@wardby/cli 0.1.0 → 0.2.1

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 (168) hide show
  1. package/README.md +183 -96
  2. package/deploy/local/docker-compose.yml +5 -5
  3. package/dist/claude-coding-worker/driver.d.ts +1 -0
  4. package/dist/claude-coding-worker/driver.js +4 -1
  5. package/dist/claude-coding-worker/main.js +3 -2
  6. package/dist/cli-help.d.ts +1 -1
  7. package/dist/cli-help.js +5 -0
  8. package/dist/cli.js +0 -0
  9. package/dist/coding/protocol.d.ts +28 -3
  10. package/dist/coding/protocol.js +53 -2
  11. package/dist/coding-worker/artifact.d.ts +12 -0
  12. package/dist/coding-worker/artifact.js +48 -6
  13. package/dist/coding-worker/driver.d.ts +1 -0
  14. package/dist/coding-worker/driver.js +4 -1
  15. package/dist/coding-worker/errors.d.ts +7 -0
  16. package/dist/coding-worker/errors.js +18 -0
  17. package/dist/coding-worker/main.js +3 -2
  18. package/dist/core/budget-groups.d.ts +1 -1
  19. package/dist/core/coding-queue.d.ts +1 -1
  20. package/dist/core/datastores.d.ts +1 -1
  21. package/dist/core/db.d.ts +36 -2
  22. package/dist/core/db.js +69 -2
  23. package/dist/core/dispatch.d.ts +16 -1
  24. package/dist/core/dispatch.js +33 -5
  25. package/dist/core/http-runtime.js +3 -4
  26. package/dist/core/lease.d.ts +1 -1
  27. package/dist/core/private-directory.d.ts +20 -0
  28. package/dist/core/private-directory.js +36 -0
  29. package/dist/core/reconciler.d.ts +1 -1
  30. package/dist/core/runner.d.ts +1 -1
  31. package/dist/core/scheduler.d.ts +1 -1
  32. package/dist/core/secrets.d.ts +1 -1
  33. package/dist/core/subagent-memory-tools.d.ts +1 -1
  34. package/dist/core/webhooks.d.ts +1 -1
  35. package/dist/env.js +8 -1
  36. package/dist/generated/prisma/browser.d.ts +228 -0
  37. package/dist/generated/prisma/browser.js +17 -0
  38. package/dist/generated/prisma/client.d.ts +247 -0
  39. package/dist/generated/prisma/client.js +34 -0
  40. package/dist/generated/prisma/commonInputTypes.d.ts +809 -0
  41. package/dist/generated/prisma/commonInputTypes.js +10 -0
  42. package/dist/generated/prisma/enums.d.ts +53 -0
  43. package/dist/generated/prisma/enums.js +54 -0
  44. package/dist/generated/prisma/internal/class.d.ts +462 -0
  45. package/dist/generated/prisma/internal/class.js +49 -0
  46. package/dist/generated/prisma/internal/prismaNamespace.d.ts +3325 -0
  47. package/dist/generated/prisma/internal/prismaNamespace.js +455 -0
  48. package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts +449 -0
  49. package/dist/generated/prisma/internal/prismaNamespaceBrowser.js +426 -0
  50. package/dist/generated/prisma/models/Agent.d.ts +3267 -0
  51. package/dist/generated/prisma/models/Agent.js +1 -0
  52. package/dist/generated/prisma/models/AgentDatastore.d.ts +1210 -0
  53. package/dist/generated/prisma/models/AgentDatastore.js +1 -0
  54. package/dist/generated/prisma/models/AgentMemory.d.ts +986 -0
  55. package/dist/generated/prisma/models/AgentMemory.js +1 -0
  56. package/dist/generated/prisma/models/AgentSecret.d.ts +1212 -0
  57. package/dist/generated/prisma/models/AgentSecret.js +1 -0
  58. package/dist/generated/prisma/models/AgentSubAgent.d.ts +1217 -0
  59. package/dist/generated/prisma/models/AgentSubAgent.js +1 -0
  60. package/dist/generated/prisma/models/AgentTool.d.ts +1309 -0
  61. package/dist/generated/prisma/models/AgentTool.js +1 -0
  62. package/dist/generated/prisma/models/AuthFormChallenge.d.ts +1298 -0
  63. package/dist/generated/prisma/models/AuthFormChallenge.js +1 -0
  64. package/dist/generated/prisma/models/AuthLoginKey.d.ts +1245 -0
  65. package/dist/generated/prisma/models/AuthLoginKey.js +1 -0
  66. package/dist/generated/prisma/models/AuthRateLimit.d.ts +979 -0
  67. package/dist/generated/prisma/models/AuthRateLimit.js +1 -0
  68. package/dist/generated/prisma/models/AuthSession.d.ts +1376 -0
  69. package/dist/generated/prisma/models/AuthSession.js +1 -0
  70. package/dist/generated/prisma/models/AuthUser.d.ts +1645 -0
  71. package/dist/generated/prisma/models/AuthUser.js +1 -0
  72. package/dist/generated/prisma/models/BudgetGroup.d.ts +1548 -0
  73. package/dist/generated/prisma/models/BudgetGroup.js +1 -0
  74. package/dist/generated/prisma/models/CodingAgentProfile.d.ts +1430 -0
  75. package/dist/generated/prisma/models/CodingAgentProfile.js +1 -0
  76. package/dist/generated/prisma/models/CodingProxyRequest.d.ts +1749 -0
  77. package/dist/generated/prisma/models/CodingProxyRequest.js +1 -0
  78. package/dist/generated/prisma/models/CodingProxySession.d.ts +1505 -0
  79. package/dist/generated/prisma/models/CodingProxySession.js +1 -0
  80. package/dist/generated/prisma/models/CodingRun.d.ts +2402 -0
  81. package/dist/generated/prisma/models/CodingRun.js +1 -0
  82. package/dist/generated/prisma/models/Datastore.d.ts +1434 -0
  83. package/dist/generated/prisma/models/Datastore.js +1 -0
  84. package/dist/generated/prisma/models/DatastoreEntry.d.ts +1314 -0
  85. package/dist/generated/prisma/models/DatastoreEntry.js +1 -0
  86. package/dist/generated/prisma/models/OAuthAuthorizationCode.d.ts +1526 -0
  87. package/dist/generated/prisma/models/OAuthAuthorizationCode.js +1 -0
  88. package/dist/generated/prisma/models/OAuthAuthorizationRequest.d.ts +1350 -0
  89. package/dist/generated/prisma/models/OAuthAuthorizationRequest.js +1 -0
  90. package/dist/generated/prisma/models/OAuthClient.d.ts +1289 -0
  91. package/dist/generated/prisma/models/OAuthClient.js +1 -0
  92. package/dist/generated/prisma/models/OAuthFamily.d.ts +1540 -0
  93. package/dist/generated/prisma/models/OAuthFamily.js +1 -0
  94. package/dist/generated/prisma/models/OAuthGrant.d.ts +1280 -0
  95. package/dist/generated/prisma/models/OAuthGrant.js +1 -0
  96. package/dist/generated/prisma/models/Principal.d.ts +1790 -0
  97. package/dist/generated/prisma/models/Principal.js +1 -0
  98. package/dist/generated/prisma/models/Run.d.ts +2281 -0
  99. package/dist/generated/prisma/models/Run.js +1 -0
  100. package/dist/generated/prisma/models/SchedulerLease.d.ts +970 -0
  101. package/dist/generated/prisma/models/SchedulerLease.js +1 -0
  102. package/dist/generated/prisma/models/Secret.d.ts +1399 -0
  103. package/dist/generated/prisma/models/Secret.js +1 -0
  104. package/dist/generated/prisma/models/SecretElicitationOutcome.d.ts +973 -0
  105. package/dist/generated/prisma/models/SecretElicitationOutcome.js +1 -0
  106. package/dist/generated/prisma/models/Task.d.ts +1176 -0
  107. package/dist/generated/prisma/models/Task.js +1 -0
  108. package/dist/generated/prisma/models/Tool.d.ts +1478 -0
  109. package/dist/generated/prisma/models/Tool.js +1 -0
  110. package/dist/generated/prisma/models/Webhook.d.ts +1386 -0
  111. package/dist/generated/prisma/models/Webhook.js +1 -0
  112. package/dist/generated/prisma/models.d.ts +32 -0
  113. package/dist/generated/prisma/models.js +1 -0
  114. package/dist/import/create.d.ts +1 -1
  115. package/dist/import/create.js +1 -1
  116. package/dist/import/index.d.ts +1 -1
  117. package/dist/mcp/auth/ownership.d.ts +19 -19
  118. package/dist/mcp/auth/principal.d.ts +1 -1
  119. package/dist/mcp/auth/resource-server.d.ts +1 -1
  120. package/dist/mcp/auth/self-hosted/browser.js +20 -6
  121. package/dist/mcp/auth/self-hosted/cli.d.ts +1 -1
  122. package/dist/mcp/auth/self-hosted/credentials.d.ts +1 -1
  123. package/dist/mcp/auth/self-hosted/rate-limit.d.ts +1 -1
  124. package/dist/mcp/auth/self-hosted/session.d.ts +1 -1
  125. package/dist/mcp/context.d.ts +1 -1
  126. package/dist/mcp/server.d.ts +1 -1
  127. package/dist/mcp/shared/page-style.d.ts +16 -0
  128. package/dist/mcp/shared/page-style.js +129 -0
  129. package/dist/mcp/tasks/manager.d.ts +1 -1
  130. package/dist/mcp/tools/agents.js +1 -1
  131. package/dist/mcp/tools/datastore.js +1 -1
  132. package/dist/mcp/tools/scheduling.js +1 -1
  133. package/dist/mcp/tools/secret-elicitation-form.d.ts +1 -1
  134. package/dist/mcp/tools/secret-elicitation-form.js +10 -28
  135. package/dist/mcp/tools/secret-elicitation.d.ts +1 -1
  136. package/dist/mcp/tools/subagents.js +1 -1
  137. package/dist/mcp/tools/tools.js +1 -1
  138. package/dist/mcp/transport/streamable-http.d.ts +1 -1
  139. package/dist/mcp/unattended-schedules.d.ts +1 -1
  140. package/dist/mcp/webhooks/ingress.d.ts +1 -1
  141. package/dist/providers/auth/index.d.ts +1 -1
  142. package/dist/providers/auth/self-hosted.d.ts +2 -2
  143. package/dist/providers/coding-proxy/prisma-ledger.d.ts +1 -1
  144. package/dist/providers/coding-proxy/runtime.d.ts +1 -1
  145. package/dist/providers/datastore/postgres.d.ts +1 -1
  146. package/dist/providers/executor/build.d.ts +1 -1
  147. package/dist/providers/executor/composition.d.ts +1 -1
  148. package/dist/providers/executor/container.d.ts +1 -1
  149. package/dist/providers/executor/container.js +10 -3
  150. package/dist/providers/executor/dbos.d.ts +1 -1
  151. package/dist/providers/jobs/docker.d.ts +11 -0
  152. package/dist/providers/jobs/docker.js +34 -18
  153. package/dist/providers/jobs/kubernetes.js +5 -10
  154. package/dist/providers/jobs/types.d.ts +2 -0
  155. package/dist/providers/memory/postgres.d.ts +1 -1
  156. package/dist/providers/vcs/git.js +2 -1
  157. package/dist/quickstart/config.d.ts +30 -0
  158. package/dist/quickstart/config.js +106 -0
  159. package/dist/quickstart/index.d.ts +5 -0
  160. package/dist/quickstart/index.js +527 -0
  161. package/dist/quickstart/migrate.d.ts +23 -0
  162. package/dist/quickstart/migrate.js +125 -0
  163. package/dist/wardby-bin.js +35 -9
  164. package/package.json +22 -9
  165. package/prisma/migrate.config.mjs +20 -0
  166. package/prisma/schema.prisma +10 -2
  167. package/dist/providers/auth/release-gate.d.ts +0 -1
  168. package/dist/providers/auth/release-gate.js +0 -4
