@wardby/cli 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. package/.env.example +34 -4
  2. package/README.md +183 -71
  3. package/dist/claude-coding-worker/driver.d.ts +7 -1
  4. package/dist/claude-coding-worker/driver.js +31 -2
  5. package/dist/claude-coding-worker/main.js +5 -2
  6. package/dist/claude-coding-worker/tool-socket.d.ts +9 -0
  7. package/dist/claude-coding-worker/tool-socket.js +26 -0
  8. package/dist/cli-help.d.ts +1 -1
  9. package/dist/cli-help.js +13 -4
  10. package/dist/cli.d.ts +1 -1
  11. package/dist/cli.js +219 -29
  12. package/dist/coding/collect-exclude.d.ts +25 -0
  13. package/dist/coding/collect-exclude.js +76 -0
  14. package/dist/coding/profile.d.ts +67 -22
  15. package/dist/coding/profile.js +58 -25
  16. package/dist/coding/protected-path-wording.d.ts +24 -0
  17. package/dist/coding/protected-path-wording.js +55 -0
  18. package/dist/coding/protected-paths.d.ts +31 -0
  19. package/dist/coding/protected-paths.js +48 -0
  20. package/dist/coding/protocol.d.ts +99 -3
  21. package/dist/coding/protocol.js +155 -4
  22. package/dist/coding/registry/adapters.d.ts +2 -0
  23. package/dist/coding/registry/adapters.js +9 -0
  24. package/dist/coding/registry/allowlist.d.ts +9 -0
  25. package/dist/coding/registry/allowlist.js +28 -0
  26. package/dist/coding/registry/json-scan.d.ts +55 -0
  27. package/dist/coding/registry/json-scan.js +191 -0
  28. package/dist/coding/registry/lockfiles.d.ts +6 -0
  29. package/dist/coding/registry/lockfiles.js +89 -0
  30. package/dist/coding/registry/npm-lockfile.d.ts +9 -0
  31. package/dist/coding/registry/npm-lockfile.js +73 -0
  32. package/dist/coding/registry/npm-plan.d.ts +29 -0
  33. package/dist/coding/registry/npm-plan.js +289 -0
  34. package/dist/coding/registry/npm.d.ts +7 -0
  35. package/dist/coding/registry/npm.js +252 -0
  36. package/dist/coding/registry/pypi.d.ts +4 -0
  37. package/dist/coding/registry/pypi.js +210 -0
  38. package/dist/coding/registry/report.d.ts +37 -0
  39. package/dist/coding/registry/report.js +31 -0
  40. package/dist/coding/registry/token.d.ts +4 -0
  41. package/dist/coding/registry/token.js +7 -0
  42. package/dist/coding/registry/types.d.ts +286 -0
  43. package/dist/coding/registry/types.js +19 -0
  44. package/dist/coding/registry/worker-config.d.ts +14 -0
  45. package/dist/coding/registry/worker-config.js +31 -0
  46. package/dist/coding/services/builtins.d.ts +22 -0
  47. package/dist/coding/services/builtins.js +85 -0
  48. package/dist/coding/services/catalog.d.ts +443 -0
  49. package/dist/coding/services/catalog.js +159 -0
  50. package/dist/coding/services/declaration.d.ts +11 -0
  51. package/dist/coding/services/declaration.js +114 -0
  52. package/dist/coding/services/note.d.ts +8 -0
  53. package/dist/coding/services/note.js +15 -0
  54. package/dist/coding/services/resolve.d.ts +25 -0
  55. package/dist/coding/services/resolve.js +50 -0
  56. package/dist/coding/services/wording.d.ts +25 -0
  57. package/dist/coding/services/wording.js +70 -0
  58. package/dist/coding-proxy/main.js +24 -4
  59. package/dist/coding-worker/artifact.d.ts +18 -0
  60. package/dist/coding-worker/artifact.js +48 -6
  61. package/dist/coding-worker/debug-trace.d.ts +37 -0
  62. package/dist/coding-worker/debug-trace.js +117 -0
  63. package/dist/coding-worker/driver.d.ts +14 -1
  64. package/dist/coding-worker/driver.js +106 -14
  65. package/dist/coding-worker/errors.d.ts +7 -0
  66. package/dist/coding-worker/errors.js +26 -0
  67. package/dist/coding-worker/main.js +13 -4
  68. package/dist/coding-worker/sdk.d.ts +2 -2
  69. package/dist/coding-worker/sdk.js +7 -2
  70. package/dist/coding-worker/types.d.ts +3 -0
  71. package/dist/config/providers.d.ts +41 -0
  72. package/dist/config/providers.js +66 -0
  73. package/dist/core/budget-groups.d.ts +109 -6
  74. package/dist/core/budget-groups.js +125 -19
  75. package/dist/core/budget-wording.d.ts +22 -0
  76. package/dist/core/budget-wording.js +55 -0
  77. package/dist/core/coding-queue.d.ts +1 -1
  78. package/dist/core/datastores.d.ts +1 -1
  79. package/dist/core/datastores.js +18 -2
  80. package/dist/core/db.d.ts +40 -2
  81. package/dist/core/db.js +75 -2
  82. package/dist/core/dispatch.d.ts +49 -7
  83. package/dist/core/dispatch.js +290 -45
  84. package/dist/core/engine-native.js +27 -10
  85. package/dist/core/grants.d.ts +86 -0
  86. package/dist/core/grants.js +126 -0
  87. package/dist/core/host-events.d.ts +49 -0
  88. package/dist/core/host-events.js +257 -0
  89. package/dist/core/host-identity-links.d.ts +54 -0
  90. package/dist/core/host-identity-links.js +189 -0
  91. package/dist/core/host-status.d.ts +61 -0
  92. package/dist/core/host-status.js +211 -0
  93. package/dist/core/http-runtime.js +3 -4
  94. package/dist/core/in-flight-runs.d.ts +8 -0
  95. package/dist/core/in-flight-runs.js +56 -0
  96. package/dist/core/lease.d.ts +1 -1
  97. package/dist/core/private-directory.d.ts +20 -0
  98. package/dist/core/private-directory.js +36 -0
  99. package/dist/core/provider-wording.d.ts +12 -0
  100. package/dist/core/provider-wording.js +44 -0
  101. package/dist/core/reconciler.d.ts +39 -3
  102. package/dist/core/reconciler.js +86 -2
  103. package/dist/core/repo-access.d.ts +99 -0
  104. package/dist/core/repo-access.js +136 -0
  105. package/dist/core/review-host-checks.d.ts +11 -0
  106. package/dist/core/review-host-checks.js +41 -0
  107. package/dist/core/review-host-tools.d.ts +47 -0
  108. package/dist/core/review-host-tools.js +347 -0
  109. package/dist/core/run-heartbeat.d.ts +27 -0
  110. package/dist/core/run-heartbeat.js +54 -0
  111. package/dist/core/runner.d.ts +31 -9
  112. package/dist/core/runner.js +237 -40
  113. package/dist/core/scheduler.d.ts +1 -1
  114. package/dist/core/secrets.d.ts +12 -3
  115. package/dist/core/secrets.js +25 -6
  116. package/dist/core/subagent-memory-tools.d.ts +2 -2
  117. package/dist/core/subagent-memory-tools.js +16 -3
  118. package/dist/core/tool-admin.d.ts +81 -0
  119. package/dist/core/tool-admin.js +129 -0
  120. package/dist/core/tool-names.d.ts +42 -0
  121. package/dist/core/tool-names.js +64 -0
  122. package/dist/core/untrusted-content.d.ts +32 -0
  123. package/dist/core/untrusted-content.js +72 -0
  124. package/dist/core/webhooks.d.ts +9 -2
  125. package/dist/core/webhooks.js +23 -2
  126. package/dist/generated/prisma/browser.d.ts +328 -0
  127. package/dist/generated/prisma/browser.js +17 -0
  128. package/dist/generated/prisma/client.d.ts +347 -0
  129. package/dist/generated/prisma/client.js +34 -0
  130. package/dist/generated/prisma/commonInputTypes.d.ts +839 -0
  131. package/dist/generated/prisma/commonInputTypes.js +10 -0
  132. package/dist/generated/prisma/enums.d.ts +59 -0
  133. package/dist/generated/prisma/enums.js +59 -0
  134. package/dist/generated/prisma/internal/class.d.ts +605 -0
  135. package/dist/generated/prisma/internal/class.js +49 -0
  136. package/dist/generated/prisma/internal/prismaNamespace.d.ts +4494 -0
  137. package/dist/generated/prisma/internal/prismaNamespace.js +628 -0
  138. package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts +635 -0
  139. package/dist/generated/prisma/internal/prismaNamespaceBrowser.js +599 -0
  140. package/dist/generated/prisma/models/Agent.d.ts +3560 -0
  141. package/dist/generated/prisma/models/Agent.js +1 -0
  142. package/dist/generated/prisma/models/AgentDatastore.d.ts +1210 -0
  143. package/dist/generated/prisma/models/AgentDatastore.js +1 -0
  144. package/dist/generated/prisma/models/AgentMemory.d.ts +986 -0
  145. package/dist/generated/prisma/models/AgentMemory.js +1 -0
  146. package/dist/generated/prisma/models/AgentRepository.d.ts +1425 -0
  147. package/dist/generated/prisma/models/AgentRepository.js +1 -0
  148. package/dist/generated/prisma/models/AgentSecret.d.ts +1212 -0
  149. package/dist/generated/prisma/models/AgentSecret.js +1 -0
  150. package/dist/generated/prisma/models/AgentSubAgent.d.ts +1217 -0
  151. package/dist/generated/prisma/models/AgentSubAgent.js +1 -0
  152. package/dist/generated/prisma/models/AgentTool.d.ts +1403 -0
  153. package/dist/generated/prisma/models/AgentTool.js +1 -0
  154. package/dist/generated/prisma/models/AuthFormChallenge.d.ts +1298 -0
  155. package/dist/generated/prisma/models/AuthFormChallenge.js +1 -0
  156. package/dist/generated/prisma/models/AuthLoginKey.d.ts +1245 -0
  157. package/dist/generated/prisma/models/AuthLoginKey.js +1 -0
  158. package/dist/generated/prisma/models/AuthRateLimit.d.ts +979 -0
  159. package/dist/generated/prisma/models/AuthRateLimit.js +1 -0
  160. package/dist/generated/prisma/models/AuthSession.d.ts +1376 -0
  161. package/dist/generated/prisma/models/AuthSession.js +1 -0
  162. package/dist/generated/prisma/models/AuthUser.d.ts +1700 -0
  163. package/dist/generated/prisma/models/AuthUser.js +1 -0
  164. package/dist/generated/prisma/models/BudgetGroup.d.ts +1548 -0
  165. package/dist/generated/prisma/models/BudgetGroup.js +1 -0
  166. package/dist/generated/prisma/models/CodingAgentProfile.d.ts +1681 -0
  167. package/dist/generated/prisma/models/CodingAgentProfile.js +1 -0
  168. package/dist/generated/prisma/models/CodingProxyRequest.d.ts +1749 -0
  169. package/dist/generated/prisma/models/CodingProxyRequest.js +1 -0
  170. package/dist/generated/prisma/models/CodingProxySession.d.ts +1626 -0
  171. package/dist/generated/prisma/models/CodingProxySession.js +1 -0
  172. package/dist/generated/prisma/models/CodingRun.d.ts +3583 -0
  173. package/dist/generated/prisma/models/CodingRun.js +1 -0
  174. package/dist/generated/prisma/models/CodingService.d.ts +1348 -0
  175. package/dist/generated/prisma/models/CodingService.js +1 -0
  176. package/dist/generated/prisma/models/Datastore.d.ts +1434 -0
  177. package/dist/generated/prisma/models/Datastore.js +1 -0
  178. package/dist/generated/prisma/models/DatastoreEntry.d.ts +1314 -0
  179. package/dist/generated/prisma/models/DatastoreEntry.js +1 -0
  180. package/dist/generated/prisma/models/HostEventDelivery.d.ts +946 -0
  181. package/dist/generated/prisma/models/HostEventDelivery.js +1 -0
  182. package/dist/generated/prisma/models/HostIdentity.d.ts +1232 -0
  183. package/dist/generated/prisma/models/HostIdentity.js +1 -0
  184. package/dist/generated/prisma/models/HostIdentityLinkRequest.d.ts +1473 -0
  185. package/dist/generated/prisma/models/HostIdentityLinkRequest.js +1 -0
  186. package/dist/generated/prisma/models/OAuthAuthorizationCode.d.ts +1526 -0
  187. package/dist/generated/prisma/models/OAuthAuthorizationCode.js +1 -0
  188. package/dist/generated/prisma/models/OAuthAuthorizationRequest.d.ts +1350 -0
  189. package/dist/generated/prisma/models/OAuthAuthorizationRequest.js +1 -0
  190. package/dist/generated/prisma/models/OAuthClient.d.ts +1289 -0
  191. package/dist/generated/prisma/models/OAuthClient.js +1 -0
  192. package/dist/generated/prisma/models/OAuthFamily.d.ts +1540 -0
  193. package/dist/generated/prisma/models/OAuthFamily.js +1 -0
  194. package/dist/generated/prisma/models/OAuthGrant.d.ts +1280 -0
  195. package/dist/generated/prisma/models/OAuthGrant.js +1 -0
  196. package/dist/generated/prisma/models/Principal.d.ts +2245 -0
  197. package/dist/generated/prisma/models/Principal.js +1 -0
  198. package/dist/generated/prisma/models/RegistryAllowance.d.ts +1148 -0
  199. package/dist/generated/prisma/models/RegistryAllowance.js +1 -0
  200. package/dist/generated/prisma/models/RegistryApprovedVersion.d.ts +1219 -0
  201. package/dist/generated/prisma/models/RegistryApprovedVersion.js +1 -0
  202. package/dist/generated/prisma/models/RegistryFetch.d.ts +1428 -0
  203. package/dist/generated/prisma/models/RegistryFetch.js +1 -0
  204. package/dist/generated/prisma/models/RegistryPlanRefusal.d.ts +1294 -0
  205. package/dist/generated/prisma/models/RegistryPlanRefusal.js +1 -0
  206. package/dist/generated/prisma/models/RegistryVersionFact.d.ts +1085 -0
  207. package/dist/generated/prisma/models/RegistryVersionFact.js +1 -0
  208. package/dist/generated/prisma/models/ResourceGrant.d.ts +1437 -0
  209. package/dist/generated/prisma/models/ResourceGrant.js +1 -0
  210. package/dist/generated/prisma/models/Run.d.ts +2669 -0
  211. package/dist/generated/prisma/models/Run.js +1 -0
  212. package/dist/generated/prisma/models/RunHostCheck.d.ts +1239 -0
  213. package/dist/generated/prisma/models/RunHostCheck.js +1 -0
  214. package/dist/generated/prisma/models/RunHostStatus.d.ts +1315 -0
  215. package/dist/generated/prisma/models/RunHostStatus.js +1 -0
  216. package/dist/generated/prisma/models/SchedulerLease.d.ts +970 -0
  217. package/dist/generated/prisma/models/SchedulerLease.js +1 -0
  218. package/dist/generated/prisma/models/Secret.d.ts +1399 -0
  219. package/dist/generated/prisma/models/Secret.js +1 -0
  220. package/dist/generated/prisma/models/SecretElicitationOutcome.d.ts +973 -0
  221. package/dist/generated/prisma/models/SecretElicitationOutcome.js +1 -0
  222. package/dist/generated/prisma/models/Task.d.ts +1176 -0
  223. package/dist/generated/prisma/models/Task.js +1 -0
  224. package/dist/generated/prisma/models/Tool.d.ts +1490 -0
  225. package/dist/generated/prisma/models/Tool.js +1 -0
  226. package/dist/generated/prisma/models/Webhook.d.ts +1386 -0
  227. package/dist/generated/prisma/models/Webhook.js +1 -0
  228. package/dist/generated/prisma/models.d.ts +45 -0
  229. package/dist/generated/prisma/models.js +1 -0
  230. package/dist/help/build.d.ts +1 -0
  231. package/dist/help/build.js +9 -0
  232. package/dist/help/catalog.d.ts +24 -0
  233. package/dist/help/catalog.js +160 -0
  234. package/dist/help/cli.d.ts +2 -0
  235. package/dist/help/cli.js +65 -0
  236. package/dist/help/runtime.d.ts +3 -0
  237. package/dist/help/runtime.js +44 -0
  238. package/dist/help/search.d.ts +9 -0
  239. package/dist/help/search.js +104 -0
  240. package/dist/help-index.json +660 -0
  241. package/dist/import/cli-args.js +3 -2
  242. package/dist/import/create.d.ts +6 -1
  243. package/dist/import/create.js +68 -14
  244. package/dist/import/index.d.ts +1 -1
  245. package/dist/import/index.js +19 -9
  246. package/dist/import/neutral-schema.d.ts +11 -11
  247. package/dist/mcp/auth/access.d.ts +70 -0
  248. package/dist/mcp/auth/access.js +58 -0
  249. package/dist/mcp/auth/grants-cli.d.ts +149 -0
  250. package/dist/mcp/auth/grants-cli.js +518 -0
  251. package/dist/mcp/auth/host-account-cli.d.ts +2 -0
  252. package/dist/mcp/auth/host-account-cli.js +47 -0
  253. package/dist/mcp/auth/ownership.d.ts +37 -63
  254. package/dist/mcp/auth/ownership.js +19 -14
  255. package/dist/mcp/auth/principal.d.ts +1 -1
  256. package/dist/mcp/auth/repo-authorization.d.ts +22 -0
  257. package/dist/mcp/auth/repo-authorization.js +51 -0
  258. package/dist/mcp/auth/resource-server.d.ts +32 -3
  259. package/dist/mcp/auth/resource-server.js +84 -3
  260. package/dist/mcp/auth/self-hosted/browser.js +22 -8
  261. package/dist/mcp/auth/self-hosted/cli.d.ts +1 -1
  262. package/dist/mcp/auth/self-hosted/cli.js +47 -13
  263. package/dist/mcp/auth/self-hosted/credentials.d.ts +21 -3
  264. package/dist/mcp/auth/self-hosted/credentials.js +62 -4
  265. package/dist/mcp/auth/self-hosted/rate-limit.d.ts +1 -1
  266. package/dist/mcp/auth/self-hosted/session.d.ts +3 -2
  267. package/dist/mcp/context.d.ts +28 -2
  268. package/dist/mcp/errors.d.ts +25 -6
  269. package/dist/mcp/errors.js +98 -0
  270. package/dist/mcp/host-events/github-ingress.d.ts +36 -0
  271. package/dist/mcp/host-events/github-ingress.js +92 -0
  272. package/dist/mcp/host-events/github-user-callback.d.ts +18 -0
  273. package/dist/mcp/host-events/github-user-callback.js +50 -0
  274. package/dist/mcp/index.d.ts +8 -1
  275. package/dist/mcp/index.js +106 -16
  276. package/dist/mcp/server.d.ts +1 -1
  277. package/dist/mcp/server.js +27 -9
  278. package/dist/mcp/shared/page-style.d.ts +16 -0
  279. package/dist/mcp/shared/page-style.js +129 -0
  280. package/dist/mcp/tasks/manager.d.ts +1 -1
  281. package/dist/mcp/tools/agents.js +447 -49
  282. package/dist/mcp/tools/budget-groups.js +3 -3
  283. package/dist/mcp/tools/datastore.js +23 -16
  284. package/dist/mcp/tools/grants.d.ts +2 -0
  285. package/dist/mcp/tools/grants.js +239 -0
  286. package/dist/mcp/tools/help.d.ts +5 -0
  287. package/dist/mcp/tools/help.js +67 -0
  288. package/dist/mcp/tools/host-accounts.d.ts +2 -0
  289. package/dist/mcp/tools/host-accounts.js +114 -0
  290. package/dist/mcp/tools/memory.d.ts +7 -1
  291. package/dist/mcp/tools/memory.js +5 -5
  292. package/dist/mcp/tools/repositories.d.ts +2 -0
  293. package/dist/mcp/tools/repositories.js +181 -0
  294. package/dist/mcp/tools/runs.d.ts +6 -0
  295. package/dist/mcp/tools/runs.js +60 -6
  296. package/dist/mcp/tools/scheduling.js +4 -7
  297. package/dist/mcp/tools/secret-elicitation-form.d.ts +1 -1
  298. package/dist/mcp/tools/secret-elicitation-form.js +10 -28
  299. package/dist/mcp/tools/secret-elicitation.d.ts +1 -1
  300. package/dist/mcp/tools/secrets.js +18 -6
  301. package/dist/mcp/tools/services.d.ts +2 -0
  302. package/dist/mcp/tools/services.js +222 -0
  303. package/dist/mcp/tools/subagents.js +53 -17
  304. package/dist/mcp/tools/tools.d.ts +41 -0
  305. package/dist/mcp/tools/tools.js +202 -41
  306. package/dist/mcp/tools/trigger.js +36 -6
  307. package/dist/mcp/tools/webhooks.js +15 -4
  308. package/dist/mcp/transport/streamable-http.d.ts +11 -1
  309. package/dist/mcp/transport/streamable-http.js +32 -2
  310. package/dist/mcp/unattended-schedules.d.ts +1 -1
  311. package/dist/mcp/webhooks/ingress.d.ts +1 -1
  312. package/dist/providers/auth/delegating.d.ts +19 -0
  313. package/dist/providers/auth/delegating.js +71 -0
  314. package/dist/providers/auth/index.d.ts +3 -1
  315. package/dist/providers/auth/index.js +11 -0
  316. package/dist/providers/auth/self-hosted.d.ts +4 -3
  317. package/dist/providers/auth/self-hosted.js +16 -4
  318. package/dist/providers/auth/types.d.ts +6 -0
  319. package/dist/providers/coding-proxy/memory-ledger.d.ts +3 -0
  320. package/dist/providers/coding-proxy/memory-ledger.js +21 -2
  321. package/dist/providers/coding-proxy/metering.d.ts +4 -0
  322. package/dist/providers/coding-proxy/metering.js +28 -2
  323. package/dist/providers/coding-proxy/prisma-ledger.d.ts +18 -1
  324. package/dist/providers/coding-proxy/prisma-ledger.js +50 -5
  325. package/dist/providers/coding-proxy/proxy.d.ts +13 -0
  326. package/dist/providers/coding-proxy/proxy.js +479 -18
  327. package/dist/providers/coding-proxy/registry/audit.d.ts +131 -0
  328. package/dist/providers/coding-proxy/registry/audit.js +380 -0
  329. package/dist/providers/coding-proxy/registry/bounded-fetch.d.ts +16 -0
  330. package/dist/providers/coding-proxy/registry/bounded-fetch.js +77 -0
  331. package/dist/providers/coding-proxy/registry/plan.d.ts +58 -0
  332. package/dist/providers/coding-proxy/registry/plan.js +304 -0
  333. package/dist/providers/coding-proxy/registry/prisma-store.d.ts +34 -0
  334. package/dist/providers/coding-proxy/registry/prisma-store.js +151 -0
  335. package/dist/providers/coding-proxy/registry/service.d.ts +213 -0
  336. package/dist/providers/coding-proxy/registry/service.js +1137 -0
  337. package/dist/providers/coding-proxy/registry/store.d.ts +127 -0
  338. package/dist/providers/coding-proxy/registry/store.js +70 -0
  339. package/dist/providers/coding-proxy/runtime.d.ts +18 -1
  340. package/dist/providers/coding-proxy/runtime.js +63 -0
  341. package/dist/providers/coding-proxy/secure-fetch.js +0 -1
  342. package/dist/providers/coding-proxy/server.d.ts +11 -0
  343. package/dist/providers/coding-proxy/server.js +163 -0
  344. package/dist/providers/coding-proxy/types.d.ts +15 -0
  345. package/dist/providers/datastore/postgres.d.ts +1 -1
  346. package/dist/providers/engine/types.d.ts +10 -0
  347. package/dist/providers/executor/build.d.ts +3 -3
  348. package/dist/providers/executor/composition.d.ts +4 -1
  349. package/dist/providers/executor/composition.js +19 -0
  350. package/dist/providers/executor/container.d.ts +106 -4
  351. package/dist/providers/executor/container.js +305 -22
  352. package/dist/providers/executor/dbos.d.ts +3 -4
  353. package/dist/providers/executor/in-process.d.ts +2 -3
  354. package/dist/providers/executor/routing.d.ts +7 -0
  355. package/dist/providers/executor/routing.js +13 -0
  356. package/dist/providers/executor/types.d.ts +22 -0
  357. package/dist/providers/jobs/claude-tool-setup.d.ts +23 -0
  358. package/dist/providers/jobs/claude-tool-setup.js +50 -0
  359. package/dist/providers/jobs/collect-prune.d.ts +7 -0
  360. package/dist/providers/jobs/collect-prune.js +27 -0
  361. package/dist/providers/jobs/docker-isolation.d.ts +48 -3
  362. package/dist/providers/jobs/docker-isolation.js +213 -22
  363. package/dist/providers/jobs/docker-services.d.ts +35 -0
  364. package/dist/providers/jobs/docker-services.js +191 -0
  365. package/dist/providers/jobs/docker.d.ts +60 -2
  366. package/dist/providers/jobs/docker.js +313 -50
  367. package/dist/providers/jobs/fake-kubernetes-api.d.ts +1 -0
  368. package/dist/providers/jobs/fake-kubernetes-api.js +12 -3
  369. package/dist/providers/jobs/kubernetes-isolation.d.ts +17 -2
  370. package/dist/providers/jobs/kubernetes-isolation.js +238 -57
  371. package/dist/providers/jobs/kubernetes-platform.d.ts +10 -4
  372. package/dist/providers/jobs/kubernetes-platform.js +11 -5
  373. package/dist/providers/jobs/kubernetes-preflight.js +3 -0
  374. package/dist/providers/jobs/kubernetes.d.ts +21 -2
  375. package/dist/providers/jobs/kubernetes.js +117 -31
  376. package/dist/providers/jobs/types.d.ts +20 -0
  377. package/dist/providers/llm/anthropic.js +6 -2
  378. package/dist/providers/llm/bedrock.js +2 -1
  379. package/dist/providers/llm/claude-messages.d.ts +5 -1
  380. package/dist/providers/llm/claude-messages.js +1 -0
  381. package/dist/providers/llm/claude-provider.d.ts +3 -1
  382. package/dist/providers/llm/claude-provider.js +5 -1
  383. package/dist/providers/llm/index.d.ts +1 -1
  384. package/dist/providers/llm/index.js +1 -1
  385. package/dist/providers/llm/pricing-anthropic.d.ts +10 -0
  386. package/dist/providers/llm/pricing-anthropic.js +32 -14
  387. package/dist/providers/llm/pricing-bedrock-claude.d.ts +8 -0
  388. package/dist/providers/llm/pricing-bedrock-claude.js +9 -0
  389. package/dist/providers/llm/routing.d.ts +10 -1
  390. package/dist/providers/llm/routing.js +18 -0
  391. package/dist/providers/llm/types.d.ts +12 -0
  392. package/dist/providers/llm/types.js +8 -1
  393. package/dist/providers/memory/postgres.d.ts +1 -1
  394. package/dist/providers/review-host/diff-lines.d.ts +16 -0
  395. package/dist/providers/review-host/diff-lines.js +59 -0
  396. package/dist/providers/review-host/github-events.d.ts +6 -0
  397. package/dist/providers/review-host/github-events.js +180 -0
  398. package/dist/providers/review-host/github-user-auth.d.ts +38 -0
  399. package/dist/providers/review-host/github-user-auth.js +128 -0
  400. package/dist/providers/review-host/github.d.ts +57 -0
  401. package/dist/providers/review-host/github.js +567 -0
  402. package/dist/providers/review-host/index.d.ts +12 -0
  403. package/dist/providers/review-host/index.js +30 -0
  404. package/dist/providers/review-host/review-format.d.ts +19 -0
  405. package/dist/providers/review-host/review-format.js +59 -0
  406. package/dist/providers/review-host/types.d.ts +284 -0
  407. package/dist/providers/review-host/types.js +24 -0
  408. package/dist/providers/vcs/git.d.ts +16 -6
  409. package/dist/providers/vcs/git.js +79 -14
  410. package/dist/providers/vcs/github.d.ts +74 -3
  411. package/dist/providers/vcs/github.js +195 -15
  412. package/dist/providers/vcs/types.d.ts +42 -4
  413. package/dist/quickstart/index.js +34 -32
  414. package/dist/quickstart/migrate.d.ts +23 -0
  415. package/dist/quickstart/migrate.js +125 -0
  416. package/dist/sandbox/fetch-policy.d.ts +20 -2
  417. package/dist/sandbox/fetch-policy.js +64 -3
  418. package/dist/sandbox/host-functions.d.ts +9 -1
  419. package/dist/sandbox/host-functions.js +12 -5
  420. package/dist/serve.js +1 -1
  421. package/dist/wardby-bin.js +6 -0
  422. package/docs/README.md +30 -0
  423. package/docs/architecture-runtime.md +90 -0
  424. package/docs/assets/brand/wardby-icon-512.png +0 -0
  425. package/docs/assets/brand/wardby-icon.svg +16 -0
  426. package/docs/assets/brand/wardby-mascot-profile-512.png +0 -0
  427. package/docs/assets/brand/wardby-mascot.png +0 -0
  428. package/docs/assets/brand/wardby-mascot.svg +5 -0
  429. package/docs/assets/wardby-workflow.svg +106 -0
  430. package/docs/code-review-agents.md +481 -0
  431. package/docs/coding-agent-setup.md +172 -0
  432. package/docs/coding-packages.md +455 -0
  433. package/docs/coding-services.md +300 -0
  434. package/docs/coding-worker-byo-images.md +98 -0
  435. package/docs/coding-worker-isolation.md +1061 -0
  436. package/docs/getting-started-gke.md +615 -0
  437. package/docs/getting-started-identity-provider.md +308 -0
  438. package/docs/getting-started.md +133 -0
  439. package/docs/observability.md +53 -0
  440. package/docs/release-verification.md +66 -0
  441. package/docs/security-deployment.md +657 -0
  442. package/help/code-review-agents.md +31 -0
  443. package/help/coding-packages.md +31 -0
  444. package/help/coding-services.md +71 -0
  445. package/help/creating-agents.md +68 -0
  446. package/help/deploy-gke.md +39 -0
  447. package/help/deployment-targets.md +39 -0
  448. package/help/errors/budget-group-exhausted.md +25 -0
  449. package/help/errors/docker-isolation-unsupported.md +26 -0
  450. package/help/errors/protected-path.md +45 -0
  451. package/help/errors/repo-access.md +27 -0
  452. package/help/errors/service-declaration-invalid.md +27 -0
  453. package/help/errors/service-declaration-unavailable.md +25 -0
  454. package/help/errors/service-launcher-unsupported.md +30 -0
  455. package/help/errors/service-not-allowed.md +27 -0
  456. package/help/errors/service-unknown.md +23 -0
  457. package/help/errors/service-unready.md +49 -0
  458. package/help/getting-started.md +31 -0
  459. package/help/github.md +30 -0
  460. package/help/identity-and-access.md +39 -0
  461. package/help/mcp.md +30 -0
  462. package/help/native-capabilities.md +30 -0
  463. package/help/observability.md +41 -0
  464. package/help/operating-agents.md +30 -0
  465. package/help/security.md +27 -0
  466. package/help/troubleshooting/budgets.md +26 -0
  467. package/help/troubleshooting/coding-workers.md +47 -0
  468. package/help/troubleshooting/repository-access.md +27 -0
  469. package/package.json +30 -11
  470. package/prisma/migrate.config.mjs +20 -0
  471. package/prisma/migrations/20260925010000_coding_collect_exclude/migration.sql +8 -0
  472. package/prisma/migrations/20260925015000_allowed_egress_default/migration.sql +8 -0
  473. package/prisma/migrations/20260925020000_coding_package_registry/migration.sql +55 -0
  474. package/prisma/migrations/20260925030000_tool_name_per_owner/migration.sql +11 -0
  475. package/prisma/migrations/20260926010000_run_trigger_host_event/migration.sql +7 -0
  476. package/prisma/migrations/20260926020000_code_review_hosts/migration.sql +53 -0
  477. package/prisma/migrations/20260926030000_auth_user_roles/migration.sql +9 -0
  478. package/prisma/migrations/20260926040000_agent_effort/migration.sql +6 -0
  479. package/prisma/migrations/20260926050000_registry_lockfile_plan/migration.sql +32 -0
  480. package/prisma/migrations/20260926050000_repo_access_authorization/migration.sql +82 -0
  481. package/prisma/migrations/20260926060000_registry_plan_refusal/migration.sql +19 -0
  482. package/prisma/migrations/20260926100000_registry_plan_refusal_published_at/migration.sql +5 -0
  483. package/prisma/migrations/20260926190000_run_host_status/migration.sql +18 -0
  484. package/prisma/migrations/20260926210000_run_host_status_at_dispatch/migration.sql +5 -0
  485. package/prisma/migrations/20260927010000_resource_grants/migration.sql +72 -0
  486. package/prisma/migrations/20260927020000_proxy_session_budget_exhausted/migration.sql +3 -0
  487. package/prisma/migrations/20260927030000_coding_debug_trace/migration.sql +4 -0
  488. package/prisma/migrations/20260927040000_proxy_session_upstream_failure/migration.sql +3 -0
  489. package/prisma/migrations/20260927050000_coding_run_services/migration.sql +74 -0
  490. package/prisma/migrations/20260928000000_coding_run_tool_image/migration.sql +5 -0
  491. package/prisma/schema.prisma +417 -23
