agent-nuvira 3.3.1 → 3.3.4

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 (466) hide show
  1. package/README.md +18 -13
  2. package/dist/agent-sdk/src/agent.d.ts +2 -0
  3. package/dist/agent-sdk/src/agent.d.ts.map +1 -1
  4. package/dist/agent-sdk/src/define.d.ts +64 -0
  5. package/dist/agent-sdk/src/define.d.ts.map +1 -0
  6. package/dist/agent-sdk/src/define.js +76 -0
  7. package/dist/agent-sdk/src/define.js.map +1 -0
  8. package/dist/agent-sdk/src/index.d.ts +9 -0
  9. package/dist/agent-sdk/src/index.d.ts.map +1 -1
  10. package/dist/agent-sdk/src/index.js +9 -0
  11. package/dist/agent-sdk/src/index.js.map +1 -1
  12. package/dist/agent-sdk/src/scaffold.d.ts +11 -0
  13. package/dist/agent-sdk/src/scaffold.d.ts.map +1 -1
  14. package/dist/agent-sdk/src/scaffold.js +16 -6
  15. package/dist/agent-sdk/src/scaffold.js.map +1 -1
  16. package/dist/agents/agents/runner.d.ts +9 -0
  17. package/dist/agents/agents/runner.d.ts.map +1 -1
  18. package/dist/agents/agents/runner.js +34 -12
  19. package/dist/agents/agents/runner.js.map +1 -1
  20. package/dist/agents/agents/writer-tool-calling.d.ts.map +1 -1
  21. package/dist/agents/agents/writer-tool-calling.js +7 -2
  22. package/dist/agents/agents/writer-tool-calling.js.map +1 -1
  23. package/dist/agents/agents/writer.d.ts.map +1 -1
  24. package/dist/agents/agents/writer.js +7 -1
  25. package/dist/agents/agents/writer.js.map +1 -1
  26. package/dist/agents/artifact-verification.d.ts +102 -0
  27. package/dist/agents/artifact-verification.d.ts.map +1 -0
  28. package/dist/agents/artifact-verification.js +216 -0
  29. package/dist/agents/artifact-verification.js.map +1 -0
  30. package/dist/agents/checkpoint-store.d.ts +73 -0
  31. package/dist/agents/checkpoint-store.d.ts.map +1 -1
  32. package/dist/agents/checkpoint-store.js +161 -0
  33. package/dist/agents/checkpoint-store.js.map +1 -1
  34. package/dist/agents/credential-store.d.ts +120 -0
  35. package/dist/agents/credential-store.d.ts.map +1 -1
  36. package/dist/agents/credential-store.js +358 -19
  37. package/dist/agents/credential-store.js.map +1 -1
  38. package/dist/agents/long-form-plan.d.ts.map +1 -1
  39. package/dist/agents/long-form-plan.js +2 -1
  40. package/dist/agents/long-form-plan.js.map +1 -1
  41. package/dist/agents/orchestrator.d.ts +10 -1
  42. package/dist/agents/orchestrator.d.ts.map +1 -1
  43. package/dist/agents/orchestrator.js +239 -79
  44. package/dist/agents/orchestrator.js.map +1 -1
  45. package/dist/agents/phase-engine.d.ts +61 -0
  46. package/dist/agents/phase-engine.d.ts.map +1 -1
  47. package/dist/agents/phase-engine.js +68 -2
  48. package/dist/agents/phase-engine.js.map +1 -1
  49. package/dist/agents/prompt-assembly.d.ts +11 -0
  50. package/dist/agents/prompt-assembly.d.ts.map +1 -1
  51. package/dist/agents/prompt-assembly.js +17 -0
  52. package/dist/agents/prompt-assembly.js.map +1 -1
  53. package/dist/agents/release-preflight.d.ts +121 -0
  54. package/dist/agents/release-preflight.d.ts.map +1 -0
  55. package/dist/agents/release-preflight.js +259 -0
  56. package/dist/agents/release-preflight.js.map +1 -0
  57. package/dist/agents/release-runner.d.ts +157 -0
  58. package/dist/agents/release-runner.d.ts.map +1 -0
  59. package/dist/agents/release-runner.js +719 -0
  60. package/dist/agents/release-runner.js.map +1 -0
  61. package/dist/agents/step-handoff.d.ts +190 -0
  62. package/dist/agents/step-handoff.d.ts.map +1 -0
  63. package/dist/agents/step-handoff.js +443 -0
  64. package/dist/agents/step-handoff.js.map +1 -0
  65. package/dist/cli/agent.d.ts +2 -2
  66. package/dist/cli/agent.js +10 -10
  67. package/dist/cli/benchmark.d.ts.map +1 -1
  68. package/dist/cli/benchmark.js +11 -4
  69. package/dist/cli/benchmark.js.map +1 -1
  70. package/dist/cli/chat.d.ts +94 -0
  71. package/dist/cli/chat.d.ts.map +1 -1
  72. package/dist/cli/chat.js +379 -24
  73. package/dist/cli/chat.js.map +1 -1
  74. package/dist/cli/cli-program.d.ts.map +1 -1
  75. package/dist/cli/cli-program.js +8 -0
  76. package/dist/cli/cli-program.js.map +1 -1
  77. package/dist/cli/config.d.ts.map +1 -1
  78. package/dist/cli/config.js +9 -1
  79. package/dist/cli/config.js.map +1 -1
  80. package/dist/cli/credentials.d.ts +28 -0
  81. package/dist/cli/credentials.d.ts.map +1 -0
  82. package/dist/cli/credentials.js +213 -0
  83. package/dist/cli/credentials.js.map +1 -0
  84. package/dist/cli/doctor.d.ts.map +1 -1
  85. package/dist/cli/doctor.js +3 -2
  86. package/dist/cli/doctor.js.map +1 -1
  87. package/dist/cli/edit.js +2 -2
  88. package/dist/cli/eval.d.ts +17 -0
  89. package/dist/cli/eval.d.ts.map +1 -1
  90. package/dist/cli/eval.js +105 -2
  91. package/dist/cli/eval.js.map +1 -1
  92. package/dist/cli/execute.d.ts +16 -1
  93. package/dist/cli/execute.d.ts.map +1 -1
  94. package/dist/cli/execute.js +192 -22
  95. package/dist/cli/execute.js.map +1 -1
  96. package/dist/cli/failover-runner.d.ts.map +1 -1
  97. package/dist/cli/failover-runner.js +9 -3
  98. package/dist/cli/failover-runner.js.map +1 -1
  99. package/dist/cli/loop-executor.d.ts +55 -0
  100. package/dist/cli/loop-executor.d.ts.map +1 -1
  101. package/dist/cli/loop-executor.js +285 -19
  102. package/dist/cli/loop-executor.js.map +1 -1
  103. package/dist/cli/model.d.ts.map +1 -1
  104. package/dist/cli/model.js +9 -8
  105. package/dist/cli/model.js.map +1 -1
  106. package/dist/cli/models.d.ts +1 -1
  107. package/dist/cli/models.js +4 -4
  108. package/dist/cli/nlu.d.ts.map +1 -1
  109. package/dist/cli/nlu.js +8 -2
  110. package/dist/cli/nlu.js.map +1 -1
  111. package/dist/cli/parity.d.ts +85 -0
  112. package/dist/cli/parity.d.ts.map +1 -0
  113. package/dist/cli/parity.js +506 -0
  114. package/dist/cli/parity.js.map +1 -0
  115. package/dist/cli/plan.d.ts.map +1 -1
  116. package/dist/cli/plan.js +2 -1
  117. package/dist/cli/plan.js.map +1 -1
  118. package/dist/cli/publish.d.ts +22 -0
  119. package/dist/cli/publish.d.ts.map +1 -1
  120. package/dist/cli/publish.js +109 -13
  121. package/dist/cli/publish.js.map +1 -1
  122. package/dist/cli/retrieval.d.ts.map +1 -1
  123. package/dist/cli/retrieval.js +5 -4
  124. package/dist/cli/retrieval.js.map +1 -1
  125. package/dist/cli/sdk.js +4 -4
  126. package/dist/cli/sdk.js.map +1 -1
  127. package/dist/cli/trace.d.ts.map +1 -1
  128. package/dist/cli/trace.js +2 -1
  129. package/dist/cli/trace.js.map +1 -1
  130. package/dist/cli/workflow.js +2 -2
  131. package/dist/cli/workflow.js.map +1 -1
  132. package/dist/config/live-credentials.d.ts +57 -0
  133. package/dist/config/live-credentials.d.ts.map +1 -0
  134. package/dist/config/live-credentials.js +126 -0
  135. package/dist/config/live-credentials.js.map +1 -0
  136. package/dist/config/paths.d.ts +18 -0
  137. package/dist/config/paths.d.ts.map +1 -1
  138. package/dist/config/paths.js +25 -0
  139. package/dist/config/paths.js.map +1 -1
  140. package/dist/config/types.d.ts +44 -0
  141. package/dist/config/types.d.ts.map +1 -1
  142. package/dist/federation/a2a-types.js +1 -1
  143. package/dist/federation/a2a-types.js.map +1 -1
  144. package/dist/findings/verdicts.d.ts +241 -0
  145. package/dist/findings/verdicts.d.ts.map +1 -0
  146. package/dist/findings/verdicts.js +284 -0
  147. package/dist/findings/verdicts.js.map +1 -0
  148. package/dist/gateway/adapters.d.ts +65 -0
  149. package/dist/gateway/adapters.d.ts.map +1 -1
  150. package/dist/gateway/adapters.js +216 -10
  151. package/dist/gateway/adapters.js.map +1 -1
  152. package/dist/gateway/channel-directory.d.ts +31 -0
  153. package/dist/gateway/channel-directory.d.ts.map +1 -1
  154. package/dist/gateway/channel-directory.js +40 -0
  155. package/dist/gateway/channel-directory.js.map +1 -1
  156. package/dist/gateway/gateway-log.d.ts +1 -1
  157. package/dist/gateway/gateway-log.d.ts.map +1 -1
  158. package/dist/gateway/gateway-log.js.map +1 -1
  159. package/dist/gateway/hooks.d.ts +87 -19
  160. package/dist/gateway/hooks.d.ts.map +1 -1
  161. package/dist/gateway/hooks.js +62 -23
  162. package/dist/gateway/hooks.js.map +1 -1
  163. package/dist/gateway/inbound-media.d.ts +147 -0
  164. package/dist/gateway/inbound-media.d.ts.map +1 -0
  165. package/dist/gateway/inbound-media.js +317 -0
  166. package/dist/gateway/inbound-media.js.map +1 -0
  167. package/dist/gateway/inbox.d.ts +8 -1
  168. package/dist/gateway/inbox.d.ts.map +1 -1
  169. package/dist/gateway/inbox.js.map +1 -1
  170. package/dist/gateway/platform-config.d.ts +14 -0
  171. package/dist/gateway/platform-config.d.ts.map +1 -1
  172. package/dist/gateway/platform-config.js +26 -8
  173. package/dist/gateway/platform-config.js.map +1 -1
  174. package/dist/gateway/realtime.d.ts +114 -0
  175. package/dist/gateway/realtime.d.ts.map +1 -0
  176. package/dist/gateway/realtime.js +402 -0
  177. package/dist/gateway/realtime.js.map +1 -0
  178. package/dist/gateway/registry.d.ts +31 -0
  179. package/dist/gateway/registry.d.ts.map +1 -1
  180. package/dist/gateway/registry.js +224 -4
  181. package/dist/gateway/registry.js.map +1 -1
  182. package/dist/gateway/whatsapp/baileys-bridge.d.ts +11 -1
  183. package/dist/gateway/whatsapp/baileys-bridge.d.ts.map +1 -1
  184. package/dist/gateway/whatsapp/baileys-bridge.js +123 -4
  185. package/dist/gateway/whatsapp/baileys-bridge.js.map +1 -1
  186. package/dist/gateway/whatsapp/bridge.d.ts +6 -2
  187. package/dist/gateway/whatsapp/bridge.d.ts.map +1 -1
  188. package/dist/gateway/whatsapp/bridge.js.map +1 -1
  189. package/dist/index.js +8 -0
  190. package/dist/index.js.map +1 -1
  191. package/dist/inference/factory.d.ts +14 -0
  192. package/dist/inference/factory.d.ts.map +1 -1
  193. package/dist/inference/factory.js +17 -0
  194. package/dist/inference/factory.js.map +1 -1
  195. package/dist/inference/groq-adapter.d.ts +2 -0
  196. package/dist/inference/groq-adapter.d.ts.map +1 -1
  197. package/dist/inference/groq-adapter.js +16 -6
  198. package/dist/inference/groq-adapter.js.map +1 -1
  199. package/dist/inference/model-validator.d.ts +6 -1
  200. package/dist/inference/model-validator.d.ts.map +1 -1
  201. package/dist/inference/model-validator.js +7 -2
  202. package/dist/inference/model-validator.js.map +1 -1
  203. package/dist/inference/route-resolver.d.ts +116 -0
  204. package/dist/inference/route-resolver.d.ts.map +1 -0
  205. package/dist/inference/route-resolver.js +159 -0
  206. package/dist/inference/route-resolver.js.map +1 -0
  207. package/dist/inference/tools.d.ts.map +1 -1
  208. package/dist/inference/tools.js +29 -0
  209. package/dist/inference/tools.js.map +1 -1
  210. package/dist/learning/autonomy-policy.d.ts +18 -0
  211. package/dist/learning/autonomy-policy.d.ts.map +1 -1
  212. package/dist/learning/autonomy-policy.js +35 -0
  213. package/dist/learning/autonomy-policy.js.map +1 -1
  214. package/dist/learning/benchmark.d.ts.map +1 -1
  215. package/dist/learning/benchmark.js +3 -2
  216. package/dist/learning/benchmark.js.map +1 -1
  217. package/dist/learning/continuation.d.ts.map +1 -1
  218. package/dist/learning/continuation.js +2 -1
  219. package/dist/learning/continuation.js.map +1 -1
  220. package/dist/learning/cost-tracker.d.ts.map +1 -1
  221. package/dist/learning/cost-tracker.js +2 -1
  222. package/dist/learning/cost-tracker.js.map +1 -1
  223. package/dist/learning/deferred-task.d.ts.map +1 -1
  224. package/dist/learning/deferred-task.js +13 -4
  225. package/dist/learning/deferred-task.js.map +1 -1
  226. package/dist/learning/eval-framework.d.ts.map +1 -1
  227. package/dist/learning/eval-framework.js +2 -1
  228. package/dist/learning/eval-framework.js.map +1 -1
  229. package/dist/learning/long-form.d.ts.map +1 -1
  230. package/dist/learning/long-form.js +2 -1
  231. package/dist/learning/long-form.js.map +1 -1
  232. package/dist/learning/model-registry.d.ts.map +1 -1
  233. package/dist/learning/model-registry.js +2 -1
  234. package/dist/learning/model-registry.js.map +1 -1
  235. package/dist/learning/reasoning-cache.d.ts.map +1 -1
  236. package/dist/learning/reasoning-cache.js +2 -1
  237. package/dist/learning/reasoning-cache.js.map +1 -1
  238. package/dist/learning/reasoning-trace.d.ts +38 -2
  239. package/dist/learning/reasoning-trace.d.ts.map +1 -1
  240. package/dist/learning/reasoning-trace.js +91 -1
  241. package/dist/learning/reasoning-trace.js.map +1 -1
  242. package/dist/learning/resilient-call.d.ts.map +1 -1
  243. package/dist/learning/resilient-call.js +31 -18
  244. package/dist/learning/resilient-call.js.map +1 -1
  245. package/dist/learning/retrieval.d.ts.map +1 -1
  246. package/dist/learning/retrieval.js +2 -1
  247. package/dist/learning/retrieval.js.map +1 -1
  248. package/dist/learning/seeded-benchmark.d.ts +160 -0
  249. package/dist/learning/seeded-benchmark.d.ts.map +1 -0
  250. package/dist/learning/seeded-benchmark.js +321 -0
  251. package/dist/learning/seeded-benchmark.js.map +1 -0
  252. package/dist/learning/seeded-bugs.d.ts +142 -0
  253. package/dist/learning/seeded-bugs.d.ts.map +1 -0
  254. package/dist/learning/seeded-bugs.js +535 -0
  255. package/dist/learning/seeded-bugs.js.map +1 -0
  256. package/dist/learning/skill-store.d.ts.map +1 -1
  257. package/dist/learning/skill-store.js +30 -9
  258. package/dist/learning/skill-store.js.map +1 -1
  259. package/dist/learning/step-checkpoint.d.ts +127 -0
  260. package/dist/learning/step-checkpoint.d.ts.map +1 -0
  261. package/dist/learning/step-checkpoint.js +244 -0
  262. package/dist/learning/step-checkpoint.js.map +1 -0
  263. package/dist/mcp/catalog.js +2 -3
  264. package/dist/mcp/catalog.js.map +1 -1
  265. package/dist/mcp/manager.d.ts.map +1 -1
  266. package/dist/mcp/manager.js +5 -3
  267. package/dist/mcp/manager.js.map +1 -1
  268. package/dist/nlu/intent-confirm.d.ts +23 -1
  269. package/dist/nlu/intent-confirm.d.ts.map +1 -1
  270. package/dist/nlu/intent-confirm.js +85 -2
  271. package/dist/nlu/intent-confirm.js.map +1 -1
  272. package/dist/nlu/learnings.d.ts +7 -0
  273. package/dist/nlu/learnings.d.ts.map +1 -1
  274. package/dist/nlu/learnings.js +7 -0
  275. package/dist/nlu/learnings.js.map +1 -1
  276. package/dist/observability/debug-log.d.ts +250 -0
  277. package/dist/observability/debug-log.d.ts.map +1 -0
  278. package/dist/observability/debug-log.js +500 -0
  279. package/dist/observability/debug-log.js.map +1 -0
  280. package/dist/observability/event-bus.d.ts.map +1 -1
  281. package/dist/observability/event-bus.js +4 -1
  282. package/dist/observability/event-bus.js.map +1 -1
  283. package/dist/observability/otel.d.ts +278 -0
  284. package/dist/observability/otel.d.ts.map +1 -0
  285. package/dist/observability/otel.js +590 -0
  286. package/dist/observability/otel.js.map +1 -0
  287. package/dist/parity/drivers.d.ts +99 -0
  288. package/dist/parity/drivers.d.ts.map +1 -0
  289. package/dist/parity/drivers.js +1362 -0
  290. package/dist/parity/drivers.js.map +1 -0
  291. package/dist/parity/graph.d.ts +73 -0
  292. package/dist/parity/graph.d.ts.map +1 -0
  293. package/dist/parity/graph.js +162 -0
  294. package/dist/parity/graph.js.map +1 -0
  295. package/dist/parity/matrix.d.ts +105 -0
  296. package/dist/parity/matrix.d.ts.map +1 -0
  297. package/dist/parity/matrix.js +352 -0
  298. package/dist/parity/matrix.js.map +1 -0
  299. package/dist/parity/observation.d.ts +444 -0
  300. package/dist/parity/observation.d.ts.map +1 -0
  301. package/dist/parity/observation.js +333 -0
  302. package/dist/parity/observation.js.map +1 -0
  303. package/dist/parity/scenarios.d.ts +229 -0
  304. package/dist/parity/scenarios.d.ts.map +1 -0
  305. package/dist/parity/scenarios.js +175 -0
  306. package/dist/parity/scenarios.js.map +1 -0
  307. package/dist/parity/surfaces.d.ts +122 -0
  308. package/dist/parity/surfaces.d.ts.map +1 -0
  309. package/dist/parity/surfaces.js +190 -0
  310. package/dist/parity/surfaces.js.map +1 -0
  311. package/dist/runtime/fault-injection.d.ts +173 -0
  312. package/dist/runtime/fault-injection.d.ts.map +1 -0
  313. package/dist/runtime/fault-injection.js +281 -0
  314. package/dist/runtime/fault-injection.js.map +1 -0
  315. package/dist/skills/secret-capture.d.ts.map +1 -1
  316. package/dist/skills/secret-capture.js +9 -4
  317. package/dist/skills/secret-capture.js.map +1 -1
  318. package/dist/tools/child-agent-entry.d.ts +23 -0
  319. package/dist/tools/child-agent-entry.d.ts.map +1 -0
  320. package/dist/tools/child-agent-entry.js +129 -0
  321. package/dist/tools/child-agent-entry.js.map +1 -0
  322. package/dist/tools/child-agent-runtime.d.ts +124 -0
  323. package/dist/tools/child-agent-runtime.d.ts.map +1 -0
  324. package/dist/tools/child-agent-runtime.js +704 -0
  325. package/dist/tools/child-agent-runtime.js.map +1 -0
  326. package/dist/tools/coding-tools.d.ts.map +1 -1
  327. package/dist/tools/coding-tools.js +82 -10
  328. package/dist/tools/coding-tools.js.map +1 -1
  329. package/dist/tools/credentials-tool.d.ts +24 -0
  330. package/dist/tools/credentials-tool.d.ts.map +1 -0
  331. package/dist/tools/credentials-tool.js +125 -0
  332. package/dist/tools/credentials-tool.js.map +1 -0
  333. package/dist/tools/delegation-system.d.ts +31 -0
  334. package/dist/tools/delegation-system.d.ts.map +1 -1
  335. package/dist/tools/delegation-system.js +70 -9
  336. package/dist/tools/delegation-system.js.map +1 -1
  337. package/dist/tools/extract/docx.d.ts +27 -0
  338. package/dist/tools/extract/docx.d.ts.map +1 -0
  339. package/dist/tools/extract/docx.js +48 -0
  340. package/dist/tools/extract/docx.js.map +1 -0
  341. package/dist/tools/extract/html-text.d.ts +27 -0
  342. package/dist/tools/extract/html-text.d.ts.map +1 -0
  343. package/dist/tools/extract/html-text.js +86 -0
  344. package/dist/tools/extract/html-text.js.map +1 -0
  345. package/dist/tools/extract/pdf-ocr.d.ts +58 -0
  346. package/dist/tools/extract/pdf-ocr.d.ts.map +1 -0
  347. package/dist/tools/extract/pdf-ocr.js +116 -0
  348. package/dist/tools/extract/pdf-ocr.js.map +1 -0
  349. package/dist/tools/extract/pdf.d.ts +65 -0
  350. package/dist/tools/extract/pdf.d.ts.map +1 -0
  351. package/dist/tools/extract/pdf.js +197 -0
  352. package/dist/tools/extract/pdf.js.map +1 -0
  353. package/dist/tools/extract/pptx.d.ts +32 -0
  354. package/dist/tools/extract/pptx.d.ts.map +1 -0
  355. package/dist/tools/extract/pptx.js +77 -0
  356. package/dist/tools/extract/pptx.js.map +1 -0
  357. package/dist/tools/extract/xlsx.d.ts +47 -0
  358. package/dist/tools/extract/xlsx.d.ts.map +1 -0
  359. package/dist/tools/extract/xlsx.js +111 -0
  360. package/dist/tools/extract/xlsx.js.map +1 -0
  361. package/dist/tools/finding-tool.d.ts +76 -0
  362. package/dist/tools/finding-tool.d.ts.map +1 -0
  363. package/dist/tools/finding-tool.js +125 -0
  364. package/dist/tools/finding-tool.js.map +1 -0
  365. package/dist/tools/git-tool.d.ts +25 -7
  366. package/dist/tools/git-tool.d.ts.map +1 -1
  367. package/dist/tools/git-tool.js +155 -15
  368. package/dist/tools/git-tool.js.map +1 -1
  369. package/dist/tools/loop-project-context.d.ts.map +1 -1
  370. package/dist/tools/loop-project-context.js +16 -0
  371. package/dist/tools/loop-project-context.js.map +1 -1
  372. package/dist/tools/loop-route-feed.d.ts +57 -0
  373. package/dist/tools/loop-route-feed.d.ts.map +1 -0
  374. package/dist/tools/loop-route-feed.js +101 -0
  375. package/dist/tools/loop-route-feed.js.map +1 -0
  376. package/dist/tools/messaging-tools.d.ts +41 -11
  377. package/dist/tools/messaging-tools.d.ts.map +1 -1
  378. package/dist/tools/messaging-tools.js +104 -55
  379. package/dist/tools/messaging-tools.js.map +1 -1
  380. package/dist/tools/neutts-synth.d.ts +27 -3
  381. package/dist/tools/neutts-synth.d.ts.map +1 -1
  382. package/dist/tools/neutts-synth.js +57 -13
  383. package/dist/tools/neutts-synth.js.map +1 -1
  384. package/dist/tools/pipeline-tool.d.ts +43 -1
  385. package/dist/tools/pipeline-tool.d.ts.map +1 -1
  386. package/dist/tools/pipeline-tool.js +21 -4
  387. package/dist/tools/pipeline-tool.js.map +1 -1
  388. package/dist/tools/publish-tool.d.ts.map +1 -1
  389. package/dist/tools/publish-tool.js +76 -10
  390. package/dist/tools/publish-tool.js.map +1 -1
  391. package/dist/tools/read-extract.d.ts +116 -45
  392. package/dist/tools/read-extract.d.ts.map +1 -1
  393. package/dist/tools/read-extract.js +494 -158
  394. package/dist/tools/read-extract.js.map +1 -1
  395. package/dist/tools/registry.d.ts +23 -3
  396. package/dist/tools/registry.d.ts.map +1 -1
  397. package/dist/tools/registry.js +196 -29
  398. package/dist/tools/registry.js.map +1 -1
  399. package/dist/tools/run-terminal.d.ts +9 -0
  400. package/dist/tools/run-terminal.d.ts.map +1 -1
  401. package/dist/tools/run-terminal.js +80 -2
  402. package/dist/tools/run-terminal.js.map +1 -1
  403. package/dist/tools/subagent-refusal.d.ts +15 -0
  404. package/dist/tools/subagent-refusal.d.ts.map +1 -0
  405. package/dist/tools/subagent-refusal.js +18 -0
  406. package/dist/tools/subagent-refusal.js.map +1 -0
  407. package/dist/tools/subagent-spawner.d.ts +122 -0
  408. package/dist/tools/subagent-spawner.d.ts.map +1 -1
  409. package/dist/tools/subagent-spawner.js +249 -28
  410. package/dist/tools/subagent-spawner.js.map +1 -1
  411. package/dist/tools/tool-hooks.d.ts +177 -0
  412. package/dist/tools/tool-hooks.d.ts.map +1 -0
  413. package/dist/tools/tool-hooks.js +427 -0
  414. package/dist/tools/tool-hooks.js.map +1 -0
  415. package/dist/tools/tool-loop.d.ts +94 -5
  416. package/dist/tools/tool-loop.d.ts.map +1 -1
  417. package/dist/tools/tool-loop.js +315 -9
  418. package/dist/tools/tool-loop.js.map +1 -1
  419. package/dist/tools/tool-refusal.d.ts +68 -0
  420. package/dist/tools/tool-refusal.d.ts.map +1 -0
  421. package/dist/tools/tool-refusal.js +78 -0
  422. package/dist/tools/tool-refusal.js.map +1 -0
  423. package/dist/tools/toolsets.d.ts +8 -0
  424. package/dist/tools/toolsets.d.ts.map +1 -1
  425. package/dist/tools/toolsets.js +14 -4
  426. package/dist/tools/toolsets.js.map +1 -1
  427. package/dist/tools/vision-tools.d.ts +88 -83
  428. package/dist/tools/vision-tools.d.ts.map +1 -1
  429. package/dist/tools/vision-tools.js +134 -103
  430. package/dist/tools/vision-tools.js.map +1 -1
  431. package/dist/tools/worktree.d.ts +210 -0
  432. package/dist/tools/worktree.d.ts.map +1 -0
  433. package/dist/tools/worktree.js +374 -0
  434. package/dist/tools/worktree.js.map +1 -0
  435. package/dist/utils/format.d.ts +3 -0
  436. package/dist/utils/format.d.ts.map +1 -0
  437. package/dist/utils/format.js +32 -0
  438. package/dist/utils/format.js.map +1 -0
  439. package/dist/web-dashboard/attachment-extract.d.ts +64 -0
  440. package/dist/web-dashboard/attachment-extract.d.ts.map +1 -0
  441. package/dist/web-dashboard/attachment-extract.js +154 -0
  442. package/dist/web-dashboard/attachment-extract.js.map +1 -0
  443. package/dist/web-dashboard/chat-console.d.ts +108 -1
  444. package/dist/web-dashboard/chat-console.d.ts.map +1 -1
  445. package/dist/web-dashboard/chat-console.js +36 -0
  446. package/dist/web-dashboard/chat-console.js.map +1 -1
  447. package/dist/web-dashboard/hub-data.d.ts +37 -0
  448. package/dist/web-dashboard/hub-data.d.ts.map +1 -1
  449. package/dist/web-dashboard/hub-data.js +61 -1
  450. package/dist/web-dashboard/hub-data.js.map +1 -1
  451. package/dist/web-dashboard/server.d.ts +14 -0
  452. package/dist/web-dashboard/server.d.ts.map +1 -1
  453. package/dist/web-dashboard/server.js +247 -13
  454. package/dist/web-dashboard/server.js.map +1 -1
  455. package/dist/web-dashboard/src/types.d.ts +196 -48
  456. package/dist/web-dashboard/src/types.d.ts.map +1 -1
  457. package/dist/workflow/registry.js +1 -1
  458. package/dist/workflow/registry.js.map +1 -1
  459. package/package.json +22 -6
  460. package/src/web-dashboard/public/assets/{index-Cyd6tIew.css → index-XJjj2cBX.css} +1 -1
  461. package/src/web-dashboard/public/assets/index-YWF9FpwQ.js +207 -0
  462. package/src/web-dashboard/public/assets/index-YWF9FpwQ.js.map +1 -0
  463. package/src/web-dashboard/public/index.html +2 -2
  464. package/dist/tools/child-agent-worker.js +0 -212
  465. package/src/web-dashboard/public/assets/index-CjvoBhlz.js +0 -207
  466. package/src/web-dashboard/public/assets/index-CjvoBhlz.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"read-extract.js","sourceRoot":"","sources":["../../src/tools/read-extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAmB7B,+EAA+E;AAE/E,MAAM,kBAAkB;IACd,gBAAgB,GAAG,IAAI,GAAG,CAAC;QACjC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;QACrF,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;KAClC,CAAC,CAAC;IAEH;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,QAAgB;QAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;QAEjD,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACpC,OAAO;gBACL,IAAI,EAAE,EAAE;gBACR,MAAM,EAAE,GAAG;gBACX,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,uBAAuB,GAAG,gBAAgB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;aAChG,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,QAAQ,GAAG,EAAE,CAAC;gBACZ,KAAK,MAAM,CAAC;gBACZ,KAAK,KAAK,CAAC;gBACX,KAAK,WAAW;oBACd,OAAO,IAAI,CAAC,gB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,GAAG,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,CAAC;QAClB,CAAC;aAAM,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;YAC5B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACzB,KAAK,GAAG,EAAE,CAAC;QACb,CAAC;aAAM,CAAC;YACN,KAAK,IAAI,EAAE,CAAC;QACd,CAAC;IACH,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IACzB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACrD,OAAO,qBAAqB,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,qBAAqB;IACnC,OAAO,qBAAqB,EAAE,CAAC,mBAAmB,EAAE,CAAC;AACvD,CAAC;AAED,+EAA+E;AAE/E,IAAI,SAAS,GAA8B,IAAI,CAAC;AAEhD,MAAM,UAAU,qBAAqB;IACnC,IAAI,CAAC,SAAS;QAAE,SAAS,GAAG,IAAI,kBAAkB,EAAE,CAAC;IACrD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAC"}
