@nyxa/nyx-agent 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +58 -9
  2. package/dist/cli.js +13 -16
  3. package/dist/commands/init.js +112 -462
  4. package/dist/commands/run.js +17 -3
  5. package/dist/commands/update.js +1 -0
  6. package/dist/config/loadConfig.js +17 -3
  7. package/dist/config/schema.js +29 -146
  8. package/dist/runtime/files.js +1 -0
  9. package/dist/runtime/git.js +1 -0
  10. package/dist/runtime/gitLifecycle.js +19 -57
  11. package/dist/runtime/harness.js +26 -0
  12. package/dist/runtime/ledger.js +1 -0
  13. package/dist/runtime/paths.js +1 -12
  14. package/dist/runtime/prompts.js +103 -0
  15. package/dist/runtime/runPhase.js +85 -254
  16. package/dist/runtime/runPipeline.js +479 -0
  17. package/dist/runtime/schemas.js +52 -0
  18. package/dist/runtime/scm.js +80 -0
  19. package/dist/runtime/time.js +1 -0
  20. package/dist/runtime/validateResult.js +2 -3
  21. package/dist/runtime/workItems.js +43 -118
  22. package/package.json +2 -5
  23. package/dist/runtime/buildPrompt.js +0 -54
  24. package/dist/runtime/effectiveConfig.js +0 -14
  25. package/dist/runtime/renderTemplate.js +0 -28
  26. package/dist/runtime/runWorkflow.js +0 -680
  27. package/dist/runtime/validateWorkItem.js +0 -212
  28. package/dist/runtime/workItemAnnotations.js +0 -39
  29. package/docs/nyxagent-v0-spec.md +0 -742
  30. package/templates/default/prompts/closure.md +0 -30
  31. package/templates/default/prompts/execution.md +0 -11
  32. package/templates/default/prompts/finalize.md +0 -7
  33. package/templates/default/prompts/global-review.md +0 -24
  34. package/templates/default/prompts/global-revision.md +0 -9
  35. package/templates/default/prompts/pull-request.md +0 -23
  36. package/templates/default/prompts/repair-result.md +0 -29
  37. package/templates/default/prompts/review.md +0 -18
  38. package/templates/default/prompts/revision.md +0 -7
  39. package/templates/default/prompts/selection.md +0 -46
  40. package/templates/default/schemas/closure.schema.json +0 -35
  41. package/templates/default/schemas/global-review.schema.json +0 -60
  42. package/templates/default/schemas/pull-request.schema.json +0 -44
  43. package/templates/default/schemas/review.schema.json +0 -60
  44. package/templates/default/schemas/selection.schema.json +0 -135
package/README.md CHANGED
@@ -1,16 +1,65 @@
1
1
  # NyxAgent
2
2
 
3
- NyxAgent is a small TypeScript CLI that runs coding-agent phases with fresh
4
- context for each phase.
3
+ NyxAgent is a small TypeScript CLI that runs a fixed coding-agent pipeline, one
4
+ GitHub issue at a time, each phase with fresh context.
5
5
 
6
- Current commands:
6
+ ## Pipeline
7
+
8
+ For every run NyxAgent:
9
+
10
+ 1. **Selects** open GitHub issues to work on (read-only).
11
+ 2. For each selected issue, in an isolated git **worktree**:
12
+ - **implements** it (the agent — the only customizable prompt),
13
+ - optionally **reviews** and **revises** it (bounded loop),
14
+ - **commits** the change (the engine, deterministically).
15
+ 3. Optionally runs a **global review** across the whole run.
16
+ 4. **Pushes** the run branch and **opens one pull request** (the engine).
17
+
18
+ The agent only implements, reviews, and revises. Every git/gh side effect —
19
+ commit, push, pull request — is performed by the engine, so closing the loop
20
+ never depends on the model. Issues are closed by GitHub when the PR merges
21
+ (`Closes #n` in the PR body); the human merges the PR.
22
+
23
+ The workflow shape is fixed (not configurable). Only `.nyxagent/prompts/execution.md`
24
+ is editable.
25
+
26
+ ## Commands
7
27
 
