@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.
- package/.env.example +34 -4
- package/README.md +183 -71
- package/dist/claude-coding-worker/driver.d.ts +7 -1
- package/dist/claude-coding-worker/driver.js +31 -2
- package/dist/claude-coding-worker/main.js +5 -2
- package/dist/claude-coding-worker/tool-socket.d.ts +9 -0
- package/dist/claude-coding-worker/tool-socket.js +26 -0
- package/dist/cli-help.d.ts +1 -1
- package/dist/cli-help.js +13 -4
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +219 -29
- package/dist/coding/collect-exclude.d.ts +25 -0
- package/dist/coding/collect-exclude.js +76 -0
- package/dist/coding/profile.d.ts +67 -22
- package/dist/coding/profile.js +58 -25
- package/dist/coding/protected-path-wording.d.ts +24 -0
- package/dist/coding/protected-path-wording.js +55 -0
- package/dist/coding/protected-paths.d.ts +31 -0
- package/dist/coding/protected-paths.js +48 -0
- package/dist/coding/protocol.d.ts +99 -3
- package/dist/coding/protocol.js +155 -4
- package/dist/coding/registry/adapters.d.ts +2 -0
- package/dist/coding/registry/adapters.js +9 -0
- package/dist/coding/registry/allowlist.d.ts +9 -0
- package/dist/coding/registry/allowlist.js +28 -0
- package/dist/coding/registry/json-scan.d.ts +55 -0
- package/dist/coding/registry/json-scan.js +191 -0
- package/dist/coding/registry/lockfiles.d.ts +6 -0
- package/dist/coding/registry/lockfiles.js +89 -0
- package/dist/coding/registry/npm-lockfile.d.ts +9 -0
- package/dist/coding/registry/npm-lockfile.js +73 -0
- package/dist/coding/registry/npm-plan.d.ts +29 -0
- package/dist/coding/registry/npm-plan.js +289 -0
- package/dist/coding/registry/npm.d.ts +7 -0
- package/dist/coding/registry/npm.js +252 -0
- package/dist/coding/registry/pypi.d.ts +4 -0
- package/dist/coding/registry/pypi.js +210 -0
- package/dist/coding/registry/report.d.ts +37 -0
- package/dist/coding/registry/report.js +31 -0
- package/dist/coding/registry/token.d.ts +4 -0
- package/dist/coding/registry/token.js +7 -0
- package/dist/coding/registry/types.d.ts +286 -0
- package/dist/coding/registry/types.js +19 -0
- package/dist/coding/registry/worker-config.d.ts +14 -0
- package/dist/coding/registry/worker-config.js +31 -0
- package/dist/coding/services/builtins.d.ts +22 -0
- package/dist/coding/services/builtins.js +85 -0
- package/dist/coding/services/catalog.d.ts +443 -0
- package/dist/coding/services/catalog.js +159 -0
- package/dist/coding/services/declaration.d.ts +11 -0
- package/dist/coding/services/declaration.js +114 -0
- package/dist/coding/services/note.d.ts +8 -0
- package/dist/coding/services/note.js +15 -0
- package/dist/coding/services/resolve.d.ts +25 -0
- package/dist/coding/services/resolve.js +50 -0
- package/dist/coding/services/wording.d.ts +25 -0
- package/dist/coding/services/wording.js +70 -0
- package/dist/coding-proxy/main.js +24 -4
- package/dist/coding-worker/artifact.d.ts +18 -0
- package/dist/coding-worker/artifact.js +48 -6
- package/dist/coding-worker/debug-trace.d.ts +37 -0
- package/dist/coding-worker/debug-trace.js +117 -0
- package/dist/coding-worker/driver.d.ts +14 -1
- package/dist/coding-worker/driver.js +106 -14
- package/dist/coding-worker/errors.d.ts +7 -0
- package/dist/coding-worker/errors.js +26 -0
- package/dist/coding-worker/main.js +13 -4
- package/dist/coding-worker/sdk.d.ts +2 -2
- package/dist/coding-worker/sdk.js +7 -2
- package/dist/coding-worker/types.d.ts +3 -0
- package/dist/config/providers.d.ts +41 -0
- package/dist/config/providers.js +66 -0
- package/dist/core/budget-groups.d.ts +109 -6
- package/dist/core/budget-groups.js +125 -19
- package/dist/core/budget-wording.d.ts +22 -0
- package/dist/core/budget-wording.js +55 -0
- package/dist/core/coding-queue.d.ts +1 -1
- package/dist/core/datastores.d.ts +1 -1
- package/dist/core/datastores.js +18 -2
- package/dist/core/db.d.ts +40 -2
- package/dist/core/db.js +75 -2
- package/dist/core/dispatch.d.ts +49 -7
- package/dist/core/dispatch.js +290 -45
- package/dist/core/engine-native.js +27 -10
- package/dist/core/grants.d.ts +86 -0
- package/dist/core/grants.js +126 -0
- package/dist/core/host-events.d.ts +49 -0
- package/dist/core/host-events.js +257 -0
- package/dist/core/host-identity-links.d.ts +54 -0
- package/dist/core/host-identity-links.js +189 -0
- package/dist/core/host-status.d.ts +61 -0
- package/dist/core/host-status.js +211 -0
- package/dist/core/http-runtime.js +3 -4
- package/dist/core/in-flight-runs.d.ts +8 -0
- package/dist/core/in-flight-runs.js +56 -0
- package/dist/core/lease.d.ts +1 -1
- package/dist/core/private-directory.d.ts +20 -0
- package/dist/core/private-directory.js +36 -0
- package/dist/core/provider-wording.d.ts +12 -0
- package/dist/core/provider-wording.js +44 -0
- package/dist/core/reconciler.d.ts +39 -3
- package/dist/core/reconciler.js +86 -2
- package/dist/core/repo-access.d.ts +99 -0
- package/dist/core/repo-access.js +136 -0
- package/dist/core/review-host-checks.d.ts +11 -0
- package/dist/core/review-host-checks.js +41 -0
- package/dist/core/review-host-tools.d.ts +47 -0
- package/dist/core/review-host-tools.js +347 -0
- package/dist/core/run-heartbeat.d.ts +27 -0
- package/dist/core/run-heartbeat.js +54 -0
- package/dist/core/runner.d.ts +31 -9
- package/dist/core/runner.js +237 -40
- package/dist/core/scheduler.d.ts +1 -1
- package/dist/core/secrets.d.ts +12 -3
- package/dist/core/secrets.js +25 -6
- package/dist/core/subagent-memory-tools.d.ts +2 -2
- package/dist/core/subagent-memory-tools.js +16 -3
- package/dist/core/tool-admin.d.ts +81 -0
- package/dist/core/tool-admin.js +129 -0
- package/dist/core/tool-names.d.ts +42 -0
- package/dist/core/tool-names.js +64 -0
- package/dist/core/untrusted-content.d.ts +32 -0
- package/dist/core/untrusted-content.js +72 -0
- package/dist/core/webhooks.d.ts +9 -2
- package/dist/core/webhooks.js +23 -2
- package/dist/generated/prisma/browser.d.ts +328 -0
- package/dist/generated/prisma/browser.js +17 -0
- package/dist/generated/prisma/client.d.ts +347 -0
- package/dist/generated/prisma/client.js +34 -0
- package/dist/generated/prisma/commonInputTypes.d.ts +839 -0
- package/dist/generated/prisma/commonInputTypes.js +10 -0
- package/dist/generated/prisma/enums.d.ts +59 -0
- package/dist/generated/prisma/enums.js +59 -0
- package/dist/generated/prisma/internal/class.d.ts +605 -0
- package/dist/generated/prisma/internal/class.js +49 -0
- package/dist/generated/prisma/internal/prismaNamespace.d.ts +4494 -0
- package/dist/generated/prisma/internal/prismaNamespace.js +628 -0
- package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts +635 -0
- package/dist/generated/prisma/internal/prismaNamespaceBrowser.js +599 -0
- package/dist/generated/prisma/models/Agent.d.ts +3560 -0
- package/dist/generated/prisma/models/Agent.js +1 -0
- package/dist/generated/prisma/models/AgentDatastore.d.ts +1210 -0
- package/dist/generated/prisma/models/AgentDatastore.js +1 -0
- package/dist/generated/prisma/models/AgentMemory.d.ts +986 -0
- package/dist/generated/prisma/models/AgentMemory.js +1 -0
- package/dist/generated/prisma/models/AgentRepository.d.ts +1425 -0
- package/dist/generated/prisma/models/AgentRepository.js +1 -0
- package/dist/generated/prisma/models/AgentSecret.d.ts +1212 -0
- package/dist/generated/prisma/models/AgentSecret.js +1 -0
- package/dist/generated/prisma/models/AgentSubAgent.d.ts +1217 -0
- package/dist/generated/prisma/models/AgentSubAgent.js +1 -0
- package/dist/generated/prisma/models/AgentTool.d.ts +1403 -0
- package/dist/generated/prisma/models/AgentTool.js +1 -0
- package/dist/generated/prisma/models/AuthFormChallenge.d.ts +1298 -0
- package/dist/generated/prisma/models/AuthFormChallenge.js +1 -0
- package/dist/generated/prisma/models/AuthLoginKey.d.ts +1245 -0
- package/dist/generated/prisma/models/AuthLoginKey.js +1 -0
- package/dist/generated/prisma/models/AuthRateLimit.d.ts +979 -0
- package/dist/generated/prisma/models/AuthRateLimit.js +1 -0
- package/dist/generated/prisma/models/AuthSession.d.ts +1376 -0
- package/dist/generated/prisma/models/AuthSession.js +1 -0
- package/dist/generated/prisma/models/AuthUser.d.ts +1700 -0
- package/dist/generated/prisma/models/AuthUser.js +1 -0
- package/dist/generated/prisma/models/BudgetGroup.d.ts +1548 -0
- package/dist/generated/prisma/models/BudgetGroup.js +1 -0
- package/dist/generated/prisma/models/CodingAgentProfile.d.ts +1681 -0
- package/dist/generated/prisma/models/CodingAgentProfile.js +1 -0
- package/dist/generated/prisma/models/CodingProxyRequest.d.ts +1749 -0
- package/dist/generated/prisma/models/CodingProxyRequest.js +1 -0
- package/dist/generated/prisma/models/CodingProxySession.d.ts +1626 -0
- package/dist/generated/prisma/models/CodingProxySession.js +1 -0
- package/dist/generated/prisma/models/CodingRun.d.ts +3583 -0
- package/dist/generated/prisma/models/CodingRun.js +1 -0
- package/dist/generated/prisma/models/CodingService.d.ts +1348 -0
- package/dist/generated/prisma/models/CodingService.js +1 -0
- package/dist/generated/prisma/models/Datastore.d.ts +1434 -0
- package/dist/generated/prisma/models/Datastore.js +1 -0
- package/dist/generated/prisma/models/DatastoreEntry.d.ts +1314 -0
- package/dist/generated/prisma/models/DatastoreEntry.js +1 -0
- package/dist/generated/prisma/models/HostEventDelivery.d.ts +946 -0
- package/dist/generated/prisma/models/HostEventDelivery.js +1 -0
- package/dist/generated/prisma/models/HostIdentity.d.ts +1232 -0
- package/dist/generated/prisma/models/HostIdentity.js +1 -0
- package/dist/generated/prisma/models/HostIdentityLinkRequest.d.ts +1473 -0
- package/dist/generated/prisma/models/HostIdentityLinkRequest.js +1 -0
- package/dist/generated/prisma/models/OAuthAuthorizationCode.d.ts +1526 -0
- package/dist/generated/prisma/models/OAuthAuthorizationCode.js +1 -0
- package/dist/generated/prisma/models/OAuthAuthorizationRequest.d.ts +1350 -0
- package/dist/generated/prisma/models/OAuthAuthorizationRequest.js +1 -0
- package/dist/generated/prisma/models/OAuthClient.d.ts +1289 -0
- package/dist/generated/prisma/models/OAuthClient.js +1 -0
- package/dist/generated/prisma/models/OAuthFamily.d.ts +1540 -0
- package/dist/generated/prisma/models/OAuthFamily.js +1 -0
- package/dist/generated/prisma/models/OAuthGrant.d.ts +1280 -0
- package/dist/generated/prisma/models/OAuthGrant.js +1 -0
- package/dist/generated/prisma/models/Principal.d.ts +2245 -0
- package/dist/generated/prisma/models/Principal.js +1 -0
- package/dist/generated/prisma/models/RegistryAllowance.d.ts +1148 -0
- package/dist/generated/prisma/models/RegistryAllowance.js +1 -0
- package/dist/generated/prisma/models/RegistryApprovedVersion.d.ts +1219 -0
- package/dist/generated/prisma/models/RegistryApprovedVersion.js +1 -0
- package/dist/generated/prisma/models/RegistryFetch.d.ts +1428 -0
- package/dist/generated/prisma/models/RegistryFetch.js +1 -0
- package/dist/generated/prisma/models/RegistryPlanRefusal.d.ts +1294 -0
- package/dist/generated/prisma/models/RegistryPlanRefusal.js +1 -0
- package/dist/generated/prisma/models/RegistryVersionFact.d.ts +1085 -0
- package/dist/generated/prisma/models/RegistryVersionFact.js +1 -0
- package/dist/generated/prisma/models/ResourceGrant.d.ts +1437 -0
- package/dist/generated/prisma/models/ResourceGrant.js +1 -0
- package/dist/generated/prisma/models/Run.d.ts +2669 -0
- package/dist/generated/prisma/models/Run.js +1 -0
- package/dist/generated/prisma/models/RunHostCheck.d.ts +1239 -0
- package/dist/generated/prisma/models/RunHostCheck.js +1 -0
- package/dist/generated/prisma/models/RunHostStatus.d.ts +1315 -0
- package/dist/generated/prisma/models/RunHostStatus.js +1 -0
- package/dist/generated/prisma/models/SchedulerLease.d.ts +970 -0
- package/dist/generated/prisma/models/SchedulerLease.js +1 -0
- package/dist/generated/prisma/models/Secret.d.ts +1399 -0
- package/dist/generated/prisma/models/Secret.js +1 -0
- package/dist/generated/prisma/models/SecretElicitationOutcome.d.ts +973 -0
- package/dist/generated/prisma/models/SecretElicitationOutcome.js +1 -0
- package/dist/generated/prisma/models/Task.d.ts +1176 -0
- package/dist/generated/prisma/models/Task.js +1 -0
- package/dist/generated/prisma/models/Tool.d.ts +1490 -0
- package/dist/generated/prisma/models/Tool.js +1 -0
- package/dist/generated/prisma/models/Webhook.d.ts +1386 -0
- package/dist/generated/prisma/models/Webhook.js +1 -0
- package/dist/generated/prisma/models.d.ts +45 -0
- package/dist/generated/prisma/models.js +1 -0
- package/dist/help/build.d.ts +1 -0
- package/dist/help/build.js +9 -0
- package/dist/help/catalog.d.ts +24 -0
- package/dist/help/catalog.js +160 -0
- package/dist/help/cli.d.ts +2 -0
- package/dist/help/cli.js +65 -0
- package/dist/help/runtime.d.ts +3 -0
- package/dist/help/runtime.js +44 -0
- package/dist/help/search.d.ts +9 -0
- package/dist/help/search.js +104 -0
- package/dist/help-index.json +660 -0
- package/dist/import/cli-args.js +3 -2
- package/dist/import/create.d.ts +6 -1
- package/dist/import/create.js +68 -14
- package/dist/import/index.d.ts +1 -1
- package/dist/import/index.js +19 -9
- package/dist/import/neutral-schema.d.ts +11 -11
- package/dist/mcp/auth/access.d.ts +70 -0
- package/dist/mcp/auth/access.js +58 -0
- package/dist/mcp/auth/grants-cli.d.ts +149 -0
- package/dist/mcp/auth/grants-cli.js +518 -0
- package/dist/mcp/auth/host-account-cli.d.ts +2 -0
- package/dist/mcp/auth/host-account-cli.js +47 -0
- package/dist/mcp/auth/ownership.d.ts +37 -63
- package/dist/mcp/auth/ownership.js +19 -14
- package/dist/mcp/auth/principal.d.ts +1 -1
- package/dist/mcp/auth/repo-authorization.d.ts +22 -0
- package/dist/mcp/auth/repo-authorization.js +51 -0
- package/dist/mcp/auth/resource-server.d.ts +32 -3
- package/dist/mcp/auth/resource-server.js +84 -3
- package/dist/mcp/auth/self-hosted/browser.js +22 -8
- package/dist/mcp/auth/self-hosted/cli.d.ts +1 -1
- package/dist/mcp/auth/self-hosted/cli.js +47 -13
- package/dist/mcp/auth/self-hosted/credentials.d.ts +21 -3
- package/dist/mcp/auth/self-hosted/credentials.js +62 -4
- package/dist/mcp/auth/self-hosted/rate-limit.d.ts +1 -1
- package/dist/mcp/auth/self-hosted/session.d.ts +3 -2
- package/dist/mcp/context.d.ts +28 -2
- package/dist/mcp/errors.d.ts +25 -6
- package/dist/mcp/errors.js +98 -0
- package/dist/mcp/host-events/github-ingress.d.ts +36 -0
- package/dist/mcp/host-events/github-ingress.js +92 -0
- package/dist/mcp/host-events/github-user-callback.d.ts +18 -0
- package/dist/mcp/host-events/github-user-callback.js +50 -0
- package/dist/mcp/index.d.ts +8 -1
- package/dist/mcp/index.js +106 -16
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.js +27 -9
- package/dist/mcp/shared/page-style.d.ts +16 -0
- package/dist/mcp/shared/page-style.js +129 -0
- package/dist/mcp/tasks/manager.d.ts +1 -1
- package/dist/mcp/tools/agents.js +447 -49
- package/dist/mcp/tools/budget-groups.js +3 -3
- package/dist/mcp/tools/datastore.js +23 -16
- package/dist/mcp/tools/grants.d.ts +2 -0
- package/dist/mcp/tools/grants.js +239 -0
- package/dist/mcp/tools/help.d.ts +5 -0
- package/dist/mcp/tools/help.js +67 -0
- package/dist/mcp/tools/host-accounts.d.ts +2 -0
- package/dist/mcp/tools/host-accounts.js +114 -0
- package/dist/mcp/tools/memory.d.ts +7 -1
- package/dist/mcp/tools/memory.js +5 -5
- package/dist/mcp/tools/repositories.d.ts +2 -0
- package/dist/mcp/tools/repositories.js +181 -0
- package/dist/mcp/tools/runs.d.ts +6 -0
- package/dist/mcp/tools/runs.js +60 -6
- package/dist/mcp/tools/scheduling.js +4 -7
- package/dist/mcp/tools/secret-elicitation-form.d.ts +1 -1
- package/dist/mcp/tools/secret-elicitation-form.js +10 -28
- package/dist/mcp/tools/secret-elicitation.d.ts +1 -1
- package/dist/mcp/tools/secrets.js +18 -6
- package/dist/mcp/tools/services.d.ts +2 -0
- package/dist/mcp/tools/services.js +222 -0
- package/dist/mcp/tools/subagents.js +53 -17
- package/dist/mcp/tools/tools.d.ts +41 -0
- package/dist/mcp/tools/tools.js +202 -41
- package/dist/mcp/tools/trigger.js +36 -6
- package/dist/mcp/tools/webhooks.js +15 -4
- package/dist/mcp/transport/streamable-http.d.ts +11 -1
- package/dist/mcp/transport/streamable-http.js +32 -2
- package/dist/mcp/unattended-schedules.d.ts +1 -1
- package/dist/mcp/webhooks/ingress.d.ts +1 -1
- package/dist/providers/auth/delegating.d.ts +19 -0
- package/dist/providers/auth/delegating.js +71 -0
- package/dist/providers/auth/index.d.ts +3 -1
- package/dist/providers/auth/index.js +11 -0
- package/dist/providers/auth/self-hosted.d.ts +4 -3
- package/dist/providers/auth/self-hosted.js +16 -4
- package/dist/providers/auth/types.d.ts +6 -0
- package/dist/providers/coding-proxy/memory-ledger.d.ts +3 -0
- package/dist/providers/coding-proxy/memory-ledger.js +21 -2
- package/dist/providers/coding-proxy/metering.d.ts +4 -0
- package/dist/providers/coding-proxy/metering.js +28 -2
- package/dist/providers/coding-proxy/prisma-ledger.d.ts +18 -1
- package/dist/providers/coding-proxy/prisma-ledger.js +50 -5
- package/dist/providers/coding-proxy/proxy.d.ts +13 -0
- package/dist/providers/coding-proxy/proxy.js +479 -18
- package/dist/providers/coding-proxy/registry/audit.d.ts +131 -0
- package/dist/providers/coding-proxy/registry/audit.js +380 -0
- package/dist/providers/coding-proxy/registry/bounded-fetch.d.ts +16 -0
- package/dist/providers/coding-proxy/registry/bounded-fetch.js +77 -0
- package/dist/providers/coding-proxy/registry/plan.d.ts +58 -0
- package/dist/providers/coding-proxy/registry/plan.js +304 -0
- package/dist/providers/coding-proxy/registry/prisma-store.d.ts +34 -0
- package/dist/providers/coding-proxy/registry/prisma-store.js +151 -0
- package/dist/providers/coding-proxy/registry/service.d.ts +213 -0
- package/dist/providers/coding-proxy/registry/service.js +1137 -0
- package/dist/providers/coding-proxy/registry/store.d.ts +127 -0
- package/dist/providers/coding-proxy/registry/store.js +70 -0
- package/dist/providers/coding-proxy/runtime.d.ts +18 -1
- package/dist/providers/coding-proxy/runtime.js +63 -0
- package/dist/providers/coding-proxy/secure-fetch.js +0 -1
- package/dist/providers/coding-proxy/server.d.ts +11 -0
- package/dist/providers/coding-proxy/server.js +163 -0
- package/dist/providers/coding-proxy/types.d.ts +15 -0
- package/dist/providers/datastore/postgres.d.ts +1 -1
- package/dist/providers/engine/types.d.ts +10 -0
- package/dist/providers/executor/build.d.ts +3 -3
- package/dist/providers/executor/composition.d.ts +4 -1
- package/dist/providers/executor/composition.js +19 -0
- package/dist/providers/executor/container.d.ts +106 -4
- package/dist/providers/executor/container.js +305 -22
- package/dist/providers/executor/dbos.d.ts +3 -4
- package/dist/providers/executor/in-process.d.ts +2 -3
- package/dist/providers/executor/routing.d.ts +7 -0
- package/dist/providers/executor/routing.js +13 -0
- package/dist/providers/executor/types.d.ts +22 -0
- package/dist/providers/jobs/claude-tool-setup.d.ts +23 -0
- package/dist/providers/jobs/claude-tool-setup.js +50 -0
- package/dist/providers/jobs/collect-prune.d.ts +7 -0
- package/dist/providers/jobs/collect-prune.js +27 -0
- package/dist/providers/jobs/docker-isolation.d.ts +48 -3
- package/dist/providers/jobs/docker-isolation.js +213 -22
- package/dist/providers/jobs/docker-services.d.ts +35 -0
- package/dist/providers/jobs/docker-services.js +191 -0
- package/dist/providers/jobs/docker.d.ts +60 -2
- package/dist/providers/jobs/docker.js +313 -50
- package/dist/providers/jobs/fake-kubernetes-api.d.ts +1 -0
- package/dist/providers/jobs/fake-kubernetes-api.js +12 -3
- package/dist/providers/jobs/kubernetes-isolation.d.ts +17 -2
- package/dist/providers/jobs/kubernetes-isolation.js +238 -57
- package/dist/providers/jobs/kubernetes-platform.d.ts +10 -4
- package/dist/providers/jobs/kubernetes-platform.js +11 -5
- package/dist/providers/jobs/kubernetes-preflight.js +3 -0
- package/dist/providers/jobs/kubernetes.d.ts +21 -2
- package/dist/providers/jobs/kubernetes.js +117 -31
- package/dist/providers/jobs/types.d.ts +20 -0
- package/dist/providers/llm/anthropic.js +6 -2
- package/dist/providers/llm/bedrock.js +2 -1
- package/dist/providers/llm/claude-messages.d.ts +5 -1
- package/dist/providers/llm/claude-messages.js +1 -0
- package/dist/providers/llm/claude-provider.d.ts +3 -1
- package/dist/providers/llm/claude-provider.js +5 -1
- package/dist/providers/llm/index.d.ts +1 -1
- package/dist/providers/llm/index.js +1 -1
- package/dist/providers/llm/pricing-anthropic.d.ts +10 -0
- package/dist/providers/llm/pricing-anthropic.js +32 -14
- package/dist/providers/llm/pricing-bedrock-claude.d.ts +8 -0
- package/dist/providers/llm/pricing-bedrock-claude.js +9 -0
- package/dist/providers/llm/routing.d.ts +10 -1
- package/dist/providers/llm/routing.js +18 -0
- package/dist/providers/llm/types.d.ts +12 -0
- package/dist/providers/llm/types.js +8 -1
- package/dist/providers/memory/postgres.d.ts +1 -1
- package/dist/providers/review-host/diff-lines.d.ts +16 -0
- package/dist/providers/review-host/diff-lines.js +59 -0
- package/dist/providers/review-host/github-events.d.ts +6 -0
- package/dist/providers/review-host/github-events.js +180 -0
- package/dist/providers/review-host/github-user-auth.d.ts +38 -0
- package/dist/providers/review-host/github-user-auth.js +128 -0
- package/dist/providers/review-host/github.d.ts +57 -0
- package/dist/providers/review-host/github.js +567 -0
- package/dist/providers/review-host/index.d.ts +12 -0
- package/dist/providers/review-host/index.js +30 -0
- package/dist/providers/review-host/review-format.d.ts +19 -0
- package/dist/providers/review-host/review-format.js +59 -0
- package/dist/providers/review-host/types.d.ts +284 -0
- package/dist/providers/review-host/types.js +24 -0
- package/dist/providers/vcs/git.d.ts +16 -6
- package/dist/providers/vcs/git.js +79 -14
- package/dist/providers/vcs/github.d.ts +74 -3
- package/dist/providers/vcs/github.js +195 -15
- package/dist/providers/vcs/types.d.ts +42 -4
- package/dist/quickstart/index.js +34 -32
- package/dist/quickstart/migrate.d.ts +23 -0
- package/dist/quickstart/migrate.js +125 -0
- package/dist/sandbox/fetch-policy.d.ts +20 -2
- package/dist/sandbox/fetch-policy.js +64 -3
- package/dist/sandbox/host-functions.d.ts +9 -1
- package/dist/sandbox/host-functions.js +12 -5
- package/dist/serve.js +1 -1
- package/dist/wardby-bin.js +6 -0
- package/docs/README.md +30 -0
- package/docs/architecture-runtime.md +90 -0
- package/docs/assets/brand/wardby-icon-512.png +0 -0
- package/docs/assets/brand/wardby-icon.svg +16 -0
- package/docs/assets/brand/wardby-mascot-profile-512.png +0 -0
- package/docs/assets/brand/wardby-mascot.png +0 -0
- package/docs/assets/brand/wardby-mascot.svg +5 -0
- package/docs/assets/wardby-workflow.svg +106 -0
- package/docs/code-review-agents.md +481 -0
- package/docs/coding-agent-setup.md +172 -0
- package/docs/coding-packages.md +455 -0
- package/docs/coding-services.md +300 -0
- package/docs/coding-worker-byo-images.md +98 -0
- package/docs/coding-worker-isolation.md +1061 -0
- package/docs/getting-started-gke.md +615 -0
- package/docs/getting-started-identity-provider.md +308 -0
- package/docs/getting-started.md +133 -0
- package/docs/observability.md +53 -0
- package/docs/release-verification.md +66 -0
- package/docs/security-deployment.md +657 -0
- package/help/code-review-agents.md +31 -0
- package/help/coding-packages.md +31 -0
- package/help/coding-services.md +71 -0
- package/help/creating-agents.md +68 -0
- package/help/deploy-gke.md +39 -0
- package/help/deployment-targets.md +39 -0
- package/help/errors/budget-group-exhausted.md +25 -0
- package/help/errors/docker-isolation-unsupported.md +26 -0
- package/help/errors/protected-path.md +45 -0
- package/help/errors/repo-access.md +27 -0
- package/help/errors/service-declaration-invalid.md +27 -0
- package/help/errors/service-declaration-unavailable.md +25 -0
- package/help/errors/service-launcher-unsupported.md +30 -0
- package/help/errors/service-not-allowed.md +27 -0
- package/help/errors/service-unknown.md +23 -0
- package/help/errors/service-unready.md +49 -0
- package/help/getting-started.md +31 -0
- package/help/github.md +30 -0
- package/help/identity-and-access.md +39 -0
- package/help/mcp.md +30 -0
- package/help/native-capabilities.md +30 -0
- package/help/observability.md +41 -0
- package/help/operating-agents.md +30 -0
- package/help/security.md +27 -0
- package/help/troubleshooting/budgets.md +26 -0
- package/help/troubleshooting/coding-workers.md +47 -0
- package/help/troubleshooting/repository-access.md +27 -0
- package/package.json +30 -11
- package/prisma/migrate.config.mjs +20 -0
- package/prisma/migrations/20260925010000_coding_collect_exclude/migration.sql +8 -0
- package/prisma/migrations/20260925015000_allowed_egress_default/migration.sql +8 -0
- package/prisma/migrations/20260925020000_coding_package_registry/migration.sql +55 -0
- package/prisma/migrations/20260925030000_tool_name_per_owner/migration.sql +11 -0
- package/prisma/migrations/20260926010000_run_trigger_host_event/migration.sql +7 -0
- package/prisma/migrations/20260926020000_code_review_hosts/migration.sql +53 -0
- package/prisma/migrations/20260926030000_auth_user_roles/migration.sql +9 -0
- package/prisma/migrations/20260926040000_agent_effort/migration.sql +6 -0
- package/prisma/migrations/20260926050000_registry_lockfile_plan/migration.sql +32 -0
- package/prisma/migrations/20260926050000_repo_access_authorization/migration.sql +82 -0
- package/prisma/migrations/20260926060000_registry_plan_refusal/migration.sql +19 -0
- package/prisma/migrations/20260926100000_registry_plan_refusal_published_at/migration.sql +5 -0
- package/prisma/migrations/20260926190000_run_host_status/migration.sql +18 -0
- package/prisma/migrations/20260926210000_run_host_status_at_dispatch/migration.sql +5 -0
- package/prisma/migrations/20260927010000_resource_grants/migration.sql +72 -0
- package/prisma/migrations/20260927020000_proxy_session_budget_exhausted/migration.sql +3 -0
- package/prisma/migrations/20260927030000_coding_debug_trace/migration.sql +4 -0
- package/prisma/migrations/20260927040000_proxy_session_upstream_failure/migration.sql +3 -0
- package/prisma/migrations/20260927050000_coding_run_services/migration.sql +74 -0
- package/prisma/migrations/20260928000000_coding_run_tool_image/migration.sql +5 -0
- package/prisma/schema.prisma +417 -23
package/prisma/schema.prisma
CHANGED
|
@@ -2,13 +2,21 @@
|
|
|
2
2
|
// schema. Targets PostgreSQL even for the laptop demo; "portable" means any
|
|
3
3
|
// Postgres (see deploy/local/docker-compose.yml), not a cloud dependency.
|
|
4
4
|
|
|
5
|
+
// Generated into src/generated/prisma (gitignored; `npm run build` and
|
|
6
|
+
// `prepare` regenerate it) and imported everywhere as "#prisma" (package.json
|
|
7
|
+
// "imports"). Pure TS + wasm query compiler: no native engine, so the built
|
|
8
|
+
// client is portable across platforms.
|
|
5
9
|
generator client {
|
|
6
|
-
provider
|
|
10
|
+
provider = "prisma-client"
|
|
11
|
+
output = "../src/generated/prisma"
|
|
12
|
+
moduleFormat = "esm"
|
|
13
|
+
runtime = "nodejs"
|
|
7
14
|
}
|
|
8
15
|
|
|
16
|
+
// The connection URL lives in prisma.config.ts (CLI) and src/core/db.ts
|
|
17
|
+
// (runtime, through @prisma/adapter-pg).
|
|
9
18
|
datasource db {
|
|
10
19
|
provider = "postgresql"
|
|
11
|
-
url = env("DATABASE_URL")
|
|
12
20
|
}
|
|
13
21
|
|
|
14
22
|
model Agent {
|
|
@@ -34,12 +42,16 @@ model Agent {
|
|
|
34
42
|
tools AgentTool[]
|
|
35
43
|
maxTurns Int @default(10)
|
|
36
44
|
|
|
37
|
-
// Phase 4: ownership. Null =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
// Phase 4: ownership. Null = owner-less, a transition state only: access
|
|
46
|
+
// then comes from ResourceGrant rows alone (the migration gives everyone
|
|
47
|
+
// execute), and `wardby grants adopt-public` assigns an owner. See
|
|
48
|
+
// ResourceGrant.
|
|
49
|
+
ownerId String?
|
|
50
|
+
owner Principal? @relation(fields: [ownerId], references: [id])
|
|
51
|
+
secrets AgentSecret[]
|
|
52
|
+
datastores AgentDatastore[]
|
|
53
|
+
webhooks Webhook[]
|
|
54
|
+
repositories AgentRepository[]
|
|
43
55
|
|
|
44
56
|
// Phase 7: at most one budget group. Null = uncapped beyond its own budgetUsd.
|
|
45
57
|
budgetGroupId String?
|
|
@@ -51,6 +63,11 @@ model Agent {
|
|
|
51
63
|
/// created for it.
|
|
52
64
|
memoryEnabled Boolean @default(false)
|
|
53
65
|
|
|
66
|
+
/// Un-phased: reasoning effort for native agents (low, medium, high,
|
|
67
|
+
/// xhigh, max). Validated against the model in code, not a DB enum.
|
|
68
|
+
/// Null = the provider's default.
|
|
69
|
+
effort String?
|
|
70
|
+
|
|
54
71
|
/// Un-phased: sub-agent composition edges (see AgentSubAgent below). An
|
|
55
72
|
/// agent can be a parent (has children it can delegate to) and/or a
|
|
56
73
|
/// child (is delegated to by others) independently.
|
|
@@ -126,7 +143,11 @@ enum RunStatus {
|
|
|
126
143
|
/// Phase 3: a WASM-sandboxed, Zod-validated tool a model can call.
|
|
127
144
|
model Tool {
|
|
128
145
|
id String @id @default(cuid())
|
|
129
|
-
name
|
|
146
|
+
/// Unique per owner (@@unique below), not globally: the name is what the
|
|
147
|
+
/// model calls, so what must never repeat is a name within one agent's
|
|
148
|
+
/// attachments — attach_tool, `wardby tool attach` and the importer refuse
|
|
149
|
+
/// a second same-named tool on an agent.
|
|
150
|
+
name String
|
|
130
151
|
description String
|
|
131
152
|
/// Zod schema *source text*; compiled and evaluated inside the sandbox,
|
|
132
153
|
/// never in the host process.
|
|
@@ -135,7 +156,8 @@ model Tool {
|
|
|
135
156
|
/// and cached here — re-deriving it on every run would spin a fresh QuickJS
|
|
136
157
|
/// runtime and evaluate the whole vendored zod bundle per attached tool,
|
|
137
158
|
/// before the first LLM call, on every single run. Safe to cache because
|
|
138
|
-
///
|
|
159
|
+
/// every write of paramsZod (create, and MCP update_tool) re-derives it in
|
|
160
|
+
/// the same write. A run pins the version its load step read.
|
|
139
161
|
jsonSchema Json
|
|
140
162
|
/// Tool body source; run inside the sandbox with the validated params.
|
|
141
163
|
code String
|
|
@@ -143,9 +165,12 @@ model Tool {
|
|
|
143
165
|
updatedAt DateTime @updatedAt
|
|
144
166
|
agents AgentTool[]
|
|
145
167
|
|
|
146
|
-
// Phase 4: ownership. Null =
|
|
168
|
+
// Phase 4: ownership. Null = owner-less (a transition state; tool grants
|
|
169
|
+
// arrive in the resource-sharing grants Phase 2, see ResourceGrant).
|
|
147
170
|
ownerId String?
|
|
148
171
|
owner Principal? @relation(fields: [ownerId], references: [id])
|
|
172
|
+
|
|
173
|
+
@@unique([ownerId, name])
|
|
149
174
|
}
|
|
150
175
|
|
|
151
176
|
/// Phase 3: explicit many-to-many join between Agent and Tool.
|
|
@@ -167,6 +192,17 @@ model AgentTool {
|
|
|
167
192
|
allowedHosts Json @default("[]")
|
|
168
193
|
allowedSharedDatastorePrefixes Json @default("{}")
|
|
169
194
|
|
|
195
|
+
/// Who created the attachment. Audit only: plain text, no FK (same
|
|
196
|
+
/// convention as AgentRepository.authorizedById).
|
|
197
|
+
attachedById String?
|
|
198
|
+
/// The principal whose consent the four capability fields above carry.
|
|
199
|
+
/// The runner honours them only while this equals the agent's CURRENT
|
|
200
|
+
/// ownerId (resource-sharing grants spec §3.4.2): a write-grantee's
|
|
201
|
+
/// attachment, a make_owner transfer, or a pre-grants row nobody vouched
|
|
202
|
+
/// for runs with no secrets, no datastore and no fetch until the owner
|
|
203
|
+
/// re-grants with attach_tool. Plain text, no FK.
|
|
204
|
+
capabilitiesGrantedById String?
|
|
205
|
+
|
|
170
206
|
@@id([agentId, toolId])
|
|
171
207
|
}
|
|
172
208
|
|
|
@@ -262,19 +298,20 @@ enum RunTrigger {
|
|
|
262
298
|
scheduled
|
|
263
299
|
webhook
|
|
264
300
|
subagent
|
|
301
|
+
host_event
|
|
265
302
|
}
|
|
266
303
|
|
|
267
304
|
model Run {
|
|
268
|
-
id String
|
|
269
|
-
agent Agent
|
|
305
|
+
id String @id @default(cuid())
|
|
306
|
+
agent Agent @relation(fields: [agentId], references: [id])
|
|
270
307
|
agentId String
|
|
271
|
-
status RunStatus
|
|
272
|
-
trigger RunTrigger
|
|
273
|
-
tokensIn Int
|
|
274
|
-
tokensOut Int
|
|
275
|
-
costUsd Decimal
|
|
308
|
+
status RunStatus @default(pending)
|
|
309
|
+
trigger RunTrigger @default(manual)
|
|
310
|
+
tokensIn Int @default(0)
|
|
311
|
+
tokensOut Int @default(0)
|
|
312
|
+
costUsd Decimal @default(0) @db.Decimal(10, 6)
|
|
276
313
|
error String?
|
|
277
|
-
startedAt DateTime
|
|
314
|
+
startedAt DateTime @default(now())
|
|
278
315
|
finishedAt DateTime?
|
|
279
316
|
/// Phase 2: beaten by the executor while running; a stale value past
|
|
280
317
|
/// HEARTBEAT_TIMEOUT is how the reconciler finds an orphaned run.
|
|
@@ -287,15 +324,17 @@ model Run {
|
|
|
287
324
|
/// Phase 4: EngineResult.turns, persisted for the same reason as
|
|
288
325
|
/// finalText — MCP's list_runs/get_run need it and it was previously
|
|
289
326
|
/// dropped after the engine returned.
|
|
290
|
-
turns Int
|
|
327
|
+
turns Int @default(0)
|
|
291
328
|
/// Detached executors are recovered by handle rather than inferred from trigger.
|
|
292
|
-
executionManaged Boolean
|
|
329
|
+
executionManaged Boolean @default(false)
|
|
293
330
|
/// Phase 6: which durable executor backend holds this run, if any
|
|
294
331
|
/// ("dbos" = a DBOS workflow whose id equals this run's id). Null for
|
|
295
332
|
/// in-process runs. The reconciler consults the backend before declaring a
|
|
296
333
|
/// stale run lost, and can adopt one orphaned by a dead instance.
|
|
297
334
|
executionBackend String?
|
|
298
335
|
codingRun CodingRun?
|
|
336
|
+
hostCheck RunHostCheck?
|
|
337
|
+
hostStatus RunHostStatus?
|
|
299
338
|
|
|
300
339
|
/// Un-phased: sub-agent dispatch (see AgentSubAgent). Null for a
|
|
301
340
|
/// top-level run; set when this run was created by a parent run's
|
|
@@ -318,6 +357,14 @@ model Run {
|
|
|
318
357
|
/// loaded systemPrompt at run time so the stable prefix stays
|
|
319
358
|
/// prompt-cache-eligible across dispatches.
|
|
320
359
|
taskOverride String?
|
|
360
|
+
/// The principal the run is visible to besides the agent's owner
|
|
361
|
+
/// (resource-sharing grants spec §3.5): the trigger_agent caller, a
|
|
362
|
+
/// webhook's creator, or a sub-agent's parent run's triggerer. Null for
|
|
363
|
+
/// scheduled, host-event and CLI runs, which only the owner sees. Plain
|
|
364
|
+
/// text, no FK.
|
|
365
|
+
triggeredById String?
|
|
366
|
+
|
|
367
|
+
@@index([agentId, triggeredById])
|
|
321
368
|
}
|
|
322
369
|
|
|
323
370
|
/// Phase 5: owner-configured coding behavior. Runtime credentials and opaque
|
|
@@ -331,13 +378,31 @@ model CodingAgentProfile {
|
|
|
331
378
|
defaultTask String?
|
|
332
379
|
allowWebhookTaskOverride Boolean @default(false)
|
|
333
380
|
timeoutSec Int @default(1800)
|
|
334
|
-
|
|
381
|
+
/// Unused; dropped after rollout (see the package-registry plan, Task 14).
|
|
382
|
+
allowedEgress Json @default("[]")
|
|
335
383
|
protectedPaths Json
|
|
384
|
+
collectExclude Json @default("[]")
|
|
336
385
|
toolchain String @default("node")
|
|
337
386
|
toolchainVersion String?
|
|
338
387
|
workerImageRef String?
|
|
339
388
|
/// Per-agent workspace size in MiB; null = CODING_DISK_MB.
|
|
340
389
|
workspaceDiskMb Int?
|
|
390
|
+
packageAllowlist Json @default("{}")
|
|
391
|
+
packagePolicy Json @default("{}")
|
|
392
|
+
/// Admin-requested debug trace: while now < debugTraceUntil, every coding
|
|
393
|
+
/// run of this agent is dispatched with CodingRun.debugTrace set. Null = off.
|
|
394
|
+
debugTraceUntil DateTime?
|
|
395
|
+
/// Coding-run services (docs/coding-services.md): the catalog names
|
|
396
|
+
/// (CodingService.name) this agent's runs may start, any version the catalog
|
|
397
|
+
/// has. Empty = none. Owner-set through update_agent.
|
|
398
|
+
services Json @default("[]")
|
|
399
|
+
|
|
400
|
+
/// How `repository` was authorized for this agent (see AgentRepository.authorizedVia):
|
|
401
|
+
/// "host_permission", "admin", or "grandfathered". Null = never authorized; runs are refused.
|
|
402
|
+
repositoryAuthorizedVia String?
|
|
403
|
+
/// The principal whose GitHub access (or admin approval) authorized it. Audit only, no FK.
|
|
404
|
+
repositoryAuthorizedById String?
|
|
405
|
+
repositoryAuthorizedAt DateTime?
|
|
341
406
|
}
|
|
342
407
|
|
|
343
408
|
/// Phase 5: immutable dispatch inputs plus opaque execution/result state for
|
|
@@ -352,8 +417,10 @@ model CodingRun {
|
|
|
352
417
|
provider String
|
|
353
418
|
model String
|
|
354
419
|
timeoutSec Int
|
|
355
|
-
|
|
420
|
+
/// Unused; dropped after rollout (see the package-registry plan, Task 14).
|
|
421
|
+
allowedEgress Json @default("[]")
|
|
356
422
|
protectedPaths Json
|
|
423
|
+
collectExclude Json @default("[]")
|
|
357
424
|
jobBackend String?
|
|
358
425
|
jobHandle String?
|
|
359
426
|
result Json?
|
|
@@ -363,6 +430,8 @@ model CodingRun {
|
|
|
363
430
|
failureCategory String?
|
|
364
431
|
diagnosticId String?
|
|
365
432
|
workerImage String?
|
|
433
|
+
/// Claude Code's tool-runner image, resolved from the agent's toolchain at dispatch; null for Codex runs.
|
|
434
|
+
toolImage String?
|
|
366
435
|
budgetReservedUsd Decimal @db.Decimal(10, 6)
|
|
367
436
|
/// Phase 12 concurrency queue: set when start() found every coding slot
|
|
368
437
|
/// taken (CODING_MAX_CONCURRENT), cleared when the run claims a slot. A
|
|
@@ -370,6 +439,15 @@ model CodingRun {
|
|
|
370
439
|
queuedAt DateTime?
|
|
371
440
|
/// Per-agent workspace size in MiB; null = CODING_DISK_MB.
|
|
372
441
|
workspaceDiskMb Int?
|
|
442
|
+
packageAllowlist Json @default("{}")
|
|
443
|
+
packagePolicy Json @default("{}")
|
|
444
|
+
/// Fixed at dispatch from the profile's debugTraceUntil: the worker writes a
|
|
445
|
+
/// full stream trace to its own pod log (never to the database).
|
|
446
|
+
debugTrace Boolean @default(false)
|
|
447
|
+
/// Coding-run services resolved at dispatch from the base branch's
|
|
448
|
+
/// .wardby/services.yaml: one snapshot per service (the catalog entry minus
|
|
449
|
+
/// kind), fixed for the run's lifetime. Empty = none.
|
|
450
|
+
services Json @default("[]")
|
|
373
451
|
createdAt DateTime @default(now())
|
|
374
452
|
updatedAt DateTime @updatedAt
|
|
375
453
|
proxySession CodingProxySession?
|
|
@@ -384,12 +462,53 @@ model CodingRun {
|
|
|
384
462
|
rootCodingRun CodingRun? @relation("CodingRunContinuation", fields: [rootCodingRunId], references: [runId])
|
|
385
463
|
continuations CodingRun[] @relation("CodingRunContinuation")
|
|
386
464
|
|
|
465
|
+
registryAllowances RegistryAllowance[]
|
|
466
|
+
registryFetches RegistryFetch[]
|
|
467
|
+
registryApprovedVersions RegistryApprovedVersion[]
|
|
468
|
+
registryPlanRefusals RegistryPlanRefusal[]
|
|
469
|
+
|
|
387
470
|
@@index([jobBackend, jobHandle])
|
|
388
471
|
@@index([failureCategory])
|
|
389
472
|
@@index([queuedAt])
|
|
390
473
|
@@index([rootCodingRunId])
|
|
391
474
|
}
|
|
392
475
|
|
|
476
|
+
/// Coding-run services (docs/coding-services.md): the catalog a repository's
|
|
477
|
+
/// .wardby/services.yaml names entries from. Admin-managed over MCP
|
|
478
|
+
/// (list/get_service: agents:read; create/update/delete_service:
|
|
479
|
+
/// services:manage, audit-logged).
|
|
480
|
+
/// Built-in rows ship with wardby, seeded by migration, and change only with a
|
|
481
|
+
/// wardby release. `kind` is "sidecar" (a fresh instance in each run's pod);
|
|
482
|
+
/// "external" is reserved.
|
|
483
|
+
model CodingService {
|
|
484
|
+
id String @id @default(cuid())
|
|
485
|
+
name String
|
|
486
|
+
version String
|
|
487
|
+
kind String @default("sidecar")
|
|
488
|
+
/// Digest-pinned image reference (repo@sha256:...).
|
|
489
|
+
image String
|
|
490
|
+
port Int
|
|
491
|
+
/// Environment for the service container itself: throwaway per-run values, never secrets.
|
|
492
|
+
serviceEnv Json @default("{}")
|
|
493
|
+
/// Variables the agent's shells receive (DATABASE_URL, PG*, REDIS_URL, ...).
|
|
494
|
+
testEnv Json @default("{}")
|
|
495
|
+
/// { command, periodSeconds, timeoutSeconds, failureThreshold }: the sidecar's startup probe.
|
|
496
|
+
readiness Json
|
|
497
|
+
/// { cpuMillicores, memoryMib, diskMib }: requests equal limits.
|
|
498
|
+
resources Json
|
|
499
|
+
/// Where the service writes its data: an emptyDir in the run pod.
|
|
500
|
+
dataPath String
|
|
501
|
+
/// Further directories the image writes to (socket directory, /tmp): each an emptyDir.
|
|
502
|
+
writablePaths Json @default("[]")
|
|
503
|
+
builtin Boolean @default(false)
|
|
504
|
+
/// The admin who created it. Audit only, no FK; null for built-ins.
|
|
505
|
+
createdById String?
|
|
506
|
+
createdAt DateTime @default(now())
|
|
507
|
+
updatedAt DateTime @updatedAt
|
|
508
|
+
|
|
509
|
+
@@unique([name, version])
|
|
510
|
+
}
|
|
511
|
+
|
|
393
512
|
enum CodingProxySessionStatus {
|
|
394
513
|
active
|
|
395
514
|
cancelled
|
|
@@ -418,6 +537,16 @@ model CodingProxySession {
|
|
|
418
537
|
createdAt DateTime @default(now())
|
|
419
538
|
updatedAt DateTime @updatedAt
|
|
420
539
|
requests CodingProxyRequest[]
|
|
540
|
+
/// Hash of the derived registry-only token (see deriveRegistryToken); the
|
|
541
|
+
/// token itself is never persisted.
|
|
542
|
+
registryTokenHash String? @unique
|
|
543
|
+
/// Set the first time the proxy refuses a request of this session for
|
|
544
|
+
/// budget; lets the executor report the run as out of budget.
|
|
545
|
+
budgetExhaustedAt DateTime?
|
|
546
|
+
/// The upstream error code (a fixed identifier, never a message) of the
|
|
547
|
+
/// first provider failure the proxy relayed for this session; lets the
|
|
548
|
+
/// executor say the model provider refused the run.
|
|
549
|
+
upstreamFailure String?
|
|
421
550
|
|
|
422
551
|
@@index([deadlineAt])
|
|
423
552
|
}
|
|
@@ -450,6 +579,96 @@ model CodingProxyRequest {
|
|
|
450
579
|
@@index([sessionId, status])
|
|
451
580
|
}
|
|
452
581
|
|
|
582
|
+
enum RegistryFetchOutcome {
|
|
583
|
+
served
|
|
584
|
+
refused
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/// One package a run's profile has approved from a given ecosystem, resolved
|
|
588
|
+
/// once at dispatch (see CodingRun.packageAllowlist) and used to gate every
|
|
589
|
+
/// proxy fetch for the run's lifetime.
|
|
590
|
+
model RegistryAllowance {
|
|
591
|
+
runId String
|
|
592
|
+
ecosystem String
|
|
593
|
+
name String
|
|
594
|
+
createdAt DateTime @default(now())
|
|
595
|
+
run CodingRun @relation(fields: [runId], references: [runId], onDelete: Cascade)
|
|
596
|
+
|
|
597
|
+
@@id([runId, ecosystem, name])
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/// Audit ledger of every package fetch the registry proxy served or refused
|
|
601
|
+
/// for a run.
|
|
602
|
+
model RegistryFetch {
|
|
603
|
+
id String @id @default(cuid())
|
|
604
|
+
runId String
|
|
605
|
+
ecosystem String
|
|
606
|
+
name String
|
|
607
|
+
version String?
|
|
608
|
+
filename String?
|
|
609
|
+
integrity String?
|
|
610
|
+
sizeBytes Int?
|
|
611
|
+
outcome RegistryFetchOutcome
|
|
612
|
+
reason String?
|
|
613
|
+
createdAt DateTime @default(now())
|
|
614
|
+
run CodingRun @relation(fields: [runId], references: [runId], onDelete: Cascade)
|
|
615
|
+
|
|
616
|
+
@@index([runId, createdAt])
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/// Immutable facts about one published package version, read from the
|
|
620
|
+
/// registry itself (never from a lockfile) by lockfile verification: its
|
|
621
|
+
/// publish time, integrity, download URL and declared dependencies
|
|
622
|
+
/// ([{ key, name, range }], aliases resolved). Stored once and reused
|
|
623
|
+
/// forever; allow/deny decisions are never cached here.
|
|
624
|
+
model RegistryVersionFact {
|
|
625
|
+
ecosystem String
|
|
626
|
+
name String
|
|
627
|
+
version String
|
|
628
|
+
publishedAt DateTime
|
|
629
|
+
integrity String
|
|
630
|
+
downloadUrl String
|
|
631
|
+
dependencies Json
|
|
632
|
+
createdAt DateTime @default(now())
|
|
633
|
+
|
|
634
|
+
@@id([ecosystem, name, version])
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/// One exact package version a run's lockfile plan (POST
|
|
638
|
+
/// /registry/<ecosystem>/-/plan) verified and approved: a download of it is
|
|
639
|
+
/// served directly, integrity-checked against this value.
|
|
640
|
+
model RegistryApprovedVersion {
|
|
641
|
+
runId String
|
|
642
|
+
ecosystem String
|
|
643
|
+
name String
|
|
644
|
+
version String
|
|
645
|
+
integrity String
|
|
646
|
+
createdAt DateTime @default(now())
|
|
647
|
+
run CodingRun @relation(fields: [runId], references: [runId], onDelete: Cascade)
|
|
648
|
+
|
|
649
|
+
@@id([runId, ecosystem, name, version])
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/// One exact package version a run's lockfile plan refused for a reason
|
|
653
|
+
/// intrinsic to the registry's name@version (too new, an advisory, not
|
|
654
|
+
/// published, no integrity, hosted elsewhere): a download of it is answered
|
|
655
|
+
/// from here with the same code and reason, without a graph walk.
|
|
656
|
+
model RegistryPlanRefusal {
|
|
657
|
+
runId String
|
|
658
|
+
ecosystem String
|
|
659
|
+
name String
|
|
660
|
+
version String
|
|
661
|
+
code String
|
|
662
|
+
reason String
|
|
663
|
+
/// Set for a too-new refusal: the answer re-checks the version's age
|
|
664
|
+
/// against the run's cutoff at answer time, so the refusal lapses.
|
|
665
|
+
publishedAt DateTime?
|
|
666
|
+
createdAt DateTime @default(now())
|
|
667
|
+
run CodingRun @relation(fields: [runId], references: [runId], onDelete: Cascade)
|
|
668
|
+
|
|
669
|
+
@@id([runId, ecosystem, name, version])
|
|
670
|
+
}
|
|
671
|
+
|
|
453
672
|
/// Phase 2: single-row-per-scope lease so exactly one scheduler process
|
|
454
673
|
/// ticks at a time. `holder` is a process instance id (crypto.randomUUID()).
|
|
455
674
|
model SchedulerLease {
|
|
@@ -473,6 +692,46 @@ model Principal {
|
|
|
473
692
|
webhooks Webhook[]
|
|
474
693
|
authUser AuthUser?
|
|
475
694
|
budgetGroups BudgetGroup[]
|
|
695
|
+
|
|
696
|
+
hostIdentities HostIdentity[]
|
|
697
|
+
hostIdentityLinkRequests HostIdentityLinkRequest[]
|
|
698
|
+
grants ResourceGrant[]
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/// Explicit sharing of one resource with one grantee (docs/private/
|
|
702
|
+
/// 2026-09-26-resource-sharing-grants-spec-and-plan.md). Polymorphic on
|
|
703
|
+
/// (resourceType, resourceId) -- no FK to the resource, so every resource
|
|
704
|
+
/// delete path removes its grants in the same transaction. Levels are
|
|
705
|
+
/// ordered per type and validated in code (core/grants.ts), like
|
|
706
|
+
/// AgentRepository.provider, so a new type or level needs no enum migration.
|
|
707
|
+
model ResourceGrant {
|
|
708
|
+
id String @id @default(cuid())
|
|
709
|
+
/// "agent" | "tool" | "budget_group" (later "secret" | "datastore").
|
|
710
|
+
resourceType String
|
|
711
|
+
resourceId String
|
|
712
|
+
/// "principal" | "everyone" (later "group").
|
|
713
|
+
granteeKind String
|
|
714
|
+
granteePrincipalId String?
|
|
715
|
+
granteePrincipal Principal? @relation(fields: [granteePrincipalId], references: [id], onDelete: Cascade)
|
|
716
|
+
/// Normalised grantee identity for uniqueness: "principal:<id>", "everyone"
|
|
717
|
+
/// (later "group:<id>"). Needed because NULL granteePrincipalId values are
|
|
718
|
+
/// distinct in a unique index. Shape enforced by a hand-written CHECK
|
|
719
|
+
/// (ResourceGrant_grantee_shape, not representable here).
|
|
720
|
+
granteeKey String
|
|
721
|
+
/// Per-type ordered level (core/grants.ts LEVELS).
|
|
722
|
+
level String
|
|
723
|
+
/// "owner" (grant_access), "migration_public", "implied_attachment",
|
|
724
|
+
/// "import", "operator". Audit only.
|
|
725
|
+
source String @default("owner")
|
|
726
|
+
/// Principal who created/last changed it. Audit only: plain text, no FK
|
|
727
|
+
/// (same convention as AgentRepository.authorizedById).
|
|
728
|
+
grantedById String?
|
|
729
|
+
createdAt DateTime @default(now())
|
|
730
|
+
updatedAt DateTime @updatedAt
|
|
731
|
+
|
|
732
|
+
@@unique([resourceType, resourceId, granteeKey])
|
|
733
|
+
@@index([granteeKey, resourceType])
|
|
734
|
+
@@index([granteePrincipalId])
|
|
476
735
|
}
|
|
477
736
|
|
|
478
737
|
/// Phase 4: durable handle backing both a triggered run and (reserved,
|
|
@@ -611,6 +870,11 @@ model AuthUser {
|
|
|
611
870
|
principal Principal @relation(fields: [principalId], references: [id])
|
|
612
871
|
displayName String?
|
|
613
872
|
status String @default("enabled")
|
|
873
|
+
/// wardby roles (src/mcp/auth/resource-server.ts ROLE_PERMISSIONS: admin,
|
|
874
|
+
/// package-approver, service-manager), set with `wardby auth user grant`. Empty = member.
|
|
875
|
+
/// A privileged operation needs its scope on the token AND a role here
|
|
876
|
+
/// that grants it; unknown values grant nothing.
|
|
877
|
+
roles String[] @default([])
|
|
614
878
|
createdAt DateTime @default(now())
|
|
615
879
|
updatedAt DateTime @updatedAt
|
|
616
880
|
loginKeys AuthLoginKey[]
|
|
@@ -721,3 +985,133 @@ model AuthRateLimit {
|
|
|
721
985
|
|
|
722
986
|
@@index([expiresAt])
|
|
723
987
|
}
|
|
988
|
+
|
|
989
|
+
/// Which repositories on which code-review host a native agent may act on,
|
|
990
|
+
/// and which host events trigger it. See
|
|
991
|
+
/// docs/private/2026-09-25-code-review-host-design.md §4.1.
|
|
992
|
+
model AgentRepository {
|
|
993
|
+
id String @id @default(cuid())
|
|
994
|
+
agentId String
|
|
995
|
+
agent Agent @relation(fields: [agentId], references: [id], onDelete: Cascade)
|
|
996
|
+
/// "github" today; validated in code so adding a host needs no enum migration.
|
|
997
|
+
provider String
|
|
998
|
+
/// Canonical lower-case owner/name for the provider.
|
|
999
|
+
repository String
|
|
1000
|
+
/// "read" or "write".
|
|
1001
|
+
access String
|
|
1002
|
+
/// Subset of "pull_request", "mention".
|
|
1003
|
+
triggers String[] @default([])
|
|
1004
|
+
/// Only with the "pull_request" trigger (required there); names the agent's
|
|
1005
|
+
/// check. Unique per repository across all links (NULLs are distinct).
|
|
1006
|
+
checkName String?
|
|
1007
|
+
createdAt DateTime @default(now())
|
|
1008
|
+
|
|
1009
|
+
/// How this link was authorized: "host_permission" (the agent owner's
|
|
1010
|
+
/// verified host identity had enough access), "admin" (a wardby admin
|
|
1011
|
+
/// approved it explicitly), or "grandfathered" (existed before
|
|
1012
|
+
/// authorization was enforced). Null = never authorized; use is refused.
|
|
1013
|
+
authorizedVia String?
|
|
1014
|
+
/// The principal who authorized it. Audit only: plain text, no FK.
|
|
1015
|
+
authorizedById String?
|
|
1016
|
+
authorizedAt DateTime?
|
|
1017
|
+
|
|
1018
|
+
@@unique([agentId, provider, repository])
|
|
1019
|
+
@@unique([provider, repository, checkName])
|
|
1020
|
+
@@index([provider, repository])
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
/// The host check a run owns, so the review tool can complete it and the
|
|
1024
|
+
/// run finalizer can close it if the run ends without publishing.
|
|
1025
|
+
model RunHostCheck {
|
|
1026
|
+
runId String @id
|
|
1027
|
+
run Run @relation(fields: [runId], references: [id], onDelete: Cascade)
|
|
1028
|
+
provider String
|
|
1029
|
+
repository String
|
|
1030
|
+
checkId String
|
|
1031
|
+
headSha String
|
|
1032
|
+
/// The pull request the run was dispatched for. The review tool only
|
|
1033
|
+
/// completes or creates a check for this PR. Null on rows written before it
|
|
1034
|
+
/// existed: such a run publishes without a check.
|
|
1035
|
+
prNumber Int?
|
|
1036
|
+
completedAt DateTime?
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
/// De-duplicates host webhook redeliveries; pruned after 7 days.
|
|
1040
|
+
/// The status comment wardby posts on the issue or pull request whose
|
|
1041
|
+
/// @-mention started this run ("working on it"), edited with the outcome
|
|
1042
|
+
/// when the run ends. One per mention run.
|
|
1043
|
+
model RunHostStatus {
|
|
1044
|
+
runId String @id
|
|
1045
|
+
run Run @relation(fields: [runId], references: [id], onDelete: Cascade)
|
|
1046
|
+
provider String
|
|
1047
|
+
repository String
|
|
1048
|
+
/// The issue or pull request number the comment is on.
|
|
1049
|
+
number Int
|
|
1050
|
+
/// "conversation" (issue/PR comment) or "inline" (a reply in a review thread).
|
|
1051
|
+
commentKind String
|
|
1052
|
+
/// Null until the "working on it" comment is posted. The row is written
|
|
1053
|
+
/// with the run, so a run that dies before the comment exists still gets
|
|
1054
|
+
/// an outcome comment (from the reconciler).
|
|
1055
|
+
commentId String?
|
|
1056
|
+
/// For an inline mention: the review comment to reply to when the outcome
|
|
1057
|
+
/// has to be posted as a new comment.
|
|
1058
|
+
replyToReviewCommentId String?
|
|
1059
|
+
createdAt DateTime @default(now())
|
|
1060
|
+
completedAt DateTime?
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
model HostEventDelivery {
|
|
1064
|
+
provider String
|
|
1065
|
+
deliveryId String
|
|
1066
|
+
receivedAt DateTime @default(now())
|
|
1067
|
+
|
|
1068
|
+
@@id([provider, deliveryId])
|
|
1069
|
+
@@index([receivedAt])
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
/// A principal's verified identity on a code-review host (GitHub today),
|
|
1073
|
+
/// linked through the host's user-authorization flow (link_host_account).
|
|
1074
|
+
/// Only the numeric user id and login are stored, never a user token. A host
|
|
1075
|
+
/// user belongs to at most one principal.
|
|
1076
|
+
model HostIdentity {
|
|
1077
|
+
principalId String
|
|
1078
|
+
principal Principal @relation(fields: [principalId], references: [id], onDelete: Cascade)
|
|
1079
|
+
/// "github" today; validated in code.
|
|
1080
|
+
provider String
|
|
1081
|
+
/// The host's numeric user id, as text.
|
|
1082
|
+
hostUserId String
|
|
1083
|
+
/// Last known login; refreshed when the host reports a rename.
|
|
1084
|
+
login String
|
|
1085
|
+
linkedAt DateTime @default(now())
|
|
1086
|
+
updatedAt DateTime @updatedAt
|
|
1087
|
+
|
|
1088
|
+
@@id([principalId, provider])
|
|
1089
|
+
@@unique([provider, hostUserId])
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
/// An in-flight host identity link (link_host_account): the OAuth state and
|
|
1093
|
+
/// PKCE verifier, then, after the host's callback, the verified user and the
|
|
1094
|
+
/// hash of the one-time confirmation code the same principal must submit.
|
|
1095
|
+
/// Lives 10 minutes.
|
|
1096
|
+
model HostIdentityLinkRequest {
|
|
1097
|
+
id String @id @default(cuid())
|
|
1098
|
+
principalId String
|
|
1099
|
+
principal Principal @relation(fields: [principalId], references: [id], onDelete: Cascade)
|
|
1100
|
+
provider String
|
|
1101
|
+
/// sha256 of the OAuth state; the state itself is never stored.
|
|
1102
|
+
stateHash String @unique
|
|
1103
|
+
/// PKCE verifier: useless without the authorization code and the client secret.
|
|
1104
|
+
codeVerifier String
|
|
1105
|
+
hostUserId String?
|
|
1106
|
+
login String?
|
|
1107
|
+
/// sha256 of the confirmation code shown on the callback page.
|
|
1108
|
+
confirmHash String?
|
|
1109
|
+
/// Wrong confirmation codes submitted; the request is dead at 5.
|
|
1110
|
+
attempts Int @default(0)
|
|
1111
|
+
callbackAt DateTime?
|
|
1112
|
+
expiresAt DateTime
|
|
1113
|
+
createdAt DateTime @default(now())
|
|
1114
|
+
|
|
1115
|
+
@@index([principalId])
|
|
1116
|
+
@@index([expiresAt])
|
|
1117
|
+
}
|