@wardby/cli 0.6.0 → 0.7.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 (576) hide show
  1. package/deploy/local/docker-compose.quickstart-coding.yml +13 -0
  2. package/dist/claude-coding-worker/driver.d.ts +21 -3
  3. package/dist/claude-coding-worker/driver.js +125 -17
  4. package/dist/claude-coding-worker/main.js +34 -6
  5. package/dist/claude-coding-worker/sdk.js +12 -1
  6. package/dist/claude-coding-worker/tool-socket.d.ts +27 -0
  7. package/dist/claude-coding-worker/tool-socket.js +111 -0
  8. package/dist/claude-coding-worker/transcript.d.ts +18 -0
  9. package/dist/claude-coding-worker/transcript.js +77 -0
  10. package/dist/cli-help.d.ts +1 -1
  11. package/dist/cli-help.js +1 -0
  12. package/dist/cli.js +24 -10
  13. package/dist/coding/continuation-wording.d.ts +35 -0
  14. package/dist/coding/continuation-wording.js +73 -0
  15. package/dist/coding/linked-issue-note.d.ts +23 -0
  16. package/dist/coding/linked-issue-note.js +47 -0
  17. package/dist/coding/merge-wording.d.ts +28 -0
  18. package/dist/coding/merge-wording.js +78 -0
  19. package/dist/coding/pr-description-note.d.ts +9 -0
  20. package/dist/coding/pr-description-note.js +32 -0
  21. package/dist/coding/profile.d.ts +46 -126
  22. package/dist/coding/profile.js +45 -4
  23. package/dist/coding/protected-path-wording.d.ts +8 -0
  24. package/dist/coding/protected-path-wording.js +1 -1
  25. package/dist/coding/protocol.d.ts +264 -346
  26. package/dist/coding/protocol.js +235 -12
  27. package/dist/coding/redact.d.ts +3 -0
  28. package/dist/coding/redact.js +12 -0
  29. package/dist/coding/registry/allowlist.d.ts +12 -0
  30. package/dist/coding/registry/allowlist.js +14 -1
  31. package/dist/coding/registry/audit-mode.d.ts +153 -0
  32. package/dist/coding/registry/audit-mode.js +304 -0
  33. package/dist/coding/registry/lockfile-shared.d.ts +36 -0
  34. package/dist/coding/registry/lockfile-shared.js +128 -0
  35. package/dist/coding/registry/lockfiles.js +1 -1
  36. package/dist/coding/registry/npm-lockfile-formats.d.ts +11 -0
  37. package/dist/coding/registry/npm-lockfile-formats.js +41 -0
  38. package/dist/coding/registry/npm-lockfile.d.ts +8 -4
  39. package/dist/coding/registry/npm-lockfile.js +4 -6
  40. package/dist/coding/registry/npm.js +78 -8
  41. package/dist/coding/registry/pnpm-lockfile.d.ts +17 -0
  42. package/dist/coding/registry/pnpm-lockfile.js +189 -0
  43. package/dist/coding/registry/pypi-plan.d.ts +50 -0
  44. package/dist/coding/registry/pypi-plan.js +406 -0
  45. package/dist/coding/registry/pypi-requirements.d.ts +58 -0
  46. package/dist/coding/registry/pypi-requirements.js +155 -0
  47. package/dist/coding/registry/pypi.d.ts +3 -27
  48. package/dist/coding/registry/pypi.js +40 -154
  49. package/dist/coding/registry/refusal-hints.d.ts +20 -0
  50. package/dist/coding/registry/refusal-hints.js +61 -0
  51. package/dist/coding/registry/refusal-wording.d.ts +11 -0
  52. package/dist/coding/registry/refusal-wording.js +56 -0
  53. package/dist/coding/registry/report.d.ts +70 -8
  54. package/dist/coding/registry/report.js +112 -5
  55. package/dist/coding/registry/types.d.ts +58 -8
  56. package/dist/coding/registry/yarn-lockfile.d.ts +30 -0
  57. package/dist/coding/registry/yarn-lockfile.js +367 -0
  58. package/dist/coding/services/catalog.d.ts +37 -351
  59. package/dist/coding/transcript/claude-code.d.ts +13 -0
  60. package/dist/coding/transcript/claude-code.js +273 -0
  61. package/dist/coding/transcript/download-protocol.d.ts +30 -0
  62. package/dist/coding/transcript/download-protocol.js +18 -0
  63. package/dist/coding/transcript/format.d.ts +20 -0
  64. package/dist/coding/transcript/format.js +32 -0
  65. package/dist/coding/transcript/recorder.d.ts +51 -0
  66. package/dist/coding/transcript/recorder.js +225 -0
  67. package/dist/coding/transcript/resume/checkout.d.ts +31 -0
  68. package/dist/coding/transcript/resume/checkout.js +203 -0
  69. package/dist/coding/transcript/resume/command.d.ts +17 -0
  70. package/dist/coding/transcript/resume/command.js +176 -0
  71. package/dist/coding/transcript/resume/download.d.ts +20 -0
  72. package/dist/coding/transcript/resume/download.js +153 -0
  73. package/dist/coding/transcript/resume/launch.d.ts +38 -0
  74. package/dist/coding/transcript/resume/launch.js +128 -0
  75. package/dist/coding/transcript/resume/session-file.d.ts +13 -0
  76. package/dist/coding/transcript/resume/session-file.js +79 -0
  77. package/dist/coding/transcript/resume/stand-in.d.ts +11 -0
  78. package/dist/coding/transcript/resume/stand-in.js +49 -0
  79. package/dist/coding-worker/artifact.d.ts +8 -3
  80. package/dist/coding-worker/artifact.js +3 -1
  81. package/dist/coding-worker/debug-trace.d.ts +6 -5
  82. package/dist/coding-worker/debug-trace.js +13 -18
  83. package/dist/coding-worker/dependency-cache.d.mts +229 -0
  84. package/dist/coding-worker/dependency-cache.mjs +2123 -0
  85. package/dist/coding-worker/driver.d.ts +4 -3
  86. package/dist/coding-worker/driver.js +116 -38
  87. package/dist/coding-worker/errors.d.ts +1 -0
  88. package/dist/coding-worker/errors.js +32 -0
  89. package/dist/coding-worker/task-note.d.ts +11 -0
  90. package/dist/coding-worker/task-note.js +13 -0
  91. package/dist/coding-worker/types.d.ts +11 -0
  92. package/dist/config/dependency-cache.d.ts +23 -0
  93. package/dist/config/dependency-cache.js +32 -0
  94. package/dist/config/providers.d.ts +12 -3
  95. package/dist/config/providers.js +55 -5
  96. package/dist/config/test-simulators.d.ts +82 -0
  97. package/dist/config/test-simulators.js +305 -0
  98. package/dist/core/async-context.d.ts +2 -0
  99. package/dist/core/async-context.js +12 -0
  100. package/dist/core/budget-events.d.ts +108 -0
  101. package/dist/core/budget-events.js +346 -0
  102. package/dist/core/budget-groups.d.ts +50 -1
  103. package/dist/core/budget-groups.js +236 -27
  104. package/dist/core/budget-stopped-head.d.ts +46 -0
  105. package/dist/core/budget-stopped-head.js +81 -0
  106. package/dist/core/budget-topup.d.ts +51 -0
  107. package/dist/core/budget-topup.js +156 -0
  108. package/dist/core/budget-wording.d.ts +16 -2
  109. package/dist/core/budget-wording.js +40 -2
  110. package/dist/core/coding-queue.d.ts +2 -1
  111. package/dist/core/coding-queue.js +7 -0
  112. package/dist/core/cron.d.ts +19 -1
  113. package/dist/core/cron.js +17 -0
  114. package/dist/core/datastores.js +1 -1
  115. package/dist/core/deferred-coding.d.ts +14 -0
  116. package/dist/core/deferred-coding.js +62 -0
  117. package/dist/core/delegation-child.d.ts +25 -0
  118. package/dist/core/delegation-child.js +37 -0
  119. package/dist/core/dispatch.d.ts +42 -0
  120. package/dist/core/dispatch.js +131 -56
  121. package/dist/core/engine-native.js +1 -1
  122. package/dist/core/error-code.d.ts +38 -0
  123. package/dist/core/error-code.js +168 -0
  124. package/dist/core/grants.d.ts +19 -6
  125. package/dist/core/grants.js +55 -6
  126. package/dist/core/host-events.d.ts +18 -2
  127. package/dist/core/host-events.js +284 -24
  128. package/dist/core/host-status.d.ts +85 -3
  129. package/dist/core/host-status.js +298 -20
  130. package/dist/core/issue-bridge.d.ts +50 -6
  131. package/dist/core/issue-bridge.js +124 -33
  132. package/dist/core/issue-events.d.ts +1 -1
  133. package/dist/core/issue-events.js +4 -10
  134. package/dist/core/issue-status.d.ts +1 -1
  135. package/dist/core/issue-status.js +54 -26
  136. package/dist/core/logger.d.ts +5 -0
  137. package/dist/core/logger.js +14 -1
  138. package/dist/core/lost-run-children.d.ts +6 -0
  139. package/dist/core/lost-run-children.js +32 -0
  140. package/dist/core/mark-ready.d.ts +34 -0
  141. package/dist/core/mark-ready.js +152 -0
  142. package/dist/core/markdown-code.d.ts +8 -0
  143. package/dist/core/markdown-code.js +107 -0
  144. package/dist/core/memory-tools.js +7 -0
  145. package/dist/core/merge-order-check.d.ts +2 -1
  146. package/dist/core/merge-order-check.js +8 -1
  147. package/dist/core/notification-templates.d.ts +1 -7
  148. package/dist/core/notification-templates.js +36 -2
  149. package/dist/core/pull-request-state-sync.js +2 -2
  150. package/dist/core/reconciler.d.ts +4 -3
  151. package/dist/core/reconciler.js +8 -1
  152. package/dist/core/related-pull-requests.d.ts +11 -3
  153. package/dist/core/related-pull-requests.js +27 -14
  154. package/dist/core/reply-parts.d.ts +21 -0
  155. package/dist/core/reply-parts.js +73 -0
  156. package/dist/core/review-fix.d.ts +1 -1
  157. package/dist/core/review-fix.js +2 -1
  158. package/dist/core/review-host-checks.d.ts +1 -1
  159. package/dist/core/review-host-tools.d.ts +3 -0
  160. package/dist/core/review-host-tools.js +99 -13
  161. package/dist/core/review-reads.d.ts +55 -0
  162. package/dist/core/review-reads.js +233 -0
  163. package/dist/core/run-status.d.ts +12 -0
  164. package/dist/core/run-status.js +12 -0
  165. package/dist/core/runner.d.ts +80 -34
  166. package/dist/core/runner.js +439 -144
  167. package/dist/core/schedule-start.d.ts +12 -0
  168. package/dist/core/schedule-start.js +14 -0
  169. package/dist/core/secret-broker-config.d.ts +10 -74
  170. package/dist/core/secret-guard.d.ts +46 -0
  171. package/dist/core/secret-guard.js +104 -0
  172. package/dist/core/secret-guarded-stores.d.ts +12 -0
  173. package/dist/core/secret-guarded-stores.js +41 -0
  174. package/dist/core/secret-spans.d.ts +50 -0
  175. package/dist/core/secret-spans.js +94 -0
  176. package/dist/core/stop-run.d.ts +46 -0
  177. package/dist/core/stop-run.js +61 -0
  178. package/dist/core/workflow-events.d.ts +14 -2
  179. package/dist/core/workflow-events.js +4 -0
  180. package/dist/core/workflow-run-events.d.ts +5 -3
  181. package/dist/core/workflow-run-events.js +43 -8
  182. package/dist/core/zod-json-schema.d.ts +4 -0
  183. package/dist/core/zod-json-schema.js +39 -0
  184. package/dist/core/zod3-window.d.ts +35 -0
  185. package/dist/core/zod3-window.js +124 -0
  186. package/dist/generated/prisma/browser.d.ts +34 -3
  187. package/dist/generated/prisma/client.d.ts +34 -3
  188. package/dist/generated/prisma/commonInputTypes.d.ts +220 -60
  189. package/dist/generated/prisma/enums.d.ts +10 -0
  190. package/dist/generated/prisma/enums.js +8 -0
  191. package/dist/generated/prisma/internal/class.d.ts +44 -0
  192. package/dist/generated/prisma/internal/class.js +4 -4
  193. package/dist/generated/prisma/internal/prismaNamespace.d.ts +428 -9
  194. package/dist/generated/prisma/internal/prismaNamespace.js +92 -1
  195. package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts +95 -0
  196. package/dist/generated/prisma/internal/prismaNamespaceBrowser.js +92 -1
  197. package/dist/generated/prisma/models/Agent.d.ts +106 -8
  198. package/dist/generated/prisma/models/AgentRepository.d.ts +42 -1
  199. package/dist/generated/prisma/models/CodingAgentProfile.d.ts +229 -1
  200. package/dist/generated/prisma/models/CodingProxyRequest.d.ts +207 -3
  201. package/dist/generated/prisma/models/CodingProxySession.d.ts +114 -1
  202. package/dist/generated/prisma/models/CodingRun.d.ts +1637 -1
  203. package/dist/generated/prisma/models/DependencySnapshot.d.ts +1668 -0
  204. package/dist/generated/prisma/models/DependencySnapshot.js +1 -0
  205. package/dist/generated/prisma/models/IssuePullRequest.d.ts +6 -2
  206. package/dist/generated/prisma/models/LocalReview.d.ts +40 -1
  207. package/dist/generated/prisma/models/NativeGatewayCall.d.ts +39 -1
  208. package/dist/generated/prisma/models/NativeGatewaySession.d.ts +35 -1
  209. package/dist/generated/prisma/models/RegistryAllowance.d.ts +41 -1
  210. package/dist/generated/prisma/models/RegistryApprovedVersion.d.ts +75 -1
  211. package/dist/generated/prisma/models/RegistryAuditRecord.d.ts +1364 -0
  212. package/dist/generated/prisma/models/RegistryAuditRecord.js +1 -0
  213. package/dist/generated/prisma/models/Run.d.ts +738 -2
  214. package/dist/generated/prisma/models/RunBudgetEvent.d.ts +1211 -0
  215. package/dist/generated/prisma/models/RunBudgetEvent.js +1 -0
  216. package/dist/generated/prisma/models/RunTranscript.d.ts +1339 -0
  217. package/dist/generated/prisma/models/RunTranscript.js +1 -0
  218. package/dist/generated/prisma/models.d.ts +4 -0
  219. package/dist/help-index.json +1320 -69
  220. package/dist/import/create.js +32 -3
  221. package/dist/import/neutral-schema.d.ts +50 -281
  222. package/dist/import/neutral-schema.js +5 -4
  223. package/dist/knowledge/check.d.ts +1 -1
  224. package/dist/knowledge/cli.d.ts +11 -1
  225. package/dist/knowledge/cli.js +37 -4
  226. package/dist/knowledge/concept.d.ts +3 -19
  227. package/dist/knowledge/location.d.ts +31 -0
  228. package/dist/knowledge/location.js +78 -0
  229. package/dist/mcp/auth/access.d.ts +10 -2
  230. package/dist/mcp/auth/access.js +15 -1
  231. package/dist/mcp/auth/ownership.d.ts +7 -7
  232. package/dist/mcp/auth/self-hosted/credentials.d.ts +3 -3
  233. package/dist/mcp/auth/self-hosted/session.d.ts +2 -2
  234. package/dist/mcp/host-events/github-ingress.d.ts +2 -0
  235. package/dist/mcp/host-events/github-ingress.js +2 -1
  236. package/dist/mcp/index.d.ts +6 -0
  237. package/dist/mcp/index.js +58 -10
  238. package/dist/mcp/server.d.ts +13 -0
  239. package/dist/mcp/server.js +33 -14
  240. package/dist/mcp/tools/agents.d.ts +4 -0
  241. package/dist/mcp/tools/agents.js +198 -16
  242. package/dist/mcp/tools/datastore.js +17 -8
  243. package/dist/mcp/tools/grants.js +9 -3
  244. package/dist/mcp/tools/memory.js +11 -1
  245. package/dist/mcp/tools/notification-channels.js +2 -2
  246. package/dist/mcp/tools/packages.d.ts +2 -0
  247. package/dist/mcp/tools/packages.js +195 -0
  248. package/dist/mcp/tools/repositories.js +18 -5
  249. package/dist/mcp/tools/run-access.d.ts +16 -0
  250. package/dist/mcp/tools/run-access.js +25 -0
  251. package/dist/mcp/tools/run-transcript-download.d.ts +30 -0
  252. package/dist/mcp/tools/run-transcript-download.js +129 -0
  253. package/dist/mcp/tools/run-transcript.d.ts +19 -0
  254. package/dist/mcp/tools/run-transcript.js +70 -0
  255. package/dist/mcp/tools/runs.js +34 -12
  256. package/dist/mcp/tools/scheduling.js +3 -1
  257. package/dist/mcp/tools/secret-elicitation-form.js +5 -0
  258. package/dist/mcp/tools/secret-elicitation-server.d.ts +6 -0
  259. package/dist/mcp/tools/secret-elicitation-server.js +10 -61
  260. package/dist/mcp/tools/secrets.js +2 -2
  261. package/dist/mcp/tools/stop-run.d.ts +2 -0
  262. package/dist/mcp/tools/stop-run.js +82 -0
  263. package/dist/mcp/tools/subagents.js +2 -2
  264. package/dist/mcp/tools/tools.d.ts +1 -1
  265. package/dist/mcp/tools/tools.js +25 -9
  266. package/dist/mcp/transport/stdio-link-host.d.ts +20 -0
  267. package/dist/mcp/transport/stdio-link-host.js +67 -0
  268. package/dist/mcp/transport/streamable-http.d.ts +13 -0
  269. package/dist/mcp/transport/streamable-http.js +41 -1
  270. package/dist/native-worker/docker-launcher.d.ts +38 -2
  271. package/dist/native-worker/docker-launcher.js +65 -5
  272. package/dist/native-worker/gateway-server.d.ts +41 -3
  273. package/dist/native-worker/gateway-server.js +124 -27
  274. package/dist/native-worker/gateway.d.ts +27 -1
  275. package/dist/native-worker/gateway.js +70 -4
  276. package/dist/native-worker/http-server.d.ts +3 -1
  277. package/dist/native-worker/http-server.js +11 -7
  278. package/dist/native-worker/http-transport.js +1 -1
  279. package/dist/native-worker/kubernetes-launcher.d.ts +7 -3
  280. package/dist/native-worker/kubernetes-launcher.js +43 -3
  281. package/dist/native-worker/launch.d.ts +18 -1
  282. package/dist/native-worker/launch.js +6 -1
  283. package/dist/native-worker/ledger.d.ts +18 -2
  284. package/dist/native-worker/ledger.js +57 -4
  285. package/dist/native-worker/loopback.js +3 -8
  286. package/dist/native-worker/main.d.ts +2 -1
  287. package/dist/native-worker/main.js +14 -3
  288. package/dist/native-worker/protocol.d.ts +129 -577
  289. package/dist/native-worker/protocol.js +47 -1
  290. package/dist/native-worker/sandbox-executor.d.ts +17 -2
  291. package/dist/native-worker/sandbox-executor.js +78 -4
  292. package/dist/native-worker/stderr-redaction.d.ts +77 -0
  293. package/dist/native-worker/stderr-redaction.js +237 -0
  294. package/dist/native-worker/stdio.d.ts +1 -1
  295. package/dist/native-worker/stdio.js +6 -5
  296. package/dist/native-worker/warm-pool.d.ts +2 -2
  297. package/dist/native-worker/warm-pool.js +4 -4
  298. package/dist/native-worker/worker.js +28 -2
  299. package/dist/observability/metrics.js +6 -1
  300. package/dist/providers/auth/self-hosted.d.ts +1 -1
  301. package/dist/providers/coding-proxy/dependency-cache/eviction.d.ts +29 -0
  302. package/dist/providers/coding-proxy/dependency-cache/eviction.js +87 -0
  303. package/dist/providers/coding-proxy/dependency-cache/key.d.ts +33 -0
  304. package/dist/providers/coding-proxy/dependency-cache/key.js +86 -0
  305. package/dist/providers/coding-proxy/dependency-cache/model-request-seal.d.ts +18 -0
  306. package/dist/providers/coding-proxy/dependency-cache/model-request-seal.js +40 -0
  307. package/dist/providers/coding-proxy/dependency-cache/prisma-store.d.ts +25 -0
  308. package/dist/providers/coding-proxy/dependency-cache/prisma-store.js +131 -0
  309. package/dist/providers/coding-proxy/dependency-cache/service.d.ts +70 -0
  310. package/dist/providers/coding-proxy/dependency-cache/service.js +409 -0
  311. package/dist/providers/coding-proxy/dependency-cache/store.d.ts +85 -0
  312. package/dist/providers/coding-proxy/dependency-cache/store.js +95 -0
  313. package/dist/providers/coding-proxy/hold.d.ts +32 -0
  314. package/dist/providers/coding-proxy/hold.js +86 -0
  315. package/dist/providers/coding-proxy/interrupted.d.ts +70 -0
  316. package/dist/providers/coding-proxy/interrupted.js +104 -0
  317. package/dist/providers/coding-proxy/memory-ledger.d.ts +15 -2
  318. package/dist/providers/coding-proxy/memory-ledger.js +84 -8
  319. package/dist/providers/coding-proxy/metering.d.ts +16 -0
  320. package/dist/providers/coding-proxy/metering.js +27 -4
  321. package/dist/providers/coding-proxy/prisma-ledger.d.ts +15 -2
  322. package/dist/providers/coding-proxy/prisma-ledger.js +179 -67
  323. package/dist/providers/coding-proxy/proxy.d.ts +14 -1
  324. package/dist/providers/coding-proxy/proxy.js +166 -14
  325. package/dist/providers/coding-proxy/registry/audit.d.ts +53 -10
  326. package/dist/providers/coding-proxy/registry/audit.js +94 -17
  327. package/dist/providers/coding-proxy/registry/lockfile-parse-worker.d.ts +36 -0
  328. package/dist/providers/coding-proxy/registry/lockfile-parse-worker.js +67 -0
  329. package/dist/providers/coding-proxy/registry/lockfile-parse.d.ts +16 -0
  330. package/dist/providers/coding-proxy/registry/lockfile-parse.js +110 -0
  331. package/dist/providers/coding-proxy/registry/plan.d.ts +9 -0
  332. package/dist/providers/coding-proxy/registry/plan.js +201 -48
  333. package/dist/providers/coding-proxy/registry/prisma-store.d.ts +11 -5
  334. package/dist/providers/coding-proxy/registry/prisma-store.js +120 -17
  335. package/dist/providers/coding-proxy/registry/service.d.ts +97 -16
  336. package/dist/providers/coding-proxy/registry/service.js +579 -112
  337. package/dist/providers/coding-proxy/registry/store.d.ts +84 -9
  338. package/dist/providers/coding-proxy/registry/store.js +54 -1
  339. package/dist/providers/coding-proxy/runtime.d.ts +4 -0
  340. package/dist/providers/coding-proxy/runtime.js +78 -16
  341. package/dist/providers/coding-proxy/server.d.ts +6 -1
  342. package/dist/providers/coding-proxy/server.js +45 -1
  343. package/dist/providers/coding-proxy/types.d.ts +65 -1
  344. package/dist/providers/datastore/types.d.ts +5 -0
  345. package/dist/providers/engine/types.d.ts +17 -2
  346. package/dist/providers/engine/types.js +17 -0
  347. package/dist/providers/executor/composition.d.ts +10 -3
  348. package/dist/providers/executor/composition.js +47 -7
  349. package/dist/providers/executor/container.d.ts +361 -8
  350. package/dist/providers/executor/container.js +1136 -91
  351. package/dist/providers/executor/dbos-status.d.ts +31 -0
  352. package/dist/providers/executor/dbos-status.js +64 -0
  353. package/dist/providers/executor/dbos.d.ts +50 -1
  354. package/dist/providers/executor/dbos.js +207 -20
  355. package/dist/providers/executor/deferred.d.ts +12 -24
  356. package/dist/providers/executor/deferred.js +10 -29
  357. package/dist/providers/executor/in-process.d.ts +9 -1
  358. package/dist/providers/executor/in-process.js +14 -4
  359. package/dist/providers/executor/linked-issue-reader.d.ts +16 -0
  360. package/dist/providers/executor/linked-issue-reader.js +30 -0
  361. package/dist/providers/executor/routing.d.ts +2 -0
  362. package/dist/providers/executor/routing.js +4 -0
  363. package/dist/providers/executor/types.d.ts +13 -0
  364. package/dist/providers/index.d.ts +2 -1
  365. package/dist/providers/issue-tracker/types.d.ts +17 -0
  366. package/dist/providers/issue-tracker/types.js +39 -1
  367. package/dist/providers/jobs/claude-tool-setup.d.ts +4 -0
  368. package/dist/providers/jobs/claude-tool-setup.js +5 -2
  369. package/dist/providers/jobs/docker-isolation.d.ts +8 -0
  370. package/dist/providers/jobs/docker-isolation.js +17 -0
  371. package/dist/providers/jobs/docker.d.ts +1 -0
  372. package/dist/providers/jobs/docker.js +27 -2
  373. package/dist/providers/jobs/fake-kubernetes-api.d.ts +2 -0
  374. package/dist/providers/jobs/fake-kubernetes-api.js +3 -0
  375. package/dist/providers/jobs/kubernetes-api.d.ts +8 -0
  376. package/dist/providers/jobs/kubernetes-api.js +10 -0
  377. package/dist/providers/jobs/kubernetes-client.js +10 -1
  378. package/dist/providers/jobs/kubernetes-isolation.d.ts +2 -0
  379. package/dist/providers/jobs/kubernetes-isolation.js +17 -1
  380. package/dist/providers/jobs/kubernetes.d.ts +6 -1
  381. package/dist/providers/jobs/kubernetes.js +105 -16
  382. package/dist/providers/jobs/types.d.ts +33 -0
  383. package/dist/providers/jobs/types.js +13 -1
  384. package/dist/providers/llm/anthropic.js +5 -1
  385. package/dist/providers/llm/bedrock.d.ts +0 -12
  386. package/dist/providers/llm/bedrock.js +4 -0
  387. package/dist/providers/llm/claude-messages.d.ts +3 -1
  388. package/dist/providers/llm/claude-messages.js +4 -1
  389. package/dist/providers/llm/claude-provider.d.ts +2 -2
  390. package/dist/providers/llm/claude-provider.js +2 -2
  391. package/dist/providers/llm/openai.d.ts +2 -2
  392. package/dist/providers/llm/openai.js +6 -2
  393. package/dist/providers/llm/routing.d.ts +2 -2
  394. package/dist/providers/llm/routing.js +2 -2
  395. package/dist/providers/llm/types.d.ts +12 -2
  396. package/dist/providers/review-host/github-events.d.ts +9 -1
  397. package/dist/providers/review-host/github-events.js +34 -12
  398. package/dist/providers/review-host/github.d.ts +29 -2
  399. package/dist/providers/review-host/github.js +224 -29
  400. package/dist/providers/review-host/local.d.ts +8 -4
  401. package/dist/providers/review-host/local.js +49 -31
  402. package/dist/providers/review-host/patch-pages.d.ts +41 -0
  403. package/dist/providers/review-host/patch-pages.js +176 -0
  404. package/dist/providers/review-host/review-format.d.ts +19 -1
  405. package/dist/providers/review-host/review-format.js +38 -7
  406. package/dist/providers/review-host/types.d.ts +134 -2
  407. package/dist/providers/review-host/types.js +8 -0
  408. package/dist/providers/storage/gcs.d.ts +63 -0
  409. package/dist/providers/storage/gcs.js +69 -0
  410. package/dist/providers/storage/index.d.ts +15 -0
  411. package/dist/providers/storage/index.js +14 -0
  412. package/dist/providers/storage/local.d.ts +24 -0
  413. package/dist/providers/storage/local.js +92 -0
  414. package/dist/providers/storage/meter.d.ts +14 -0
  415. package/dist/providers/storage/meter.js +34 -0
  416. package/dist/providers/storage/s3.d.ts +41 -0
  417. package/dist/providers/storage/s3.js +107 -0
  418. package/dist/providers/storage/types.d.ts +37 -3
  419. package/dist/providers/storage/types.js +21 -4
  420. package/dist/providers/vcs/git.d.ts +33 -2
  421. package/dist/providers/vcs/git.js +324 -22
  422. package/dist/providers/vcs/github-remote.d.ts +26 -3
  423. package/dist/providers/vcs/github-remote.js +124 -14
  424. package/dist/providers/vcs/github.d.ts +214 -6
  425. package/dist/providers/vcs/github.js +447 -45
  426. package/dist/providers/vcs/index.js +8 -1
  427. package/dist/providers/vcs/pr-description.d.ts +127 -0
  428. package/dist/providers/vcs/pr-description.js +270 -0
  429. package/dist/providers/vcs/remote.d.ts +33 -1
  430. package/dist/providers/vcs/routing.d.ts +4 -2
  431. package/dist/providers/vcs/routing.js +6 -0
  432. package/dist/providers/vcs/types.d.ts +80 -3
  433. package/dist/quickstart/coding-seed.d.ts +14 -3
  434. package/dist/quickstart/coding-seed.js +213 -4
  435. package/dist/quickstart/reviewer-prompt.d.ts +1 -1
  436. package/dist/quickstart/reviewer-prompt.js +6 -6
  437. package/dist/quickstart-images.json +1 -1
  438. package/dist/sandbox/generated/zod.bundle.js +62 -1
  439. package/dist/sandbox/generated/zod3.bundle.js +5 -0
  440. package/dist/sandbox/host-functions.d.ts +1 -0
  441. package/dist/sandbox/host-functions.js +6 -11
  442. package/dist/sandbox/secret-broker.js +3 -4
  443. package/dist/sandbox/tool-capabilities.d.ts +10 -30
  444. package/dist/sandbox/zod-params.d.ts +37 -5
  445. package/dist/sandbox/zod-params.js +181 -26
  446. package/dist/serve.js +8 -1
  447. package/dist/viewer/api-schema.d.ts +349 -2627
  448. package/dist/viewer/api-schema.js +7 -0
  449. package/dist/viewer/build-schemas.js +6 -2
  450. package/dist/viewer/openapi.js +2 -4
  451. package/dist/wardby-bin.js +10 -0
  452. package/docs/agent-recipes.md +58 -20
  453. package/docs/code-review-agents.md +551 -41
  454. package/docs/coding-agent-setup.md +489 -7
  455. package/docs/coding-packages.md +1033 -90
  456. package/docs/coding-services.md +27 -12
  457. package/docs/coding-worker-byo-images.md +20 -0
  458. package/docs/coding-worker-isolation.md +105 -30
  459. package/docs/getting-started-gke.md +124 -137
  460. package/docs/getting-started-identity-provider.md +10 -1
  461. package/docs/getting-started.md +9 -0
  462. package/docs/jira-agents.md +17 -8
  463. package/docs/knowledge/blob-not-found-semantics.md +41 -0
  464. package/docs/knowledge/bounded-file-descriptor.md +52 -0
  465. package/docs/knowledge/delegation-admission-slots.md +52 -0
  466. package/docs/knowledge/http-dispatcher-bootstrap.md +61 -0
  467. package/docs/knowledge/import-rename-target.md +52 -0
  468. package/docs/knowledge/index.md +57 -0
  469. package/docs/knowledge/log.md +9 -0
  470. package/docs/knowledge/mcp-cancelled-task-precedence.md +41 -0
  471. package/docs/knowledge/mcp-http-prompt-discovery.md +41 -0
  472. package/docs/knowledge/mcp-schema-module-boundary.md +41 -0
  473. package/docs/knowledge/nullable-tool-uniqueness.md +52 -0
  474. package/docs/knowledge/overview-cli.md +74 -0
  475. package/docs/knowledge/overview-coding-proxy.md +72 -0
  476. package/docs/knowledge/overview-coding.md +72 -0
  477. package/docs/knowledge/overview-config.md +60 -0
  478. package/docs/knowledge/overview-core.md +72 -0
  479. package/docs/knowledge/overview-deploy.md +83 -0
  480. package/docs/knowledge/overview-mcp.md +61 -0
  481. package/docs/knowledge/overview-prisma.md +72 -0
  482. package/docs/knowledge/overview-providers.md +89 -0
  483. package/docs/knowledge/overview-sandbox.md +83 -0
  484. package/docs/knowledge/overview-surfaces.md +83 -0
  485. package/docs/knowledge/private-datastore-shared-boundary.md +54 -0
  486. package/docs/knowledge/proxy-settlement-projections.md +41 -0
  487. package/docs/knowledge/run-pricing-first-writer.md +43 -0
  488. package/docs/knowledge/schedule-claim-transaction.md +41 -0
  489. package/docs/knowledge/secret-entry-replica-contract.md +52 -0
  490. package/docs/knowledge/terminal-run-first-writer.md +41 -0
  491. package/docs/knowledge/transactional-agent-authorization.md +52 -0
  492. package/docs/knowledge/viewer-notify-write-isolation.md +30 -0
  493. package/docs/knowledge/warm-input-publication.md +30 -0
  494. package/docs/knowledge/workspace-staging-failure.md +54 -0
  495. package/docs/knowledge.md +54 -14
  496. package/docs/native-sandbox.md +119 -23
  497. package/docs/observability.md +4 -0
  498. package/docs/security-deployment.md +33 -2
  499. package/docs/slack-notifications.md +35 -19
  500. package/docs/tool-secrets.md +42 -10
  501. package/docs/viewer-api.openapi.yml +1 -1
  502. package/help/admin-viewer.md +24 -2
  503. package/help/architecture-agent.md +11 -6
  504. package/help/build-worker-image.md +3 -1
  505. package/help/builder-agent.md +19 -6
  506. package/help/code-review-agents.md +177 -6
  507. package/help/coding-packages.md +156 -6
  508. package/help/cost-attribution.md +9 -5
  509. package/help/creating-agents.md +14 -1
  510. package/help/dependency-cache.md +143 -0
  511. package/help/deploy-gke.md +15 -8
  512. package/help/errors/budget-exhausted.md +187 -0
  513. package/help/errors/budget-group-exhausted.md +5 -1
  514. package/help/errors/coding-stream-quota-exceeded.md +33 -0
  515. package/help/errors/coding-workspace-disk-exceeds-limit.md +39 -0
  516. package/help/errors/continuation-closed.md +9 -12
  517. package/help/errors/delegation-conflict.md +24 -0
  518. package/help/errors/file-list-truncated.md +45 -0
  519. package/help/errors/full-read-required.md +49 -0
  520. package/help/errors/github-account-not-allowed.md +4 -0
  521. package/help/errors/graph-incomplete.md +43 -0
  522. package/help/errors/graph-limit.md +43 -0
  523. package/help/errors/merge-conflict.md +49 -0
  524. package/help/errors/native-sandbox-gateway-error.md +20 -0
  525. package/help/errors/native-sandbox-launch-abandoned.md +21 -0
  526. package/help/errors/native-sandbox-worker-exited.md +3 -2
  527. package/help/errors/package-not-allowed-pending.md +52 -0
  528. package/help/errors/package-not-allowed.md +51 -0
  529. package/help/errors/package-refusals.md +43 -0
  530. package/help/errors/patch-cursor-malformed.md +31 -0
  531. package/help/errors/run-lost.md +39 -0
  532. package/help/errors/run-transcript-download.md +44 -0
  533. package/help/errors/secret-in-value.md +69 -0
  534. package/help/errors/target-merge.md +40 -0
  535. package/help/fix-merge-conflicts.md +73 -0
  536. package/help/github-app-setup.md +132 -0
  537. package/help/github.md +22 -0
  538. package/help/identity-and-access.md +2 -0
  539. package/help/jira.md +23 -6
  540. package/help/knowledge.md +16 -7
  541. package/help/local-repositories.md +1 -1
  542. package/help/low-power-mode.md +7 -1
  543. package/help/merge-order-check.md +5 -0
  544. package/help/native-capabilities.md +29 -1
  545. package/help/native-sandbox.md +15 -1
  546. package/help/operating-agents.md +5 -0
  547. package/help/package-audit-mode.md +91 -0
  548. package/help/related-pull-requests.md +10 -7
  549. package/help/resume-runs-locally.md +131 -0
  550. package/help/review-fix-rounds.md +33 -1
  551. package/help/sharing-agents.md +59 -0
  552. package/help/slack-notifications.md +19 -5
  553. package/help/status-comments.md +31 -0
  554. package/help/stop-run.md +58 -0
  555. package/help/troubleshooting/budgets.md +28 -0
  556. package/help/troubleshooting/coding-workers.md +78 -7
  557. package/package.json +17 -10
  558. package/prisma/migrations/20261016000000_registry_approved_accepted_advisories/migration.sql +3 -0
  559. package/prisma/migrations/20261016000001_mark_ready_when_passing/migration.sql +3 -0
  560. package/prisma/migrations/20261017000000_debug_trace_max_mb/migration.sql +4 -0
  561. package/prisma/migrations/20261018000000_dependency_cache/migration.sql +53 -0
  562. package/prisma/migrations/20261019000000_claude_max_output_tokens/migration.sql +5 -0
  563. package/prisma/migrations/20261021000000_pr_description_hash/migration.sql +4 -0
  564. package/prisma/migrations/20261022000000_dependency_snapshot_validation_metadata/migration.sql +4 -0
  565. package/prisma/migrations/20261023000000_package_audit_mode/migration.sql +27 -0
  566. package/prisma/migrations/20261024000000_budget_events/migration.sql +26 -0
  567. package/prisma/migrations/20261025000000_cache_aware_holds/migration.sql +9 -0
  568. package/prisma/migrations/20261026000000_budget_overrun/migration.sql +4 -0
  569. package/prisma/migrations/20261027000000_coding_run_request/migration.sql +1 -0
  570. package/prisma/migrations/20261028000000_native_gateway_review_reads/migration.sql +6 -0
  571. package/prisma/migrations/20261029000000_lead_survives_deploy/migration.sql +6 -0
  572. package/prisma/migrations/20261030000000_local_review_covered_sha/migration.sql +2 -0
  573. package/prisma/migrations/20261031000000_coding_run_budget_limit/migration.sql +9 -0
  574. package/prisma/migrations/20261101000000_run_transcripts/migration.sql +22 -0
  575. package/prisma/schema.prisma +311 -97
  576. package/dist/sandbox/generated/zod-to-json-schema.bundle.js +0 -5
