@webpresso/agent-kit 3.1.30 → 3.3.0

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 (300) hide show
  1. package/README.md +53 -15
  2. package/bin/_run.js +183 -20
  3. package/catalog/AGENTS.md.tpl +3 -3
  4. package/catalog/agent/agents/implementer.md +45 -0
  5. package/catalog/agent/rules/parallel-orchestration-quota.md +100 -0
  6. package/catalog/agent/rules/pre-implementation.md +28 -1
  7. package/catalog/agent/rules/supported-agent-clis.md +9 -0
  8. package/catalog/agent/rules/typescript-version.md +50 -0
  9. package/catalog/agent/skills/codex/SKILL.md +25 -1
  10. package/catalog/agent/skills/verify/SKILL.md +4 -2
  11. package/catalog/docs/templates/blueprint.md +1 -1
  12. package/dist/esm/audit/agents.js +1 -0
  13. package/dist/esm/audit/blueprint-lifecycle-sql.d.ts +12 -0
  14. package/dist/esm/audit/blueprint-lifecycle-sql.js +23 -2
  15. package/dist/esm/audit/blueprint-pr-coverage.js +4 -0
  16. package/dist/esm/audit/blueprint-trust.js +14 -10
  17. package/dist/esm/audit/changeset-evidence.d.ts +23 -0
  18. package/dist/esm/audit/changeset-evidence.js +30 -0
  19. package/dist/esm/audit/changeset-required.d.ts +10 -0
  20. package/dist/esm/audit/changeset-required.js +73 -0
  21. package/dist/esm/audit/ci-guardrails-detection.d.ts +27 -0
  22. package/dist/esm/audit/ci-guardrails-detection.js +68 -0
  23. package/dist/esm/audit/ci-guardrails-wiring.d.ts +22 -0
  24. package/dist/esm/audit/ci-guardrails-wiring.js +80 -0
  25. package/dist/esm/audit/ci-test-perf.js +30 -0
  26. package/dist/esm/audit/command-surface.js +4 -2
  27. package/dist/esm/audit/host-substitution-risk.d.ts +2 -0
  28. package/dist/esm/audit/host-substitution-risk.js +256 -0
  29. package/dist/esm/audit/registry.d.ts +4 -4
  30. package/dist/esm/audit/registry.js +13 -1
  31. package/dist/esm/audit/toolchain-isolation.js +1 -2
  32. package/dist/esm/audit/typescript-version.d.ts +2 -0
  33. package/dist/esm/audit/typescript-version.js +123 -0
  34. package/dist/esm/blueprint/core/parser.js +101 -2
  35. package/dist/esm/blueprint/core/schema.d.ts +1 -0
  36. package/dist/esm/blueprint/core/schema.js +26 -0
  37. package/dist/esm/blueprint/core/validation/criteria.d.ts +14 -0
  38. package/dist/esm/blueprint/core/validation/criteria.js +41 -2
  39. package/dist/esm/blueprint/core/validation/state.js +25 -14
  40. package/dist/esm/blueprint/db/migrations/run.js +4 -2
  41. package/dist/esm/blueprint/lifecycle/audit.d.ts +20 -0
  42. package/dist/esm/blueprint/lifecycle/audit.js +87 -20
  43. package/dist/esm/blueprint/lifecycle/canonicalize.d.ts +6 -0
  44. package/dist/esm/blueprint/lifecycle/canonicalize.js +135 -0
  45. package/dist/esm/blueprint/lifecycle/local.d.ts +2 -1
  46. package/dist/esm/blueprint/lifecycle/local.js +19 -3
  47. package/dist/esm/blueprint/lifecycle/review-provenance.d.ts +6 -0
  48. package/dist/esm/blueprint/lifecycle/review-provenance.js +68 -12
  49. package/dist/esm/blueprint/lifecycle/rollout-anchor.d.ts +97 -0
  50. package/dist/esm/blueprint/lifecycle/rollout-anchor.js +161 -0
  51. package/dist/esm/blueprint/service/BlueprintCreationService.d.ts +1 -0
  52. package/dist/esm/blueprint/service/BlueprintCreationService.js +53 -4
  53. package/dist/esm/blueprint/service/blueprint-tech-debt-links.js +16 -2
  54. package/dist/esm/blueprint/sync/client.d.ts +2 -1
  55. package/dist/esm/blueprint/sync/client.js +1 -1
  56. package/dist/esm/blueprint/trust/command-runner.d.ts +26 -0
  57. package/dist/esm/blueprint/trust/command-runner.js +148 -0
  58. package/dist/esm/blueprint/trust/dossier.d.ts +1 -0
  59. package/dist/esm/blueprint/trust/dossier.js +40 -6
  60. package/dist/esm/blueprint/trust/gates.d.ts +7 -0
  61. package/dist/esm/blueprint/trust/gates.js +20 -0
  62. package/dist/esm/blueprint/trust/promotion.d.ts +8 -0
  63. package/dist/esm/blueprint/trust/promotion.js +74 -112
  64. package/dist/esm/blueprint/trust/scaffold.d.ts +19 -0
  65. package/dist/esm/blueprint/trust/scaffold.js +64 -0
  66. package/dist/esm/blueprint/trust/validator.d.ts +1 -0
  67. package/dist/esm/blueprint/trust/validator.js +7 -1
  68. package/dist/esm/blueprint/utils/archive.js +27 -5
  69. package/dist/esm/blueprint/utils/document-paths.d.ts +18 -0
  70. package/dist/esm/blueprint/utils/document-paths.js +45 -12
  71. package/dist/esm/build/cli-mcp-parity.js +15 -0
  72. package/dist/esm/cli/bundle/commands/blueprint.d.ts +1 -0
  73. package/dist/esm/cli/bundle/commands/blueprint.js +1 -0
  74. package/dist/esm/cli/cli.d.ts +1 -1
  75. package/dist/esm/cli/cli.js +43 -0
  76. package/dist/esm/cli/commands/agent-launch.d.ts +8 -1
  77. package/dist/esm/cli/commands/agent-launch.js +93 -4
  78. package/dist/esm/cli/commands/audit-core.d.ts +1 -1
  79. package/dist/esm/cli/commands/audit-core.js +8 -1
  80. package/dist/esm/cli/commands/audit.js +21 -5
  81. package/dist/esm/cli/commands/blueprint/execution.js +18 -6
  82. package/dist/esm/cli/commands/blueprint/mutations.js +59 -40
  83. package/dist/esm/cli/commands/blueprint/router-dispatch.d.ts +2 -1
  84. package/dist/esm/cli/commands/blueprint/router-dispatch.js +20 -1
  85. package/dist/esm/cli/commands/blueprint/router-output.d.ts +21 -0
  86. package/dist/esm/cli/commands/blueprint/router-output.js +48 -17
  87. package/dist/esm/cli/commands/blueprint/router.d.ts +7 -0
  88. package/dist/esm/cli/commands/blueprint/router.js +13 -1
  89. package/dist/esm/cli/commands/ci-preflight.d.ts +13 -2
  90. package/dist/esm/cli/commands/ci-preflight.js +30 -6
  91. package/dist/esm/cli/commands/compile.js +5 -31
  92. package/dist/esm/cli/commands/dash/delivery-status.d.ts +1 -0
  93. package/dist/esm/cli/commands/dash/delivery-status.js +11 -4
  94. package/dist/esm/cli/commands/doctor.js +5 -0
  95. package/dist/esm/cli/commands/hook.d.ts +5 -0
  96. package/dist/esm/cli/commands/hook.js +15 -9
  97. package/dist/esm/cli/commands/init/config.js +2 -2
  98. package/dist/esm/cli/commands/init/convergence-apply.d.ts +88 -0
  99. package/dist/esm/cli/commands/init/convergence-apply.js +325 -0
  100. package/dist/esm/cli/commands/init/convergence-state.d.ts +13 -0
  101. package/dist/esm/cli/commands/init/convergence-state.js +54 -0
  102. package/dist/esm/cli/commands/init/convergence.d.ts +23 -0
  103. package/dist/esm/cli/commands/init/convergence.js +57 -0
  104. package/dist/esm/cli/commands/init/git-convergence.d.ts +19 -0
  105. package/dist/esm/cli/commands/init/git-convergence.js +168 -0
  106. package/dist/esm/cli/commands/init/gitignore-patcher.js +2 -0
  107. package/dist/esm/cli/commands/init/grok-privacy-smoke.d.ts +52 -0
  108. package/dist/esm/cli/commands/init/grok-privacy-smoke.js +91 -0
  109. package/dist/esm/cli/commands/init/host-native-proof.d.ts +18 -0
  110. package/dist/esm/cli/commands/init/host-native-proof.js +88 -0
  111. package/dist/esm/cli/commands/init/host-visibility.d.ts +2 -2
  112. package/dist/esm/cli/commands/init/host-visibility.js +94 -5
  113. package/dist/esm/cli/commands/init/index.d.ts +3 -0
  114. package/dist/esm/cli/commands/init/index.js +326 -173
  115. package/dist/esm/cli/commands/init/mcp-spec.d.ts +57 -0
  116. package/dist/esm/cli/commands/init/mcp-spec.js +273 -0
  117. package/dist/esm/cli/commands/init/merge.d.ts +1 -0
  118. package/dist/esm/cli/commands/init/merge.js +30 -1
  119. package/dist/esm/cli/commands/init/package-root.d.ts +7 -0
  120. package/dist/esm/cli/commands/init/package-root.js +10 -2
  121. package/dist/esm/cli/commands/init/plugin-cache-prune.d.ts +0 -3
  122. package/dist/esm/cli/commands/init/plugin-cache-prune.js +0 -1
  123. package/dist/esm/cli/commands/init/scaffold-agents-md.d.ts +1 -1
  124. package/dist/esm/cli/commands/init/scaffold-agents-md.js +9 -3
  125. package/dist/esm/cli/commands/init/scaffold-base-kit.d.ts +20 -0
  126. package/dist/esm/cli/commands/init/scaffold-base-kit.js +61 -5
  127. package/dist/esm/cli/commands/init/scaffolders/agent-hooks/emitters/grok.d.ts +14 -8
  128. package/dist/esm/cli/commands/init/scaffolders/agent-hooks/emitters/grok.js +41 -24
  129. package/dist/esm/cli/commands/init/scaffolders/agent-hooks/index.d.ts +2 -0
  130. package/dist/esm/cli/commands/init/scaffolders/agent-hooks/index.js +54 -24
  131. package/dist/esm/cli/commands/init/scaffolders/codex-mcp/index.d.ts +12 -31
  132. package/dist/esm/cli/commands/init/scaffolders/codex-mcp/index.js +288 -202
  133. package/dist/esm/cli/commands/init/scaffolders/file-transaction.d.ts +22 -0
  134. package/dist/esm/cli/commands/init/scaffolders/file-transaction.js +230 -0
  135. package/dist/esm/cli/commands/init/scaffolders/grok-mcp/index.d.ts +38 -0
  136. package/dist/esm/cli/commands/init/scaffolders/grok-mcp/index.js +73 -0
  137. package/dist/esm/cli/commands/init/scaffolders/opencode-plugin/index.d.ts +21 -0
  138. package/dist/esm/cli/commands/init/scaffolders/opencode-plugin/index.js +559 -63
  139. package/dist/esm/cli/commands/init/untracked-collision.d.ts +14 -0
  140. package/dist/esm/cli/commands/init/untracked-collision.js +42 -0
  141. package/dist/esm/cli/commands/opencode-probe.d.ts +107 -0
  142. package/dist/esm/cli/commands/opencode-probe.js +323 -0
  143. package/dist/esm/cli/commands/opencode-rotate.d.ts +72 -0
  144. package/dist/esm/cli/commands/opencode-rotate.js +147 -0
  145. package/dist/esm/cli/commands/public-readiness.d.ts +11 -0
  146. package/dist/esm/cli/commands/public-readiness.js +42 -0
  147. package/dist/esm/cli/commands/quality-runner.js +3 -3
  148. package/dist/esm/cli/commands/review.d.ts +35 -3
  149. package/dist/esm/cli/commands/review.js +751 -209
  150. package/dist/esm/cli/commands/run-wait.d.ts +2 -0
  151. package/dist/esm/cli/commands/run-wait.js +122 -0
  152. package/dist/esm/cli/commands/rust-check.d.ts +24 -0
  153. package/dist/esm/cli/commands/rust-check.js +110 -0
  154. package/dist/esm/cli/commands/setup-help.js +1 -1
  155. package/dist/esm/cli/commands/setup-repair-help.js +1 -1
  156. package/dist/esm/cli/commands/typecheck.d.ts +1 -0
  157. package/dist/esm/cli/commands/typecheck.js +30 -1
  158. package/dist/esm/cli/commands/worktree/router-dispatch.d.ts +6 -0
  159. package/dist/esm/cli/commands/worktree/router-dispatch.js +126 -9
  160. package/dist/esm/cli/commands/worktree/router.js +10 -0
  161. package/dist/esm/cli/direct-provider-launch.js +9 -5
  162. package/dist/esm/cli/optional-tool-freshness.d.ts +27 -0
  163. package/dist/esm/cli/optional-tool-freshness.js +219 -9
  164. package/dist/esm/daemon/domains/git-actions.d.ts +29 -0
  165. package/dist/esm/daemon/domains/git-actions.js +136 -0
  166. package/dist/esm/daemon/domains/run-registry-interop.d.ts +16 -0
  167. package/dist/esm/daemon/domains/run-registry-interop.js +45 -0
  168. package/dist/esm/daemon/domains/sessions-search.d.ts +11 -0
  169. package/dist/esm/daemon/domains/sessions-search.js +29 -0
  170. package/dist/esm/daemon/handlers/blueprints-handlers.d.ts +5 -0
  171. package/dist/esm/daemon/handlers/blueprints-handlers.js +36 -0
  172. package/dist/esm/daemon/handlers/deploy-handlers.d.ts +6 -0
  173. package/dist/esm/daemon/handlers/deploy-handlers.js +5 -0
  174. package/dist/esm/daemon/handlers/fleet-handlers.d.ts +15 -0
  175. package/dist/esm/daemon/handlers/fleet-handlers.js +91 -0
  176. package/dist/esm/daemon/handlers/git-handlers.d.ts +6 -0
  177. package/dist/esm/daemon/handlers/git-handlers.js +27 -0
  178. package/dist/esm/daemon/handlers/product.d.ts +7 -0
  179. package/dist/esm/daemon/handlers/product.js +10 -119
  180. package/dist/esm/daemon/handlers/sessions-handlers.d.ts +12 -0
  181. package/dist/esm/daemon/handlers/sessions-handlers.js +31 -0
  182. package/dist/esm/daemon/handlers/shared.d.ts +5 -0
  183. package/dist/esm/daemon/handlers/shared.js +16 -0
  184. package/dist/esm/daemon/methods.d.ts +8 -1
  185. package/dist/esm/daemon/methods.js +7 -0
  186. package/dist/esm/daemon/protocol/contract.d.ts +43 -0
  187. package/dist/esm/daemon/protocol/contract.js +26 -0
  188. package/dist/esm/daemon/protocol/index.d.ts +1 -1
  189. package/dist/esm/daemon/protocol/index.js +1 -1
  190. package/dist/esm/hooks/__conformance__/matrix.d.ts +6 -0
  191. package/dist/esm/hooks/__conformance__/matrix.js +137 -0
  192. package/dist/esm/hooks/conformance/batch.js +5 -0
  193. package/dist/esm/hooks/doctor.d.ts +5 -3
  194. package/dist/esm/hooks/doctor.js +67 -16
  195. package/dist/esm/hooks/permission-request/index.js +9 -3
  196. package/dist/esm/hooks/permission-request/policy.d.ts +9 -0
  197. package/dist/esm/hooks/permission-request/policy.js +13 -0
  198. package/dist/esm/hooks/pretool-guard/dev-routing.d.ts +9 -0
  199. package/dist/esm/hooks/pretool-guard/dev-routing.js +41 -5
  200. package/dist/esm/hooks/pretool-guard/logger.d.ts +7 -0
  201. package/dist/esm/hooks/pretool-guard/logger.js +16 -0
  202. package/dist/esm/hooks/pretool-guard/runner.d.ts +6 -0
  203. package/dist/esm/hooks/pretool-guard/runner.js +68 -16
  204. package/dist/esm/hooks/pretool-guard/validators/blueprint.js +30 -10
  205. package/dist/esm/hooks/pretool-guard/validators/forbidden-commands.js +54 -0
  206. package/dist/esm/hooks/pretool-guard/validators/index.d.ts +7 -0
  207. package/dist/esm/hooks/pretool-guard/validators/index.js +21 -0
  208. package/dist/esm/hooks/pretool-guard/validators/path-contract.d.ts +19 -0
  209. package/dist/esm/hooks/pretool-guard/validators/path-contract.js +25 -8
  210. package/dist/esm/hooks/pretool-guard/validators/worktree-discipline.js +6 -1
  211. package/dist/esm/hooks/shared/guard-outcome.d.ts +149 -0
  212. package/dist/esm/hooks/shared/guard-outcome.js +215 -0
  213. package/dist/esm/hooks/shared/hook-bootstrap.d.ts +26 -0
  214. package/dist/esm/hooks/shared/hook-bootstrap.js +64 -1
  215. package/dist/esm/hooks/shared/types.d.ts +8 -5
  216. package/dist/esm/hooks/shared/types.js +50 -9
  217. package/dist/esm/hooks/stop/qa-changed-files.d.ts +11 -0
  218. package/dist/esm/hooks/stop/qa-changed-files.js +92 -0
  219. package/dist/esm/mcp/blueprint/_shared/lifecycle.js +14 -1
  220. package/dist/esm/mcp/blueprint/handlers/document-mutations.d.ts +5 -0
  221. package/dist/esm/mcp/blueprint/handlers/document-mutations.js +109 -11
  222. package/dist/esm/mcp/blueprint/handlers/review-log.js +8 -1
  223. package/dist/esm/mcp/blueprint/handlers/task-advance.js +113 -54
  224. package/dist/esm/mcp/blueprint/handlers/task-verify.js +39 -19
  225. package/dist/esm/mcp/blueprint/registration.js +3 -2
  226. package/dist/esm/mcp/server.d.ts +1 -0
  227. package/dist/esm/mcp/server.js +27 -0
  228. package/dist/esm/mcp/tools/_names.d.ts +1 -1
  229. package/dist/esm/mcp/tools/_names.js +5 -0
  230. package/dist/esm/mcp/tools/_registry.js +10 -0
  231. package/dist/esm/mcp/tools/_shared/audit-kinds.d.ts +1 -1
  232. package/dist/esm/mcp/tools/_shared/result.js +44 -1
  233. package/dist/esm/mcp/tools/audit.d.ts +5 -1
  234. package/dist/esm/mcp/tools/audit.js +42 -0
  235. package/dist/esm/mcp/tools/audits.d.ts +4 -0
  236. package/dist/esm/mcp/tools/ci-preflight.d.ts +50 -0
  237. package/dist/esm/mcp/tools/ci-preflight.js +183 -0
  238. package/dist/esm/mcp/tools/pr-upsert.js +39 -1
  239. package/dist/esm/mcp/tools/review-run.d.ts +28 -0
  240. package/dist/esm/mcp/tools/review-run.js +216 -0
  241. package/dist/esm/mcp/tools/run-wait.d.ts +86 -0
  242. package/dist/esm/mcp/tools/run-wait.js +593 -0
  243. package/dist/esm/mcp/tools/session-fetch-and-index.d.ts +1 -1
  244. package/dist/esm/mcp/tools/session-id.d.ts +3 -0
  245. package/dist/esm/mcp/tools/session-id.js +45 -0
  246. package/dist/esm/mcp/tools/session-info.d.ts +3 -0
  247. package/dist/esm/mcp/tools/session-info.js +49 -0
  248. package/dist/esm/output-transforms/audit.d.ts +23 -0
  249. package/dist/esm/output-transforms/audit.js +47 -0
  250. package/dist/esm/output-transforms/index.js +2 -0
  251. package/dist/esm/package.json +2 -0
  252. package/dist/esm/platform/client.d.ts +7 -1
  253. package/dist/esm/platform/github-contract-source.d.ts +2 -1
  254. package/dist/esm/pr-description/contract.js +24 -4
  255. package/dist/esm/review/authority.js +27 -14
  256. package/dist/esm/review/availability.d.ts +33 -0
  257. package/dist/esm/review/availability.js +122 -20
  258. package/dist/esm/review/delivery-verifier.d.ts +27 -0
  259. package/dist/esm/review/delivery-verifier.js +115 -0
  260. package/dist/esm/review/events.d.ts +3 -2
  261. package/dist/esm/review/events.js +23 -3
  262. package/dist/esm/review/execution/adapters.d.ts +11 -1
  263. package/dist/esm/review/execution/adapters.js +36 -10
  264. package/dist/esm/review/execution/artifacts.d.ts +1 -1
  265. package/dist/esm/review/execution/output-policy.d.ts +2 -0
  266. package/dist/esm/review/execution/output-policy.js +12 -0
  267. package/dist/esm/review/execution/review-checkout.js +121 -21
  268. package/dist/esm/review/execution/supervisor.js +36 -4
  269. package/dist/esm/review/execution/types.d.ts +9 -0
  270. package/dist/esm/review/opencode-account.d.ts +24 -0
  271. package/dist/esm/review/opencode-account.js +68 -0
  272. package/dist/esm/review/opencode-auth.d.ts +33 -0
  273. package/dist/esm/review/opencode-auth.js +79 -0
  274. package/dist/esm/review/subject.d.ts +25 -0
  275. package/dist/esm/review/subject.js +116 -26
  276. package/dist/esm/runtime/opencode-account-materializer.d.ts +34 -0
  277. package/dist/esm/runtime/opencode-account-materializer.js +33 -0
  278. package/dist/esm/rust/affected-manifests.d.ts +38 -0
  279. package/dist/esm/rust/affected-manifests.js +69 -0
  280. package/dist/esm/session-memory/fetch-index.d.ts +1 -1
  281. package/dist/esm/status/snapshot.js +32 -25
  282. package/dist/esm/test/duration-sequencer.d.ts +20 -0
  283. package/dist/esm/test/duration-sequencer.js +54 -0
  284. package/dist/esm/test/shard-durations.json +922 -0
  285. package/dist/esm/test/worker-budget.d.ts +6 -0
  286. package/dist/esm/test/worker-budget.js +59 -1
  287. package/dist/esm/test-helpers/global-setup.d.ts +1 -2
  288. package/dist/esm/test-helpers/global-setup.js +79 -32
  289. package/dist/esm/typecheck/planner.d.ts +9 -1
  290. package/dist/esm/typecheck/planner.js +31 -0
  291. package/dist/esm/ultragoal/service.d.ts +7 -0
  292. package/dist/esm/ultragoal/service.js +42 -2
  293. package/dist/esm/utils/write-json-file.js +3 -1
  294. package/dist/esm/worktrees/codex-project-trust.d.ts +15 -0
  295. package/dist/esm/worktrees/codex-project-trust.js +56 -0
  296. package/dist/esm/worktrees/orphan-scan.d.ts +50 -0
  297. package/dist/esm/worktrees/orphan-scan.js +211 -0
  298. package/dist/esm/worktrees/registry.d.ts +8 -0
  299. package/dist/esm/worktrees/registry.js +18 -3
  300. package/package.json +18 -13
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Blueprint-domain product handlers: `blueprints.list` is a real
3
+ * implementation over the `blueprints/<status>/` directories; `blueprints.exec`
4
+ * is not implemented (exec remains CLI-owned).
5
+ */
6
+ import { readdirSync, existsSync, statSync } from "node:fs";
7
+ import { join } from "node:path";
8
+ function listBlueprintRows(repoRoot) {
9
+ const statuses = ["completed", "in-progress", "planned", "parked", "draft", "archived"];
10
+ const rows = [];
11
+ for (const status of statuses) {
12
+ const dir = join(repoRoot, "blueprints", status);
13
+ if (!existsSync(dir) || !statSync(dir).isDirectory())
14
+ continue;
15
+ for (const name of readdirSync(dir)) {
16
+ if (name.startsWith("."))
17
+ continue;
18
+ rows.push({ slug: name, status });
19
+ }
20
+ }
21
+ rows.sort((a, b) => a.slug.localeCompare(b.slug));
22
+ return rows;
23
+ }
24
+ /**
25
+ * Build blueprint-domain handlers scoped to `repoRoot`.
26
+ */
27
+ export function createBlueprintsHandlers(repoRoot) {
28
+ return {
29
+ "blueprints.list": () => ({
30
+ blueprints: listBlueprintRows(repoRoot),
31
+ }),
32
+ "blueprints.exec": () => {
33
+ throw new Error("blueprints.exec is not implemented (exec remains CLI-owned)");
34
+ },
35
+ };
36
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Deploy-domain product handlers: `deploy.run` is not implemented (no deploy
3
+ * job ledger; refuse fabricated handles).
4
+ */
5
+ import type { MethodHandler } from "#daemon/rpc.js";
6
+ export declare const deployHandlers: Readonly<Partial<Record<string, MethodHandler>>>;
@@ -0,0 +1,5 @@
1
+ export const deployHandlers = {
2
+ "deploy.run": () => {
3
+ throw new Error("deploy.run is not implemented (no deploy job ledger; refuse fabricated handles)");
4
+ },
5
+ };
@@ -0,0 +1,15 @@
1
+ import type { MethodHandler } from "#daemon/rpc.js";
2
+ import { type FleetStatus } from "#fleet/status.js";
3
+ import type { FleetStatusResult } from "#daemon/protocol/contract.js";
4
+ /**
5
+ * Adapt the rich `collectFleetStatus` output down to the FROZEN daemon wire
6
+ * contract `{ agents: [{ id, state, label? }] }` that
7
+ * apps/desktop/src-tauri/src/commands/fleet.rs already destructures. Pure /
8
+ * unit-testable without spawning real git or gh. Complexity: O(worktrees).
9
+ */
10
+ export declare function toFleetStatusResult(status: FleetStatus): FleetStatusResult;
11
+ /**
12
+ * Build fleet-domain handlers. `repoRoot` is the default worktree root used
13
+ * when a request does not supply its own `repoRoot` param.
14
+ */
15
+ export declare function createFleetHandlers(repoRoot: string): Readonly<Partial<Record<string, MethodHandler>>>;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Fleet-domain product handlers: `worktrees.list` is a real implementation
3
+ * over `git worktree list`; `fleet.status` calls the production
4
+ * `collectFleetStatus` engine and adapts its shape to the frozen daemon
5
+ * wire contract.
6
+ */
7
+ import { execFileSync } from "node:child_process";
8
+ import { collectFleetStatus } from "#fleet/status.js";
9
+ import { asRecord } from "./shared.js";
10
+ function worktreeRows(repoRoot) {
11
+ try {
12
+ const out = execFileSync("git", ["worktree", "list", "--porcelain"], {
13
+ cwd: repoRoot,
14
+ encoding: "utf8",
15
+ stdio: ["ignore", "pipe", "pipe"],
16
+ });
17
+ const rows = [];
18
+ let path;
19
+ let branch;
20
+ for (const line of out.split("\n")) {
21
+ if (line.startsWith("worktree ")) {
22
+ if (path)
23
+ rows.push({ path, branch });
24
+ path = line.slice("worktree ".length).trim();
25
+ branch = undefined;
26
+ }
27
+ else if (line.startsWith("branch ")) {
28
+ branch = line
29
+ .slice("branch ".length)
30
+ .trim()
31
+ .replace(/^refs\/heads\//u, "");
32
+ }
33
+ else if (line === "") {
34
+ if (path)
35
+ rows.push({ path, branch });
36
+ path = undefined;
37
+ branch = undefined;
38
+ }
39
+ }
40
+ if (path)
41
+ rows.push({ path, branch });
42
+ return rows;
43
+ }
44
+ catch {
45
+ return [{ path: repoRoot }];
46
+ }
47
+ }
48
+ /** Single-string worktree classification the frozen daemon wire contract carries as `state`. */
49
+ function classifyWorktreeState(git) {
50
+ if (git.dirtyFiles === null)
51
+ return "unknown";
52
+ if (git.dirtyFiles > 0)
53
+ return "dirty";
54
+ if ((git.ahead ?? 0) > 0 || (git.behind ?? 0) > 0)
55
+ return "drifted";
56
+ return "clean";
57
+ }
58
+ /**
59
+ * Adapt the rich `collectFleetStatus` output down to the FROZEN daemon wire
60
+ * contract `{ agents: [{ id, state, label? }] }` that
61
+ * apps/desktop/src-tauri/src/commands/fleet.rs already destructures. Pure /
62
+ * unit-testable without spawning real git or gh. Complexity: O(worktrees).
63
+ */
64
+ export function toFleetStatusResult(status) {
65
+ return {
66
+ agents: status.worktrees.map((worktree) => ({
67
+ id: worktree.path,
68
+ state: classifyWorktreeState(worktree.git),
69
+ ...(worktree.label ? { label: worktree.label } : {}),
70
+ })),
71
+ };
72
+ }
73
+ /**
74
+ * Build fleet-domain handlers. `repoRoot` is the default worktree root used
75
+ * when a request does not supply its own `repoRoot` param.
76
+ */
77
+ export function createFleetHandlers(repoRoot) {
78
+ return {
79
+ "fleet.status": async () => {
80
+ const status = await collectFleetStatus({ cwd: repoRoot });
81
+ return toFleetStatusResult(status);
82
+ },
83
+ "worktrees.list": (_session, params) => {
84
+ const record = asRecord(params);
85
+ const root = typeof record.repoRoot === "string" && record.repoRoot.length > 0
86
+ ? record.repoRoot
87
+ : repoRoot;
88
+ return { worktrees: worktreeRows(root) };
89
+ },
90
+ };
91
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Git-domain product handlers: `git.diff`, `git.commit`, and `git.createPr`
3
+ * are real implementations over `src/daemon/domains/git-actions.ts`.
4
+ */
5
+ import type { MethodHandler } from "#daemon/rpc.js";
6
+ export declare const gitHandlers: Readonly<Partial<Record<string, MethodHandler>>>;
@@ -0,0 +1,27 @@
1
+ import { gitDiff, gitCommit, gitCreatePr } from "#daemon/domains/git-actions.js";
2
+ import { asRecord, requireString } from "./shared.js";
3
+ export const gitHandlers = {
4
+ "git.diff": (_session, params) => {
5
+ const record = asRecord(params);
6
+ const cwd = requireString(record, "cwd");
7
+ return gitDiff(cwd);
8
+ },
9
+ "git.commit": (_session, params) => {
10
+ const record = asRecord(params);
11
+ const cwd = requireString(record, "cwd");
12
+ const message = requireString(record, "message");
13
+ const paths = Array.isArray(record.paths)
14
+ ? record.paths.filter((p) => typeof p === "string")
15
+ : undefined;
16
+ return gitCommit(cwd, message, paths);
17
+ },
18
+ "git.createPr": (_session, params) => {
19
+ const record = asRecord(params);
20
+ const cwd = requireString(record, "cwd");
21
+ const title = requireString(record, "title");
22
+ // confirmationToken is already consumed by DaemonAuthz before this
23
+ // handler runs (methods.ts requiresConfirmation) — no re-check needed here.
24
+ const body = typeof record.body === "string" ? record.body : undefined;
25
+ return gitCreatePr(cwd, title, body);
26
+ },
27
+ };
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Default production handlers for registered product-domain RPC methods.
3
+ * Wired at daemon start so callers do not need ad-hoc injection.
4
+ *
5
+ * Domain implementations live in the sibling `*-handlers.ts` files; this
6
+ * module only aggregates them into the map `startDaemonServer` consumes.
7
+ */
1
8
  import type { MethodHandler } from "#daemon/rpc.js";
2
9
  /**
3
10
  * Build the default handler map. Callers may override individual methods via
@@ -1,78 +1,8 @@
1
- /**
2
- * Default production handlers for registered product-domain RPC methods.
3
- * Wired at daemon start so callers do not need ad-hoc injection.
4
- */
5
- import { readdirSync, existsSync, statSync } from "node:fs";
6
- import { join } from "node:path";
7
- import { execFileSync } from "node:child_process";
8
- import { gitDiff, gitCommit } from "#daemon/domains/git-actions.js";
9
- function asRecord(params) {
10
- if (params === null || typeof params !== "object" || Array.isArray(params)) {
11
- return {};
12
- }
13
- return params;
14
- }
15
- function requireString(record, key) {
16
- const v = record[key];
17
- if (typeof v !== "string" || v.length === 0) {
18
- throw new Error(`missing string param: ${key}`);
19
- }
20
- return v;
21
- }
22
- function listBlueprintRows(repoRoot) {
23
- const statuses = ["completed", "in-progress", "planned", "parked", "draft", "archived"];
24
- const rows = [];
25
- for (const status of statuses) {
26
- const dir = join(repoRoot, "blueprints", status);
27
- if (!existsSync(dir) || !statSync(dir).isDirectory())
28
- continue;
29
- for (const name of readdirSync(dir)) {
30
- if (name.startsWith("."))
31
- continue;
32
- rows.push({ slug: name, status });
33
- }
34
- }
35
- rows.sort((a, b) => a.slug.localeCompare(b.slug));
36
- return rows;
37
- }
38
- function worktreeRows(repoRoot) {
39
- try {
40
- const out = execFileSync("git", ["worktree", "list", "--porcelain"], {
41
- cwd: repoRoot,
42
- encoding: "utf8",
43
- stdio: ["ignore", "pipe", "pipe"],
44
- });
45
- const rows = [];
46
- let path;
47
- let branch;
48
- for (const line of out.split("\n")) {
49
- if (line.startsWith("worktree ")) {
50
- if (path)
51
- rows.push({ path, branch });
52
- path = line.slice("worktree ".length).trim();
53
- branch = undefined;
54
- }
55
- else if (line.startsWith("branch ")) {
56
- branch = line
57
- .slice("branch ".length)
58
- .trim()
59
- .replace(/^refs\/heads\//u, "");
60
- }
61
- else if (line === "") {
62
- if (path)
63
- rows.push({ path, branch });
64
- path = undefined;
65
- branch = undefined;
66
- }
67
- }
68
- if (path)
69
- rows.push({ path, branch });
70
- return rows;
71
- }
72
- catch {
73
- return [{ path: repoRoot }];
74
- }
75
- }
1
+ import { gitHandlers } from "./git-handlers.js";
2
+ import { createFleetHandlers } from "./fleet-handlers.js";
3
+ import { createBlueprintsHandlers } from "./blueprints-handlers.js";
4
+ import { createSessionsHandlers } from "./sessions-handlers.js";
5
+ import { deployHandlers } from "./deploy-handlers.js";
76
6
  /**
77
7
  * Build the default handler map. Callers may override individual methods via
78
8
  * `startDaemonServer({ handlers })` — overrides win.
@@ -80,49 +10,10 @@ function worktreeRows(repoRoot) {
80
10
  export function createDefaultProductHandlers(options) {
81
11
  const repoRoot = options?.repoRoot ?? process.cwd();
82
12
  return {
83
- "git.diff": (_session, params) => {
84
- const record = asRecord(params);
85
- const cwd = requireString(record, "cwd");
86
- return gitDiff(cwd);
87
- },
88
- "git.commit": (_session, params) => {
89
- const record = asRecord(params);
90
- const cwd = requireString(record, "cwd");
91
- const message = requireString(record, "message");
92
- const paths = Array.isArray(record.paths)
93
- ? record.paths.filter((p) => typeof p === "string")
94
- : undefined;
95
- return gitCommit(cwd, message, paths);
96
- },
97
- "git.createPr": () => {
98
- throw new Error("git.createPr is not implemented in agent-kit daemon (host policy / gh required)");
99
- },
100
- "fleet.status": () => {
101
- throw new Error("fleet.status is not implemented (no worktree fleet integration; refuse empty success)");
102
- },
103
- "worktrees.list": (_session, params) => {
104
- const record = asRecord(params);
105
- const root = typeof record.repoRoot === "string" && record.repoRoot.length > 0
106
- ? record.repoRoot
107
- : repoRoot;
108
- return { worktrees: worktreeRows(root) };
109
- },
110
- "blueprints.list": () => ({
111
- blueprints: listBlueprintRows(repoRoot),
112
- }),
113
- "blueprints.exec": () => {
114
- throw new Error("blueprints.exec is not implemented (exec remains CLI-owned)");
115
- },
116
- "sessions.list": () => {
117
- throw new Error("sessions.list is not implemented (PTY sessions are Tauri-owned; refuse empty success)");
118
- },
119
- "deploy.run": () => {
120
- throw new Error("deploy.run is not implemented (no deploy job ledger; refuse fabricated handles)");
121
- },
122
- "launch.permissionState": () => ({
123
- mode: "safe",
124
- yoloPreference: false,
125
- isolationWarning: "permission state is advisory until full permission UX lands",
126
- }),
13
+ ...gitHandlers,
14
+ ...createFleetHandlers(repoRoot),
15
+ ...createBlueprintsHandlers(repoRoot),
16
+ ...createSessionsHandlers(repoRoot),
17
+ ...deployHandlers,
127
18
  };
128
19
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Session/launch-domain product handlers: `sessions.list` reads the real
3
+ * dash run-registry; `sessions.search` reuses the session-memory FTS index;
4
+ * `launch.permissionState` returns the advisory permission-state stub.
5
+ */
6
+ import type { MethodHandler } from "#daemon/rpc.js";
7
+ /**
8
+ * Build session-domain handlers scoped to `repoRoot`. `repoRoot` doubles as
9
+ * the dash run-registry cwd (sessions.list) and the session-memory index
10
+ * root (sessions.search) — both already resolve per-repo paths on their own.
11
+ */
12
+ export declare function createSessionsHandlers(repoRoot: string): Readonly<Partial<Record<string, MethodHandler>>>;
@@ -0,0 +1,31 @@
1
+ import { defaultIndexDbPath } from "#mcp/tools/session-restore.js";
2
+ import { listDaemonSessions } from "#daemon/domains/run-registry-interop.js";
3
+ import { createSessionMemorySearchBackend, searchSessions, } from "#daemon/domains/sessions-search.js";
4
+ import { asRecord, requireString } from "./shared.js";
5
+ /**
6
+ * Build session-domain handlers scoped to `repoRoot`. `repoRoot` doubles as
7
+ * the dash run-registry cwd (sessions.list) and the session-memory index
8
+ * root (sessions.search) — both already resolve per-repo paths on their own.
9
+ */
10
+ export function createSessionsHandlers(repoRoot) {
11
+ return {
12
+ "sessions.list": async (_session, params) => {
13
+ const record = asRecord(params);
14
+ const limit = typeof record.limit === "number" ? record.limit : undefined;
15
+ return listDaemonSessions({ cwd: repoRoot, limit });
16
+ },
17
+ "sessions.search": (_session, params) => {
18
+ const record = asRecord(params);
19
+ const query = requireString(record, "query");
20
+ const limit = typeof record.limit === "number" ? record.limit : undefined;
21
+ const backend = createSessionMemorySearchBackend(defaultIndexDbPath(repoRoot));
22
+ const hits = searchSessions(backend, { query, limit });
23
+ return { hits };
24
+ },
25
+ "launch.permissionState": () => ({
26
+ mode: "safe",
27
+ yoloPreference: false,
28
+ isolationWarning: "permission state is advisory until full permission UX lands",
29
+ }),
30
+ };
31
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Shared parameter-parsing helpers for daemon product-domain handlers.
3
+ */
4
+ export declare function asRecord(params: unknown): Record<string, unknown>;
5
+ export declare function requireString(record: Record<string, unknown>, key: string): string;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Shared parameter-parsing helpers for daemon product-domain handlers.
3
+ */
4
+ export function asRecord(params) {
5
+ if (params === null || typeof params !== "object" || Array.isArray(params)) {
6
+ return {};
7
+ }
8
+ return params;
9
+ }
10
+ export function requireString(record, key) {
11
+ const v = record[key];
12
+ if (typeof v !== "string" || v.length === 0) {
13
+ throw new Error(`missing string param: ${key}`);
14
+ }
15
+ return v;
16
+ }
@@ -92,6 +92,13 @@ export declare const DAEMON_METHOD_REGISTRY: {
92
92
  readonly requireHandshake: true;
93
93
  readonly uiFacing: true;
94
94
  };
95
+ readonly "sessions.search": {
96
+ readonly privileged: true;
97
+ readonly requiresConfirmation: false;
98
+ readonly mutates: false;
99
+ readonly requireHandshake: true;
100
+ readonly uiFacing: true;
101
+ };
95
102
  readonly "git.diff": {
96
103
  readonly privileged: true;
97
104
  readonly requiresConfirmation: false;
@@ -164,7 +171,7 @@ export type UiRpcMethod = {
164
171
  [M in DaemonRpcMethod]: (typeof DAEMON_METHOD_REGISTRY)[M]["uiFacing"] extends true ? M : never;
165
172
  }[DaemonRpcMethod];
166
173
  export declare const UI_RPC_METHODS: UiRpcMethod[];
167
- export declare const DESTRUCTIVE_METHODS: ("auth.issueNonce" | "blueprints.exec" | "blueprints.list" | "daemon.envMap.push" | "deploy.run" | "fleet.status" | "git.commit" | "git.createPr" | "git.diff" | "handshake" | "launch.claim" | "launch.permissionState" | "launch.prepare" | "ping" | "sessions.list" | "worktrees.list")[];
174
+ export declare const DESTRUCTIVE_METHODS: ("auth.issueNonce" | "blueprints.exec" | "blueprints.list" | "daemon.envMap.push" | "deploy.run" | "fleet.status" | "git.commit" | "git.createPr" | "git.diff" | "handshake" | "launch.claim" | "launch.permissionState" | "launch.prepare" | "ping" | "sessions.list" | "sessions.search" | "worktrees.list")[];
168
175
  export declare function getMethodCapability(method: string): MethodCapability | null;
169
176
  export declare function isDaemonRpcMethod(method: string): method is DaemonRpcMethod;
170
177
  export declare function isUiRpcMethod(method: string): method is UiRpcMethod;
@@ -60,6 +60,13 @@ export const DAEMON_METHOD_REGISTRY = {
60
60
  requireHandshake: true,
61
61
  uiFacing: true,
62
62
  },
63
+ "sessions.search": {
64
+ privileged: true,
65
+ requiresConfirmation: false,
66
+ mutates: false,
67
+ requireHandshake: true,
68
+ uiFacing: true,
69
+ },
63
70
  "git.diff": {
64
71
  privileged: true,
65
72
  requiresConfirmation: false,
@@ -92,6 +92,7 @@ export declare const daemonRpcMethodSchema: z.ZodEnum<{
92
92
  "launch.prepare": "launch.prepare";
93
93
  ping: "ping";
94
94
  "sessions.list": "sessions.list";
95
+ "sessions.search": "sessions.search";
95
96
  "worktrees.list": "worktrees.list";
96
97
  }>;
97
98
  export declare const uiRpcMethodSchema: z.ZodEnum<{
@@ -108,6 +109,7 @@ export declare const uiRpcMethodSchema: z.ZodEnum<{
108
109
  "launch.prepare": "launch.prepare";
109
110
  ping: "ping";
110
111
  "sessions.list": "sessions.list";
112
+ "sessions.search": "sessions.search";
111
113
  "worktrees.list": "worktrees.list";
112
114
  }>;
113
115
  export declare const pingParamsSchema: z.ZodObject<{}, z.core.$strict>;
@@ -212,6 +214,32 @@ export declare const sessionsListResultSchema: z.ZodObject<{
212
214
  }, z.core.$strict>>;
213
215
  }, z.core.$strict>;
214
216
  export type SessionsListResult = z.infer<typeof sessionsListResultSchema>;
217
+ /**
218
+ * No db-path override fields: path safety requires the daemon resolve its
219
+ * own index db path from its configured repoRoot, never from a
220
+ * webview-supplied param.
221
+ */
222
+ export declare const sessionsSearchParamsSchema: z.ZodObject<{
223
+ query: z.ZodString;
224
+ limit: z.ZodOptional<z.ZodNumber>;
225
+ }, z.core.$strict>;
226
+ export type SessionsSearchParams = z.infer<typeof sessionsSearchParamsSchema>;
227
+ export declare const sessionSearchHitSchema: z.ZodObject<{
228
+ id: z.ZodString;
229
+ source: z.ZodString;
230
+ text: z.ZodString;
231
+ score: z.ZodNumber;
232
+ }, z.core.$strict>;
233
+ export type SessionSearchHitResult = z.infer<typeof sessionSearchHitSchema>;
234
+ export declare const sessionsSearchResultSchema: z.ZodObject<{
235
+ hits: z.ZodArray<z.ZodObject<{
236
+ id: z.ZodString;
237
+ source: z.ZodString;
238
+ text: z.ZodString;
239
+ score: z.ZodNumber;
240
+ }, z.core.$strict>>;
241
+ }, z.core.$strict>;
242
+ export type SessionsSearchResult = z.infer<typeof sessionsSearchResultSchema>;
215
243
  export declare const gitDiffParamsSchema: z.ZodObject<{
216
244
  cwd: z.ZodString;
217
245
  }, z.core.$strict>;
@@ -255,6 +283,7 @@ export declare const fleetStatusResultSchema: z.ZodObject<{
255
283
  label: z.ZodOptional<z.ZodString>;
256
284
  }, z.core.$strict>>;
257
285
  }, z.core.$strict>;
286
+ export type FleetStatusResult = z.infer<typeof fleetStatusResultSchema>;
258
287
  export declare const worktreesListParamsSchema: z.ZodObject<{
259
288
  repoRoot: z.ZodOptional<z.ZodString>;
260
289
  }, z.core.$strict>;
@@ -387,6 +416,20 @@ export declare const UI_METHOD_SCHEMAS: {
387
416
  }, z.core.$strict>>;
388
417
  }, z.core.$strict>;
389
418
  };
419
+ readonly "sessions.search": {
420
+ readonly params: z.ZodObject<{
421
+ query: z.ZodString;
422
+ limit: z.ZodOptional<z.ZodNumber>;
423
+ }, z.core.$strict>;
424
+ readonly result: z.ZodObject<{
425
+ hits: z.ZodArray<z.ZodObject<{
426
+ id: z.ZodString;
427
+ source: z.ZodString;
428
+ text: z.ZodString;
429
+ score: z.ZodNumber;
430
+ }, z.core.$strict>>;
431
+ }, z.core.$strict>;
432
+ };
390
433
  readonly "git.diff": {
391
434
  readonly params: z.ZodObject<{
392
435
  cwd: z.ZodString;
@@ -189,6 +189,31 @@ export const sessionsListResultSchema = z
189
189
  sessions: z.array(sessionSummarySchema),
190
190
  })
191
191
  .strict();
192
+ // --- sessions.search ---
193
+ /**
194
+ * No db-path override fields: path safety requires the daemon resolve its
195
+ * own index db path from its configured repoRoot, never from a
196
+ * webview-supplied param.
197
+ */
198
+ export const sessionsSearchParamsSchema = z
199
+ .object({
200
+ query: z.string().min(1).max(4_096),
201
+ limit: z.number().int().positive().max(100).optional(),
202
+ })
203
+ .strict();
204
+ export const sessionSearchHitSchema = z
205
+ .object({
206
+ id: z.string().min(1),
207
+ source: z.string().min(1),
208
+ text: z.string(),
209
+ score: z.number(),
210
+ })
211
+ .strict();
212
+ export const sessionsSearchResultSchema = z
213
+ .object({
214
+ hits: z.array(sessionSearchHitSchema),
215
+ })
216
+ .strict();
192
217
  // --- git (stubs) ---
193
218
  export const gitDiffParamsSchema = z
194
219
  .object({
@@ -311,6 +336,7 @@ export const UI_METHOD_SCHEMAS = {
311
336
  result: launchPermissionStateResultSchema,
312
337
  },
313
338
  "sessions.list": { params: sessionsListParamsSchema, result: sessionsListResultSchema },
339
+ "sessions.search": { params: sessionsSearchParamsSchema, result: sessionsSearchResultSchema },
314
340
  "git.diff": { params: gitDiffParamsSchema, result: gitDiffResultSchema },
315
341
  "git.commit": { params: gitCommitParamsSchema, result: gitCommitResultSchema },
316
342
  "git.createPr": { params: gitCreatePrParamsSchema, result: gitCreatePrResultSchema },
@@ -5,4 +5,4 @@
5
5
  * - `#daemon/protocol` (repo-internal package imports)
6
6
  * - `@webpresso/agent-kit/daemon/protocol` (published subpath)
7
7
  */
8
- export { DAEMON_PROTOCOL_VERSION, DAEMON_SESSION_MEMORY_SCHEMA_VERSION, DAEMON_RPC_METHODS, RUST_CHANNEL_METHODS, FORBIDDEN_UI_PAYLOAD_KEYS, UI_METHOD_SCHEMAS, opaqueHandleSchema, permissionModeSchema, providerIdSchema, peerRoleSchema, daemonRpcMethodSchema, handshakeParamsSchema, handshakeResultSchema, pingParamsSchema, pingResultSchema, launchPrepareParamsSchema, launchPrepareResultSchema, launchPermissionStateParamsSchema, launchPermissionStateResultSchema, sessionsListParamsSchema, sessionSummarySchema, sessionsListResultSchema, gitDiffParamsSchema, gitDiffResultSchema, gitCommitParamsSchema, gitCommitResultSchema, gitCreatePrParamsSchema, gitCreatePrResultSchema, fleetStatusParamsSchema, fleetStatusResultSchema, worktreesListParamsSchema, worktreesListResultSchema, blueprintsListParamsSchema, blueprintsListResultSchema, blueprintsExecParamsSchema, blueprintsExecResultSchema, deployRunParamsSchema, deployRunResultSchema, rustSpawnEnvMapSchema, rustSpawnEnvDeliverySchema, sessionExitNotificationSchema, jsonRpcIdSchema, jsonRpcRequestSchema, jsonRpcErrorObjectSchema, jsonRpcSuccessResponseSchema, jsonRpcErrorResponseSchema, jsonRpcResponseSchema, isDaemonRpcMethod, isUiRpcMethod, isRustChannelMethod, UI_RPC_METHODS, parseUiMethodParams, parseUiMethodResult, safeParseUiMethodParams, safeParseUiMethodResult, buildHandshakeResult, payloadHasForbiddenUiKeys, type OpaqueHandle, type PermissionMode, type ProviderId, type PeerRole, type ForbiddenUiPayloadKey, type HandshakeParams, type HandshakeResult, type DaemonRpcMethod, type PingParams, type PingResult, type LaunchPrepareParams, type LaunchPrepareResult, type LaunchPermissionStateParams, type LaunchPermissionStateResult, type SessionsListParams, type SessionSummary, type SessionsListResult, type GitDiffParams, type GitDiffResult, type GitCommitParams, type GitCommitResult, type GitCreatePrParams, type GitCreatePrResult, type RustSpawnEnvMap, type RustSpawnEnvDelivery, type RustChannelMethod, type JsonRpcId, type JsonRpcRequest, type JsonRpcResponse, type MethodSchemaPair, type UiMethodSchemas, } from "./contract.js";
8
+ export { DAEMON_PROTOCOL_VERSION, DAEMON_SESSION_MEMORY_SCHEMA_VERSION, DAEMON_RPC_METHODS, RUST_CHANNEL_METHODS, FORBIDDEN_UI_PAYLOAD_KEYS, UI_METHOD_SCHEMAS, opaqueHandleSchema, permissionModeSchema, providerIdSchema, peerRoleSchema, daemonRpcMethodSchema, handshakeParamsSchema, handshakeResultSchema, pingParamsSchema, pingResultSchema, launchPrepareParamsSchema, launchPrepareResultSchema, launchPermissionStateParamsSchema, launchPermissionStateResultSchema, sessionsListParamsSchema, sessionSummarySchema, sessionsListResultSchema, sessionsSearchParamsSchema, sessionSearchHitSchema, sessionsSearchResultSchema, gitDiffParamsSchema, gitDiffResultSchema, gitCommitParamsSchema, gitCommitResultSchema, gitCreatePrParamsSchema, gitCreatePrResultSchema, fleetStatusParamsSchema, fleetStatusResultSchema, worktreesListParamsSchema, worktreesListResultSchema, blueprintsListParamsSchema, blueprintsListResultSchema, blueprintsExecParamsSchema, blueprintsExecResultSchema, deployRunParamsSchema, deployRunResultSchema, rustSpawnEnvMapSchema, rustSpawnEnvDeliverySchema, sessionExitNotificationSchema, jsonRpcIdSchema, jsonRpcRequestSchema, jsonRpcErrorObjectSchema, jsonRpcSuccessResponseSchema, jsonRpcErrorResponseSchema, jsonRpcResponseSchema, isDaemonRpcMethod, isUiRpcMethod, isRustChannelMethod, UI_RPC_METHODS, parseUiMethodParams, parseUiMethodResult, safeParseUiMethodParams, safeParseUiMethodResult, buildHandshakeResult, payloadHasForbiddenUiKeys, type OpaqueHandle, type PermissionMode, type ProviderId, type PeerRole, type ForbiddenUiPayloadKey, type HandshakeParams, type HandshakeResult, type DaemonRpcMethod, type PingParams, type PingResult, type LaunchPrepareParams, type LaunchPrepareResult, type LaunchPermissionStateParams, type LaunchPermissionStateResult, type SessionsListParams, type SessionSummary, type SessionsListResult, type SessionsSearchParams, type SessionSearchHitResult, type SessionsSearchResult, type GitDiffParams, type GitDiffResult, type GitCommitParams, type GitCommitResult, type GitCreatePrParams, type GitCreatePrResult, type FleetStatusResult, type RustSpawnEnvMap, type RustSpawnEnvDelivery, type RustChannelMethod, type JsonRpcId, type JsonRpcRequest, type JsonRpcResponse, type MethodSchemaPair, type UiMethodSchemas, } from "./contract.js";
@@ -5,4 +5,4 @@
5
5
  * - `#daemon/protocol` (repo-internal package imports)
6
6
  * - `@webpresso/agent-kit/daemon/protocol` (published subpath)
7
7
  */
8
- export { DAEMON_PROTOCOL_VERSION, DAEMON_SESSION_MEMORY_SCHEMA_VERSION, DAEMON_RPC_METHODS, RUST_CHANNEL_METHODS, FORBIDDEN_UI_PAYLOAD_KEYS, UI_METHOD_SCHEMAS, opaqueHandleSchema, permissionModeSchema, providerIdSchema, peerRoleSchema, daemonRpcMethodSchema, handshakeParamsSchema, handshakeResultSchema, pingParamsSchema, pingResultSchema, launchPrepareParamsSchema, launchPrepareResultSchema, launchPermissionStateParamsSchema, launchPermissionStateResultSchema, sessionsListParamsSchema, sessionSummarySchema, sessionsListResultSchema, gitDiffParamsSchema, gitDiffResultSchema, gitCommitParamsSchema, gitCommitResultSchema, gitCreatePrParamsSchema, gitCreatePrResultSchema, fleetStatusParamsSchema, fleetStatusResultSchema, worktreesListParamsSchema, worktreesListResultSchema, blueprintsListParamsSchema, blueprintsListResultSchema, blueprintsExecParamsSchema, blueprintsExecResultSchema, deployRunParamsSchema, deployRunResultSchema, rustSpawnEnvMapSchema, rustSpawnEnvDeliverySchema, sessionExitNotificationSchema, jsonRpcIdSchema, jsonRpcRequestSchema, jsonRpcErrorObjectSchema, jsonRpcSuccessResponseSchema, jsonRpcErrorResponseSchema, jsonRpcResponseSchema, isDaemonRpcMethod, isUiRpcMethod, isRustChannelMethod, UI_RPC_METHODS, parseUiMethodParams, parseUiMethodResult, safeParseUiMethodParams, safeParseUiMethodResult, buildHandshakeResult, payloadHasForbiddenUiKeys, } from "./contract.js";
8
+ export { DAEMON_PROTOCOL_VERSION, DAEMON_SESSION_MEMORY_SCHEMA_VERSION, DAEMON_RPC_METHODS, RUST_CHANNEL_METHODS, FORBIDDEN_UI_PAYLOAD_KEYS, UI_METHOD_SCHEMAS, opaqueHandleSchema, permissionModeSchema, providerIdSchema, peerRoleSchema, daemonRpcMethodSchema, handshakeParamsSchema, handshakeResultSchema, pingParamsSchema, pingResultSchema, launchPrepareParamsSchema, launchPrepareResultSchema, launchPermissionStateParamsSchema, launchPermissionStateResultSchema, sessionsListParamsSchema, sessionSummarySchema, sessionsListResultSchema, sessionsSearchParamsSchema, sessionSearchHitSchema, sessionsSearchResultSchema, gitDiffParamsSchema, gitDiffResultSchema, gitCommitParamsSchema, gitCommitResultSchema, gitCreatePrParamsSchema, gitCreatePrResultSchema, fleetStatusParamsSchema, fleetStatusResultSchema, worktreesListParamsSchema, worktreesListResultSchema, blueprintsListParamsSchema, blueprintsListResultSchema, blueprintsExecParamsSchema, blueprintsExecResultSchema, deployRunParamsSchema, deployRunResultSchema, rustSpawnEnvMapSchema, rustSpawnEnvDeliverySchema, sessionExitNotificationSchema, jsonRpcIdSchema, jsonRpcRequestSchema, jsonRpcErrorObjectSchema, jsonRpcSuccessResponseSchema, jsonRpcErrorResponseSchema, jsonRpcResponseSchema, isDaemonRpcMethod, isUiRpcMethod, isRustChannelMethod, UI_RPC_METHODS, parseUiMethodParams, parseUiMethodResult, safeParseUiMethodParams, safeParseUiMethodResult, buildHandshakeResult, payloadHasForbiddenUiKeys, } from "./contract.js";
@@ -24,6 +24,12 @@ export type WebpressoHookBin = (typeof WEBPRESSO_HOOK_BINS)[number];
24
24
  export type HookRunResult = {
25
25
  readonly stdout: string;
26
26
  readonly exitCode: number | null;
27
+ /**
28
+ * Captured stderr, when the runner provides it. Claude reads stderr as the
29
+ * blocking feedback on an exit-2 PreToolUse deny, so the coded reason is
30
+ * asserted here when the stdout envelope carries none.
31
+ */
32
+ readonly stderr?: string;
27
33
  };
28
34
  type BaseRow = {
29
35
  readonly name: string;