@@ -0,0 +1,308 @@
1
+ # Bring your own identity provider
2
+
3
+ This guide connects a deployed Wardby control plane to an existing OAuth/OIDC
4
+ identity provider for remote MCP access. Wardby calls this **delegating mode**:
5
+ your provider authenticates users and issues access tokens; Wardby acts only as
6
+ the protected resource that verifies those tokens and enforces their scopes.
7
+
8
+ Use this mode for a shared HTTPS deployment. Local stdio MCP created by
9
+ `wardby quickstart` trusts the local operator and does not use OAuth.
10
+
11
+ ## What Wardby requires
12
+
13
+ Your provider must issue signed JWT access tokens with:
14
+
15
+ - `iss` exactly equal to the configured issuer;
16
+ - `aud` equal to Wardby's canonical MCP URI;
17
+ - a stable, nonblank `sub` identifying the user or workload;
18
+ - a future `exp` expiration; and
19
+ - Wardby permissions in either the `scope` or `scp` claim.
20
+
21
+ The signing key must be published at an HTTPS JWKS endpoint reachable from the
22
+ Wardby control plane. `email` and `roles` are retained when present, but tool
23
+ authorization is based on scopes, not those optional claims.
24
+
25
+ Wardby does not call the provider's user-info endpoint, exchange authorization
26
+ codes, refresh tokens, or administer users in delegating mode. The MCP client
27
+ performs the provider's authorization flow and sends the resulting bearer
28
+ access token to Wardby.
29
+
30
+ ## 1. Choose the canonical resource
31
+
32
+ Use the final public HTTPS MCP URL as the resource identifier. For example:
33
+
34
+ ```text
35
+ https://wardby.example.com/mcp
36
+ ```
37
+
38
+ Use that exact value for all three of these:
39
+
40
+ - the IdP API, resource, or audience identifier;
41
+ - `MCP_CANONICAL_URI`; and
42
+ - `AUTH_AUDIENCE`.
43
+
44
+ Wardby refuses to start when the two environment values are not the same
45
+ normalized URL. A trailing slash on a non-root path is significant, so prefer
46
+ copying the canonical URI exactly rather than typing it separately in each
47
+ system.
48
+
49
+ ## 2. Register Wardby as an API or resource
50
+
51
+ Create an API, resource server, or equivalent object in the identity provider.
52
+ Set its audience or identifier to the canonical URI and configure signed JWT
53
+ access tokens for that audience.
54
+
55
+ Create these scopes in the provider:
56
+
57
+ | Scope | Capability |
58
+ | --------------------- | ----------------------------------------------------------------- |
59
+ | `agents:read` | Inspect agents, models, runs, memory, and attached resources. |
60
+ | `agents:write` | Create and modify agents, schedules, and sub-agent relationships. |
61
+ | `runs:trigger` | Start agent runs. |
62
+ | `tools:write` | Create, attach, and manage tools. |
63
+ | `datastore:write` | Create, attach, query, and modify datastores. |
64
+ | `secrets:write` | Create, attach, rotate, and remove secret bindings. |
65
+ | `webhooks:write` | Create and manage webhook triggers. |
66
+ | `budget_groups:write` | Create and manage shared budget groups. |
67
+ | `packages:approve` | Approve coding agents' package allowlists. |
68
+ | `services:manage` | Create, update and delete coding-run service catalog entries. |
69
+ | `agents:admin` | Reassign agent ownership, BYO worker images; admins only. |
70
+ | `memory:write` | Set and delete agent memory entries. |
71
+
72
+ MCP clients discover this list from Wardby's protected-resource metadata and
73
+ may request every advertised scope. Define all twelve in the provider even when
74
+ policy grants a particular client or user only a subset. Ensure granted scopes
75
+ are emitted in the access token's `scope` or `scp` claim; defining them only in
76
+ the provider UI is not sufficient.
77
+
78
+ `memory:write` was added after the first ten scopes. When you upgrade an
79
+ existing deployment, define it in the provider too. Otherwise, clients that
80
+ request every advertised scope may fail with `invalid_scope`.
81
+
82
+ `services:manage` was added after `memory:write`. When you upgrade an existing
83
+ deployment, define it in the provider too, for the same reason.
84
+
85
+ ### Wardby roles
86
+
87
+ A scope only delegates. `agents:admin`, `packages:approve` and `services:manage`
88
+ take effect only for a caller who also holds a Wardby role that grants them:
89
+
90
+ | Wardby role | Grants |
91
+ | ------------------ | --------------------------------------------------------------------------------------------- |
92
+ | `admin` | `agents:admin` (`make_owner`, BYO `workerImageRef`), `packages:approve` and `services:manage` |
93
+ | `package-approver` | `packages:approve` (package allowlist and policy approval) |
94
+ | `service-manager` | `services:manage` (coding-run service catalog changes) |
95
+
96
+ The roles come from a claim in the caller's **access token**, which you map to
97
+ Wardby roles:
98
+
99
+ ```dotenv
100
+ AUTH_ROLE_CLAIM=groups # claim name or dotted path
101
+ AUTH_ROLE_MAP=wardby-admin=admin,wardby-packages=package-approver,wardby-services=service-manager
102
+ ```
103
+
104
+ Wardby looks up `AUTH_ROLE_CLAIM` in two steps:
105
+
106
+ 1. It first looks for a top-level claim with that exact name. This covers names
107
+ that themselves contain dots or slashes, such as
108
+ `https://wardby.example/roles`.
109
+ 2. If there is none and the name contains `.`, it follows the name as a dotted
110
+ path through nested objects, such as `realm_access.roles`.
111
+
112
+ The claim can be a single string or an array of strings. Each value that
113
+ `AUTH_ROLE_MAP` lists gives the caller the mapped Wardby role:
114
+
115
+ - Values the map doesn't list are ignored.
116
+ - A missing claim, or one of any other type, gives the caller no roles.
117
+ - Matching is exact and **case-sensitive**. `Wardby-Admin` does not match
118
+ `wardby-admin`.
119
+ - A space-separated string counts as one value, not a list.
120
+ - Whitespace around `AUTH_ROLE_CLAIM`, and around entries in `AUTH_ROLE_MAP`,
121
+ is ignored.
122
+
123
+ **Map only IdP values that users can't create or assign to themselves.** Anyone
124
+ who can put a mapped value into their own token becomes an admin. Avoid group
125
+ names in providers that allow self-service groups or user-editable profile
126
+ attributes. Prefer application roles, or group IDs that only administrators
127
+ manage.
128
+
129
+ A dotted path splits on every `.`, so it can't address a Keycloak
130
+ `resource_access.<client-id>` whose client ID itself contains a dot. Use realm
131
+ roles in that case.
132
+
133
+ Wardby refuses to start if:
134
+
135
+ - only one of the two variables is set, or
136
+ - the map names an unknown Wardby role.
137
+
138
+ `AUTH_ROLE_CLAIM` and `AUTH_ROLE_MAP` are ignored in self-hosted mode, and
139
+ Wardby logs a warning at startup if they are set there.
140
+
141
+ With neither variable set, no caller has a role and the privileged operations
142
+ are refused. The claim is read on every request, from the bearer token validated
143
+ for Wardby's issuer and audience. Configure the provider so that only access
144
+ tokens carry that audience. Removing someone's group or role takes effect with
145
+ their next token.
146
+
147
+ Provider examples:
148
+
149
+ - **Okta** (custom authorization server): create three groups, `wardby-admin`,
150
+ `wardby-packages` and `wardby-services`. Add a `groups` claim to the access
151
+ token, filtered to those groups. Set `AUTH_ROLE_CLAIM=groups` and
152
+ `AUTH_ROLE_MAP=wardby-admin=admin,wardby-packages=package-approver,wardby-services=service-manager`.
153
+ Optionally, add access policy rules so only those groups can obtain
154
+ `agents:admin`, `packages:approve` and `services:manage`.
155
+ - **FusionAuth:** create three application roles, `admin`,
156
+ `package-approver` and `service-manager`. They appear in the access token's
157
+ top-level `roles` claim. Set `AUTH_ROLE_CLAIM=roles` and
158
+ `AUTH_ROLE_MAP=admin=admin,package-approver=package-approver,service-manager=service-manager`.
159
+ - **Keycloak:** create realm roles such as `wardby-admin`, `wardby-packages`
160
+ and `wardby-services`. Realm roles appear under `realm_access.roles`. Set
161
+ `AUTH_ROLE_CLAIM=realm_access.roles` and
162
+ `AUTH_ROLE_MAP=wardby-admin=admin,wardby-packages=package-approver,wardby-services=service-manager`.
163
+ For client roles, use `resource_access.<client-id>.roles`. The
164
+ [local Keycloak harness](../deploy/keycloak-test/README.md) sets this up.
165
+ - **Auth0:** add the user's roles to the access token as a namespaced custom
166
+ claim from an Action, such as `https://wardby.example/roles`. Set
167
+ `AUTH_ROLE_CLAIM=https://wardby.example/roles` and an `AUTH_ROLE_MAP` naming
168
+ your Auth0 role names.
169
+
170
+ ## 3. Register an MCP client
171
+
172
+ Most enterprise providers disable anonymous dynamic client registration. In
173
+ that case, register the MCP client manually as a **public/native application**:
174
+
175
+ - require authorization code flow with PKCE S256;
176
+ - do not issue or embed a client secret in a desktop client;
177
+ - register the client's exact loopback callback URI; and
178
+ - allow it to request the Wardby audience and scopes.
179
+
180
+ For Claude Code, a fixed callback port makes the redirect URI predictable:
181
+
182
+ ```sh
183
+ claude mcp add --transport http wardby https://wardby.example.com/mcp \
184
+ --client-id YOUR_PUBLIC_CLIENT_ID \
185
+ --callback-port 8765
186
+ ```
187
+
188
+ Register the callback URI shown by the client for port `8765` in the identity
189
+ provider. Other MCP clients need an equivalent way to supply a pre-registered
190
+ public client ID. If a client supports only dynamic registration, either enable
191
+ that feature with suitable provider-side restrictions or use Wardby's
192
+ self-hosted authentication mode.
193
+
194
+ ## 4. Configure Wardby
195
+
196
+ Inject these settings through the deployment's secret/configuration mechanism:
197
+
198
+ ```dotenv
199
+ MCP_TRANSPORT=http
200
+ MCP_HTTP_BIND=0.0.0.0:8080
201
+ MCP_CANONICAL_URI=https://wardby.example.com/mcp
202
+
203
+ AUTH_PROVIDER=delegating
204
+ AUTH_ISSUER=https://identity.example.com/your-tenant/
205
+ AUTH_JWKS_URI=https://identity.example.com/your-tenant/.well-known/jwks.json
206
+ AUTH_AUDIENCE=https://wardby.example.com/mcp
207
+ # Optional: Wardby roles (see "Wardby roles" above).
208
+ AUTH_ROLE_CLAIM=groups
209
+ AUTH_ROLE_MAP=wardby-admin=admin,wardby-packages=package-approver,wardby-services=service-manager
210
+ ```
211
+
212
+ Copy `AUTH_ISSUER` exactly from the token's `iss` claim or the provider's
213
+ metadata. Copy `AUTH_JWKS_URI` from the provider's metadata rather than
214
+ guessing its path. Keep the application port private behind the TLS-terminating
215
+ proxy or load balancer; only the public HTTPS hostname should be reachable by
216
+ MCP clients.
217
+
218
+ `AUTH_SIGNING_KEY`, `AUTH_CREDENTIAL_HASH_KEY`, local login keys, and
219
+ `wardby auth user` commands belong to self-hosted mode and are not used here.
220
+ `SECRET_APP_KEY` remains required because it encrypts Wardby's stored
221
+ application secrets.
222
+
223
+ For the portable container deployment, place these values in the protected
224
+ production environment described by
225
+ [the production boundary](../deploy/production/README.md). The GKE deployment
226
+ helper uses self-hosted authentication by default; replace the control-plane
227
+ secret's auth settings with the delegated values, including `AUTH_ROLE_CLAIM`
228
+ and `AUTH_ROLE_MAP`, before rollout, and preserve
229
+ that customization in your deployment automation so a later `up.sh` does not
230
+ restore self-hosted mode.
231
+
232
+ ## 5. Verify discovery
233
+
234
+ After deploying, request Wardby's protected-resource metadata:
235
+
236
+ ```sh
237
+ curl --fail --silent --show-error \
238
+ https://wardby.example.com/.well-known/oauth-protected-resource/mcp | jq
239
+ ```
240
+
241
+ Confirm that:
242
+
243
+ - `resource` is the canonical MCP URI;
244
+ - `authorization_servers` contains the external issuer; and
245
+ - `scopes_supported` contains all ten Wardby scopes.
246
+
247
+ An unauthenticated MCP request must return `401` with a `WWW-Authenticate`
248
+ challenge pointing back to that metadata document.
249
+
250
+ ## 6. Verify a provider token
251
+
252
+ Obtain an access token through the registered MCP client or your provider's
253
+ approved test flow. Inspect its claims locally; do not paste a production token
254
+ into a third-party JWT debugger:
255
+
256
+ ```sh
257
+ TOKEN='REPLACE_WITH_SHORT_LIVED_TEST_TOKEN' node -e '
258
+ const token = process.env.TOKEN;
259
+ const payload = JSON.parse(Buffer.from(token.split(".")[1], "base64url"));
260
+ console.log(JSON.stringify({
261
+ iss: payload.iss,
262
+ aud: payload.aud,
263
+ sub: payload.sub,
264
+ exp: payload.exp,
265
+ scope: payload.scope ?? payload.scp
266
+ }, null, 2));
267
+ '
268
+ ```
269
+
270
+ Check that the issuer and audience match the configured values and that the
271
+ token carries the scopes needed by the requested Wardby operation. Then connect
272
+ the MCP client and list agents. Wardby creates a local `Principal` for the
273
+ validated `sub` on first use; users remain managed entirely in the external
274
+ provider.
275
+
276
+ ## 7. Rehearse locally with Keycloak
277
+
278
+ Before changing a production provider, exercise the complete delegated flow
279
+ with the repository's disposable Keycloak harness:
280
+
281
+ ```sh
282
+ docker compose -f deploy/keycloak-test/docker-compose.yml up -d
283
+ ./deploy/keycloak-test/setup-realm.sh
284
+ ```
285
+
286
+ The script recreates a local realm, API audience, all Wardby scopes, a machine
287
+ client, and a public PKCE client, then prints the exact environment and Claude
288
+ Code command to use. It uses development HTTP and hardcoded credentials; never
289
+ expose it or reuse it for production. See
290
+ [the harness documentation](../deploy/keycloak-test/README.md) for the full
291
+ test procedure and cleanup.
292
+
293
+ ## Troubleshooting
294
+
295
+ | Symptom | Most likely cause |
296
+ | --------------------------------------------- | ------------------------------------------------------------------------------------ |
297
+ | Authorization fails with `invalid_scope` | One or more advertised Wardby scopes do not exist in the provider. |
298
+ | Wardby returns `401 Invalid token` | Wrong issuer/audience, expired token, missing `sub`, unknown key, or bad signature. |
299
+ | Wardby returns `403 insufficient_scope` | The token is valid but `scope`/`scp` lacks the operation's required permission. |
300
+ | Client registration returns `403` | Anonymous dynamic registration is disabled; pre-register a public client. |
301
+ | Browser flow rejects the redirect | The provider's registered loopback callback does not exactly match the client. |
302
+ | Wardby cannot validate any newly issued token | The control plane cannot reach the JWKS URI, or provider key rotation is incomplete. |
303
+ | One person appears as multiple principals | The provider is emitting different or pairwise `sub` values for different clients. |
304
+
305
+ Keep JWKS access on the deployment egress allowlist, use short-lived access
306
+ tokens, map Wardby roles only to trusted administrators, and monitor
307
+ authentication failures without logging bearer tokens. Review the broader
308
+ [security deployment guide](security-deployment.md) before production use.
@@ -0,0 +1,133 @@
1
+ # Getting started
2
+
3
+ This guide gets a local Wardby control plane running without installing
4
+ PostgreSQL or cloning the Wardby repository. Wardby keeps its database and
5
+ configuration isolated from the application in which you run it.
6
+
7
+ For a shared deployment with isolated Kubernetes coding workers, use the
8
+ [GKE getting-started guide](getting-started-gke.md).
9
+
10
+ ## Requirements
11
+
12
+ - Node.js 24 or newer.
13
+ - Docker with Docker Compose v2.
14
+ - An OpenAI or Anthropic API key.
15
+ - Optional: Codex or Claude Code, if you want `quickstart` to register Wardby
16
+ as an MCP server.
17
+
18
+ ## Run quickstart
19
+
20
+ From the repository where you want to use Wardby:
21
+
22
+ ```sh
23
+ npx --yes @wardby/cli@latest quickstart
24
+ ```
25
+
26
+ The guided command:
27
+
28
+ 1. checks Node, Docker, Docker Compose, and the Docker daemon;
29
+ 2. creates a private `.wardby/.env` and project state;
30
+ 3. adds `.wardby/` to the repository's `.gitignore`;
31
+ 4. starts PostgreSQL 16 in Docker on the first available local port beginning
32
+ at `55432`;
33
+ 5. applies Wardby's packaged Prisma migrations;
34
+ 6. creates the `hello-wardby` sample agent with a `$1` maximum run budget;
35
+ 7. asks before making the billed model request; and
36
+ 8. optionally registers the local stdio MCP server with Codex, Claude Code, or
37
+ both.
38
+
39
+ Provider credentials and `SECRET_APP_KEY` are written with owner-only file
40
+ permissions. They are not printed, passed as command-line arguments, or added
41
+ to the application's own `.env` files.
42
+
43
+ ## Unattended setup
44
+
45
+ Automation must explicitly accept the billed demo with `--yes`:
46
+
47
+ ```sh
48
+ OPENAI_API_KEY="..." npx --yes @wardby/cli@latest quickstart \
49
+ --provider openai \
50
+ --model gpt-5.6-luna \
51
+ --budget 1 \
52
+ --client codex \
53
+ --non-interactive \
54
+ --yes
55
+ ```
56
+
57
+ Use `--skip-demo` to prepare the database without making a provider request.
58
+ This is useful for CI and package verification:
59
+
60
+ ```sh
61
+ npx --yes @wardby/cli@latest quickstart \
62
+ --provider openai \
63
+ --non-interactive \
64
+ --skip-demo
65
+ ```
66
+
67
+ ## Operate the local installation
68
+
69
+ Run these from the same project directory. Set `WARDBY_PROJECT_DIR` to that
70
+ directory when invoking Wardby from somewhere else.
71
+
72
+ ```sh
73
+ npx --yes @wardby/cli@latest doctor
74
+ npx --yes @wardby/cli@latest status
75
+ npx --yes @wardby/cli@latest logs --tail 100
76
+ npx --yes @wardby/cli@latest down
77
+ ```
78
+
79
+ `down` stops PostgreSQL but preserves its named volume. Removing the database
80
+ is intentionally explicit:
81
+
82
+ ```sh
83
+ npx --yes @wardby/cli@latest down --volumes
84
+ ```
85
+
86
+ `quickstart` is safe to rerun. It reuses the project identity, port, secrets,
87
+ and database volume, reapplies idempotent migrations, and updates the sample
88
+ agent instead of creating duplicates.
89
+
90
+ ## MCP configuration
91
+
92
+ Passing `--client codex`, `--client claude`, or `--client both` lets quickstart
93
+ register Wardby after showing the choice interactively. The generated stdio
94
+ entry launches the same package version and sets `WARDBY_PROJECT_DIR`, so the
95
+ MCP process finds this project's private Wardby configuration regardless of the
96
+ client's current working directory.
97
+
98
+ After connecting, try:
99
+
100
+ > List my Wardby agents, show the latest run and its actual cost, then create a
101
+ > new agent with a maximum budget of $0.50. Do not run it yet.
102
+
103
+ ### Reasoning effort
104
+
105
+ A native agent can set `effort` (`low`, `medium`, `high`, `xhigh`, or `max`)
106
+ through `create_agent`, `update_agent`, or `wardby agent create --effort`. It is
107
+ sent on every model call and trades depth of reasoning against latency and
108
+ output-token cost; lower levels are faster and cheaper per turn. Leave it unset
109
+ to use the provider's default. Wardby rejects a level the agent's model does not
110
+ accept, including when you later change the model (clear it with
111
+ `effort: null`). Effort currently applies to direct Anthropic API models that
112
+ support it; OpenAI and Bedrock models accept no effort setting, and coding
113
+ agents do not use it.
114
+
115
+ ## Coding agents
116
+
117
+ The first-run demo proves native model routing, budget admission, persistence,
118
+ and accounting. It deliberately does not install a GitHub App or build worker
119
+ images.
120
+
121
+ Coding agents require the stronger boundary described in
122
+ [Coding-agent setup](coding-agent-setup.md): a dedicated GitHub App, immutable
123
+ worker image, trusted coding proxy, and either Docker or Kubernetes as the job
124
+ launcher. Run `wardby coding preflight` before enabling a production repository.
125
+
126
+ ## Next steps
127
+
128
+ - [Runtime architecture](architecture-runtime.md)
129
+ - [Coding-agent setup](coding-agent-setup.md)
130
+ - [Bring your own identity provider](getting-started-identity-provider.md)
131
+ - [Observability](observability.md)
132
+ - [GKE deployment](getting-started-gke.md)
133
+ - [Security deployment guide](security-deployment.md)
@@ -0,0 +1,53 @@
1
+ # Observability
2
+
3
+ Wardby's coding proxy exposes Prometheus metrics at `/metrics` when
4
+ `METRICS_BIND` is configured. Collection is pull-based. Keep the endpoint on a
5
+ private network and allow only the selected collector to reach it.
6
+
7
+ Metrics cover proxy requests, errors, latency, audit events, model cost,
8
+ reserved budget, actual spend, coding-run outcomes, and Node.js process health.
9
+ Labels are deliberately bounded and exclude prompts, repository content,
10
+ credentials, diffs, request bodies, raw worker output, and run identifiers.
11
+
12
+ ## Local Prometheus and Grafana
13
+
14
+ The included Compose profile provisions Prometheus, Grafana, and the Wardby
15
+ dashboards without making a paid model request:
16
+
17
+ ```sh
18
+ npm run observability:up
19
+ npm run observability:smoke
20
+ npm run observability:down
21
+ ```
22
+
23
+ Grafana is available at `http://127.0.0.1:3000` and Prometheus at
24
+ `http://127.0.0.1:9090`. The local Prometheus volume retains 24 hours of time
25
+ series. Grafana stores dashboard configuration, not the authoritative metrics
26
+ history. Wardby's database remains the source of truth for runs, budgets, and
27
+ accounting records.
28
+
29
+ ## Cloud collectors
30
+
31
+ - AWS operators can configure the [CloudWatch Agent Prometheus
32
+ collector](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-PrometheusEC2.html)
33
+ on EC2, ECS, or EKS to scrape Wardby over private networking.
34
+ - GCP operators can use the [Google Cloud Ops Agent Prometheus
35
+ receiver](https://cloud.google.com/stackdriver/docs/managed-prometheus/setup-opsagent)
36
+ or a Managed Service for Prometheus collector.
37
+ - Any collector or hosted platform that accepts Prometheus exposition format
38
+ can scrape the same endpoint.
39
+
40
+ The reference cloud deployments do not provision these collectors. Operators
41
+ must configure authentication, private reachability, retention, alerting, and
42
+ SLOs for their environment. Application/MCP coverage is still narrower than
43
+ the coding-proxy coverage, so verify required signals before production use.
44
+
45
+ ## Production checklist
46
+
47
+ - Keep `/metrics` private; never expose it directly to the internet.
48
+ - Set retention intentionally in the Prometheus-compatible backend.
49
+ - Alert on request failures, budget cutoffs, cleanup failures, stalled runs,
50
+ and sustained latency or memory growth.
51
+ - Confirm alerts reach an owned channel and rehearse one response path.
52
+ - Treat telemetry as operational evidence, not as a replacement for Wardby's
53
+ accounting database.
@@ -0,0 +1,66 @@
1
+ # Release verification
2
+
3
+ Run release checks against the exact commit and dependency lockfile that will
4
+ be published. Database-backed checks require a disposable, migrated PostgreSQL
5
+ database through `DATABASE_URL`.
6
+
7
+ ```sh
8
+ npm ci
9
+ npm run prisma:generate
10
+ npm run prisma:migrate
11
+ npm run typecheck
12
+ npm run lint
13
+ npm run format:check
14
+ npm test
15
+ npm run build
16
+ npm run test:production-boundary
17
+ npm run test:package
18
+ node scripts/security-audit.mjs
19
+ ```
20
+
21
+ For coding-agent releases, also run:
22
+
23
+ ```sh
24
+ npm run test:phase5:database
25
+ npm run worker:image:local
26
+ npm run test:docker-isolation
27
+ npm run test:docker-job
28
+ npm run verify:claude-code
29
+ ```
30
+
31
+ The GitHub `Security checks` workflow builds the worker-image matrix, creates
32
+ SPDX SBOMs, scans images, replays migrations, and exercises the database and
33
+ browser-backed suites. A release is acceptable only when required checks pass
34
+ on the release commit and its production images are addressed by immutable
35
+ digest.
36
+
37
+ Live coding smoke tests are opt-in because they spend provider credit and
38
+ create a branch and draft pull request. Use a dedicated fixture repository, a
39
+ repository-scoped GitHub App installation, and a deliberately small budget.
40
+ Verify the requested diff, terminal outcome, cost, resource cleanup, and branch
41
+ cleanup. See [local coding-agent setup](coding-agent-setup.md).
42
+
43
+ Before production deployment, review [runtime architecture](architecture-runtime.md),
44
+ [coding-worker isolation](coding-worker-isolation.md), and the
45
+ [security deployment guide](security-deployment.md). A self-hosted operator is
46
+ responsible for equivalent edge, network, database, secret-management,
47
+ monitoring, backup, and recovery controls in the selected platform.
48
+
49
+ ## npm releases
50
+
51
+ The first public release reserves the package and must be published by an npm
52
+ member of the `wardby` organization with publishing 2FA enabled:
53
+
54
+ ```sh
55
+ npm login
56
+ npm run test:package
57
+ npm run build
58
+ npm publish --access public
59
+ ```
60
+
61
+ After `@wardby/cli` exists, configure its npm trusted publisher with GitHub
62
+ organization `wardby`, repository `wardby`, and workflow filename
63
+ `publish-npm.yml`; allow direct `npm publish`. Future versions are published by
64
+ creating a GitHub Release whose tag exactly matches `v<package.json version>`.
65
+ The workflow uses npm OIDC rather than a stored token. A public repository and
66
+ public package receive npm provenance automatically.