@wardby/cli 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +5 -5
- package/README.md +6 -1
- package/deploy/local/docker-compose.quickstart-coding.yml +6 -0
- package/dist/claude-coding-worker/driver.d.ts +12 -0
- package/dist/claude-coding-worker/driver.js +29 -7
- package/dist/claude-coding-worker/main.js +5 -1
- package/dist/claude-coding-worker/sdk.js +17 -1
- package/dist/claude-plugin/command.d.ts +61 -0
- package/dist/claude-plugin/command.js +376 -0
- package/dist/cli-help.d.ts +1 -1
- package/dist/cli-help.js +2 -1
- package/dist/cli.js +47 -3
- package/dist/coding/code-host.d.ts +16 -0
- package/dist/coding/code-host.js +60 -0
- package/dist/coding/mcp-token.d.ts +12 -0
- package/dist/coding/mcp-token.js +26 -0
- package/dist/coding/protocol.js +2 -0
- package/dist/coding/redact.js +6 -1
- package/dist/coding/transcript/recorder.d.ts +5 -4
- package/dist/coding/transcript/recorder.js +1 -1
- package/dist/coding-worker/debug-trace.d.ts +3 -1
- package/dist/coding-worker/debug-trace.js +4 -2
- package/dist/coding-worker/driver.js +8 -1
- package/dist/coding-worker/main.js +5 -1
- package/dist/coding-worker/mcp-config.d.ts +27 -0
- package/dist/coding-worker/mcp-config.js +32 -0
- package/dist/coding-worker/sdk.d.ts +36 -0
- package/dist/coding-worker/sdk.js +28 -1
- package/dist/coding-worker/types.d.ts +4 -0
- package/dist/config/mcp-call-limit.d.ts +8 -0
- package/dist/config/mcp-call-limit.js +18 -0
- package/dist/config/mcp-servers.d.ts +8 -0
- package/dist/config/mcp-servers.js +12 -0
- package/dist/config/test-simulators.d.ts +10 -0
- package/dist/config/test-simulators.js +28 -0
- package/dist/config/tool-timeout.d.ts +1 -0
- package/dist/config/tool-timeout.js +18 -0
- package/dist/core/coding-mcp.d.ts +36 -0
- package/dist/core/coding-mcp.js +253 -0
- package/dist/core/coding-repository.d.ts +46 -0
- package/dist/core/coding-repository.js +92 -0
- package/dist/core/delegation-slots.d.ts +27 -0
- package/dist/core/delegation-slots.js +44 -0
- package/dist/core/dispatch.d.ts +6 -2
- package/dist/core/dispatch.js +36 -11
- package/dist/core/error-code.js +1 -0
- package/dist/core/grants.d.ts +28 -3
- package/dist/core/grants.js +46 -4
- package/dist/core/host-events.js +7 -3
- package/dist/core/host-status.js +2 -2
- package/dist/core/issue-status.js +4 -3
- package/dist/core/mark-ready.d.ts +1 -1
- package/dist/core/mark-ready.js +1 -1
- package/dist/core/mcp-client/client.d.ts +47 -0
- package/dist/core/mcp-client/client.js +141 -0
- package/dist/core/mcp-client/jsonrpc.d.ts +15 -0
- package/dist/core/mcp-client/jsonrpc.js +54 -0
- package/dist/core/mcp-client/results.d.ts +13 -0
- package/dist/core/mcp-client/results.js +42 -0
- package/dist/core/mcp-servers.d.ts +90 -0
- package/dist/core/mcp-servers.js +230 -0
- package/dist/core/mcp-tools.d.ts +108 -0
- package/dist/core/mcp-tools.js +287 -0
- package/dist/core/merge-order-check.js +38 -19
- package/dist/core/notification-dispatcher.js +2 -1
- package/dist/core/related-pull-requests.js +26 -10
- package/dist/core/review-fix.js +2 -2
- package/dist/core/review-host-tools.js +3 -1
- package/dist/core/runner.d.ts +66 -16
- package/dist/core/runner.js +281 -73
- package/dist/core/secret-broker-config.d.ts +2 -0
- package/dist/core/secret-broker-config.js +1 -1
- package/dist/core/secret-guard.d.ts +5 -2
- package/dist/core/secret-guard.js +22 -7
- package/dist/core/secrets.d.ts +11 -1
- package/dist/core/secrets.js +27 -1
- package/dist/core/serializable-retry.d.ts +18 -0
- package/dist/core/serializable-retry.js +43 -0
- package/dist/core/tool-admin.d.ts +5 -1
- package/dist/core/tool-admin.js +7 -2
- package/dist/core/tool-names.d.ts +13 -0
- package/dist/core/tool-names.js +20 -0
- package/dist/core/webhooks.d.ts +4 -0
- package/dist/core/webhooks.js +68 -49
- package/dist/core/workflow-run-events.js +2 -1
- package/dist/generated/prisma/browser.d.ts +31 -0
- package/dist/generated/prisma/client.d.ts +31 -0
- package/dist/generated/prisma/commonInputTypes.d.ts +50 -50
- package/dist/generated/prisma/internal/class.d.ts +66 -0
- package/dist/generated/prisma/internal/class.js +4 -4
- package/dist/generated/prisma/internal/prismaNamespace.d.ts +530 -1
- package/dist/generated/prisma/internal/prismaNamespace.js +75 -2
- package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts +79 -0
- package/dist/generated/prisma/internal/prismaNamespaceBrowser.js +75 -2
- package/dist/generated/prisma/models/Agent.d.ts +271 -0
- package/dist/generated/prisma/models/AgentMcpServer.d.ts +1412 -0
- package/dist/generated/prisma/models/AgentMcpServer.js +1 -0
- package/dist/generated/prisma/models/AgentRepository.d.ts +40 -1
- package/dist/generated/prisma/models/AuthUser.d.ts +1 -1
- package/dist/generated/prisma/models/CodingAgentProfile.d.ts +0 -7
- package/dist/generated/prisma/models/CodingProxySession.d.ts +119 -2
- package/dist/generated/prisma/models/CodingRun.d.ts +76 -1
- package/dist/generated/prisma/models/HostProvider.d.ts +2176 -0
- package/dist/generated/prisma/models/HostProvider.js +1 -0
- package/dist/generated/prisma/models/HostProviderCredential.d.ts +1285 -0
- package/dist/generated/prisma/models/HostProviderCredential.js +1 -0
- package/dist/generated/prisma/models/HostProviderOperation.d.ts +1470 -0
- package/dist/generated/prisma/models/HostProviderOperation.js +1 -0
- package/dist/generated/prisma/models/HostProviderTrustedAccount.d.ts +1145 -0
- package/dist/generated/prisma/models/HostProviderTrustedAccount.js +1 -0
- package/dist/generated/prisma/models/McpServer.d.ts +1500 -0
- package/dist/generated/prisma/models/McpServer.js +1 -0
- package/dist/generated/prisma/models/NativeGatewayCall.d.ts +39 -1
- package/dist/generated/prisma/models/Principal.d.ts +167 -0
- package/dist/generated/prisma/models/ResourceGrant.d.ts +1 -1
- package/dist/generated/prisma/models/Secret.d.ts +387 -0
- package/dist/generated/prisma/models/Tool.d.ts +223 -1
- package/dist/generated/prisma/models.d.ts +6 -0
- package/dist/help/search.js +12 -3
- package/dist/help-index.json +719 -47
- package/dist/import/create.js +16 -1
- package/dist/import/neutral-schema.d.ts +1 -0
- package/dist/import/neutral-schema.js +2 -0
- package/dist/mcp/auth/grants-cli.d.ts +6 -4
- package/dist/mcp/auth/grants-cli.js +42 -3
- package/dist/mcp/auth/resource-server.d.ts +3 -1
- package/dist/mcp/auth/resource-server.js +17 -2
- package/dist/mcp/context.d.ts +3 -0
- package/dist/mcp/index.js +11 -0
- package/dist/mcp/tools/agents.js +100 -15
- package/dist/mcp/tools/grants.js +66 -28
- package/dist/mcp/tools/host-providers.d.ts +2 -0
- package/dist/mcp/tools/host-providers.js +215 -0
- package/dist/mcp/tools/mcp-servers.d.ts +26 -0
- package/dist/mcp/tools/mcp-servers.js +481 -0
- package/dist/mcp/tools/repositories.js +50 -10
- package/dist/mcp/tools/runs.js +178 -18
- package/dist/mcp/tools/secret-elicitation.d.ts +2 -0
- package/dist/mcp/tools/secret-elicitation.js +25 -2
- package/dist/mcp/tools/secrets.js +38 -4
- package/dist/mcp/tools/tools.d.ts +6 -4
- package/dist/mcp/tools/tools.js +40 -8
- package/dist/mcp/tools/trigger.js +28 -6
- package/dist/mcp/transport/http-limits.d.ts +2 -0
- package/dist/mcp/transport/http-limits.js +6 -2
- package/dist/mcp/webhooks/ingress.js +10 -0
- package/dist/native-worker/gateway-server.d.ts +14 -0
- package/dist/native-worker/gateway-server.js +28 -7
- package/dist/native-worker/gateway.d.ts +2 -0
- package/dist/native-worker/gateway.js +5 -1
- package/dist/native-worker/http-server.d.ts +4 -0
- package/dist/native-worker/http-server.js +51 -0
- package/dist/native-worker/ledger.d.ts +6 -2
- package/dist/native-worker/ledger.js +5 -4
- package/dist/native-worker/protocol.d.ts +1 -0
- package/dist/native-worker/protocol.js +4 -1
- package/dist/providers/coding-proxy/capability-hash.d.ts +2 -0
- package/dist/providers/coding-proxy/capability-hash.js +5 -0
- package/dist/providers/coding-proxy/mcp-route.d.ts +34 -0
- package/dist/providers/coding-proxy/mcp-route.js +166 -0
- package/dist/providers/coding-proxy/memory-ledger.d.ts +2 -0
- package/dist/providers/coding-proxy/memory-ledger.js +15 -0
- package/dist/providers/coding-proxy/prisma-ledger.d.ts +1 -0
- package/dist/providers/coding-proxy/prisma-ledger.js +30 -2
- package/dist/providers/coding-proxy/proxy.d.ts +7 -1
- package/dist/providers/coding-proxy/proxy.js +134 -34
- package/dist/providers/coding-proxy/runtime.d.ts +6 -0
- package/dist/providers/coding-proxy/runtime.js +32 -1
- package/dist/providers/coding-proxy/server.d.ts +3 -0
- package/dist/providers/coding-proxy/server.js +10 -0
- package/dist/providers/coding-proxy/types.d.ts +13 -0
- package/dist/providers/executor/composition.js +5 -0
- package/dist/providers/executor/container.d.ts +33 -1
- package/dist/providers/executor/container.js +76 -7
- package/dist/providers/host-tools/invoke.d.ts +37 -0
- package/dist/providers/host-tools/invoke.js +117 -0
- package/dist/providers/host-tools/operations.d.ts +65 -0
- package/dist/providers/host-tools/operations.js +149 -0
- package/dist/providers/host-tools/registry.d.ts +79 -0
- package/dist/providers/host-tools/registry.js +362 -0
- package/dist/providers/host-tools/request-guard.d.ts +17 -0
- package/dist/providers/host-tools/request-guard.js +99 -0
- package/dist/providers/host-tools/self-test.d.ts +64 -0
- package/dist/providers/host-tools/self-test.js +142 -0
- package/dist/providers/jobs/docker-isolation.d.ts +2 -2
- package/dist/providers/jobs/docker-isolation.js +30 -8
- package/dist/providers/jobs/docker.d.ts +8 -0
- package/dist/providers/jobs/docker.js +33 -9
- package/dist/providers/jobs/kubernetes-isolation.d.ts +3 -1
- package/dist/providers/jobs/kubernetes-isolation.js +15 -2
- package/dist/providers/jobs/kubernetes.d.ts +5 -0
- package/dist/providers/jobs/kubernetes.js +6 -1
- package/dist/providers/jobs/types.d.ts +6 -0
- package/dist/providers/review-host/types.d.ts +6 -4
- package/dist/providers/review-host/types.js +1 -1
- package/dist/providers/vcs/git.d.ts +6 -2
- package/dist/providers/vcs/git.js +15 -4
- package/dist/providers/vcs/github.d.ts +2 -71
- package/dist/providers/vcs/github.js +8 -11
- package/dist/providers/vcs/index.d.ts +1 -1
- package/dist/providers/vcs/index.js +1 -1
- package/dist/providers/vcs/remote.d.ts +4 -0
- package/dist/providers/vcs/remote.js +7 -1
- package/dist/providers/vcs/routing.d.ts +12 -6
- package/dist/providers/vcs/routing.js +21 -6
- package/dist/providers/vcs/types.d.ts +71 -3
- package/dist/quickstart/index.d.ts +5 -0
- package/dist/quickstart/index.js +21 -0
- package/dist/quickstart-images.json +1 -1
- package/dist/sandbox/eval-core.d.ts +12 -2
- package/dist/sandbox/eval-core.js +20 -4
- package/dist/sandbox/host-functions.d.ts +4 -0
- package/dist/sandbox/host-functions.js +7 -2
- package/dist/sandbox/limits.d.ts +4 -1
- package/dist/sandbox/limits.js +4 -1
- package/dist/sandbox/run-in-sandbox.d.ts +6 -0
- package/dist/sandbox/run-in-sandbox.js +14 -2
- package/dist/sandbox/safe-fetch.d.ts +2 -0
- package/dist/sandbox/safe-fetch.js +1 -1
- package/dist/sandbox/secret-broker.d.ts +1 -0
- package/dist/sandbox/secret-broker.js +1 -1
- package/dist/sandbox/tool-timeout.d.ts +32 -0
- package/dist/sandbox/tool-timeout.js +52 -0
- package/dist/sandbox/user-tool.d.ts +8 -1
- package/dist/sandbox/user-tool.js +9 -3
- package/dist/viewer/graph.js +2 -1
- package/dist/wardby-bin.js +5 -0
- package/docs/README.md +11 -1
- package/docs/agent-recipes.md +37 -4
- package/docs/architecture-runtime.md +1 -1
- package/docs/claude-code-plugin.md +164 -0
- package/docs/code-review-agents.md +6 -0
- package/docs/coding-agent-setup.md +77 -1
- package/docs/coding-worker-byo-images.md +4 -2
- package/docs/coding-worker-isolation.md +78 -7
- package/docs/debugging-agent-runs.md +242 -0
- package/docs/getting-started-gke.md +5 -4
- package/docs/getting-started-identity-provider.md +43 -37
- package/docs/getting-started.md +8 -0
- package/docs/host-providers.md +294 -0
- package/docs/mcp-servers.md +254 -0
- package/docs/native-sandbox.md +25 -9
- package/docs/security-deployment.md +110 -31
- package/docs/tool-secrets.md +3 -0
- package/docs/viewer-api.md +6 -0
- package/docs/viewer-api.openapi.yml +1 -1
- package/help/admin-viewer.md +4 -0
- package/help/agent-recipes.md +33 -2
- package/help/brokered-secrets.md +3 -0
- package/help/build-claude-code-image.md +1 -1
- package/help/claude-code-run-pane.md +40 -0
- package/help/errors/coding-mcp-pins-unavailable.md +35 -0
- package/help/errors/database-auth-invalid.md +1 -1
- package/help/errors/host-provider-error.md +40 -0
- package/help/errors/host-tool-failed.md +36 -0
- package/help/errors/mcp-call-limit.md +22 -0
- package/help/errors/mcp-call-timeout.md +22 -0
- package/help/errors/mcp-server-auth-failed.md +22 -0
- package/help/errors/mcp-server-credentials-unavailable.md +45 -0
- package/help/errors/mcp-server-error.md +28 -0
- package/help/errors/mcp-server-unreachable.md +22 -0
- package/help/errors/mcp-servers-off.md +21 -0
- package/help/errors/mcp-tool-not-allowed.md +26 -0
- package/help/errors/mcp-tool-removed.md +22 -0
- package/help/errors/mcp-unavailable.md +25 -0
- package/help/errors/native-sandbox-capacity.md +1 -1
- package/help/errors/native-sandbox-deadline-exceeded.md +1 -1
- package/help/errors/native-sandbox-docker-failed.md +1 -1
- package/help/errors/native-sandbox-gateway-error.md +1 -1
- package/help/errors/native-sandbox-gateway-unavailable.md +1 -1
- package/help/errors/native-sandbox-image-not-pinned.md +1 -1
- package/help/errors/native-sandbox-isolation-mismatch.md +1 -1
- package/help/errors/native-sandbox-network-unenforced.md +1 -1
- package/help/errors/native-sandbox-requires-catalog.md +1 -1
- package/help/errors/native-sandbox-unavailable.md +1 -1
- package/help/errors/native-sandbox-warm-delivery-failed.md +1 -1
- package/help/errors/native-sandbox-worker-exited.md +1 -1
- package/help/errors/native-sandbox-worker-lost.md +1 -1
- package/help/errors/native-sandbox-worker-unready.md +1 -1
- package/help/errors/repository-not-listed.md +36 -0
- package/help/errors/repository-required.md +36 -0
- package/help/errors/tool-timeout.md +38 -0
- package/help/host-providers.md +40 -0
- package/help/identity-and-access.md +4 -1
- package/help/mcp-servers.md +73 -0
- package/help/mcp.md +7 -2
- package/help/native-capabilities.md +27 -1
- package/help/native-sandbox.md +1 -1
- package/help/operating-agents.md +16 -0
- package/help/related-pull-requests.md +7 -3
- package/help/repo-instructions-and-skills.md +3 -1
- package/help/resume-runs-locally.md +3 -0
- package/help/stop-run.md +1 -1
- package/help/troubleshooting/coding-workers.md +9 -1
- package/help/troubleshooting/debugging-agent-runs.md +29 -0
- package/package.json +2 -1
- package/prisma/migrations/20261102000000_host_providers/migration.sql +56 -0
- package/prisma/migrations/20261104000000_coding_agent_repository_list/migration.sql +5 -0
- package/prisma/migrations/20261106000000_tool_timeout/migration.sql +4 -0
- package/prisma/migrations/20261107000000_mcp_servers/migration.sql +33 -0
- package/prisma/migrations/20261108000000_coding_mcp/migration.sql +5 -0
- package/prisma/migrations/20261109000000_task_run_index/migration.sql +3 -0
- package/prisma/schema.prisma +159 -14
- package/scripts/git-askpass.sh +1 -1
package/prisma/schema.prisma
CHANGED
|
@@ -20,18 +20,18 @@ datasource db {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
model Agent {
|
|
23
|
-
id
|
|
24
|
-
name
|
|
25
|
-
systemPrompt
|
|
26
|
-
model
|
|
27
|
-
budgetUsd
|
|
23
|
+
id String @id @default(cuid())
|
|
24
|
+
name String @unique
|
|
25
|
+
systemPrompt String
|
|
26
|
+
model String
|
|
27
|
+
budgetUsd Decimal @db.Decimal(10, 4)
|
|
28
28
|
/// Percent above budgetUsd a run may spend: each coding run's limit, or (on a lead agent) its run tree's ceiling for coding sub-agents; native model calls are unaffected; group caps still apply.
|
|
29
|
-
allowedOverrunPercent Int
|
|
30
|
-
createdAt
|
|
31
|
-
updatedAt
|
|
32
|
-
runs
|
|
33
|
-
kind
|
|
34
|
-
codingProfile
|
|
29
|
+
allowedOverrunPercent Int @default(0)
|
|
30
|
+
createdAt DateTime @default(now())
|
|
31
|
+
updatedAt DateTime @updatedAt
|
|
32
|
+
runs Run[]
|
|
33
|
+
kind AgentKind @default(native)
|
|
34
|
+
codingProfile CodingAgentProfile?
|
|
35
35
|
|
|
36
36
|
// Phase 2: scheduling. `schedule` is a cron expression; null = manual-only.
|
|
37
37
|
schedule String?
|
|
@@ -60,6 +60,7 @@ model Agent {
|
|
|
60
60
|
repositories AgentRepository[]
|
|
61
61
|
deferredReviews DeferredReview[]
|
|
62
62
|
issueProjects AgentIssueProject[]
|
|
63
|
+
mcpServers AgentMcpServer[]
|
|
63
64
|
notificationChannels NotificationChannel[]
|
|
64
65
|
|
|
65
66
|
/// Self-defects opt-in: the Jira project and issue type wardby files the agent's own failures into. Both or neither.
|
|
@@ -186,6 +187,10 @@ model Tool {
|
|
|
186
187
|
jsonSchema Json
|
|
187
188
|
/// Tool body source; run inside the sandbox with the validated params.
|
|
188
189
|
code String
|
|
190
|
+
/// The tool's own time limit per call (ms). Null = the default (10 s). A
|
|
191
|
+
/// run uses the lower of this and WARDBY_TOOL_MAX_TIMEOUT_MS, and pins the
|
|
192
|
+
/// value its load step read, like the code.
|
|
193
|
+
timeoutMs Int?
|
|
189
194
|
createdAt DateTime @default(now())
|
|
190
195
|
updatedAt DateTime @updatedAt
|
|
191
196
|
agents AgentTool[]
|
|
@@ -195,6 +200,8 @@ model Tool {
|
|
|
195
200
|
ownerId String?
|
|
196
201
|
owner Principal? @relation(fields: [ownerId], references: [id])
|
|
197
202
|
|
|
203
|
+
hostProviderOperations HostProviderOperation[]
|
|
204
|
+
|
|
198
205
|
@@unique([ownerId, name])
|
|
199
206
|
}
|
|
200
207
|
|
|
@@ -425,6 +432,7 @@ model Run {
|
|
|
425
432
|
/// text, no FK.
|
|
426
433
|
triggeredById String?
|
|
427
434
|
|
|
435
|
+
@@unique([parentRunId, parentCallId])
|
|
428
436
|
@@index([agentId, triggeredById])
|
|
429
437
|
/// The admin viewer's graph window (runs started since a time, or still
|
|
430
438
|
/// pending/running) and its ancestor/children walks (docs/viewer-api.md).
|
|
@@ -433,7 +441,6 @@ model Run {
|
|
|
433
441
|
@@index([parentRunId])
|
|
434
442
|
@@index([startDeferredAt])
|
|
435
443
|
@@index([stopRequestedAt])
|
|
436
|
-
@@unique([parentRunId, parentCallId])
|
|
437
444
|
}
|
|
438
445
|
|
|
439
446
|
/// Phase 5: owner-configured coding behavior. Runtime credentials and opaque
|
|
@@ -572,6 +579,9 @@ model CodingRun {
|
|
|
572
579
|
baseSha String?
|
|
573
580
|
/// Step in the request's merge order set by the delegating agent (1 = first); null = no order.
|
|
574
581
|
mergeOrder Int?
|
|
582
|
+
/// Fixed at dispatch: this run's repository came from an AgentRepository link, not the
|
|
583
|
+
/// profile, so that link must still exist whenever the run uses the repository.
|
|
584
|
+
viaRepositoryLink Boolean @default(false)
|
|
575
585
|
/// When Wardby marked this run's pull request ready for review (at most once;
|
|
576
586
|
/// a person moving it back to draft is final). Only set on a root coding run.
|
|
577
587
|
markedReadyAt DateTime?
|
|
@@ -846,6 +856,8 @@ model NativeGatewayCall {
|
|
|
846
856
|
childRunId String?
|
|
847
857
|
/// A delegation's sub-agent, recorded at admission (it holds a place while waiting for budget).
|
|
848
858
|
childAgentId String?
|
|
859
|
+
/// A coding delegation's repository, recorded with childAgentId. Null = the child's default.
|
|
860
|
+
childRepository String?
|
|
849
861
|
createdAt DateTime @default(now())
|
|
850
862
|
updatedAt DateTime @updatedAt
|
|
851
863
|
completedAt DateTime?
|
|
@@ -893,6 +905,12 @@ model CodingProxySession {
|
|
|
893
905
|
dependencyCacheLockHashes String[] @default([])
|
|
894
906
|
/// Set when the run's dependency step is over; after it the cache refuses this session.
|
|
895
907
|
dependencyCacheSealedAt DateTime?
|
|
908
|
+
/// Phase 2 of remote MCP servers: the run's pinned MCP tools (no URLs or secrets), or null.
|
|
909
|
+
mcpTools Json?
|
|
910
|
+
/// SHA-256 (base64url) of the run's MCP token; null when the run has no MCP tools.
|
|
911
|
+
mcpTokenHash String? @unique
|
|
912
|
+
/// MCP tools/call count for this run (capped by WARDBY_MCP_MAX_CALLS_PER_RUN).
|
|
913
|
+
mcpCallCount Int @default(0)
|
|
896
914
|
|
|
897
915
|
@@index([deadlineAt])
|
|
898
916
|
}
|
|
@@ -1121,6 +1139,7 @@ model Principal {
|
|
|
1121
1139
|
webhooks Webhook[]
|
|
1122
1140
|
authUser AuthUser?
|
|
1123
1141
|
budgetGroups BudgetGroup[]
|
|
1142
|
+
mcpServers McpServer[]
|
|
1124
1143
|
|
|
1125
1144
|
hostIdentities HostIdentity[]
|
|
1126
1145
|
hostIdentityLinkRequests HostIdentityLinkRequest[]
|
|
@@ -1135,7 +1154,7 @@ model Principal {
|
|
|
1135
1154
|
/// AgentRepository.provider, so a new type or level needs no enum migration.
|
|
1136
1155
|
model ResourceGrant {
|
|
1137
1156
|
id String @id @default(cuid())
|
|
1138
|
-
/// "agent" | "tool" | "budget_group" (later "secret" | "datastore").
|
|
1157
|
+
/// "agent" | "tool" | "budget_group" | "mcp_server" (later "secret" | "datastore").
|
|
1139
1158
|
resourceType String
|
|
1140
1159
|
resourceId String
|
|
1141
1160
|
/// "principal" | "everyone" (later "group").
|
|
@@ -1193,6 +1212,9 @@ model Task {
|
|
|
1193
1212
|
ttlAt DateTime
|
|
1194
1213
|
createdAt DateTime @default(now())
|
|
1195
1214
|
updatedAt DateTime @updatedAt
|
|
1215
|
+
|
|
1216
|
+
/// The run-drivability and cancelled-task lookups: findFirst({ runId, status: "cancelled" }).
|
|
1217
|
+
@@index([runId, status])
|
|
1196
1218
|
}
|
|
1197
1219
|
|
|
1198
1220
|
/// Phase 4: a secret value, encrypted at rest via the SecretCipher seam.
|
|
@@ -1211,6 +1233,10 @@ model Secret {
|
|
|
1211
1233
|
updatedAt DateTime @updatedAt
|
|
1212
1234
|
agents AgentSecret[]
|
|
1213
1235
|
|
|
1236
|
+
hostProviderWebhooks HostProvider[] @relation("HostProviderWebhookSecret")
|
|
1237
|
+
hostProviderPermissions HostProvider[] @relation("HostProviderPermissionSecret")
|
|
1238
|
+
hostProviderCredentials HostProviderCredential[] @relation("HostProviderCredentialSecret")
|
|
1239
|
+
|
|
1214
1240
|
@@unique([ownerId, name])
|
|
1215
1241
|
}
|
|
1216
1242
|
|
|
@@ -1320,7 +1346,7 @@ model AuthUser {
|
|
|
1320
1346
|
displayName String?
|
|
1321
1347
|
status String @default("enabled")
|
|
1322
1348
|
/// wardby roles (src/mcp/auth/resource-server.ts ROLE_PERMISSIONS: admin,
|
|
1323
|
-
/// package-approver, service-manager, model-manager), set with `wardby auth user grant`. Empty = member.
|
|
1349
|
+
/// package-approver, service-manager, model-manager, host-manager), set with `wardby auth user grant`. Empty = member.
|
|
1324
1350
|
/// A privileged operation needs its scope on the token AND a role here
|
|
1325
1351
|
/// that grants it; unknown values grant nothing.
|
|
1326
1352
|
roles String[] @default([])
|
|
@@ -1466,6 +1492,9 @@ model AgentRepository {
|
|
|
1466
1492
|
/// review check passed, CI is green and the merge order check (if any) is
|
|
1467
1493
|
/// success. Default off.
|
|
1468
1494
|
markReadyWhenPassing Boolean @default(false)
|
|
1495
|
+
/// Only on a coding agent's link: the base branch for runs in this repository.
|
|
1496
|
+
/// Null = the coding profile's baseRef.
|
|
1497
|
+
baseRef String?
|
|
1469
1498
|
createdAt DateTime @default(now())
|
|
1470
1499
|
|
|
1471
1500
|
/// How this link was authorized: "host_permission" (the agent owner's
|
|
@@ -1671,6 +1700,48 @@ model AgentIssueProject {
|
|
|
1671
1700
|
@@index([provider, projectKey])
|
|
1672
1701
|
}
|
|
1673
1702
|
|
|
1703
|
+
/// A remote MCP server an owner registered (Streamable HTTP, HTTPS only).
|
|
1704
|
+
model McpServer {
|
|
1705
|
+
id String @id @default(cuid())
|
|
1706
|
+
ownerId String
|
|
1707
|
+
owner Principal @relation(fields: [ownerId], references: [id], onDelete: Cascade)
|
|
1708
|
+
/// Unique per owner; the prefix of the tool names the model sees.
|
|
1709
|
+
name String
|
|
1710
|
+
/// https only; no userinfo, no fragment; the query string is kept.
|
|
1711
|
+
url String
|
|
1712
|
+
/// The owner's brokered secrets sent on every request (each brokered to the URL's host).
|
|
1713
|
+
secretNames String[] @default([])
|
|
1714
|
+
/// Last tools/list result, redacted: [{ name, description, inputSchema, annotations? }].
|
|
1715
|
+
toolSnapshot Json @default("[]")
|
|
1716
|
+
snapshotAt DateTime?
|
|
1717
|
+
/// From initialize: { name?, version?, protocolVersion }.
|
|
1718
|
+
serverInfo Json?
|
|
1719
|
+
createdAt DateTime @default(now())
|
|
1720
|
+
updatedAt DateTime @updatedAt
|
|
1721
|
+
agents AgentMcpServer[]
|
|
1722
|
+
|
|
1723
|
+
@@unique([ownerId, name])
|
|
1724
|
+
@@index([ownerId])
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
/// An MCP server attached to an agent, with the server tools it may call.
|
|
1728
|
+
model AgentMcpServer {
|
|
1729
|
+
agentId String
|
|
1730
|
+
agent Agent @relation(fields: [agentId], references: [id], onDelete: Cascade)
|
|
1731
|
+
serverId String
|
|
1732
|
+
server McpServer @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
|
1733
|
+
/// Exact tool names from the server's saved list. Never empty.
|
|
1734
|
+
allowedTools String[]
|
|
1735
|
+
/// Per call; null = 30000. Capped by WARDBY_TOOL_MAX_TIMEOUT_MS at call time.
|
|
1736
|
+
callTimeoutMs Int?
|
|
1737
|
+
attachedById String
|
|
1738
|
+
createdAt DateTime @default(now())
|
|
1739
|
+
updatedAt DateTime @updatedAt
|
|
1740
|
+
|
|
1741
|
+
@@id([agentId, serverId])
|
|
1742
|
+
@@index([serverId])
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1674
1745
|
/// Dedupe record: an issue wardby created for a fingerprint (several over time — regressions).
|
|
1675
1746
|
model IssueFingerprint {
|
|
1676
1747
|
id String @id @default(cuid())
|
|
@@ -1953,3 +2024,77 @@ model NotificationThread {
|
|
|
1953
2024
|
|
|
1954
2025
|
@@unique([provider, channelId, threadKey])
|
|
1955
2026
|
}
|
|
2027
|
+
|
|
2028
|
+
/// A code host implemented by operator-approved custom tools (docs/host-providers.md).
|
|
2029
|
+
/// `name` is the prefix of its repository ids: `<name>:<workspace>/<repo>`. Holds no secret values.
|
|
2030
|
+
model HostProvider {
|
|
2031
|
+
name String @id
|
|
2032
|
+
contractVersion Int
|
|
2033
|
+
gitHost String
|
|
2034
|
+
apiHosts String[]
|
|
2035
|
+
gitUsername String
|
|
2036
|
+
pullRequestUrlTemplate String
|
|
2037
|
+
/// Where one repository lives on the API, with `{repository}`: a repository-scoped tool's requests stay under it.
|
|
2038
|
+
repositoryApiPath String
|
|
2039
|
+
/// The effective-permission endpoint, with `{workspace}` and `{repo}`. Set with a permission secret.
|
|
2040
|
+
permissionApiPath String?
|
|
2041
|
+
/// How to verify and read a webhook: header names and algorithm, never the secret.
|
|
2042
|
+
webhook Json
|
|
2043
|
+
webhookSecretId String
|
|
2044
|
+
webhookSecret Secret @relation("HostProviderWebhookSecret", fields: [webhookSecretId], references: [id], onDelete: Restrict)
|
|
2045
|
+
/// Set: ask the host who has access. Unset: trustedAccounts decides.
|
|
2046
|
+
permissionSecretId String?
|
|
2047
|
+
permissionSecret Secret? @relation("HostProviderPermissionSecret", fields: [permissionSecretId], references: [id], onDelete: Restrict)
|
|
2048
|
+
createdById String
|
|
2049
|
+
createdAt DateTime @default(now())
|
|
2050
|
+
updatedAt DateTime @updatedAt
|
|
2051
|
+
|
|
2052
|
+
operations HostProviderOperation[]
|
|
2053
|
+
credentials HostProviderCredential[]
|
|
2054
|
+
trustedAccounts HostProviderTrustedAccount[]
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
/// One approved snapshot: the code Wardby runs. `update_tool` changes nothing here until approved again.
|
|
2058
|
+
model HostProviderOperation {
|
|
2059
|
+
provider String
|
|
2060
|
+
operation String
|
|
2061
|
+
/// The tool it was copied from. Null once that tool is deleted; the snapshot keeps working.
|
|
2062
|
+
toolId String?
|
|
2063
|
+
code String
|
|
2064
|
+
paramsZod String
|
|
2065
|
+
/// The tool's timeoutMs when it was approved; null = the default limit.
|
|
2066
|
+
timeoutMs Int?
|
|
2067
|
+
approvedById String
|
|
2068
|
+
approvedAt DateTime @default(now())
|
|
2069
|
+
|
|
2070
|
+
hostProvider HostProvider @relation(fields: [provider], references: [name], onDelete: Cascade)
|
|
2071
|
+
tool Tool? @relation(fields: [toolId], references: [id], onDelete: SetNull)
|
|
2072
|
+
|
|
2073
|
+
@@id([provider, operation])
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
/// Which brokered secret serves which repositories. `credentialKind` is `static` only in v1.
|
|
2077
|
+
model HostProviderCredential {
|
|
2078
|
+
id String @id @default(cuid())
|
|
2079
|
+
provider String
|
|
2080
|
+
repositoryPattern String
|
|
2081
|
+
secretId String
|
|
2082
|
+
credentialKind String @default("static")
|
|
2083
|
+
|
|
2084
|
+
hostProvider HostProvider @relation(fields: [provider], references: [name], onDelete: Cascade)
|
|
2085
|
+
secret Secret @relation("HostProviderCredentialSecret", fields: [secretId], references: [id], onDelete: Restrict)
|
|
2086
|
+
|
|
2087
|
+
@@unique([provider, repositoryPattern])
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
/// Host accounts allowed to start runs when the provider has no permission secret.
|
|
2091
|
+
model HostProviderTrustedAccount {
|
|
2092
|
+
provider String
|
|
2093
|
+
accountId String
|
|
2094
|
+
addedById String
|
|
2095
|
+
addedAt DateTime @default(now())
|
|
2096
|
+
|
|
2097
|
+
hostProvider HostProvider @relation(fields: [provider], references: [name], onDelete: Cascade)
|
|
2098
|
+
|
|
2099
|
+
@@id([provider, accountId])
|
|
2100
|
+
}
|