@aragon-agent/cli 0.6.54 → 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 -2838
- package/README.md +4226 -4042
- package/dist/agent/controller.d.ts +119 -0
- package/dist/agent/controller.js +365 -2
- package/dist/agent/governance-wiring.js +8 -1
- package/dist/agent/redteam-prompt.d.ts +47 -0
- package/dist/agent/redteam-prompt.js +161 -0
- package/dist/agent/redteam-wiring.d.ts +159 -0
- package/dist/agent/redteam-wiring.js +349 -0
- package/dist/agent/system-prompt.d.ts +39 -0
- package/dist/agent/system-prompt.js +18 -0
- package/dist/app/App.d.ts +10 -1
- package/dist/app/App.js +233 -24
- package/dist/app/use-redteam-mode.d.ts +56 -0
- package/dist/app/use-redteam-mode.js +121 -0
- package/dist/cli.js +82 -4
- package/dist/commands/builtins.js +43 -1
- package/dist/commands/catalog.js +5 -0
- package/dist/commands/index-build.js +2 -1
- package/dist/commands/redteam-command.d.ts +22 -0
- package/dist/commands/redteam-command.js +141 -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 +3 -1
- package/dist/config/env.js +23 -1
- package/dist/config/load.d.ts +22 -0
- package/dist/config/load.js +22 -2
- package/dist/config/redteam-launch.d.ts +77 -0
- package/dist/config/redteam-launch.js +58 -0
- package/dist/config/store.js +21 -1
- package/dist/config/ui-state.d.ts +44 -0
- package/dist/config/ui-state.js +38 -0
- 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/controller-factory.d.ts +8 -0
- package/dist/host/controller-factory.js +7 -0
- 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/session/checkpoint.d.ts +15 -0
- package/dist/session/checkpoint.js +18 -0
- package/dist/session/persist.d.ts +21 -0
- package/dist/session/persist.js +10 -0
- package/dist/session/startup-session.d.ts +11 -2
- package/dist/session/startup-session.js +12 -2
- package/dist/session/validate-session.js +31 -0
- package/dist/team/runtime.d.ts +16 -0
- package/dist/team/runtime.js +29 -0
- package/dist/team/subagent.d.ts +55 -0
- package/dist/team/subagent.js +46 -2
- package/dist/tools/index.d.ts +60 -2
- package/dist/tools/index.js +68 -10
- package/package.json +3 -3
- package/skills/project-indexer/SKILL.md +275 -147
- package/skills/project-indexer/templates/artifact-hygiene-template.md +14 -0
- package/skills/project-indexer/templates/config-template.md +12 -0
- package/skills/project-indexer/templates/index-template.md +4 -0
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;
|
|
@@ -81,6 +82,30 @@ export interface BuiltinToolsOptions {
|
|
|
81
82
|
confirmTools?: boolean;
|
|
82
83
|
/** Awaited before a mutating tool runs; resolve `false` to cancel. */
|
|
83
84
|
confirm?: (req: ConfirmRequest) => Promise<boolean>;
|
|
85
|
+
/**
|
|
86
|
+
* Read AT CALL TIME: red team mode is armed and its bypass applies
|
|
87
|
+
* (red-team-security-mode 4.5 / I-5).
|
|
88
|
+
*
|
|
89
|
+
* A FUNCTION, NOT A BOOLEAN. The tool array is fixed once `new Agent(...)` returns, so a
|
|
90
|
+
* boolean would turn this feature into "active from the next launch"; `armed` changes on a
|
|
91
|
+
* keystroke.
|
|
92
|
+
*
|
|
93
|
+
* IT IS READ IN EXACTLY ONE PLACE (`withConfirmation`) AND NOWHERE ELSE. Plan mode's gate and
|
|
94
|
+
* the governance gate are wrapped OUTSIDE it, so an armed + PLAN turn never reaches the code
|
|
95
|
+
* that consults this - a structural guarantee rather than a promise (I-6 / R-4).
|
|
96
|
+
*
|
|
97
|
+
* Omitting it (every caller but `AgentController`) leaves the confirm wrapper exactly as it
|
|
98
|
+
* was, which is what keeps every other host's tool behaviour byte-identical.
|
|
99
|
+
*/
|
|
100
|
+
confirmBypass?: () => boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Called once per BYPASSED call with the tool's name, never its arguments.
|
|
103
|
+
*
|
|
104
|
+
* This is the audit trail that answers "what did it run without asking me", and the reason it
|
|
105
|
+
* is a callback rather than a `getLogger()` call here: `tools/` has no logger import, and the
|
|
106
|
+
* controller already owns the `redteam.*` event vocabulary (D-9 / R-12).
|
|
107
|
+
*/
|
|
108
|
+
onConfirmBypass?: (tool: string) => void;
|
|
84
109
|
/**
|
|
85
110
|
* `skill` / `skill_install` / `skill_create`, appended verbatim.
|
|
86
111
|
*
|
|
@@ -216,6 +241,30 @@ export interface BuiltinToolsOptions {
|
|
|
216
241
|
* existed, which is provable by identity (I-2).
|
|
217
242
|
*/
|
|
218
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;
|
|
219
268
|
/**
|
|
220
269
|
* `submit_result`, appended verbatim when the caller supplied `--result-schema`
|
|
221
270
|
* (headless-request-scope-and-typed-result section 2.3.9).
|
|
@@ -414,7 +463,7 @@ export declare function gatedToolTimeouts(toolTimeoutMs: number, decisionBudgetM
|
|
|
414
463
|
* is the whole of what this mechanism is worth, and saying so plainly beats
|
|
415
464
|
* implying it covers more.
|
|
416
465
|
*/
|
|
417
|
-
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"];
|
|
418
467
|
/**
|
|
419
468
|
* The five tools plan mode refuses: exactly the complement of `SKILL_TOOL_FLOOR`
|
|
420
469
|
* within `HOST_TOOL_NAMES` — "the five that change something", the set this file
|
|
@@ -447,7 +496,7 @@ export declare const PLAN_MODE_BLOCKED_TOOLS: ReadonlySet<string>;
|
|
|
447
496
|
* declaration MEANS, and that reading must not change with how the CLI was
|
|
448
497
|
* started.
|
|
449
498
|
*/
|
|
450
|
-
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"];
|
|
451
500
|
/**
|
|
452
501
|
* The three memory tools, as one constant (agent-memory 7.1).
|
|
453
502
|
*
|
|
@@ -456,4 +505,13 @@ export declare const HOST_TOOL_NAMES: readonly ["read_file", "write_file", "edit
|
|
|
456
505
|
* caller tools that are perfectly legitimate (`memory_search` is a very common name).
|
|
457
506
|
*/
|
|
458
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"];
|
|
459
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 ?? '')}`;
|
|
@@ -248,12 +280,25 @@ function summarize(toolName, params) {
|
|
|
248
280
|
return `Edit: ${String(params.path ?? '')}`;
|
|
249
281
|
return toolName;
|
|
250
282
|
}
|
|
251
|
-
/**
|
|
252
|
-
|
|
283
|
+
/**
|
|
284
|
+
* Wrap a tool so its execution is gated behind a confirmation callback.
|
|
285
|
+
*
|
|
286
|
+
* `bypass` IS CHECKED FIRST AND COSTS NO `confirm` CALL (red-team-security-mode 4.5): when it
|
|
287
|
+
* answers true the tool runs immediately and `onBypass` records the fact. The order is the whole
|
|
288
|
+
* contract - a bypass consulted AFTER the dialog had been shown would be a slower way of asking.
|
|
289
|
+
*/
|
|
290
|
+
function withConfirmation(tool, confirm, bypass, onBypass) {
|
|
253
291
|
const original = tool.execute;
|
|
254
292
|
return {
|
|
255
293
|
...tool,
|
|
256
294
|
async execute(id, params, ctx) {
|
|
295
|
+
if (bypass?.() === true) {
|
|
296
|
+
// THE AUDIT LINE, and it carries the tool name ONLY. Deliberately no arguments: a
|
|
297
|
+
// command line can hold a credential, and this is the one log in the product that is
|
|
298
|
+
// written while a user believes they are not being asked.
|
|
299
|
+
onBypass?.(tool.name);
|
|
300
|
+
return original(id, params, ctx);
|
|
301
|
+
}
|
|
257
302
|
const approved = await confirm({
|
|
258
303
|
tool: tool.name,
|
|
259
304
|
summary: summarize(tool.name, params),
|
|
@@ -346,7 +391,9 @@ export function createBuiltinTools(options) {
|
|
|
346
391
|
// The fourth, with the same two-interface note on `images` above.
|
|
347
392
|
...(options.images ? { images: options.images } : {}),
|
|
348
393
|
};
|
|
349
|
-
|
|
394
|
+
const hints = options.geneHints;
|
|
395
|
+
const hinted = (list) => hints ? list.map((tool) => withGeneHints(tool, hints)) : list;
|
|
396
|
+
let tools = hinted([
|
|
350
397
|
makeReadFile(deps),
|
|
351
398
|
makeWriteFile(deps),
|
|
352
399
|
makeEditFile(deps),
|
|
@@ -369,13 +416,17 @@ export function createBuiltinTools(options) {
|
|
|
369
416
|
...(options.jobTools && options.jobTools.length > 0 ? { jobsAvailable: () => true } : {}),
|
|
370
417
|
}
|
|
371
418
|
: {}),
|
|
372
|
-
];
|
|
419
|
+
]);
|
|
373
420
|
if (options.confirmTools && options.confirm) {
|
|
374
421
|
const confirm = options.confirm;
|
|
375
|
-
|
|
422
|
+
const bypass = options.confirmBypass;
|
|
423
|
+
const onBypass = options.onConfirmBypass;
|
|
424
|
+
tools = tools.map((t) => (MUTATING_TOOLS.has(t.name)
|
|
425
|
+
? withConfirmation(t, confirm, bypass, onBypass)
|
|
426
|
+
: t));
|
|
376
427
|
}
|
|
377
428
|
if (options.skillTools && options.skillTools.length > 0) {
|
|
378
|
-
tools = [...tools, ...options.skillTools];
|
|
429
|
+
tools = [...tools, ...hinted(options.skillTools)];
|
|
379
430
|
}
|
|
380
431
|
if (options.planTools && options.planTools.length > 0) {
|
|
381
432
|
tools = [...tools, ...options.planTools];
|
|
@@ -388,13 +439,13 @@ export function createBuiltinTools(options) {
|
|
|
388
439
|
// AFTER `todoTools`, BEFORE `teamTools`, so a lead's `task` stays last and
|
|
389
440
|
// `HOST_TOOL_NAMES` changes by two insertions rather than a reshuffle.
|
|
390
441
|
if (options.procTools && options.procTools.length > 0) {
|
|
391
|
-
tools = [...tools, ...options.procTools];
|
|
442
|
+
tools = [...tools, ...hinted(options.procTools)];
|
|
392
443
|
}
|
|
393
444
|
// AFTER `procTools` (long-task-jobs §5.2): the job tools are the third group of
|
|
394
445
|
// server-side handles and belong with the two they extend. A lead's `task` is
|
|
395
446
|
// still last.
|
|
396
447
|
if (options.jobTools && options.jobTools.length > 0) {
|
|
397
|
-
tools = [...tools, ...options.jobTools];
|
|
448
|
+
tools = [...tools, ...hinted(options.jobTools)];
|
|
398
449
|
}
|
|
399
450
|
// AFTER `jobTools` and BEFORE `resultTool` (agent-memory 7.1): the memory tools are the
|
|
400
451
|
// fourth group of host-side handles, and `HOST_TOOL_NAMES` places them between `job_list`
|
|
@@ -402,6 +453,13 @@ export function createBuiltinTools(options) {
|
|
|
402
453
|
if (options.memoryTools && options.memoryTools.length > 0) {
|
|
403
454
|
tools = [...tools, ...options.memoryTools];
|
|
404
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
|
+
}
|
|
405
463
|
// AFTER `jobTools`, BEFORE `teamTools`: `submit_result` is the answer-shaped sibling
|
|
406
464
|
// of the plan tools rather than a team tool, and keeping a lead's `task` last means
|
|
407
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",
|