@@ -252,6 +252,22 @@ export declare const publishToolSchema: z.ZodObject<{
252
252
  dry_run: z.ZodDefault<z.ZodBoolean>;
253
253
  skip_tests: z.ZodDefault<z.ZodBoolean>;
254
254
  }, z.core.$strip>;
255
+ /**
256
+ * Release credentials (store/status/forget/verify) — the E3c publish tool can
257
+ * only release with a GitHub and an npm token, and this is how the agent keeps
258
+ * them. Storing is NOT an irreversible external action, so it is not gated —
259
+ * but the VALUE must come from the user: `ask_user` for it, never invent one.
260
+ */
261
+ export declare const credentialsToolSchema: z.ZodObject<{
262
+ action: z.ZodDefault<z.ZodEnum<{
263
+ store: "store";
264
+ status: "status";
265
+ verify: "verify";
266
+ forget: "forget";
267
+ }>>;
268
+ key: z.ZodOptional<z.ZodString>;
269
+ value: z.ZodOptional<z.ZodString>;
270
+ }, z.core.$strip>;
255
271
  /** E3g — gateway message delivery: target + text + optional media (model-decides vocabulary). */
256
272
  export declare const gatewaySendSchema: z.ZodObject<{
257
273
  target: z.ZodString;
@@ -264,9 +280,10 @@ export declare const runCliSchema: z.ZodObject<{
264
280
  ask: z.ZodString;
265
281
  confirm: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
266
282
  }, z.core.$strip>;
267
- /** P3b — gated git args: structured status/log/diff/commit. */
283
+ /** P3b — gated git args: structured status/log/diff/commit, plus the gated push. */
268
284
  export declare const gitToolSchema: z.ZodObject<{
269
285
  action: z.ZodEnum<{
286
+ push: "push";
270
287
  status: "status";
271
288
  log: "log";
272
289
  diff: "diff";
@@ -276,6 +293,9 @@ export declare const gitToolSchema: z.ZodObject<{
276
293
  files: z.ZodOptional<z.ZodArray<z.ZodString>>;
277
294
  confirm: z.ZodDefault<z.ZodBoolean>;
278
295
  limit: z.ZodOptional<z.ZodNumber>;
296
+ remote: z.ZodOptional<z.ZodString>;
297
+ branch: z.ZodOptional<z.ZodString>;
298
+ tags: z.ZodDefault<z.ZodBoolean>;
279
299
  }, z.core.$strip>;
280
300
  /** P3a — clone_repo args: a git URL to assess (depth-1 shallow only). */
281
301
  export declare const cloneRepoSchema: z.ZodObject<{
@@ -353,9 +373,9 @@ export declare function toolJsonSchemas(toolNames?: string[]): ToolJsonSchema[];
353
373
  * calling suggest_followups with exactly 3 followups, and clarifies ambiguous
354
374
  * requests via ask_user instead of guessing.
355
375
  */
356
- export declare const TOOL_CONTRACT = "You have tools available. Call them when appropriate.\n\n- If a request is ambiguous or incomplete, call `ask_user` with a question and 2\u20134 choices \u2014 never guess, never ask in plain text.\n- If a request needs code written, debugged, or prior work resumed, call `build`, `repair`, or `resume` with the goal.\n- If a request needs documentation, a website, analysis of a project, or running tests, call `document`, `website`, `analyze`, or `test` with the goal.\n- If a request asks to publish a release (npm/GitHub), call `publish`. It leaves this machine and is irreversible \u2014 confirm the bump type and target with the user via `ask_user` first unless they already specified them.\n- If a request's completeness is uncertain, call `verify_requirement` first.\n- If a request asks to deliver a message or result to a DIFFERENT contact/channel than the one you are currently chatting on (WhatsApp, Telegram, Slack, email, \u2026), call `gateway_send` with the target (e.g. `whatsapp:Alex`) and the text. Do NOT call gateway_send to reply to the CURRENT conversation \u2014 your text response is automatically delivered back. If the target contact is not configured, tell the user what to set up.\n- If a request asks to manage the system/agent itself in plain English \u2014 start/stop the dashboard or gateway, check status, add/remove a verified sender, configure a platform (telegram/whatsapp), run evals, show stats \u2014 call `run_cli` with the plain-English ask. It resolves the exact `nuvira` command and runs it. If the user's own request already resolves to that command (\"stop the dashboard\"), it just runs \u2014 do not ask for permission to do what was just asked. If it reports AMBIGUOUS, call `ask_user` with the two choices; if the intent is one YOU chose rather than the user (or is irreversible: history.clear, memory.prune, stats.cost.clear, publish), call `ask_user` first and retry with confirm:true.\n- If a subtask can be delegated to a specialized sub-agent (gather context, review, security scan, run tests), call `delegate` with the agent type, a focused prompt, and optional file paths.\n- To find code matching a pattern (context gathering, locating definitions/usages), call `code_search` with the pattern and optional globs.\n- To READ the project: call `read_file` to open a file (with line numbers), `list_dir` to see a directory's contents, or `glob` to find files by pattern. Always prefer reading the actual file over assuming its contents \u2014 a large file reports a line range, continue with offset/limit.\n- To CHANGE code (after reading it): call `edit_file` for a surgical exact-text replacement, or `write_file` to create/replace a file. CREATING a file the request asked for is applied directly \u2014 no confirmation needed, so just call it. An `edit_file` that is surgical (small relative to the file) also applies directly, as does one on a file the request names \u2014 the verify loop must not need a human between iterations. A whole-file write over existing content, or an edit that rewrites most of a file, refuses without confirm \u2014 call `ask_user` with a one-line summary, then retry with confirm:true.\n- NEVER ask for permission to do work the user already asked for \u2014 not via `ask_user` and never in plain text. Decide it yourself, state the decision in your answer, and continue. Reserve `ask_user` for a decision that is genuinely the user's: it cannot proceed without an answer, it is high-impact AND irreversible, and there is no sensible default (overwriting existing work, deleting data, spending money, publishing).\n- To VERIFY code by actual invocation: call `run_terminal` with the real command (`npx vitest run tests/x.test.ts`, `npx tsc --noEmit`, `npm run build`, `git diff`). Read-only verify commands run directly, and so do recoverable workspace commands (`npm/pnpm/yarn/bun install`, `pip install`, `mkdir`, `touch`, `cp`, `mv`, `git add`, `npm init`) when the request authorized the work \u2014 the build you were asked for is your job to set up. Everything else state-changing (network fetches, arbitrary code, global installs, anything leaving the machine) needs confirm:true after the user approves via ask_user. Never guess that a test passes \u2014 run it and read the output. Use run_cli (not run_terminal) for buff/agent-nuvira control commands, and the `git` tool (not run_terminal) to commit.\n- END EVERY RESPONSE by calling `suggest_followups` with exactly 3 followups the user is likely to want next \u2014 natural next questions, deeper dives, or related directions that build on what you just said; specific to this conversation, not generic.\n- If you have nothing to add, answer directly and still end with suggest_followups.\n- ORDERING (non-negotiable): deliver the user's answer FIRST, then suggest_followups. The followup call must come only AFTER the complete answer is written \u2014 never before it, never instead of it. A bare lead-in (\"Sure, I can help!\") is NOT an answer; write the full answer in the same step as the followup call.";
376
+ export declare const TOOL_CONTRACT = "You have tools available. Call them when appropriate.\n\n- If a request is ambiguous or incomplete, call `ask_user` with a question and 2\u20134 choices \u2014 never guess, never ask in plain text.\n- If a request needs code written, debugged, or prior work resumed, call `build`, `repair`, or `resume` with the goal.\n- If a request needs documentation, a website, analysis of a project, or running tests, call `document`, `website`, `analyze`, or `test` with the goal.\n- If a request asks to publish a release (npm/GitHub), call `publish`. It leaves this machine and is irreversible \u2014 confirm the bump type and target with the user via `ask_user` first unless they already specified them.\n- When your answer ASSERTS something a second party could check (a test passed, a file contains X, the count is N, a command was run), call `finding` with the claim, what became of it, and the evidence you ACTUALLY checked \u2014 the command and its real output, the path you read, a quote from the request. Usable evidence records it CONFIRMED; with none it is recorded PLAUSIBLE, which is the honest result for a reasoned guess. You cannot set the verdict and must never claim a check you did not perform.\n- If a request's completeness is uncertain, call `verify_requirement` first.\n- If a request asks to deliver a message or result to a DIFFERENT contact/channel than the one you are currently chatting on (WhatsApp, Telegram, Slack, email, \u2026), call `gateway_send` with the target (e.g. `whatsapp:Alex`) and the text. Do NOT call gateway_send to reply to the CURRENT conversation \u2014 your text response is automatically delivered back. If the target contact is not configured, tell the user what to set up.\n- If a request asks to manage the system/agent itself in plain English \u2014 start/stop the dashboard or gateway, check status, add/remove a verified sender, configure a platform (telegram/whatsapp), run evals, show stats \u2014 call `run_cli` with the plain-English ask. It resolves the exact `nuvira` command and runs it. If the user's own request already resolves to that command (\"stop the dashboard\"), it just runs \u2014 do not ask for permission to do what was just asked. If it reports AMBIGUOUS, call `ask_user` with the two choices; if the intent is one YOU chose rather than the user (or is irreversible: history.clear, memory.prune, stats.cost.clear, publish), call `ask_user` first and retry with confirm:true.\n- If a subtask can be delegated to a specialized sub-agent (gather context, review, security scan, run tests), call `delegate` with the agent type, a focused prompt, and optional file paths.\n- To find code matching a pattern (context gathering, locating definitions/usages), call `code_search` with the pattern and optional globs.\n- To READ the project: call `read_file` to open a file (with line numbers), `list_dir` to see a directory's contents, or `glob` to find files by pattern. Always prefer reading the actual file over assuming its contents \u2014 a large file reports a line range, continue with offset/limit.\n- To CHANGE code (after reading it): call `edit_file` for a surgical exact-text replacement, or `write_file` to create/replace a file. CREATING a file the request asked for is applied directly \u2014 no confirmation needed, so just call it. An `edit_file` that is surgical (small relative to the file) also applies directly, as does one on a file the request names \u2014 the verify loop must not need a human between iterations. A whole-file write over existing content, or an edit that rewrites most of a file, refuses without confirm \u2014 call `ask_user` with a one-line summary, then retry with confirm:true.\n- NEVER ask for permission to do work the user already asked for \u2014 not via `ask_user` and never in plain text. Decide it yourself, state the decision in your answer, and continue. Reserve `ask_user` for a decision that is genuinely the user's: it cannot proceed without an answer, it is high-impact AND irreversible, and there is no sensible default (overwriting existing work, deleting data, spending money, publishing).\n- To VERIFY code by actual invocation: call `run_terminal` with the real command (`npx vitest run tests/x.test.ts`, `npx tsc --noEmit`, `npm run build`, `git diff`). Read-only verify commands run directly, and so do recoverable workspace commands (`npm/pnpm/yarn/bun install`, `pip install`, `mkdir`, `touch`, `cp`, `mv`, `git add`, `npm init`) when the request authorized the work \u2014 the build you were asked for is your job to set up. Everything else state-changing (network fetches, arbitrary code, global installs, anything leaving the machine) needs confirm:true after the user approves via ask_user. Never guess that a test passes \u2014 run it and read the output. Use run_cli (not run_terminal) for buff/agent-nuvira control commands, and the `git` tool (not run_terminal) to commit.\n- END EVERY RESPONSE by calling `suggest_followups` with exactly 3 followups the user is likely to want next \u2014 natural next questions, deeper dives, or related directions that build on what you just said; specific to this conversation, not generic.\n- If you have nothing to add, answer directly and still end with suggest_followups.\n- ORDERING (non-negotiable): deliver the user's answer FIRST, then suggest_followups. The followup call must come only AFTER the complete answer is written \u2014 never before it, never instead of it. A bare lead-in (\"Sure, I can help!\") is NOT an answer; write the full answer in the same step as the followup call.";
357
377
  /** The JSON-fallback tool contract — for providers WITHOUT native tool-calling. */
358
- export declare const TOOL_CONTRACT_JSON = "You have tools available. Call them when appropriate.\n\n- If a request is ambiguous or incomplete, call `ask_user` with a question and 2\u20134 choices \u2014 never guess, never ask in plain text.\n- If a request needs code written, debugged, or prior work resumed, call `build`, `repair`, or `resume` with the goal.\n- If a request needs documentation, a website, analysis of a project, or running tests, call `document`, `website`, `analyze`, or `test` with the goal.\n- If a request asks to publish a release (npm/GitHub), call `publish`. It leaves this machine and is irreversible \u2014 confirm the bump type and target with the user via `ask_user` first unless they already specified them.\n- If a request's completeness is uncertain, call `verify_requirement` first.\n- If a request asks to deliver a message or result to a DIFFERENT contact/channel than the one you are currently chatting on (WhatsApp, Telegram, Slack, email, \u2026), call `gateway_send` with the target (e.g. `whatsapp:Alex`) and the text. Do NOT call gateway_send to reply to the CURRENT conversation \u2014 your text response is automatically delivered back. If the target contact is not configured, tell the user what to set up.\n- If a request asks to manage the system/agent itself in plain English \u2014 start/stop the dashboard or gateway, check status, add/remove a verified sender, configure a platform (telegram/whatsapp), run evals, show stats \u2014 call `run_cli` with the plain-English ask. It resolves the exact `nuvira` command and runs it. If the user's own request already resolves to that command (\"stop the dashboard\"), it just runs \u2014 do not ask for permission to do what was just asked. If it reports AMBIGUOUS, call `ask_user` with the two choices; if the intent is one YOU chose rather than the user (or is irreversible: history.clear, memory.prune, stats.cost.clear, publish), call `ask_user` first and retry with confirm:true.\n- If a subtask can be delegated to a specialized sub-agent (gather context, review, security scan, run tests), call `delegate` with the agent type, a focused prompt, and optional file paths.\n- To find code matching a pattern (context gathering, locating definitions/usages), call `code_search` with the pattern and optional globs.\n- To READ the project: call `read_file` to open a file (with line numbers), `list_dir` to see a directory's contents, or `glob` to find files by pattern. Always prefer reading the actual file over assuming its contents \u2014 a large file reports a line range, continue with offset/limit.\n- To CHANGE code (after reading it): call `edit_file` for a surgical exact-text replacement, or `write_file` to create/replace a file. CREATING a file the request asked for is applied directly \u2014 no confirmation needed, so just call it. An `edit_file` that is surgical (small relative to the file) also applies directly, as does one on a file the request names \u2014 the verify loop must not need a human between iterations. A whole-file write over existing content, or an edit that rewrites most of a file, refuses without confirm \u2014 call `ask_user` with a one-line summary, then retry with confirm:true.\n- NEVER ask for permission to do work the user already asked for \u2014 not via `ask_user` and never in plain text. Decide it yourself, state the decision in your answer, and continue. Reserve `ask_user` for a decision that is genuinely the user's: it cannot proceed without an answer, it is high-impact AND irreversible, and there is no sensible default (overwriting existing work, deleting data, spending money, publishing).\n- To VERIFY code by actual invocation: call `run_terminal` with the real command (`npx vitest run tests/x.test.ts`, `npx tsc --noEmit`, `npm run build`, `git diff`). Read-only verify commands run directly, and so do recoverable workspace commands (`npm/pnpm/yarn/bun install`, `pip install`, `mkdir`, `touch`, `cp`, `mv`, `git add`, `npm init`) when the request authorized the work \u2014 the build you were asked for is your job to set up. Everything else state-changing (network fetches, arbitrary code, global installs, anything leaving the machine) needs confirm:true after the user approves via ask_user. Never guess that a test passes \u2014 run it and read the output. Use run_cli (not run_terminal) for buff/agent-nuvira control commands, and the `git` tool (not run_terminal) to commit.\n- END EVERY RESPONSE by calling `suggest_followups` with exactly 3 followups the user is likely to want next \u2014 natural next questions, deeper dives, or related directions that build on what you just said; specific to this conversation, not generic.\n- If you have nothing to add, answer directly and still end with suggest_followups.\n- ORDERING (non-negotiable): deliver the user's answer FIRST, then suggest_followups. The followup call must come only AFTER the complete answer is written \u2014 never before it, never instead of it. A bare lead-in (\"Sure, I can help!\") is NOT an answer; write the full answer in the same step as the followup call.\n\nTOOL CALL FORMAT (JSON fallback transport):\nWhen calling a tool, emit its JSON AFTER your response text, in this exact shape:\n{\"tool\":\"<name>\",\"arguments\":{...}}\nOne tool call per block. The final block may be a suggest_followups call.";
378
+ export declare const TOOL_CONTRACT_JSON = "You have tools available. Call them when appropriate.\n\n- If a request is ambiguous or incomplete, call `ask_user` with a question and 2\u20134 choices \u2014 never guess, never ask in plain text.\n- If a request needs code written, debugged, or prior work resumed, call `build`, `repair`, or `resume` with the goal.\n- If a request needs documentation, a website, analysis of a project, or running tests, call `document`, `website`, `analyze`, or `test` with the goal.\n- If a request asks to publish a release (npm/GitHub), call `publish`. It leaves this machine and is irreversible \u2014 confirm the bump type and target with the user via `ask_user` first unless they already specified them.\n- When your answer ASSERTS something a second party could check (a test passed, a file contains X, the count is N, a command was run), call `finding` with the claim, what became of it, and the evidence you ACTUALLY checked \u2014 the command and its real output, the path you read, a quote from the request. Usable evidence records it CONFIRMED; with none it is recorded PLAUSIBLE, which is the honest result for a reasoned guess. You cannot set the verdict and must never claim a check you did not perform.\n- If a request's completeness is uncertain, call `verify_requirement` first.\n- If a request asks to deliver a message or result to a DIFFERENT contact/channel than the one you are currently chatting on (WhatsApp, Telegram, Slack, email, \u2026), call `gateway_send` with the target (e.g. `whatsapp:Alex`) and the text. Do NOT call gateway_send to reply to the CURRENT conversation \u2014 your text response is automatically delivered back. If the target contact is not configured, tell the user what to set up.\n- If a request asks to manage the system/agent itself in plain English \u2014 start/stop the dashboard or gateway, check status, add/remove a verified sender, configure a platform (telegram/whatsapp), run evals, show stats \u2014 call `run_cli` with the plain-English ask. It resolves the exact `nuvira` command and runs it. If the user's own request already resolves to that command (\"stop the dashboard\"), it just runs \u2014 do not ask for permission to do what was just asked. If it reports AMBIGUOUS, call `ask_user` with the two choices; if the intent is one YOU chose rather than the user (or is irreversible: history.clear, memory.prune, stats.cost.clear, publish), call `ask_user` first and retry with confirm:true.\n- If a subtask can be delegated to a specialized sub-agent (gather context, review, security scan, run tests), call `delegate` with the agent type, a focused prompt, and optional file paths.\n- To find code matching a pattern (context gathering, locating definitions/usages), call `code_search` with the pattern and optional globs.\n- To READ the project: call `read_file` to open a file (with line numbers), `list_dir` to see a directory's contents, or `glob` to find files by pattern. Always prefer reading the actual file over assuming its contents \u2014 a large file reports a line range, continue with offset/limit.\n- To CHANGE code (after reading it): call `edit_file` for a surgical exact-text replacement, or `write_file` to create/replace a file. CREATING a file the request asked for is applied directly \u2014 no confirmation needed, so just call it. An `edit_file` that is surgical (small relative to the file) also applies directly, as does one on a file the request names \u2014 the verify loop must not need a human between iterations. A whole-file write over existing content, or an edit that rewrites most of a file, refuses without confirm \u2014 call `ask_user` with a one-line summary, then retry with confirm:true.\n- NEVER ask for permission to do work the user already asked for \u2014 not via `ask_user` and never in plain text. Decide it yourself, state the decision in your answer, and continue. Reserve `ask_user` for a decision that is genuinely the user's: it cannot proceed without an answer, it is high-impact AND irreversible, and there is no sensible default (overwriting existing work, deleting data, spending money, publishing).\n- To VERIFY code by actual invocation: call `run_terminal` with the real command (`npx vitest run tests/x.test.ts`, `npx tsc --noEmit`, `npm run build`, `git diff`). Read-only verify commands run directly, and so do recoverable workspace commands (`npm/pnpm/yarn/bun install`, `pip install`, `mkdir`, `touch`, `cp`, `mv`, `git add`, `npm init`) when the request authorized the work \u2014 the build you were asked for is your job to set up. Everything else state-changing (network fetches, arbitrary code, global installs, anything leaving the machine) needs confirm:true after the user approves via ask_user. Never guess that a test passes \u2014 run it and read the output. Use run_cli (not run_terminal) for buff/agent-nuvira control commands, and the `git` tool (not run_terminal) to commit.\n- END EVERY RESPONSE by calling `suggest_followups` with exactly 3 followups the user is likely to want next \u2014 natural next questions, deeper dives, or related directions that build on what you just said; specific to this conversation, not generic.\n- If you have nothing to add, answer directly and still end with suggest_followups.\n- ORDERING (non-negotiable): deliver the user's answer FIRST, then suggest_followups. The followup call must come only AFTER the complete answer is written \u2014 never before it, never instead of it. A bare lead-in (\"Sure, I can help!\") is NOT an answer; write the full answer in the same step as the followup call.\n\nTOOL CALL FORMAT (JSON fallback transport):\nWhen calling a tool, emit its JSON AFTER your response text, in this exact shape:\n{\"tool\":\"<name>\",\"arguments\":{...}}\nOne tool call per block. The final block may be a suggest_followups call.";
359
379
  /**
360
380
  * Parse + validate a model's followups output against the shared
361
381
  * suggest_followups schema. Accepts both the tool shape `[{prompt,label?}]`
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,OAAO,EAAE,CAAC,EAAgB,KAAK,OAAO,EAAE,MAAM,KAAK,CAAC;AAMpD,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,CAAC;AAElE,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED;;;;GAIG;AACH,MAAM,WAAW,IAAI;IACnB,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ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;;;iBASxB,CAAC;AAEH,yEAAyE;AACzE,eAAO,MAAM,eAAe;;;iBAG1B,CAAC;AAEH,kFAAkF;AAClF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;iBAgB1B,CAAC;AAEH,8EAA8E;AAC9E,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;iBAczB,CAAC;AA0IH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;iBAejC,CAAC;AAMH;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAE7C;AAED,8BAA8B;AAC9B,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAEtD;AAED,gFAAgF;AAChF,wBAAgB,SAAS,IAAI,IAAI,EAAE,CAElC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAOtE;AAID;;;;;GAKG;AACH,eAAO,MAAM,aAAa,u8KAkB8R,CAAC;AAEzT,mFAAmF;AACnF,eAAO,MAAM,kBAAkB,+rLAK2C,CAAC;AAilB3E;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAyBvE;AASD,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,4BAA4B,EAC5B,+BAA+B,EAC/B,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC"}
@@ -27,6 +27,7 @@ import { envBuff } from '../config/paths.js';
27
27
  import { z, toJSONSchema } from 'zod';
28
28
  import { ACTION_BY_INTENT } from '../nlu/actions.js';
29
29
  import { detectPermissionSeeking, IRREVERSIBLE_ACTION_RE } from '../learning/autonomy-policy.js';
30
+ import { createFindingTool } from './finding-tool.js';
30
31
  // ─── Tool definitions ───────────────────────────────────────────────────────
31
32
  // ─── Shared auto-delivery helper ─────────────────────────────────────────
32
33
  // Tools that produce artifact files (generate_image, speak, video_generate)
@@ -98,6 +99,26 @@ export const publishToolSchema = z.object({
98
99
  dry_run: z.boolean().default(false).describe('Preview the publish phases without publishing anything'),
99
100
  skip_tests: z.boolean().default(false).describe('Skip the test-verification phase'),
100
101
  });
102
+ /**
103
+ * Release credentials (store/status/forget/verify) — the E3c publish tool can
104
+ * only release with a GitHub and an npm token, and this is how the agent keeps
105
+ * them. Storing is NOT an irreversible external action, so it is not gated —
106
+ * but the VALUE must come from the user: `ask_user` for it, never invent one.
107
+ */
108
+ export const credentialsToolSchema = z.object({
109
+ action: z
110
+ .enum(['status', 'store', 'forget', 'verify'])
111
+ .default('status')
112
+ .describe('status = which credentials exist and where each came from; store = persist a token the user supplied; forget = delete a stored token; verify = check the tokens against the live services'),
113
+ key: z
114
+ .string()
115
+ .optional()
116
+ .describe('Credential name for store/forget: GITHUB_TOKEN | GIT_USERNAME | NPM_TOKEN | NPM_REGISTRY'),
117
+ value: z
118
+ .string()
119
+ .optional()
120
+ .describe('Value to store (action=store). Must come from the USER via ask_user — never invent, guess or reuse a token from elsewhere in the transcript.'),
121
+ });
101
122
  /** E3c — the task tools all carry a goal (model-decides vocabulary). */
102
123
  const taskGoalArgs = z.object({ goal: z.string().describe('The task goal passed to the agent pipeline') });
103
124
  /** E3g — gateway message delivery: target + text + optional media (model-decides vocabulary). */
@@ -128,13 +149,16 @@ export const runCliSchema = z.object({
128
149
  .default(false)
129
150
  .describe('Set true ONLY after the user explicitly confirmed a destructive/system-level command you initiated. When the user’s own request resolves to the exact command (they asked to stop the dashboard), that IS the confirmation — the tool applies it. Irreversible intents (history.clear, memory.prune, stats.cost.clear, publish) always need it.'),
130
151
  });
131
- /** P3b — gated git args: structured status/log/diff/commit. */
152
+ /** P3b — gated git args: structured status/log/diff/commit, plus the gated push. */
132
153
  export const gitToolSchema = z.object({
133
- action: z.enum(['status', 'log', 'diff', 'commit']).describe('What to do — status/log are read-only; diff returns a structured diff (rendered as a card); commit is GATED unless the user’s own request asked for the commit.'),
154
+ action: z.enum(['status', 'log', 'diff', 'commit', 'push']).describe('What to do — status/log are read-only; diff returns a structured diff (rendered as a card); commit is GATED unless the user’s own request asked for the commit; push is GATED and STAYS gated unless the user’s own request named the push ("commit and push this to GitHub"). A request to commit locally does NOT authorize a push.'),
134
155
  message: z.string().optional().describe('Commit message (action=commit, required)'),
135
156
  files: z.array(z.string()).optional().describe('Files to stage+commit — the ACCEPTED subset after the user reviewed the diff card (absent = all changes)'),
136
- confirm: z.boolean().default(false).describe('Commit gate — required only when the MODEL initiated the commit. When the user’s own request asks for a commit ("commit these changes"), that request IS the approval: call it with confirm:false and it applies.'),
157
+ confirm: z.boolean().default(false).describe('Gate for the two history-changing actions (commit, push) — required when the MODEL initiated the action. When the user’s own request asks for it, that request IS the approval: call it with confirm:false and it applies (for commit: "commit these changes"; for push: the request must name the push itself).'),
137
158
  limit: z.number().int().min(1).max(100).optional().describe('Log limit (action=log, default 20)'),
159
+ remote: z.string().optional().describe('Push destination (action=push, default: the repository’s first remote)'),
160
+ branch: z.string().optional().describe('Push source branch (action=push, default: the current branch)'),
161
+ tags: z.boolean().default(false).describe('action=push — also push tags after the branch'),
138
162
  });
139
163
  /** P3a — clone_repo args: a git URL to assess (depth-1 shallow only). */
140
164
  export const cloneRepoSchema = z.object({
@@ -349,6 +373,7 @@ export const TOOL_CONTRACT = `You have tools available. Call them when appropria
349
373
  - If a request needs code written, debugged, or prior work resumed, call \`build\`, \`repair\`, or \`resume\` with the goal.
350
374
  - If a request needs documentation, a website, analysis of a project, or running tests, call \`document\`, \`website\`, \`analyze\`, or \`test\` with the goal.
351
375
  - If a request asks to publish a release (npm/GitHub), call \`publish\`. It leaves this machine and is irreversible — confirm the bump type and target with the user via \`ask_user\` first unless they already specified them.
376
+ - When your answer ASSERTS something a second party could check (a test passed, a file contains X, the count is N, a command was run), call \`finding\` with the claim, what became of it, and the evidence you ACTUALLY checked — the command and its real output, the path you read, a quote from the request. Usable evidence records it CONFIRMED; with none it is recorded PLAUSIBLE, which is the honest result for a reasoned guess. You cannot set the verdict and must never claim a check you did not perform.
352
377
  - If a request's completeness is uncertain, call \`verify_requirement\` first.
353
378
  - If a request asks to deliver a message or result to a DIFFERENT contact/channel than the one you are currently chatting on (WhatsApp, Telegram, Slack, email, …), call \`gateway_send\` with the target (e.g. \`whatsapp:Alex\`) and the text. Do NOT call gateway_send to reply to the CURRENT conversation — your text response is automatically delivered back. If the target contact is not configured, tell the user what to set up.
354
379
  - If a request asks to manage the system/agent itself in plain English — start/stop the dashboard or gateway, check status, add/remove a verified sender, configure a platform (telegram/whatsapp), run evals, show stats — call \`run_cli\` with the plain-English ask. It resolves the exact \`nuvira\` command and runs it. If the user's own request already resolves to that command ("stop the dashboard"), it just runs — do not ask for permission to do what was just asked. If it reports AMBIGUOUS, call \`ask_user\` with the two choices; if the intent is one YOU chose rather than the user (or is irreversible: history.clear, memory.prune, stats.cost.clear, publish), call \`ask_user\` first and retry with confirm:true.
@@ -438,6 +463,16 @@ registerTool({
438
463
  endsAgentStep: true,
439
464
  run: (args, ctx) => runPublishTool(args, ctx),
440
465
  });
466
+ registerTool({
467
+ name: 'credentials',
468
+ description: 'Release credentials: status (what exists, and where from), store (persist a GitHub/npm token so releases work without an environment export), forget (delete one), verify (check the tokens against the live services). Call status before a release; if a token is missing, ask_user for it and store it — never invent one.',
469
+ category: 'workflow',
470
+ inputSchema: credentialsToolSchema,
471
+ // Not a dispenser: the model must read the credential picture and act on it
472
+ // (store the missing token, or proceed with the release).
473
+ endsAgentStep: false,
474
+ run: (args, ctx) => runCredentialsTool(args, ctx),
475
+ });
441
476
  registerTool({
442
477
  name: 'ask_user',
443
478
  description: 'Ask the user a clarifying question with 2–4 choices (multi-select optional). Use when a request is ambiguous or missing information.',
@@ -659,6 +694,14 @@ registerTool({
659
694
  return store.toText ? store.toText() : `Plan updated (${action}).`;
660
695
  },
661
696
  });
697
+ // ─── WS1 (#23) finding tool — a claim, and the verdict the gate computed ────
698
+ // The model states the claim, the outcome and the evidence it actually checked;
699
+ // it does NOT state the verdict (`finding-tool.ts` has no such parameter, and
700
+ // the gate refuses a promotion without a non-blank evidence reference). Each
701
+ // recorded finding is emitted as `finding:recorded` with the SAME wire form the
702
+ // gateway already logs for an intent verdict, so all five surfaces report one
703
+ // shape — which is what `findings-verdicts@<surface>` is proved against.
704
+ registerTool(createFindingTool());
662
705
  // ─── I1 web-research tools (web_search / read_page) ─────────────────────────
663
706
  // The research-tool pattern
664
707
  // `web_search_registry.py` parity: the model can search the web and read a
@@ -848,11 +891,12 @@ registerTool({
848
891
  // The agent can commit IN CONVERSATION, visibly: `git diff` emits a
849
892
  // structured event the dashboard renders as a 🔧 diff card (per-file +/−
850
893
  // sections); `git commit` is GATED (confirm:true after ask_user) and stages
851
- // only the ACCEPTED files subset. push/reset --hard/clean are structurally
852
- // unexpressible (the action enum) AND deny-guarded — parity with run_terminal.
894
+ // only the ACCEPTED files subset. `git push` is a real GATED action here (the
895
+ // only outbound one — it asks unless the user's own request named the push),
896
+ // while reset --hard/clean remain structurally unexpressible AND deny-guarded.
853
897
  registerTool({
854
898
  name: 'git',
855
- description: 'Structured git operations: status/log (read-only), diff (unified output + a diff card in the GUI), and commit (GATED — confirm:true only after the user approved via ask_user; optional files = the accepted subset to stage+commit). Use for the whole commit flow: diff → ask_user (accept/reject files) → commit with confirm:true.',
899
+ description: 'Structured git operations: status/log (read-only), diff (unified output + a diff card in the GUI), commit (GATED — confirm:true only after the user approved via ask_user; optional files = the accepted subset to stage+commit), and push (GATED — sends a branch to a remote; runs when the user’s own request named the push, otherwise ask via ask_user first). Use for the whole flow: diff → ask_user (accept/reject files) → commit → push.',
856
900
  category: 'workflow',
857
901
  inputSchema: gitToolSchema,
858
902
  endsAgentStep: false,
@@ -944,6 +988,10 @@ function runPipelineTool(action, args, ctx) {
944
988
  function runPublishTool(args, ctx) {
945
989
  return import('./publish-tool.js').then((m) => m.runPublishTool(args, ctx));
946
990
  }
991
+ /** Release credentials as a tool (store/status/forget/verify) — see credentials-tool.ts. */
992
+ function runCredentialsTool(args, ctx) {
993
+ return import('./credentials-tool.js').then((m) => m.runCredentialsTool(args, ctx));
994
+ }
947
995
  /** The C2 requirementState check — see executor.ts. */
948
996
  function verifyRequirement(request, ctx) {
949
997
  return import('./verify-requirement.js').then((m) => m.verifyRequirementTool(request, ctx));
@@ -1394,7 +1442,10 @@ registerTool({
1394
1442
  // Delegate system tool
1395
1443
  registerTool({
1396
1444
  name: 'delegate_system',
1397
- description: 'Full delegation: spawn subagents, batch execute.',
1445
+ description: 'Full delegation: spawn subagents, batch execute. REQUIRES a child executor to be wired in — without one '
1446
+ + 'every task fails with code "not_configured" and NOTHING runs (it previously reported each task '
1447
+ + 'completed with its own goal echoed back as the result). For real delegation use `delegate`, which '
1448
+ + 'spawns a sub-agent through the resolved LLM in the loop.',
1398
1449
  category: 'workflow',
1399
1450
  inputSchema: z.object({
1400
1451
  action: z.enum(['delegate', 'batch', 'status', 'cancel']).describe('Action'),
@@ -1407,33 +1458,116 @@ registerTool({
1407
1458
  const { action, goal, id, goals } = args;
1408
1459
  const mgr = m.getDelegationManager();
1409
1460
  switch (action) {
1410
- case 'delegate': return goal ? mgr.delegate(goal).then((r) => JSON.stringify(r)) : 'goal required';
1411
- case 'batch': return goals ? mgr.delegateBatch(goals).then((r) => JSON.stringify(r)) : 'goals required';
1412
- case 'status': return id ? JSON.stringify(mgr.getTask(id)) : 'id required';
1413
- case 'cancel': return id ? (mgr.cancel(id) ? 'Cancelled' : 'Not found') : 'id required';
1461
+ // Await the RESULT, not the pending task: returning a task that had not run told
1462
+ // the model a delegation had been accepted when nothing was ever executed.
1463
+ case 'delegate': return goal
1464
+ ? mgr.delegate(goal).then((t) => mgr.waitForCompletion(t.id)).then((r) => JSON.stringify(r))
1465
+ : JSON.stringify({ success: false, code: 'unsupported_format', error: 'goal required' });
1466
+ case 'batch': return goals
1467
+ ? mgr.delegateBatch(goals).then((r) => JSON.stringify(r))
1468
+ : JSON.stringify({ success: false, code: 'unsupported_format', error: 'goals required' });
1469
+ case 'status': return id ? JSON.stringify(mgr.getTask(id)) : JSON.stringify({ success: false, code: 'unsupported_format', error: 'id required' });
1470
+ case 'cancel': return id ? (mgr.cancel(id) ? 'Cancelled' : 'Not found') : JSON.stringify({ success: false, code: 'unsupported_format', error: 'id required' });
1414
1471
  default: return 'Unknown action';
1415
1472
  }
1416
1473
  }),
1417
1474
  });
1418
- // Subagent tool
1475
+ // Subagent tool — connected (P4.1, 2026-09-28).
1476
+ //
1477
+ // The child is a real forked process running `child-agent-entry.ts`, which the
1478
+ // build emits to `dist/tools/`. It resolves a provider from YOUR configuration,
1479
+ // makes real LLM calls, runs any allowed tool through the real registry, and
1480
+ // reports its own output over IPC. What it will NOT do is answer for work that
1481
+ // did not happen: with no constructible provider, an unreachable backend, or
1482
+ // tools requested on a provider that cannot call them, it refuses with a typed
1483
+ // code (see child-agent-runtime.ts). Before this it was marked NOT CONNECTED —
1484
+ // the fork target was never shipped and the worker it wrapped simulated both the
1485
+ // model and the tools, so a "completed" subagent had done nothing at all.
1419
1486
  registerTool({
1420
1487
  name: 'subagent',
1421
- description: 'Spawn real subagents that make their own LLM calls and use tools.',
1488
+ description: 'Spawn a real subagent in its own process: it resolves your configured provider, makes its own LLM '
1489
+ + 'calls, runs the tools you allow, and returns its actual output. Pass tools:[...] to let it use '
1490
+ + 'tools (requires a tool-calling provider); omit them for a plain completion. Pass provider and/or '
1491
+ + 'model to PIN which backend it runs on — provider is one of your configured provider ids (groq, '
1492
+ + 'gemini, openrouter, local, …; see `provider list`) and model is a model id that provider itself '
1493
+ + 'serves. Without them auto routing chooses, and it can choose a model your account cannot serve, '
1494
+ + 'which fails the whole run. It REFUSES with a typed code when no provider is configured, the '
1495
+ + 'backend is unreachable, or tools were asked for on a provider that cannot call them — it never '
1496
+ + 'reports work it did not do. Every run records the provider, model and tool transport that '
1497
+ + 'actually served it, on success and on failure, and `status`/`wait` return them, so you can check '
1498
+ + 'which backend ran instead of assuming. Use `delegate` for a sub-agent inside the current tool '
1499
+ + 'loop instead of a separate process.',
1422
1500
  category: 'workflow',
1423
1501
  inputSchema: z.object({
1424
1502
  action: z.enum(['spawn', 'status', 'wait', 'kill', 'log']).describe('Action'),
1425
1503
  goal: z.string().optional().describe('Task goal'),
1426
1504
  id: z.string().optional().describe('Subagent ID'),
1427
1505
  timeout: z.number().optional().describe('Timeout'),
1428
- }),
1429
- endsAgentStep: false,
1430
- run: (args) => import('./subagent-spawner.js').then((m) => {
1431
- const { action, goal, id, timeout } = args;
1506
+ tools: z.array(z.string()).optional().describe('Tool names the subagent may use (default: none)'),
1507
+ // Exposed because auto-routing can resolve a model the account cannot serve
1508
+ // (a stale Model Availability Registry entry is the observed cause) — and the
1509
+ // run then fails on a model the caller never chose, with no way to say which
1510
+ // to use instead. Naming a provider/model pins the run. The child records the
1511
+ // pair it actually used on the run either way.
1512
+ provider: z
1513
+ .string()
1514
+ .optional()
1515
+ .describe('Provider id to pin the run to — one of your configured providers, e.g. groq, gemini, '
1516
+ + 'openrouter, local (`provider list` shows them). Default: auto-routed.'),
1517
+ model: z
1518
+ .string()
1519
+ .optional()
1520
+ .describe('Model id to pin, exactly as the provider names it. Only meaningful with provider; '
1521
+ + 'default is that provider default model.'),
1522
+ // WS5 (#27) — run the child in its own git worktree and get the diff back.
1523
+ // Exposed to the MODEL because "isolate this and show me what changed" is a
1524
+ // request a user makes conversationally, and delegating the risky work to an
1525
+ // isolated copy is the case the capability exists for.
1526
+ worktree: z
1527
+ .boolean()
1528
+ .optional()
1529
+ .describe('Run the child in its own git worktree of the current project and return the diff against '
1530
+ + 'the base commit. REFUSES (rather than running unisolated) when this is not a git repo '
1531
+ + 'with a commit. Default false.'),
1532
+ keepWorktree: z
1533
+ .boolean()
1534
+ .optional()
1535
+ .describe('Keep the isolated worktree after the run instead of removing it. Default false.'),
1536
+ }),
1537
+ endsAgentStep: false,
1538
+ run: (args, ctx) => import('./subagent-spawner.js').then((m) => {
1539
+ const { action, goal, id, timeout, tools, provider, model, worktree, keepWorktree } = args;
1432
1540
  const mgr = m.getSubagentManager();
1433
1541
  switch (action) {
1434
- case 'spawn': return goal ? mgr.spawn({ goal }).then((s) => JSON.stringify(s)) : 'goal required';
1542
+ case 'spawn': return goal
1543
+ ? mgr.spawn({
1544
+ goal,
1545
+ // WS5 (#27) — the child works where THIS turn is working. Without it
1546
+ // a subagent spawned from an isolated turn (or from a dashboard turn
1547
+ // attached to a project) forked in the process's own directory — so
1548
+ // "isolate this and delegate it" delegated a copy of the real tree.
1549
+ ...(ctx?.cwd ? { cwd: ctx.cwd } : {}),
1550
+ ...(Array.isArray(tools) && tools.length ? { tools } : {}),
1551
+ ...(typeof provider === 'string' && provider ? { provider } : {}),
1552
+ ...(typeof model === 'string' && model ? { model } : {}),
1553
+ ...(worktree === true ? { worktree: true } : {}),
1554
+ ...(keepWorktree === true ? { keepWorktree: true } : {}),
1555
+ }).then((s) => JSON.stringify(s))
1556
+ : 'goal required';
1435
1557
  case 'status': return id ? JSON.stringify(mgr.getState(id)) : 'id required';
1436
- case 'wait': return id ? mgr.waitForCompletion(id, timeout || 300_000).then((r) => JSON.stringify(r)) : 'id required';
1558
+ // `waitForCompletion` REJECTS when a subagent failed (the child's own exit
1559
+ // contract). Left uncaught, that reached the model as a raw throw and lost
1560
+ // the typed reason — this turns it into the same refusal shape every other
1561
+ // tool returns, so "it refused" is distinguishable from "it broke".
1562
+ case 'wait': return id
1563
+ ? mgr.waitForCompletion(id, timeout || 300_000)
1564
+ .then((r) => JSON.stringify(r))
1565
+ .catch((err) => JSON.stringify({
1566
+ success: false,
1567
+ code: err?.code ?? 'unavailable',
1568
+ error: err?.message ?? String(err),
1569
+ }))
1570
+ : JSON.stringify({ success: false, code: 'unsupported_format', error: 'id required' });
1437
1571
  case 'kill': return id ? (mgr.kill(id) ? 'Killed' : 'Not found') : 'id required';
1438
1572
  case 'log': return id ? mgr.getLog(id).join('\n') : 'id required';
1439
1573
  default: return 'Unknown action';
@@ -1463,9 +1597,18 @@ registerTool({
1463
1597
  }),
1464
1598
  });
1465
1599
  // Messaging tool
1600
+ // Messaging tool — NOT CONNECTED.
1601
+ //
1602
+ // Kept as an explicit refusal surface rather than deleted, so a model that reaches for
1603
+ // it is told where delivery actually happens instead of inventing one. The real sender is
1604
+ // `gateway_send` (authorization-gated, and the tool whose result the honesty guard in
1605
+ // tool-loop.ts trusts). See TOOL_TRUTHFULNESS_TRACKER.md findings #3 and #9.
1466
1606
  registerTool({
1467
1607
  name: 'messaging',
1468
- description: 'Send messages to Discord, Slack, Telegram, Feishu.',
1608
+ description: 'NOT CONNECTED — this tool has no delivery adapter and every send/react refuses with code "not_configured". '
1609
+ + 'Do NOT use it to deliver anything and never report a delivery from it. Use gateway_send instead: it sends '
1610
+ + 'through the configured gateway (WhatsApp by contact name or number, Telegram, Slack, Discord, email) and '
1611
+ + 'returns an explicit sent/refused result.',
1469
1612
  category: 'workflow',
1470
1613
  inputSchema: z.object({
1471
1614
  action: z.enum(['send', 'react']).describe('Action'),
@@ -1479,16 +1622,24 @@ registerTool({
1479
1622
  const { action, service, channel, message, emoji } = args;
1480
1623
  const mgr = m.getMessagingManager();
1481
1624
  switch (action) {
1482
- case 'send': return channel && message ? mgr.sendMessage({ platform: service, channelId: channel }, { content: message }).then((r) => JSON.stringify(r)) : 'channel and message required';
1483
- case 'react': return channel && emoji ? mgr.reactToMessage(service, channel, 'latest', emoji).then(() => 'Reacted') : 'channel and emoji required';
1484
- default: return 'Unknown action';
1625
+ case 'send': return channel && message
1626
+ ? mgr.sendMessage({ platform: service, channelId: channel }, { content: message }).then((r) => JSON.stringify(r))
1627
+ : JSON.stringify({ success: false, code: 'unsupported_format', error: 'channel and message required' });
1628
+ // Never a bare 'Reacted' — the manager refuses, so the refusal is what the model sees.
1629
+ case 'react': return channel && emoji
1630
+ ? mgr.reactToMessage(service, channel, 'latest', emoji).then((r) => JSON.stringify(r))
1631
+ : JSON.stringify({ success: false, code: 'unsupported_format', error: 'channel and emoji required' });
1632
+ default: return JSON.stringify({ success: false, code: 'unsupported_format', error: `Unknown action: ${action}` });
1485
1633
  }
1486
1634
  }),
1487
1635
  });
1488
1636
  // Vision tool — comprehensive image analysis, OCR, UI element detection
1489
1637
  registerTool({
1490
1638
  name: 'vision',
1491
- description: 'Vision tools: analyze images, extract text via OCR, detect UI elements, compare screenshots. Use when the user provides an image or asks about visual content.',
1639
+ description: 'Analyze an image and transcribe its text (OCR) through the configured vision backend (a local Ollama '
1640
+ + 'vision model or a Gemini key); `analyze` also reports real pixel dimensions. detect-elements, '
1641
+ + 'find-element and compare have NO backend and return ok:false with code "not_configured" — an empty '
1642
+ + 'element list is a refusal, never "found nothing". For a plain description prefer describe_image.',
1492
1643
  category: 'workflow',
1493
1644
  inputSchema: z.object({
1494
1645
  action: z.enum(['analyze', 'ocr', 'detect-elements', 'compare', 'find-element', 'extract-text']).describe('Vision action'),
@@ -1506,8 +1657,10 @@ registerTool({
1506
1657
  case 'ocr': return analyzer.ocr(imagePath).then((r) => JSON.stringify(r));
1507
1658
  case 'detect-elements': return analyzer.detectUIElements(imagePath).then((r) => JSON.stringify(r));
1508
1659
  case 'compare': return imagePath2 ? analyzer.compare(imagePath, imagePath2).then((r) => JSON.stringify(r)) : 'imagePath2 required for comparison';
1509
- case 'find-element': return searchText ? analyzer.findElementByText(imagePath, searchText).then((r) => JSON.stringify(r)) : 'searchText required';
1510
- case 'extract-text': return analyzer.extractText(imagePath).then((r) => JSON.stringify({ text: r }));
1660
+ // null means "refused or not found" — surfaced as `ok` so the two are distinguishable.
1661
+ case 'find-element': return searchText ? analyzer.findElementByText(imagePath, searchText).then((r) => JSON.stringify({ ok: r !== null, element: r })) : 'searchText required';
1662
+ // Same result shape as `ocr`: a refusal must not be flattened into an empty string.
1663
+ case 'extract-text': return analyzer.ocr(imagePath).then((r) => JSON.stringify(r));
1511
1664
  default: return 'Unknown action';
1512
1665
  }
1513
1666
  }),
@@ -2693,18 +2846,32 @@ registerTool({
2693
2846
  }),
2694
2847
  });
2695
2848
  // Read Extract — Document-to-text extraction
2849
+ //
2850
+ // The description advertises ONLY what is implemented (see read-extract.ts). It used
2851
+ // to list PDF/DOCX/XLSX/PPTX while reading PDF/DOCX as raw bytes — which is how a
2852
+ // model concluded an unreadable PDF had been read (TOOL_TRUTHFULNESS_TRACKER.md #1).
2853
+ // It now names the formats that genuinely work, and the refusal codes for the ones
2854
+ // that cannot, so the model can distinguish "read it" from "could not read it".
2696
2855
  registerTool({
2697
2856
  name: 'read_extract',
2698
- description: 'Extract text from documents — PDF, DOCX, XLSX, PPTX, HTML, CSV, JSON.',
2857
+ description: 'Extract text from a document. WORKS for PDF, DOCX, XLSX, PPTX, HTML, CSV/TSV, JSON, XML, YAML and '
2858
+ + 'plain text/Markdown; PDF and spreadsheet table rows are preserved so values stay paired with their '
2859
+ + 'columns. Returns success:false with a typed code when it cannot read the file — "no_data" means a '
2860
+ + 'scanned PDF with no text layer (use describe_image on a screenshot instead), "unsupported_format" '
2861
+ + 'means a legacy .doc/.xls/.ppt/.rtf/.odt, "not_configured" means a reader package is missing. '
2862
+ + 'NEVER report a document as read when this tool returned success:false.',
2699
2863
  category: 'workflow',
2700
2864
  inputSchema: z.object({
2701
2865
  filePath: z.string().describe('File path to extract text from'),
2866
+ ocr: z.boolean().optional().describe('Set true ONLY to recover text from a scanned PDF that has no text layer. Renders the pages and '
2867
+ + 'transcribes them with the vision model — slower, and the text is a transcription rather than a '
2868
+ + 'parsed layer, so digits should be verified. Leave unset for all normal documents.'),
2702
2869
  }),
2703
2870
  endsAgentStep: false,
2704
2871
  run: (args) => import('./read-extract.js').then((m) => {
2705
2872
  const mgr = m.getReadExtractManager();
2706
- const { filePath } = args;
2707
- return mgr.extract(filePath).then((r) => JSON.stringify(r));
2873
+ const { filePath, ocr } = args;
2874
+ return mgr.extract(filePath, { ocr: Boolean(ocr) }).then((r) => JSON.stringify(r));
2708
2875
  }),
2709
2876
  });
2710
2877
  // Credential Files — Credential file management