@@ -15,6 +15,8 @@ registry) but never holds the run capability.
15
15
  for each enabled coding provider: `OPENAI_API_KEY` and/or
16
16
  `ANTHROPIC_API_KEY`.
17
17
  - The local database has the current Prisma migrations applied.
18
+ - git 2.38 or newer on any machine that runs the wardby server outside the
19
+ shipped image (follow-up runs merge the pull request's target branch with it).
18
20
  - A GitHub App is installed on only the repository to be exercised. (Not needed
19
21
  for a repository on this machine; see
20
22
  [Local repositories](#local-repositories).) Grant it
@@ -61,6 +63,9 @@ A continuation (`continuePriorRun`) checks separately that the pull request
61
63
  it is asked to continue is still open on GitHub; one already merged or closed
62
64
  fails with category `continuation_closed` and nothing pushed — see
63
65
  [Continuation's pull request is no longer open](../help/errors/continuation-closed.md).
66
+ Before its agent starts, a continuation also merges the branch the pull
67
+ request currently targets, and the agent resolves any conflicts — see
68
+ [Follow-ups bring the pull request up to date](code-review-agents.md#follow-ups-bring-the-pull-request-up-to-date).
64
69
  Over stdio, the local operator holds every role, so `repositoryAdminOverride`
65
70
  is the way to approve a repository there.
66
71
 
@@ -101,7 +106,7 @@ JOB_LAUNCHER=docker
101
106
  directly, so the control plane must not run in a container, a pod or on
102
107
  another machine. A trusted folder the server cannot see is ignored, so its
103
108
  repositories fail with `local_repo_not_allowed`, and `doctor` reports the
104
- folder as missing. The machine needs git 2.24 or newer.
109
+ folder as missing. The machine needs git 2.38 or newer.
105
110
  - **Worker images.** Use worker images from the same release as the control
106
111
  plane. An older worker image rejects `local:` repositories (the run fails with
107
112
  `worker_input_failed`), including a Codex agent's bring-your-own
@@ -128,7 +133,8 @@ JOB_LAUNCHER=docker
128
133
  To build on an earlier result, trigger with `baseRef: "wardby/run-<run id>"`. A
129
134
  continuation of a run (a lead agent revising its earlier work) fast-forwards the
130
135
  same branch; if the branch has moved, or is checked out, the run fails with
131
- `local_branch_conflict` and nothing is pushed.
136
+ `local_branch_conflict` and nothing is pushed. A local repository has no pull
137
+ requests, so a continuation there does not merge any other branch first.
132
138
 
133
139
  Result branches accumulate, and wardby does not delete them. Clean up with
134
140
  `git branch -D wardby/run-<run id>`.
@@ -374,17 +380,61 @@ the agent's commands); Claude Code itself always runs on
374
380
 
375
381
  A coding run's budget is reserved when it is dispatched: the agent's own
376
382
  `budgetUsd`, tightened to whatever its budget group has left for each
377
- configured period and, for a sub-agent, whatever its run tree has left. The
378
- worker can never spend more than that reservation. When a group or run tree
383
+ configured period and, for a sub-agent, whatever its run tree has left. Each
384
+ model request holds part of the reservation before it is sent, and a request
385
+ that would not fit is refused. A reply can still cost more than its hold, up to
386
+ that request's worst case, so a run can end a little over its reservation;
387
+ finished work is still delivered. When a group or run tree
379
388
  has nothing left, the run is recorded as `refused` with the error
380
389
  `budget_group_exhausted:<day|week|month>` or `run_tree_exhausted`, and no
381
390
  container starts (`trigger_agent` returns that status and error directly).
382
391
 
392
+ ### Allowing a small overrun
393
+
394
+ A coding agent's `allowedOverrunPercent` (an integer from 0 to 100, default 0,
395
+ set with `create_agent` or `update_agent`, and shown by `get_agent`) lets a run
396
+ spend a little beyond `budgetUsd` instead of stopping at it. It takes the same
397
+ permission as changing `budgetUsd`. On a coding agent it raises the limit of
398
+ each of its runs; on a lead agent that delegates, it raises its run tree's
399
+ ceiling for coding sub-agents. Native runs' own model calls are not affected.
400
+
401
+ The overrun is permission to spend more, not a reservation. At dispatch a
402
+ coding run reserves only its base budget: the smallest of the agent's
403
+ `budgetUsd`, what its budget group has left and what its run tree has left.
404
+ Its limit is `budgetUsd` raised by the percent, and nothing is held for it up
405
+ front. While the run works, wardby tops up what it may spend, in steps of 10%
406
+ of its base (or the largest model request it has made, if that is more), each
407
+ time it gets within its headroom of what it has been granted: two of its
408
+ largest requests, or 20% of its base if that is more. A run whose base is
409
+ smaller than its first request cannot use its overrun, since that request is
410
+ refused before any top-up. A step is granted
411
+ only out of room its budget group and run tree have left at that moment, and
412
+ never past the limit. The coding proxy enforces what has been granted so far,
413
+ and the Claude Code worker's own budget stop is set to the limit. `get_run`
414
+ shows `budgetBaseUsd`, `budgetLimitUsd` (the limit) and `budgetReservedUsd`
415
+ (what has been granted so far, which the group and run tree hold).
416
+
417
+ Budget group caps and run-tree ceilings stay hard. A top-up takes whatever room
418
+ is left, so if the group or run tree fills up while a run needs more, the run
419
+ stops at what it has been granted, with its work kept as below, and its budget
420
+ sentence says why, for example "Only $0.40 of its 10% allowed overrun was
421
+ available because the "team" group had no more left of its daily cap." (or
422
+ "Its 10% allowed overrun wasn't available because the "team" group had nothing
423
+ left of its daily cap." when it got none). `get_run` then lists an `overrun_unavailable` event. A run that
424
+ was refused a top-up does not ask again, even if the group frees up later. The
425
+ overrun a run actually got can therefore be lower than the agent's setting, or
426
+ none. For a delegated run tree, the raised ceiling uses the lead (root) agent's
427
+ percent, so set it on the lead agent to let its coding sub-agents go beyond
428
+ the lead's `budgetUsd`. Runs dispatched before this behaviour have no
429
+ `budgetLimitUsd`: their reservation already includes the overrun, and they
430
+ finish as before.
431
+
383
432
  Every live run still pending or running holds its unspent reservation
384
433
  (reservation minus cost so far) against its group; a native run holds its
385
434
  agent's per-run `budgetUsd`. So overlapping scheduled, webhook and manual runs
386
435
  share one cap rather than each seeing the full remainder, and
387
- `get_budget_group` reports those holds as `reservedUsd` next to `spentUsd`.
436
+ `get_budget_group` reports those holds as `reservedUsd` next to `spentUsd`, and
437
+ each `spend[]` entry's `heldRuns` counts the runs holding budget in that period.
388
438
  Native runs are served first come, first served: a native run only counts the
389
439
  holds of runs that started before it, so members dispatched on the same tick
390
440
  don't starve each other.
@@ -408,8 +458,176 @@ all beat every 10 seconds. A coding run also holds until its
408
458
  `CODING_QUEUE_TIMEOUT_SEC` + its `timeoutSec` + 60 seconds have passed since
409
459
  dispatch, because it does not beat while it waits in the coding queue. Its
410
460
  recorded cost always counts. `wardby run` records the run as `cancelled` on
411
- Ctrl-C or SIGTERM. If a row is still stuck in `running` for another reason,
412
- only its real cost counts once its hold lapses.
461
+ Ctrl-C or SIGTERM, and the MCP tool `stop_run` records any pending, queued,
462
+ or running run as `cancelled` (see [Stop or cancel a run](../help/stop-run.md)),
463
+ which ends its hold at once. If a row is still stuck in `running` for another
464
+ reason, only its real cost counts once its hold lapses.
465
+
466
+ ### How a request's hold is estimated
467
+
468
+ Before each model request the proxy holds an amount against the run's budget.
469
+ A request whose hold does not fit in what is left is refused. The hold is not
470
+ a charge: the run pays the reply's real cost.
471
+
472
+ The first request of a conversation, and every fallback below, holds the worst
473
+ case: the whole request body as new input written to the cache (one token per
474
+ byte) plus `maxOutputTokens` at the output rate.
475
+
476
+ After a reply in the same conversation that read from or wrote to the prompt
477
+ cache at least half of its prompt (on OpenAI models only cache reads count),
478
+ the next request holds that cached part at the cache-read rate,
479
+ and the rest (including whatever the body has grown by) at the input and
480
+ cache-write rates, plus the output allowance. It never holds more than the
481
+ worst case. A conversation is the main agent or one of its sub-agents.
482
+
483
+ The hold falls back to the worst case when:
484
+
485
+ - there is no previous reply in the conversation;
486
+ - the model changed;
487
+ - the previous reply was interrupted (settled at an estimate) or did not
488
+ complete;
489
+ - less than half of the previous reply's prompt was read from or written to
490
+ the cache;
491
+ - the request body got smaller; or
492
+ - the previous request in the conversation was sent more than 5 minutes
493
+ earlier, the lifetime of the prompt cache.
494
+
495
+ If the cache misses, a reply can cost more than its hold. It is still settled
496
+ when it costs no more than the worst case, so a run can exceed its budget by at
497
+ most the difference between a request's worst case and its hold, for each
498
+ request in flight. A reply that
499
+ costs more than the worst case cancels the run's model access
500
+ (`reservation_invariant_violated`).
501
+
502
+ When a request is refused, `budgetEvents` in `get_run` shows the basis of the
503
+ refused hold (`refusedHoldBasis`: `cached` or `full`) and the worst case for
504
+ that request (`refusedHoldCeilingUsd`); see
505
+ [Why a run stopped](#why-a-run-stopped).
506
+
507
+ ### Interrupted replies
508
+
509
+ When a model reply breaks off before its final usage arrives (a dropped
510
+ connection, a worker that is stopped mid-reply), the proxy settles the request
511
+ at an estimate instead of leaving its whole hold in place. The estimate is the
512
+ input usage the proxy already read; failing that, the input of the previous
513
+ completed reply in the same conversation (the main conversation and each
514
+ sub-agent are tracked apart) on the same model, plus the request body's growth
515
+ since then. That reply is used only if it started within the 5-minute prompt
516
+ cache window before the request and the body has not shrunk since (as after a
517
+ compaction). Failing that, the whole request body counts as new input. New input
518
+ is counted at one token per 3 bytes, a deliberately high count, and priced at
519
+ the higher of the model's input and cache-write rates. It adds the output
520
+ relayed so far (text, tool-call input, and thinking or reasoning text), counted
521
+ high. With nothing relayed, the run's median completed reply on that model is
522
+ used, or no output if there is none yet. A streaming request that failed before
523
+ the provider's response started adds no output, because nothing was generated.
524
+ A provider's placeholder output count at the start of a reply is used only as a
525
+ minimum. The estimate is never more than the request's worst
526
+ case. An estimated request is flagged `costEstimated`, counts in the
527
+ run's cost at the estimate, and is recorded as `uncertain` in the proxy's
528
+ request ledger. If the estimate cannot be computed or recorded, the request
529
+ keeps its full hold. A run can therefore exceed
530
+ its budget by at most the difference between an estimate and the real cost of
531
+ the interrupted request.
532
+
533
+ ### Delegated runs in a budget group
534
+
535
+ A lead and the sub-agents it starts in the same budget group hold the lead's
536
+ budget once, at the lead: the lead's reservation minus what the whole run tree
537
+ has spent. Each sub-agent reserves its own base out of what the lead's budget
538
+ has left. When the lead has an `allowedOverrunPercent`, its coding sub-agents
539
+ can be topped up past the lead's budget, up to its raised ceiling; the lead
540
+ then holds at least the unspent holds of every live sub-agent run in its tree
541
+ (top-ups included), so the overrun still fits inside the group's cap. This is decided per period: a sub-agent run holds nothing in a
542
+ period only when its lead started in that same period. So a delegating lead
543
+ does not count against its group several times over.
544
+
545
+ ### Why a run stopped
546
+
547
+ `get_run` returns `budgetEvents` for a run that was refused for budget,
548
+ including a run whose model request was refused but that still finished,
549
+ failed for another reason, or was stopped. The event is recorded when the run
550
+ ends. Each event has `kind` (`refused`, or `overrun_unavailable` for a top-up
551
+ the group or run tree had no room for), `limit`, `at` and `details`. `limit` says which
552
+ cap bound the run: `run` (the agent's own `budgetUsd`), `run-tree` (what the
553
+ lead had left), or `day`, `week` or `month` (the budget group's cap for that
554
+ period). For a refused model request, `details` holds the budget, the amount
555
+ spent, the holds of requests in flight, the refused hold, the model and the
556
+ turn, plus the basis of the refused hold (`refusedHoldBasis`) and its worst case
557
+ (`refusedHoldCeilingUsd`). For a refusal at dispatch it holds the cap, the amount spent, the amount
558
+ held and the number of holding runs (`heldRuns`). Both also name the agent's
559
+ budget group (`groupName`) when it has one, and the lead agent
560
+ (`leadAgentName`) for a `run-tree` limit; a refused model request also gives
561
+ the agent's own `budgetUsd` (`agentBudgetUsd`). An `overrun_unavailable` event
562
+ holds the full cap or tree's numbers (`capUsd`, `spentUsd`, `heldUsd`,
563
+ `leftUsd`), the run's `baseBudgetUsd`, `grantedUsd` and `limitUsd`, and the
564
+ name of the group whose cap was full (`groupName`), which can be the lead's.
565
+
566
+ The run's error carries the same facts in one sentence after the code, for
567
+ example `coding_budget_exhausted: <sentence>`. A lead's sub-agent result
568
+ carries the sentence in a `budget` field. Pull request and issue comments and
569
+ check summaries show the amounts and the budget group's name only. See
570
+ [Run stopped out of budget](../help/errors/budget-exhausted.md).
571
+
572
+ Budget sentences name both parts when the run had an overrun, for example
573
+ "this run's $1.00 budget and its 10% allowed overrun ($1.10 in all)", or
574
+ "$1.00 budget and $0.05 of its 10% allowed overrun ($1.05 in all)" when only
575
+ part of it was available.
576
+
577
+ #### Finished work is delivered
578
+
579
+ A worker that finishes is pushed, and its pull request opened, even if its
580
+ cost ended over the limit (one reply can cost more than the hold placed for
581
+ it). The run's status is `succeeded`, and its status comment states the
582
+ overrun, for example "Spent $1.04, $0.04 (4%) over its $1.00 budget, within
583
+ its allowed overrun." (without the "within" part when it went past the limit).
584
+
585
+ #### Stopped for budget: the work so far is kept
586
+
587
+ When a run is stopped for budget and its worker ended cleanly, its changes so
588
+ far are pushed as the usual draft pull request, or added to the pull request it
589
+ was continuing. A new pull request's description starts "Stopped at its budget
590
+ before finishing; the changes so far are in this draft." A continuation leaves
591
+ the existing description as it is; its status comment says the run stopped.
592
+ The run's status stays
593
+ `budget_exhausted` and its `budgetEvents` are kept. The status comment points
594
+ at the pull request and says that mentioning the agent on it, or on the issue
595
+ the run came from, continues the work with a fresh budget: a comment
596
+ mentioning the App on GitHub, or the service account on a Jira issue.
597
+
598
+ - A new pull request's description and the run's summary then carry a
599
+ `### Task` section: the request that started the run, quoted, with mentions
600
+ defused and wrapper tags neutralised, and cut at 4 KiB with a
601
+ `[task truncated]` marker. The agent's standing instructions are never
602
+ included. The worker's own summary follows it, unless it is only the fixed
603
+ budget sentence. A continuation reads the task from there, so it knows what
604
+ the draft was for. The request text is shown in the draft, so anyone who can
605
+ read the pull request can read it.
606
+ - While the draft's latest commit is the one the stopped run pushed, the
607
+ automatic review is skipped: its check completes as neutral, titled
608
+ "Skipped: stopped at its budget", and no [fix round](code-review-agents.md#automatic-review-fix-rounds)
609
+ follows. A review that would start while that run is still finishing waits
610
+ for its result. Marking the pull request ready for review, or pushing a new
611
+ commit, gets a normal review; so does an explicit request (re-running the
612
+ check, or a comment mentioning the App asking for a review). The skip
613
+ applies to drafts only, because a neutral check counts as passing for branch
614
+ protection.
615
+ - The status comment says the draft can be continued from the pull request, or
616
+ from the issue it came from. See
617
+ [Follow-ups on an issue](code-review-agents.md#follow-ups-on-an-issue).
618
+ - Such a pull request is not marked ready automatically. Marking ready looks at
619
+ the last run that pushed to the pull request, so a later continuation that
620
+ finishes makes it eligible again; a continuation that ends with no changes
621
+ does not.
622
+ - The usual push checks still apply (protected paths, diff limits, access). If
623
+ one refuses, or there are no changes, the run ends as `budget_exhausted`
624
+ with nothing pushed.
625
+ - Unfinished work is never pushed onto a pull request that is no longer a
626
+ draft (marked ready for review by wardby or a person). A continuation of
627
+ such a pull request that stops for budget ends as `budget_exhausted` with
628
+ nothing pushed. The draft state is read from the host; when the host cannot
629
+ be asked, a pull request wardby marked ready counts as not a draft.
630
+ - Nothing is kept from a worker that crashed, timed out or was stopped.
413
631
 
414
632
  ## Turn limit (Claude Code)
415
633
 
@@ -429,6 +647,270 @@ failure. The run's `budgetUsd` and `timeoutSec` still apply and are usually the
429
647
  better limits. Codex runs have no turn limit, so `maxTurns` does not affect
430
648
  them.
431
649
 
650
+ ## Output tokens per reply (Claude Code)
651
+
652
+ A Claude Code run caps each model reply at 32000 output tokens by default.
653
+ Thinking counts toward that cap, so a model with adaptive or extended thinking
654
+ can reach it on a long reply; Claude Code then ends with an error that the
655
+ response exceeded the output token maximum, and the run fails as a stream
656
+ failure. Raise the cap per agent:
657
+
658
+ ```json
659
+ { "id": "<coding agent id>", "codingProfile": { "maxOutputTokens": 64000 } }
660
+ ```
661
+
662
+ `maxOutputTokens` is 1024 to 128000; `null` restores the default. Pick a value
663
+ the agent's model supports. It is fixed on each run when the run is
664
+ dispatched. The coding proxy reserves `maxOutputTokens` × the model's output
665
+ price (plus the request's input, see
666
+ [How a request's hold is estimated](#how-a-requests-hold-is-estimated)) against the run's budget for every
667
+ model request, so a higher cap needs a larger `budgetUsd`: at a $25/MTok output
668
+ price, 32000 tokens reserve $0.80 per request and 128000 reserve $3.20. A
669
+ request whose reservation does not fit in what is left of the budget is
670
+ refused and the run ends as `budget_exhausted` (see
671
+ [Why a run stopped](#why-a-run-stopped)), so a higher value makes a run
672
+ with a small budget end sooner. Only Claude Code agents take
673
+ `maxOutputTokens`; `create_agent` and `update_agent` refuse it on a Codex
674
+ agent, and changing an agent's provider to `codex` needs it set to `null` in
675
+ the same `update_agent` call (or before).
676
+
677
+ The 32000 default and `maxOutputTokens` need a Claude Code worker image from a
678
+ release that supports them (Wardby 0.7.0 or later). An older pinned image still
679
+ caps each reply at 4096 tokens, and rejects the input of a run whose agent sets
680
+ `maxOutputTokens` as invalid.
681
+
682
+ ## Resume a run locally
683
+
684
+ A Claude Code agent can keep a copy of each run's conversation so a developer
685
+ can later continue that session in their own Claude Code. Keeping it is off by
686
+ default. Turn it on per agent:
687
+
688
+ ```json
689
+ { "id": "<coding agent id>", "codingProfile": { "sessionResume": true } }
690
+ ```
691
+
692
+ `sessionResume` applies to Claude Code agents only; `create_agent` and
693
+ `update_agent` refuse it on a Codex agent. Wardby keeps each run's session,
694
+ and `get_run_transcript` plus `npx @wardby/cli@latest resume` continue it on a
695
+ developer's machine (see [Continue a run on your machine](#continue-a-run-on-your-machine)).
696
+ This section covers what is stored, how to set it up, and how to resume.
697
+
698
+ Session resume needs Claude Code worker images from a release that supports
699
+ it (Wardby 0.7.0 or later). An older pinned image rejects the input of a run
700
+ whose agent sets `sessionResume` as invalid (`worker_input_failed`).
701
+
702
+ **What is kept.** The conversation as Claude Code recorded it: the user and
703
+ assistant messages, tool calls and their results, compaction summaries (so a
704
+ long run resumes from its last summary, as it would have in the worker), the
705
+ files and skills the agent loaded, and a session title. When Claude Code made
706
+ no title, the title is `wardby run <id>: ` and the first line of the task.
707
+ Records are kept whole. Removed: thinking blocks (they are tied to the account
708
+ and conversation that produced them and would not replay), the system prompt,
709
+ the worker's environment, date and budget reminders, account and
710
+ organisation details, billing records, and any record kind the pinned Claude
711
+ Code version is not known to write. The content is then redacted against the
712
+ values of the secrets attached to the agent, and the run's capability and
713
+ registry token are redacted by their token shape. If the agent's secrets
714
+ cannot be loaded, nothing is stored.
715
+
716
+ **Which runs.** Claude Code runs that finish, stop at their budget, or fail.
717
+ A run stopped with `stop_run` or ended by its timeout is not captured, because
718
+ its worker is removed before the transcript can be collected.
719
+
720
+ **Who can read it.** Transcripts are stored from the first run
721
+ with `sessionResume` on. Anyone who can read a run (its triggerer and the
722
+ agent's owner, as for `get_run`) can download its transcript, and so everything the agent saw and wrote, including file
723
+ contents and command output from the repository. Redaction covers secret
724
+ values, not other sensitive text. Enable `sessionResume` only for agents whose
725
+ runs you are comfortable sharing with everyone who can read them.
726
+
727
+ **Where it is stored.** In the server's blob store, as a gzip-compressed
728
+ object under the `run-transcripts/` prefix. When a run's context was
729
+ compacted, only what a resume loads is kept: the last compaction's summary,
730
+ the messages that compaction kept, and everything after it. Earlier history
731
+ is never loaded on resume, so it is not stored.
732
+
733
+ **Size limits.** `RUN_TRANSCRIPT_MAX_BYTES` caps the stored transcript,
734
+ measured before compression (default 10 MiB, at most 64 MiB). A larger
735
+ transcript is not stored. While the run works, its worker keeps the raw
736
+ session in its own in-memory scratch of up to 80 MiB, which counts toward the
737
+ run's memory, and reads at most 64 MiB of it when the run ends. Each run
738
+ records a status of `stored`, `too_large`, `not_captured` or `failed`, with a
739
+ short reason code and no content.
740
+
741
+ The blob store settings must be present on the **server process** (the
742
+ control plane that launches coding runs), not only on the coding proxy. The
743
+ server also needs its secret cipher, which it has in a normal setup.
744
+
745
+ | Variable | Default | Purpose |
746
+ | ---------------------------------------------- | ------- | --------------------------------------------------------------------------------- |
747
+ | `BLOB_STORE` | | `local`, `gcs` or `s3`. Without it no transcript is stored. |
748
+ | `BLOB_STORE_LOCAL_DIR` | | Directory for `BLOB_STORE=local`. |
749
+ | `BLOB_STORE_GCS_BUCKET` | | Bucket for `BLOB_STORE=gcs`. |
750
+ | `BLOB_STORE_S3_BUCKET`, `BLOB_STORE_S3_REGION` | | Bucket and region for `BLOB_STORE=s3`. |
751
+ | `BLOB_STORE_S3_ENDPOINT` | | Optional: an S3-compatible endpoint for `BLOB_STORE=s3`. |
752
+ | `RUN_TRANSCRIPT_RETENTION_DAYS` | `30` | Days to keep a transcript, a whole number from 1 to 3650. |
753
+ | `RUN_TRANSCRIPT_MAX_BYTES` | 10 MiB | Largest transcript stored, in bytes before compression, from 1048576 to 67108864. |
754
+
755
+ **Retention.** Expired transcripts are pruned whenever a new one is stored.
756
+ For GCS and S3, also add a bucket lifecycle rule that deletes objects under
757
+ the `run-transcripts/` prefix after the same number of days, so objects are
758
+ removed even when no new run is stored. The reference GKE and AWS modules
759
+ create that rule for you (below).
760
+
761
+ **Set it up per deployment.** Use a bucket of its own for transcripts, not the
762
+ dependency cache bucket, and give access to the control plane only: a
763
+ transcript holds everything the run saw, and the coding proxy and workers have
764
+ no need for it.
765
+
766
+ - **GKE**: set `session_transcripts_enabled = true` and a unique
767
+ `session_transcripts_bucket_name` (optionally
768
+ `session_transcripts_retention_days`, default 30) in `terraform.tfvars`, and
769
+ deploy with `WARDBY_SESSION_TRANSCRIPTS=true deploy/gke/up.sh`. Terraform
770
+ creates the bucket and its lifecycle rule and grants the control plane's
771
+ service account alone; `up.sh` gives the control plane `BLOB_STORE=gcs`, the
772
+ bucket and the matching `RUN_TRANSCRIPT_RETENTION_DAYS`. See
773
+ [`deploy/gke/README.md`](../deploy/gke/README.md#session-transcripts).
774
+ - **AWS (EKS)**: set the Terraform variables of the same names, then give the
775
+ control plane container `BLOB_STORE=s3`, `BLOB_STORE_S3_BUCKET` (the
776
+ `session_transcripts_bucket` output), `BLOB_STORE_S3_REGION` and
777
+ `RUN_TRANSCRIPT_RETENTION_DAYS` (the `session_transcripts_retention_days`
778
+ output). See
779
+ [`deploy/aws/README.md`](../deploy/aws/README.md#session-transcripts).
780
+ - **kind harness**: the control plane runs on your host, so set
781
+ `BLOB_STORE=local` and `BLOB_STORE_LOCAL_DIR` (a directory on your host) in
782
+ the environment you start it with. Nothing changes in the cluster.
783
+ - **Docker quickstart**: the server runs on your host. Add `BLOB_STORE=local`
784
+ and `BLOB_STORE_LOCAL_DIR` (an absolute directory on your host) to
785
+ `.wardby/.env` and restart. The coding proxy container keeps its own
786
+ dependency cache store and is not affected. A local directory has no
787
+ lifecycle rule, so expired transcripts are removed only when new ones are
788
+ stored.
789
+
790
+ **Startup checks.** With `JOB_LAUNCHER` set to `docker` or `kubernetes`, a
791
+ half-set `BLOB_STORE` (the kind set but its bucket or directory missing), or an
792
+ invalid `RUN_TRANSCRIPT_RETENTION_DAYS` or `RUN_TRANSCRIPT_MAX_BYTES`, stops the server at startup with a
793
+ message naming the variable.
794
+
795
+ **Custom worker images.** An agent that sets `workerImageRef` must rebuild its
796
+ image from a release that includes session resume. Until then its runs fail at
797
+ input (`worker_input_failed`). `update_agent` warns about this when you turn
798
+ `sessionResume` on, and also warns when the server has no blob store.
799
+
800
+ ### Continue a run on your machine
801
+
802
+ Ask your MCP client to call `get_run_transcript` with the run's id. It takes
803
+ the same access as `get_run` (the run's triggerer or the agent's owner) and
804
+ returns:
805
+
806
+ - `status`: `stored` when the transcript can be resumed. Otherwise the status
807
+ (`none`, `too_large`, `not_captured`, `failed`, `expired`, `unavailable` or
808
+ `unsupported`), its `reason`, and what it means; no link.
809
+ - `sessionId`, `repository`, `branch` (the branch the run pushed, or its head
810
+ branch), `baseSha`, `sizeBytes` and `expiresAt` (when the transcript is
811
+ deleted).
812
+ - `download.url` and `download.expiresAt`: a signed download link that works
813
+ for 10 minutes.
814
+ - `command`: `npx @wardby/cli@latest resume -`. It asks for the link; paste
815
+ `download.url`.
816
+
817
+ The transcript itself never enters your MCP client's conversation, only the
818
+ link. Run the command in a terminal. You can also pass the link as an
819
+ argument (`npx @wardby/cli@latest resume '<link>'`) or pipe it in, but an argument stays
820
+ in your shell history and in the process list while Claude Code runs, so
821
+ pasting it at the prompt is the safer default.
822
+
823
+ - For a GitHub repository, run it inside a clone of that repository. It
824
+ fetches the run's branch from the remote that points at the repository and
825
+ adds a detached git worktree next to the clone, named
826
+ `<clone>-run-<last 8 characters of the run id>`.
827
+ - For a `local:` repository, run it anywhere on the server's machine. The
828
+ worktree is added from that repository, next to it. A `local:` path names
829
+ a folder on the server's machine, so it is used only when the link comes
830
+ from this machine (`127.0.0.1`, `localhost` or `[::1]`, as with a stdio MCP
831
+ server). For a link from any other server the command stops with
832
+ `local_repository_refused` unless you pass `--here`, or `--dir <path>` to
833
+ check the run out from that folder anyway.
834
+ - A detached worktree works even while the branch is checked out somewhere
835
+ else. When the branch no longer exists (for example a failed run that
836
+ pushed nothing), the run's base commit is checked out instead, with a
837
+ warning that the run's changes are not in it.
838
+
839
+ ```text
840
+ npx @wardby/cli@latest resume - [--dir <path> | --here] [--force] [--print]
841
+ ```
842
+
843
+ | Option | Effect |
844
+ | -------------- | ---------------------------------------------------------------------------------- |
845
+ | `--dir <path>` | Put the worktree at `<path>` instead of the default. |
846
+ | `--here` | Skip the checkout and continue in the current directory as it is. |
847
+ | `--force` | Replace a different session file already imported for this run. |
848
+ | `--print` | Print the `claude` command instead of starting it (also when `claude` is missing). |
849
+
850
+ The command downloads the transcript and checks its SHA-256 against the
851
+ server's before writing anything. It writes two files, both readable only by
852
+ you, under `~/.wardby/sessions/<run id>/`: the session as
853
+ `<session id>.jsonl`, and `mcp-config.json`. It never writes to Claude Code's
854
+ own configuration directory. It then starts Claude Code in the worktree:
855
+
856
+ ```text
857
+ claude --resume ~/.wardby/sessions/<run id>/<session id>.jsonl \
858
+ --mcp-config ~/.wardby/sessions/<run id>/mcp-config.json \
859
+ --system-prompt-snapshot off --append-system-prompt '<move note>'
860
+ ```
861
+
862
+ - **The move note** tells the model the session moved from the worker:
863
+ `/workspace` (where the run's commands ran) is now the worktree, and the
864
+ worker's tool is gone. `--system-prompt-snapshot off` makes Claude Code
865
+ apply the note to a resumed conversation. It needs Claude Code 2.1.257 or
866
+ later; for an older version that `claude --version` reports, it is left
867
+ out. When the version cannot be read (for example `claude` is not on
868
+ `PATH`), the printed command includes it and says so: remove it if your
869
+ Claude Code is older than 2.1.257.
870
+ - **The stand-in tool server.** Every command in a run went through the
871
+ worker's `run_command` tool (`wardby_tools`). The MCP config starts a
872
+ stand-in with the same name and input schema from the same wardby install,
873
+ so the resumed session shows the run's calls and their output. Under `npx`,
874
+ `mcp-config.json` points into the npx cache; if that cache has been
875
+ cleaned, run `wardby resume` again to rewrite it. The stand-in
876
+ runs nothing: any call answers that the session moved and to use the local
877
+ Bash, Read and Edit tools in the worktree.
878
+ - **Importing again.** An identical session file is reused. A file that has
879
+ grown because you continued the session locally is kept, so running the
880
+ command again picks up where you left off. Any other different file is
881
+ refused unless you pass `--force`. An existing worktree of the same
882
+ repository at the target path is reused as it is, with a warning when it
883
+ is at a different commit from the run's.
884
+ - **Removing an import.** Delete `~/.wardby/sessions/<run id>/` and remove
885
+ the worktree with `git worktree remove <path>`. The command prints both.
886
+ - Only Claude Code runs can be resumed; for other runs the tool returns
887
+ `unsupported`.
888
+
889
+ **The link is a credential.** Anyone who has it can download the transcript
890
+ until it expires, without signing in. Do not paste it into chats, issues or
891
+ logs. It works only for the run and person it was made for, and only while
892
+ that person can still read the run. Over the HTTP transport it points at the
893
+ server's own address (`MCP_CANONICAL_URI`'s origin). Over stdio it points at a
894
+ local port the MCP server opens on `127.0.0.1` while links are in use, so
895
+ your MCP client must stay connected until the download finishes. On a
896
+ multi-instance HTTP deployment a link made on one instance works on every
897
+ other: each instance derives the key that signs links from `SECRET_APP_KEY`,
898
+ which they already share (set `REQUEST_STATE_KEY`, 32 bytes of hex, the same
899
+ on every instance, to use a key of your own instead). A link made by a stdio
900
+ server is never accepted by the HTTP route. `wardby resume` sends the link only over HTTPS, or over plain
901
+ HTTP to this machine.
902
+
903
+ The token is in the link's query string (as with the secret-entry form's
904
+ links). Exclude `/run-transcripts/download` (and `/elicit/secret`) from
905
+ load-balancer, ingress and proxy access logs, or log those paths without
906
+ their query string.
907
+
908
+ The download responds with the gzip-compressed transcript and the headers
909
+ `x-wardby-sha256`, `x-wardby-session-id` and `x-wardby-transcript-meta` (the
910
+ run's repository and refs, as base64url JSON). A refused download returns
911
+ JSON `{ "error": "<code>" }`; `wardby resume` explains each code (see the
912
+ `errors/run-transcript-download` help article).
913
+
432
914
  ## Stop the setup
433
915
 
434
916
  ```sh