@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.
Files changed (346) hide show
  1. package/CHANGELOG.md +2912 -2838
  2. package/README.md +4226 -4042
  3. package/dist/agent/controller.d.ts +119 -0
  4. package/dist/agent/controller.js +365 -2
  5. package/dist/agent/governance-wiring.js +8 -1
  6. package/dist/agent/redteam-prompt.d.ts +47 -0
  7. package/dist/agent/redteam-prompt.js +161 -0
  8. package/dist/agent/redteam-wiring.d.ts +159 -0
  9. package/dist/agent/redteam-wiring.js +349 -0
  10. package/dist/agent/system-prompt.d.ts +39 -0
  11. package/dist/agent/system-prompt.js +18 -0
  12. package/dist/app/App.d.ts +10 -1
  13. package/dist/app/App.js +233 -24
  14. package/dist/app/use-redteam-mode.d.ts +56 -0
  15. package/dist/app/use-redteam-mode.js +121 -0
  16. package/dist/cli.js +82 -4
  17. package/dist/commands/builtins.js +43 -1
  18. package/dist/commands/catalog.js +5 -0
  19. package/dist/commands/index-build.js +2 -1
  20. package/dist/commands/redteam-command.d.ts +22 -0
  21. package/dist/commands/redteam-command.js +141 -0
  22. package/dist/commands/registry.d.ts +8 -0
  23. package/dist/config/app-paths.d.ts +10 -0
  24. package/dist/config/app-paths.js +12 -0
  25. package/dist/config/cli-commands.d.ts +29 -0
  26. package/dist/config/cli-commands.js +76 -1
  27. package/dist/config/env.d.ts +3 -1
  28. package/dist/config/env.js +23 -1
  29. package/dist/config/load.d.ts +22 -0
  30. package/dist/config/load.js +22 -2
  31. package/dist/config/redteam-launch.d.ts +77 -0
  32. package/dist/config/redteam-launch.js +58 -0
  33. package/dist/config/store.js +21 -1
  34. package/dist/config/ui-state.d.ts +44 -0
  35. package/dist/config/ui-state.js +38 -0
  36. package/dist/exec/bridge/server.d.ts +7 -0
  37. package/dist/exec/bridge/server.js +6 -2
  38. package/dist/exec/cli-commands.js +4 -0
  39. package/dist/exec/index.js +2 -0
  40. package/dist/exec/options.d.ts +11 -0
  41. package/dist/exec/options.js +21 -1
  42. package/dist/gene/block.d.ts +33 -0
  43. package/dist/gene/block.js +51 -0
  44. package/dist/gene/capacity.d.ts +74 -0
  45. package/dist/gene/capacity.js +169 -0
  46. package/dist/gene/catalog-reconcile.d.ts +13 -0
  47. package/dist/gene/catalog-reconcile.js +105 -0
  48. package/dist/gene/catalog-stats.d.ts +27 -0
  49. package/dist/gene/catalog-stats.js +89 -0
  50. package/dist/gene/catalog-sync.d.ts +82 -0
  51. package/dist/gene/catalog-sync.js +324 -0
  52. package/dist/gene/catalog.d.ts +160 -0
  53. package/dist/gene/catalog.js +433 -0
  54. package/dist/gene/cli-commands.d.ts +50 -0
  55. package/dist/gene/cli-commands.js +500 -0
  56. package/dist/gene/command-report.d.ts +40 -0
  57. package/dist/gene/command-report.js +246 -0
  58. package/dist/gene/command.d.ts +29 -0
  59. package/dist/gene/command.js +561 -0
  60. package/dist/gene/commit-apply-types.d.ts +13 -0
  61. package/dist/gene/commit-apply-types.js +1 -0
  62. package/dist/gene/commit-compound.d.ts +34 -0
  63. package/dist/gene/commit-compound.js +212 -0
  64. package/dist/gene/commit-counts.d.ts +41 -0
  65. package/dist/gene/commit-counts.js +70 -0
  66. package/dist/gene/commit-exec.d.ts +42 -0
  67. package/dist/gene/commit-exec.js +134 -0
  68. package/dist/gene/commit-head.d.ts +52 -0
  69. package/dist/gene/commit-head.js +97 -0
  70. package/dist/gene/commit-plan.d.ts +95 -0
  71. package/dist/gene/commit-plan.js +68 -0
  72. package/dist/gene/commit-prepare.d.ts +63 -0
  73. package/dist/gene/commit-prepare.js +159 -0
  74. package/dist/gene/commit-types.d.ts +234 -0
  75. package/dist/gene/commit-types.js +3 -0
  76. package/dist/gene/curator/agent.d.ts +137 -0
  77. package/dist/gene/curator/agent.js +203 -0
  78. package/dist/gene/curator/budget.d.ts +69 -0
  79. package/dist/gene/curator/budget.js +131 -0
  80. package/dist/gene/curator/conflicts.d.ts +54 -0
  81. package/dist/gene/curator/conflicts.js +143 -0
  82. package/dist/gene/curator/curator.d.ts +170 -0
  83. package/dist/gene/curator/curator.js +617 -0
  84. package/dist/gene/curator/deps.d.ts +34 -0
  85. package/dist/gene/curator/deps.js +48 -0
  86. package/dist/gene/curator/deterministic.d.ts +62 -0
  87. package/dist/gene/curator/deterministic.js +287 -0
  88. package/dist/gene/curator/executors.d.ts +36 -0
  89. package/dist/gene/curator/executors.js +379 -0
  90. package/dist/gene/curator/lanes.d.ts +52 -0
  91. package/dist/gene/curator/lanes.js +99 -0
  92. package/dist/gene/curator/lease.d.ts +76 -0
  93. package/dist/gene/curator/lease.js +171 -0
  94. package/dist/gene/curator/library.d.ts +36 -0
  95. package/dist/gene/curator/library.js +169 -0
  96. package/dist/gene/curator/lifecycle.d.ts +52 -0
  97. package/dist/gene/curator/lifecycle.js +109 -0
  98. package/dist/gene/curator/maintenance.d.ts +71 -0
  99. package/dist/gene/curator/maintenance.js +213 -0
  100. package/dist/gene/curator/probation.d.ts +51 -0
  101. package/dist/gene/curator/probation.js +71 -0
  102. package/dist/gene/curator/probe.d.ts +131 -0
  103. package/dist/gene/curator/probe.js +534 -0
  104. package/dist/gene/curator/prompt.d.ts +18 -0
  105. package/dist/gene/curator/prompt.js +128 -0
  106. package/dist/gene/curator/publish.d.ts +64 -0
  107. package/dist/gene/curator/publish.js +113 -0
  108. package/dist/gene/curator/recheck.d.ts +55 -0
  109. package/dist/gene/curator/recheck.js +103 -0
  110. package/dist/gene/curator/run-events.d.ts +63 -0
  111. package/dist/gene/curator/run-events.js +55 -0
  112. package/dist/gene/curator/similarity.d.ts +13 -0
  113. package/dist/gene/curator/similarity.js +46 -0
  114. package/dist/gene/curator/switches.d.ts +78 -0
  115. package/dist/gene/curator/switches.js +146 -0
  116. package/dist/gene/curator/task-context.d.ts +93 -0
  117. package/dist/gene/curator/task-context.js +63 -0
  118. package/dist/gene/curator/task-runner.d.ts +56 -0
  119. package/dist/gene/curator/task-runner.js +257 -0
  120. package/dist/gene/curator/tool-support.d.ts +112 -0
  121. package/dist/gene/curator/tool-support.js +197 -0
  122. package/dist/gene/curator/toolkit.d.ts +49 -0
  123. package/dist/gene/curator/toolkit.js +104 -0
  124. package/dist/gene/curator/tools-read.d.ts +4 -0
  125. package/dist/gene/curator/tools-read.js +177 -0
  126. package/dist/gene/curator/tools-release.d.ts +73 -0
  127. package/dist/gene/curator/tools-release.js +287 -0
  128. package/dist/gene/curator/tools-verify.d.ts +47 -0
  129. package/dist/gene/curator/tools-verify.js +202 -0
  130. package/dist/gene/curator/tools-write.d.ts +26 -0
  131. package/dist/gene/curator/tools-write.js +394 -0
  132. package/dist/gene/curator/tools.d.ts +23 -0
  133. package/dist/gene/curator/tools.js +21 -0
  134. package/dist/gene/curator/validate/common.d.ts +87 -0
  135. package/dist/gene/curator/validate/common.js +132 -0
  136. package/dist/gene/curator/validate/evidence-tokens.d.ts +36 -0
  137. package/dist/gene/curator/validate/evidence-tokens.js +139 -0
  138. package/dist/gene/curator/validate/index.d.ts +23 -0
  139. package/dist/gene/curator/validate/index.js +62 -0
  140. package/dist/gene/curator/validate/knowledge.d.ts +25 -0
  141. package/dist/gene/curator/validate/knowledge.js +216 -0
  142. package/dist/gene/curator/validate/live-check.d.ts +14 -0
  143. package/dist/gene/curator/validate/live-check.js +144 -0
  144. package/dist/gene/curator/validate/ports.d.ts +67 -0
  145. package/dist/gene/curator/validate/ports.js +1 -0
  146. package/dist/gene/curator/validate/prompts.d.ts +41 -0
  147. package/dist/gene/curator/validate/prompts.js +161 -0
  148. package/dist/gene/curator/validate/skill.d.ts +15 -0
  149. package/dist/gene/curator/validate/skill.js +251 -0
  150. package/dist/gene/curator/validate/tool.d.ts +6 -0
  151. package/dist/gene/curator/validate/tool.js +217 -0
  152. package/dist/gene/curator/validate/types.d.ts +90 -0
  153. package/dist/gene/curator/validate/types.js +1 -0
  154. package/dist/gene/curator/validator-ports.d.ts +38 -0
  155. package/dist/gene/curator/validator-ports.js +29 -0
  156. package/dist/gene/diag.d.ts +209 -0
  157. package/dist/gene/diag.js +549 -0
  158. package/dist/gene/env.d.ts +10 -0
  159. package/dist/gene/env.js +214 -0
  160. package/dist/gene/eval-recorder.d.ts +84 -0
  161. package/dist/gene/eval-recorder.js +222 -0
  162. package/dist/gene/explain-transport.d.ts +3 -0
  163. package/dist/gene/explain-transport.js +39 -0
  164. package/dist/gene/explain.d.ts +96 -0
  165. package/dist/gene/explain.js +293 -0
  166. package/dist/gene/fs.d.ts +39 -0
  167. package/dist/gene/fs.js +139 -0
  168. package/dist/gene/fsck.d.ts +68 -0
  169. package/dist/gene/fsck.js +134 -0
  170. package/dist/gene/gc-library-sweeps.d.ts +9 -0
  171. package/dist/gene/gc-library-sweeps.js +220 -0
  172. package/dist/gene/gc-rejected-set.d.ts +15 -0
  173. package/dist/gene/gc-rejected-set.js +63 -0
  174. package/dist/gene/gc-safe.d.ts +12 -0
  175. package/dist/gene/gc-safe.js +74 -0
  176. package/dist/gene/gc-scope-sweeps.d.ts +18 -0
  177. package/dist/gene/gc-scope-sweeps.js +297 -0
  178. package/dist/gene/gc-types.d.ts +55 -0
  179. package/dist/gene/gc-types.js +26 -0
  180. package/dist/gene/gc.d.ts +42 -0
  181. package/dist/gene/gc.js +129 -0
  182. package/dist/gene/gene-errors.d.ts +23 -0
  183. package/dist/gene/gene-errors.js +29 -0
  184. package/dist/gene/hints.d.ts +91 -0
  185. package/dist/gene/hints.js +394 -0
  186. package/dist/gene/hub.d.ts +149 -0
  187. package/dist/gene/hub.js +371 -0
  188. package/dist/gene/import-plan.d.ts +80 -0
  189. package/dist/gene/import-plan.js +294 -0
  190. package/dist/gene/import-proposal.d.ts +23 -0
  191. package/dist/gene/import-proposal.js +101 -0
  192. package/dist/gene/import-skill-port.d.ts +6 -0
  193. package/dist/gene/import-skill-port.js +53 -0
  194. package/dist/gene/import-sources.d.ts +48 -0
  195. package/dist/gene/import-sources.js +140 -0
  196. package/dist/gene/index-writer.d.ts +36 -0
  197. package/dist/gene/index-writer.js +101 -0
  198. package/dist/gene/learn/learn-call.d.ts +63 -0
  199. package/dist/gene/learn/learn-call.js +157 -0
  200. package/dist/gene/learn/learn-prompt.d.ts +51 -0
  201. package/dist/gene/learn/learn-prompt.js +245 -0
  202. package/dist/gene/learn/learner.d.ts +181 -0
  203. package/dist/gene/learn/learner.js +426 -0
  204. package/dist/gene/learn/ledger.d.ts +220 -0
  205. package/dist/gene/learn/ledger.js +394 -0
  206. package/dist/gene/learn/proposal-build.d.ts +83 -0
  207. package/dist/gene/learn/proposal-build.js +211 -0
  208. package/dist/gene/learn/proposal-guard.d.ts +43 -0
  209. package/dist/gene/learn/proposal-guard.js +37 -0
  210. package/dist/gene/learn/signals-port.d.ts +47 -0
  211. package/dist/gene/learn/signals-port.js +86 -0
  212. package/dist/gene/maintenance-paths.d.ts +7 -0
  213. package/dist/gene/maintenance-paths.js +20 -0
  214. package/dist/gene/maintenance-probation.d.ts +33 -0
  215. package/dist/gene/maintenance-probation.js +127 -0
  216. package/dist/gene/maintenance-proposals.d.ts +24 -0
  217. package/dist/gene/maintenance-proposals.js +68 -0
  218. package/dist/gene/maintenance-runner.d.ts +92 -0
  219. package/dist/gene/maintenance-runner.js +262 -0
  220. package/dist/gene/maintenance-tasks.d.ts +37 -0
  221. package/dist/gene/maintenance-tasks.js +95 -0
  222. package/dist/gene/manager-actions.d.ts +12 -0
  223. package/dist/gene/manager-actions.js +279 -0
  224. package/dist/gene/manager-approve.d.ts +29 -0
  225. package/dist/gene/manager-approve.js +84 -0
  226. package/dist/gene/manager-context.d.ts +90 -0
  227. package/dist/gene/manager-context.js +201 -0
  228. package/dist/gene/manager-detail.d.ts +17 -0
  229. package/dist/gene/manager-detail.js +313 -0
  230. package/dist/gene/manager-gc.d.ts +13 -0
  231. package/dist/gene/manager-gc.js +81 -0
  232. package/dist/gene/manager-library.d.ts +39 -0
  233. package/dist/gene/manager-library.js +90 -0
  234. package/dist/gene/manager-list.d.ts +27 -0
  235. package/dist/gene/manager-list.js +170 -0
  236. package/dist/gene/manager-queue.d.ts +16 -0
  237. package/dist/gene/manager-queue.js +124 -0
  238. package/dist/gene/manager-stats.d.ts +28 -0
  239. package/dist/gene/manager-stats.js +53 -0
  240. package/dist/gene/manager-view.d.ts +27 -0
  241. package/dist/gene/manager-view.js +124 -0
  242. package/dist/gene/manager.d.ts +56 -0
  243. package/dist/gene/manager.js +179 -0
  244. package/dist/gene/orphan-scopes.d.ts +37 -0
  245. package/dist/gene/orphan-scopes.js +150 -0
  246. package/dist/gene/paths.d.ts +73 -0
  247. package/dist/gene/paths.js +239 -0
  248. package/dist/gene/plan-content.d.ts +73 -0
  249. package/dist/gene/plan-content.js +522 -0
  250. package/dist/gene/plan-lifecycle.d.ts +29 -0
  251. package/dist/gene/plan-lifecycle.js +310 -0
  252. package/dist/gene/policy.d.ts +71 -0
  253. package/dist/gene/policy.js +313 -0
  254. package/dist/gene/project-learning.d.ts +25 -0
  255. package/dist/gene/project-learning.js +54 -0
  256. package/dist/gene/propagation.d.ts +48 -0
  257. package/dist/gene/propagation.js +45 -0
  258. package/dist/gene/queue-lock.d.ts +22 -0
  259. package/dist/gene/queue-lock.js +99 -0
  260. package/dist/gene/queue-record.d.ts +57 -0
  261. package/dist/gene/queue-record.js +145 -0
  262. package/dist/gene/queue.d.ts +235 -0
  263. package/dist/gene/queue.js +764 -0
  264. package/dist/gene/read.d.ts +61 -0
  265. package/dist/gene/read.js +252 -0
  266. package/dist/gene/runlog.d.ts +101 -0
  267. package/dist/gene/runlog.js +404 -0
  268. package/dist/gene/schema-lite.d.ts +24 -0
  269. package/dist/gene/schema-lite.js +159 -0
  270. package/dist/gene/scope-guard.d.ts +23 -0
  271. package/dist/gene/scope-guard.js +9 -0
  272. package/dist/gene/scope-lock.d.ts +48 -0
  273. package/dist/gene/scope-lock.js +222 -0
  274. package/dist/gene/scope-verify.d.ts +63 -0
  275. package/dist/gene/scope-verify.js +123 -0
  276. package/dist/gene/secrets.d.ts +43 -0
  277. package/dist/gene/secrets.js +161 -0
  278. package/dist/gene/service-context.d.ts +43 -0
  279. package/dist/gene/service-context.js +79 -0
  280. package/dist/gene/service-prepare.d.ts +25 -0
  281. package/dist/gene/service-prepare.js +219 -0
  282. package/dist/gene/service-types.d.ts +196 -0
  283. package/dist/gene/service-types.js +1 -0
  284. package/dist/gene/service-view.d.ts +41 -0
  285. package/dist/gene/service-view.js +69 -0
  286. package/dist/gene/service.d.ts +114 -0
  287. package/dist/gene/service.js +761 -0
  288. package/dist/gene/session-start.d.ts +36 -0
  289. package/dist/gene/session-start.js +212 -0
  290. package/dist/gene/store-port.d.ts +88 -0
  291. package/dist/gene/store-port.js +10 -0
  292. package/dist/gene/store-rows.d.ts +36 -0
  293. package/dist/gene/store-rows.js +72 -0
  294. package/dist/gene/store.d.ts +125 -0
  295. package/dist/gene/store.js +622 -0
  296. package/dist/gene/tombstones.d.ts +47 -0
  297. package/dist/gene/tombstones.js +61 -0
  298. package/dist/gene/tool-runner.d.ts +47 -0
  299. package/dist/gene/tool-runner.js +154 -0
  300. package/dist/gene/tool-screen.d.ts +41 -0
  301. package/dist/gene/tool-screen.js +227 -0
  302. package/dist/gene/tools.d.ts +112 -0
  303. package/dist/gene/tools.js +539 -0
  304. package/dist/gene/transfer.d.ts +85 -0
  305. package/dist/gene/transfer.js +433 -0
  306. package/dist/gene/ui-hints.d.ts +15 -0
  307. package/dist/gene/ui-hints.js +67 -0
  308. package/dist/gene/usage-fold-cursor.d.ts +24 -0
  309. package/dist/gene/usage-fold-cursor.js +115 -0
  310. package/dist/gene/usage-fold.d.ts +49 -0
  311. package/dist/gene/usage-fold.js +397 -0
  312. package/dist/gene/usage.d.ts +67 -0
  313. package/dist/gene/usage.js +231 -0
  314. package/dist/gene/version-service.d.ts +118 -0
  315. package/dist/gene/version-service.js +453 -0
  316. package/dist/gene/wiring-events.d.ts +43 -0
  317. package/dist/gene/wiring-events.js +113 -0
  318. package/dist/gene/wiring-models.d.ts +46 -0
  319. package/dist/gene/wiring-models.js +81 -0
  320. package/dist/gene/wiring.d.ts +200 -0
  321. package/dist/gene/wiring.js +764 -0
  322. package/dist/governance/prompts/orchestrator-block.js +3 -2
  323. package/dist/host/controller-factory.d.ts +8 -0
  324. package/dist/host/controller-factory.js +7 -0
  325. package/dist/host/gene.d.ts +26 -0
  326. package/dist/host/gene.js +24 -0
  327. package/dist/host/index.d.ts +1 -0
  328. package/dist/host/index.js +1 -0
  329. package/dist/session/checkpoint.d.ts +15 -0
  330. package/dist/session/checkpoint.js +18 -0
  331. package/dist/session/persist.d.ts +21 -0
  332. package/dist/session/persist.js +10 -0
  333. package/dist/session/startup-session.d.ts +11 -2
  334. package/dist/session/startup-session.js +12 -2
  335. package/dist/session/validate-session.js +31 -0
  336. package/dist/team/runtime.d.ts +16 -0
  337. package/dist/team/runtime.js +29 -0
  338. package/dist/team/subagent.d.ts +55 -0
  339. package/dist/team/subagent.js +46 -2
  340. package/dist/tools/index.d.ts +60 -2
  341. package/dist/tools/index.js +68 -10
  342. package/package.json +3 -3
  343. package/skills/project-indexer/SKILL.md +275 -147
  344. package/skills/project-indexer/templates/artifact-hygiene-template.md +14 -0
  345. package/skills/project-indexer/templates/config-template.md +12 -0
  346. package/skills/project-indexer/templates/index-template.md +4 -0
@@ -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[];
@@ -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 disk" rather than
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
- /** Wrap a tool so its execution is gated behind a confirmation callback. */
252
- function withConfirmation(tool, confirm) {
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
- let tools = [
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
- tools = tools.map((t) => (MUTATING_TOOLS.has(t.name) ? withConfirmation(t, confirm) : t));
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.54",
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.66",
62
- "@aragon-agent/tui": "0.0.7",
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",