@wardby/cli 0.2.1 → 0.4.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 +53 -4
- package/README.md +52 -13
- package/dist/claude-coding-worker/driver.d.ts +6 -1
- package/dist/claude-coding-worker/driver.js +27 -1
- package/dist/claude-coding-worker/main.js +2 -0
- 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 +14 -4
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +284 -36
- package/dist/coding/base-commit.d.ts +6 -0
- package/dist/coding/base-commit.js +12 -0
- 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 +91 -4
- package/dist/coding/protocol.js +123 -12
- package/dist/coding/provider.d.ts +6 -1
- package/dist/coding/provider.js +16 -9
- 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 +6 -0
- 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 +13 -1
- package/dist/coding-worker/driver.js +102 -13
- package/dist/coding-worker/errors.js +8 -0
- package/dist/coding-worker/main.js +10 -2
- 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 +66 -0
- package/dist/config/providers.js +137 -0
- package/dist/core/attribution.d.ts +101 -0
- package/dist/core/attribution.js +208 -0
- package/dist/core/budget-groups.d.ts +120 -10
- package/dist/core/budget-groups.js +133 -24
- package/dist/core/budget-wording.d.ts +22 -0
- package/dist/core/budget-wording.js +55 -0
- package/dist/core/coding-queue.d.ts +3 -0
- package/dist/core/coding-queue.js +6 -2
- package/dist/core/coding-service-status.d.ts +11 -0
- package/dist/core/coding-service-status.js +17 -0
- package/dist/core/cost-report.d.ts +88 -0
- package/dist/core/cost-report.js +248 -0
- package/dist/core/datastores.js +18 -2
- package/dist/core/db.d.ts +5 -1
- package/dist/core/db.js +8 -2
- package/dist/core/dispatch.d.ts +74 -7
- package/dist/core/dispatch.js +382 -47
- package/dist/core/engine-native.js +44 -14
- package/dist/core/glob.d.ts +10 -0
- package/dist/core/glob.js +33 -0
- package/dist/core/grants.d.ts +86 -0
- package/dist/core/grants.js +126 -0
- package/dist/core/host-events.d.ts +72 -0
- package/dist/core/host-events.js +597 -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 +78 -0
- package/dist/core/host-status.js +228 -0
- package/dist/core/in-flight-runs.d.ts +8 -0
- package/dist/core/in-flight-runs.js +56 -0
- package/dist/core/issue-bridge.d.ts +60 -0
- package/dist/core/issue-bridge.js +189 -0
- package/dist/core/issue-dedupe.d.ts +70 -0
- package/dist/core/issue-dedupe.js +255 -0
- package/dist/core/issue-events.d.ts +42 -0
- package/dist/core/issue-events.js +155 -0
- package/dist/core/issue-status.d.ts +29 -0
- package/dist/core/issue-status.js +241 -0
- package/dist/core/issue-tracker-tools.d.ts +64 -0
- package/dist/core/issue-tracker-tools.js +850 -0
- package/dist/core/model-usage.d.ts +10 -0
- package/dist/core/model-usage.js +24 -0
- package/dist/core/provider-wording.d.ts +12 -0
- package/dist/core/provider-wording.js +44 -0
- package/dist/core/reconciler.d.ts +42 -2
- package/dist/core/reconciler.js +97 -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 +354 -0
- package/dist/core/run-heartbeat.d.ts +27 -0
- package/dist/core/run-heartbeat.js +54 -0
- package/dist/core/run-pricing.d.ts +61 -0
- package/dist/core/run-pricing.js +56 -0
- package/dist/core/runner.d.ts +33 -8
- package/dist/core/runner.js +410 -62
- package/dist/core/scheduler.d.ts +4 -1
- package/dist/core/scheduler.js +3 -2
- package/dist/core/secrets.d.ts +11 -2
- package/dist/core/secrets.js +25 -6
- package/dist/core/self-defects.d.ts +80 -0
- package/dist/core/self-defects.js +180 -0
- package/dist/core/subagent-memory-tools.d.ts +1 -1
- 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 +67 -0
- package/dist/core/untrusted-content.d.ts +32 -0
- package/dist/core/untrusted-content.js +72 -0
- package/dist/core/webhooks.d.ts +17 -2
- package/dist/core/webhooks.js +42 -3
- package/dist/generated/prisma/browser.d.ts +166 -0
- package/dist/generated/prisma/client.d.ts +166 -0
- package/dist/generated/prisma/commonInputTypes.d.ts +152 -52
- package/dist/generated/prisma/enums.d.ts +13 -0
- package/dist/generated/prisma/enums.js +12 -1
- package/dist/generated/prisma/internal/class.d.ts +242 -0
- package/dist/generated/prisma/internal/class.js +4 -4
- package/dist/generated/prisma/internal/prismaNamespace.d.ts +2571 -577
- package/dist/generated/prisma/internal/prismaNamespace.js +312 -6
- package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts +328 -0
- package/dist/generated/prisma/internal/prismaNamespaceBrowser.js +312 -6
- package/dist/generated/prisma/models/Agent.d.ts +682 -1
- package/dist/generated/prisma/models/AgentIssueProject.d.ts +1838 -0
- package/dist/generated/prisma/models/AgentIssueProject.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/AgentTool.d.ts +95 -1
- package/dist/generated/prisma/models/AuthUser.d.ts +56 -1
- package/dist/generated/prisma/models/CodingAgentProfile.d.ts +258 -7
- package/dist/generated/prisma/models/CodingProxySession.d.ts +195 -2
- package/dist/generated/prisma/models/CodingRun.d.ts +1405 -95
- package/dist/generated/prisma/models/CodingRunServiceStatus.d.ts +1404 -0
- package/dist/generated/prisma/models/CodingRunServiceStatus.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/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/IssueFingerprint.d.ts +1183 -0
- package/dist/generated/prisma/models/IssueFingerprint.js +1 -0
- package/dist/generated/prisma/models/IssuePullRequest.d.ts +1255 -0
- package/dist/generated/prisma/models/IssuePullRequest.js +1 -0
- package/dist/generated/prisma/models/ModelCatalogEntry.d.ts +1322 -0
- package/dist/generated/prisma/models/ModelCatalogEntry.js +1 -0
- package/dist/generated/prisma/models/Principal.d.ts +455 -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 +1402 -82
- package/dist/generated/prisma/models/RunAttribution.d.ts +1259 -0
- package/dist/generated/prisma/models/RunAttribution.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/RunIssueStatus.d.ts +1199 -0
- package/dist/generated/prisma/models/RunIssueStatus.js +1 -0
- package/dist/generated/prisma/models/RunModelUsage.d.ts +1316 -0
- package/dist/generated/prisma/models/RunModelUsage.js +1 -0
- package/dist/generated/prisma/models/Tool.d.ts +15 -3
- package/dist/generated/prisma/models/WorkItem.d.ts +1408 -0
- package/dist/generated/prisma/models/WorkItem.js +1 -0
- package/dist/generated/prisma/models.d.ts +22 -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 +999 -0
- package/dist/import/cli-args.js +3 -2
- package/dist/import/create.d.ts +5 -0
- package/dist/import/create.js +67 -13
- package/dist/import/index.js +19 -9
- package/dist/import/neutral-schema.d.ts +18 -18
- package/dist/knowledge/check.d.ts +13 -0
- package/dist/knowledge/check.js +69 -0
- package/dist/knowledge/cli.d.ts +14 -0
- package/dist/knowledge/cli.js +67 -0
- package/dist/knowledge/concept.d.ts +54 -0
- package/dist/knowledge/concept.js +78 -0
- package/dist/knowledge/note.d.ts +11 -0
- package/dist/knowledge/note.js +39 -0
- package/dist/knowledge/relevance.d.ts +11 -0
- package/dist/knowledge/relevance.js +14 -0
- package/dist/knowledge/span-hash.d.ts +3 -0
- package/dist/knowledge/span-hash.js +16 -0
- package/dist/mcp/auth/access.d.ts +72 -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 +25 -51
- package/dist/mcp/auth/ownership.js +19 -14
- 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 +33 -2
- package/dist/mcp/auth/resource-server.js +99 -3
- package/dist/mcp/auth/self-hosted/browser.js +2 -2
- package/dist/mcp/auth/self-hosted/cli.js +47 -13
- package/dist/mcp/auth/self-hosted/credentials.d.ts +23 -5
- package/dist/mcp/auth/self-hosted/credentials.js +62 -4
- package/dist/mcp/auth/self-hosted/session.d.ts +7 -6
- package/dist/mcp/context.d.ts +30 -1
- package/dist/mcp/errors.d.ts +25 -6
- package/dist/mcp/errors.js +98 -0
- package/dist/mcp/host-events/deliveries.d.ts +9 -0
- package/dist/mcp/host-events/deliveries.js +17 -0
- package/dist/mcp/host-events/github-ingress.d.ts +38 -0
- package/dist/mcp/host-events/github-ingress.js +83 -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/host-events/jira-ingress.d.ts +29 -0
- package/dist/mcp/host-events/jira-ingress.js +92 -0
- package/dist/mcp/index.d.ts +10 -1
- package/dist/mcp/index.js +187 -19
- package/dist/mcp/server.js +32 -11
- package/dist/mcp/tools/agents.js +519 -50
- package/dist/mcp/tools/budget-groups.js +3 -3
- package/dist/mcp/tools/cost-report.d.ts +8 -0
- package/dist/mcp/tools/cost-report.js +60 -0
- package/dist/mcp/tools/datastore.js +22 -15
- 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/issue-projects.d.ts +2 -0
- package/dist/mcp/tools/issue-projects.js +238 -0
- package/dist/mcp/tools/memory.d.ts +7 -1
- package/dist/mcp/tools/memory.js +5 -5
- package/dist/mcp/tools/model-catalog.d.ts +22 -0
- package/dist/mcp/tools/model-catalog.js +423 -0
- package/dist/mcp/tools/repositories.d.ts +2 -0
- package/dist/mcp/tools/repositories.js +182 -0
- package/dist/mcp/tools/runs.d.ts +6 -0
- package/dist/mcp/tools/runs.js +60 -6
- package/dist/mcp/tools/scheduling.js +3 -6
- 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 +52 -16
- package/dist/mcp/tools/tools.d.ts +41 -0
- package/dist/mcp/tools/tools.js +201 -40
- package/dist/mcp/tools/trigger.js +65 -7
- package/dist/mcp/tools/webhooks.js +15 -4
- package/dist/mcp/transport/streamable-http.d.ts +15 -0
- package/dist/mcp/transport/streamable-http.js +55 -3
- package/dist/mcp/webhooks/ingress.d.ts +2 -1
- package/dist/mcp/webhooks/ingress.js +9 -2
- package/dist/providers/auth/delegating.d.ts +19 -0
- package/dist/providers/auth/delegating.js +71 -0
- package/dist/providers/auth/index.d.ts +2 -0
- package/dist/providers/auth/index.js +11 -0
- package/dist/providers/auth/self-hosted.d.ts +10 -2
- package/dist/providers/auth/self-hosted.js +55 -6
- package/dist/providers/auth/types.d.ts +6 -0
- package/dist/providers/coding-proxy/memory-ledger.d.ts +4 -1
- package/dist/providers/coding-proxy/memory-ledger.js +31 -3
- package/dist/providers/coding-proxy/metering.d.ts +6 -1
- package/dist/providers/coding-proxy/metering.js +41 -4
- package/dist/providers/coding-proxy/prisma-ledger.d.ts +17 -0
- package/dist/providers/coding-proxy/prisma-ledger.js +106 -8
- package/dist/providers/coding-proxy/proxy.d.ts +25 -2
- package/dist/providers/coding-proxy/proxy.js +561 -38
- 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 +17 -0
- 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 +33 -1
- package/dist/providers/coding-proxy/types.js +12 -1
- package/dist/providers/engine/types.d.ts +29 -0
- package/dist/providers/executor/build.d.ts +2 -2
- package/dist/providers/executor/composition.d.ts +3 -0
- package/dist/providers/executor/composition.js +28 -1
- package/dist/providers/executor/container.d.ts +134 -4
- package/dist/providers/executor/container.js +394 -37
- package/dist/providers/executor/dbos.d.ts +4 -3
- package/dist/providers/executor/dbos.js +7 -5
- package/dist/providers/executor/in-process.d.ts +2 -3
- package/dist/providers/executor/routing.d.ts +13 -0
- package/dist/providers/executor/routing.js +18 -0
- package/dist/providers/executor/types.d.ts +34 -0
- package/dist/providers/issue-tracker/adf.d.ts +31 -0
- package/dist/providers/issue-tracker/adf.js +181 -0
- package/dist/providers/issue-tracker/index.d.ts +5 -0
- package/dist/providers/issue-tracker/index.js +12 -0
- package/dist/providers/issue-tracker/jira-client.d.ts +41 -0
- package/dist/providers/issue-tracker/jira-client.js +151 -0
- package/dist/providers/issue-tracker/jira-events.d.ts +3 -0
- package/dist/providers/issue-tracker/jira-events.js +98 -0
- package/dist/providers/issue-tracker/jira.d.ts +116 -0
- package/dist/providers/issue-tracker/jira.js +502 -0
- package/dist/providers/issue-tracker/types.d.ts +269 -0
- package/dist/providers/issue-tracker/types.js +16 -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 +53 -2
- package/dist/providers/jobs/docker.js +307 -32
- 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 +24 -2
- package/dist/providers/jobs/kubernetes.js +153 -22
- package/dist/providers/jobs/service-state.d.ts +22 -0
- package/dist/providers/jobs/service-state.js +17 -0
- package/dist/providers/jobs/types.d.ts +18 -0
- package/dist/providers/llm/anthropic.d.ts +3 -3
- package/dist/providers/llm/anthropic.js +3 -5
- package/dist/providers/llm/bedrock.d.ts +3 -3
- package/dist/providers/llm/bedrock.js +3 -8
- package/dist/providers/llm/catalog-lookup.d.ts +10 -0
- package/dist/providers/llm/catalog-lookup.js +15 -0
- package/dist/providers/llm/catalog-shipped.d.ts +18 -0
- package/dist/providers/llm/catalog-shipped.js +197 -0
- package/dist/providers/llm/catalog-store.d.ts +58 -0
- package/dist/providers/llm/catalog-store.js +138 -0
- package/dist/providers/llm/catalog-types.d.ts +66 -0
- package/dist/providers/llm/catalog-types.js +64 -0
- package/dist/providers/llm/catalog.d.ts +61 -0
- package/dist/providers/llm/catalog.js +147 -0
- 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 +10 -12
- package/dist/providers/llm/claude-provider.js +15 -6
- package/dist/providers/llm/index.d.ts +9 -6
- package/dist/providers/llm/index.js +8 -5
- package/dist/providers/llm/openai.d.ts +14 -5
- package/dist/providers/llm/openai.js +24 -14
- package/dist/providers/llm/pricing-core.d.ts +5 -3
- package/dist/providers/llm/registration.js +8 -12
- package/dist/providers/llm/routing.d.ts +21 -11
- package/dist/providers/llm/routing.js +47 -13
- package/dist/providers/llm/types.d.ts +12 -0
- package/dist/providers/llm/types.js +8 -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 +226 -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 +568 -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 +309 -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 +78 -34
- package/dist/providers/vcs/github.d.ts +94 -3
- package/dist/providers/vcs/github.js +223 -17
- package/dist/providers/vcs/types.d.ts +48 -4
- package/dist/quickstart/index.d.ts +2 -0
- package/dist/quickstart/index.js +36 -8
- 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 +8 -2
- package/dist/viewer/api-schema.d.ts +2757 -0
- package/dist/viewer/api-schema.js +165 -0
- package/dist/viewer/build-schemas.d.ts +2 -0
- package/dist/viewer/build-schemas.js +18 -0
- package/dist/viewer/event-bus.d.ts +38 -0
- package/dist/viewer/event-bus.js +232 -0
- package/dist/viewer/graph.d.ts +40 -0
- package/dist/viewer/graph.js +243 -0
- package/dist/viewer/http.d.ts +30 -0
- package/dist/viewer/http.js +133 -0
- package/dist/viewer/run-detail.d.ts +4 -0
- package/dist/viewer/run-detail.js +61 -0
- package/dist/wardby-bin.js +11 -0
- package/docs/README.md +40 -0
- package/docs/agent-recipes.md +383 -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 +508 -0
- package/docs/coding-agent-setup.md +175 -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 +1068 -0
- package/docs/getting-started-gke.md +632 -0
- package/docs/getting-started-identity-provider.md +319 -0
- package/docs/getting-started.md +147 -0
- package/docs/jira-agents.md +649 -0
- package/docs/knowledge.md +387 -0
- package/docs/models.md +221 -0
- package/docs/observability.md +53 -0
- package/docs/release-verification.md +66 -0
- package/docs/security-deployment.md +667 -0
- package/docs/viewer-api.md +142 -0
- package/help/admin-viewer.md +39 -0
- package/help/agent-recipes.md +173 -0
- package/help/architecture-agent.md +189 -0
- package/help/builder-agent.md +80 -0
- package/help/code-review-agents.md +37 -0
- package/help/coding-packages.md +31 -0
- package/help/coding-services.md +71 -0
- package/help/cost-attribution.md +67 -0
- package/help/creating-agents.md +90 -0
- package/help/deploy-gke.md +45 -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/model-unavailable.md +63 -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 +32 -0
- package/help/github.md +48 -0
- package/help/identity-and-access.md +44 -0
- package/help/jira.md +135 -0
- package/help/knowledge.md +47 -0
- package/help/mcp.md +30 -0
- package/help/models.md +90 -0
- package/help/native-capabilities.md +30 -0
- package/help/observability.md +41 -0
- package/help/operating-agents.md +36 -0
- package/help/security.md +27 -0
- package/help/troubleshooting/budgets.md +32 -0
- package/help/troubleshooting/coding-workers.md +47 -0
- package/help/troubleshooting/repository-access.md +27 -0
- package/package.json +14 -3
- 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/migrations/20260930000000_jira_issue_projects/migration.sql +34 -0
- package/prisma/migrations/20261001000000_jira_phase2_allowlists/migration.sql +3 -0
- package/prisma/migrations/20261001010000_jira_link_types_allowlist/migration.sql +2 -0
- package/prisma/migrations/20261002000000_jira_coding_bridge/migration.sql +28 -0
- package/prisma/migrations/20261002010000_jira_issue_creation/migration.sql +25 -0
- package/prisma/migrations/20261003000000_issue_cost_attribution/migration.sql +56 -0
- package/prisma/migrations/20261003010000_coding_run_service_status/migration.sql +23 -0
- package/prisma/migrations/20261003020000_viewer_notify/migration.sql +54 -0
- package/prisma/migrations/20261003030000_viewer_notify_fixes/migration.sql +47 -0
- package/prisma/migrations/20261003040000_viewer_indexes/migration.sql +12 -0
- package/prisma/migrations/20261004000000_model_catalog/migration.sql +26 -0
- package/prisma/schema.prisma +663 -21
- package/dist/mcp/tools/models.d.ts +0 -8
- package/dist/mcp/tools/models.js +0 -15
- package/dist/providers/llm/pricing-anthropic.d.ts +0 -4
- package/dist/providers/llm/pricing-anthropic.js +0 -30
- package/dist/providers/llm/pricing-bedrock-claude.d.ts +0 -12
- package/dist/providers/llm/pricing-bedrock-claude.js +0 -37
- package/dist/providers/llm/pricing.d.ts +0 -30
- package/dist/providers/llm/pricing.js +0 -74
package/prisma/schema.prisma
CHANGED
|
@@ -42,12 +42,21 @@ model Agent {
|
|
|
42
42
|
tools AgentTool[]
|
|
43
43
|
maxTurns Int @default(10)
|
|
44
44
|
|
|
45
|
-
// Phase 4: ownership. Null =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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[]
|
|
55
|
+
issueProjects AgentIssueProject[]
|
|
56
|
+
|
|
57
|
+
/// Self-defects opt-in: the Jira project and issue type wardby files the agent's own failures into. Both or neither.
|
|
58
|
+
defectProjectKey String?
|
|
59
|
+
defectIssueType String?
|
|
51
60
|
|
|
52
61
|
// Phase 7: at most one budget group. Null = uncapped beyond its own budgetUsd.
|
|
53
62
|
budgetGroupId String?
|
|
@@ -59,6 +68,11 @@ model Agent {
|
|
|
59
68
|
/// created for it.
|
|
60
69
|
memoryEnabled Boolean @default(false)
|
|
61
70
|
|
|
71
|
+
/// Un-phased: reasoning effort for native agents (low, medium, high,
|
|
72
|
+
/// xhigh, max). Validated against the model in code, not a DB enum.
|
|
73
|
+
/// Null = the provider's default.
|
|
74
|
+
effort String?
|
|
75
|
+
|
|
62
76
|
/// Un-phased: sub-agent composition edges (see AgentSubAgent below). An
|
|
63
77
|
/// agent can be a parent (has children it can delegate to) and/or a
|
|
64
78
|
/// child (is delegated to by others) independently.
|
|
@@ -134,7 +148,11 @@ enum RunStatus {
|
|
|
134
148
|
/// Phase 3: a WASM-sandboxed, Zod-validated tool a model can call.
|
|
135
149
|
model Tool {
|
|
136
150
|
id String @id @default(cuid())
|
|
137
|
-
name
|
|
151
|
+
/// Unique per owner (@@unique below), not globally: the name is what the
|
|
152
|
+
/// model calls, so what must never repeat is a name within one agent's
|
|
153
|
+
/// attachments — attach_tool, `wardby tool attach` and the importer refuse
|
|
154
|
+
/// a second same-named tool on an agent.
|
|
155
|
+
name String
|
|
138
156
|
description String
|
|
139
157
|
/// Zod schema *source text*; compiled and evaluated inside the sandbox,
|
|
140
158
|
/// never in the host process.
|
|
@@ -143,7 +161,8 @@ model Tool {
|
|
|
143
161
|
/// and cached here — re-deriving it on every run would spin a fresh QuickJS
|
|
144
162
|
/// runtime and evaluate the whole vendored zod bundle per attached tool,
|
|
145
163
|
/// before the first LLM call, on every single run. Safe to cache because
|
|
146
|
-
///
|
|
164
|
+
/// every write of paramsZod (create, and MCP update_tool) re-derives it in
|
|
165
|
+
/// the same write. A run pins the version its load step read.
|
|
147
166
|
jsonSchema Json
|
|
148
167
|
/// Tool body source; run inside the sandbox with the validated params.
|
|
149
168
|
code String
|
|
@@ -151,9 +170,12 @@ model Tool {
|
|
|
151
170
|
updatedAt DateTime @updatedAt
|
|
152
171
|
agents AgentTool[]
|
|
153
172
|
|
|
154
|
-
// Phase 4: ownership. Null =
|
|
173
|
+
// Phase 4: ownership. Null = owner-less (a transition state; tool grants
|
|
174
|
+
// arrive in the resource-sharing grants Phase 2, see ResourceGrant).
|
|
155
175
|
ownerId String?
|
|
156
176
|
owner Principal? @relation(fields: [ownerId], references: [id])
|
|
177
|
+
|
|
178
|
+
@@unique([ownerId, name])
|
|
157
179
|
}
|
|
158
180
|
|
|
159
181
|
/// Phase 3: explicit many-to-many join between Agent and Tool.
|
|
@@ -175,6 +197,17 @@ model AgentTool {
|
|
|
175
197
|
allowedHosts Json @default("[]")
|
|
176
198
|
allowedSharedDatastorePrefixes Json @default("{}")
|
|
177
199
|
|
|
200
|
+
/// Who created the attachment. Audit only: plain text, no FK (same
|
|
201
|
+
/// convention as AgentRepository.authorizedById).
|
|
202
|
+
attachedById String?
|
|
203
|
+
/// The principal whose consent the four capability fields above carry.
|
|
204
|
+
/// The runner honours them only while this equals the agent's CURRENT
|
|
205
|
+
/// ownerId (resource-sharing grants spec §3.4.2): a write-grantee's
|
|
206
|
+
/// attachment, a make_owner transfer, or a pre-grants row nobody vouched
|
|
207
|
+
/// for runs with no secrets, no datastore and no fetch until the owner
|
|
208
|
+
/// re-grants with attach_tool. Plain text, no FK.
|
|
209
|
+
capabilitiesGrantedById String?
|
|
210
|
+
|
|
178
211
|
@@id([agentId, toolId])
|
|
179
212
|
}
|
|
180
213
|
|
|
@@ -270,19 +303,20 @@ enum RunTrigger {
|
|
|
270
303
|
scheduled
|
|
271
304
|
webhook
|
|
272
305
|
subagent
|
|
306
|
+
host_event
|
|
273
307
|
}
|
|
274
308
|
|
|
275
309
|
model Run {
|
|
276
|
-
id String
|
|
277
|
-
agent Agent
|
|
310
|
+
id String @id @default(cuid())
|
|
311
|
+
agent Agent @relation(fields: [agentId], references: [id])
|
|
278
312
|
agentId String
|
|
279
|
-
status RunStatus
|
|
280
|
-
trigger RunTrigger
|
|
281
|
-
tokensIn Int
|
|
282
|
-
tokensOut Int
|
|
283
|
-
costUsd Decimal
|
|
313
|
+
status RunStatus @default(pending)
|
|
314
|
+
trigger RunTrigger @default(manual)
|
|
315
|
+
tokensIn Int @default(0)
|
|
316
|
+
tokensOut Int @default(0)
|
|
317
|
+
costUsd Decimal @default(0) @db.Decimal(10, 6)
|
|
284
318
|
error String?
|
|
285
|
-
startedAt DateTime
|
|
319
|
+
startedAt DateTime @default(now())
|
|
286
320
|
finishedAt DateTime?
|
|
287
321
|
/// Phase 2: beaten by the executor while running; a stale value past
|
|
288
322
|
/// HEARTBEAT_TIMEOUT is how the reconciler finds an orphaned run.
|
|
@@ -295,15 +329,27 @@ model Run {
|
|
|
295
329
|
/// Phase 4: EngineResult.turns, persisted for the same reason as
|
|
296
330
|
/// finalText — MCP's list_runs/get_run need it and it was previously
|
|
297
331
|
/// dropped after the engine returned.
|
|
298
|
-
turns Int
|
|
332
|
+
turns Int @default(0)
|
|
333
|
+
/// The run's model catalog entry, recorded when it started (native: the
|
|
334
|
+
/// runner's load step; coding: dispatch). The run is billed at these rates
|
|
335
|
+
/// for its whole life, resumes included. Null on runs from before the
|
|
336
|
+
/// model catalog.
|
|
337
|
+
pricingVersion String?
|
|
338
|
+
pricingSnapshot Json?
|
|
299
339
|
/// Detached executors are recovered by handle rather than inferred from trigger.
|
|
300
|
-
executionManaged Boolean
|
|
340
|
+
executionManaged Boolean @default(false)
|
|
301
341
|
/// Phase 6: which durable executor backend holds this run, if any
|
|
302
342
|
/// ("dbos" = a DBOS workflow whose id equals this run's id). Null for
|
|
303
343
|
/// in-process runs. The reconciler consults the backend before declaring a
|
|
304
344
|
/// stale run lost, and can adopt one orphaned by a dead instance.
|
|
305
345
|
executionBackend String?
|
|
306
346
|
codingRun CodingRun?
|
|
347
|
+
hostCheck RunHostCheck?
|
|
348
|
+
hostStatus RunHostStatus?
|
|
349
|
+
issueStatus RunIssueStatus?
|
|
350
|
+
attribution RunAttribution?
|
|
351
|
+
modelUsage RunModelUsage[]
|
|
352
|
+
serviceStatuses CodingRunServiceStatus[]
|
|
307
353
|
|
|
308
354
|
/// Un-phased: sub-agent dispatch (see AgentSubAgent). Null for a
|
|
309
355
|
/// top-level run; set when this run was created by a parent run's
|
|
@@ -326,6 +372,19 @@ model Run {
|
|
|
326
372
|
/// loaded systemPrompt at run time so the stable prefix stays
|
|
327
373
|
/// prompt-cache-eligible across dispatches.
|
|
328
374
|
taskOverride String?
|
|
375
|
+
/// The principal the run is visible to besides the agent's owner
|
|
376
|
+
/// (resource-sharing grants spec §3.5): the trigger_agent caller, a
|
|
377
|
+
/// webhook's creator, or a sub-agent's parent run's triggerer. Null for
|
|
378
|
+
/// scheduled, host-event and CLI runs, which only the owner sees. Plain
|
|
379
|
+
/// text, no FK.
|
|
380
|
+
triggeredById String?
|
|
381
|
+
|
|
382
|
+
@@index([agentId, triggeredById])
|
|
383
|
+
/// The admin viewer's graph window (runs started since a time, or still
|
|
384
|
+
/// pending/running) and its ancestor/children walks (docs/viewer-api.md).
|
|
385
|
+
@@index([startedAt])
|
|
386
|
+
@@index([status])
|
|
387
|
+
@@index([parentRunId])
|
|
329
388
|
}
|
|
330
389
|
|
|
331
390
|
/// Phase 5: owner-configured coding behavior. Runtime credentials and opaque
|
|
@@ -339,13 +398,31 @@ model CodingAgentProfile {
|
|
|
339
398
|
defaultTask String?
|
|
340
399
|
allowWebhookTaskOverride Boolean @default(false)
|
|
341
400
|
timeoutSec Int @default(1800)
|
|
342
|
-
|
|
401
|
+
/// Unused; dropped after rollout (see the package-registry plan, Task 14).
|
|
402
|
+
allowedEgress Json @default("[]")
|
|
343
403
|
protectedPaths Json
|
|
404
|
+
collectExclude Json @default("[]")
|
|
344
405
|
toolchain String @default("node")
|
|
345
406
|
toolchainVersion String?
|
|
346
407
|
workerImageRef String?
|
|
347
408
|
/// Per-agent workspace size in MiB; null = CODING_DISK_MB.
|
|
348
409
|
workspaceDiskMb Int?
|
|
410
|
+
packageAllowlist Json @default("{}")
|
|
411
|
+
packagePolicy Json @default("{}")
|
|
412
|
+
/// Admin-requested debug trace: while now < debugTraceUntil, every coding
|
|
413
|
+
/// run of this agent is dispatched with CodingRun.debugTrace set. Null = off.
|
|
414
|
+
debugTraceUntil DateTime?
|
|
415
|
+
/// Coding-run services (docs/coding-services.md): the catalog names
|
|
416
|
+
/// (CodingService.name) this agent's runs may start, any version the catalog
|
|
417
|
+
/// has. Empty = none. Owner-set through update_agent.
|
|
418
|
+
services Json @default("[]")
|
|
419
|
+
|
|
420
|
+
/// How `repository` was authorized for this agent (see AgentRepository.authorizedVia):
|
|
421
|
+
/// "host_permission", "admin", or "grandfathered". Null = never authorized; runs are refused.
|
|
422
|
+
repositoryAuthorizedVia String?
|
|
423
|
+
/// The principal whose GitHub access (or admin approval) authorized it. Audit only, no FK.
|
|
424
|
+
repositoryAuthorizedById String?
|
|
425
|
+
repositoryAuthorizedAt DateTime?
|
|
349
426
|
}
|
|
350
427
|
|
|
351
428
|
/// Phase 5: immutable dispatch inputs plus opaque execution/result state for
|
|
@@ -360,8 +437,10 @@ model CodingRun {
|
|
|
360
437
|
provider String
|
|
361
438
|
model String
|
|
362
439
|
timeoutSec Int
|
|
363
|
-
|
|
440
|
+
/// Unused; dropped after rollout (see the package-registry plan, Task 14).
|
|
441
|
+
allowedEgress Json @default("[]")
|
|
364
442
|
protectedPaths Json
|
|
443
|
+
collectExclude Json @default("[]")
|
|
365
444
|
jobBackend String?
|
|
366
445
|
jobHandle String?
|
|
367
446
|
result Json?
|
|
@@ -371,6 +450,8 @@ model CodingRun {
|
|
|
371
450
|
failureCategory String?
|
|
372
451
|
diagnosticId String?
|
|
373
452
|
workerImage String?
|
|
453
|
+
/// Claude Code's tool-runner image, resolved from the agent's toolchain at dispatch; null for Codex runs.
|
|
454
|
+
toolImage String?
|
|
374
455
|
budgetReservedUsd Decimal @db.Decimal(10, 6)
|
|
375
456
|
/// Phase 12 concurrency queue: set when start() found every coding slot
|
|
376
457
|
/// taken (CODING_MAX_CONCURRENT), cleared when the run claims a slot. A
|
|
@@ -378,6 +459,18 @@ model CodingRun {
|
|
|
378
459
|
queuedAt DateTime?
|
|
379
460
|
/// Per-agent workspace size in MiB; null = CODING_DISK_MB.
|
|
380
461
|
workspaceDiskMb Int?
|
|
462
|
+
packageAllowlist Json @default("{}")
|
|
463
|
+
packagePolicy Json @default("{}")
|
|
464
|
+
/// Fixed at dispatch from the profile's debugTraceUntil: the worker writes a
|
|
465
|
+
/// full stream trace to its own pod log (never to the database).
|
|
466
|
+
debugTrace Boolean @default(false)
|
|
467
|
+
/// Coding-run services resolved at dispatch from the base branch's
|
|
468
|
+
/// .wardby/services.yaml: one snapshot per service (the catalog entry minus
|
|
469
|
+
/// kind), fixed for the run's lifetime. Empty = none.
|
|
470
|
+
services Json @default("[]")
|
|
471
|
+
/// The originating tracker issue ("jira" + key), set by the control plane from the run tree, never from model output.
|
|
472
|
+
issueProvider String?
|
|
473
|
+
issueKey String?
|
|
381
474
|
createdAt DateTime @default(now())
|
|
382
475
|
updatedAt DateTime @updatedAt
|
|
383
476
|
proxySession CodingProxySession?
|
|
@@ -392,12 +485,84 @@ model CodingRun {
|
|
|
392
485
|
rootCodingRun CodingRun? @relation("CodingRunContinuation", fields: [rootCodingRunId], references: [runId])
|
|
393
486
|
continuations CodingRun[] @relation("CodingRunContinuation")
|
|
394
487
|
|
|
488
|
+
registryAllowances RegistryAllowance[]
|
|
489
|
+
registryFetches RegistryFetch[]
|
|
490
|
+
registryApprovedVersions RegistryApprovedVersion[]
|
|
491
|
+
registryPlanRefusals RegistryPlanRefusal[]
|
|
492
|
+
|
|
395
493
|
@@index([jobBackend, jobHandle])
|
|
396
494
|
@@index([failureCategory])
|
|
397
495
|
@@index([queuedAt])
|
|
398
496
|
@@index([rootCodingRunId])
|
|
399
497
|
}
|
|
400
498
|
|
|
499
|
+
/// Coding-run services (docs/coding-services.md): the catalog a repository's
|
|
500
|
+
/// .wardby/services.yaml names entries from. Admin-managed over MCP
|
|
501
|
+
/// (list/get_service: agents:read; create/update/delete_service:
|
|
502
|
+
/// services:manage, audit-logged).
|
|
503
|
+
/// Built-in rows ship with wardby, seeded by migration, and change only with a
|
|
504
|
+
/// wardby release. `kind` is "sidecar" (a fresh instance in each run's pod);
|
|
505
|
+
/// "external" is reserved.
|
|
506
|
+
model CodingService {
|
|
507
|
+
id String @id @default(cuid())
|
|
508
|
+
name String
|
|
509
|
+
version String
|
|
510
|
+
kind String @default("sidecar")
|
|
511
|
+
/// Digest-pinned image reference (repo@sha256:...).
|
|
512
|
+
image String
|
|
513
|
+
port Int
|
|
514
|
+
/// Environment for the service container itself: throwaway per-run values, never secrets.
|
|
515
|
+
serviceEnv Json @default("{}")
|
|
516
|
+
/// Variables the agent's shells receive (DATABASE_URL, PG*, REDIS_URL, ...).
|
|
517
|
+
testEnv Json @default("{}")
|
|
518
|
+
/// { command, periodSeconds, timeoutSeconds, failureThreshold }: the sidecar's startup probe.
|
|
519
|
+
readiness Json
|
|
520
|
+
/// { cpuMillicores, memoryMib, diskMib }: requests equal limits.
|
|
521
|
+
resources Json
|
|
522
|
+
/// Where the service writes its data: an emptyDir in the run pod.
|
|
523
|
+
dataPath String
|
|
524
|
+
/// Further directories the image writes to (socket directory, /tmp): each an emptyDir.
|
|
525
|
+
writablePaths Json @default("[]")
|
|
526
|
+
builtin Boolean @default(false)
|
|
527
|
+
/// The admin who created it. Audit only, no FK; null for built-ins.
|
|
528
|
+
createdById String?
|
|
529
|
+
createdAt DateTime @default(now())
|
|
530
|
+
updatedAt DateTime @updatedAt
|
|
531
|
+
|
|
532
|
+
@@unique([name, version])
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
enum CodingServiceState {
|
|
536
|
+
pending
|
|
537
|
+
probing
|
|
538
|
+
ready
|
|
539
|
+
failed
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/// Live start-up state of one coding-run service (one row per run x
|
|
543
|
+
/// service), written by the job launcher as it observes the service, for
|
|
544
|
+
/// display only (the viewer). The run's CodingRun.services
|
|
545
|
+
/// snapshot says what was started; this says how far each one got.
|
|
546
|
+
/// `attempts` is the readiness probes made so far, known only where wardby
|
|
547
|
+
/// runs the probe itself (Docker); `reason` is a fixed identifier
|
|
548
|
+
/// (image_unavailable, start_failed, exited, probe_failed, timed_out),
|
|
549
|
+
/// never probe output.
|
|
550
|
+
model CodingRunServiceStatus {
|
|
551
|
+
id String @id @default(cuid())
|
|
552
|
+
runId String
|
|
553
|
+
run Run @relation(fields: [runId], references: [id], onDelete: Cascade)
|
|
554
|
+
name String
|
|
555
|
+
state CodingServiceState @default(pending)
|
|
556
|
+
attempts Int?
|
|
557
|
+
reason String?
|
|
558
|
+
readyAt DateTime?
|
|
559
|
+
failedAt DateTime?
|
|
560
|
+
createdAt DateTime @default(now())
|
|
561
|
+
updatedAt DateTime @updatedAt
|
|
562
|
+
|
|
563
|
+
@@unique([runId, name])
|
|
564
|
+
}
|
|
565
|
+
|
|
401
566
|
enum CodingProxySessionStatus {
|
|
402
567
|
active
|
|
403
568
|
cancelled
|
|
@@ -426,6 +591,22 @@ model CodingProxySession {
|
|
|
426
591
|
createdAt DateTime @default(now())
|
|
427
592
|
updatedAt DateTime @updatedAt
|
|
428
593
|
requests CodingProxyRequest[]
|
|
594
|
+
/// Hash of the derived registry-only token (see deriveRegistryToken); the
|
|
595
|
+
/// token itself is never persisted.
|
|
596
|
+
registryTokenHash String? @unique
|
|
597
|
+
/// Set the first time the proxy refuses a request of this session for
|
|
598
|
+
/// budget; lets the executor report the run as out of budget.
|
|
599
|
+
budgetExhaustedAt DateTime?
|
|
600
|
+
/// The upstream error code (a fixed identifier, never a message) of the
|
|
601
|
+
/// first provider failure the proxy relayed for this session; lets the
|
|
602
|
+
/// executor say the model provider refused the run.
|
|
603
|
+
upstreamFailure String?
|
|
604
|
+
/// The run's catalog entry, copied from Run.pricingSnapshot when the session
|
|
605
|
+
/// is created; the proxy prices and shapes requests from it. Null on
|
|
606
|
+
/// sessions from before the model catalog (the proxy falls back to the
|
|
607
|
+
/// shipped catalog).
|
|
608
|
+
pricingVersion String?
|
|
609
|
+
catalogEntry Json?
|
|
429
610
|
|
|
430
611
|
@@index([deadlineAt])
|
|
431
612
|
}
|
|
@@ -458,6 +639,96 @@ model CodingProxyRequest {
|
|
|
458
639
|
@@index([sessionId, status])
|
|
459
640
|
}
|
|
460
641
|
|
|
642
|
+
enum RegistryFetchOutcome {
|
|
643
|
+
served
|
|
644
|
+
refused
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/// One package a run's profile has approved from a given ecosystem, resolved
|
|
648
|
+
/// once at dispatch (see CodingRun.packageAllowlist) and used to gate every
|
|
649
|
+
/// proxy fetch for the run's lifetime.
|
|
650
|
+
model RegistryAllowance {
|
|
651
|
+
runId String
|
|
652
|
+
ecosystem String
|
|
653
|
+
name String
|
|
654
|
+
createdAt DateTime @default(now())
|
|
655
|
+
run CodingRun @relation(fields: [runId], references: [runId], onDelete: Cascade)
|
|
656
|
+
|
|
657
|
+
@@id([runId, ecosystem, name])
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/// Audit ledger of every package fetch the registry proxy served or refused
|
|
661
|
+
/// for a run.
|
|
662
|
+
model RegistryFetch {
|
|
663
|
+
id String @id @default(cuid())
|
|
664
|
+
runId String
|
|
665
|
+
ecosystem String
|
|
666
|
+
name String
|
|
667
|
+
version String?
|
|
668
|
+
filename String?
|
|
669
|
+
integrity String?
|
|
670
|
+
sizeBytes Int?
|
|
671
|
+
outcome RegistryFetchOutcome
|
|
672
|
+
reason String?
|
|
673
|
+
createdAt DateTime @default(now())
|
|
674
|
+
run CodingRun @relation(fields: [runId], references: [runId], onDelete: Cascade)
|
|
675
|
+
|
|
676
|
+
@@index([runId, createdAt])
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/// Immutable facts about one published package version, read from the
|
|
680
|
+
/// registry itself (never from a lockfile) by lockfile verification: its
|
|
681
|
+
/// publish time, integrity, download URL and declared dependencies
|
|
682
|
+
/// ([{ key, name, range }], aliases resolved). Stored once and reused
|
|
683
|
+
/// forever; allow/deny decisions are never cached here.
|
|
684
|
+
model RegistryVersionFact {
|
|
685
|
+
ecosystem String
|
|
686
|
+
name String
|
|
687
|
+
version String
|
|
688
|
+
publishedAt DateTime
|
|
689
|
+
integrity String
|
|
690
|
+
downloadUrl String
|
|
691
|
+
dependencies Json
|
|
692
|
+
createdAt DateTime @default(now())
|
|
693
|
+
|
|
694
|
+
@@id([ecosystem, name, version])
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/// One exact package version a run's lockfile plan (POST
|
|
698
|
+
/// /registry/<ecosystem>/-/plan) verified and approved: a download of it is
|
|
699
|
+
/// served directly, integrity-checked against this value.
|
|
700
|
+
model RegistryApprovedVersion {
|
|
701
|
+
runId String
|
|
702
|
+
ecosystem String
|
|
703
|
+
name String
|
|
704
|
+
version String
|
|
705
|
+
integrity String
|
|
706
|
+
createdAt DateTime @default(now())
|
|
707
|
+
run CodingRun @relation(fields: [runId], references: [runId], onDelete: Cascade)
|
|
708
|
+
|
|
709
|
+
@@id([runId, ecosystem, name, version])
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/// One exact package version a run's lockfile plan refused for a reason
|
|
713
|
+
/// intrinsic to the registry's name@version (too new, an advisory, not
|
|
714
|
+
/// published, no integrity, hosted elsewhere): a download of it is answered
|
|
715
|
+
/// from here with the same code and reason, without a graph walk.
|
|
716
|
+
model RegistryPlanRefusal {
|
|
717
|
+
runId String
|
|
718
|
+
ecosystem String
|
|
719
|
+
name String
|
|
720
|
+
version String
|
|
721
|
+
code String
|
|
722
|
+
reason String
|
|
723
|
+
/// Set for a too-new refusal: the answer re-checks the version's age
|
|
724
|
+
/// against the run's cutoff at answer time, so the refusal lapses.
|
|
725
|
+
publishedAt DateTime?
|
|
726
|
+
createdAt DateTime @default(now())
|
|
727
|
+
run CodingRun @relation(fields: [runId], references: [runId], onDelete: Cascade)
|
|
728
|
+
|
|
729
|
+
@@id([runId, ecosystem, name, version])
|
|
730
|
+
}
|
|
731
|
+
|
|
461
732
|
/// Phase 2: single-row-per-scope lease so exactly one scheduler process
|
|
462
733
|
/// ticks at a time. `holder` is a process instance id (crypto.randomUUID()).
|
|
463
734
|
model SchedulerLease {
|
|
@@ -481,6 +752,46 @@ model Principal {
|
|
|
481
752
|
webhooks Webhook[]
|
|
482
753
|
authUser AuthUser?
|
|
483
754
|
budgetGroups BudgetGroup[]
|
|
755
|
+
|
|
756
|
+
hostIdentities HostIdentity[]
|
|
757
|
+
hostIdentityLinkRequests HostIdentityLinkRequest[]
|
|
758
|
+
grants ResourceGrant[]
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
/// Explicit sharing of one resource with one grantee (docs/private/
|
|
762
|
+
/// 2026-09-26-resource-sharing-grants-spec-and-plan.md). Polymorphic on
|
|
763
|
+
/// (resourceType, resourceId) -- no FK to the resource, so every resource
|
|
764
|
+
/// delete path removes its grants in the same transaction. Levels are
|
|
765
|
+
/// ordered per type and validated in code (core/grants.ts), like
|
|
766
|
+
/// AgentRepository.provider, so a new type or level needs no enum migration.
|
|
767
|
+
model ResourceGrant {
|
|
768
|
+
id String @id @default(cuid())
|
|
769
|
+
/// "agent" | "tool" | "budget_group" (later "secret" | "datastore").
|
|
770
|
+
resourceType String
|
|
771
|
+
resourceId String
|
|
772
|
+
/// "principal" | "everyone" (later "group").
|
|
773
|
+
granteeKind String
|
|
774
|
+
granteePrincipalId String?
|
|
775
|
+
granteePrincipal Principal? @relation(fields: [granteePrincipalId], references: [id], onDelete: Cascade)
|
|
776
|
+
/// Normalised grantee identity for uniqueness: "principal:<id>", "everyone"
|
|
777
|
+
/// (later "group:<id>"). Needed because NULL granteePrincipalId values are
|
|
778
|
+
/// distinct in a unique index. Shape enforced by a hand-written CHECK
|
|
779
|
+
/// (ResourceGrant_grantee_shape, not representable here).
|
|
780
|
+
granteeKey String
|
|
781
|
+
/// Per-type ordered level (core/grants.ts LEVELS).
|
|
782
|
+
level String
|
|
783
|
+
/// "owner" (grant_access), "migration_public", "implied_attachment",
|
|
784
|
+
/// "import", "operator". Audit only.
|
|
785
|
+
source String @default("owner")
|
|
786
|
+
/// Principal who created/last changed it. Audit only: plain text, no FK
|
|
787
|
+
/// (same convention as AgentRepository.authorizedById).
|
|
788
|
+
grantedById String?
|
|
789
|
+
createdAt DateTime @default(now())
|
|
790
|
+
updatedAt DateTime @updatedAt
|
|
791
|
+
|
|
792
|
+
@@unique([resourceType, resourceId, granteeKey])
|
|
793
|
+
@@index([granteeKey, resourceType])
|
|
794
|
+
@@index([granteePrincipalId])
|
|
484
795
|
}
|
|
485
796
|
|
|
486
797
|
/// Phase 4: durable handle backing both a triggered run and (reserved,
|
|
@@ -619,6 +930,11 @@ model AuthUser {
|
|
|
619
930
|
principal Principal @relation(fields: [principalId], references: [id])
|
|
620
931
|
displayName String?
|
|
621
932
|
status String @default("enabled")
|
|
933
|
+
/// wardby roles (src/mcp/auth/resource-server.ts ROLE_PERMISSIONS: admin,
|
|
934
|
+
/// package-approver, service-manager, model-manager), set with `wardby auth user grant`. Empty = member.
|
|
935
|
+
/// A privileged operation needs its scope on the token AND a role here
|
|
936
|
+
/// that grants it; unknown values grant nothing.
|
|
937
|
+
roles String[] @default([])
|
|
622
938
|
createdAt DateTime @default(now())
|
|
623
939
|
updatedAt DateTime @updatedAt
|
|
624
940
|
loginKeys AuthLoginKey[]
|
|
@@ -729,3 +1045,329 @@ model AuthRateLimit {
|
|
|
729
1045
|
|
|
730
1046
|
@@index([expiresAt])
|
|
731
1047
|
}
|
|
1048
|
+
|
|
1049
|
+
/// Which repositories on which code-review host a native agent may act on,
|
|
1050
|
+
/// and which host events trigger it. See
|
|
1051
|
+
/// docs/private/2026-09-25-code-review-host-design.md §4.1.
|
|
1052
|
+
model AgentRepository {
|
|
1053
|
+
id String @id @default(cuid())
|
|
1054
|
+
agentId String
|
|
1055
|
+
agent Agent @relation(fields: [agentId], references: [id], onDelete: Cascade)
|
|
1056
|
+
/// "github" today; validated in code so adding a host needs no enum migration.
|
|
1057
|
+
provider String
|
|
1058
|
+
/// Canonical lower-case owner/name for the provider.
|
|
1059
|
+
repository String
|
|
1060
|
+
/// "read" or "write".
|
|
1061
|
+
access String
|
|
1062
|
+
/// Subset of "pull_request", "mention", "push".
|
|
1063
|
+
triggers String[] @default([])
|
|
1064
|
+
/// Only with the "pull_request" trigger (required there); names the agent's
|
|
1065
|
+
/// check. Unique per repository across all links (NULLs are distinct).
|
|
1066
|
+
checkName String?
|
|
1067
|
+
createdAt DateTime @default(now())
|
|
1068
|
+
|
|
1069
|
+
/// How this link was authorized: "host_permission" (the agent owner's
|
|
1070
|
+
/// verified host identity had enough access), "admin" (a wardby admin
|
|
1071
|
+
/// approved it explicitly), or "grandfathered" (existed before
|
|
1072
|
+
/// authorization was enforced). Null = never authorized; use is refused.
|
|
1073
|
+
authorizedVia String?
|
|
1074
|
+
/// The principal who authorized it. Audit only: plain text, no FK.
|
|
1075
|
+
authorizedById String?
|
|
1076
|
+
authorizedAt DateTime?
|
|
1077
|
+
|
|
1078
|
+
@@unique([agentId, provider, repository])
|
|
1079
|
+
@@unique([provider, repository, checkName])
|
|
1080
|
+
@@index([provider, repository])
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/// The host check a run owns, so the review tool can complete it and the
|
|
1084
|
+
/// run finalizer can close it if the run ends without publishing.
|
|
1085
|
+
model RunHostCheck {
|
|
1086
|
+
runId String @id
|
|
1087
|
+
run Run @relation(fields: [runId], references: [id], onDelete: Cascade)
|
|
1088
|
+
provider String
|
|
1089
|
+
repository String
|
|
1090
|
+
checkId String
|
|
1091
|
+
headSha String
|
|
1092
|
+
/// The pull request the run was dispatched for. The review tool only
|
|
1093
|
+
/// completes or creates a check for this PR. Null on rows written before it
|
|
1094
|
+
/// existed: such a run publishes without a check.
|
|
1095
|
+
prNumber Int?
|
|
1096
|
+
completedAt DateTime?
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
/// De-duplicates host webhook redeliveries; pruned after 7 days.
|
|
1100
|
+
/// The status comment wardby posts on the issue or pull request whose
|
|
1101
|
+
/// @-mention started this run ("working on it"), edited with the outcome
|
|
1102
|
+
/// when the run ends. One per mention run.
|
|
1103
|
+
model RunHostStatus {
|
|
1104
|
+
runId String @id
|
|
1105
|
+
run Run @relation(fields: [runId], references: [id], onDelete: Cascade)
|
|
1106
|
+
provider String
|
|
1107
|
+
repository String
|
|
1108
|
+
/// The issue or pull request number the comment is on.
|
|
1109
|
+
number Int
|
|
1110
|
+
/// "conversation" (issue/PR comment) or "inline" (a reply in a review thread).
|
|
1111
|
+
commentKind String
|
|
1112
|
+
/// Null until the "working on it" comment is posted. The row is written
|
|
1113
|
+
/// with the run, so a run that dies before the comment exists still gets
|
|
1114
|
+
/// an outcome comment (from the reconciler).
|
|
1115
|
+
commentId String?
|
|
1116
|
+
/// For an inline mention: the review comment to reply to when the outcome
|
|
1117
|
+
/// has to be posted as a new comment.
|
|
1118
|
+
replyToReviewCommentId String?
|
|
1119
|
+
createdAt DateTime @default(now())
|
|
1120
|
+
completedAt DateTime?
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
model HostEventDelivery {
|
|
1124
|
+
provider String
|
|
1125
|
+
deliveryId String
|
|
1126
|
+
receivedAt DateTime @default(now())
|
|
1127
|
+
|
|
1128
|
+
@@id([provider, deliveryId])
|
|
1129
|
+
@@index([receivedAt])
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
/// A principal's verified identity on a code-review host (GitHub today),
|
|
1133
|
+
/// linked through the host's user-authorization flow (link_host_account).
|
|
1134
|
+
/// Only the numeric user id and login are stored, never a user token. A host
|
|
1135
|
+
/// user belongs to at most one principal.
|
|
1136
|
+
model HostIdentity {
|
|
1137
|
+
principalId String
|
|
1138
|
+
principal Principal @relation(fields: [principalId], references: [id], onDelete: Cascade)
|
|
1139
|
+
/// "github" today; validated in code.
|
|
1140
|
+
provider String
|
|
1141
|
+
/// The host's numeric user id, as text.
|
|
1142
|
+
hostUserId String
|
|
1143
|
+
/// Last known login; refreshed when the host reports a rename.
|
|
1144
|
+
login String
|
|
1145
|
+
linkedAt DateTime @default(now())
|
|
1146
|
+
updatedAt DateTime @updatedAt
|
|
1147
|
+
|
|
1148
|
+
@@id([principalId, provider])
|
|
1149
|
+
@@unique([provider, hostUserId])
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/// An in-flight host identity link (link_host_account): the OAuth state and
|
|
1153
|
+
/// PKCE verifier, then, after the host's callback, the verified user and the
|
|
1154
|
+
/// hash of the one-time confirmation code the same principal must submit.
|
|
1155
|
+
/// Lives 10 minutes.
|
|
1156
|
+
model HostIdentityLinkRequest {
|
|
1157
|
+
id String @id @default(cuid())
|
|
1158
|
+
principalId String
|
|
1159
|
+
principal Principal @relation(fields: [principalId], references: [id], onDelete: Cascade)
|
|
1160
|
+
provider String
|
|
1161
|
+
/// sha256 of the OAuth state; the state itself is never stored.
|
|
1162
|
+
stateHash String @unique
|
|
1163
|
+
/// PKCE verifier: useless without the authorization code and the client secret.
|
|
1164
|
+
codeVerifier String
|
|
1165
|
+
hostUserId String?
|
|
1166
|
+
login String?
|
|
1167
|
+
/// sha256 of the confirmation code shown on the callback page.
|
|
1168
|
+
confirmHash String?
|
|
1169
|
+
/// Wrong confirmation codes submitted; the request is dead at 5.
|
|
1170
|
+
attempts Int @default(0)
|
|
1171
|
+
callbackAt DateTime?
|
|
1172
|
+
expiresAt DateTime
|
|
1173
|
+
createdAt DateTime @default(now())
|
|
1174
|
+
|
|
1175
|
+
@@index([principalId])
|
|
1176
|
+
@@index([expiresAt])
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
/// Which issue-tracker projects (Jira today) a native agent may act on, and
|
|
1180
|
+
/// which issue events trigger it. Admin-approved in phase 1 (no way to verify
|
|
1181
|
+
/// an owner's Jira access). See
|
|
1182
|
+
/// docs/private/2026-09-30-jira-issue-tracker-design.md §3.
|
|
1183
|
+
model AgentIssueProject {
|
|
1184
|
+
id String @id @default(cuid())
|
|
1185
|
+
agentId String
|
|
1186
|
+
agent Agent @relation(fields: [agentId], references: [id], onDelete: Cascade)
|
|
1187
|
+
/// "jira" today; validated in code.
|
|
1188
|
+
provider String
|
|
1189
|
+
/// Upper-case Jira project key.
|
|
1190
|
+
projectKey String
|
|
1191
|
+
/// "read" or "write".
|
|
1192
|
+
access String
|
|
1193
|
+
/// Subset of "created", "transitioned", "labeled", "assigned", "mention".
|
|
1194
|
+
triggers String[] @default([])
|
|
1195
|
+
/// With "transitioned": the status names (case-insensitive) that trigger.
|
|
1196
|
+
triggerStatuses String[] @default([])
|
|
1197
|
+
/// With "labeled": the labels whose addition triggers.
|
|
1198
|
+
triggerLabels String[] @default([])
|
|
1199
|
+
/// Optional JQL the issue must also match for any trigger.
|
|
1200
|
+
jqlFilter String?
|
|
1201
|
+
/// Jira accountIds whose @-mention or assignment may trigger (required for those triggers).
|
|
1202
|
+
trustedAccountIds String[] @default([])
|
|
1203
|
+
/// Optional project role that the agent's comments are restricted to.
|
|
1204
|
+
commentVisibilityRole String?
|
|
1205
|
+
/// Target status names (case-insensitive) jira_transition may move issues to. Empty = no transitions.
|
|
1206
|
+
allowedTransitions String[] @default([])
|
|
1207
|
+
/// Field ids jira_update_fields may change ("labels", "components", "priority", "customfield_NNNNN"). Empty = none.
|
|
1208
|
+
writableFields String[] @default([])
|
|
1209
|
+
/// Issue link type names (case-insensitive) jira_link_issues may create. Empty = linking off.
|
|
1210
|
+
allowedLinkTypes String[] @default([])
|
|
1211
|
+
/// Status to move the issue to when a pull request for it opens (a control-plane move, not gated by allowedTransitions). Null = none.
|
|
1212
|
+
onPullRequestOpened String?
|
|
1213
|
+
/// Status to move the issue to when a pull request for it merges. Null = none.
|
|
1214
|
+
onPullRequestMerged String?
|
|
1215
|
+
/// Issue type names (case-insensitive) jira_create_issue may create. Empty = creation off.
|
|
1216
|
+
creatableIssueTypes String[] @default([])
|
|
1217
|
+
/// Cap on issues one run may create in this project. Null = no cap.
|
|
1218
|
+
maxNewIssuesPerRun Int?
|
|
1219
|
+
authorizedById String
|
|
1220
|
+
authorizedAt DateTime @default(now())
|
|
1221
|
+
createdAt DateTime @default(now())
|
|
1222
|
+
|
|
1223
|
+
@@unique([agentId, provider, projectKey])
|
|
1224
|
+
@@index([provider, projectKey])
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
/// Dedupe record: an issue wardby created for a fingerprint (several over time — regressions).
|
|
1228
|
+
model IssueFingerprint {
|
|
1229
|
+
id String @id @default(cuid())
|
|
1230
|
+
issueProvider String
|
|
1231
|
+
projectKey String
|
|
1232
|
+
/// sha256 hex of the agent- or control-plane-supplied fingerprint (raw value never stored).
|
|
1233
|
+
fingerprintHash String
|
|
1234
|
+
issueKey String
|
|
1235
|
+
agentId String
|
|
1236
|
+
createdByRunId String?
|
|
1237
|
+
seenCount Int @default(1)
|
|
1238
|
+
firstSeenAt DateTime @default(now())
|
|
1239
|
+
lastSeenAt DateTime @default(now())
|
|
1240
|
+
|
|
1241
|
+
@@unique([issueProvider, issueKey])
|
|
1242
|
+
@@index([issueProvider, projectKey, fingerprintHash])
|
|
1243
|
+
@@index([createdByRunId])
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
/// A pull request wardby opened for a tracker issue (the Jira -> code bridge). Provider-neutral on both sides.
|
|
1247
|
+
/// Deliberately no foreign keys to Agent or Run: audit-style rows that survive agent/run deletion.
|
|
1248
|
+
model IssuePullRequest {
|
|
1249
|
+
id String @id @default(cuid())
|
|
1250
|
+
/// "jira"
|
|
1251
|
+
issueProvider String
|
|
1252
|
+
issueKey String
|
|
1253
|
+
/// "github" today; "bitbucket" next.
|
|
1254
|
+
codeProvider String
|
|
1255
|
+
repository String
|
|
1256
|
+
number Int
|
|
1257
|
+
url String
|
|
1258
|
+
/// The issue-linked agent whose run tree opened it (the parent native agent).
|
|
1259
|
+
agentId String
|
|
1260
|
+
/// The coding run that opened it (continuePriorRun target for follow-ups).
|
|
1261
|
+
openedByRunId String
|
|
1262
|
+
/// "open" | "merged" | "closed"
|
|
1263
|
+
state String @default("open")
|
|
1264
|
+
createdAt DateTime @default(now())
|
|
1265
|
+
updatedAt DateTime @updatedAt
|
|
1266
|
+
|
|
1267
|
+
@@unique([codeProvider, repository, number, issueProvider, issueKey])
|
|
1268
|
+
@@index([issueProvider, issueKey])
|
|
1269
|
+
/// The admin viewer's outcome lookup by run.
|
|
1270
|
+
@@index([openedByRunId])
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
/// The status comment wardby posts on the Jira issue whose event started this
|
|
1274
|
+
/// run ("working on it"), edited with the outcome when the run ends.
|
|
1275
|
+
model RunIssueStatus {
|
|
1276
|
+
runId String @id
|
|
1277
|
+
run Run @relation(fields: [runId], references: [id], onDelete: Cascade)
|
|
1278
|
+
provider String
|
|
1279
|
+
issueKey String
|
|
1280
|
+
/// Null until the "working on it" comment is posted.
|
|
1281
|
+
commentId String?
|
|
1282
|
+
visibilityRole String?
|
|
1283
|
+
createdAt DateTime @default(now())
|
|
1284
|
+
completedAt DateTime?
|
|
1285
|
+
|
|
1286
|
+
@@index([completedAt])
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
/// Latest known state of an issue/epic in an external tracker (Jira, later
|
|
1290
|
+
/// Linear). Shared by every run attributed to it; titles are refreshed by the
|
|
1291
|
+
/// next snapshot, so reports always show current names.
|
|
1292
|
+
model WorkItem {
|
|
1293
|
+
id String @id @default(cuid())
|
|
1294
|
+
/// "jira" | "linear" | ...
|
|
1295
|
+
provider String
|
|
1296
|
+
/// PAY-241, ENG-123
|
|
1297
|
+
key String
|
|
1298
|
+
title String?
|
|
1299
|
+
type String?
|
|
1300
|
+
url String?
|
|
1301
|
+
/// Jira project / Linear team.
|
|
1302
|
+
scopeKey String
|
|
1303
|
+
/// The current parent (epic or parent issue), refreshed on each snapshot.
|
|
1304
|
+
parentKey String?
|
|
1305
|
+
/// "epic" | "parent" | ...
|
|
1306
|
+
parentKind String?
|
|
1307
|
+
/// Last successful snapshot; null = key-only (never snapshotted).
|
|
1308
|
+
refreshedAt DateTime?
|
|
1309
|
+
createdAt DateTime @default(now())
|
|
1310
|
+
updatedAt DateTime @updatedAt
|
|
1311
|
+
attributions RunAttribution[]
|
|
1312
|
+
|
|
1313
|
+
@@unique([provider, key])
|
|
1314
|
+
@@index([provider, parentKey])
|
|
1315
|
+
@@index([provider, scopeKey])
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
/// Which work item a run's cost belongs to, with its parent frozen as of
|
|
1319
|
+
/// dispatch. Written in dispatchRun's persist transaction; child runs copy
|
|
1320
|
+
/// their parent's row (source "inherited"). Control-plane data only.
|
|
1321
|
+
model RunAttribution {
|
|
1322
|
+
runId String @id
|
|
1323
|
+
run Run @relation(fields: [runId], references: [id], onDelete: Cascade)
|
|
1324
|
+
workItemId String
|
|
1325
|
+
workItem WorkItem @relation(fields: [workItemId], references: [id])
|
|
1326
|
+
parentKeyAtRun String?
|
|
1327
|
+
/// issue_event | linked_pr | explicit | inherited
|
|
1328
|
+
source String
|
|
1329
|
+
createdAt DateTime @default(now())
|
|
1330
|
+
|
|
1331
|
+
@@index([workItemId])
|
|
1332
|
+
@@index([parentKeyAtRun])
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
/// Per-run, per-model usage by priced token kind. Sum of costUsd over a
|
|
1336
|
+
/// run's rows equals Run.costUsd (to Run.costUsd's 6 decimal places).
|
|
1337
|
+
model RunModelUsage {
|
|
1338
|
+
runId String
|
|
1339
|
+
run Run @relation(fields: [runId], references: [id], onDelete: Cascade)
|
|
1340
|
+
model String
|
|
1341
|
+
/// Input tokens NOT served from cache (LlmUsage.inputTokens - cachedInputTokens).
|
|
1342
|
+
freshInputTokens Int @default(0)
|
|
1343
|
+
cachedInputTokens Int @default(0)
|
|
1344
|
+
cacheWriteTokens Int @default(0)
|
|
1345
|
+
outputTokens Int @default(0)
|
|
1346
|
+
costUsd Decimal @default(0) @db.Decimal(18, 10)
|
|
1347
|
+
|
|
1348
|
+
@@id([runId, model])
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
/// A deployment's override of the shipped model catalog
|
|
1352
|
+
/// (src/providers/llm/catalog-shipped.ts), written by set_model /
|
|
1353
|
+
/// disable_model (models:admin). A row fully replaces the shipped entry with
|
|
1354
|
+
/// the same key; enabled=false removes the model; a row with no shipped match
|
|
1355
|
+
/// adds one. Rates are the provider's exact published numbers (sourceUrl).
|
|
1356
|
+
model ModelCatalogEntry {
|
|
1357
|
+
provider String
|
|
1358
|
+
modelId String
|
|
1359
|
+
enabled Boolean
|
|
1360
|
+
encoding String
|
|
1361
|
+
inputPerMTok Float
|
|
1362
|
+
outputPerMTok Float
|
|
1363
|
+
cachedInputPerMTok Float
|
|
1364
|
+
cacheWritePerMTok Float
|
|
1365
|
+
efforts String[]
|
|
1366
|
+
thinkingMode String
|
|
1367
|
+
sourceUrl String
|
|
1368
|
+
updatedBy String
|
|
1369
|
+
createdAt DateTime @default(now())
|
|
1370
|
+
updatedAt DateTime @updatedAt
|
|
1371
|
+
|
|
1372
|
+
@@id([provider, modelId])
|
|
1373
|
+
}
|