package/README.md CHANGED
@@ -1,79 +1,175 @@
1
1
  <div>
2
- <img align="left" hspace="24" src="docs/assets/brand/wardby-mascot.png" alt="Wardby guardian robot protecting an agent budget" width="280">
2
+ <img align="left" hspace="24" src="https://raw.githubusercontent.com/wardby/wardby/main/docs/assets/brand/wardby-mascot.png" alt="Wardby guardian robot protecting an agent budget" width="280">
3
3
  <h3><big><big>Wardby</big></big> <small><em>(pronounced&nbsp;“WARD&#8209;bee”)</em></small></h3>
4
4
  <h3>Autonomous agents, bounded by design.</h3>
5
- <p><strong>Most agent runners focus on helping a model complete a task. Wardby is the self-hosted control plane that decides whether the task should run, limits what it can access, and returns a reviewable outcome governed by explicit policy.</strong></p>
5
+ <p><strong>Agent runners help a model complete a task. Wardby is the self-hosted control plane that governs the work around it: whether it may run, what it may access, what it may spend, and what reviewable outcome it may produce.</strong></p>
6
6
  <br clear="left">
7
7
  <p><strong>Budgets are enforced before spend: every model request must fit within a hard run limit before it reaches the provider.</strong></p>
8
+ <p><strong>Bring your providers. Keep your infrastructure. Govern agents in one place.</strong></p>
8
9
  <p>
10
+ <a href="#get-started">Get started</a> ·
9
11
  <a href="#why-wardby">Why Wardby</a> ·
10
- <a href="#why-wardby-instead-of-another-agent-runner">Why it is different</a> ·
12
+ <a href="#where-wardby-fits">Where it fits</a> ·
11
13
  <a href="#a-full-cycle-agent-from-one-conversation">Full-cycle example</a> ·
12
14
  <a href="#host-it-in-your-cloud">Deployments</a> ·
13
15
  <a href="#bring-your-own-observability">Observability</a> ·
14
- <a href="#quickstart">Quickstart</a> ·
15
16
  <a href="#security-boundaries">Security</a>
16
17
  </p>
17
18
  </div>
18
19
  <br clear="left">
19
20
 
20
- <!-- GitHub does not expose live Actions badge images for private repositories. These capability badges link authenticated readers to the authoritative workflow. -->
21
-
22
- [![Security CI](https://img.shields.io/badge/security%20CI-GitHub%20Actions-2088FF?logo=githubactions&logoColor=white)](https://github.com/wardby/wardby/actions/workflows/security.yml?query=branch%3Amain)
21
+ <!-- The first four badges are live: the npm version, Node floor and license are
22
+ read from the published package, and the security badge shows the latest run of
23
+ the security workflow on main. The last three are capability labels describing
24
+ what that workflow enforces -- they are not status and never change colour.
25
+ Every URL is absolute because npm renders this README too, and a relative path
26
+ there resolves against npmjs.com instead of this repository. -->
27
+
28
+ [![npm](https://img.shields.io/npm/v/@wardby/cli)](https://www.npmjs.com/package/@wardby/cli)
29
+ [![Security checks](https://github.com/wardby/wardby/actions/workflows/security.yml/badge.svg?branch=main)](https://github.com/wardby/wardby/actions/workflows/security.yml?query=branch%3Amain)
30
+ [![Node](https://img.shields.io/node/v/@wardby/cli)](https://www.npmjs.com/package/@wardby/cli)
31
+ [![License](https://img.shields.io/npm/l/@wardby/cli)](https://github.com/wardby/wardby/blob/main/LICENSE)
23
32
  [![Dependency audit](https://img.shields.io/badge/dependencies-audit%20policy-0f766e.svg)](https://github.com/wardby/wardby/actions/workflows/security.yml?query=branch%3Amain)
24
33
  [![Container scan](https://img.shields.io/badge/container%20images-Trivy%20CRITICAL%20gate-0f766e.svg)](https://github.com/wardby/wardby/actions/workflows/security.yml?query=branch%3Amain)
25
34
  [![SBOM](https://img.shields.io/badge/SBOM-SPDX%20JSON-0f766e.svg)](https://github.com/wardby/wardby/actions/workflows/security.yml?query=branch%3Amain)
26
- [![License](https://img.shields.io/badge/license-Apache--2.0-0f766e.svg)](LICENSE)
27
35
 
28
36
  > **Project status:** the control plane, scheduler, budget groups, MCP server,
29
37
  > native agents, isolated Codex and Claude Code workers, GitHub draft-PR flow,
30
38
  > and local observability stack are implemented and tested. Production
31
39
  > readiness and cloud deployment coverage are still being expanded.
32
40
 
41
+ ## Get started
42
+
43
+ ### Run locally in five minutes
44
+
45
+ Requirements: Node.js 24 or newer, Docker, and an OpenAI or Anthropic API key.
46
+ You do not need to clone Wardby or install PostgreSQL.
47
+
48
+ 1. From the project where you want to use Wardby, run:
49
+
50
+ ```sh
51
+ npx --yes @wardby/cli@latest quickstart
52
+ ```
53
+
54
+ 2. Follow the prompts to choose a provider, start PostgreSQL, create a `$1`
55
+ demo agent, and optionally connect Codex or Claude Code through MCP.
56
+
57
+ 3. Verify the installation:
58
+
59
+ ```sh
60
+ npx --yes @wardby/cli@latest doctor
61
+ ```
62
+
63
+ Quickstart keeps credentials and local state under `.wardby/` in the current
64
+ project. Read the [local getting-started guide](https://github.com/wardby/wardby/blob/main/docs/getting-started.md)
65
+ for unattended setup, lifecycle commands, MCP configuration, and cleanup.
66
+
67
+ ### Develop Wardby from source
68
+
69
+ Clone the repository only when you want to contribute to Wardby, inspect its
70
+ deployment assets, or build images yourself:
71
+
72
+ ```sh
73
+ git clone https://github.com/wardby/wardby.git
74
+ cd wardby
75
+ npm ci
76
+ npm run build
77
+ npm test
78
+ ```
79
+
80
+ Continue with [CONTRIBUTING.md](https://github.com/wardby/wardby/blob/main/CONTRIBUTING.md)
81
+ for the development database, migrations, required checks, and contribution
82
+ expectations.
83
+
84
+ ### Deploy for a team
85
+
86
+ - Follow the [GKE guide](https://github.com/wardby/wardby/blob/main/docs/getting-started-gke.md)
87
+ for the supported Google Cloud reference deployment.
88
+ - Start from the [portable production boundary](https://github.com/wardby/wardby/blob/main/deploy/production/README.md)
89
+ for another cloud, VM, or container platform.
90
+ - Follow [Bring your own identity provider](https://github.com/wardby/wardby/blob/main/docs/getting-started-identity-provider.md)
91
+ to protect remote MCP with your existing OAuth/OIDC provider.
92
+
33
93
  ## Why Wardby
34
94
 
35
95
  AI agents are easy to demo and harder to operate. Once an agent can spend
36
96
  money, use credentials, change a repository, or run without a person watching,
37
97
  teams need more than a prompt and a cron job.
38
98
 
99
+ ### One control plane instead of scattered automation
100
+
101
+ Teams often begin with Claude Code or Codex on developer machines,
102
+ repository-specific automation, and separate provider dashboards. As adoption
103
+ grows, agent definitions, ownership, credentials, budgets, schedules, and run
104
+ history become fragmented across tools and repositories.
105
+
106
+ Wardby gives every Wardby-managed agent one durable operational identity: who
107
+ owns it, why it exists, what it may access, when it runs, what it may spend,
108
+ and what outcome it produced.
109
+
39
110
  Wardby provides the control plane around the model:
40
111
 
41
- | For engineering leaders | For developers |
42
- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
43
- | Put explicit cost, ownership, and approval boundaries around agent work. | Create and manage agents from Claude or Codex through MCP. |
44
- | Keep execution, data, and credentials in infrastructure your team controls. | Choose OpenAI, Anthropic, or Bedrock-backed models per agent. |
45
- | Turn one-off experiments into scheduled, observable operating processes. | Attach scoped tools, secrets, schedules, memory, and sub-agents. |
46
- | Keep approval and action authority explicit for consequential outcomes. | Run optional coding tasks in isolated Codex or Claude Code workers that produce draft PRs. |
112
+ | For engineering leaders | For developers |
113
+ | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
114
+ | Keep an inventory of owned agents, purposes, schedules, limits, and results. | Create and manage agents from Claude or Codex through MCP. |
115
+ | See reserved budget and actual usage across Wardby-managed agents. | Choose OpenAI, Anthropic, or Bedrock-backed models per agent. |
116
+ | Keep execution, data, and credentials in infrastructure your team controls. | Switch approved models or builders without rewriting the governance contract. |
117
+ | Turn one-off experiments into scheduled, observable operating processes. | Attach scoped tools, secrets, schedules, memory, and sub-agents. |
118
+ | Keep approval and action authority explicit for consequential outcomes. | Run optional coding tasks in isolated Codex or Claude Code workers that produce draft PRs. |
47
119
 
48
120
  The result is not another autonomous black box. It is a way to make agent work
49
121
  repeatable, bounded, inspectable, and reviewable.
50
122
 
51
- ## Why Wardby instead of another agent runner?
123
+ ## Where Wardby fits
52
124
 
53
125
  Agent tools solve different layers of the problem. Wardby does not need to
54
126
  replace them: it provides the self-hosted operating boundary around agents and
55
127
  the work they perform.
56
128
 
57
- | Category | What it primarily helps you do | What Wardby adds |
58
- | -------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
59
- | **Agent frameworks** | Build reasoning loops, tool calls, and multi-agent logic. | Persistent ownership, schedules, budgets, credentials, run history, and lifecycle control. |
60
- | **Coding agents** | Plan, edit, and test code for an interactive task. | Isolated managed workers, admission-time budgets, scoped access, and optional draft PRs. |
61
- | **Hosted agent platforms** | Start quickly on infrastructure operated by another vendor. | A control plane, data, credentials, and execution boundary you can host in your own cloud. |
62
- | **Workflow orchestrators** | Make application jobs durable, retryable, and observable. | Agent-specific policy, model usage, capabilities, budgets, and MCP-native operations. |
63
-
64
- The distinction is control, not just execution. Wardby reserves spend before a
65
- run starts, grants only assigned capabilities, records what happened, and
66
- keeps downstream action authority separate from the worker that produced the
67
- result.
68
-
69
- ## One control plane, the full lifecycle
70
-
71
- ![Wardby workflow: ask in Claude or Codex, define an agent through MCP, govern it in Wardby, execute it in isolation, and apply review policy to its outcome](docs/assets/wardby-workflow.svg)
72
-
73
- Claude and Codex are the operator experience. Wardby is the durable system
74
- behind them: it stores agent definitions, triggers work, reserves budget,
75
- mediates tools and credentials, records outcomes, and exposes run state through
76
- MCP.
129
+ | Category | What it primarily helps you do | What Wardby adds |
130
+ | --------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
131
+ | **Repository automation** | Run jobs for one repository in response to delivery events. | One agent catalog, budget model, and policy boundary across repositories and triggers. |
132
+ | **Agent frameworks** | Build reasoning loops, tool calls, and multi-agent logic. | Persistent ownership, schedules, budgets, credentials, run history, and lifecycle control. |
133
+ | **Coding agents** | Plan, edit, and test code for an interactive task. | Isolated managed workers, admission-time budgets, scoped access, and optional draft PRs. |
134
+ | **Provider dashboards** | Report usage and cost within one model provider. | Agent-owned budgets, capabilities, runs, and outcomes across approved providers. |
135
+ | **LLM gateways** | Route model requests, manage keys, and enforce quotas. | Budgets tied to named agents, owned runs, capabilities, schedules, and outcomes. |
136
+ | **Observability platforms** | Trace requests, evaluate quality, and explain cost. | Admission and execution controls applied before work occurs, plus a durable agent catalog. |
137
+ | **Vendor control planes** | Govern agents inside one provider or cloud ecosystem. | A self-hosted boundary spanning approved providers, builders, repositories, and clouds. |
138
+ | **Workflow orchestrators** | Make application jobs durable, retryable, and observable. | Agent-specific policy, model usage, capabilities, budgets, and MCP-native operations. |
139
+
140
+ The distinction is governed work, not just model calls or execution. Rather
141
+ than assembling a gateway, scheduler, agent catalog, budget service,
142
+ capability registry, and run database, Wardby provides one operating boundary.
143
+ It reserves spend before a run starts, grants only assigned capabilities,
144
+ records what happened, and keeps downstream action authority separate from the
145
+ worker that produced the result.
146
+
147
+ > **Scope:** Wardby's inventory and budget views cover work managed through
148
+ > Wardby. Provider reconciliation and unmanaged-agent discovery are required
149
+ > before those views can represent every AI agent or expense in an
150
+ > organization.
151
+
152
+ ## One operational contract, the full lifecycle
153
+
154
+ ![Wardby workflow: ask in Claude or Codex, define an agent through MCP, govern it in Wardby, execute it in isolation, and apply review policy to its outcome](https://raw.githubusercontent.com/wardby/wardby/main/docs/assets/wardby-workflow.svg)
155
+
156
+ Claude and Codex are the operator experience. Wardby is the durable operating
157
+ boundary between intent and agent execution: it stores agent definitions,
158
+ triggers work, reserves budget, mediates tools and credentials, records
159
+ outcomes, and exposes run state through MCP. Nothing runs until identity,
160
+ policy, and available budget agree.
161
+
162
+ ### Governed shared state for agent teams
163
+
164
+ Named Wardby datastores let related agents exchange persistent structured data
165
+ without sharing an unrestricted database credential. Datastores are owned and
166
+ attached to agents explicitly; each sandboxed tool can reach only approved
167
+ bound names and key prefixes.
168
+
169
+ A planner can publish a feature plan, a builder can record implementation
170
+ state, and a reviewer or QA agent can add findings to the same governed
171
+ workspace. Datastores provide bounded coordination state, not a replacement
172
+ for authoritative source systems or searchable agent memory.
77
173
 
78
174
  ## A full-cycle agent from one conversation
79
175
 
@@ -100,13 +196,17 @@ Claude or Codex can translate that request into Wardby MCP operations such as
100
196
 
101
197
  The same agent can be updated, paused, triggered, inspected, or deleted from an
102
198
  MCP conversation. The CLI remains available as the bootstrap and operations
103
- floor.
199
+ floor. The result is autonomy with a receipt: an owned run with bounded spend,
200
+ assigned capabilities, durable status, and a reviewable outcome.
104
201
 
105
202
  ## Agent ecosystems you can compose
106
203
 
107
204
  Wardby provides lifecycle primitives rather than prescribing one fixed catalog.
108
205
  These are example systems a team can build and manage through MCP:
109
206
 
207
+ **Builders can vary. The controls do not.** Each system inherits the same
208
+ budget, capability, identity, evidence, and review contract.
209
+
110
210
  | Agent system | Typical cycle | Governed outcome |
111
211
  | ------------------------ | ------------------------------------------------------------------ | ------------------------------------ |
112
212
  | **Delivery pipeline** | Work request → plan → implementation → tests → review | Optional draft feature or bug-fix PR |
@@ -122,31 +222,33 @@ own model, tools, schedule, and run history.
122
222
 
123
223
  ## Host it in your cloud
124
224
 
225
+ **Bring your providers. Keep your infrastructure. Govern agents in one place.**
226
+
125
227
  The core does not import a cloud SDK. Jobs, model access, email, secrets,
126
228
  authentication, and object storage sit behind provider interfaces so operators
127
- can choose the infrastructure boundary that fits their environment.
128
-
129
- | Target | Current support |
130
- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
131
- | **Local Docker, VM, or on-premises** | Portable PostgreSQL and container workflow for development and self-hosting. |
132
- | **Production container baseline** | Separate runtime and migration images plus a Compose/Caddy reference boundary. |
133
- | **GCP** | Terraform reference for the control plane on Cloud Run and Cloud SQL. Cloud-native coding jobs and production observability are follow-on work. |
134
- | **AWS** | The portable runtime and Bedrock model adapter are available; a native AWS deployment module is planned. |
135
- | **Other clouds** | Run the production image and provide equivalent PostgreSQL, secrets, ingress, egress, and monitoring controls. |
136
-
137
- Start with [deployment targets](deploy/README.md), the
138
- [portable production boundary](deploy/production/README.md), or the
139
- [GCP setup guide](deploy/gcp/SETUP.md). Reference deployments are examples,
229
+ can choose the infrastructure boundary that fits their environment. Models,
230
+ coding executors, cloud platforms, and observability systems can change
231
+ independently instead of defining the agent architecture. This reduces
232
+ control-plane lock-in without pretending that source control, model providers,
233
+ or monitoring systems disappear.
234
+
235
+ | Target | Current support |
236
+ | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
237
+ | **Local Docker, VM, or on-premises** | Portable PostgreSQL and container workflow for development and self-hosting. |
238
+ | **Production container baseline** | Separate runtime and migration images plus a Compose/Caddy reference boundary. |
239
+ | **GKE Autopilot** | Supported GCP reference with private Cloud SQL, isolated Codex worker pods, HTTPS Gateway, and immutable images. |
240
+ | **AWS** | The portable runtime and Bedrock model adapter are available; a native AWS deployment module is planned. |
241
+ | **Other clouds** | Run the production image and provide equivalent PostgreSQL, secrets, ingress, egress, and monitoring controls. |
242
+
243
+ Start with [deployment targets](https://github.com/wardby/wardby/blob/main/deploy/README.md), the
244
+ [portable production boundary](https://github.com/wardby/wardby/blob/main/deploy/production/README.md), or the
245
+ [GKE getting-started guide](https://github.com/wardby/wardby/blob/main/docs/getting-started-gke.md). Reference deployments are examples,
140
246
  not a requirement to use one vendor.
141
247
 
142
- **A complete deployment runs more than `wardby mcp`.** `mcp` serves the MCP
143
- surface; the scheduler that fires due agents and the reconciler that recovers
144
- orphaned runs live in `wardby scheduler`. Run **`wardby serve`** to get all three
145
- in one process. It is the container image's default command and what a
146
- single-container deployment (Cloud Run, a lone VM) should run. Alternatively,
147
- run `mcp` and `scheduler` as two processes, as `deploy/production/compose.yml`
148
- does. Running `mcp` alone logs a startup warning if enabled schedules exist
149
- that nothing will fire.
248
+ For a single-container deployment, run **`wardby serve`** to start MCP, the
249
+ scheduler, and reconciliation together. Split deployments can run `wardby mcp`
250
+ and `wardby scheduler` separately; `mcp` alone does not fire schedules. See the
251
+ deployment guides above for the complete process boundary.
150
252
 
151
253
  ## Bring your own observability
152
254
 
@@ -172,7 +274,7 @@ npm run observability:down
172
274
  The included cloud deployments do not yet provision AWS or GCP collectors.
173
275
  Current metrics primarily cover the coding proxy; application/MCP metrics,
174
276
  production alerts, and SLOs remain operator responsibilities. See the
175
- [observability guide](docs/observability.md) for boundaries and retention.
277
+ [observability guide](https://github.com/wardby/wardby/blob/main/docs/observability.md) for boundaries and retention.
176
278
 
177
279
  ## Security boundaries
178
280
 
@@ -195,48 +297,33 @@ production alerts, and SLOs remain operator responsibilities. See the
195
297
  - **Sanitized operations:** lifecycle events and metrics exclude prompts,
196
298
  repository content, credentials, diffs, and raw worker output.
197
299
 
198
- Read the [runtime architecture](docs/architecture-runtime.md),
199
- [coding-worker isolation model](docs/coding-worker-isolation.md), and
200
- [security deployment guide](docs/security-deployment.md) before enabling a
300
+ Read the [runtime architecture](https://github.com/wardby/wardby/blob/main/docs/architecture-runtime.md),
301
+ [coding-worker isolation model](https://github.com/wardby/wardby/blob/main/docs/coding-worker-isolation.md), and
302
+ [security deployment guide](https://github.com/wardby/wardby/blob/main/docs/security-deployment.md) before enabling a
201
303
  production repository.
202
304
 
203
305
  Review policy is designed to support designated agents as well as people.
204
306
  Agent approvals will be recorded as workflow evidence; operators will decide
205
307
  whether that evidence permits an automated action or still requires a person.
206
308
 
207
- ## Quickstart
208
-
209
- Requirements: Node.js 24 or newer, Docker, and one supported model-provider
210
- credential.
211
-
212
- ```sh
213
- git clone https://github.com/wardby/wardby.git
214
- cd wardby
215
- npm ci
216
- cp .env.example .env
217
- ```
309
+ ## Optional npm installation
218
310
 
219
- Edit `.env` and set `OPENAI_API_KEY` or `ANTHROPIC_API_KEY`. Generate a local
220
- secret-encryption key with `openssl rand -hex 32` and use it as
221
- `SECRET_APP_KEY`. Then initialize the local database and start the stdio MCP
222
- server:
311
+ The `npx` quickstart above requires no installation. To pin Wardby as a local
312
+ project dependency instead:
223
313
 
224
314
  ```sh
225
- npm run db:up
226
- npm run prisma:generate
227
- npm run prisma:migrate
228
- npm run cli -- mcp
315
+ npm install @wardby/cli
229
316
  ```
230
317
 
231
- Point Claude or Codex at `npm run cli -- mcp` with the repository as its working
232
- directory. The exact client configuration format differs, but both use Wardby's
233
- stdio transport locally. For shared or remote access, use Streamable HTTP with
234
- OAuth and the production boundary documented above.
318
+ That install is audit-clean: the published package carries no Prisma CLI,
319
+ `@prisma/config`, `deepmerge-ts`, or `mysql2`, so `npm audit` reports nothing
320
+ and no `overrides` entry is needed in your own `package.json`.
235
321
 
236
- Once connected, ask the client to list the available Wardby tools, create an
237
- agent with a small budget, trigger it, and inspect the run. Coding-agent setup
238
- additionally requires a dedicated GitHub App, immutable worker images, and the
239
- proxy boundary described in the [local coding-agent setup guide](docs/coding-agent-setup.md).
322
+ `wardby quickstart` and `wardby doctor` separately fetch the pinned Prisma CLI
323
+ (`prisma@7.10.0`) on demand via `npx` to run migrations, so the machine running
324
+ them needs npm registry access at that moment. See
325
+ [Images and dependencies](https://github.com/wardby/wardby/blob/main/docs/security-deployment.md#images-and-dependencies)
326
+ for the repository's own dependency-override policy.
240
327
 
241
328
  ## What is implemented
242
329
 
@@ -251,12 +338,12 @@ proxy boundary described in the [local coding-agent setup guide](docs/coding-age
251
338
  - In-process reconciliation and optional DBOS durable workflows.
252
339
  - Self-hosted or delegated OAuth for remote MCP access.
253
340
  - Prometheus metrics and provisioned Grafana dashboards for local operations.
254
- - Portable production images, a Compose/Caddy boundary, and a GCP control-plane
255
- Terraform reference.
341
+ - Portable production images, a Compose/Caddy boundary, and a GKE Autopilot
342
+ Terraform reference deployment.
256
343
 
257
344
  This project is under active development. Run the
258
- [release verification](docs/release-verification.md) checks and review the
259
- [security deployment guide](docs/security-deployment.md) before production use.
345
+ [release verification](https://github.com/wardby/wardby/blob/main/docs/release-verification.md) checks and review the
346
+ [security deployment guide](https://github.com/wardby/wardby/blob/main/docs/security-deployment.md) before production use.
260
347
 
261
348
  ## Repository map
262
349
 
@@ -273,10 +360,10 @@ docs/ Architecture, security, setup, and operator guidance
273
360
 
274
361
  ## License
275
362
 
276
- Apache License 2.0. See [LICENSE](LICENSE) for the license terms and
277
- [NOTICE](NOTICE) for attribution.
363
+ Apache License 2.0. See [LICENSE](https://github.com/wardby/wardby/blob/main/LICENSE) for the license terms and
364
+ [NOTICE](https://github.com/wardby/wardby/blob/main/NOTICE) for attribution.
278
365
 
279
- See [CONTRIBUTING.md](CONTRIBUTING.md) to contribute and [SECURITY.md](SECURITY.md)
366
+ See [CONTRIBUTING.md](https://github.com/wardby/wardby/blob/main/CONTRIBUTING.md) to contribute and [SECURITY.md](https://github.com/wardby/wardby/blob/main/SECURITY.md)
280
367
  to report a vulnerability privately.
281
368
 
282
- Built as an independent reimplementation. See [CLEANROOM.md](CLEANROOM.md).
369
+ Built as an independent reimplementation. See [CLEANROOM.md](https://github.com/wardby/wardby/blob/main/CLEANROOM.md).
@@ -2,15 +2,15 @@ services:
2
2
  postgres:
3
3
  image: postgres:16-alpine
4
4
  environment:
5
- POSTGRES_USER: wardby
6
- POSTGRES_PASSWORD: wardby
7
- POSTGRES_DB: wardby
5
+ POSTGRES_USER: ${WARDBY_POSTGRES_USER:-wardby}
6
+ POSTGRES_PASSWORD: ${WARDBY_POSTGRES_PASSWORD:-wardby}
7
+ POSTGRES_DB: ${WARDBY_POSTGRES_DB:-wardby}
8
8
  ports:
9
- - "55432:5432"
9
+ - "${WARDBY_POSTGRES_PORT:-55432}:5432"
10
10
  volumes:
11
11
  - wardby-postgres-data:/var/lib/postgresql/data
12
12
  healthcheck:
13
- test: ["CMD-SHELL", "pg_isready -U wardby -d wardby"]
13
+ test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
14
14
  interval: 5s
15
15
  timeout: 5s
16
16
  retries: 12
@@ -20,6 +20,7 @@ export declare const CLAUDE_OUTPUT_JSON_SCHEMA: {
20
20
  };
21
21
  readonly tag: {
22
22
  readonly type: "string";
23
+ readonly description: "Optional short label shown in the pull request title, such as a ticket id. At most 32 characters: letters, digits, '.', '_', '/', '-', starting with a letter or digit, with no spaces. Example: \"add-jokes\". Omit it when there is no natural label.";
23
24
  };
24
25
  readonly tests: {
25
26
  readonly type: "array";
@@ -13,7 +13,10 @@ export const CLAUDE_OUTPUT_JSON_SCHEMA = {
13
13
  runId: { type: "string" },
14
14
  outcome: { type: "string", enum: ["changes_ready", "no_changes", "budget_exhausted"] },
15
15
  summary: { type: "string" },
16
- tag: { type: "string" },
16
+ tag: {
17
+ type: "string",
18
+ description: "Optional short label shown in the pull request title, such as a ticket id. At most 32 characters: letters, digits, '.', '_', '/', '-', starting with a letter or digit, with no spaces. Example: \"add-jokes\". Omit it when there is no natural label.",
19
+ },
17
20
  tests: {
18
21
  type: "array",
19
22
  maxItems: 64,
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { readCodingInput, writeCodingOutputAtomic } from "../coding-worker/artifact.js";
3
- import { safeWorkerErrorCode } from "../coding-worker/errors.js";
3
+ import { safeOutputIssues, safeWorkerErrorCode } from "../coding-worker/errors.js";
4
4
  import { runClaudeCodingWorker } from "./driver.js";
5
5
  import { createClaudeSdkQuery } from "./sdk.js";
6
6
  const INPUT_PATH = "/run/wardby/input/input.json";
@@ -36,6 +36,7 @@ catch (error) {
36
36
  : safeCode === "worker_failed"
37
37
  ? `worker_${stage}_failed`
38
38
  : safeCode;
39
- process.stderr.write(`${JSON.stringify({ error: code })}\n`);
39
+ const issues = code === "coding_output_invalid" ? safeOutputIssues(error) : undefined;
40
+ process.stderr.write(`${JSON.stringify({ error: code, ...(issues ? { issues } : {}) })}\n`);
40
41
  process.exitCode = controller.signal.aborted ? 143 : 1;
41
42
  }
@@ -1 +1 @@
1
- export declare const CLI_USAGE = "usage:\n wardby agent create --name <n> --model <m> --prompt <p> --budget <usd> [--schedule \"<cron>\"] [--timezone <tz>] [--max-turns <n>]\n wardby agent list\n wardby agent schedule <name> --cron \"<expr>\" [--timezone <tz>] [--disable]\n wardby tool create --name <n> --description <d> --params <file> --code <file>\n wardby tool attach <tool-name> <agent-name>\n wardby tool detach <tool-name> <agent-name>\n wardby tool list [--agent <name>]\n wardby run <name>\n wardby runs [--agent <name>] [--limit N] [--status <s>]\n wardby coding preflight (JOB_LAUNCHER=docker or kubernetes)\n wardby coding cleanup --run-id <id>\n wardby scheduler [--scope default]\n wardby mcp (MCP_TRANSPORT=stdio|http selects the transport)\n wardby serve [--scope default] (mcp + scheduler + reconciler in one process; http only)\n wardby import <bundle-dir> --owner <subject> [--public] [--include-secrets --transfer-key <pem>] [--default-budget <usd>] [--dry-run] [--prefix <p>] [--on-conflict fail|skip|rename] [--allow-open-fetch]\n\noptions:\n -h, --help Show this help\n -v, --version Show the installed Wardby version";
1
+ export declare const CLI_USAGE = "usage:\n wardby quickstart [--provider openai|anthropic] [--model <m>] [--budget <usd>] [--client none|codex|claude|both] [--skip-demo] [--non-interactive --yes]\n wardby doctor\n wardby status\n wardby logs [--tail N] [--follow]\n wardby down [--volumes]\n wardby agent create --name <n> --model <m> --prompt <p> --budget <usd> [--schedule \"<cron>\"] [--timezone <tz>] [--max-turns <n>]\n wardby agent list\n wardby agent schedule <name> --cron \"<expr>\" [--timezone <tz>] [--disable]\n wardby tool create --name <n> --description <d> --params <file> --code <file>\n wardby tool attach <tool-name> <agent-name>\n wardby tool detach <tool-name> <agent-name>\n wardby tool list [--agent <name>]\n wardby run <name>\n wardby runs [--agent <name>] [--limit N] [--status <s>]\n wardby coding preflight (JOB_LAUNCHER=docker or kubernetes)\n wardby coding cleanup --run-id <id>\n wardby scheduler [--scope default]\n wardby mcp (MCP_TRANSPORT=stdio|http selects the transport)\n wardby serve [--scope default] (mcp + scheduler + reconciler in one process; http only)\n wardby import <bundle-dir> --owner <subject> [--public] [--include-secrets --transfer-key <pem>] [--default-budget <usd>] [--dry-run] [--prefix <p>] [--on-conflict fail|skip|rename] [--allow-open-fetch]\n\noptions:\n -h, --help Show this help\n -v, --version Show the installed Wardby version";
package/dist/cli-help.js CHANGED
@@ -1,4 +1,9 @@
1
1
  export const CLI_USAGE = `usage:
2
+ wardby quickstart [--provider openai|anthropic] [--model <m>] [--budget <usd>] [--client none|codex|claude|both] [--skip-demo] [--non-interactive --yes]
3
+ wardby doctor
4
+ wardby status
5
+ wardby logs [--tail N] [--follow]
6
+ wardby down [--volumes]
2
7
  wardby agent create --name <n> --model <m> --prompt <p> --budget <usd> [--schedule "<cron>"] [--timezone <tz>] [--max-turns <n>]
3
8
  wardby agent list
4
9
  wardby agent schedule <name> --cron "<expr>" [--timezone <tz>] [--disable]
package/dist/cli.js CHANGED
File without changes
@@ -6,10 +6,35 @@ export declare const MAX_CODING_SUMMARY_BYTES: number;
6
6
  export declare const MAX_CODING_TESTS = 64;
7
7
  export declare const MAX_CODING_TEST_COMMAND_BYTES: number;
8
8
  export declare const MAX_TAG_BYTES = 32;
9
+ /**
10
+ * A worker's output-schema failure, reduced to where and how it failed, never
11
+ * what the model wrote: `<path>:<zod issue code>`, where the path is dot-joined
12
+ * schema keys and array indices (`$` for the root). Unrecognized keys the model
13
+ * invented are carried only as the `unrecognized_keys` code, never by name.
14
+ */
15
+ export declare const MAX_CODING_OUTPUT_ISSUES = 8;
16
+ export declare const SAFE_CODING_OUTPUT_ISSUE: RegExp;
9
17
  export declare function normalizeGitHubRepository(value: string): string;
10
18
  export declare function normalizeGitRef(value: string): string;
11
19
  export declare const CodingBaseRefSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
12
20
  export declare const CodingTaskOverrideSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
21
+ /**
22
+ * A coding worker receives only its task text, so a coding agent's own
23
+ * instructions (its systemPrompt) travel inside that text, ahead of the
24
+ * request. Blank instructions leave the task unchanged. The combination must
25
+ * still fit MAX_CODING_TASK_BYTES; exceeding it is an error naming both parts
26
+ * rather than a silent truncation of either.
27
+ */
28
+ export declare function composeCodingTask(instructions: string | null | undefined, task: string): string;
29
+ /**
30
+ * The tag only labels a pull request title, so a model's malformed tag must not
31
+ * sink an otherwise finished run. A tag that already passes is kept as-is; any
32
+ * other string becomes a lowercase slug (runs of disallowed characters to "-",
33
+ * no leading or trailing punctuation, at most MAX_TAG_BYTES), and one with
34
+ * nothing usable left, or a non-string, becomes null. GitHub finalization still
35
+ * re-validates whatever survives.
36
+ */
37
+ export declare function normalizeCodingTag(value: unknown): string | null | undefined;
13
38
  export declare const CodingTaskInputSchema: z.ZodEffects<z.ZodObject<{
14
39
  schemaVersion: z.ZodLiteral<1>;
15
40
  runId: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
@@ -103,7 +128,7 @@ export declare const CodingAgentOutputSchema: z.ZodEffects<z.ZodObject<{
103
128
  command: string;
104
129
  outcome: "passed" | "failed" | "skipped";
105
130
  }>, "many">;
106
- tag: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | undefined, string | null | undefined>;
131
+ tag: z.ZodEffects<z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | undefined, string | null | undefined>, string | undefined, unknown>;
107
132
  }, "strict", z.ZodTypeAny, {
108
133
  outcome: "changes_ready" | "no_changes" | "budget_exhausted";
109
134
  schemaVersion: 1;
@@ -123,7 +148,7 @@ export declare const CodingAgentOutputSchema: z.ZodEffects<z.ZodObject<{
123
148
  command: string;
124
149
  outcome: "passed" | "failed" | "skipped";
125
150
  }[];
126
- tag?: string | null | undefined;
151
+ tag?: unknown;
127
152
  }>, {
128
153
  tag?: string | undefined;
129
154
  summary: string;
@@ -143,7 +168,7 @@ export declare const CodingAgentOutputSchema: z.ZodEffects<z.ZodObject<{
143
168
  command: string;
144
169
  outcome: "passed" | "failed" | "skipped";
145
170
  }[];
146
- tag?: string | null | undefined;
171
+ tag?: unknown;
147
172
  }>;
148
173
  export declare const CodingRunResultSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
149
174
  schemaVersion: z.ZodLiteral<1>;