@aragon-agent/cli 0.6.57 → 0.6.61
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.
- package/CHANGELOG.md +71 -0
- package/README.md +159 -3
- package/dist/agent/controller.d.ts +112 -1
- package/dist/agent/controller.js +350 -7
- package/dist/agent/project-guidance-prompt.js +97 -97
- package/dist/agent/redteam-prompt.d.ts +29 -11
- package/dist/agent/redteam-prompt.js +118 -103
- package/dist/agent/redteam-wiring.d.ts +117 -2
- package/dist/agent/redteam-wiring.js +204 -1
- package/dist/agent/team-notices.d.ts +68 -0
- package/dist/agent/team-notices.js +82 -0
- package/dist/app/App.js +208 -5
- package/dist/app/use-redteam-mode.d.ts +1 -1
- package/dist/app/use-redteam-mode.js +14 -1
- package/dist/cli.js +13 -0
- package/dist/commands/catalog.js +6 -2
- package/dist/commands/redteam-command.d.ts +14 -8
- package/dist/commands/redteam-command.js +243 -12
- package/dist/commands/team-command.js +93 -2
- package/dist/config/app-paths.d.ts +19 -0
- package/dist/config/app-paths.js +23 -0
- package/dist/config/load.d.ts +8 -0
- package/dist/gene/catalog-sync.js +37 -16
- package/dist/gene/curator/budget.js +1 -1
- package/dist/gene/curator/curator.d.ts +6 -0
- package/dist/gene/curator/curator.js +8 -0
- package/dist/gene/curator/task-runner.js +4 -1
- package/dist/gene/curator/tools-verify.js +17 -5
- package/dist/gene/curator/validate/evidence-tokens.js +97 -18
- package/dist/gene/curator/validate/knowledge.d.ts +5 -0
- package/dist/gene/curator/validate/knowledge.js +57 -13
- package/dist/gene/curator/validate/types.d.ts +6 -1
- package/dist/gene/learn/learn-prompt.d.ts +10 -1
- package/dist/gene/learn/learn-prompt.js +11 -2
- package/dist/governance/engine/lifecycle.js +1 -1
- package/dist/governance/store/run-lock.d.ts +9 -2
- package/dist/governance/store/run-lock.js +91 -7
- package/dist/host/controller-factory.d.ts +13 -0
- package/dist/host/controller-factory.js +7 -0
- package/dist/host/index.d.ts +1 -0
- package/dist/host/index.js +1 -0
- package/dist/host/interaction.d.ts +19 -0
- package/dist/host/interaction.js +75 -0
- package/dist/host/team-control.d.ts +83 -0
- package/dist/host/team-control.js +55 -0
- package/dist/logging/install.d.ts +32 -1
- package/dist/logging/install.js +21 -0
- package/dist/proc/output-streams.d.ts +20 -0
- package/dist/proc/output-streams.js +20 -0
- package/dist/redteam/prompt-resolve.d.ts +61 -0
- package/dist/redteam/prompt-resolve.js +303 -0
- package/dist/redteam/prompt-store.d.ts +96 -0
- package/dist/redteam/prompt-store.js +156 -0
- package/dist/redteam/prompt-template.d.ts +22 -0
- package/dist/redteam/prompt-template.js +72 -0
- package/dist/team/bus.d.ts +18 -0
- package/dist/team/bus.js +70 -18
- package/dist/team/console-tools.d.ts +54 -0
- package/dist/team/console-tools.js +333 -0
- package/dist/team/console-view.d.ts +88 -0
- package/dist/team/console-view.js +173 -0
- package/dist/team/forced-mode.d.ts +61 -1
- package/dist/team/forced-mode.js +75 -0
- package/dist/team/normalize.d.ts +31 -0
- package/dist/team/normalize.js +49 -5
- package/dist/team/notices.d.ts +95 -0
- package/dist/team/notices.js +121 -0
- package/dist/team/pause-gate.d.ts +79 -0
- package/dist/team/pause-gate.js +127 -0
- package/dist/team/prompt.d.ts +25 -9
- package/dist/team/prompt.js +29 -29
- package/dist/team/report.js +33 -0
- package/dist/team/runtime.d.ts +270 -5
- package/dist/team/runtime.js +732 -64
- package/dist/team/settled.d.ts +5 -2
- package/dist/team/settled.js +12 -2
- package/dist/team/subagent.d.ts +7 -0
- package/dist/team/subagent.js +12 -1
- package/dist/team/task-tool.d.ts +39 -1
- package/dist/team/task-tool.js +75 -18
- package/dist/tools/bash-tool.d.ts +11 -8
- package/dist/tools/bash-tool.js +44 -9
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +30 -0
- package/package.json +3 -3
package/dist/team/settled.d.ts
CHANGED
|
@@ -36,9 +36,12 @@ import type { SubagentRun } from '@aragon-agent/tui/model/team/types';
|
|
|
36
36
|
export declare const SETTLE_STRIP_FIELDS: readonly ["activity", "activityArgs", "retry", "timeline"];
|
|
37
37
|
/**
|
|
38
38
|
* Fields that may never reach a file. `lastIntervention` joins the four above because
|
|
39
|
-
* it must live on the settled run while staying out of every persisted one
|
|
39
|
+
* it must live on the settled run while staying out of every persisted one, and
|
|
40
|
+
* team-detached-dispatch adds the four hold facts for exactly the same reason: a
|
|
41
|
+
* resumed session has no live dispatch, so a persisted `pausedAt` would describe a
|
|
42
|
+
* hold that nothing can release (I-DD9).
|
|
40
43
|
*/
|
|
41
|
-
export declare const PERSIST_STRIP_FIELDS: readonly ["activity", "activityArgs", "retry", "timeline", "lastIntervention"];
|
|
44
|
+
export declare const PERSIST_STRIP_FIELDS: readonly ["activity", "activityArgs", "retry", "timeline", "lastIntervention", "pausedAt", "pausedMs", "pauseCount", "controlBy"];
|
|
42
45
|
/**
|
|
43
46
|
* The dispatch exit: one run, without `SETTLE_STRIP_FIELDS`.
|
|
44
47
|
*
|
package/dist/team/settled.js
CHANGED
|
@@ -34,9 +34,19 @@
|
|
|
34
34
|
export const SETTLE_STRIP_FIELDS = ['activity', 'activityArgs', 'retry', 'timeline'];
|
|
35
35
|
/**
|
|
36
36
|
* Fields that may never reach a file. `lastIntervention` joins the four above because
|
|
37
|
-
* it must live on the settled run while staying out of every persisted one
|
|
37
|
+
* it must live on the settled run while staying out of every persisted one, and
|
|
38
|
+
* team-detached-dispatch adds the four hold facts for exactly the same reason: a
|
|
39
|
+
* resumed session has no live dispatch, so a persisted `pausedAt` would describe a
|
|
40
|
+
* hold that nothing can release (I-DD9).
|
|
38
41
|
*/
|
|
39
|
-
export const PERSIST_STRIP_FIELDS = [
|
|
42
|
+
export const PERSIST_STRIP_FIELDS = [
|
|
43
|
+
...SETTLE_STRIP_FIELDS,
|
|
44
|
+
'lastIntervention',
|
|
45
|
+
'pausedAt',
|
|
46
|
+
'pausedMs',
|
|
47
|
+
'pauseCount',
|
|
48
|
+
'controlBy',
|
|
49
|
+
];
|
|
40
50
|
/**
|
|
41
51
|
* Drop `fields` from one run, returning a NEW object - and the SAME object when there
|
|
42
52
|
* is nothing to drop, so a run's identity is preserved for reference equality where
|
package/dist/team/subagent.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import type { CliConfig } from '@aragon-agent/tui/model/config/schema';
|
|
|
22
22
|
import type { ToolPermission } from '../exec/permission.js';
|
|
23
23
|
import type { ChildReviewProvider } from './child-reviewer.js';
|
|
24
24
|
import { TeamBus } from './bus.js';
|
|
25
|
+
import { type PauseGate } from './pause-gate.js';
|
|
25
26
|
import type { TeamHumanQueue, WatchdogPausable } from './human-queue.js';
|
|
26
27
|
import type { OverseerVerdict, SubagentRun, SubagentSpec } from '@aragon-agent/tui/model/team/types';
|
|
27
28
|
/**
|
|
@@ -63,6 +64,12 @@ export type SubagentAgentFactory = (config: AgentConfig) => SubagentAgentLike;
|
|
|
63
64
|
export declare const defaultSubagentFactory: SubagentAgentFactory;
|
|
64
65
|
/** Everything a child needs that is the same for every child in a dispatch. */
|
|
65
66
|
export interface SubagentDeps {
|
|
67
|
+
/**
|
|
68
|
+
* The dispatch pause gate (team-detached-dispatch section 5.2.4). ABSENT means
|
|
69
|
+
* no pause support, which is what leaves every existing fixture and every
|
|
70
|
+
* non-team construction site byte-identical to the pre-feature build.
|
|
71
|
+
*/
|
|
72
|
+
pauseGate?: PauseGate;
|
|
66
73
|
bus: TeamBus;
|
|
67
74
|
config: CliConfig;
|
|
68
75
|
providerRegistry: ProviderRegistry;
|
package/dist/team/subagent.js
CHANGED
|
@@ -26,6 +26,7 @@ import { isRetryableStreamError } from './retry.js';
|
|
|
26
26
|
import { accumulateUsage } from '../fast/review-call.js';
|
|
27
27
|
import { resolveSubagentKey, resolveSubagentModel } from '@aragon-agent/tui/model/team/model';
|
|
28
28
|
import { makeTeamSend, makeTeamWait, withMailboxTail } from './comm-tools.js';
|
|
29
|
+
import { withPauseGate } from './pause-gate.js';
|
|
29
30
|
import { buildSubagentBlock } from './prompt.js';
|
|
30
31
|
/** The default factory: a real `Agent` from `@aragon-agent/core`. */
|
|
31
32
|
export const defaultSubagentFactory = (config) => new Agent(config);
|
|
@@ -225,7 +226,17 @@ getModel) {
|
|
|
225
226
|
// Mail rides on the NEXT tool result of whatever the child does next (D-4), so
|
|
226
227
|
// every tool it can call has to carry the tail — the comm tools included, or a
|
|
227
228
|
// child that only ever messages would never receive.
|
|
228
|
-
|
|
229
|
+
//
|
|
230
|
+
// THE PAUSE GATE WRAPS *OUTSIDE* THE TAIL (team-detached-dispatch spec REV-12):
|
|
231
|
+
// a held child must not be handed a mailbox tail, because that would be a
|
|
232
|
+
// delivery to an agent that is not running, and the existing wrapper order
|
|
233
|
+
// (`withToolPolicy` -> `withPlanModeGate` -> `withMailboxTail`) stays as it was
|
|
234
|
+
// designed. Absent gate = the exact pre-feature array.
|
|
235
|
+
const gate = deps.pauseGate;
|
|
236
|
+
const finished = tools.map((t) => {
|
|
237
|
+
const withTail = withMailboxTail(t, deps.bus, spec.label);
|
|
238
|
+
return gate ? withPauseGate(withTail, gate, spec.label) : withTail;
|
|
239
|
+
});
|
|
229
240
|
finalTools.current = finished;
|
|
230
241
|
return finished;
|
|
231
242
|
}
|
package/dist/team/task-tool.d.ts
CHANGED
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
import { type AgentTool } from '@aragon-agent/core';
|
|
32
32
|
import type { ModelCost } from '@aragon-agent/core';
|
|
33
33
|
import type { SubagentModelResolution } from '@aragon-agent/tui/model/team/model';
|
|
34
|
-
import type
|
|
34
|
+
import { type ReportOptions } from './report.js';
|
|
35
|
+
import type { DispatchHandle, TeamRuntime } from './runtime.js';
|
|
35
36
|
export interface TaskToolDeps {
|
|
36
37
|
runtime: TeamRuntime;
|
|
37
38
|
/** Read LIVE, never cached: `/team off` flips this, it does not unregister. */
|
|
@@ -75,5 +76,42 @@ export interface TaskToolDeps {
|
|
|
75
76
|
* on stderr and no other explanation.
|
|
76
77
|
*/
|
|
77
78
|
withPausedWatchdog: <T>(fn: () => Promise<T>) => Promise<T>;
|
|
79
|
+
/**
|
|
80
|
+
* Whether this session lets a dispatch outlive the tool call that started it
|
|
81
|
+
* (team-detached-dispatch section 5.1.3).
|
|
82
|
+
*
|
|
83
|
+
* `true` for the TUI and the desktop host, `false` for `-p` / `exec`, which keep
|
|
84
|
+
* the blocking behaviour and therefore the machine contract. Read at CALL time,
|
|
85
|
+
* so a mid-session `/team` settings change reaches the next dispatch.
|
|
86
|
+
*/
|
|
87
|
+
detach?: () => boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The price and model closures for the report, handed to the runtime (REV-05).
|
|
90
|
+
*
|
|
91
|
+
* In detach mode the runtime calls `buildDispatchReport` at settlement, because
|
|
92
|
+
* there is no `await` here to hang it off. In await mode this tool still builds
|
|
93
|
+
* the report itself - byte for byte what it always did - and passing the same
|
|
94
|
+
* closure twice is how the two paths price a dispatch identically.
|
|
95
|
+
*/
|
|
96
|
+
reportOptions?: () => ReportOptions;
|
|
78
97
|
}
|
|
79
98
|
export declare function createTaskTool(deps: TaskToolDeps): AgentTool;
|
|
99
|
+
/**
|
|
100
|
+
* The `task` result in detach mode: A CONTRACT, NOT A MESSAGE.
|
|
101
|
+
*
|
|
102
|
+
* The model can only read text, so the wording carries the whole protocol: the
|
|
103
|
+
* first sentence denies that the work is finished (the old tool answered with a
|
|
104
|
+
* report, and a model trained on that will otherwise announce success), the second
|
|
105
|
+
* says who delivers the report, the third says what the lead may do RIGHT NOW, and
|
|
106
|
+
* the rest is a one-line cheat sheet for each control tool.
|
|
107
|
+
*
|
|
108
|
+
* WHY THE TOOL DESCRIPTION IS NOT CHANGED TO MATCH (spec REV-06): the tool array
|
|
109
|
+
* is frozen at construction (D-17) while `team.detachDispatch` is read per call,
|
|
110
|
+
* so a description mentioning this mode could not be switched off - and I-DD8
|
|
111
|
+
* requires the prompt and tool array to be byte-identical when the key is false.
|
|
112
|
+
* The description therefore keeps its original shapes-only wording, and the
|
|
113
|
+
* detach contract lives here plus in `<team_mode>`.
|
|
114
|
+
*/
|
|
115
|
+
export declare function describeDispatchStarted(handle: DispatchHandle, options?: {
|
|
116
|
+
truncatedFrom?: number;
|
|
117
|
+
}): string;
|
package/dist/team/task-tool.js
CHANGED
|
@@ -29,10 +29,12 @@
|
|
|
29
29
|
* (compaction summaries, per-child reviews).
|
|
30
30
|
*/
|
|
31
31
|
import { errorResult, textResult } from '@aragon-agent/core';
|
|
32
|
-
import { TEAM_LIMITS } from '@aragon-agent/tui/model/team/limits';
|
|
32
|
+
import { TEAM_CONSOLE_TOOL_NAMES, TEAM_LIMITS } from '@aragon-agent/tui/model/team/limits';
|
|
33
33
|
import { normalizeSubagentSpecs } from './normalize.js';
|
|
34
34
|
import { buildDispatchReport } from './report.js';
|
|
35
|
-
const BUSY_REFUSAL = 'A team dispatch is already running.
|
|
35
|
+
const BUSY_REFUSAL = 'A team dispatch is already running. Answer the user if they asked something, and use ' +
|
|
36
|
+
'team_status / team_message / team_pause / team_stop / team_spawn (or team_collect to wait ' +
|
|
37
|
+
'for the report). Do not start a second dispatch.';
|
|
36
38
|
const TEAM_OFF_REFUSAL = 'Team mode is off for this session. Do this work yourself, in order.';
|
|
37
39
|
/**
|
|
38
40
|
* The model-facing description. Deliberately close to Claude Code's `Task` tool
|
|
@@ -121,23 +123,78 @@ export function createTaskTool(deps) {
|
|
|
121
123
|
if (specs.length === 0) {
|
|
122
124
|
return errorResult('No usable subagent specs: each needs a description and a prompt.');
|
|
123
125
|
}
|
|
124
|
-
// 5.
|
|
125
|
-
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
126
|
+
// 5. DETACHED OR BLOCKING - the branch is here, not baked in (spec 5.1.2).
|
|
127
|
+
// `-p`, `exec` and governance keep the old path; the interactive hosts
|
|
128
|
+
// hand the dispatch to the runtime and return immediately.
|
|
129
|
+
if (deps.detach?.() !== true) {
|
|
130
|
+
// Pause the lead's watchdog for the whole dispatch (I-3). Not needed in
|
|
131
|
+
// detach mode: the lead is not blocked inside a tool call, so the idle
|
|
132
|
+
// watchdog has no window to fire into.
|
|
133
|
+
const outcome = await deps.withPausedWatchdog(() => deps.runtime.dispatch(specs, requested, ctx.signal));
|
|
134
|
+
// 6. ALWAYS A NON-ERROR RESULT, abort and all-children-failed included.
|
|
135
|
+
// A cancellation or a partial result rendered as a tool FAILURE invites
|
|
136
|
+
// the model to retry the whole fan-out, which is the most expensive
|
|
137
|
+
// possible reaction (the same reasoning as `ask_user`'s cancelled
|
|
138
|
+
// shape, and D-14 one level up). `modelCost` is priced at the model
|
|
139
|
+
// children ACTUALLY ran - the lead's own table under the default
|
|
140
|
+
// `main` mode - so the total stays one honest price.
|
|
141
|
+
const cost = deps.modelCost();
|
|
142
|
+
const fastCost = deps.fastModelCost?.();
|
|
143
|
+
const subagentModel = deps.subagentModel?.();
|
|
144
|
+
return textResult(buildDispatchReport(outcome, {
|
|
145
|
+
...(cost ? { cost } : {}),
|
|
146
|
+
...(fastCost ? { fastCost } : {}),
|
|
147
|
+
...(subagentModel ? { subagentModel } : {}),
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
// 5b. DETACHED. `start()` is synchronous, so this returns in milliseconds and
|
|
151
|
+
// the lead is free for the user's next message. The report is produced by
|
|
152
|
+
// the runtime at settlement and delivered as a notice plus (at most) one
|
|
153
|
+
// summary turn - which is why this text says NOT DONE yet, in its first
|
|
154
|
+
// sentence.
|
|
155
|
+
const handle = deps.runtime.start(specs, requested);
|
|
156
|
+
return textResult(describeDispatchStarted(handle, {
|
|
157
|
+
truncatedFrom: specs.length < requested ? requested : undefined,
|
|
140
158
|
}));
|
|
141
159
|
},
|
|
142
160
|
};
|
|
143
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* The `task` result in detach mode: A CONTRACT, NOT A MESSAGE.
|
|
164
|
+
*
|
|
165
|
+
* The model can only read text, so the wording carries the whole protocol: the
|
|
166
|
+
* first sentence denies that the work is finished (the old tool answered with a
|
|
167
|
+
* report, and a model trained on that will otherwise announce success), the second
|
|
168
|
+
* says who delivers the report, the third says what the lead may do RIGHT NOW, and
|
|
169
|
+
* the rest is a one-line cheat sheet for each control tool.
|
|
170
|
+
*
|
|
171
|
+
* WHY THE TOOL DESCRIPTION IS NOT CHANGED TO MATCH (spec REV-06): the tool array
|
|
172
|
+
* is frozen at construction (D-17) while `team.detachDispatch` is read per call,
|
|
173
|
+
* so a description mentioning this mode could not be switched off - and I-DD8
|
|
174
|
+
* requires the prompt and tool array to be byte-identical when the key is false.
|
|
175
|
+
* The description therefore keeps its original shapes-only wording, and the
|
|
176
|
+
* detach contract lives here plus in `<team_mode>`.
|
|
177
|
+
*/
|
|
178
|
+
export function describeDispatchStarted(handle, options = {}) {
|
|
179
|
+
const who = handle.labels.length > 0 ? handle.labels.join(', ') : '(none)';
|
|
180
|
+
const truncated = options.truncatedFrom !== undefined
|
|
181
|
+
? ` You asked for ${options.truncatedFrom} and ${handle.labels.length} were accepted: the ` +
|
|
182
|
+
'dispatch ceiling caps the team. Use team_spawn or a second dispatch later for the rest.'
|
|
183
|
+
: '';
|
|
184
|
+
const tools = TEAM_CONSOLE_TOOL_NAMES.join(' / ');
|
|
185
|
+
return (`Dispatch ${handle.dispatchId} STARTED, not finished. Subagents: ${who}.${truncated}\n` +
|
|
186
|
+
'The report arrives when every subagent has finished, as a notice, and you get a turn to ' +
|
|
187
|
+
'summarise it in your own words.\n' +
|
|
188
|
+
'DO NOT WAIT. You are free now: answer the user, do other work, and treat any new message ' +
|
|
189
|
+
`from them as a normal turn rather than something to queue behind the team.\n` +
|
|
190
|
+
`You control the team with: ${tools}.\n` +
|
|
191
|
+
' team_status - who is doing what, how long, and any mail they sent you.\n' +
|
|
192
|
+
' team_message - correct a child\'s direction, or tell all of them the goal changed.\n' +
|
|
193
|
+
' team_pause / team_resume - hold one child and let it continue later.\n' +
|
|
194
|
+
' team_stop - end one child, or "all" to end the dispatch.\n' +
|
|
195
|
+
' team_spawn - add a subagent for work the first briefs did not cover.\n' +
|
|
196
|
+
' team_collect - only if you cannot answer without the result; it stops waiting when the ' +
|
|
197
|
+
'user writes to you.\n' +
|
|
198
|
+
'Nothing stops it automatically unless team.dispatchTimeoutMs sets a ceiling - team_status ' +
|
|
199
|
+
'prints that as "ceiling" - so end it yourself with team_stop all if it should not continue.');
|
|
200
|
+
}
|
|
@@ -26,14 +26,17 @@
|
|
|
26
26
|
* 3. An abort killed the tree and then went on waiting for a `'close'` that a
|
|
27
27
|
* detached grandchild was still holding.
|
|
28
28
|
*
|
|
29
|
-
* WHY THE DRAIN WINDOW IS A BOUND AND NOT A VERDICT. The first build
|
|
30
|
-
* anything still unsettled when that window closed "a held pipe" and
|
|
31
|
-
* the `'exit'` drain note on the strength of it. Under load the two
|
|
32
|
-
* the release gate caught a command that had printed two lines and
|
|
33
|
-
* immediately being reported as holding its output stream, because the
|
|
34
|
-
* phase came round before libuv delivered the close notification. The
|
|
35
|
-
* claim about STATE, so it is decided by asking the streams
|
|
36
|
-
* (`proc/output-streams.ts`) instead of guessing from a clock
|
|
29
|
+
* WHY THE DRAIN WINDOW IS A BOUND AND NOT A VERDICT, TWICE OVER. The first build
|
|
30
|
+
* called anything still unsettled when that window closed "a held pipe" and
|
|
31
|
+
* printed the `'exit'` drain note on the strength of it. Under load the two
|
|
32
|
+
* disagree: the release gate caught a command that had printed two lines and
|
|
33
|
+
* exited immediately being reported as holding its output stream, because the
|
|
34
|
+
* timers phase came round before libuv delivered the close notification. The
|
|
35
|
+
* note is a claim about STATE, so it is decided by asking the streams
|
|
36
|
+
* (`proc/output-streams.ts`) instead of guessing from a clock — and then asking
|
|
37
|
+
* them a SECOND time `drainVerifyMs` later, because one sample is still a clock
|
|
38
|
+
* and the 2026-11-10 gate run printed the note for `node -e "console.log('hi')"`
|
|
39
|
+
* off exactly one.
|
|
37
40
|
*
|
|
38
41
|
* The happy path is BYTE-IDENTICAL to the pre-change build: `$ cmd\n<output>\n
|
|
39
42
|
* [exit code N]`, same truncation, same footer. That is what keeps the existing
|
package/dist/tools/bash-tool.js
CHANGED
|
@@ -26,14 +26,17 @@
|
|
|
26
26
|
* 3. An abort killed the tree and then went on waiting for a `'close'` that a
|
|
27
27
|
* detached grandchild was still holding.
|
|
28
28
|
*
|
|
29
|
-
* WHY THE DRAIN WINDOW IS A BOUND AND NOT A VERDICT. The first build
|
|
30
|
-
* anything still unsettled when that window closed "a held pipe" and
|
|
31
|
-
* the `'exit'` drain note on the strength of it. Under load the two
|
|
32
|
-
* the release gate caught a command that had printed two lines and
|
|
33
|
-
* immediately being reported as holding its output stream, because the
|
|
34
|
-
* phase came round before libuv delivered the close notification. The
|
|
35
|
-
* claim about STATE, so it is decided by asking the streams
|
|
36
|
-
* (`proc/output-streams.ts`) instead of guessing from a clock
|
|
29
|
+
* WHY THE DRAIN WINDOW IS A BOUND AND NOT A VERDICT, TWICE OVER. The first build
|
|
30
|
+
* called anything still unsettled when that window closed "a held pipe" and
|
|
31
|
+
* printed the `'exit'` drain note on the strength of it. Under load the two
|
|
32
|
+
* disagree: the release gate caught a command that had printed two lines and
|
|
33
|
+
* exited immediately being reported as holding its output stream, because the
|
|
34
|
+
* timers phase came round before libuv delivered the close notification. The
|
|
35
|
+
* note is a claim about STATE, so it is decided by asking the streams
|
|
36
|
+
* (`proc/output-streams.ts`) instead of guessing from a clock — and then asking
|
|
37
|
+
* them a SECOND time `drainVerifyMs` later, because one sample is still a clock
|
|
38
|
+
* and the 2026-11-10 gate run printed the note for `node -e "console.log('hi')"`
|
|
39
|
+
* off exactly one.
|
|
37
40
|
*
|
|
38
41
|
* The happy path is BYTE-IDENTICAL to the pre-change build: `$ cmd\n<output>\n
|
|
39
42
|
* [exit code N]`, same truncation, same footer. That is what keeps the existing
|
|
@@ -280,6 +283,7 @@ export function makeBash(deps, options = {}) {
|
|
|
280
283
|
let output = '';
|
|
281
284
|
let settled = false;
|
|
282
285
|
let drainTimer;
|
|
286
|
+
let verifyTimer;
|
|
283
287
|
let graceTimer;
|
|
284
288
|
let selfTimer;
|
|
285
289
|
/**
|
|
@@ -353,6 +357,8 @@ export function makeBash(deps, options = {}) {
|
|
|
353
357
|
settled = true;
|
|
354
358
|
if (drainTimer)
|
|
355
359
|
clearTimeout(drainTimer);
|
|
360
|
+
if (verifyTimer)
|
|
361
|
+
clearTimeout(verifyTimer);
|
|
356
362
|
if (graceTimer)
|
|
357
363
|
clearTimeout(graceTimer);
|
|
358
364
|
if (selfTimer)
|
|
@@ -478,6 +484,35 @@ export function makeBash(deps, options = {}) {
|
|
|
478
484
|
};
|
|
479
485
|
child.stdout?.on('end', onStreamSettled);
|
|
480
486
|
child.stderr?.on('end', onStreamSettled);
|
|
487
|
+
/**
|
|
488
|
+
* `drainMs` HAS ELAPSED AND THE PIPES STILL LOOK OPEN. That is one sample,
|
|
489
|
+
* and one sample is not a diagnosis: the second release-gate failure of
|
|
490
|
+
* this sentence (2026-11-10) printed the note for
|
|
491
|
+
* `node -e "console.log('hi')"`, whose pipes were merely late being
|
|
492
|
+
* dispatched on a loop that was 400 files of transforms behind.
|
|
493
|
+
*
|
|
494
|
+
* So keep waiting - event driven, so an ordinary release still settles the
|
|
495
|
+
* instant it happens with no note - and only claim a held pipe if it is
|
|
496
|
+
* STILL held `drainVerifyMs` later. See `PROC_LIMITS.drainVerifyMs`.
|
|
497
|
+
*
|
|
498
|
+
* WAITING TWICE IS NOT WAITING LONG ENOUGH (third failure, same sentence,
|
|
499
|
+
* same day: AC-9b). Both samples above are still clocks, and the quantity
|
|
500
|
+
* they race - a child's last byte to libuv dispatching its EOF - is a
|
|
501
|
+
* property of the HOST: measured at up to 1.46 s on a loaded machine
|
|
502
|
+
* against 0.5 s idle. The window is therefore a measured budget now, not
|
|
503
|
+
* a guess, and this branch is the only place it is spent.
|
|
504
|
+
*/
|
|
505
|
+
const pastDrain = () => {
|
|
506
|
+
if (settled || !exitInfo)
|
|
507
|
+
return;
|
|
508
|
+
if (!streamsStillOpen()) {
|
|
509
|
+
settleOrdinary();
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
if (verifyTimer)
|
|
513
|
+
return;
|
|
514
|
+
verifyTimer = setTimeout(() => setImmediate(settleOrdinary), PROC_LIMITS.drainVerifyMs);
|
|
515
|
+
};
|
|
481
516
|
child.on('exit', (code, signalName) => {
|
|
482
517
|
exitInfo = { code, signalName };
|
|
483
518
|
if (settled)
|
|
@@ -495,7 +530,7 @@ export function makeBash(deps, options = {}) {
|
|
|
495
530
|
// precisely the starvation that produced the false note. The check phase
|
|
496
531
|
// runs after the poll phase of the same iteration, so by then the answer is
|
|
497
532
|
// observable rather than guessable.
|
|
498
|
-
setImmediate(
|
|
533
|
+
setImmediate(pastDrain);
|
|
499
534
|
}, PROC_LIMITS.drainMs);
|
|
500
535
|
});
|
|
501
536
|
child.on('close', (code, signalName) => {
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -463,7 +463,7 @@ export declare function gatedToolTimeouts(toolTimeoutMs: number, decisionBudgetM
|
|
|
463
463
|
* is the whole of what this mechanism is worth, and saying so plainly beats
|
|
464
464
|
* implying it covers more.
|
|
465
465
|
*/
|
|
466
|
-
export declare const SKILL_TOOL_FLOOR: readonly ["read_file", "list_dir", "glob", "grep", "skill", "skill_find", "ask_user", "submit_plan", "task", "todo_write", "bash_output", "job_wait", "job_list", "memory_search", "memory_read", "gene_search", "gene_read", "gene_feedback"];
|
|
466
|
+
export declare const SKILL_TOOL_FLOOR: readonly ["read_file", "list_dir", "glob", "grep", "skill", "skill_find", "ask_user", "submit_plan", "task", "todo_write", "bash_output", "job_wait", "job_list", "memory_search", "memory_read", "gene_search", "gene_read", "gene_feedback", "team_status", "team_message", "team_pause", "team_resume", "team_stop", "team_spawn", "team_collect"];
|
|
467
467
|
/**
|
|
468
468
|
* The five tools plan mode refuses: exactly the complement of `SKILL_TOOL_FLOOR`
|
|
469
469
|
* within `HOST_TOOL_NAMES` — "the five that change something", the set this file
|
|
@@ -496,7 +496,7 @@ export declare const PLAN_MODE_BLOCKED_TOOLS: ReadonlySet<string>;
|
|
|
496
496
|
* declaration MEANS, and that reading must not change with how the CLI was
|
|
497
497
|
* started.
|
|
498
498
|
*/
|
|
499
|
-
export declare const HOST_TOOL_NAMES: readonly ["read_file", "write_file", "edit_file", "list_dir", "glob", "grep", "bash", "skill", "skill_find", "skill_install", "skill_create", "ask_user", "submit_plan", "todo_write", "bash_output", "bash_kill", "job_wait", "job_list", "memory_search", "memory_read", "memory_write", "gene_search", "gene_read", "gene_feedback", "gene_run", "submit_result", "task"];
|
|
499
|
+
export declare const HOST_TOOL_NAMES: readonly ["read_file", "write_file", "edit_file", "list_dir", "glob", "grep", "bash", "skill", "skill_find", "skill_install", "skill_create", "ask_user", "submit_plan", "todo_write", "bash_output", "bash_kill", "job_wait", "job_list", "memory_search", "memory_read", "memory_write", "gene_search", "gene_read", "gene_feedback", "gene_run", "submit_result", "task", "team_status", "team_message", "team_pause", "team_resume", "team_stop", "team_spawn", "team_collect"];
|
|
500
500
|
/**
|
|
501
501
|
* The three memory tools, as one constant (agent-memory 7.1).
|
|
502
502
|
*
|
package/dist/tools/index.js
CHANGED
|
@@ -147,6 +147,22 @@ export const SKILL_TOOL_FLOOR = [
|
|
|
147
147
|
'gene_search',
|
|
148
148
|
'gene_read',
|
|
149
149
|
'gene_feedback',
|
|
150
|
+
// THE SEVEN LEAD CONSOLE TOOLS join the FLOOR (team-detached-dispatch section
|
|
151
|
+
// 5.2), and the partition test below is what forces the choice to be conscious.
|
|
152
|
+
// Three arguments, none of which is "convenience": none of them can write to the
|
|
153
|
+
// workspace (they message, hold, stop or read a dispatch); a skill whose
|
|
154
|
+
// `allowed-tools` omitted them would make the user's own control surface
|
|
155
|
+
// unreachable inside that frame - the identical dead end that put `ask_user` /
|
|
156
|
+
// `submit_plan` / `task` here; and `team_stop` in particular is the only way to
|
|
157
|
+
// end a dispatch that an EARLIER turn started, so a skill being able to remove it
|
|
158
|
+
// would be a control the user cannot exercise.
|
|
159
|
+
'team_status',
|
|
160
|
+
'team_message',
|
|
161
|
+
'team_pause',
|
|
162
|
+
'team_resume',
|
|
163
|
+
'team_stop',
|
|
164
|
+
'team_spawn',
|
|
165
|
+
'team_collect',
|
|
150
166
|
];
|
|
151
167
|
/**
|
|
152
168
|
* The five tools plan mode refuses: exactly the complement of `SKILL_TOOL_FLOOR`
|
|
@@ -252,7 +268,21 @@ export const HOST_TOOL_NAMES = [
|
|
|
252
268
|
// IS unenforceable, and `aragon skills doctor` saying so is correct rather
|
|
253
269
|
// than a gap. They reach children through `policyExempt`, a different
|
|
254
270
|
// mechanism answering a different question.
|
|
271
|
+
// `task` and the seven lead-side console tools (team-detached-dispatch section
|
|
272
|
+
// 5.2). ALL EIGHT ARE REGISTERED ON A LEAD, which is the whole reason they are
|
|
273
|
+
// in this list: a skill's `allowed-tools: [team_pause]` must be answerable by
|
|
274
|
+
// `skills doctor`, and `--allow-tool` / `--deny-tool` validate against THIS
|
|
275
|
+
// constant. They are registered through `createBuiltinTools`'s `teamTools`
|
|
276
|
+
// path, so `tools.test.ts::C7` compares them against the real array - the
|
|
277
|
+
// constant, the controller's `teamTools` and C7's stub list move TOGETHER.
|
|
255
278
|
'task',
|
|
279
|
+
'team_status',
|
|
280
|
+
'team_message',
|
|
281
|
+
'team_pause',
|
|
282
|
+
'team_resume',
|
|
283
|
+
'team_stop',
|
|
284
|
+
'team_spawn',
|
|
285
|
+
'team_collect',
|
|
256
286
|
];
|
|
257
287
|
/**
|
|
258
288
|
* The three memory tools, as one constant (agent-memory 7.1).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aragon-agent/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.61",
|
|
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",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"prepublishOnly": "npm run build"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@aragon-agent/core": "^0.2.
|
|
62
|
-
"@aragon-agent/tui": "0.0.
|
|
61
|
+
"@aragon-agent/core": "^0.2.73",
|
|
62
|
+
"@aragon-agent/tui": "0.0.14",
|
|
63
63
|
"commander": "^12.1.0",
|
|
64
64
|
"dotenv": "^16.6.1",
|
|
65
65
|
"env-paths": "^3.0.0",
|