diff --git a/bin/el/src/dashboard.html b/bin/el/src/dashboard.html new file mode 100644 index 0000000..95b1b95 --- /dev/null +++ b/bin/el/src/dashboard.html @@ -0,0 +1,1914 @@ + + + + + +Neuron Code + + + + + +
+ + +
+ +
+
Connecting to event stream…
+
+ + + +
+
+ +
+ + + + + +
+ + + +
+ + + + + + + + + + + +

Hello. I'm Neuron.

+

Your AI-native development partner. Tell me where your code lives and I'll start understanding it.

+ + +
+ + +
+ + +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
Neuron
+
+ + +
+ Voice +
+ + + + +
+ +
+ + + 1.0 +
+
+ + + 0.95 +
+
+ + + 1.0 +
+ + +
+
Memory:
+
+ + +
+
+
+ + + +
+
+
+
+ + +
+
+

Repositories

+ +
+
+ +
+ +
+
+ + +
+
+

Issues

+
+ + +
+ +
+
+
+
+ +
+ + +
+
+

Pull Requests

+ +
+
+
+ + +
+
+

Pipeline

+ +
+
+
+ + +
+
+ +
History
+
+
+
+ + +
+
+

Files

+ +
+ +
+
+
+
+
+
+
+
+
+ + +
+
+

Search

+
+
+
+ +
+ + + +
+ +
+
+
+
+ + +
+
+

Wiki

+ +
+
+
+
+
Select a page to read it.
+
+
+
+ + +
+
+

Security Scan

+
+ + +
+
+
Click Scan to run a security analysis on the active repo.
+
+
+ + +
+
+

Live Events

+ 0 events +
+
+
+ + +
+
+

Insights

+ +
+
+
Select an active repo and click Refresh.
+
+
+ +
+
+
+
+ + +
+
+

⚙ Settings

+
+ + +
+
+ +
+
+
+
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + 🔇 Whisper +
+ + +
+
+ + +
+ + + + diff --git a/bin/el/src/main.rs b/bin/el/src/main.rs index 7132427..444091f 100644 --- a/bin/el/src/main.rs +++ b/bin/el/src/main.rs @@ -35,6 +35,8 @@ use el_compiler::{Compiler, CompilerOptions, Target}; use el_test; use el_manifest::{BuildTarget, Manifest}; use el_seal::{seal as seal_fn, unseal as unseal_fn, SealedArtifact, DeploymentBinding, SealAlgorithm, SealConfig}; +use el_fmt; +use el_lint; // ── Global state (thread-local for simplicity) ──────────────────────────────── @@ -172,12 +174,30 @@ enum Command { manifest: Option, }, - /// Format source files. + /// Format an engram-lang source file (or all files in a project). Fmt { + /// Single source file to format (*.el). When omitted, formats the whole project. + file: Option, + /// Overwrite the file in place with canonical formatting. + #[arg(long)] + in_place: bool, + /// Exit 1 if the file is not in canonical format (useful in CI). Does not modify the file. + #[arg(long)] + check: bool, + /// Project manifest (used when no `file` is given). #[arg(long)] manifest: Option, }, + /// Lint an engram-lang source file. + Lint { + /// Source file to lint (*.el). + file: PathBuf, + /// Emit diagnostics as JSON instead of human-readable text. + #[arg(long)] + json: bool, + }, + /// Remove build artifacts and cache. Clean { #[arg(long)] @@ -396,10 +416,48 @@ async fn run(cli: Cli) -> Result<(), Box> { } } - Command::Fmt { manifest } => { - let manifest_path = resolve_manifest(manifest.as_deref())?; - let bs = BuildSystem::from_manifest_file(&manifest_path)?; - bs.fmt()?; + Command::Fmt { file, in_place, check, manifest } => { + if let Some(path) = file { + // Single-file mode + let source = std::fs::read_to_string(&path) + .map_err(|e| format!("cannot read {}: {e}", path.display()))?; + let formatted = el_fmt::format(&source) + .map_err(|e| format!("fmt error: {e}"))?; + if check { + if formatted != source { + eprintln!("error: {} is not in canonical format", path.display()); + std::process::exit(1); + } + println!("ok: {} is already formatted", path.display()); + } else if in_place { + std::fs::write(&path, &formatted) + .map_err(|e| format!("cannot write {}: {e}", path.display()))?; + println!("formatted: {}", path.display()); + } else { + print!("{formatted}"); + } + } else { + // Project mode — fall back to build system's fmt + let manifest_path = resolve_manifest(manifest.as_deref())?; + let bs = BuildSystem::from_manifest_file(&manifest_path)?; + bs.fmt()?; + } + } + + Command::Lint { file, json } => { + let source = std::fs::read_to_string(&file) + .map_err(|e| format!("cannot read {}: {e}", file.display()))?; + let mut report = el_lint::lint(&source) + .map_err(|e| format!("lint error: {e}"))?; + report.file_path = Some(file.display().to_string()); + if json { + println!("{}", report.to_json()); + } else { + print!("{}", report.display()); + } + if report.has_errors() { + std::process::exit(1); + } } Command::Clean { manifest } => { @@ -1577,6 +1635,7 @@ fn dispatch_builtin( let result = reqwest::blocking::Client::new() .post(&url) .header("Content-Type", "application/json") + .header("X-NC-CLI", "true") .body(body) .send() .and_then(|r| r.text())