8
28
  ```bash
9
- nyxagent init
10
- nyxagent init --missing
11
- nyxagent run
12
- nyxagent update
29
+ nyxagent init # create .nyxagent/config.json (interactive)
30
+ nyxagent run # run the pipeline
31
+ nyxagent run --harness claude # override the configured harness for one run
32
+ nyxagent update # self-update to the latest published version
33
+ ```
34
+
35
+ ## Configuration
36
+
37
+ `nyxagent init` writes `.nyxagent/config.json`:
38
+
39
+ ```json
40
+ {
41
+ "harness": "codex",
42
+ "model": "gpt-5.5",
43
+ "reasoning_effort": "medium",
44
+ "review": "each",
45
+ "review_max_attempts": 4,
46
+ "tracker": { "type": "github", "repo": "owner/repo" },
47
+ "base_branch": "main",
48
+ "max_iterations": 5
49
+ }
13
50
  ```
14
51
 
15
- See [docs/nyxagent-v0-spec.md](docs/nyxagent-v0-spec.md) for the v0 design.
16
- # nyxagent
52
+ - `harness`: `codex` or `claude` (override per run with `--harness`).
53
+ - `review`: `each` (per task), `all` (global only), `both`, or `none`.
54
+ - `review_max_attempts`: review+revise rounds per stage before the run fails (default 4).
55
+ - `base_branch`: optional; defaults to the current branch at run time.
56
+
57
+ If a run fails review after exhausting its attempts but has already produced
58
+ commits, NyxAgent pushes the branch and opens a **draft** pull request with the
59
+ unresolved feedback, so the work is never stranded on an orphaned branch.
60
+
61
+ ## Requirements
62
+
63
+ - A git repository with a GitHub remote.
64
+ - The `gh` CLI authenticated for the configured repository.
65
+ - The selected harness CLI (`codex` or `claude`) on `PATH`.
package/dist/cli.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ /** CLI entry point: declares the `init`, `run`, and `update` commands and dispatches them. */
2
3
  import { Command } from "commander";
3
4
  import { createRequire } from "node:module";
4
5
  import pc from "picocolors";
@@ -10,32 +11,28 @@ const packageJson = require("../package.json");
10
11
  const program = new Command();
11
12
  program
12
13
  .name("nyxagent")
13
- .description("Run coding-agent workflows with fresh context per phase.")
14
+ .description("Run a fixed coding-agent pipeline with fresh context per phase.")
14
15
  .version(packageJson.version);
15
16
  program
16
17
  .command("init")
17
- .description("Create a .nyxagent project configuration")
18
- .option("--missing", "only add missing template files")
19
- .option("--harness <preset>", "harness preset: codex, claude, or custom")
18
+ .description("Create a .nyxagent/config.json project configuration")
19
+ .option("--harness <name>", "default harness: codex or claude")
20
20
  .option("--model <name>", "model name")
21
- .option("--reasoning-level <level>", "default harness-neutral reasoning level")
21
+ .option("--reasoning-effort <level>", "reasoning effort (default: medium)")
22
+ .option("--review <mode>", "review strategy: each, all, both, or none")
23
+ .option("--review-attempts <count>", "max review attempts per stage (default: 4)")
24
+ .option("--repo <owner/repo>", "GitHub repository")
25
+ .option("--base-branch <branch>", "base branch (default: current branch)")
22
26
  .option("--max-iterations <count>", "maximum work items per run")
23
- .option("--work-items-source <source>", "work item source template: local or github")
24
- .option("--work-items-path <path>", "local markdown work item directory")
25
- .option("--work-items-repository <owner/repo>", "GitHub work item repository")
26
- .option("--implementation-skill <name>", "implementation skill to reference in the execution prompt")
27
- .option("--review", "include a review phase (alias for --review-mode each)")
28
- .option("--no-review", "skip the review phase (alias for --review-mode none)")
29
- .option("--review-mode <mode>", "review strategy: each, all, both, or none")
30
- .option("--pull-request", "close the PRD with a pull request (GitHub work items)")
31
- .option("--no-pull-request", "skip the pull request finalization phase")
27
+ .option("--force", "overwrite an existing config")
32
28
  .action(async (options) => {
33
29
  await initCommand(options);
34
30
  });
35
31
  program
36
32
  .command("run")
37
- .description("Run the configured NyxAgent workflow")
38
- .option("--config <path>", "config path, defaults to .nyxagent/config.toml")
33
+ .description("Run the NyxAgent pipeline")
34
+ .option("--config <path>", "config path (default: .nyxagent/config.json)")
35
+ .option("--harness <name>", "override the configured harness: codex or claude")
39
36
  .action(async (options) => {
40
37
  await runCommand(options);
41
38
  });