opencode-swarm 7.132.2 → 7.134.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/README.md +4 -1
- package/dist/agents/agent-output-schema.d.ts +74 -0
- package/dist/agents/critic.d.ts +2 -1
- package/dist/agents/reviewer.d.ts +1 -1
- package/dist/background/completion-observer.d.ts +17 -5
- package/dist/background/pending-delegations.d.ts +315 -2
- package/dist/background/stage-b-gates.d.ts +2 -0
- package/dist/cli/{config-doctor-bp5spb79.js → config-doctor-t5r92674.js} +3 -3
- package/dist/cli/{core-wg3re04e.js → core-d6yd2jzv.js} +2 -2
- package/dist/cli/{curation-policy-7zp2m9gv.js → curation-policy-3smfn2a3.js} +7 -7
- package/dist/cli/{curator-drift-y1wm4atk.js → curator-drift-tsyyf4b4.js} +4 -4
- package/dist/cli/{curator-h067mrcc.js → curator-hva8f3nf.js} +31 -29
- package/dist/cli/{curator-llm-factory-605d08hf.js → curator-llm-factory-p3aqev12.js} +31 -29
- package/dist/cli/{dispatch-3mhgqj2x.js → dispatch-gxbeb2ps.js} +2 -2
- package/dist/cli/{evidence-summary-service-jfagmvrh.js → evidence-summary-service-mrzsjpg4.js} +12 -11
- package/dist/cli/{gate-evidence-cy2te3x8.js → gate-evidence-b5v1xvxp.js} +4 -4
- package/dist/cli/guardrail-explain-k8mcvk61.js +57 -0
- package/dist/cli/{guardrail-log-aa112fxv.js → guardrail-log-absma1rv.js} +5 -5
- package/dist/cli/{hive-promoter-nv0m5rzk.js → hive-promoter-jwd51gzk.js} +31 -29
- package/dist/cli/{index-g4mnf3p5.js → index-1j3682j8.js} +5 -5
- package/dist/cli/{index-6ccynjv3.js → index-2njes601.js} +8 -8
- package/dist/cli/{index-w9cb5zwh.js → index-2t1n9k7b.js} +4 -4
- package/dist/cli/{index-f6480ee6.js → index-3dtjhr26.js} +5259 -1759
- package/dist/cli/{index-2tn5h2zp.js → index-4p02dp92.js} +6 -6
- package/dist/cli/index-b4z7s917.js +80 -0
- package/dist/cli/{index-bvp2v7k1.js → index-b5ek2cge.js} +266 -19
- package/dist/cli/index-b8zgtz81.js +123 -0
- package/dist/cli/{index-3s9rfnqq.js → index-baawkm48.js} +12 -12
- package/dist/cli/{index-fgcmxjp7.js → index-c3e0ymrg.js} +1 -1
- package/dist/cli/{index-q27bajqb.js → index-cfkvc5q9.js} +3 -3
- package/dist/cli/{index-7mkpsw6g.js → index-dd7ttx8x.js} +1 -1
- package/dist/cli/{index-jgfcp9bh.js → index-dgxgvzab.js} +7 -7
- package/dist/cli/{index-8d3m0ge3.js → index-eedq2y40.js} +48 -34
- package/dist/cli/{index-630badhp.js → index-g87ty4wp.js} +149 -6
- package/dist/cli/{index-yvv1wt2h.js → index-hgh01f6h.js} +25 -3
- package/dist/cli/{index-9cf1yr67.js → index-j6ywarjp.js} +3 -3
- package/dist/cli/{index-mwkwyej1.js → index-jpkxjmfw.js} +5 -5
- package/dist/cli/{index-03zyn94g.js → index-k742ecbm.js} +178 -222
- package/dist/cli/{index-y5qp59rc.js → index-kapharv7.js} +10 -4
- package/dist/cli/{index-djwemsjn.js → index-m2s0gbzt.js} +2 -2
- package/dist/cli/{index-4ff0x4cg.js → index-p8hezdtz.js} +1 -1
- package/dist/cli/{index-k4tmx21m.js → index-rkyhv4p5.js} +2 -2
- package/dist/cli/{index-3x761jqv.js → index-wk1h5ec2.js} +1 -1
- package/dist/cli/{index-jj4earrh.js → index-xfejq1p9.js} +1 -1
- package/dist/cli/{index-rt5jgktq.js → index-y0kk3rtv.js} +2 -2
- package/dist/cli/index-y3v1404y.js +1625 -0
- package/dist/cli/index.js +35 -31
- package/dist/cli/{knowledge-escalator-j0nceas7.js → knowledge-escalator-mkdac2m7.js} +8 -8
- package/dist/cli/{knowledge-events-gpqc62jr.js → knowledge-events-jjc9qbe0.js} +6 -6
- package/dist/cli/{knowledge-link-4yd2z8ev.js → knowledge-link-nc4y2zkq.js} +5 -5
- package/dist/cli/{knowledge-store-ggxr3ww5.js → knowledge-store-9e0w1kxm.js} +6 -6
- package/dist/cli/{knowledge-validator-007smap6.js → knowledge-validator-h1nrn2pk.js} +9 -9
- package/dist/cli/pending-delegations-v9e40hfk.js +96 -0
- package/dist/cli/{pr-subscriptions-zqbmctwz.js → pr-subscriptions-ztq40hrt.js} +7 -7
- package/dist/cli/{scan-cursor-wz4bff7a.js → scan-cursor-mk3tq3sf.js} +7 -7
- package/dist/cli/{schema-023gwne7.js → schema-bjb0yzsq.js} +7 -3
- package/dist/cli/{scope-persistence-dm5bab50.js → scope-persistence-hz3zmmsv.js} +5 -5
- package/dist/cli/{skill-generator-rtsg1m7x.js → skill-generator-p1de0wkr.js} +10 -10
- package/dist/cli/worktree-collision-ownership-c4bdnjtx.js +221 -0
- package/dist/commands/command-dispatch.d.ts +7 -0
- package/dist/commands/index.d.ts +7 -0
- package/dist/commands/registry.d.ts +16 -0
- package/dist/commands/review.d.ts +21 -0
- package/dist/config/agent-names.d.ts +3 -3
- package/dist/config/evidence-schema.d.ts +47 -47
- package/dist/config/index.d.ts +2 -2
- package/dist/config/schema.d.ts +58 -6
- package/dist/consensus/contracts.d.ts +3 -3
- package/dist/evaluation/ephemeral-agent-dispatcher.d.ts +64 -0
- package/dist/evaluation/model-dispatcher.d.ts +11 -5
- package/dist/hooks/auto-review.d.ts +30 -65
- package/dist/hooks/delegation-gate/worktree-collision-ownership.d.ts +28 -0
- package/dist/hooks/delegation-gate/worktree-isolation.d.ts +63 -1
- package/dist/hooks/delegation-gate/worktree-merge-status.d.ts +14 -0
- package/dist/hooks/delegation-gate/worktree-ownership-tag.d.ts +19 -0
- package/dist/hooks/delegation-gate/worktree-provisioning-owner.d.ts +30 -0
- package/dist/hooks/delegation-gate.d.ts +15 -6
- package/dist/hooks/guardrails/tool-before.d.ts +8 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/init-orphan-recovery.d.ts +17 -0
- package/dist/hooks/review-receipt-collector.d.ts +53 -10
- package/dist/hooks/review-receipt-scope.d.ts +74 -0
- package/dist/hooks/review-receipt.d.ts +104 -10
- package/dist/hooks/reviewer-scope-file-fingerprint.d.ts +21 -0
- package/dist/hooks/reviewer-scope-lifecycle.d.ts +19 -0
- package/dist/hooks/task-result-classifier.d.ts +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +583 -524
- package/dist/memory/schema.d.ts +1 -1
- package/dist/review/contracts.d.ts +29 -0
- package/dist/review/diff-source.d.ts +134 -0
- package/dist/review/engine.d.ts +60 -0
- package/dist/review/evidence.d.ts +88 -0
- package/dist/review/finding-validator.d.ts +77 -0
- package/dist/review/phase-runner.d.ts +37 -0
- package/dist/review/runtime.d.ts +32 -0
- package/dist/scope/scope-binding.d.ts +9 -0
- package/dist/services/config-doctor.d.ts +12 -0
- package/dist/session/snapshot-writer.d.ts +2 -0
- package/dist/state.d.ts +222 -1
- package/dist/tools/dispatch-lanes.d.ts +3 -1
- package/dist/tools/epic-record-divergence.d.ts +5 -5
- package/dist/tools/lean-turbo-review.d.ts +4 -1
- package/dist/tools/lean-turbo-run-phase.d.ts +3 -1
- package/dist/tools/phase-complete/gates/final-review-gate.d.ts +18 -0
- package/dist/tools/phase-complete/gates/index.d.ts +1 -0
- package/dist/tools/phase-complete/gates/types.d.ts +10 -0
- package/dist/tools/phase-complete.d.ts +13 -1
- package/dist/tools/plugin-registration.d.ts +3 -1
- package/dist/tools/swarm-command.d.ts +4 -1
- package/dist/tools/tool-metadata.d.ts +22 -22
- package/dist/turbo/lean/integration.d.ts +18 -2
- package/dist/turbo/lean/reviewer.d.ts +19 -3
- package/dist/turbo/lean/runner.d.ts +1 -1
- package/dist/worktree/merge.d.ts +47 -1
- package/package.json +1 -1
- package/dist/cli/guardrail-explain-s7vzm6z7.js +0 -55
- package/dist/cli/index-y2pfmd0z.js +0 -259
- package/dist/cli/pending-delegations-37t4xecr.js +0 -34
- package/dist/cli/{index-9f71ye47.js → index-13xxjfhn.js} +3 -3
- package/dist/cli/{index-s80bsjkj.js → index-2ghkk9ve.js} +6 -6
- package/dist/cli/{index-76kvm9z5.js → index-5nybajn9.js} +3 -3
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
scanWorktreeProvisioningOwnersForRecovery
|
|
4
|
+
} from "./index-b4z7s917.js";
|
|
5
|
+
import {
|
|
6
|
+
scanWorktreeMergeFailuresForRecovery
|
|
7
|
+
} from "./index-b8zgtz81.js";
|
|
8
|
+
import {
|
|
9
|
+
scanDelegationFallbacksForRecovery,
|
|
10
|
+
scanDelegationsForRecovery
|
|
11
|
+
} from "./index-y3v1404y.js";
|
|
12
|
+
import"./index-2ghkk9ve.js";
|
|
13
|
+
import"./index-fsrp8wp3.js";
|
|
14
|
+
import"./index-5nybajn9.js";
|
|
15
|
+
import"./index-7g4c7s5r.js";
|
|
16
|
+
import"./index-q2rrv0cy.js";
|
|
17
|
+
import"./index-bpmtbmy9.js";
|
|
18
|
+
import"./index-z6xqpmqg.js";
|
|
19
|
+
import"./index-zjygnfay.js";
|
|
20
|
+
import {
|
|
21
|
+
bunSpawn
|
|
22
|
+
} from "./index-qe3v54nb.js";
|
|
23
|
+
import"./index-zgwm4ryv.js";
|
|
24
|
+
import"./index-a76rekgs.js";
|
|
25
|
+
|
|
26
|
+
// src/hooks/delegation-gate/worktree-collision-ownership.ts
|
|
27
|
+
import * as path2 from "path";
|
|
28
|
+
|
|
29
|
+
// src/hooks/delegation-gate/worktree-ownership-tag.ts
|
|
30
|
+
import * as fs from "fs";
|
|
31
|
+
import * as path from "path";
|
|
32
|
+
var OWNERSHIP_TAG_SCAN_TIMEOUT_MS = 2000;
|
|
33
|
+
var MAX_OWNERSHIP_TAGS = 512;
|
|
34
|
+
function decodeTagPart(value) {
|
|
35
|
+
if (!value || !/^[A-Za-z0-9_-]+$/.test(value))
|
|
36
|
+
return null;
|
|
37
|
+
const decoded = Buffer.from(value, "base64url").toString("utf8");
|
|
38
|
+
return decoded && Buffer.from(decoded, "utf8").toString("base64url") === value ? decoded : null;
|
|
39
|
+
}
|
|
40
|
+
async function scanBackgroundWorktreeOwnershipTagsForRecovery(directory) {
|
|
41
|
+
try {
|
|
42
|
+
fs.statSync(path.join(directory, ".git"));
|
|
43
|
+
} catch (error) {
|
|
44
|
+
if (error.code === "ENOENT") {
|
|
45
|
+
return { status: "ok", owners: [] };
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
status: "uncertain",
|
|
49
|
+
reason: `Git metadata could not be inspected: ${error instanceof Error ? error.message : String(error)}`
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const proc = bunSpawn([
|
|
53
|
+
"git",
|
|
54
|
+
"-C",
|
|
55
|
+
directory,
|
|
56
|
+
"for-each-ref",
|
|
57
|
+
`--count=${MAX_OWNERSHIP_TAGS + 1}`,
|
|
58
|
+
"--format=%(refname:strip=2)%00%(objectname)",
|
|
59
|
+
"refs/tags/swarm-preserved-owner/"
|
|
60
|
+
], {
|
|
61
|
+
stdin: "ignore",
|
|
62
|
+
stdout: "pipe",
|
|
63
|
+
stderr: "ignore",
|
|
64
|
+
timeout: OWNERSHIP_TAG_SCAN_TIMEOUT_MS
|
|
65
|
+
});
|
|
66
|
+
try {
|
|
67
|
+
const exitCode = await proc.exited;
|
|
68
|
+
if (exitCode !== 0) {
|
|
69
|
+
return {
|
|
70
|
+
status: "uncertain",
|
|
71
|
+
reason: `ownership tag scan exited ${exitCode}`
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const lines = (await proc.stdout.text()).split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
75
|
+
if (lines.length > MAX_OWNERSHIP_TAGS) {
|
|
76
|
+
return {
|
|
77
|
+
status: "uncertain",
|
|
78
|
+
reason: `ownership tag scan exceeded the ${MAX_OWNERSHIP_TAGS}-tag safety bound`
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
const owners = [];
|
|
82
|
+
for (const line of lines) {
|
|
83
|
+
const [tag, ref, ...extra] = line.split("\x00");
|
|
84
|
+
const segments = tag?.split("/") ?? [];
|
|
85
|
+
const sessionId = decodeTagPart(segments[1] ?? "");
|
|
86
|
+
const laneId = decodeTagPart(segments[2] ?? "");
|
|
87
|
+
const callDigest = segments[3];
|
|
88
|
+
if (extra.length > 0 || segments.length !== 4 || segments[0] !== "swarm-preserved-owner" || !sessionId || !laneId || !callDigest || !/^[0-9a-f]{12}$/.test(callDigest) || !ref || !/^[0-9a-f]{40,64}$/i.test(ref)) {
|
|
89
|
+
return {
|
|
90
|
+
status: "uncertain",
|
|
91
|
+
reason: `malformed background ownership tag entry "${tag ?? ""}"`
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
owners.push({ sessionId, laneId, callDigest, ref });
|
|
95
|
+
}
|
|
96
|
+
return { status: "ok", owners };
|
|
97
|
+
} catch (error) {
|
|
98
|
+
return {
|
|
99
|
+
status: "uncertain",
|
|
100
|
+
reason: `ownership tag scan failed: ${error instanceof Error ? error.message : String(error)}`
|
|
101
|
+
};
|
|
102
|
+
} finally {
|
|
103
|
+
try {
|
|
104
|
+
proc.kill();
|
|
105
|
+
} catch {}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// src/hooks/delegation-gate/worktree-collision-ownership.ts
|
|
110
|
+
function normalizedPath(value) {
|
|
111
|
+
const resolved = path2.normalize(path2.resolve(value));
|
|
112
|
+
return process.platform === "win32" ? resolved.toLowerCase() : resolved;
|
|
113
|
+
}
|
|
114
|
+
function descriptorCoordinateMatch(descriptor, identity) {
|
|
115
|
+
const branchMatches = descriptor.branchName === identity.branchName;
|
|
116
|
+
const pathMatches = normalizedPath(descriptor.worktreePath) === normalizedPath(identity.worktreePath);
|
|
117
|
+
if (!branchMatches && !pathMatches)
|
|
118
|
+
return "none";
|
|
119
|
+
if (!branchMatches || !pathMatches || descriptor.parentSessionId !== identity.parentSessionId || descriptor.taskId !== identity.taskId) {
|
|
120
|
+
return "uncertain";
|
|
121
|
+
}
|
|
122
|
+
return "exact";
|
|
123
|
+
}
|
|
124
|
+
function isProvenSettled(record) {
|
|
125
|
+
const settlement = record.coderSettlement;
|
|
126
|
+
return settlement?.state === "settled" && settlement.outcome?.kind === "standard-worktree" && (settlement.outcome.result === "merged" || settlement.outcome.result === "unchanged");
|
|
127
|
+
}
|
|
128
|
+
function classifyRecord(record, identity, ownerKind) {
|
|
129
|
+
if (!record.worktree)
|
|
130
|
+
return null;
|
|
131
|
+
const coordinates = descriptorCoordinateMatch(record.worktree, identity);
|
|
132
|
+
if (coordinates === "none")
|
|
133
|
+
return null;
|
|
134
|
+
if (coordinates === "uncertain") {
|
|
135
|
+
return {
|
|
136
|
+
status: "uncertain",
|
|
137
|
+
reason: `${ownerKind} background owner has conflicting identity for branch "${identity.branchName}"`
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
if (isProvenSettled(record))
|
|
141
|
+
return null;
|
|
142
|
+
const lifecycle = record.coderSettlement?.state === "preserved" ? "preserved" : "active";
|
|
143
|
+
return {
|
|
144
|
+
status: "protected",
|
|
145
|
+
ownerKind,
|
|
146
|
+
lifecycle,
|
|
147
|
+
reason: `${ownerKind} background owner ${record.correlationId} is ${record.status}` + (record.coderSettlement ? ` with coder settlement ${record.coderSettlement.state}` : " without a settled workspace outcome")
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
async function inspectStandardWorktreeCollisionOwnership(identity) {
|
|
151
|
+
const provisioning = scanWorktreeProvisioningOwnersForRecovery(identity.directory);
|
|
152
|
+
if (provisioning.status === "uncertain")
|
|
153
|
+
return provisioning;
|
|
154
|
+
for (const owner of provisioning.owners) {
|
|
155
|
+
const sameSession = owner.parentSessionId === identity.parentSessionId || owner.worktreeSessionId === identity.parentSessionId;
|
|
156
|
+
if (!sameSession)
|
|
157
|
+
continue;
|
|
158
|
+
if (owner.schemaVersion === 1 || owner.taskId === identity.taskId) {
|
|
159
|
+
return {
|
|
160
|
+
status: "protected",
|
|
161
|
+
ownerKind: "provisioning",
|
|
162
|
+
lifecycle: "active",
|
|
163
|
+
reason: owner.schemaVersion === 1 ? `legacy provisioning owner ${owner.callID} cannot disprove ownership of this same-session lane` : `provisioning owner ${owner.callID} is active for task ${identity.taskId}`
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const fallback = await scanDelegationFallbacksForRecovery(identity.directory);
|
|
168
|
+
if (fallback.status === "uncertain")
|
|
169
|
+
return fallback;
|
|
170
|
+
for (const artifact of fallback.owners) {
|
|
171
|
+
const classified = classifyRecord(artifact.record, identity, "fallback");
|
|
172
|
+
if (classified)
|
|
173
|
+
return classified;
|
|
174
|
+
}
|
|
175
|
+
const primary = scanDelegationsForRecovery(identity.directory);
|
|
176
|
+
if (primary.status === "uncertain")
|
|
177
|
+
return primary;
|
|
178
|
+
for (const record of primary.owners) {
|
|
179
|
+
const classified = classifyRecord(record, identity, "primary");
|
|
180
|
+
if (classified)
|
|
181
|
+
return classified;
|
|
182
|
+
}
|
|
183
|
+
const tags = await scanBackgroundWorktreeOwnershipTagsForRecovery(identity.directory);
|
|
184
|
+
if (tags.status === "uncertain")
|
|
185
|
+
return tags;
|
|
186
|
+
for (const owner of tags.owners) {
|
|
187
|
+
if (owner.sessionId === identity.parentSessionId && owner.laneId === identity.taskId) {
|
|
188
|
+
return {
|
|
189
|
+
status: "protected",
|
|
190
|
+
ownerKind: "ownership-tag",
|
|
191
|
+
lifecycle: "preserved",
|
|
192
|
+
reason: `durable ownership tag ${owner.callDigest} preserves this same-session lane`
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
const mergeStatus = scanWorktreeMergeFailuresForRecovery(identity.directory);
|
|
197
|
+
if (mergeStatus.status === "uncertain")
|
|
198
|
+
return mergeStatus;
|
|
199
|
+
for (const [, failure] of mergeStatus.failures) {
|
|
200
|
+
const branchMatches = failure.branch === identity.branchName;
|
|
201
|
+
const pathMatches = typeof failure.worktreePath === "string" && normalizedPath(failure.worktreePath) === normalizedPath(identity.worktreePath);
|
|
202
|
+
if (!branchMatches && !pathMatches)
|
|
203
|
+
continue;
|
|
204
|
+
if (!branchMatches || !pathMatches) {
|
|
205
|
+
return {
|
|
206
|
+
status: "uncertain",
|
|
207
|
+
reason: `merge-status owner has conflicting identity for branch "${identity.branchName}"`
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
status: "protected",
|
|
212
|
+
ownerKind: "merge-status",
|
|
213
|
+
lifecycle: "preserved",
|
|
214
|
+
reason: `merge-status records ${failure.outcome} at stage ${failure.stage}`
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
return { status: "unowned" };
|
|
218
|
+
}
|
|
219
|
+
export {
|
|
220
|
+
inspectStandardWorktreeCollisionOwnership
|
|
221
|
+
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { AgentDefinition } from '../agents/index.js';
|
|
2
|
+
import type { AutoReviewConfig } from '../config/schema.js';
|
|
2
3
|
import type { EvaluationModelDispatcher } from '../evaluation/model-dispatcher.js';
|
|
4
|
+
import type { ReviewModelDispatcher } from '../review/contracts.js';
|
|
5
|
+
import type { ReviewAgentModelRegistry } from '../review/runtime.js';
|
|
3
6
|
import { type CommandEntry, resolveCommand } from './registry.js';
|
|
4
7
|
export type ResolvedSwarmCommand = NonNullable<ReturnType<typeof resolveCommand>>;
|
|
5
8
|
export type SwarmCommandPolicyResult = {
|
|
@@ -29,5 +32,9 @@ export declare function executeSwarmCommand(args: {
|
|
|
29
32
|
buildHelpText?: () => string;
|
|
30
33
|
policy?: SwarmCommandPolicy;
|
|
31
34
|
evaluationModelDispatcher?: EvaluationModelDispatcher;
|
|
35
|
+
reviewModelDispatcher?: ReviewModelDispatcher;
|
|
36
|
+
autoReviewConfig?: AutoReviewConfig;
|
|
37
|
+
activeAgentName?: string;
|
|
38
|
+
reviewAgentModelRegistry?: ReviewAgentModelRegistry;
|
|
32
39
|
}): Promise<SwarmCommandExecutionResult>;
|
|
33
40
|
export type { CommandEntry };
|
package/dist/commands/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { AgentDefinition } from '../agents/index.js';
|
|
2
|
+
import type { AutoReviewConfig } from '../config/schema.js';
|
|
2
3
|
import type { EvaluationModelDispatcher } from '../evaluation/model-dispatcher.js';
|
|
4
|
+
import type { ReviewModelDispatcher } from '../review/contracts.js';
|
|
5
|
+
import type { ReviewAgentModelRegistry } from '../review/runtime.js';
|
|
3
6
|
export { handleAcknowledgeSpecDriftCommand } from './acknowledge-spec-drift';
|
|
4
7
|
export { handleAgentsCommand } from './agents';
|
|
5
8
|
export { handleAnalyzeCommand } from './analyze';
|
|
@@ -49,6 +52,7 @@ export { COMMAND_REGISTRY, resolveCommand, VALID_COMMANDS, } from './registry.js
|
|
|
49
52
|
export { handleResetCommand } from './reset';
|
|
50
53
|
export { handleResetSessionCommand } from './reset-session';
|
|
51
54
|
export { handleRetrieveCommand } from './retrieve';
|
|
55
|
+
export { handleReviewCommand } from './review';
|
|
52
56
|
export { handleRollbackCommand } from './rollback';
|
|
53
57
|
export { handleSddCommand, handleSddProjectCommand, handleSddStatusCommand, handleSddValidateCommand, } from './sdd';
|
|
54
58
|
export { handleSimulateCommand } from './simulate';
|
|
@@ -71,6 +75,9 @@ export declare function createSwarmCommandHandler(directory: string, agents: Rec
|
|
|
71
75
|
tools?: Record<string, boolean>;
|
|
72
76
|
}>;
|
|
73
77
|
evaluationModelDispatcher?: EvaluationModelDispatcher;
|
|
78
|
+
reviewModelDispatcher?: ReviewModelDispatcher;
|
|
79
|
+
autoReviewConfig?: AutoReviewConfig;
|
|
80
|
+
reviewAgentModelRegistry?: ReviewAgentModelRegistry;
|
|
74
81
|
}): (input: {
|
|
75
82
|
command: string;
|
|
76
83
|
sessionID: string;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { AgentDefinition } from '../agents/index.js';
|
|
2
|
+
import type { AutoReviewConfig } from '../config/schema.js';
|
|
2
3
|
import type { EvaluationModelDispatcher } from '../evaluation/model-dispatcher.js';
|
|
4
|
+
import type { ReviewModelDispatcher } from '../review/contracts.js';
|
|
5
|
+
import type { ReviewAgentModelRegistry } from '../review/runtime.js';
|
|
6
|
+
import { handleReviewCommand } from './review.js';
|
|
3
7
|
declare function levenshteinDistance(a: string, b: string): number;
|
|
4
8
|
declare function findSimilarCommands(query: string): string[];
|
|
5
9
|
declare function emitValidationWarnings(prefix: string, warnings: readonly string[]): void;
|
|
@@ -20,6 +24,10 @@ export type CommandContext = {
|
|
|
20
24
|
*/
|
|
21
25
|
source?: 'cli' | 'chat';
|
|
22
26
|
evaluationModelDispatcher?: EvaluationModelDispatcher;
|
|
27
|
+
reviewModelDispatcher?: ReviewModelDispatcher;
|
|
28
|
+
autoReviewConfig?: AutoReviewConfig;
|
|
29
|
+
activeAgentName?: string;
|
|
30
|
+
reviewAgentModelRegistry?: ReviewAgentModelRegistry;
|
|
23
31
|
};
|
|
24
32
|
export type CommandResult = Promise<string>;
|
|
25
33
|
export type CommandCategory = 'core' | 'agent' | 'config' | 'diagnostics' | 'utility';
|
|
@@ -236,6 +244,14 @@ export declare const COMMAND_REGISTRY: {
|
|
|
236
244
|
readonly category: "diagnostics";
|
|
237
245
|
readonly toolPolicy: "agent";
|
|
238
246
|
};
|
|
247
|
+
readonly review: {
|
|
248
|
+
readonly handler: typeof handleReviewCommand;
|
|
249
|
+
readonly description: "Run the independent review model against a selected Git diff";
|
|
250
|
+
readonly args: "--base <ref>, --range <from..to|from...to>, --working-tree, --json";
|
|
251
|
+
readonly details: "Collects one bounded canonical diff, dispatches the configured reviewer in a fresh read-only session, optionally validates eligible HIGH/CRITICAL findings when configured or required by gate mode, and persists the receipt and evidence. With no selector, reviews the default merge-base plus working-tree scope.";
|
|
252
|
+
readonly category: "diagnostics";
|
|
253
|
+
readonly toolPolicy: "human-only";
|
|
254
|
+
};
|
|
239
255
|
readonly costs: {
|
|
240
256
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
241
257
|
readonly description: "Show per-agent and per-task token/cost telemetry [--json]";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReviewDiffSelector } from '../review/diff-source.js';
|
|
2
|
+
import { type ReviewEngineResult, type RunReviewEngineInput } from '../review/engine.js';
|
|
3
|
+
import type { AutoReviewEvidence } from '../review/evidence.js';
|
|
4
|
+
import type { CommandContext } from './registry.js';
|
|
5
|
+
declare function findAgentName(agents: CommandContext['agents'], role: string, preferredPrefix?: string): string | undefined;
|
|
6
|
+
declare function formatSelector(selector: ReviewDiffSelector): string;
|
|
7
|
+
declare function renderHuman(result: ReviewEngineResult, evidence: AutoReviewEvidence | null, requestedSelector: ReviewDiffSelector): string;
|
|
8
|
+
declare function renderJson(result: ReviewEngineResult, evidence: AutoReviewEvidence | null, requestedSelector: ReviewDiffSelector): string;
|
|
9
|
+
export declare function handleReviewCommand(ctx: CommandContext): Promise<string>;
|
|
10
|
+
export declare const _internals: {
|
|
11
|
+
runReviewEngine: (input: RunReviewEngineInput) => Promise<ReviewEngineResult>;
|
|
12
|
+
readEvidence: (evidencePath: string | undefined, directory: string) => AutoReviewEvidence | null;
|
|
13
|
+
};
|
|
14
|
+
export declare const _test_exports: {
|
|
15
|
+
MAX_JSON_WRAPPER_BYTES: number;
|
|
16
|
+
findAgentName: typeof findAgentName;
|
|
17
|
+
formatSelector: typeof formatSelector;
|
|
18
|
+
renderHuman: typeof renderHuman;
|
|
19
|
+
renderJson: typeof renderJson;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
* constants.ts re-exports every symbol here, so existing
|
|
10
10
|
* `import { ALL_AGENT_NAMES } from '../config/constants'` call sites are unchanged.
|
|
11
11
|
*/
|
|
12
|
-
export declare const QA_AGENTS: readonly ["reviewer", "critic", "critic_oversight"];
|
|
12
|
+
export declare const QA_AGENTS: readonly ["reviewer", "critic", "critic_oversight", "critic_finding_validator"];
|
|
13
13
|
export declare const PIPELINE_AGENTS: readonly ["explorer", "coder", "test_engineer"];
|
|
14
14
|
export declare const ORCHESTRATOR_NAME: "architect";
|
|
15
|
-
export declare const ALL_SUBAGENT_NAMES: readonly ["sme", "researcher", "docs", "docs_design", "designer", "critic_sounding_board", "critic_drift_verifier", "critic_hallucination_verifier", "critic_architecture_supervisor", "curator_init", "curator_phase", "curator_postmortem", "curator_consolidation", "council_generalist", "council_skeptic", "council_domain_expert", "skill_improver", "spec_writer", "reviewer", "critic", "critic_oversight", "explorer", "coder", "test_engineer"];
|
|
16
|
-
export declare const ALL_AGENT_NAMES: readonly ["architect", "sme", "researcher", "docs", "docs_design", "designer", "critic_sounding_board", "critic_drift_verifier", "critic_hallucination_verifier", "critic_architecture_supervisor", "curator_init", "curator_phase", "curator_postmortem", "curator_consolidation", "council_generalist", "council_skeptic", "council_domain_expert", "skill_improver", "spec_writer", "reviewer", "critic", "critic_oversight", "explorer", "coder", "test_engineer"];
|
|
15
|
+
export declare const ALL_SUBAGENT_NAMES: readonly ["sme", "researcher", "docs", "docs_design", "designer", "critic_sounding_board", "critic_drift_verifier", "critic_hallucination_verifier", "critic_architecture_supervisor", "curator_init", "curator_phase", "curator_postmortem", "curator_consolidation", "council_generalist", "council_skeptic", "council_domain_expert", "skill_improver", "spec_writer", "reviewer", "critic", "critic_oversight", "critic_finding_validator", "explorer", "coder", "test_engineer"];
|
|
16
|
+
export declare const ALL_AGENT_NAMES: readonly ["architect", "sme", "researcher", "docs", "docs_design", "designer", "critic_sounding_board", "critic_drift_verifier", "critic_hallucination_verifier", "critic_architecture_supervisor", "curator_init", "curator_phase", "curator_postmortem", "curator_consolidation", "council_generalist", "council_skeptic", "council_domain_expert", "skill_improver", "spec_writer", "reviewer", "critic", "critic_oversight", "critic_finding_validator", "explorer", "coder", "test_engineer"];
|
|
17
17
|
export type QAAgentName = (typeof QA_AGENTS)[number];
|
|
18
18
|
export type PipelineAgentName = (typeof PIPELINE_AGENTS)[number];
|
|
19
19
|
export type AgentName = (typeof ALL_AGENT_NAMES)[number];
|