@aragon-agent/cli 0.6.55 → 0.6.56
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 +2912 -2864
- package/README.md +160 -45
- package/dist/agent/controller.d.ts +47 -0
- package/dist/agent/controller.js +153 -2
- package/dist/agent/governance-wiring.js +8 -1
- package/dist/agent/system-prompt.d.ts +26 -0
- package/dist/agent/system-prompt.js +11 -0
- package/dist/app/App.js +101 -3
- package/dist/cli.js +29 -1
- package/dist/commands/builtins.js +4 -0
- package/dist/commands/catalog.js +1 -0
- package/dist/commands/registry.d.ts +8 -0
- package/dist/config/app-paths.d.ts +10 -0
- package/dist/config/app-paths.js +12 -0
- package/dist/config/cli-commands.d.ts +29 -0
- package/dist/config/cli-commands.js +76 -1
- package/dist/config/env.d.ts +2 -1
- package/dist/config/env.js +12 -1
- package/dist/config/load.d.ts +10 -0
- package/dist/config/load.js +13 -2
- package/dist/config/store.js +11 -1
- package/dist/exec/bridge/server.d.ts +7 -0
- package/dist/exec/bridge/server.js +6 -2
- package/dist/exec/cli-commands.js +4 -0
- package/dist/exec/index.js +2 -0
- package/dist/exec/options.d.ts +11 -0
- package/dist/exec/options.js +21 -1
- package/dist/gene/block.d.ts +33 -0
- package/dist/gene/block.js +51 -0
- package/dist/gene/capacity.d.ts +74 -0
- package/dist/gene/capacity.js +169 -0
- package/dist/gene/catalog-reconcile.d.ts +13 -0
- package/dist/gene/catalog-reconcile.js +105 -0
- package/dist/gene/catalog-stats.d.ts +27 -0
- package/dist/gene/catalog-stats.js +89 -0
- package/dist/gene/catalog-sync.d.ts +82 -0
- package/dist/gene/catalog-sync.js +324 -0
- package/dist/gene/catalog.d.ts +160 -0
- package/dist/gene/catalog.js +433 -0
- package/dist/gene/cli-commands.d.ts +50 -0
- package/dist/gene/cli-commands.js +500 -0
- package/dist/gene/command-report.d.ts +40 -0
- package/dist/gene/command-report.js +246 -0
- package/dist/gene/command.d.ts +29 -0
- package/dist/gene/command.js +561 -0
- package/dist/gene/commit-apply-types.d.ts +13 -0
- package/dist/gene/commit-apply-types.js +1 -0
- package/dist/gene/commit-compound.d.ts +34 -0
- package/dist/gene/commit-compound.js +212 -0
- package/dist/gene/commit-counts.d.ts +41 -0
- package/dist/gene/commit-counts.js +70 -0
- package/dist/gene/commit-exec.d.ts +42 -0
- package/dist/gene/commit-exec.js +134 -0
- package/dist/gene/commit-head.d.ts +52 -0
- package/dist/gene/commit-head.js +97 -0
- package/dist/gene/commit-plan.d.ts +95 -0
- package/dist/gene/commit-plan.js +68 -0
- package/dist/gene/commit-prepare.d.ts +63 -0
- package/dist/gene/commit-prepare.js +159 -0
- package/dist/gene/commit-types.d.ts +234 -0
- package/dist/gene/commit-types.js +3 -0
- package/dist/gene/curator/agent.d.ts +137 -0
- package/dist/gene/curator/agent.js +203 -0
- package/dist/gene/curator/budget.d.ts +69 -0
- package/dist/gene/curator/budget.js +131 -0
- package/dist/gene/curator/conflicts.d.ts +54 -0
- package/dist/gene/curator/conflicts.js +143 -0
- package/dist/gene/curator/curator.d.ts +170 -0
- package/dist/gene/curator/curator.js +617 -0
- package/dist/gene/curator/deps.d.ts +34 -0
- package/dist/gene/curator/deps.js +48 -0
- package/dist/gene/curator/deterministic.d.ts +62 -0
- package/dist/gene/curator/deterministic.js +287 -0
- package/dist/gene/curator/executors.d.ts +36 -0
- package/dist/gene/curator/executors.js +379 -0
- package/dist/gene/curator/lanes.d.ts +52 -0
- package/dist/gene/curator/lanes.js +99 -0
- package/dist/gene/curator/lease.d.ts +76 -0
- package/dist/gene/curator/lease.js +171 -0
- package/dist/gene/curator/library.d.ts +36 -0
- package/dist/gene/curator/library.js +169 -0
- package/dist/gene/curator/lifecycle.d.ts +52 -0
- package/dist/gene/curator/lifecycle.js +109 -0
- package/dist/gene/curator/maintenance.d.ts +71 -0
- package/dist/gene/curator/maintenance.js +213 -0
- package/dist/gene/curator/probation.d.ts +51 -0
- package/dist/gene/curator/probation.js +71 -0
- package/dist/gene/curator/probe.d.ts +131 -0
- package/dist/gene/curator/probe.js +534 -0
- package/dist/gene/curator/prompt.d.ts +18 -0
- package/dist/gene/curator/prompt.js +128 -0
- package/dist/gene/curator/publish.d.ts +64 -0
- package/dist/gene/curator/publish.js +113 -0
- package/dist/gene/curator/recheck.d.ts +55 -0
- package/dist/gene/curator/recheck.js +103 -0
- package/dist/gene/curator/run-events.d.ts +63 -0
- package/dist/gene/curator/run-events.js +55 -0
- package/dist/gene/curator/similarity.d.ts +13 -0
- package/dist/gene/curator/similarity.js +46 -0
- package/dist/gene/curator/switches.d.ts +78 -0
- package/dist/gene/curator/switches.js +146 -0
- package/dist/gene/curator/task-context.d.ts +93 -0
- package/dist/gene/curator/task-context.js +63 -0
- package/dist/gene/curator/task-runner.d.ts +56 -0
- package/dist/gene/curator/task-runner.js +257 -0
- package/dist/gene/curator/tool-support.d.ts +112 -0
- package/dist/gene/curator/tool-support.js +197 -0
- package/dist/gene/curator/toolkit.d.ts +49 -0
- package/dist/gene/curator/toolkit.js +104 -0
- package/dist/gene/curator/tools-read.d.ts +4 -0
- package/dist/gene/curator/tools-read.js +177 -0
- package/dist/gene/curator/tools-release.d.ts +73 -0
- package/dist/gene/curator/tools-release.js +287 -0
- package/dist/gene/curator/tools-verify.d.ts +47 -0
- package/dist/gene/curator/tools-verify.js +202 -0
- package/dist/gene/curator/tools-write.d.ts +26 -0
- package/dist/gene/curator/tools-write.js +394 -0
- package/dist/gene/curator/tools.d.ts +23 -0
- package/dist/gene/curator/tools.js +21 -0
- package/dist/gene/curator/validate/common.d.ts +87 -0
- package/dist/gene/curator/validate/common.js +132 -0
- package/dist/gene/curator/validate/evidence-tokens.d.ts +36 -0
- package/dist/gene/curator/validate/evidence-tokens.js +139 -0
- package/dist/gene/curator/validate/index.d.ts +23 -0
- package/dist/gene/curator/validate/index.js +62 -0
- package/dist/gene/curator/validate/knowledge.d.ts +25 -0
- package/dist/gene/curator/validate/knowledge.js +216 -0
- package/dist/gene/curator/validate/live-check.d.ts +14 -0
- package/dist/gene/curator/validate/live-check.js +144 -0
- package/dist/gene/curator/validate/ports.d.ts +67 -0
- package/dist/gene/curator/validate/ports.js +1 -0
- package/dist/gene/curator/validate/prompts.d.ts +41 -0
- package/dist/gene/curator/validate/prompts.js +161 -0
- package/dist/gene/curator/validate/skill.d.ts +15 -0
- package/dist/gene/curator/validate/skill.js +251 -0
- package/dist/gene/curator/validate/tool.d.ts +6 -0
- package/dist/gene/curator/validate/tool.js +217 -0
- package/dist/gene/curator/validate/types.d.ts +90 -0
- package/dist/gene/curator/validate/types.js +1 -0
- package/dist/gene/curator/validator-ports.d.ts +38 -0
- package/dist/gene/curator/validator-ports.js +29 -0
- package/dist/gene/diag.d.ts +209 -0
- package/dist/gene/diag.js +549 -0
- package/dist/gene/env.d.ts +10 -0
- package/dist/gene/env.js +214 -0
- package/dist/gene/eval-recorder.d.ts +84 -0
- package/dist/gene/eval-recorder.js +222 -0
- package/dist/gene/explain-transport.d.ts +3 -0
- package/dist/gene/explain-transport.js +39 -0
- package/dist/gene/explain.d.ts +96 -0
- package/dist/gene/explain.js +293 -0
- package/dist/gene/fs.d.ts +39 -0
- package/dist/gene/fs.js +139 -0
- package/dist/gene/fsck.d.ts +68 -0
- package/dist/gene/fsck.js +134 -0
- package/dist/gene/gc-library-sweeps.d.ts +9 -0
- package/dist/gene/gc-library-sweeps.js +220 -0
- package/dist/gene/gc-rejected-set.d.ts +15 -0
- package/dist/gene/gc-rejected-set.js +63 -0
- package/dist/gene/gc-safe.d.ts +12 -0
- package/dist/gene/gc-safe.js +74 -0
- package/dist/gene/gc-scope-sweeps.d.ts +18 -0
- package/dist/gene/gc-scope-sweeps.js +297 -0
- package/dist/gene/gc-types.d.ts +55 -0
- package/dist/gene/gc-types.js +26 -0
- package/dist/gene/gc.d.ts +42 -0
- package/dist/gene/gc.js +129 -0
- package/dist/gene/gene-errors.d.ts +23 -0
- package/dist/gene/gene-errors.js +29 -0
- package/dist/gene/hints.d.ts +91 -0
- package/dist/gene/hints.js +394 -0
- package/dist/gene/hub.d.ts +149 -0
- package/dist/gene/hub.js +371 -0
- package/dist/gene/import-plan.d.ts +80 -0
- package/dist/gene/import-plan.js +294 -0
- package/dist/gene/import-proposal.d.ts +23 -0
- package/dist/gene/import-proposal.js +101 -0
- package/dist/gene/import-skill-port.d.ts +6 -0
- package/dist/gene/import-skill-port.js +53 -0
- package/dist/gene/import-sources.d.ts +48 -0
- package/dist/gene/import-sources.js +140 -0
- package/dist/gene/index-writer.d.ts +36 -0
- package/dist/gene/index-writer.js +101 -0
- package/dist/gene/learn/learn-call.d.ts +63 -0
- package/dist/gene/learn/learn-call.js +157 -0
- package/dist/gene/learn/learn-prompt.d.ts +51 -0
- package/dist/gene/learn/learn-prompt.js +245 -0
- package/dist/gene/learn/learner.d.ts +181 -0
- package/dist/gene/learn/learner.js +426 -0
- package/dist/gene/learn/ledger.d.ts +220 -0
- package/dist/gene/learn/ledger.js +394 -0
- package/dist/gene/learn/proposal-build.d.ts +83 -0
- package/dist/gene/learn/proposal-build.js +211 -0
- package/dist/gene/learn/proposal-guard.d.ts +43 -0
- package/dist/gene/learn/proposal-guard.js +37 -0
- package/dist/gene/learn/signals-port.d.ts +47 -0
- package/dist/gene/learn/signals-port.js +86 -0
- package/dist/gene/maintenance-paths.d.ts +7 -0
- package/dist/gene/maintenance-paths.js +20 -0
- package/dist/gene/maintenance-probation.d.ts +33 -0
- package/dist/gene/maintenance-probation.js +127 -0
- package/dist/gene/maintenance-proposals.d.ts +24 -0
- package/dist/gene/maintenance-proposals.js +68 -0
- package/dist/gene/maintenance-runner.d.ts +92 -0
- package/dist/gene/maintenance-runner.js +262 -0
- package/dist/gene/maintenance-tasks.d.ts +37 -0
- package/dist/gene/maintenance-tasks.js +95 -0
- package/dist/gene/manager-actions.d.ts +12 -0
- package/dist/gene/manager-actions.js +279 -0
- package/dist/gene/manager-approve.d.ts +29 -0
- package/dist/gene/manager-approve.js +84 -0
- package/dist/gene/manager-context.d.ts +90 -0
- package/dist/gene/manager-context.js +201 -0
- package/dist/gene/manager-detail.d.ts +17 -0
- package/dist/gene/manager-detail.js +313 -0
- package/dist/gene/manager-gc.d.ts +13 -0
- package/dist/gene/manager-gc.js +81 -0
- package/dist/gene/manager-library.d.ts +39 -0
- package/dist/gene/manager-library.js +90 -0
- package/dist/gene/manager-list.d.ts +27 -0
- package/dist/gene/manager-list.js +170 -0
- package/dist/gene/manager-queue.d.ts +16 -0
- package/dist/gene/manager-queue.js +124 -0
- package/dist/gene/manager-stats.d.ts +28 -0
- package/dist/gene/manager-stats.js +53 -0
- package/dist/gene/manager-view.d.ts +27 -0
- package/dist/gene/manager-view.js +124 -0
- package/dist/gene/manager.d.ts +56 -0
- package/dist/gene/manager.js +179 -0
- package/dist/gene/orphan-scopes.d.ts +37 -0
- package/dist/gene/orphan-scopes.js +150 -0
- package/dist/gene/paths.d.ts +73 -0
- package/dist/gene/paths.js +239 -0
- package/dist/gene/plan-content.d.ts +73 -0
- package/dist/gene/plan-content.js +522 -0
- package/dist/gene/plan-lifecycle.d.ts +29 -0
- package/dist/gene/plan-lifecycle.js +310 -0
- package/dist/gene/policy.d.ts +71 -0
- package/dist/gene/policy.js +313 -0
- package/dist/gene/project-learning.d.ts +25 -0
- package/dist/gene/project-learning.js +54 -0
- package/dist/gene/propagation.d.ts +48 -0
- package/dist/gene/propagation.js +45 -0
- package/dist/gene/queue-lock.d.ts +22 -0
- package/dist/gene/queue-lock.js +99 -0
- package/dist/gene/queue-record.d.ts +57 -0
- package/dist/gene/queue-record.js +145 -0
- package/dist/gene/queue.d.ts +235 -0
- package/dist/gene/queue.js +764 -0
- package/dist/gene/read.d.ts +61 -0
- package/dist/gene/read.js +252 -0
- package/dist/gene/runlog.d.ts +101 -0
- package/dist/gene/runlog.js +404 -0
- package/dist/gene/schema-lite.d.ts +24 -0
- package/dist/gene/schema-lite.js +159 -0
- package/dist/gene/scope-guard.d.ts +23 -0
- package/dist/gene/scope-guard.js +9 -0
- package/dist/gene/scope-lock.d.ts +48 -0
- package/dist/gene/scope-lock.js +222 -0
- package/dist/gene/scope-verify.d.ts +63 -0
- package/dist/gene/scope-verify.js +123 -0
- package/dist/gene/secrets.d.ts +43 -0
- package/dist/gene/secrets.js +161 -0
- package/dist/gene/service-context.d.ts +43 -0
- package/dist/gene/service-context.js +79 -0
- package/dist/gene/service-prepare.d.ts +25 -0
- package/dist/gene/service-prepare.js +219 -0
- package/dist/gene/service-types.d.ts +196 -0
- package/dist/gene/service-types.js +1 -0
- package/dist/gene/service-view.d.ts +41 -0
- package/dist/gene/service-view.js +69 -0
- package/dist/gene/service.d.ts +114 -0
- package/dist/gene/service.js +761 -0
- package/dist/gene/session-start.d.ts +36 -0
- package/dist/gene/session-start.js +212 -0
- package/dist/gene/store-port.d.ts +88 -0
- package/dist/gene/store-port.js +10 -0
- package/dist/gene/store-rows.d.ts +36 -0
- package/dist/gene/store-rows.js +72 -0
- package/dist/gene/store.d.ts +125 -0
- package/dist/gene/store.js +622 -0
- package/dist/gene/tombstones.d.ts +47 -0
- package/dist/gene/tombstones.js +61 -0
- package/dist/gene/tool-runner.d.ts +47 -0
- package/dist/gene/tool-runner.js +154 -0
- package/dist/gene/tool-screen.d.ts +41 -0
- package/dist/gene/tool-screen.js +227 -0
- package/dist/gene/tools.d.ts +112 -0
- package/dist/gene/tools.js +539 -0
- package/dist/gene/transfer.d.ts +85 -0
- package/dist/gene/transfer.js +433 -0
- package/dist/gene/ui-hints.d.ts +15 -0
- package/dist/gene/ui-hints.js +67 -0
- package/dist/gene/usage-fold-cursor.d.ts +24 -0
- package/dist/gene/usage-fold-cursor.js +115 -0
- package/dist/gene/usage-fold.d.ts +49 -0
- package/dist/gene/usage-fold.js +397 -0
- package/dist/gene/usage.d.ts +67 -0
- package/dist/gene/usage.js +231 -0
- package/dist/gene/version-service.d.ts +118 -0
- package/dist/gene/version-service.js +453 -0
- package/dist/gene/wiring-events.d.ts +43 -0
- package/dist/gene/wiring-events.js +113 -0
- package/dist/gene/wiring-models.d.ts +46 -0
- package/dist/gene/wiring-models.js +81 -0
- package/dist/gene/wiring.d.ts +200 -0
- package/dist/gene/wiring.js +764 -0
- package/dist/governance/prompts/orchestrator-block.js +3 -2
- package/dist/host/gene.d.ts +26 -0
- package/dist/host/gene.js +24 -0
- package/dist/host/index.d.ts +1 -0
- package/dist/host/index.js +1 -0
- package/dist/team/runtime.d.ts +5 -0
- package/dist/team/runtime.js +23 -0
- package/dist/team/subagent.d.ts +34 -0
- package/dist/team/subagent.js +39 -2
- package/dist/tools/index.d.ts +36 -2
- package/dist/tools/index.js +48 -7
- package/package.json +3 -3
|
@@ -67,8 +67,9 @@ function powersSection() {
|
|
|
67
67
|
'',
|
|
68
68
|
'Your tools: gov_run, gov_dispatch, ask_user, todo_write, and every tool that only reads',
|
|
69
69
|
'(read_file, list_dir, glob, grep, skill, skill_find, bash_output, job_wait, job_list).',
|
|
70
|
-
'write_file, edit_file, bash, bash_kill, skill_install, skill_create, memory_write
|
|
71
|
-
'refused in this mode on purpose: all implementation happens through dispatched
|
|
70
|
+
'write_file, edit_file, bash, bash_kill, skill_install, skill_create, memory_write, gene_run',
|
|
71
|
+
'and task are refused in this mode on purpose: all implementation happens through dispatched',
|
|
72
|
+
'agents.',
|
|
72
73
|
];
|
|
73
74
|
}
|
|
74
75
|
function startSteps(maxWorkPackages) {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gene Bank facade: the one surface a GUI host (the Electron desktop app) may depend on for the
|
|
3
|
+
* gene library (gene-bank spec 12.6, 15.3).
|
|
4
|
+
*
|
|
5
|
+
* Same contract as `memory.ts`: a RE-EXPORT, on purpose. The manager is the very object the
|
|
6
|
+
* terminal overlay is handed, so the desktop reads and writes the same library through the same
|
|
7
|
+
* version service; a wrapper that re-implemented any of that would drift.
|
|
8
|
+
*
|
|
9
|
+
* ASCII ONLY - the whole `gene/` tree and its facade are in `glyphs.test.ts::inScope`.
|
|
10
|
+
*
|
|
11
|
+
* Nothing re-exported may pull `ink`, `react` or `@aragon-agent/tui/ui/**` into the import
|
|
12
|
+
* closure (layering rule L9): a host process has no TTY. `verify:layering` checks it.
|
|
13
|
+
*
|
|
14
|
+
* - `createGeneManager` the `GeneManagerPort` implementation (per session: cwd + session id).
|
|
15
|
+
* - `redactSecrets` the main process runs evidence text through it a second time before
|
|
16
|
+
* the text crosses to the renderer (defence in depth, spec 16.6).
|
|
17
|
+
* - `getGeneDir` the library root, for the subscription-scoped change watcher.
|
|
18
|
+
* - `isValidGeneId` / `isValidScope` the id shapes the main process restates at its IPC edge;
|
|
19
|
+
* a test compares the restated shapes against these.
|
|
20
|
+
*/
|
|
21
|
+
export { createGeneManager } from '../gene/manager.js';
|
|
22
|
+
export type { GeneManagerOptions } from '../gene/manager.js';
|
|
23
|
+
export { redactSecrets } from '../gene/secrets.js';
|
|
24
|
+
export type { Redaction } from '../gene/secrets.js';
|
|
25
|
+
export { getGeneDir } from '../gene/paths.js';
|
|
26
|
+
export { isValidGeneId, isValidScope } from '@aragon-agent/tui/model/gene/ids';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gene Bank facade: the one surface a GUI host (the Electron desktop app) may depend on for the
|
|
3
|
+
* gene library (gene-bank spec 12.6, 15.3).
|
|
4
|
+
*
|
|
5
|
+
* Same contract as `memory.ts`: a RE-EXPORT, on purpose. The manager is the very object the
|
|
6
|
+
* terminal overlay is handed, so the desktop reads and writes the same library through the same
|
|
7
|
+
* version service; a wrapper that re-implemented any of that would drift.
|
|
8
|
+
*
|
|
9
|
+
* ASCII ONLY - the whole `gene/` tree and its facade are in `glyphs.test.ts::inScope`.
|
|
10
|
+
*
|
|
11
|
+
* Nothing re-exported may pull `ink`, `react` or `@aragon-agent/tui/ui/**` into the import
|
|
12
|
+
* closure (layering rule L9): a host process has no TTY. `verify:layering` checks it.
|
|
13
|
+
*
|
|
14
|
+
* - `createGeneManager` the `GeneManagerPort` implementation (per session: cwd + session id).
|
|
15
|
+
* - `redactSecrets` the main process runs evidence text through it a second time before
|
|
16
|
+
* the text crosses to the renderer (defence in depth, spec 16.6).
|
|
17
|
+
* - `getGeneDir` the library root, for the subscription-scoped change watcher.
|
|
18
|
+
* - `isValidGeneId` / `isValidScope` the id shapes the main process restates at its IPC edge;
|
|
19
|
+
* a test compares the restated shapes against these.
|
|
20
|
+
*/
|
|
21
|
+
export { createGeneManager } from '../gene/manager.js';
|
|
22
|
+
export { redactSecrets } from '../gene/secrets.js';
|
|
23
|
+
export { getGeneDir } from '../gene/paths.js';
|
|
24
|
+
export { isValidGeneId, isValidScope } from '@aragon-agent/tui/model/gene/ids';
|
package/dist/host/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from './interaction.js';
|
|
|
17
17
|
export * from './logging.js';
|
|
18
18
|
export * from './prompts.js';
|
|
19
19
|
export * from './memory.js';
|
|
20
|
+
export * from './gene.js';
|
|
20
21
|
export * from './sessions.js';
|
|
21
22
|
export * from './settings.js';
|
|
22
23
|
export * from './commands.js';
|
package/dist/host/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export * from './interaction.js';
|
|
|
17
17
|
export * from './logging.js';
|
|
18
18
|
export * from './prompts.js';
|
|
19
19
|
export * from './memory.js';
|
|
20
|
+
export * from './gene.js';
|
|
20
21
|
export * from './sessions.js';
|
|
21
22
|
export * from './settings.js';
|
|
22
23
|
export * from './commands.js';
|
package/dist/team/runtime.d.ts
CHANGED
|
@@ -123,6 +123,11 @@ export interface TeamRuntimeDeps {
|
|
|
123
123
|
* as before.
|
|
124
124
|
*/
|
|
125
125
|
imageSupportFor?: SubagentDeps['imageSupportFor'];
|
|
126
|
+
/**
|
|
127
|
+
* The gene library for children, passed straight through to `SubagentDeps` (gene-bank 9.7).
|
|
128
|
+
* ABSENT when the library is off, which leaves every child built as before.
|
|
129
|
+
*/
|
|
130
|
+
geneTools?: SubagentDeps['geneTools'];
|
|
126
131
|
}
|
|
127
132
|
export declare class TeamRuntime {
|
|
128
133
|
private readonly deps;
|
package/dist/team/runtime.js
CHANGED
|
@@ -405,6 +405,20 @@ export class TeamRuntime {
|
|
|
405
405
|
this.quietNotified.clear();
|
|
406
406
|
this.overseerDegraded = false;
|
|
407
407
|
this.overseerDegradedTicks = 0;
|
|
408
|
+
// THE GENE ZONES ARE PLANNED HERE, ONCE, BEFORE ANY CHILD EXISTS (gene-bank 9.6): planning is
|
|
409
|
+
// asynchronous and a child's system prompt is built synchronously, so the awaiting has to
|
|
410
|
+
// happen first. `busy` is already latched, so a second dispatch cannot interleave. A retry
|
|
411
|
+
// (F-4) rebuilds a child from the SAME `subDeps` and so reads the same text - "computed once".
|
|
412
|
+
// The hook never throws; the catch is for a host closure that breaks that promise.
|
|
413
|
+
const planned = this.deps.geneTools?.prepare !== undefined;
|
|
414
|
+
if (this.deps.geneTools?.prepare) {
|
|
415
|
+
try {
|
|
416
|
+
await this.deps.geneTools.prepare(specs);
|
|
417
|
+
}
|
|
418
|
+
catch {
|
|
419
|
+
// No zone for this dispatch; the children are built without one.
|
|
420
|
+
}
|
|
421
|
+
}
|
|
408
422
|
// THE SUPERVISOR IS CREATED PER DISPATCH (R-P0-2): provider wired AND
|
|
409
423
|
// policy on. `TeamOverseer.isActive()` re-checks the provider per
|
|
410
424
|
// inspection and per tick, so a mid-dispatch `/fast off` degrades the
|
|
@@ -537,6 +551,10 @@ export class TeamRuntime {
|
|
|
537
551
|
// others): declared above and not forwarded here, it type-checks and every child keeps
|
|
538
552
|
// the pre-feature `read_file`, with no error anywhere.
|
|
539
553
|
...(this.deps.imageSupportFor ? { imageSupportFor: this.deps.imageSupportFor } : {}),
|
|
554
|
+
// Site two of three for the gene library (the controller and `TeamRuntimeDeps` are the
|
|
555
|
+
// others): declared above and not forwarded here, it type-checks and every child quietly runs
|
|
556
|
+
// without the library, with nothing to say so.
|
|
557
|
+
...(this.deps.geneTools ? { geneTools: this.deps.geneTools } : {}),
|
|
540
558
|
// Same conditional-spread rule: a dispatch without a supervisor builds
|
|
541
559
|
// the exact pre-feature `SubagentDeps`, and the child's idle watchdog
|
|
542
560
|
// keeps its un-lengthened ceiling (team-overseer §3.6).
|
|
@@ -587,6 +605,11 @@ export class TeamRuntime {
|
|
|
587
605
|
// than a consequence of signal plumbing three modules away.
|
|
588
606
|
const onAbort = () => this.abortAll();
|
|
589
607
|
signal?.addEventListener('abort', onAbort, { once: true });
|
|
608
|
+
// An abort that arrived while the gene zones were being planned fired before the listener
|
|
609
|
+
// existed; a listener added to an already-aborted signal never runs. Only when planning
|
|
610
|
+
// actually awaited, so every other dispatch behaves exactly as it did.
|
|
611
|
+
if (planned && signal?.aborted === true)
|
|
612
|
+
onAbort();
|
|
590
613
|
// The dispatch ceiling has to be enforced HERE as well as through
|
|
591
614
|
// `toolTimeoutOverrides.task`: the executor's timeout is COOPERATIVE (I-2),
|
|
592
615
|
// so the override only bites because `task` listens to `ctx.signal` — and a
|
package/dist/team/subagent.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ import { type AgentConfig, type AgentEvent, type AgentTool, type Message, type M
|
|
|
15
15
|
import type { AgentMode } from '@aragon-agent/tui/model/agent/agent-mode';
|
|
16
16
|
import type { ChildContextManagerProvider } from '../compaction/child.js';
|
|
17
17
|
import type { ImageSupport } from '../agent/image-support.js';
|
|
18
|
+
import type { GeneHintEngine } from '../gene/hints.js';
|
|
19
|
+
import { type GeneToolAccess } from '../gene/tools.js';
|
|
18
20
|
import type { ToolGate } from '../tools/tool-gate.js';
|
|
19
21
|
import type { CliConfig } from '@aragon-agent/tui/model/config/schema';
|
|
20
22
|
import type { ToolPermission } from '../exec/permission.js';
|
|
@@ -197,6 +199,38 @@ export interface SubagentDeps {
|
|
|
197
199
|
* forgetting another type-checks and forwards nothing.
|
|
198
200
|
*/
|
|
199
201
|
imageSupportFor?: (ref: ModelRef) => ImageSupport;
|
|
202
|
+
/**
|
|
203
|
+
* The gene library for a child (gene-bank 9.6 / 9.7). ABSENT unless the library is on, and a
|
|
204
|
+
* child is then built exactly as it was: no gene tool, no rules block, no context zone (I-20).
|
|
205
|
+
* Three sites forward it, like every dep above: `TeamRuntimeDeps`, the `SubagentDeps` literal
|
|
206
|
+
* in `runtime.ts`, and the controller.
|
|
207
|
+
*
|
|
208
|
+
* The children SHARE the process's one `GeneService` (one index, one usage recorder) and keep
|
|
209
|
+
* their own task context; what differs per child is the `GeneActor` the host's closure builds
|
|
210
|
+
* from `spec.label` (the `agent` tag on usage events) and the context zone, which is computed
|
|
211
|
+
* ONCE at dispatch from the task brief and never refreshed mid-run (9.3).
|
|
212
|
+
*/
|
|
213
|
+
geneTools?: SubagentGeneDeps;
|
|
214
|
+
}
|
|
215
|
+
export interface SubagentGeneDeps {
|
|
216
|
+
/**
|
|
217
|
+
* Called once per dispatch BEFORE any child is built, so the static `<gene_context>` of every
|
|
218
|
+
* spec can be planned (the plan is asynchronous, a child's system prompt is not). Never
|
|
219
|
+
* throws; a failure just leaves the zone empty.
|
|
220
|
+
*/
|
|
221
|
+
prepare?: (specs: readonly SubagentSpec[]) => Promise<void>;
|
|
222
|
+
/**
|
|
223
|
+
* The child's gene tools. `access` reads the child's FINAL tool array lazily: its `bash` is
|
|
224
|
+
* the fully gated (and, for a governed inspector, restricted) one, which is what `gene_run`
|
|
225
|
+
* must delegate to. `[]` means this child gets none.
|
|
226
|
+
*/
|
|
227
|
+
toolsFor: (spec: SubagentSpec, access: GeneToolAccess) => AgentTool[];
|
|
228
|
+
/** The child's stage-hint engine, if any; decorates the child's built-in tools. */
|
|
229
|
+
hintsFor?: (spec: SubagentSpec) => GeneHintEngine | undefined;
|
|
230
|
+
/** The `<gene_library>` rules block for the child's final tool names; '' when it cannot use it. */
|
|
231
|
+
rulesBlock: (toolNames: readonly string[]) => string;
|
|
232
|
+
/** The static `<gene_context>` zone planned for this label by `prepare`; '' when none. */
|
|
233
|
+
contextFor: (label: string) => string;
|
|
200
234
|
}
|
|
201
235
|
export interface SubagentHooks {
|
|
202
236
|
/** Coalesced at the source (§5.2); phase transitions always pass. */
|
package/dist/team/subagent.js
CHANGED
|
@@ -16,6 +16,7 @@ import { buildSystemPrompt } from '../agent/system-prompt.js';
|
|
|
16
16
|
import { buildImageInputBlock } from '../agent/image-input-prompt.js';
|
|
17
17
|
import { makeImageProjection } from '../agent/image-history.js';
|
|
18
18
|
import { buildFastBlock } from '../fast/prompt.js';
|
|
19
|
+
import { createToolAccess, withoutOrphanGeneRun } from '../gene/tools.js';
|
|
19
20
|
import { createBuiltinTools, gatedToolTimeouts, } from '../tools/index.js';
|
|
20
21
|
import { ledgerPathKey, normalizeLedgerPath } from './report.js';
|
|
21
22
|
import { describeToolActivity, pickActivityArgs, sanitizeActivity } from '@aragon-agent/tui/model/team/activity';
|
|
@@ -88,6 +89,11 @@ getModel) {
|
|
|
88
89
|
];
|
|
89
90
|
const extras = deps.extraToolsFor?.(spec) ?? [];
|
|
90
91
|
const imageSupportFor = deps.imageSupportFor;
|
|
92
|
+
// The gene tools delegate to this child's own FINAL `bash`, which does not exist yet: the holder
|
|
93
|
+
// is filled in at the end of this function and read lazily at call time.
|
|
94
|
+
const finalTools = { current: [] };
|
|
95
|
+
const geneTools = deps.geneTools?.toolsFor(spec, createToolAccess(() => finalTools.current)) ?? [];
|
|
96
|
+
const geneHints = deps.geneTools?.hintsFor?.(spec);
|
|
91
97
|
const built = createBuiltinTools({
|
|
92
98
|
getCwd: deps.getCwd,
|
|
93
99
|
confirmTools: deps.confirmTools,
|
|
@@ -178,6 +184,11 @@ getModel) {
|
|
|
178
184
|
// Role tools ride the same slot as the comm tools (governance-mode 14.3). A spread
|
|
179
185
|
// only when a governed dispatch supplied some, so every other child is unchanged.
|
|
180
186
|
teamTools: extras.length > 0 ? [...commTools, ...extras] : commTools,
|
|
187
|
+
// Spread only for a child that was handed the library, so every other child's options bag (and
|
|
188
|
+
// therefore its tool array) is the one it always was. The tools join INSIDE the factory so the
|
|
189
|
+
// plan gate, the ceiling and the permission filter wrap `gene_run` exactly like `bash`.
|
|
190
|
+
...(geneTools.length > 0 ? { geneTools } : {}),
|
|
191
|
+
...(geneHints ? { geneHints } : {}),
|
|
181
192
|
// `spec.readOnly` forces the plan gate on for this child even in a BUILD
|
|
182
193
|
// session. TIGHTENING ONLY (D-13): there is no field anywhere that gives a
|
|
183
194
|
// child more permission than the session it was spawned from. Read LIVE, so
|
|
@@ -206,11 +217,36 @@ getModel) {
|
|
|
206
217
|
}
|
|
207
218
|
: {}),
|
|
208
219
|
});
|
|
209
|
-
const
|
|
220
|
+
const narrowed = deps.narrowToolsFor ? deps.narrowToolsFor(spec, built) : built;
|
|
221
|
+
// `gene_run` FOLLOWS `bash` (9.6): a child whose shell was removed or narrowed away (a governed
|
|
222
|
+
// inspector without integration commands, `--deny-tool bash`) must not be advertised a tool it
|
|
223
|
+
// can only be refused.
|
|
224
|
+
const tools = withoutOrphanGeneRun(narrowed);
|
|
210
225
|
// Mail rides on the NEXT tool result of whatever the child does next (D-4), so
|
|
211
226
|
// every tool it can call has to carry the tail — the comm tools included, or a
|
|
212
227
|
// child that only ever messages would never receive.
|
|
213
|
-
|
|
228
|
+
const finished = tools.map((t) => withMailboxTail(t, deps.bus, spec.label));
|
|
229
|
+
finalTools.current = finished;
|
|
230
|
+
return finished;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* The two gene blocks for a child's system prompt, or nothing at all.
|
|
234
|
+
*
|
|
235
|
+
* The zone is only ever spliced WITH the rules block: a context zone whose authority claim
|
|
236
|
+
* ("advisory data, never instructions") is missing would be previews with no frame, and a rules
|
|
237
|
+
* block that names tools the child lacks would be an order it cannot follow. Both come from
|
|
238
|
+
* `deps.geneTools` and are `''` (hence omitted) whenever the child has no `gene_search` /
|
|
239
|
+
* `gene_read` in its FINAL tool array.
|
|
240
|
+
*/
|
|
241
|
+
function geneBlocksFor(spec, deps, tools) {
|
|
242
|
+
const gene = deps.geneTools;
|
|
243
|
+
if (gene === undefined)
|
|
244
|
+
return {};
|
|
245
|
+
const rules = gene.rulesBlock(tools.map((t) => t.name));
|
|
246
|
+
if (rules.length === 0)
|
|
247
|
+
return {};
|
|
248
|
+
const context = gene.contextFor(spec.label);
|
|
249
|
+
return { geneRulesBlock: rules, ...(context.length > 0 ? { geneContextBlock: context } : {}) };
|
|
214
250
|
}
|
|
215
251
|
/**
|
|
216
252
|
* Construct a child and wire its instrumentation.
|
|
@@ -311,6 +347,7 @@ export function createSubagent(spec, deps, hooks) {
|
|
|
311
347
|
// THE CHILD'S HALF OF THE RED TEAM INHERITANCE (D-8 / D-16). `''` for every session without
|
|
312
348
|
// the mode, and `buildSystemPrompt` splices conditionally, so those prompts are unchanged.
|
|
313
349
|
...(deps.redteamBlock ? { redteamBlock: deps.redteamBlock() } : {}),
|
|
350
|
+
...geneBlocksFor(spec, deps, tools),
|
|
314
351
|
});
|
|
315
352
|
// LAZY ACCESSORS OVER `agentRef`, WHICH IS ASSIGNED AFTER THIS RETURNS. A
|
|
316
353
|
// non-lazy read here is `undefined` at construction and the child's estimate
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import type { FilePatch } from '@aragon-agent/tui/model/tools/patch';
|
|
|
16
16
|
import type { ProcSupervisorPort } from '@aragon-agent/tui/model/proc/types';
|
|
17
17
|
import type { JobNotice } from '../proc/notices.js';
|
|
18
18
|
import { type ToolGate } from './tool-gate.js';
|
|
19
|
+
import { type GeneHintEngine } from '../gene/hints.js';
|
|
19
20
|
import { type ToolHookRunner } from '../exec/hooks/tool-wrapper.js';
|
|
20
21
|
export interface ConfirmRequest {
|
|
21
22
|
tool: string;
|
|
@@ -240,6 +241,30 @@ export interface BuiltinToolsOptions {
|
|
|
240
241
|
* existed, which is provable by identity (I-2).
|
|
241
242
|
*/
|
|
242
243
|
memoryTools?: AgentTool[];
|
|
244
|
+
/**
|
|
245
|
+
* `gene_search` / `gene_read` / `gene_feedback` / `gene_run`, appended verbatim (gene-bank 9.1).
|
|
246
|
+
*
|
|
247
|
+
* THROUGH THE FACTORY FOR THE REASON `memoryTools` RECORDS, with one more reason that is the
|
|
248
|
+
* point of this option: `gene_run` has to sit INSIDE the plan gate, the skill ceiling and the
|
|
249
|
+
* bridge approval wrappers applied below, exactly like `bash`. Appended after the factory
|
|
250
|
+
* returned, it would be the one tool in the array no gate had ever heard of. SPREAD
|
|
251
|
+
* CONDITIONALLY by the caller: with the library off (or headless without `--gene`) the options
|
|
252
|
+
* bag has no such key and the array is the one built before this feature existed, provable by
|
|
253
|
+
* identity (I-20). The tools are appended RAW - never wrapped by `geneHints` below.
|
|
254
|
+
*/
|
|
255
|
+
geneTools?: AgentTool[];
|
|
256
|
+
/**
|
|
257
|
+
* The stage-hint engine (gene-bank 9.4). When present, the built-in tools and the skill, process
|
|
258
|
+
* and job tools are decorated so a first-use / failure / retry lookup can append a hint to
|
|
259
|
+
* their results.
|
|
260
|
+
*
|
|
261
|
+
* THE DECORATION SITS INSIDE EVERY GATE: it is applied to the raw tools, before the
|
|
262
|
+
* confirmation, approval, hook, permission, ceiling and plan-mode wrappers, so a call that any
|
|
263
|
+
* of them refuses never reaches the engine and carries no hint. Absent, every tool object is
|
|
264
|
+
* untouched (I-20). The gene tools themselves, `ask_user`, `submit_plan` and `todo_write` are
|
|
265
|
+
* never decorated (`isHintableTool`).
|
|
266
|
+
*/
|
|
267
|
+
geneHints?: GeneHintEngine;
|
|
243
268
|
/**
|
|
244
269
|
* `submit_result`, appended verbatim when the caller supplied `--result-schema`
|
|
245
270
|
* (headless-request-scope-and-typed-result section 2.3.9).
|
|
@@ -438,7 +463,7 @@ export declare function gatedToolTimeouts(toolTimeoutMs: number, decisionBudgetM
|
|
|
438
463
|
* is the whole of what this mechanism is worth, and saying so plainly beats
|
|
439
464
|
* implying it covers more.
|
|
440
465
|
*/
|
|
441
|
-
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"];
|
|
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"];
|
|
442
467
|
/**
|
|
443
468
|
* The five tools plan mode refuses: exactly the complement of `SKILL_TOOL_FLOOR`
|
|
444
469
|
* within `HOST_TOOL_NAMES` — "the five that change something", the set this file
|
|
@@ -471,7 +496,7 @@ export declare const PLAN_MODE_BLOCKED_TOOLS: ReadonlySet<string>;
|
|
|
471
496
|
* declaration MEANS, and that reading must not change with how the CLI was
|
|
472
497
|
* started.
|
|
473
498
|
*/
|
|
474
|
-
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", "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"];
|
|
475
500
|
/**
|
|
476
501
|
* The three memory tools, as one constant (agent-memory 7.1).
|
|
477
502
|
*
|
|
@@ -480,4 +505,13 @@ export declare const HOST_TOOL_NAMES: readonly ["read_file", "write_file", "edit
|
|
|
480
505
|
* caller tools that are perfectly legitimate (`memory_search` is a very common name).
|
|
481
506
|
*/
|
|
482
507
|
export declare const MEMORY_TOOL_NAMES: readonly ["memory_search", "memory_read", "memory_write"];
|
|
508
|
+
/**
|
|
509
|
+
* The four gene-library tools, as one constant (gene-bank 9.1 / RV-13).
|
|
510
|
+
*
|
|
511
|
+
* Exported so `exec/bridge/server.ts` can SUBTRACT it from the bridge's default reserved-name
|
|
512
|
+
* set, exactly as it subtracts `MEMORY_TOOL_NAMES`: `aragon exec` does not enable the library
|
|
513
|
+
* unless `--gene` is passed, so reserving these names by default would reject a caller whose
|
|
514
|
+
* own tool is called `gene_search`. `--gene` adds them back.
|
|
515
|
+
*/
|
|
516
|
+
export declare const GENE_TOOL_NAMES: readonly ["gene_search", "gene_read", "gene_feedback", "gene_run"];
|
|
483
517
|
export declare function createBuiltinTools(options: BuiltinToolsOptions): AgentTool[];
|
package/dist/tools/index.js
CHANGED
|
@@ -16,6 +16,10 @@ import { makeGlob, makeGrep } from './search-tools.js';
|
|
|
16
16
|
import { makeBash } from './bash-tool.js';
|
|
17
17
|
import { withJobNoticeTail } from './job-tools.js';
|
|
18
18
|
import { withToolApproval } from './tool-gate.js';
|
|
19
|
+
// VALUE IMPORT: `withGeneHints` is a plain `{...tool, execute}` wrapper like the others here, and
|
|
20
|
+
// `gene/hints.ts` imports Core, the pure tui model and a TYPE of `GeneService` - nothing that
|
|
21
|
+
// leads back to this file (gene-bank 9.4).
|
|
22
|
+
import { withGeneHints } from '../gene/hints.js';
|
|
19
23
|
// VALUE IMPORTS, AND THE DIRECTION IS SAFE: `exec/hooks/tool-wrapper.ts` imports only Core
|
|
20
24
|
// and its own siblings, so `tools/index.ts -> exec/hooks -> (nothing back here)` is not a
|
|
21
25
|
// cycle. The wrappers are plain `{...tool, execute}` objects, exactly like the four this
|
|
@@ -94,8 +98,9 @@ export const SKILL_TOOL_FLOOR = [
|
|
|
94
98
|
// end iteration 2 of the skills work spent a round removing. Neither is a
|
|
95
99
|
// filesystem mutation, so the ceiling loses nothing it was protecting.
|
|
96
100
|
// (`submit_plan` does mutate the SESSION MODE, which is why the floor is now
|
|
97
|
-
// described as "everything that cannot write to
|
|
98
|
-
// "read-only"
|
|
101
|
+
// described as "everything that cannot write to the workspace" rather than
|
|
102
|
+
// "read-only"; the wording moved from "to disk" when `gene_feedback`, which appends
|
|
103
|
+
// a usage event under the home directory, joined it - gene-bank RV-16.)
|
|
99
104
|
'ask_user',
|
|
100
105
|
'submit_plan',
|
|
101
106
|
// `task` joins the floor rather than the blocked set (D-5), and the choice is
|
|
@@ -132,6 +137,16 @@ export const SKILL_TOOL_FLOOR = [
|
|
|
132
137
|
// test makes both choices conscious (agent-memory D-8).
|
|
133
138
|
'memory_search',
|
|
134
139
|
'memory_read',
|
|
140
|
+
// `gene_search` / `gene_read` / `gene_feedback` join the FLOOR for the reason the memory
|
|
141
|
+
// readers did (gene-bank 15.2): none of them writes the WORKSPACE. `gene_feedback` appends
|
|
142
|
+
// a usage event under the home directory - bookkeeping, the same class as `memory_read`
|
|
143
|
+
// updating nothing the user owns - and a skill whose `allowed-tools` omits it would
|
|
144
|
+
// otherwise be unable to consult the library at all. `gene_run` is the opposite: it runs a
|
|
145
|
+
// command, so it belongs to the BLOCKED set below. The partition test makes both choices
|
|
146
|
+
// conscious.
|
|
147
|
+
'gene_search',
|
|
148
|
+
'gene_read',
|
|
149
|
+
'gene_feedback',
|
|
135
150
|
];
|
|
136
151
|
/**
|
|
137
152
|
* The five tools plan mode refuses: exactly the complement of `SKILL_TOOL_FLOOR`
|
|
@@ -160,6 +175,10 @@ export const PLAN_MODE_BLOCKED_TOOLS = new Set([
|
|
|
160
175
|
// still save with Ctrl+M / `/memory save` (a UI action, not a tool call), and the tool's
|
|
161
176
|
// description tells the model to say so.
|
|
162
177
|
'memory_write',
|
|
178
|
+
// `gene_run` EXECUTES A COMMAND (gene-bank I-15): it is `bash` with a validated argv, so it
|
|
179
|
+
// is refused in plan mode exactly as `bash` is. The gate sits on the tool AND on the `bash`
|
|
180
|
+
// it delegates to, so neither route reaches the shell.
|
|
181
|
+
'gene_run',
|
|
163
182
|
]);
|
|
164
183
|
/**
|
|
165
184
|
* Every tool name this host CAN register (7 built-ins + 4 skill tools).
|
|
@@ -216,6 +235,10 @@ export const HOST_TOOL_NAMES = [
|
|
|
216
235
|
'memory_search',
|
|
217
236
|
'memory_read',
|
|
218
237
|
'memory_write',
|
|
238
|
+
'gene_search',
|
|
239
|
+
'gene_read',
|
|
240
|
+
'gene_feedback',
|
|
241
|
+
'gene_run',
|
|
219
242
|
// `submit_result` (headless-request-scope-and-typed-result section 2.3.9) belongs to
|
|
220
243
|
// the superset for the reason the two job names above do: a skill's
|
|
221
244
|
// `allowed-tools: [submit_result]` must be answerable, and `--allow-tool` /
|
|
@@ -239,6 +262,15 @@ export const HOST_TOOL_NAMES = [
|
|
|
239
262
|
* caller tools that are perfectly legitimate (`memory_search` is a very common name).
|
|
240
263
|
*/
|
|
241
264
|
export const MEMORY_TOOL_NAMES = ['memory_search', 'memory_read', 'memory_write'];
|
|
265
|
+
/**
|
|
266
|
+
* The four gene-library tools, as one constant (gene-bank 9.1 / RV-13).
|
|
267
|
+
*
|
|
268
|
+
* Exported so `exec/bridge/server.ts` can SUBTRACT it from the bridge's default reserved-name
|
|
269
|
+
* set, exactly as it subtracts `MEMORY_TOOL_NAMES`: `aragon exec` does not enable the library
|
|
270
|
+
* unless `--gene` is passed, so reserving these names by default would reject a caller whose
|
|
271
|
+
* own tool is called `gene_search`. `--gene` adds them back.
|
|
272
|
+
*/
|
|
273
|
+
export const GENE_TOOL_NAMES = ['gene_search', 'gene_read', 'gene_feedback', 'gene_run'];
|
|
242
274
|
function summarize(toolName, params) {
|
|
243
275
|
if (toolName === 'bash')
|
|
244
276
|
return `Run: ${String(params.command ?? '')}`;
|
|
@@ -359,7 +391,9 @@ export function createBuiltinTools(options) {
|
|
|
359
391
|
// The fourth, with the same two-interface note on `images` above.
|
|
360
392
|
...(options.images ? { images: options.images } : {}),
|
|
361
393
|
};
|
|
362
|
-
|
|
394
|
+
const hints = options.geneHints;
|
|
395
|
+
const hinted = (list) => hints ? list.map((tool) => withGeneHints(tool, hints)) : list;
|
|
396
|
+
let tools = hinted([
|
|
363
397
|
makeReadFile(deps),
|
|
364
398
|
makeWriteFile(deps),
|
|
365
399
|
makeEditFile(deps),
|
|
@@ -382,7 +416,7 @@ export function createBuiltinTools(options) {
|
|
|
382
416
|
...(options.jobTools && options.jobTools.length > 0 ? { jobsAvailable: () => true } : {}),
|
|
383
417
|
}
|
|
384
418
|
: {}),
|
|
385
|
-
];
|
|
419
|
+
]);
|
|
386
420
|
if (options.confirmTools && options.confirm) {
|
|
387
421
|
const confirm = options.confirm;
|
|
388
422
|
const bypass = options.confirmBypass;
|
|
@@ -392,7 +426,7 @@ export function createBuiltinTools(options) {
|
|
|
392
426
|
: t));
|
|
393
427
|
}
|
|
394
428
|
if (options.skillTools && options.skillTools.length > 0) {
|
|
395
|
-
tools = [...tools, ...options.skillTools];
|
|
429
|
+
tools = [...tools, ...hinted(options.skillTools)];
|
|
396
430
|
}
|
|
397
431
|
if (options.planTools && options.planTools.length > 0) {
|
|
398
432
|
tools = [...tools, ...options.planTools];
|
|
@@ -405,13 +439,13 @@ export function createBuiltinTools(options) {
|
|
|
405
439
|
// AFTER `todoTools`, BEFORE `teamTools`, so a lead's `task` stays last and
|
|
406
440
|
// `HOST_TOOL_NAMES` changes by two insertions rather than a reshuffle.
|
|
407
441
|
if (options.procTools && options.procTools.length > 0) {
|
|
408
|
-
tools = [...tools, ...options.procTools];
|
|
442
|
+
tools = [...tools, ...hinted(options.procTools)];
|
|
409
443
|
}
|
|
410
444
|
// AFTER `procTools` (long-task-jobs §5.2): the job tools are the third group of
|
|
411
445
|
// server-side handles and belong with the two they extend. A lead's `task` is
|
|
412
446
|
// still last.
|
|
413
447
|
if (options.jobTools && options.jobTools.length > 0) {
|
|
414
|
-
tools = [...tools, ...options.jobTools];
|
|
448
|
+
tools = [...tools, ...hinted(options.jobTools)];
|
|
415
449
|
}
|
|
416
450
|
// AFTER `jobTools` and BEFORE `resultTool` (agent-memory 7.1): the memory tools are the
|
|
417
451
|
// fourth group of host-side handles, and `HOST_TOOL_NAMES` places them between `job_list`
|
|
@@ -419,6 +453,13 @@ export function createBuiltinTools(options) {
|
|
|
419
453
|
if (options.memoryTools && options.memoryTools.length > 0) {
|
|
420
454
|
tools = [...tools, ...options.memoryTools];
|
|
421
455
|
}
|
|
456
|
+
// AFTER `memoryTools`, BEFORE `resultTool` (gene-bank 9.1): the fifth group of host-side handles,
|
|
457
|
+
// and `HOST_TOOL_NAMES` places the four names between `memory_write` and `submit_result`. RAW,
|
|
458
|
+
// never `hinted(...)`: a hint on a library lookup would be the library advertising itself, and
|
|
459
|
+
// `gene_run` must reach the gates below exactly as `bash` does.
|
|
460
|
+
if (options.geneTools && options.geneTools.length > 0) {
|
|
461
|
+
tools = [...tools, ...options.geneTools];
|
|
462
|
+
}
|
|
422
463
|
// AFTER `jobTools`, BEFORE `teamTools`: `submit_result` is the answer-shaped sibling
|
|
423
464
|
// of the plan tools rather than a team tool, and keeping a lead's `task` last means
|
|
424
465
|
// `HOST_TOOL_NAMES` grows by one insertion instead of a reshuffle
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aragon-agent/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.56",
|
|
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.68",
|
|
62
|
+
"@aragon-agent/tui": "0.0.9",
|
|
63
63
|
"commander": "^12.1.0",
|
|
64
64
|
"dotenv": "^16.6.1",
|
|
65
65
|
"env-paths": "^3.0.0",
|