@aragon-agent/cli 0.6.39 → 0.6.40

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 (69) hide show
  1. package/CHANGELOG.md +2589 -2523
  2. package/README.md +3706 -3614
  3. package/dist/agent/controller.d.ts +103 -9
  4. package/dist/agent/controller.js +196 -19
  5. package/dist/agent/model-profile-settings.js +12 -1
  6. package/dist/agent/plan-prompt.d.ts +1 -3
  7. package/dist/agent/plan-prompt.js +13 -7
  8. package/dist/agent/reducer.d.ts +29 -1
  9. package/dist/agent/reducer.js +34 -6
  10. package/dist/agent/skill-triage-prompt.d.ts +42 -0
  11. package/dist/agent/skill-triage-prompt.js +74 -0
  12. package/dist/agent/system-prompt.d.ts +14 -2
  13. package/dist/agent/system-prompt.js +7 -4
  14. package/dist/cli.js +21 -5
  15. package/dist/commands/builtins.js +12 -3
  16. package/dist/commands/skills.js +86 -1
  17. package/dist/commands/subagent-command.d.ts +25 -0
  18. package/dist/commands/subagent-command.js +242 -0
  19. package/dist/compaction/command.js +16 -3
  20. package/dist/compaction/compactor.d.ts +25 -0
  21. package/dist/compaction/compactor.js +111 -10
  22. package/dist/compaction/digest.d.ts +24 -1
  23. package/dist/compaction/digest.js +139 -17
  24. package/dist/compaction/limits.d.ts +21 -0
  25. package/dist/compaction/limits.js +21 -0
  26. package/dist/compaction/reason-text.d.ts +36 -0
  27. package/dist/compaction/reason-text.js +78 -0
  28. package/dist/compaction/types.d.ts +82 -14
  29. package/dist/compaction/wiring.d.ts +13 -8
  30. package/dist/compaction/wiring.js +1 -0
  31. package/dist/config/load.js +50 -3
  32. package/dist/config/schema.d.ts +82 -6
  33. package/dist/config/schema.js +107 -9
  34. package/dist/config/store.js +7 -2
  35. package/dist/proc/log-mirror.d.ts +21 -4
  36. package/dist/proc/log-mirror.js +29 -7
  37. package/dist/skills/service.d.ts +41 -0
  38. package/dist/skills/service.js +62 -0
  39. package/dist/skills/triage.d.ts +194 -0
  40. package/dist/skills/triage.js +393 -0
  41. package/dist/team/forced-dispatch.d.ts +95 -0
  42. package/dist/team/forced-dispatch.js +208 -0
  43. package/dist/team/limits.d.ts +21 -1
  44. package/dist/team/limits.js +21 -1
  45. package/dist/team/normalize.d.ts +15 -0
  46. package/dist/team/normalize.js +21 -4
  47. package/dist/team/prompt.d.ts +6 -3
  48. package/dist/team/prompt.js +9 -5
  49. package/dist/team/task-tool.js +11 -7
  50. package/dist/tools/human-input.d.ts +35 -2
  51. package/dist/tools/human-input.js +38 -0
  52. package/dist/tools/plan-tools.d.ts +20 -12
  53. package/dist/tools/plan-tools.js +24 -17
  54. package/dist/ui/App.js +14 -1
  55. package/dist/ui/StatusBar.d.ts +1 -0
  56. package/dist/ui/StatusBar.js +1 -0
  57. package/dist/ui/Transcript.js +1 -1
  58. package/dist/ui/entries/CompactionCard.d.ts +11 -1
  59. package/dist/ui/entries/CompactionCard.js +65 -4
  60. package/dist/ui/layout/status-layout.d.ts +10 -0
  61. package/dist/ui/layout/status-layout.js +18 -1
  62. package/dist/ui/overlays/SettingsScreen.js +29 -5
  63. package/dist/ui/overlays/TeamFanoutPage.d.ts +35 -0
  64. package/dist/ui/overlays/TeamFanoutPage.js +78 -0
  65. package/dist/ui/overlays/model-profile-state.d.ts +19 -1
  66. package/dist/ui/overlays/model-profile-state.js +12 -0
  67. package/dist/ui/overlays/team-fanout-state.d.ts +73 -0
  68. package/dist/ui/overlays/team-fanout-state.js +97 -0
  69. package/package.json +2 -2
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Settings > Team fan-out: the pure half of the page (subagent-fanout 3.4.2).
3
+ *
4
+ * ASCII ONLY - `src/ui/**` is inside `glyphs.test.ts::inScope`.
5
+ *
6
+ * THE PAGE WRITES THREE KEYS AND CANNOT BE MADE TO WRITE A FOURTH (D-17 /
7
+ * R-P0-1). `TeamFanoutPatch` is `Pick<TeamConfig, 'maxSubagents' |
8
+ * 'maxConcurrent' | 'overseer'>`, and `stepFanoutValue` returns
9
+ * `Partial<TeamFanoutPatch>`: a width adjustment therefore CANNOT carry `model`
10
+ * or `modelProfileId` into `draft.patch.team`. That matters because
11
+ * `releasedSlots` reads those two keys as "the user re-decided the subagent
12
+ * slot", so a page that returned the whole section would silently release the
13
+ * model a session kit had just installed - and no test would notice, because
14
+ * every value on screen would still be right.
15
+ *
16
+ * EVERYTHING HERE IS A PURE FUNCTION over the draft. The page owns exactly one
17
+ * piece of state (its cursor); values come from the reducer, which is the same
18
+ * discipline the rest of this screen follows.
19
+ */
20
+ import type { TeamConfig } from '../../config/schema.js';
21
+ import type { ModelSettingsDraft } from '../../config/model-profile-store.js';
22
+ export type TeamFanoutField = 'maxSubagents' | 'maxConcurrent' | 'overseer';
23
+ /**
24
+ * THE ONLY KEYS THIS PAGE MAY WRITE (R-P0-1).
25
+ *
26
+ * Not `Partial<TeamConfig>`: a fragment that could carry `model` would make a
27
+ * width adjustment read as a model decision at save time.
28
+ */
29
+ export type TeamFanoutPatch = Pick<TeamConfig, 'maxSubagents' | 'maxConcurrent' | 'overseer'>;
30
+ export interface TeamFanoutRow {
31
+ field: TeamFanoutField;
32
+ label: string;
33
+ /** The value as the page prints it (`'8'` / `'on'`). */
34
+ value: string;
35
+ /** One line, <= 60 columns: WHY this number, not a restatement of the label. */
36
+ hint: string;
37
+ }
38
+ export interface TeamFanoutView {
39
+ /** Exactly three, in the fixed order the cursor indexes. */
40
+ rows: TeamFanoutRow[];
41
+ error?: string;
42
+ }
43
+ /**
44
+ * The CLAMPED team section this draft would save (R-P0-2), for display only.
45
+ *
46
+ * THE CLAMP IS NOT COSMETIC. Without it a patch carrying only
47
+ * `maxSubagents: 6` renders "6 per dispatch, 8 at once" on top of an 8-wide
48
+ * baseline, while `mergePersistedConfig` clamps the same patch to 6/6 on the way
49
+ * to disk - so the screen and the file disagree, and every arrow key makes the
50
+ * user reconcile them by hand.
51
+ */
52
+ export declare function teamFanoutValues(draft: ModelSettingsDraft): TeamConfig;
53
+ /**
54
+ * The PATCH FRAGMENT for one arrow press, clamped exactly like `clampTeamConfig`.
55
+ *
56
+ * `current` must be the value the screen actually shows (`teamFanoutValues`), so
57
+ * a step always starts from a number the user can see.
58
+ *
59
+ * NO WRAPAROUND: a form control is not a ring, and `Left` at 1 jumping to 10
60
+ * would be a way to widen a dispatch while trying to narrow it.
61
+ */
62
+ export declare function stepFanoutValue(current: TeamConfig, field: TeamFanoutField, delta: -1 | 1): Partial<TeamFanoutPatch>;
63
+ /**
64
+ * The page's three rows.
65
+ *
66
+ * TWO HINTS CARRY A CONDITION THE DESIGN OWNS RATHER THAN DECORATION (R-1 / C-2):
67
+ * the default pool is now 8, which is 8 simultaneous streams against one API key,
68
+ * and the honest mitigation for an HTTP 429 storm is "lower this number" - said
69
+ * HERE, where the number is, not only in a risk table nobody reads.
70
+ */
71
+ export declare function fanoutRows(team: TeamConfig): TeamFanoutRow[];
72
+ /** The one-line summary the settings root row prints for this page. */
73
+ export declare function fanoutSummary(team: TeamConfig): string;
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Settings > Team fan-out: the pure half of the page (subagent-fanout 3.4.2).
3
+ *
4
+ * ASCII ONLY - `src/ui/**` is inside `glyphs.test.ts::inScope`.
5
+ *
6
+ * THE PAGE WRITES THREE KEYS AND CANNOT BE MADE TO WRITE A FOURTH (D-17 /
7
+ * R-P0-1). `TeamFanoutPatch` is `Pick<TeamConfig, 'maxSubagents' |
8
+ * 'maxConcurrent' | 'overseer'>`, and `stepFanoutValue` returns
9
+ * `Partial<TeamFanoutPatch>`: a width adjustment therefore CANNOT carry `model`
10
+ * or `modelProfileId` into `draft.patch.team`. That matters because
11
+ * `releasedSlots` reads those two keys as "the user re-decided the subagent
12
+ * slot", so a page that returned the whole section would silently release the
13
+ * model a session kit had just installed - and no test would notice, because
14
+ * every value on screen would still be right.
15
+ *
16
+ * EVERYTHING HERE IS A PURE FUNCTION over the draft. The page owns exactly one
17
+ * piece of state (its cursor); values come from the reducer, which is the same
18
+ * discipline the rest of this screen follows.
19
+ */
20
+ import { clampTeamConfig, HARD_MAX_SUBAGENTS } from '../../config/schema.js';
21
+ function clampInt(value, min, max) {
22
+ return Math.max(min, Math.min(max, Math.floor(value)));
23
+ }
24
+ /**
25
+ * The CLAMPED team section this draft would save (R-P0-2), for display only.
26
+ *
27
+ * THE CLAMP IS NOT COSMETIC. Without it a patch carrying only
28
+ * `maxSubagents: 6` renders "6 per dispatch, 8 at once" on top of an 8-wide
29
+ * baseline, while `mergePersistedConfig` clamps the same patch to 6/6 on the way
30
+ * to disk - so the screen and the file disagree, and every arrow key makes the
31
+ * user reconcile them by hand.
32
+ */
33
+ export function teamFanoutValues(draft) {
34
+ return clampTeamConfig({ ...draft.baseline.team, ...draft.patch.team });
35
+ }
36
+ /**
37
+ * The PATCH FRAGMENT for one arrow press, clamped exactly like `clampTeamConfig`.
38
+ *
39
+ * `current` must be the value the screen actually shows (`teamFanoutValues`), so
40
+ * a step always starts from a number the user can see.
41
+ *
42
+ * NO WRAPAROUND: a form control is not a ring, and `Left` at 1 jumping to 10
43
+ * would be a way to widen a dispatch while trying to narrow it.
44
+ */
45
+ export function stepFanoutValue(current, field, delta) {
46
+ if (field === 'overseer') {
47
+ // Both arrows toggle: `Supervisor` has two states, so a direction has no
48
+ // meaning beyond "the user pressed an arrow".
49
+ return { overseer: !current.overseer };
50
+ }
51
+ if (field === 'maxConcurrent') {
52
+ const ceiling = Math.min(HARD_MAX_SUBAGENTS, current.maxSubagents);
53
+ return { maxConcurrent: clampInt(current.maxConcurrent + delta, 1, ceiling) };
54
+ }
55
+ const next = clampInt(current.maxSubagents + delta, 1, HARD_MAX_SUBAGENTS);
56
+ // THE FOLLOW-DOWN IS WRITTEN INTO THE PATCH (R-P1-9), not just rendered: a
57
+ // narrower population cannot keep a wider pool, but a DISPLAY-only correction
58
+ // would snap back the moment the user widened again, so "the change I just
59
+ // made" would not stick - the exact complaint this design exists to answer.
60
+ return current.maxConcurrent > next
61
+ ? { maxSubagents: next, maxConcurrent: next }
62
+ : { maxSubagents: next };
63
+ }
64
+ /**
65
+ * The page's three rows.
66
+ *
67
+ * TWO HINTS CARRY A CONDITION THE DESIGN OWNS RATHER THAN DECORATION (R-1 / C-2):
68
+ * the default pool is now 8, which is 8 simultaneous streams against one API key,
69
+ * and the honest mitigation for an HTTP 429 storm is "lower this number" - said
70
+ * HERE, where the number is, not only in a risk table nobody reads.
71
+ */
72
+ export function fanoutRows(team) {
73
+ return [
74
+ {
75
+ field: 'maxSubagents',
76
+ label: 'Max subagents',
77
+ value: String(team.maxSubagents),
78
+ hint: `children per dispatch; ${HARD_MAX_SUBAGENTS} is the hard ceiling`,
79
+ },
80
+ {
81
+ field: 'maxConcurrent',
82
+ label: 'Run at once',
83
+ value: String(team.maxConcurrent),
84
+ hint: 'provider limits: lower this if you see rate-limit errors',
85
+ },
86
+ {
87
+ field: 'overseer',
88
+ label: 'Supervisor',
89
+ value: team.overseer ? 'on' : 'off',
90
+ hint: 'checks stalled children; never kills them',
91
+ },
92
+ ];
93
+ }
94
+ /** The one-line summary the settings root row prints for this page. */
95
+ export function fanoutSummary(team) {
96
+ return `${team.maxSubagents} per dispatch, ${team.maxConcurrent} at once`;
97
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aragon-agent/cli",
3
- "version": "0.6.39",
3
+ "version": "0.6.40",
4
4
  "description": "AragonAgent CLI — a Claude-Code / Codex-style interactive terminal UI (TUI) on top of the @aragon-agent/core engine. Installable and runnable via npm / npx.",
5
5
  "license": "MIT",
6
6
  "author": "AragonAgent contributors",
@@ -56,7 +56,7 @@
56
56
  "prepublishOnly": "npm run build"
57
57
  },
58
58
  "dependencies": {
59
- "@aragon-agent/core": "^0.2.51",
59
+ "@aragon-agent/core": "^0.2.52",
60
60
  "chalk": "^5.6.2",
61
61
  "cli-highlight": "^2.0.0",
62
62
  "commander": "^12.1.0",