@wardby/cli 0.7.0 → 0.8.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 (304) hide show
  1. package/.env.example +5 -5
  2. package/README.md +6 -1
  3. package/deploy/local/docker-compose.quickstart-coding.yml +6 -0
  4. package/dist/claude-coding-worker/driver.d.ts +12 -0
  5. package/dist/claude-coding-worker/driver.js +29 -7
  6. package/dist/claude-coding-worker/main.js +5 -1
  7. package/dist/claude-coding-worker/sdk.js +17 -1
  8. package/dist/claude-plugin/command.d.ts +61 -0
  9. package/dist/claude-plugin/command.js +376 -0
  10. package/dist/cli-help.d.ts +1 -1
  11. package/dist/cli-help.js +2 -1
  12. package/dist/cli.js +47 -3
  13. package/dist/coding/code-host.d.ts +16 -0
  14. package/dist/coding/code-host.js +60 -0
  15. package/dist/coding/mcp-token.d.ts +12 -0
  16. package/dist/coding/mcp-token.js +26 -0
  17. package/dist/coding/protocol.js +2 -0
  18. package/dist/coding/redact.js +6 -1
  19. package/dist/coding/transcript/recorder.d.ts +5 -4
  20. package/dist/coding/transcript/recorder.js +1 -1
  21. package/dist/coding-worker/debug-trace.d.ts +3 -1
  22. package/dist/coding-worker/debug-trace.js +4 -2
  23. package/dist/coding-worker/driver.js +8 -1
  24. package/dist/coding-worker/main.js +5 -1
  25. package/dist/coding-worker/mcp-config.d.ts +27 -0
  26. package/dist/coding-worker/mcp-config.js +32 -0
  27. package/dist/coding-worker/sdk.d.ts +36 -0
  28. package/dist/coding-worker/sdk.js +28 -1
  29. package/dist/coding-worker/types.d.ts +4 -0
  30. package/dist/config/mcp-call-limit.d.ts +8 -0
  31. package/dist/config/mcp-call-limit.js +18 -0
  32. package/dist/config/mcp-servers.d.ts +8 -0
  33. package/dist/config/mcp-servers.js +12 -0
  34. package/dist/config/test-simulators.d.ts +10 -0
  35. package/dist/config/test-simulators.js +28 -0
  36. package/dist/config/tool-timeout.d.ts +1 -0
  37. package/dist/config/tool-timeout.js +18 -0
  38. package/dist/core/coding-mcp.d.ts +36 -0
  39. package/dist/core/coding-mcp.js +253 -0
  40. package/dist/core/coding-repository.d.ts +46 -0
  41. package/dist/core/coding-repository.js +92 -0
  42. package/dist/core/delegation-slots.d.ts +27 -0
  43. package/dist/core/delegation-slots.js +44 -0
  44. package/dist/core/dispatch.d.ts +6 -2
  45. package/dist/core/dispatch.js +36 -11
  46. package/dist/core/error-code.js +1 -0
  47. package/dist/core/grants.d.ts +28 -3
  48. package/dist/core/grants.js +46 -4
  49. package/dist/core/host-events.js +7 -3
  50. package/dist/core/host-status.js +2 -2
  51. package/dist/core/issue-status.js +4 -3
  52. package/dist/core/mark-ready.d.ts +1 -1
  53. package/dist/core/mark-ready.js +1 -1
  54. package/dist/core/mcp-client/client.d.ts +47 -0
  55. package/dist/core/mcp-client/client.js +141 -0
  56. package/dist/core/mcp-client/jsonrpc.d.ts +15 -0
  57. package/dist/core/mcp-client/jsonrpc.js +54 -0
  58. package/dist/core/mcp-client/results.d.ts +13 -0
  59. package/dist/core/mcp-client/results.js +42 -0
  60. package/dist/core/mcp-servers.d.ts +90 -0
  61. package/dist/core/mcp-servers.js +230 -0
  62. package/dist/core/mcp-tools.d.ts +108 -0
  63. package/dist/core/mcp-tools.js +287 -0
  64. package/dist/core/merge-order-check.js +38 -19
  65. package/dist/core/notification-dispatcher.js +2 -1
  66. package/dist/core/related-pull-requests.js +26 -10
  67. package/dist/core/review-fix.js +2 -2
  68. package/dist/core/review-host-tools.js +3 -1
  69. package/dist/core/runner.d.ts +66 -16
  70. package/dist/core/runner.js +281 -73
  71. package/dist/core/secret-broker-config.d.ts +2 -0
  72. package/dist/core/secret-broker-config.js +1 -1
  73. package/dist/core/secret-guard.d.ts +5 -2
  74. package/dist/core/secret-guard.js +22 -7
  75. package/dist/core/secrets.d.ts +11 -1
  76. package/dist/core/secrets.js +27 -1
  77. package/dist/core/serializable-retry.d.ts +18 -0
  78. package/dist/core/serializable-retry.js +43 -0
  79. package/dist/core/tool-admin.d.ts +5 -1
  80. package/dist/core/tool-admin.js +7 -2
  81. package/dist/core/tool-names.d.ts +13 -0
  82. package/dist/core/tool-names.js +20 -0
  83. package/dist/core/webhooks.d.ts +4 -0
  84. package/dist/core/webhooks.js +68 -49
  85. package/dist/core/workflow-run-events.js +2 -1
  86. package/dist/generated/prisma/browser.d.ts +31 -0
  87. package/dist/generated/prisma/client.d.ts +31 -0
  88. package/dist/generated/prisma/commonInputTypes.d.ts +50 -50
  89. package/dist/generated/prisma/internal/class.d.ts +66 -0
  90. package/dist/generated/prisma/internal/class.js +4 -4
  91. package/dist/generated/prisma/internal/prismaNamespace.d.ts +530 -1
  92. package/dist/generated/prisma/internal/prismaNamespace.js +75 -2
  93. package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts +79 -0
  94. package/dist/generated/prisma/internal/prismaNamespaceBrowser.js +75 -2
  95. package/dist/generated/prisma/models/Agent.d.ts +271 -0
  96. package/dist/generated/prisma/models/AgentMcpServer.d.ts +1412 -0
  97. package/dist/generated/prisma/models/AgentMcpServer.js +1 -0
  98. package/dist/generated/prisma/models/AgentRepository.d.ts +40 -1
  99. package/dist/generated/prisma/models/AuthUser.d.ts +1 -1
  100. package/dist/generated/prisma/models/CodingAgentProfile.d.ts +0 -7
  101. package/dist/generated/prisma/models/CodingProxySession.d.ts +119 -2
  102. package/dist/generated/prisma/models/CodingRun.d.ts +76 -1
  103. package/dist/generated/prisma/models/HostProvider.d.ts +2176 -0
  104. package/dist/generated/prisma/models/HostProvider.js +1 -0
  105. package/dist/generated/prisma/models/HostProviderCredential.d.ts +1285 -0
  106. package/dist/generated/prisma/models/HostProviderCredential.js +1 -0
  107. package/dist/generated/prisma/models/HostProviderOperation.d.ts +1470 -0
  108. package/dist/generated/prisma/models/HostProviderOperation.js +1 -0
  109. package/dist/generated/prisma/models/HostProviderTrustedAccount.d.ts +1145 -0
  110. package/dist/generated/prisma/models/HostProviderTrustedAccount.js +1 -0
  111. package/dist/generated/prisma/models/McpServer.d.ts +1500 -0
  112. package/dist/generated/prisma/models/McpServer.js +1 -0
  113. package/dist/generated/prisma/models/NativeGatewayCall.d.ts +39 -1
  114. package/dist/generated/prisma/models/Principal.d.ts +167 -0
  115. package/dist/generated/prisma/models/ResourceGrant.d.ts +1 -1
  116. package/dist/generated/prisma/models/Secret.d.ts +387 -0
  117. package/dist/generated/prisma/models/Tool.d.ts +223 -1
  118. package/dist/generated/prisma/models.d.ts +6 -0
  119. package/dist/help/search.js +12 -3
  120. package/dist/help-index.json +719 -47
  121. package/dist/import/create.js +16 -1
  122. package/dist/import/neutral-schema.d.ts +1 -0
  123. package/dist/import/neutral-schema.js +2 -0
  124. package/dist/mcp/auth/grants-cli.d.ts +6 -4
  125. package/dist/mcp/auth/grants-cli.js +42 -3
  126. package/dist/mcp/auth/resource-server.d.ts +3 -1
  127. package/dist/mcp/auth/resource-server.js +17 -2
  128. package/dist/mcp/context.d.ts +3 -0
  129. package/dist/mcp/index.js +11 -0
  130. package/dist/mcp/tools/agents.js +100 -15
  131. package/dist/mcp/tools/grants.js +66 -28
  132. package/dist/mcp/tools/host-providers.d.ts +2 -0
  133. package/dist/mcp/tools/host-providers.js +215 -0
  134. package/dist/mcp/tools/mcp-servers.d.ts +26 -0
  135. package/dist/mcp/tools/mcp-servers.js +481 -0
  136. package/dist/mcp/tools/repositories.js +50 -10
  137. package/dist/mcp/tools/runs.js +178 -18
  138. package/dist/mcp/tools/secret-elicitation.d.ts +2 -0
  139. package/dist/mcp/tools/secret-elicitation.js +25 -2
  140. package/dist/mcp/tools/secrets.js +38 -4
  141. package/dist/mcp/tools/tools.d.ts +6 -4
  142. package/dist/mcp/tools/tools.js +40 -8
  143. package/dist/mcp/tools/trigger.js +28 -6
  144. package/dist/mcp/transport/http-limits.d.ts +2 -0
  145. package/dist/mcp/transport/http-limits.js +6 -2
  146. package/dist/mcp/webhooks/ingress.js +10 -0
  147. package/dist/native-worker/gateway-server.d.ts +14 -0
  148. package/dist/native-worker/gateway-server.js +28 -7
  149. package/dist/native-worker/gateway.d.ts +2 -0
  150. package/dist/native-worker/gateway.js +5 -1
  151. package/dist/native-worker/http-server.d.ts +4 -0
  152. package/dist/native-worker/http-server.js +51 -0
  153. package/dist/native-worker/ledger.d.ts +6 -2
  154. package/dist/native-worker/ledger.js +5 -4
  155. package/dist/native-worker/protocol.d.ts +1 -0
  156. package/dist/native-worker/protocol.js +4 -1
  157. package/dist/providers/coding-proxy/capability-hash.d.ts +2 -0
  158. package/dist/providers/coding-proxy/capability-hash.js +5 -0
  159. package/dist/providers/coding-proxy/mcp-route.d.ts +34 -0
  160. package/dist/providers/coding-proxy/mcp-route.js +166 -0
  161. package/dist/providers/coding-proxy/memory-ledger.d.ts +2 -0
  162. package/dist/providers/coding-proxy/memory-ledger.js +15 -0
  163. package/dist/providers/coding-proxy/prisma-ledger.d.ts +1 -0
  164. package/dist/providers/coding-proxy/prisma-ledger.js +30 -2
  165. package/dist/providers/coding-proxy/proxy.d.ts +7 -1
  166. package/dist/providers/coding-proxy/proxy.js +134 -34
  167. package/dist/providers/coding-proxy/runtime.d.ts +6 -0
  168. package/dist/providers/coding-proxy/runtime.js +32 -1
  169. package/dist/providers/coding-proxy/server.d.ts +3 -0
  170. package/dist/providers/coding-proxy/server.js +10 -0
  171. package/dist/providers/coding-proxy/types.d.ts +13 -0
  172. package/dist/providers/executor/composition.js +5 -0
  173. package/dist/providers/executor/container.d.ts +33 -1
  174. package/dist/providers/executor/container.js +76 -7
  175. package/dist/providers/host-tools/invoke.d.ts +37 -0
  176. package/dist/providers/host-tools/invoke.js +117 -0
  177. package/dist/providers/host-tools/operations.d.ts +65 -0
  178. package/dist/providers/host-tools/operations.js +149 -0
  179. package/dist/providers/host-tools/registry.d.ts +79 -0
  180. package/dist/providers/host-tools/registry.js +362 -0
  181. package/dist/providers/host-tools/request-guard.d.ts +17 -0
  182. package/dist/providers/host-tools/request-guard.js +99 -0
  183. package/dist/providers/host-tools/self-test.d.ts +64 -0
  184. package/dist/providers/host-tools/self-test.js +142 -0
  185. package/dist/providers/jobs/docker-isolation.d.ts +2 -2
  186. package/dist/providers/jobs/docker-isolation.js +30 -8
  187. package/dist/providers/jobs/docker.d.ts +8 -0
  188. package/dist/providers/jobs/docker.js +33 -9
  189. package/dist/providers/jobs/kubernetes-isolation.d.ts +3 -1
  190. package/dist/providers/jobs/kubernetes-isolation.js +15 -2
  191. package/dist/providers/jobs/kubernetes.d.ts +5 -0
  192. package/dist/providers/jobs/kubernetes.js +6 -1
  193. package/dist/providers/jobs/types.d.ts +6 -0
  194. package/dist/providers/review-host/types.d.ts +6 -4
  195. package/dist/providers/review-host/types.js +1 -1
  196. package/dist/providers/vcs/git.d.ts +6 -2
  197. package/dist/providers/vcs/git.js +15 -4
  198. package/dist/providers/vcs/github.d.ts +2 -71
  199. package/dist/providers/vcs/github.js +8 -11
  200. package/dist/providers/vcs/index.d.ts +1 -1
  201. package/dist/providers/vcs/index.js +1 -1
  202. package/dist/providers/vcs/remote.d.ts +4 -0
  203. package/dist/providers/vcs/remote.js +7 -1
  204. package/dist/providers/vcs/routing.d.ts +12 -6
  205. package/dist/providers/vcs/routing.js +21 -6
  206. package/dist/providers/vcs/types.d.ts +71 -3
  207. package/dist/quickstart/index.d.ts +5 -0
  208. package/dist/quickstart/index.js +21 -0
  209. package/dist/quickstart-images.json +1 -1
  210. package/dist/sandbox/eval-core.d.ts +12 -2
  211. package/dist/sandbox/eval-core.js +20 -4
  212. package/dist/sandbox/host-functions.d.ts +4 -0
  213. package/dist/sandbox/host-functions.js +7 -2
  214. package/dist/sandbox/limits.d.ts +4 -1
  215. package/dist/sandbox/limits.js +4 -1
  216. package/dist/sandbox/run-in-sandbox.d.ts +6 -0
  217. package/dist/sandbox/run-in-sandbox.js +14 -2
  218. package/dist/sandbox/safe-fetch.d.ts +2 -0
  219. package/dist/sandbox/safe-fetch.js +1 -1
  220. package/dist/sandbox/secret-broker.d.ts +1 -0
  221. package/dist/sandbox/secret-broker.js +1 -1
  222. package/dist/sandbox/tool-timeout.d.ts +32 -0
  223. package/dist/sandbox/tool-timeout.js +52 -0
  224. package/dist/sandbox/user-tool.d.ts +8 -1
  225. package/dist/sandbox/user-tool.js +9 -3
  226. package/dist/viewer/graph.js +2 -1
  227. package/dist/wardby-bin.js +5 -0
  228. package/docs/README.md +11 -1
  229. package/docs/agent-recipes.md +37 -4
  230. package/docs/architecture-runtime.md +1 -1
  231. package/docs/claude-code-plugin.md +164 -0
  232. package/docs/code-review-agents.md +6 -0
  233. package/docs/coding-agent-setup.md +77 -1
  234. package/docs/coding-worker-byo-images.md +4 -2
  235. package/docs/coding-worker-isolation.md +78 -7
  236. package/docs/debugging-agent-runs.md +242 -0
  237. package/docs/getting-started-gke.md +5 -4
  238. package/docs/getting-started-identity-provider.md +43 -37
  239. package/docs/getting-started.md +8 -0
  240. package/docs/host-providers.md +294 -0
  241. package/docs/mcp-servers.md +254 -0
  242. package/docs/native-sandbox.md +25 -9
  243. package/docs/security-deployment.md +110 -31
  244. package/docs/tool-secrets.md +3 -0
  245. package/docs/viewer-api.md +6 -0
  246. package/docs/viewer-api.openapi.yml +1 -1
  247. package/help/admin-viewer.md +4 -0
  248. package/help/agent-recipes.md +33 -2
  249. package/help/brokered-secrets.md +3 -0
  250. package/help/build-claude-code-image.md +1 -1
  251. package/help/claude-code-run-pane.md +40 -0
  252. package/help/errors/coding-mcp-pins-unavailable.md +35 -0
  253. package/help/errors/database-auth-invalid.md +1 -1
  254. package/help/errors/host-provider-error.md +40 -0
  255. package/help/errors/host-tool-failed.md +36 -0
  256. package/help/errors/mcp-call-limit.md +22 -0
  257. package/help/errors/mcp-call-timeout.md +22 -0
  258. package/help/errors/mcp-server-auth-failed.md +22 -0
  259. package/help/errors/mcp-server-credentials-unavailable.md +45 -0
  260. package/help/errors/mcp-server-error.md +28 -0
  261. package/help/errors/mcp-server-unreachable.md +22 -0
  262. package/help/errors/mcp-servers-off.md +21 -0
  263. package/help/errors/mcp-tool-not-allowed.md +26 -0
  264. package/help/errors/mcp-tool-removed.md +22 -0
  265. package/help/errors/mcp-unavailable.md +25 -0
  266. package/help/errors/native-sandbox-capacity.md +1 -1
  267. package/help/errors/native-sandbox-deadline-exceeded.md +1 -1
  268. package/help/errors/native-sandbox-docker-failed.md +1 -1
  269. package/help/errors/native-sandbox-gateway-error.md +1 -1
  270. package/help/errors/native-sandbox-gateway-unavailable.md +1 -1
  271. package/help/errors/native-sandbox-image-not-pinned.md +1 -1
  272. package/help/errors/native-sandbox-isolation-mismatch.md +1 -1
  273. package/help/errors/native-sandbox-network-unenforced.md +1 -1
  274. package/help/errors/native-sandbox-requires-catalog.md +1 -1
  275. package/help/errors/native-sandbox-unavailable.md +1 -1
  276. package/help/errors/native-sandbox-warm-delivery-failed.md +1 -1
  277. package/help/errors/native-sandbox-worker-exited.md +1 -1
  278. package/help/errors/native-sandbox-worker-lost.md +1 -1
  279. package/help/errors/native-sandbox-worker-unready.md +1 -1
  280. package/help/errors/repository-not-listed.md +36 -0
  281. package/help/errors/repository-required.md +36 -0
  282. package/help/errors/tool-timeout.md +38 -0
  283. package/help/host-providers.md +40 -0
  284. package/help/identity-and-access.md +4 -1
  285. package/help/mcp-servers.md +73 -0
  286. package/help/mcp.md +7 -2
  287. package/help/native-capabilities.md +27 -1
  288. package/help/native-sandbox.md +1 -1
  289. package/help/operating-agents.md +16 -0
  290. package/help/related-pull-requests.md +7 -3
  291. package/help/repo-instructions-and-skills.md +3 -1
  292. package/help/resume-runs-locally.md +3 -0
  293. package/help/stop-run.md +1 -1
  294. package/help/troubleshooting/coding-workers.md +9 -1
  295. package/help/troubleshooting/debugging-agent-runs.md +29 -0
  296. package/package.json +2 -1
  297. package/prisma/migrations/20261102000000_host_providers/migration.sql +56 -0
  298. package/prisma/migrations/20261104000000_coding_agent_repository_list/migration.sql +5 -0
  299. package/prisma/migrations/20261106000000_tool_timeout/migration.sql +4 -0
  300. package/prisma/migrations/20261107000000_mcp_servers/migration.sql +33 -0
  301. package/prisma/migrations/20261108000000_coding_mcp/migration.sql +5 -0
  302. package/prisma/migrations/20261109000000_task_run_index/migration.sql +3 -0
  303. package/prisma/schema.prisma +159 -14
  304. package/scripts/git-askpass.sh +1 -1
