@wardby/cli 0.4.0 → 0.5.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 +8 -1
- package/README.md +3 -1
- package/deploy/local/docker-compose.quickstart-coding.yml +27 -0
- package/dist/claude-coding-worker/driver.d.ts +2 -0
- package/dist/claude-coding-worker/driver.js +19 -3
- package/dist/claude-coding-worker/sdk.js +1 -1
- package/dist/cli.js +41 -22
- package/dist/coding/continuation-wording.d.ts +10 -0
- package/dist/coding/continuation-wording.js +13 -0
- package/dist/coding/docker-preflight.d.ts +12 -0
- package/dist/coding/docker-preflight.js +40 -0
- package/dist/coding/local-git.d.ts +22 -0
- package/dist/coding/local-git.js +102 -0
- package/dist/coding/local-repo-status.d.ts +7 -0
- package/dist/coding/local-repo-status.js +56 -0
- package/dist/coding/local-repo.d.ts +17 -0
- package/dist/coding/local-repo.js +65 -0
- package/dist/coding/observability.d.ts +1 -1
- package/dist/coding/observability.js +1 -0
- package/dist/coding/profile.d.ts +6 -0
- package/dist/coding/profile.js +13 -4
- package/dist/coding/protocol.d.ts +32 -7
- package/dist/coding/protocol.js +66 -4
- package/dist/coding-worker/artifact.d.ts +1 -0
- package/dist/coding-worker/errors.js +2 -0
- package/dist/config/providers.d.ts +13 -0
- package/dist/config/providers.js +21 -9
- package/dist/core/attribution.d.ts +13 -0
- package/dist/core/attribution.js +30 -0
- package/dist/core/budget-groups.d.ts +3 -1
- package/dist/core/budget-groups.js +53 -5
- package/dist/core/ci-context.d.ts +8 -0
- package/dist/core/ci-context.js +59 -0
- package/dist/core/delegation-siblings.d.ts +22 -0
- package/dist/core/delegation-siblings.js +40 -0
- package/dist/core/dispatch.d.ts +28 -4
- package/dist/core/dispatch.js +57 -15
- package/dist/core/engine-native.d.ts +16 -0
- package/dist/core/engine-native.js +49 -2
- package/dist/core/host-events.d.ts +25 -2
- package/dist/core/host-events.js +361 -19
- package/dist/core/host-status.d.ts +8 -3
- package/dist/core/host-status.js +38 -7
- package/dist/core/issue-events.d.ts +2 -6
- package/dist/core/issue-events.js +13 -19
- package/dist/core/pull-request-state-sync.d.ts +17 -0
- package/dist/core/pull-request-state-sync.js +53 -0
- package/dist/core/reconciler.d.ts +10 -1
- package/dist/core/reconciler.js +15 -2
- package/dist/core/related-pull-requests.d.ts +95 -0
- package/dist/core/related-pull-requests.js +338 -0
- package/dist/core/repo-access.d.ts +5 -1
- package/dist/core/repo-access.js +17 -1
- package/dist/core/review-fix-ledger.d.ts +20 -0
- package/dist/core/review-fix-ledger.js +41 -0
- package/dist/core/review-fix.d.ts +60 -0
- package/dist/core/review-fix.js +155 -0
- package/dist/core/review-host-tools.d.ts +13 -2
- package/dist/core/review-host-tools.js +72 -11
- package/dist/core/runner.d.ts +2 -2
- package/dist/core/runner.js +379 -184
- package/dist/core/serial-gate.d.ts +11 -0
- package/dist/core/serial-gate.js +19 -0
- package/dist/core/timing.d.ts +7 -0
- package/dist/core/timing.js +7 -0
- package/dist/env.js +6 -1
- package/dist/generated/prisma/browser.d.ts +23 -0
- package/dist/generated/prisma/client.d.ts +23 -0
- package/dist/generated/prisma/commonInputTypes.d.ts +22 -0
- package/dist/generated/prisma/internal/class.d.ts +33 -0
- package/dist/generated/prisma/internal/class.js +4 -4
- package/dist/generated/prisma/internal/prismaNamespace.d.ts +274 -1
- package/dist/generated/prisma/internal/prismaNamespace.js +47 -2
- package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts +48 -0
- package/dist/generated/prisma/internal/prismaNamespaceBrowser.js +47 -2
- package/dist/generated/prisma/models/Agent.d.ts +422 -1
- package/dist/generated/prisma/models/AgentRepository.d.ts +120 -2
- package/dist/generated/prisma/models/CodingAgentProfile.d.ts +42 -1
- package/dist/generated/prisma/models/CodingRun.d.ts +205 -1
- package/dist/generated/prisma/models/DeferredReview.d.ts +1336 -0
- package/dist/generated/prisma/models/DeferredReview.js +1 -0
- package/dist/generated/prisma/models/LocalPullRequest.d.ts +1384 -0
- package/dist/generated/prisma/models/LocalPullRequest.js +1 -0
- package/dist/generated/prisma/models/LocalReview.d.ts +1315 -0
- package/dist/generated/prisma/models/LocalReview.js +1 -0
- package/dist/generated/prisma/models/Run.d.ts +223 -0
- package/dist/generated/prisma/models/RunHostCheck.d.ts +148 -1
- package/dist/generated/prisma/models.d.ts +3 -0
- package/dist/help-index.json +476 -37
- package/dist/import/neutral-schema.d.ts +2 -2
- package/dist/mcp/auth/access.d.ts +3 -1
- package/dist/mcp/auth/host-account-cli.js +2 -2
- package/dist/mcp/auth/repo-authorization.d.ts +6 -7
- package/dist/mcp/auth/repo-authorization.js +21 -0
- package/dist/mcp/index.js +4 -1
- package/dist/mcp/tools/agents.js +46 -4
- package/dist/mcp/tools/host-accounts.js +2 -2
- package/dist/mcp/tools/repositories.js +71 -12
- package/dist/mcp/tools/runs.js +23 -0
- package/dist/mcp/tools/trigger.js +153 -24
- package/dist/providers/engine/types.d.ts +11 -0
- package/dist/providers/executor/composition.js +12 -7
- package/dist/providers/executor/container.d.ts +40 -3
- package/dist/providers/executor/container.js +140 -9
- package/dist/providers/executor/types.d.ts +1 -1
- package/dist/providers/jobs/fake-kubernetes-api.d.ts +3 -2
- package/dist/providers/jobs/fake-kubernetes-api.js +3 -0
- package/dist/providers/jobs/kubernetes-api.d.ts +3 -1
- package/dist/providers/jobs/kubernetes-client.d.ts +2 -1
- package/dist/providers/jobs/kubernetes-client.js +3 -0
- package/dist/providers/jobs/kubernetes-isolation.d.ts +7 -0
- package/dist/providers/jobs/kubernetes-isolation.js +8 -3
- package/dist/providers/jobs/kubernetes-preflight.d.ts +8 -0
- package/dist/providers/jobs/kubernetes-preflight.js +7 -0
- package/dist/providers/jobs/kubernetes-quota.d.ts +31 -0
- package/dist/providers/jobs/kubernetes-quota.js +110 -0
- package/dist/providers/jobs/kubernetes.d.ts +9 -0
- package/dist/providers/jobs/kubernetes.js +50 -0
- package/dist/providers/jobs/types.d.ts +7 -0
- package/dist/providers/review-host/ci.d.ts +7 -0
- package/dist/providers/review-host/ci.js +20 -0
- package/dist/providers/review-host/github-events.d.ts +7 -0
- package/dist/providers/review-host/github-events.js +31 -7
- package/dist/providers/review-host/github.d.ts +19 -2
- package/dist/providers/review-host/github.js +145 -2
- package/dist/providers/review-host/index.d.ts +8 -2
- package/dist/providers/review-host/index.js +14 -3
- package/dist/providers/review-host/local.d.ts +72 -0
- package/dist/providers/review-host/local.js +434 -0
- package/dist/providers/review-host/types.d.ts +65 -3
- package/dist/providers/review-host/types.js +5 -3
- package/dist/providers/vcs/git.d.ts +10 -20
- package/dist/providers/vcs/git.js +71 -127
- package/dist/providers/vcs/github-remote.d.ts +67 -0
- package/dist/providers/vcs/github-remote.js +201 -0
- package/dist/providers/vcs/github.d.ts +81 -0
- package/dist/providers/vcs/github.js +203 -6
- package/dist/providers/vcs/index.d.ts +16 -1
- package/dist/providers/vcs/index.js +43 -15
- package/dist/providers/vcs/local-remote.d.ts +44 -0
- package/dist/providers/vcs/local-remote.js +108 -0
- package/dist/providers/vcs/remote.d.ts +58 -0
- package/dist/providers/vcs/remote.js +1 -0
- package/dist/providers/vcs/routing.d.ts +33 -0
- package/dist/providers/vcs/routing.js +52 -0
- package/dist/providers/vcs/types.d.ts +12 -1
- package/dist/quickstart/coding-db.d.ts +11 -0
- package/dist/quickstart/coding-db.js +75 -0
- package/dist/quickstart/coding-doctor.d.ts +13 -0
- package/dist/quickstart/coding-doctor.js +88 -0
- package/dist/quickstart/coding-images.d.ts +15 -0
- package/dist/quickstart/coding-images.js +79 -0
- package/dist/quickstart/coding-seed.d.ts +63 -0
- package/dist/quickstart/coding-seed.js +85 -0
- package/dist/quickstart/coding.d.ts +66 -0
- package/dist/quickstart/coding.js +430 -0
- package/dist/quickstart/images.d.ts +19 -0
- package/dist/quickstart/images.js +63 -0
- package/dist/quickstart/index.d.ts +6 -0
- package/dist/quickstart/index.js +72 -40
- package/dist/quickstart/starter-services.d.ts +45 -0
- package/dist/quickstart/starter-services.js +186 -0
- package/dist/quickstart-images.json +1 -0
- package/dist/serve.js +14 -1
- package/dist/viewer/api-schema.d.ts +176 -0
- package/dist/viewer/api-schema.js +27 -2
- package/dist/viewer/graph.d.ts +7 -2
- package/dist/viewer/graph.js +25 -11
- package/dist/viewer/http.d.ts +7 -1
- package/dist/viewer/http.js +8 -3
- package/dist/viewer/infra.d.ts +2 -0
- package/dist/viewer/infra.js +23 -0
- package/dist/viewer/run-detail.d.ts +2 -1
- package/dist/viewer/run-detail.js +2 -2
- package/docs/agent-recipes.md +123 -2
- package/docs/code-review-agents.md +293 -38
- package/docs/coding-agent-setup.md +141 -2
- package/docs/coding-packages.md +21 -0
- package/docs/coding-services.md +3 -0
- package/docs/coding-worker-isolation.md +87 -24
- package/docs/getting-started-gke.md +24 -0
- package/docs/getting-started.md +82 -8
- package/docs/jira-agents.md +26 -5
- package/docs/security-deployment.md +9 -0
- package/docs/viewer-api.md +21 -2
- package/help/admin-viewer.md +11 -1
- package/help/agent-recipes.md +25 -1
- package/help/builder-agent.md +4 -0
- package/help/code-review-agents.md +82 -2
- package/help/coding-packages.md +12 -1
- package/help/coding-services.md +4 -0
- package/help/cost-attribution.md +3 -1
- package/help/creating-agents.md +3 -0
- package/help/deploy-gke.md +2 -1
- package/help/errors/coding-provider-not-configured.md +60 -0
- package/help/errors/coding-turn-limit.md +25 -0
- package/help/errors/continuation-closed.md +75 -0
- package/help/errors/local-branch-conflict.md +37 -0
- package/help/errors/local-path-invalid.md +30 -0
- package/help/errors/local-ref-invalid.md +36 -0
- package/help/errors/local-ref-not-found.md +41 -0
- package/help/errors/local-repo-not-allowed.md +46 -0
- package/help/errors/local-repo-not-found.md +39 -0
- package/help/errors/model-unavailable.md +7 -6
- package/help/errors/vcs-github-not-configured.md +34 -0
- package/help/getting-started.md +4 -0
- package/help/github.md +22 -5
- package/help/jira.md +9 -2
- package/help/local-repositories.md +182 -0
- package/help/related-pull-requests.md +89 -0
- package/help/review-fix-rounds.md +69 -0
- package/help/troubleshooting/budgets.md +11 -0
- package/help/troubleshooting/coding-workers.md +22 -0
- package/help/troubleshooting/repository-access.md +5 -0
- package/package.json +5 -3
- package/prisma/migrations/20261004100000_delegations_and_coding_turns/migration.sql +12 -0
- package/prisma/migrations/20261005000000_review_fix_rounds/migration.sql +5 -0
- package/prisma/migrations/20261006000000_parallel_delegations/migration.sql +6 -0
- package/prisma/migrations/20261007000000_ci_rereview/migration.sql +4 -0
- package/prisma/migrations/20261008000000_review_after_ci/migration.sql +33 -0
- package/prisma/migrations/20261009000001_coding_run_local_branch/migration.sql +7 -0
- package/prisma/migrations/20261009000002_local_review/migration.sql +50 -0
- package/prisma/schema.prisma +98 -1
package/prisma/schema.prisma
CHANGED
|
@@ -41,6 +41,10 @@ model Agent {
|
|
|
41
41
|
// Phase 3: tools + multi-turn loop.
|
|
42
42
|
tools AgentTool[]
|
|
43
43
|
maxTurns Int @default(10)
|
|
44
|
+
/// Sub-agent delegations one run may make (delegate_to_*), each to a different sub-agent. 1 = route to exactly one.
|
|
45
|
+
maxDelegationsPerRun Int @default(1)
|
|
46
|
+
/// Native leads: the delegate_to_* calls of one model turn run at the same time. False = one after another.
|
|
47
|
+
parallelDelegations Boolean @default(false)
|
|
44
48
|
|
|
45
49
|
// Phase 4: ownership. Null = owner-less, a transition state only: access
|
|
46
50
|
// then comes from ResourceGrant rows alone (the migration gives everyone
|
|
@@ -52,6 +56,7 @@ model Agent {
|
|
|
52
56
|
datastores AgentDatastore[]
|
|
53
57
|
webhooks Webhook[]
|
|
54
58
|
repositories AgentRepository[]
|
|
59
|
+
deferredReviews DeferredReview[]
|
|
55
60
|
issueProjects AgentIssueProject[]
|
|
56
61
|
|
|
57
62
|
/// Self-defects opt-in: the Jira project and issue type wardby files the agent's own failures into. Both or neither.
|
|
@@ -350,6 +355,8 @@ model Run {
|
|
|
350
355
|
attribution RunAttribution?
|
|
351
356
|
modelUsage RunModelUsage[]
|
|
352
357
|
serviceStatuses CodingRunServiceStatus[]
|
|
358
|
+
/// A manual review of a local branch: this run is the review run dispatched for it.
|
|
359
|
+
localPullRequest LocalPullRequest?
|
|
353
360
|
|
|
354
361
|
/// Un-phased: sub-agent dispatch (see AgentSubAgent). Null for a
|
|
355
362
|
/// top-level run; set when this run was created by a parent run's
|
|
@@ -398,6 +405,8 @@ model CodingAgentProfile {
|
|
|
398
405
|
defaultTask String?
|
|
399
406
|
allowWebhookTaskOverride Boolean @default(false)
|
|
400
407
|
timeoutSec Int @default(1800)
|
|
408
|
+
/// Claude Code runs only: the most agent turns a run may take. Null = the worker default (200).
|
|
409
|
+
maxTurns Int?
|
|
401
410
|
/// Unused; dropped after rollout (see the package-registry plan, Task 14).
|
|
402
411
|
allowedEgress Json @default("[]")
|
|
403
412
|
protectedPaths Json
|
|
@@ -464,6 +473,8 @@ model CodingRun {
|
|
|
464
473
|
/// Fixed at dispatch from the profile's debugTraceUntil: the worker writes a
|
|
465
474
|
/// full stream trace to its own pod log (never to the database).
|
|
466
475
|
debugTrace Boolean @default(false)
|
|
476
|
+
/// Fixed at dispatch from the profile's maxTurns: the Claude Code worker's turn limit. Null = the worker default.
|
|
477
|
+
maxTurns Int?
|
|
467
478
|
/// Coding-run services resolved at dispatch from the base branch's
|
|
468
479
|
/// .wardby/services.yaml: one snapshot per service (the catalog entry minus
|
|
469
480
|
/// kind), fixed for the run's lifetime. Empty = none.
|
|
@@ -471,6 +482,10 @@ model CodingRun {
|
|
|
471
482
|
/// The originating tracker issue ("jira" + key), set by the control plane from the run tree, never from model output.
|
|
472
483
|
issueProvider String?
|
|
473
484
|
issueKey String?
|
|
485
|
+
/// The branch a run pushed to a local repository (no pull request exists); null otherwise.
|
|
486
|
+
resultBranch String?
|
|
487
|
+
/// The commit the run started from (the base ref's tip when the workspace was prepared).
|
|
488
|
+
baseSha String?
|
|
474
489
|
createdAt DateTime @default(now())
|
|
475
490
|
updatedAt DateTime @updatedAt
|
|
476
491
|
proxySession CodingProxySession?
|
|
@@ -1059,11 +1074,19 @@ model AgentRepository {
|
|
|
1059
1074
|
repository String
|
|
1060
1075
|
/// "read" or "write".
|
|
1061
1076
|
access String
|
|
1062
|
-
/// Subset of "pull_request", "mention", "push".
|
|
1077
|
+
/// Subset of "pull_request", "mention", "push", "review_fix".
|
|
1063
1078
|
triggers String[] @default([])
|
|
1064
1079
|
/// Only with the "pull_request" trigger (required there); names the agent's
|
|
1065
1080
|
/// check. Unique per repository across all links (NULLs are distinct).
|
|
1066
1081
|
checkName String?
|
|
1082
|
+
/// Only with the "review_fix" trigger: how many automatic fix rounds a
|
|
1083
|
+
/// pull request gets before wardby stops. Null = the default (2).
|
|
1084
|
+
reviewFixMaxRounds Int?
|
|
1085
|
+
/// Only with the "pull_request" trigger: holds this agent's review on a
|
|
1086
|
+
/// pushed head until that head's own CI finishes (see DeferredReview),
|
|
1087
|
+
/// instead of racing it. Default off: existing links review immediately,
|
|
1088
|
+
/// exactly as today.
|
|
1089
|
+
waitForCi Boolean @default(false)
|
|
1067
1090
|
createdAt DateTime @default(now())
|
|
1068
1091
|
|
|
1069
1092
|
/// How this link was authorized: "host_permission" (the agent owner's
|
|
@@ -1080,6 +1103,31 @@ model AgentRepository {
|
|
|
1080
1103
|
@@index([provider, repository])
|
|
1081
1104
|
}
|
|
1082
1105
|
|
|
1106
|
+
/// A pull-request review deferred because its head's CI was still pending
|
|
1107
|
+
/// (or had not reported) when the triggering push event arrived
|
|
1108
|
+
/// (AgentRepository.waitForCi). Started either when that head's CI finishes
|
|
1109
|
+
/// (the ci_completed host event) or by the reconciler's fallback sweep after
|
|
1110
|
+
/// DEFERRED_REVIEW_MAX_WAIT_MS. Idempotent per
|
|
1111
|
+
/// (provider, repository, prNumber, headSha, agentId): re-deferring the same
|
|
1112
|
+
/// head for the same agent is a no-op, not a duplicate row.
|
|
1113
|
+
model DeferredReview {
|
|
1114
|
+
id String @id @default(cuid())
|
|
1115
|
+
provider String
|
|
1116
|
+
repository String
|
|
1117
|
+
prNumber Int
|
|
1118
|
+
headSha String
|
|
1119
|
+
agentId String
|
|
1120
|
+
agent Agent @relation(fields: [agentId], references: [id], onDelete: Cascade)
|
|
1121
|
+
/// The agent's check name at defer time, so the delayed review starts
|
|
1122
|
+
/// against the same check even if the link's checkName changes later.
|
|
1123
|
+
checkName String
|
|
1124
|
+
createdAt DateTime @default(now())
|
|
1125
|
+
|
|
1126
|
+
@@unique([provider, repository, prNumber, headSha, agentId])
|
|
1127
|
+
@@index([provider, repository, headSha])
|
|
1128
|
+
@@index([createdAt])
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1083
1131
|
/// The host check a run owns, so the review tool can complete it and the
|
|
1084
1132
|
/// run finalizer can close it if the run ends without publishing.
|
|
1085
1133
|
model RunHostCheck {
|
|
@@ -1094,6 +1142,18 @@ model RunHostCheck {
|
|
|
1094
1142
|
/// existed: such a run publishes without a check.
|
|
1095
1143
|
prNumber Int?
|
|
1096
1144
|
completedAt DateTime?
|
|
1145
|
+
/// The verdict the run published on its own check ("APPROVE",
|
|
1146
|
+
/// "CHANGES_REQUESTED", "COMMENT"); null until then, or when the check was
|
|
1147
|
+
/// closed without one (superseded, or by the finalizer).
|
|
1148
|
+
verdict String?
|
|
1149
|
+
/// The published review's summary and body (capped), kept for an automatic
|
|
1150
|
+
/// fix round started when the run finishes.
|
|
1151
|
+
reviewBody String?
|
|
1152
|
+
/// The run published COMMENT while CI on its head was still running or had
|
|
1153
|
+
/// not reported yet. CI finishing on that head later re-runs the review.
|
|
1154
|
+
ciPendingAtReview Boolean?
|
|
1155
|
+
/// When CI finishing on this head re-ran the review: at most once per head.
|
|
1156
|
+
ciRereviewAt DateTime?
|
|
1097
1157
|
}
|
|
1098
1158
|
|
|
1099
1159
|
/// De-duplicates host webhook redeliveries; pruned after 7 days.
|
|
@@ -1371,3 +1431,40 @@ model ModelCatalogEntry {
|
|
|
1371
1431
|
|
|
1372
1432
|
@@id([provider, modelId])
|
|
1373
1433
|
}
|
|
1434
|
+
|
|
1435
|
+
/// A local "pull request": a branch compared against a base in a local:
|
|
1436
|
+
/// repository (git folder on the wardby host), keyed by a durable number so
|
|
1437
|
+
/// the repo_* review tools work against it like a GitHub pull request.
|
|
1438
|
+
model LocalPullRequest {
|
|
1439
|
+
id String @id @default(cuid())
|
|
1440
|
+
number Int @unique @default(autoincrement())
|
|
1441
|
+
/// "local:/abs/path"
|
|
1442
|
+
repository String
|
|
1443
|
+
branch String
|
|
1444
|
+
base String
|
|
1445
|
+
/// The review run dispatched for this pull request.
|
|
1446
|
+
runId String? @unique
|
|
1447
|
+
run Run? @relation(fields: [runId], references: [id], onDelete: SetNull)
|
|
1448
|
+
createdAt DateTime @default(now())
|
|
1449
|
+
reviews LocalReview[]
|
|
1450
|
+
|
|
1451
|
+
@@index([repository, branch])
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
/// A review (or a plain comment, verdict COMMENT) published on a LocalPullRequest.
|
|
1455
|
+
model LocalReview {
|
|
1456
|
+
id String @id @default(cuid())
|
|
1457
|
+
pullRequestId String
|
|
1458
|
+
pullRequest LocalPullRequest @relation(fields: [pullRequestId], references: [id], onDelete: Cascade)
|
|
1459
|
+
agentId String
|
|
1460
|
+
headSha String
|
|
1461
|
+
/// APPROVE | CHANGES_REQUESTED | COMMENT
|
|
1462
|
+
verdict String
|
|
1463
|
+
summary String
|
|
1464
|
+
body String
|
|
1465
|
+
/// [{path, line, side, severity, body}]
|
|
1466
|
+
comments Json
|
|
1467
|
+
createdAt DateTime @default(now())
|
|
1468
|
+
|
|
1469
|
+
@@index([pullRequestId, createdAt])
|
|
1470
|
+
}
|