@@ -4,7 +4,7 @@ title: Native worker pod did not start
4
4
  summary: On Kubernetes, the sandbox worker pod did not reach the Running state in time, so the run failed before starting.
5
5
  audience: operator
6
6
  tags: [error, native-agents, sandbox, kubernetes, native_sandbox_worker_unready]
7
- appliesTo: ">=0.5.4"
7
+ appliesTo: ">=0.6.0"
8
8
  ---
9
9
 
10
10
  # Native worker pod did not start
@@ -0,0 +1,36 @@
1
+ ---
2
+ id: errors/repository-not-listed
3
+ title: Repository not on the agent's list (repository_not_listed)
4
+ summary: The repository named for a coding run is not the agent's default or one of its write links; name a listed one, or add it with link_repository.
5
+ audience: operator
6
+ tags: [error, coding-agents, repository_not_listed, invalid_repository, link_repository]
7
+ appliesTo: ">=0.8.0"
8
+ ---
9
+
10
+ # Repository not on the agent's list
11
+
12
+ `repository_not_listed` means the `repository` given to `trigger_agent` or to a
13
+ `delegate_to_<name>` call is neither the coding agent's default
14
+ (`codingProfile.repository`) nor one of its repository links (write access, no
15
+ triggers). No run was started. The message lists the repositories that are
16
+ allowed and never repeats the value that was sent.
17
+
18
+ A webhook that sends `wardbyRepository` gets the same refusal as a 400
19
+ `{ "error": "invalid_repository" }` when
20
+ `codingProfile.allowWebhookTaskOverride` is on. A malformed value (not a string,
21
+ empty, or over 300 characters) is that same 400 with the flag on or off. With
22
+ the flag off, a well-formed value is refused with 403 `{ "error": "disabled" }`
23
+ before it is compared with the list, whoever created the webhook.
24
+
25
+ ## What to do
26
+
27
+ - Name one of the listed repositories, spelled as `your-org/your-repo`.
28
+ - To add a repository, the agent's owner calls `link_repository` with
29
+ `access: "write"`, no triggers and, optionally, a `baseRef`. The owner needs
30
+ write access to it on the host, or an admin approves it.
31
+ - If a native (non-coding) sub-agent is the target, `repository` is refused
32
+ with `repository_requires_coding_agent`: drop the argument.
33
+
34
+ See [Repository required](repository-required.md),
35
+ [Agent recipes](../agent-recipes.md) and the operator guide
36
+ `docs/coding-agent-setup.md`, section "A coding agent's repositories".
@@ -0,0 +1,36 @@
1
+ ---
2
+ id: errors/repository-required
3
+ title: Repository required (repository_required)
4
+ summary: A coding agent with several repositories was asked to work without being told which one; pass repository, or use continuePriorRun.
5
+ audience: operator
6
+ tags: [error, coding-agents, repository_required, repository, link_repository, delegation]
7
+ appliesTo: ">=0.8.0"
8
+ ---
9
+
10
+ # Repository required
11
+
12
+ `repository_required` means a coding agent has more than its default repository
13
+ (it has write links without triggers added with `link_repository`), and the
14
+ request did not say which one to work in. Nothing was started.
15
+
16
+ A `delegate_to_<name>` call to such a sub-agent must name a repository. The
17
+ exception is a follow-up: with `continuePriorRun`, the run works in the
18
+ repository of the run it continues. The message lists the repositories on the
19
+ agent's list.
20
+
21
+ ## What to do
22
+
23
+ - Pass `repository` on the call, using one of the listed repositories, for
24
+ example `your-org/your-repo`.
25
+ - Tell the lead agent in its system prompt which repository each kind of
26
+ change belongs to.
27
+ - If the agent should only work in one repository, remove the extra ones with
28
+ `unlink_repository`.
29
+
30
+ On `trigger_agent` and webhooks, leaving `repository` out uses the default
31
+ repository (`codingProfile.repository`) and is not an error. Webhooks use the
32
+ body field `wardbyRepository`.
33
+
34
+ See [Repository not on the agent's list](repository-not-listed.md),
35
+ [Agent recipes](../agent-recipes.md) and the operator guide
36
+ `docs/coding-agent-setup.md`, section "A coding agent's repositories".
@@ -0,0 +1,38 @@
1
+ ---
2
+ id: errors/tool-timeout
3
+ title: A tool call ran out of time (timeout, fetch_cancelled_or_timeout)
4
+ summary: A sandboxed tool call hit its time limit; raise the tool's timeoutMs, up to the server's WARDBY_TOOL_MAX_TIMEOUT_MS.
5
+ audience: developer
6
+ tags: [timeout, timeoutMs, wall-time, fetch_cancelled_or_timeout, sleep_limit, WARDBY_TOOL_MAX_TIMEOUT_MS]
7
+ appliesTo: ">=0.8.0"
8
+ ---
9
+
10
+ # A tool call ran out of time
11
+
12
+ ## What happened
13
+
14
+ A tool's result was `{"error":"timeout","message":"Exceeded the 10000ms wall-time limit. ..."}`.
15
+ The call ran longer than the tool's time limit, so it was stopped. The run goes on: only this call
16
+ failed. The message names the limit. Without `timeoutMs` a tool has 10 seconds.
17
+
18
+ Related results:
19
+
20
+ - `fetch_cancelled_or_timeout` from inside the tool: a `fetch` was aborted because the call ran
21
+ out of time or the run stopped.
22
+ - `sleep_limit`: the tool asked to wait longer than its own limit.
23
+ - `{"error":"cancelled"}`: the run was stopped while the call was running.
24
+
25
+ ## What to do
26
+
27
+ 1. Check how long the API the tool calls really takes.
28
+ 2. Give the tool a longer limit with `update_tool` (`timeoutMs`, in milliseconds), or
29
+ `wardby tool update <tool> --timeout-ms <ms>`.
30
+ 3. Test it with `dry_run_tool` and the same `timeoutMs`.
31
+
32
+ `timeoutMs` can't exceed the server's `WARDBY_TOOL_MAX_TIMEOUT_MS` (default `300000`); a larger
33
+ value is refused with an error naming the ceiling. If you need more, ask the operator to raise it.
34
+ If the operator lowers the ceiling, a tool with a larger `timeoutMs` runs with the ceiling.
35
+
36
+ Runs that started before the change keep the limit they loaded; the next run uses the new one.
37
+
38
+ See [Use native agents, tools, and data](../native-capabilities.md#tool-time-limits).
@@ -0,0 +1,40 @@
1
+ ---
2
+ id: host-providers
3
+ title: Add a code host with your own tools (host providers)
4
+ summary: Register a code host implemented by custom tools, approve changes to them, and test them with read-only calls. Agents can't use a provider yet.
5
+ audience: operator
6
+ tags: [host provider, register_host_provider, approve_host_provider_tools, hosts:admin, host-manager]
7
+ appliesTo: >=0.8.0
8
+ ---
9
+
10
+ # Host providers
11
+
12
+ A host provider adds a code host using your own custom tools. This release lets you register
13
+ a provider, approve its tools and test them. Agents can't use a registered provider yet.
14
+
15
+ You need the `hosts:admin` scope and a role that grants it (`admin` or `host-manager`). See
16
+ [Identity and access](identity-and-access.md).
17
+
18
+ 1. Write one tool per operation with `create_tool`.
19
+ 2. Broker each credential with `set_secret_broker`, allowing the API hosts and the git host. The
20
+ permission credential needs only the API hosts ([Brokered secrets](brokered-secrets.md)).
21
+ 3. Call `register_host_provider`. No restart is needed today, because agents can't use a provider
22
+ yet; a new provider will need one once they can. A refusal has a
23
+ [`host_provider_*` code](errors/host-provider-error.md).
24
+ 4. Call `test_host_provider` to check each read-only tool. Failures have
25
+ [fixed codes](errors/host-tool-failed.md).
26
+
27
+ `update_tool` changes nothing until you call `approve_host_provider_tools`, a new `timeoutMs`
28
+ included. See which tools have changes with `get_host_provider`.
29
+
30
+ A bound tool reaches only the provider's API hosts, inside one repository's path, and Wardby
31
+ follows no redirects; the tool must fetch the `Location` itself. Any host manager can read and re-register any
32
+ provider.
33
+
34
+ Replacing a secret a provider uses, or changing its broker config, needs `hosts:admin` as well as
35
+ `secrets:write`. A webhook secret stays at 16 characters or more.
36
+
37
+ Keep provider credentials unattached: an agent's own tools can use an attached one without the
38
+ provider's path guard.
39
+
40
+ See [docs/host-providers.md](../docs/host-providers.md) for the full guide.
@@ -21,7 +21,7 @@ audience, and the granted Wardby scopes in `scope` or `scp`.
21
21
 
22
22
  Scopes authorize normal operations such as managing agents, runs, tools,
23
23
  datastores, secrets, webhooks, budgets, packages, services, memory, and
24
- models. Six sensitive permissions have an additional role requirement:
24
+ models. Seven sensitive permissions have an additional role requirement:
25
25
 
26
26
  - `agents:admin` requires the Wardby `admin` role.
27
27
  - `packages:approve` requires the `admin` or `package-approver` role.
@@ -31,6 +31,9 @@ models. Six sensitive permissions have an additional role requirement:
31
31
  - `models:admin` requires the `admin` or `model-manager` role. It adds,
32
32
  overrides, disables, and resets model catalog entries; see
33
33
  [Models and pricing](models.md).
34
+ - `hosts:admin` requires the `admin` or `host-manager` role. It registers host
35
+ providers, approves their tools and, with `secrets:write`, replaces their secrets; see
36
+ [Host providers](../docs/host-providers.md).
34
37
  - `power:manage` requires the `admin` role. It reads low-power state and
35
38
  sleeps the coding proxy and native gateway now (`power_status`,
36
39
  `power_sleep`); see
@@ -0,0 +1,73 @@
1
+ ---
2
+ id: mcp-servers
3
+ title: Remote MCP server tools for native and coding agents
4
+ summary: Register a remote MCP server, then attach an allowlist of its tools to a native, Claude Code or Codex agent; credentials stay in brokered secrets.
5
+ audience: operator
6
+ tags: [mcp, mcp server, coding-agent, codex, register_mcp_server, attach_mcp_server, readOnlyHint, WARDBY_MCP_SERVERS]
7
+ appliesTo: ">=0.8.0"
8
+ ---
9
+
10
+ # Remote MCP server tools for native and coding agents
11
+
12
+ A native, Claude Code or Codex agent can call tools from a remote MCP server (Streamable HTTP, HTTPS only).
13
+
14
+ 1. Create a [brokered secret](brokered-secrets.md) for the server's host, for example
15
+ `Authorization: Bearer {value}`.
16
+ 2. `register_mcp_server` with a `name`, the `url` (`https://mcp.example.com/mcp`) and
17
+ `secretNames`. Wardby saves the server's tool list.
18
+ 3. `attach_mcp_server` with the agent, the server and `allowedTools` (exact names, at least one).
19
+ The agent sees each as `<server name>__<tool name>`.
20
+ 4. After the server changes its tools, `refresh_mcp_server` applies the new list at once. Allowed
21
+ tools the server dropped show as `missingTools` in `get_agent`.
22
+
23
+ Each call has `callTimeoutMs` (default `30000`, at most `WARDBY_TOOL_MAX_TIMEOUT_MS`, and never
24
+ past the run's deadline). Results are untrusted input; the allowlist is the control. stdio servers
25
+ and OAuth are not supported.
26
+
27
+ `WARDBY_MCP_SERVERS` is `owners` (default), `admins` (registering needs `hosts:admin`) or `off`
28
+ (only `detach_mcp_server` and `delete_mcp_server` still work, for cleanup).
29
+
30
+ Each call opens a fresh MCP session, so a server that keeps state between calls in one session
31
+ won't see it. Arguments that aren't a JSON object return `invalid_arguments`.
32
+
33
+ ## Coding agents
34
+
35
+ `attach_mcp_server` also takes a Claude Code or Codex agent. Its run reaches the tools only through
36
+ the coding proxy and the native gateway; the worker never sees the server's URL or secrets.
37
+
38
+ - Claude Code agents see each tool as `mcp__wardby_mcp__<server name>__<tool name>` and may use any
39
+ allowed tool.
40
+ - Codex agents may use only tools the server marks `readOnlyHint: true`. Wardby checks this when
41
+ you attach, when a run loads and on every call. Repository code in a Codex run can read the run's
42
+ MCP token, so a Codex agent must not be given tools that change things. `readOnlyHint` is the
43
+ server's claim, which Wardby can't verify, so the allowlist stays your control.
44
+ - A run may make `WARDBY_MCP_MAX_CALLS_PER_RUN` calls (default `100`, failed calls count); more are
45
+ refused with [`mcp_call_limit`](errors/mcp-call-limit.md).
46
+ - The proxy needs `WARDBY_MCP_GATEWAY_URL`. Without it coding agents get no MCP tools
47
+ ([`mcp_unavailable`](errors/mcp-unavailable.md)).
48
+ - MCP for coding agents needs this release's Claude worker image and a new Codex driver image.
49
+ Older images get no MCP tools, and runs don't fail.
50
+ - A repository's MCP configuration is still never loaded.
51
+ - Codex models that use tool search load MCP tools on demand. They need this release's coding
52
+ proxy; an older one refuses their requests with `openai_tool_not_allowed:tool_search`.
53
+ - Switching an agent to Codex with `update_agent` keeps its attachments, but tools not marked
54
+ read-only won't reach Codex runs; the result's `warnings` names them.
55
+ - The proxy gives up on a coding run's MCP call after 5 minutes, whatever
56
+ `WARDBY_TOOL_MAX_TIMEOUT_MS` says ([`mcp_unavailable`](errors/mcp-unavailable.md)).
57
+
58
+ Share a server with `grant_access` (`resourceType: "mcp_server"`; needs the `agents:write` scope,
59
+ registering needs `tools:write`). `use` lets the grantee attach it, and its tools then run with your
60
+ secrets. Revoking the grant, or lowering it to `read`, detaches the server from the grantee's agents
61
+ at once, and their runs' next call is refused with `mcp_tool_not_allowed`.
62
+
63
+ Errors a call can return: [`mcp_server_unreachable`](errors/mcp-server-unreachable.md),
64
+ [`mcp_server_auth_failed`](errors/mcp-server-auth-failed.md),
65
+ [`mcp_server_credentials_unavailable`](errors/mcp-server-credentials-unavailable.md),
66
+ [`mcp_server_error`](errors/mcp-server-error.md),
67
+ [`mcp_tool_not_allowed`](errors/mcp-tool-not-allowed.md),
68
+ [`mcp_tool_removed`](errors/mcp-tool-removed.md),
69
+ [`mcp_call_timeout`](errors/mcp-call-timeout.md),
70
+ [`mcp_servers_off`](errors/mcp-servers-off.md), and for coding agents
71
+ [`mcp_call_limit`](errors/mcp-call-limit.md) and [`mcp_unavailable`](errors/mcp-unavailable.md).
72
+
73
+ Full guide: [Remote MCP servers](../docs/mcp-servers.md).
package/help/mcp.md CHANGED
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  id: mcp-access
3
- title: Connect an MCP client
3
+ title: Connect a client to Wardby
4
4
  summary: Use Wardby's local stdio or protected HTTP MCP transport safely.
5
5
  audience: developer
6
6
  tags: [mcp, oauth, codex, claude-code]
7
7
  appliesTo: >=0.2.1
8
8
  ---
9
9
 
10
- # Connect an MCP client
10
+ # Connect a client to Wardby
11
11
 
12
12
  For local use, `wardby quickstart` can register the local stdio MCP server with
13
13
  Codex or Claude Code. Local stdio trusts the local operator.
@@ -28,3 +28,8 @@ offline catalog as `wardby help`; they expose no instance data or credentials.
28
28
 
29
29
  See [`docs/getting-started-identity-provider.md`](../docs/getting-started-identity-provider.md)
30
30
  for the supported self-hosted and delegated identity-provider setup.
31
+
32
+ From Wardby 0.8.0, Claude Code can show your runs in a pane beside the chat
33
+ through the `wardby-runs` plugin: run `wardby claude-plugin install`, then
34
+ `/wardby-runs`. Search help for "claude code plugin" (article
35
+ `claude-code-run-pane`, Wardby 0.8.0 and later).
@@ -3,7 +3,7 @@ id: native-capabilities
3
3
  title: Use native agents, tools, and data
4
4
  summary: Attach scoped tools, secrets, datastores, memory, schedules, and sub-agents to a native Wardby agent.
5
5
  audience: developer
6
- tags: [agents, tools, secrets, datastores, memory, schedules, subagents, zod, paramsZod, create_tool, dry_run_tool]
6
+ tags: [agents, tools, secrets, datastores, memory, schedules, subagents, zod, create_tool, dry_run_tool, timeoutMs, mcp]
7
7
  appliesTo: >=0.2.1
8
8
  ---
9
9
 
@@ -48,11 +48,37 @@ rewrite the schema with the Zod 4 API (for example `z.looseObject()` for
48
48
  `.nonstrict()`, `z.string().optional()` for `z.ostring()`, and `z.ipv4()` or
49
49
  `z.ipv6()` for `.ip()`), dry-run it again, and save it with `update_tool`.
50
50
 
51
+ ## Tool time limits
52
+
53
+ Wardby 0.8.0 and later. Each call of a tool has 10 seconds by default. A tool that calls a slow API can
54
+ ask for more with `timeoutMs` (milliseconds, at least `1000`) on `create_tool`,
55
+ `update_tool` or `dry_run_tool`, or `--timeout-ms` on `wardby tool create` and
56
+ `wardby tool update`. Pass `timeoutMs: null` to `update_tool` (or
57
+ `--timeout-ms default` to `wardby tool update`) to go back to the default.
58
+
59
+ - The limit covers the whole call. Each `fetch` may run until the limit, and a
60
+ timer (`setTimeout`) can't be set for longer than it.
61
+ - The server's `WARDBY_TOOL_MAX_TIMEOUT_MS` (default `300000`, five minutes)
62
+ caps it. A larger `timeoutMs` is refused with an error naming the ceiling. If
63
+ the operator lowers the ceiling later, existing tools run with the ceiling.
64
+ - A run keeps the value it loaded, as it does the tool's code.
65
+ - A call never outlasts its run: stopping the run aborts it, and a sandboxed
66
+ run's deadline cuts it off.
67
+ - `list_tools` and `get_agent` show each tool's `timeoutMs` (`null` means the
68
+ default).
69
+
70
+ Test a slow tool with `dry_run_tool` and the same `timeoutMs` before you attach
71
+ it. A call that runs out of time fails with a `timeout` error; the help article
72
+ `errors/tool-timeout` explains what to do.
73
+
51
74
  Use a budget or shared budget group on every agent, and inspect runs before
52
75
  expanding its access. An access grant is intentional delegation: use it only
53
76
  when an owner permits one agent to use another resource. Creating or changing
54
77
  tools, secrets, datastores, schedules, webhooks, memory, and budget groups
55
78
  requires the matching MCP scope.
56
79
 
80
+ Native agents can also call tools from remote MCP servers; see
81
+ [Remote MCP servers](../docs/mcp-servers.md) (0.8.0+).
82
+
57
83
  See [Operate agents](operating-agents.md) for run and budget management, and
58
84
  [`README.md`](../README.md) for the feature overview and MCP operations.
@@ -4,7 +4,7 @@ title: Run native agents in a sandbox
4
4
  summary: Turn on sandbox mode so a native agent's turn loop and tools run in a single-use, credential-free Docker container or Kubernetes pod behind a native gateway.
5
5
  audience: operator
6
6
  tags: [native-agents, sandbox, isolation, docker, kubernetes, native-gateway, security, warm-pool]
7
- appliesTo: ">=0.5.4"
7
+ appliesTo: ">=0.6.0"
8
8
  ---
9
9
 
10
10
  # Run native agents in a sandbox
@@ -32,6 +32,22 @@ A running run's cost, token counts, and turn count update after each model
32
32
  call, so `get_run` and `list_runs` show spend so far rather than zero until the
33
33
  run finishes.
34
34
 
35
+ To see your runs across every agent, call `list_runs` without an `agentId`
36
+ (Wardby 0.8.0 and later). Each row names its agent and leaves out the final
37
+ text; `active: true` keeps pending and running runs, and `since` (an ISO time)
38
+ keeps runs that started or finished since then plus any still active. You see
39
+ every run of the agents you own and only the runs you started on the others.
40
+ `list_agents` with `summary: true` returns just each agent's id, name, kind,
41
+ model, coding provider, budget, owner and your access, without the full
42
+ configuration.
43
+
44
+ From Wardby 0.8.0, `get_run` and `list_runs` without an `agentId` also return
45
+ `triggerInfo` (the pull request or issue that started the run, and whether it
46
+ was a review or a mention), `outcomes` (pull requests opened, comments, checks)
47
+ and `serviceReadiness` (each coding-run service's state). They use the admin
48
+ viewer API's shapes. Match one run's pull-request outcome to another run's
49
+ trigger to follow a pull request through its review and fix rounds.
50
+
35
51
  To stop a run that is pending, queued, or running (for example one a schedule
36
52
  started that you did not want), call `stop_run` with its id. It ends as
37
53
  `cancelled`, along with the sub-agent runs it still has in flight. Search help
@@ -128,15 +128,19 @@ such hints: a fix round's task names only its own pull request. Merged and
128
128
  closed pull requests are never listed as continuable: a change there needs a
129
129
  new pull request, which joins the set once it is recorded.
130
130
 
131
+ When the sub-agent is a coding agent with a list of repositories, a
132
+ follow-up delegation passes `continuePriorRun` and takes its repository from
133
+ that run, so it needs no `repository` of its own.
134
+
131
135
  Give your own delivery or router agent's system prompt a line such as:
132
136
 
133
137
  Continue the pull request you were asked about, and any listed open
134
138
  sibling the change requires; never open a new pull request in a
135
139
  repository that already has an open sibling for this request.
136
140
 
137
- The usual limits still apply: `maxDelegationsPerRun` and never delegating to
138
- the same sub-agent twice in one run; every push to a sibling pull request
139
- gets its own review; fix rounds are capped per pull request and only one
141
+ The usual limits still apply: `maxDelegationsPerRun` and delegating to each
142
+ sub-agent and repository at most once per run; every push to a sibling pull
143
+ request gets its own review; fix rounds are capped per pull request and only one
140
144
  runs at a time on a pull request; and a continuation only ever reaches a
141
145
  sub-agent that shares the same owner as the one asked to continue it.
142
146
 
@@ -4,7 +4,7 @@ title: Repository instructions and skills in coding runs
4
4
  summary: What AGENTS.md, CLAUDE.md, and repo skills a coding run loads, and how to turn repo skills off per agent with codingProfile.repoSkills.
5
5
  audience: all
6
6
  tags: [coding, skills, repoSkills, claudeBareMode, CLAUDE.md, AGENTS.md, SKILL.md, codex, claude-code]
7
- appliesTo: ">=0.5.4"
7
+ appliesTo: ">=0.6.0"
8
8
  ---
9
9
 
10
10
  # Repository instructions and skills in coding runs
@@ -81,6 +81,8 @@ never loaded in either mode.
81
81
 
82
82
  ## See also
83
83
 
84
+ - [Remote MCP servers](../docs/mcp-servers.md) (0.8.0+) are for native agents only; a coding run loads no
85
+ MCP configuration.
84
86
  - [Choose a native or coding agent](creating-agents.md) for `codingProfile`
85
87
  basics and the other fields it accepts.
86
88
  - [Bring-Your-Own Coding-Worker Images](../docs/coding-worker-byo-images.md)
@@ -129,3 +129,6 @@ or its runs fail at input with `worker_input_failed`.
129
129
 
130
130
  Full setup: [Resume a run locally](../docs/coding-agent-setup.md#resume-a-run-locally).
131
131
  See also [Choose a native or coding agent](help://creating-agents).
132
+
133
+ The `wardby-runs` Claude Code plugin can start the import from a run's detail
134
+ (**Continue locally**); see `claude-code-run-pane` (Wardby 0.8.0 and later).
package/help/stop-run.md CHANGED
@@ -28,7 +28,7 @@ in its `stopRequestReason` (and, for a native run, in its `error`).
28
28
  | The run is | `stop_run` |
29
29
  | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
30
30
  | Pending, or a coding run queued for a slot | Ends it now. It never starts. |
31
- | A running native run in the control plane | Ends it now; the run stops at its next step (the model turn or tool call already under way finishes first). |
31
+ | A running native run in the control plane | Ends it now; the run stops at its next step. A model turn already under way finishes first; a tool call already under way is aborted within a few seconds. |
32
32
  | A running native run in the sandbox | Ends it now and ends its gateway session, so the worker's next call is refused and it exits. A worker still running after a short grace (5 seconds) is killed and removed; a warm pool worker is never reused. |
33
33
  | A running coding run | Ends it, cancels its model proxy session, and stops and removes its worker. It opens or updates no pull request afterwards. |
34
34
  | Already finished (any other status) | Changes nothing and returns its status. Calling `stop_run` again is safe. |
@@ -3,7 +3,7 @@ id: troubleshooting/coding-workers
3
3
  title: Troubleshoot coding workers
4
4
  summary: Investigate coding-worker setup, isolation preflight, and safe failure handling.
5
5
  audience: operator
6
- tags: [coding-agents, quota, coding_queue_timeout, docker, kubernetes, isolation, services, debug-trace, debugTraceMinutes, debugTraceMaxMb, maxOutputTokens, output-tokens, claude-code, codex, memory, CODING_MEMORY_MB, CODING_CPUS, out-of-memory]
6
+ tags: [coding-agents, get_run, request, requestUnavailable, quota, coding_queue_timeout, docker, kubernetes, isolation, services, debug-trace, debugTraceMinutes, debugTraceMaxMb, maxOutputTokens, output-tokens, claude-code, codex, memory, CODING_MEMORY_MB, CODING_CPUS, out-of-memory]
7
7
  appliesTo: >=0.2.1
8
8
  ---
9
9
 
@@ -95,6 +95,14 @@ commands run in a tool-runner container limited to at most 512 MiB and 0.25 CPU.
95
95
  3. For a Claude Code agent with heavy checks, run it on Codex instead, since raising
96
96
  the pod's memory doesn't raise the tool runner's limit.
97
97
 
98
+ ## See what a run was asked to do
99
+
100
+ From Wardby 0.8.0, `get_run` returns a coding run's `request`: the task it
101
+ received from `trigger_agent`, a webhook or a lead, without the agent's standing
102
+ instructions. Use it to check what a lead told a coding agent. The agent's secret
103
+ values and token-shaped values are masked. If the secrets can't be read, you get
104
+ `requestUnavailable: true` instead of the text.
105
+
98
106
  ## Debug trace
99
107
 
100
108
  When a run's fixed error code or a slow run doesn't say enough, an admin can
@@ -0,0 +1,29 @@
1
+ ---
2
+ id: troubleshooting/debugging-agent-runs
3
+ title: Debug an agent run
4
+ summary: Triage a run that failed, opened no pull request, or missed what you expected, using the MCP tools and GitHub without server logs.
5
+ audience: operator
6
+ tags: [debugging, triage, get_run, list_runs, failureCategory, diagnosticId, get_run_transcript, no_changes]
7
+ appliesTo: >=0.7.0
8
+ ---
9
+
10
+ # Debug an agent run
11
+
12
+ Find the run with `list_runs`, read it with `get_run`, then follow what you see.
13
+ Without an `agentId`, `list_runs` lists your runs across every agent (from
14
+ Wardby 0.8.0); add `active: true` or `since` to narrow it.
15
+
16
+ | What you see | What to check |
17
+ | ----------------------------- | -------------------------------------------------------------------------------------------------- |
18
+ | No run started | `list_repositories` on the router: is a link holding the trigger you used? |
19
+ | Failed or refused | `status`, `error`, `failureCategory` and the final text. Call `search_help` with the category |
20
+ | Lead ran, no coding run | The lead's final text, which should say why it didn't delegate |
21
+ | Succeeded, no pull request | `codingResult.outcome`: `no_changes`, `budget_exhausted`, or `branch_pushed` on a local repository |
22
+ | Pull request missed the point | The diff, the review, the original request, and `request` on `get_run` (from Wardby 0.8.0) |
23
+
24
+ A failed coding run's specific reason is only in the server log. Send an operator
25
+ the run ID and its `diagnosticId`. For Claude Code agents with `sessionResume` on,
26
+ `get_run_transcript` shows what the agent did; see
27
+ [Resume Claude Code runs locally](../resume-runs-locally.md).
28
+
29
+ The full guide is [Debugging an agent run](../../docs/debugging-agent-runs.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wardby/cli",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Self-hosted control plane for budget-guarded AI agents.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/wardby/wardby#readme",
@@ -158,6 +158,7 @@
158
158
  },
159
159
  "overrides": {
160
160
  "deepmerge-ts": "8.0.2",
161
+ "minimatch": "11.0.3",
161
162
  "mysql2": "3.24.4",
162
163
  "uuid": "11.1.1"
163
164
  }
@@ -0,0 +1,56 @@
1
+ -- Tool-backed host providers: config and approved snapshots. No secret values.
2
+ CREATE TABLE "HostProvider" (
3
+ "name" TEXT NOT NULL,
4
+ "contractVersion" INTEGER NOT NULL,
5
+ "gitHost" TEXT NOT NULL,
6
+ "apiHosts" TEXT[],
7
+ "gitUsername" TEXT NOT NULL,
8
+ "pullRequestUrlTemplate" TEXT NOT NULL,
9
+ "repositoryApiPath" TEXT NOT NULL,
10
+ "permissionApiPath" TEXT,
11
+ "webhook" JSONB NOT NULL,
12
+ "webhookSecretId" TEXT NOT NULL,
13
+ "permissionSecretId" TEXT,
14
+ "createdById" TEXT NOT NULL,
15
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
16
+ "updatedAt" TIMESTAMP(3) NOT NULL,
17
+ CONSTRAINT "HostProvider_pkey" PRIMARY KEY ("name")
18
+ );
19
+
20
+ CREATE TABLE "HostProviderOperation" (
21
+ "provider" TEXT NOT NULL,
22
+ "operation" TEXT NOT NULL,
23
+ "toolId" TEXT,
24
+ "code" TEXT NOT NULL,
25
+ "paramsZod" TEXT NOT NULL,
26
+ "approvedById" TEXT NOT NULL,
27
+ "approvedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
28
+ CONSTRAINT "HostProviderOperation_pkey" PRIMARY KEY ("provider", "operation")
29
+ );
30
+
31
+ CREATE TABLE "HostProviderCredential" (
32
+ "id" TEXT NOT NULL,
33
+ "provider" TEXT NOT NULL,
34
+ "repositoryPattern" TEXT NOT NULL,
35
+ "secretId" TEXT NOT NULL,
36
+ "credentialKind" TEXT NOT NULL DEFAULT 'static',
37
+ CONSTRAINT "HostProviderCredential_pkey" PRIMARY KEY ("id")
38
+ );
39
+
40
+ CREATE TABLE "HostProviderTrustedAccount" (
41
+ "provider" TEXT NOT NULL,
42
+ "accountId" TEXT NOT NULL,
43
+ "addedById" TEXT NOT NULL,
44
+ "addedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
45
+ CONSTRAINT "HostProviderTrustedAccount_pkey" PRIMARY KEY ("provider", "accountId")
46
+ );
47
+
48
+ CREATE UNIQUE INDEX "HostProviderCredential_provider_repositoryPattern_key" ON "HostProviderCredential"("provider", "repositoryPattern");
49
+
50
+ ALTER TABLE "HostProvider" ADD CONSTRAINT "HostProvider_webhookSecretId_fkey" FOREIGN KEY ("webhookSecretId") REFERENCES "Secret"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
51
+ ALTER TABLE "HostProvider" ADD CONSTRAINT "HostProvider_permissionSecretId_fkey" FOREIGN KEY ("permissionSecretId") REFERENCES "Secret"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
52
+ ALTER TABLE "HostProviderOperation" ADD CONSTRAINT "HostProviderOperation_provider_fkey" FOREIGN KEY ("provider") REFERENCES "HostProvider"("name") ON DELETE CASCADE ON UPDATE CASCADE;
53
+ ALTER TABLE "HostProviderOperation" ADD CONSTRAINT "HostProviderOperation_toolId_fkey" FOREIGN KEY ("toolId") REFERENCES "Tool"("id") ON DELETE SET NULL ON UPDATE CASCADE;
54
+ ALTER TABLE "HostProviderCredential" ADD CONSTRAINT "HostProviderCredential_provider_fkey" FOREIGN KEY ("provider") REFERENCES "HostProvider"("name") ON DELETE CASCADE ON UPDATE CASCADE;
55
+ ALTER TABLE "HostProviderCredential" ADD CONSTRAINT "HostProviderCredential_secretId_fkey" FOREIGN KEY ("secretId") REFERENCES "Secret"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
56
+ ALTER TABLE "HostProviderTrustedAccount" ADD CONSTRAINT "HostProviderTrustedAccount_provider_fkey" FOREIGN KEY ("provider") REFERENCES "HostProvider"("name") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,5 @@
1
+ -- A coding agent may work in several repositories: each link can name its own base
2
+ -- branch, and a run records that its repository came from a link.
3
+ ALTER TABLE "AgentRepository" ADD COLUMN "baseRef" TEXT;
4
+ ALTER TABLE "CodingRun" ADD COLUMN "viaRepositoryLink" BOOLEAN NOT NULL DEFAULT false;
5
+ ALTER TABLE "NativeGatewayCall" ADD COLUMN "childRepository" TEXT;
@@ -0,0 +1,4 @@
1
+ -- A sandboxed tool may set its own time limit per call, in milliseconds. Null keeps the
2
+ -- default limit. A host provider's approved snapshot of a tool keeps the value it approved.
3
+ ALTER TABLE "Tool" ADD COLUMN "timeoutMs" INTEGER;
4
+ ALTER TABLE "HostProviderOperation" ADD COLUMN "timeoutMs" INTEGER;
@@ -0,0 +1,33 @@
1
+ -- Remote MCP servers an owner registers, and their attachments to native agents.
2
+ CREATE TABLE "McpServer" (
3
+ "id" TEXT NOT NULL,
4
+ "ownerId" TEXT NOT NULL,
5
+ "name" TEXT NOT NULL,
6
+ "url" TEXT NOT NULL,
7
+ "secretNames" TEXT[] DEFAULT ARRAY[]::TEXT[],
8
+ "toolSnapshot" JSONB NOT NULL DEFAULT '[]',
9
+ "snapshotAt" TIMESTAMP(3),
10
+ "serverInfo" JSONB,
11
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
12
+ "updatedAt" TIMESTAMP(3) NOT NULL,
13
+ CONSTRAINT "McpServer_pkey" PRIMARY KEY ("id")
14
+ );
15
+
16
+ CREATE TABLE "AgentMcpServer" (
17
+ "agentId" TEXT NOT NULL,
18
+ "serverId" TEXT NOT NULL,
19
+ "allowedTools" TEXT[],
20
+ "callTimeoutMs" INTEGER,
21
+ "attachedById" TEXT NOT NULL,
22
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
23
+ "updatedAt" TIMESTAMP(3) NOT NULL,
24
+ CONSTRAINT "AgentMcpServer_pkey" PRIMARY KEY ("agentId", "serverId")
25
+ );
26
+
27
+ CREATE UNIQUE INDEX "McpServer_ownerId_name_key" ON "McpServer"("ownerId", "name");
28
+ CREATE INDEX "McpServer_ownerId_idx" ON "McpServer"("ownerId");
29
+ CREATE INDEX "AgentMcpServer_serverId_idx" ON "AgentMcpServer"("serverId");
30
+
31
+ ALTER TABLE "McpServer" ADD CONSTRAINT "McpServer_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "Principal"("id") ON DELETE CASCADE ON UPDATE CASCADE;
32
+ ALTER TABLE "AgentMcpServer" ADD CONSTRAINT "AgentMcpServer_agentId_fkey" FOREIGN KEY ("agentId") REFERENCES "Agent"("id") ON DELETE CASCADE ON UPDATE CASCADE;
33
+ ALTER TABLE "AgentMcpServer" ADD CONSTRAINT "AgentMcpServer_serverId_fkey" FOREIGN KEY ("serverId") REFERENCES "McpServer"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,5 @@
1
+ -- Coding runs: pinned MCP tools, the MCP token's hash, and a call counter.
2
+ ALTER TABLE "CodingProxySession" ADD COLUMN "mcpTools" JSONB;
3
+ ALTER TABLE "CodingProxySession" ADD COLUMN "mcpTokenHash" TEXT;
4
+ ALTER TABLE "CodingProxySession" ADD COLUMN "mcpCallCount" INTEGER NOT NULL DEFAULT 0;
5
+ CREATE UNIQUE INDEX "CodingProxySession_mcpTokenHash_key" ON "CodingProxySession"("mcpTokenHash");
@@ -0,0 +1,3 @@
1
+ -- The run-drivability and cancelled-task lookups filter Task on (runId, status); the drivability
2
+ -- check runs on every coding MCP request.
3
+ CREATE INDEX "Task_runId_status_idx" ON "Task"("runId", "status");