opencode-swarm 7.139.3 → 7.139.5
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 +2 -2
- package/dist/cli/{config-doctor-75qky762.js → config-doctor-jgv6h8hd.js} +6 -6
- package/dist/cli/{core-nn8ffy5h.js → core-aj5g7an6.js} +4 -4
- package/dist/cli/{curation-policy-f46tf3dw.js → curation-policy-9a8xmh4x.js} +7 -7
- package/dist/cli/{curator-drift-r52hjskk.js → curator-drift-49p3jnte.js} +6 -6
- package/dist/cli/curator-llm-factory-7c5s2cdm.js +61 -0
- package/dist/cli/{curator-m6mk2v1n.js → curator-xhzdk0qy.js} +39 -39
- package/dist/cli/{dispatch-nbv0hezh.js → dispatch-2s23fbcs.js} +3 -3
- package/dist/cli/{evidence-summary-service-sxcq5nrt.js → evidence-summary-service-g82bsjqa.js} +16 -16
- package/dist/cli/{gate-evidence-1982qswy.js → gate-evidence-72cgrvs2.js} +6 -5
- package/dist/cli/guardrail-explain-vw1kz4k1.js +62 -0
- package/dist/cli/{guardrail-log-320grggj.js → guardrail-log-j91e1s6q.js} +8 -8
- package/dist/cli/{hive-promoter-v4w7cjvk.js → hive-promoter-5rk01jea.js} +39 -39
- package/dist/cli/{index-jqn332jx.js → index-0cyqmr36.js} +2 -2
- package/dist/cli/{index-5syvwd8g.js → index-0xkjhgrf.js} +5 -5
- package/dist/cli/{index-yh0q21nj.js → index-1kyex7z2.js} +1 -1
- package/dist/cli/{index-tkg6rapy.js → index-2ga0zt4s.js} +19404 -19355
- package/dist/cli/{index-6mvbjqbt.js → index-33skgk1a.js} +1 -1
- package/dist/cli/{index-xsxrhakg.js → index-41hkt36g.js} +1 -1
- package/dist/cli/{index-xzzcfwwm.js → index-5z2xps64.js} +2 -2
- package/dist/cli/{index-4fr94329.js → index-6nzmp937.js} +53 -108
- package/dist/cli/{index-2eet124q.js → index-6r522srn.js} +1 -1
- package/dist/cli/{index-4xbyy6aw.js → index-6rxgb5r9.js} +10 -6
- package/dist/cli/{index-gen82t10.js → index-6z0a940s.js} +7 -7
- package/dist/cli/{index-bcwx1335.js → index-9jr92bff.js} +1 -1
- package/dist/cli/{index-z6qe8wft.js → index-9rbwfydj.js} +10 -10
- package/dist/cli/{index-mzck763x.js → index-9xczz1yh.js} +2 -2
- package/dist/cli/{index-yawwwhmc.js → index-fb11cwqr.js} +6 -6
- package/dist/cli/{index-ba5e5e3n.js → index-gee0y2d8.js} +6 -6
- package/dist/cli/{index-1yd38ajy.js → index-h2zm446q.js} +4 -4
- package/dist/cli/{index-v7g8dnyh.js → index-hhgbbceq.js} +15 -15
- package/dist/cli/{index-mv0czd9c.js → index-j77frjq8.js} +6 -6
- package/dist/cli/{index-xeyr62x0.js → index-jtg7gtky.js} +5 -5
- package/dist/cli/{index-k87hs2ff.js → index-k46me75h.js} +3 -3
- package/dist/cli/{index-5hyq2mw6.js → index-ngfw3sd4.js} +43 -43
- package/dist/cli/{index-hckq2r5m.js → index-nrx08gcr.js} +6 -2
- package/dist/cli/{index-hwnpd4tw.js → index-px7z3r1c.js} +3 -3
- package/dist/cli/{index-6axm8q3s.js → index-r2bggfra.js} +7 -7
- package/dist/cli/{index-a5eba0t8.js → index-rsrx77fg.js} +6 -6
- package/dist/cli/index-s0qc4gj6.js +298 -0
- package/dist/cli/{index-ajwmn8gp.js → index-sd657fkp.js} +4 -4
- package/dist/cli/{index-0mzz46we.js → index-w9tezcdd.js} +7 -7
- package/dist/cli/{index-1jbj7vzv.js → index-wqk50bv0.js} +4 -4
- package/dist/cli/{index-05mms0va.js → index-xmhhhjjw.js} +38 -3
- package/dist/cli/{index-kyz7259r.js → index-z0tt5j2s.js} +7 -7
- package/dist/cli/index.js +41 -41
- package/dist/cli/{knowledge-escalator-kkjsjtza.js → knowledge-escalator-rhycg2rh.js} +9 -9
- package/dist/cli/{knowledge-events-jbw9j94n.js → knowledge-events-yjkszs87.js} +6 -6
- package/dist/cli/{knowledge-link-f6akgbdn.js → knowledge-link-bmbatt8s.js} +5 -5
- package/dist/cli/{knowledge-store-m7vnz62z.js → knowledge-store-qe7geq48.js} +7 -7
- package/dist/cli/{knowledge-validator-rqj7kech.js → knowledge-validator-rwptbkpz.js} +10 -10
- package/dist/cli/{pending-delegations-14544jpr.js → pending-delegations-7ayryxbg.js} +7 -7
- package/dist/cli/{pr-subscriptions-qdwfm1a8.js → pr-subscriptions-w5y08ebc.js} +7 -7
- package/dist/cli/{runner-mzb3e2s6.js → runner-h7vmgkth.js} +7 -6
- package/dist/cli/{scan-cursor-8e6ryhjq.js → scan-cursor-v1zkh6st.js} +8 -8
- package/dist/cli/{schema-g7rs20c6.js → schema-9v8wgmxf.js} +3 -3
- package/dist/cli/{scope-persistence-wy65zyha.js → scope-persistence-tj6qway9.js} +6 -6
- package/dist/cli/{skill-generator-2rv6ftre.js → skill-generator-a91bxwv2.js} +12 -12
- package/dist/cli/{telemetry-4tgrfhaz.js → telemetry-62cn5t24.js} +1 -1
- package/dist/cli/{worktree-collision-ownership-24s0t62z.js → worktree-collision-ownership-hs5c2qzp.js} +8 -8
- package/dist/evidence/manager.d.ts +4 -1
- package/dist/index.js +590 -588
- package/dist/prm/escalation.d.ts +34 -0
- package/dist/prm/index.d.ts +6 -2
- package/dist/prm/pattern-detector.d.ts +22 -1
- package/dist/prm/types.d.ts +12 -2
- package/dist/state.d.ts +49 -0
- package/dist/summaries/schema.d.ts +2 -2
- package/dist/tools/convene-council.d.ts +1 -1
- package/dist/tools/pre-check-batch.d.ts +4 -0
- package/dist/tools/resolve-working-directory.d.ts +4 -4
- package/dist/tools/submit-phase-council-verdicts.d.ts +1 -1
- package/dist/tools/write-final-council-evidence.d.ts +1 -1
- package/dist/utils/project-boundary.d.ts +34 -0
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-1r9vz0g2.js +0 -61
- package/dist/cli/guardrail-explain-y2wg00dp.js +0 -62
- package/dist/cli/index-5j6chvj8.js +0 -159
- package/dist/cli/{index-z6xqpmqg.js → index-ee3x66a5.js} +3 -3
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
atomicWriteFile,
|
|
4
4
|
taskEvidencePath,
|
|
5
5
|
withTaskEvidenceLock
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-6r522srn.js";
|
|
7
7
|
import {
|
|
8
8
|
telemetry
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-rsrx77fg.js";
|
|
10
10
|
import {
|
|
11
11
|
exports_external,
|
|
12
12
|
init_zod
|
|
@@ -3,28 +3,10 @@ import {
|
|
|
3
3
|
EvaluationRunV1Schema,
|
|
4
4
|
GateAuditResultV1Schema,
|
|
5
5
|
getProtectedEvaluationRunIds
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-nrx08gcr.js";
|
|
7
7
|
import {
|
|
8
8
|
readEffectiveSpecSync
|
|
9
9
|
} from "./index-9ss2m4rs.js";
|
|
10
|
-
import {
|
|
11
|
-
isValidTaskId,
|
|
12
|
-
readTaskEvidence,
|
|
13
|
-
readTaskEvidenceRaw,
|
|
14
|
-
sanitizeTaskId
|
|
15
|
-
} from "./index-xzzcfwwm.js";
|
|
16
|
-
import {
|
|
17
|
-
EVIDENCE_MAX_JSON_BYTES,
|
|
18
|
-
EvidenceBundleSchema,
|
|
19
|
-
EvidenceSchema
|
|
20
|
-
} from "./index-gprxjmm7.js";
|
|
21
|
-
import {
|
|
22
|
-
_internals,
|
|
23
|
-
buildDefaultPolicy,
|
|
24
|
-
execute,
|
|
25
|
-
init_runner_client,
|
|
26
|
-
probe
|
|
27
|
-
} from "./index-q1exe2b3.js";
|
|
28
10
|
import {
|
|
29
11
|
LedgerStaleWriterError,
|
|
30
12
|
appendLedgerEvent,
|
|
@@ -40,42 +22,61 @@ import {
|
|
|
40
22
|
replayFromLedgerWithStatus,
|
|
41
23
|
takeSnapshotEvent,
|
|
42
24
|
takeSnapshotWithRetry
|
|
43
|
-
} from "./index-
|
|
44
|
-
import {
|
|
45
|
-
PlanSchema
|
|
46
|
-
} from "./index-1kz6da87.js";
|
|
25
|
+
} from "./index-6rxgb5r9.js";
|
|
47
26
|
import {
|
|
48
27
|
getWorktreeMergeFailure
|
|
49
28
|
} from "./index-b8zgtz81.js";
|
|
50
29
|
import {
|
|
51
30
|
readSwarmFileAsync,
|
|
52
31
|
validateSwarmPath
|
|
53
|
-
} from "./index-
|
|
32
|
+
} from "./index-k46me75h.js";
|
|
33
|
+
import {
|
|
34
|
+
isValidTaskId,
|
|
35
|
+
readTaskEvidence,
|
|
36
|
+
readTaskEvidenceRaw,
|
|
37
|
+
sanitizeTaskId
|
|
38
|
+
} from "./index-5z2xps64.js";
|
|
39
|
+
import {
|
|
40
|
+
_internals,
|
|
41
|
+
buildDefaultPolicy,
|
|
42
|
+
execute,
|
|
43
|
+
init_runner_client,
|
|
44
|
+
probe
|
|
45
|
+
} from "./index-q1exe2b3.js";
|
|
54
46
|
import {
|
|
55
47
|
invalidateCachedArtifact,
|
|
56
48
|
readCachedParsedFile
|
|
57
49
|
} from "./index-ed5ykebp.js";
|
|
58
50
|
import {
|
|
51
|
+
assertProjectRoot,
|
|
59
52
|
withEvidenceLock
|
|
60
|
-
} from "./index-
|
|
61
|
-
import {
|
|
62
|
-
emit
|
|
63
|
-
} from "./index-a5eba0t8.js";
|
|
64
|
-
import {
|
|
65
|
-
ZodError,
|
|
66
|
-
init_zod
|
|
67
|
-
} from "./index-bpmtbmy9.js";
|
|
53
|
+
} from "./index-s0qc4gj6.js";
|
|
68
54
|
import {
|
|
69
55
|
bunHash,
|
|
70
56
|
bunWrite,
|
|
71
57
|
mergeEnvForChild
|
|
72
58
|
} from "./index-4nt52yr9.js";
|
|
59
|
+
import {
|
|
60
|
+
EVIDENCE_MAX_JSON_BYTES,
|
|
61
|
+
EvidenceBundleSchema,
|
|
62
|
+
EvidenceSchema
|
|
63
|
+
} from "./index-gprxjmm7.js";
|
|
64
|
+
import {
|
|
65
|
+
PlanSchema
|
|
66
|
+
} from "./index-1kz6da87.js";
|
|
73
67
|
import {
|
|
74
68
|
criticalWarn,
|
|
75
69
|
error,
|
|
76
70
|
init_logger,
|
|
77
71
|
warn
|
|
78
72
|
} from "./index-zgwm4ryv.js";
|
|
73
|
+
import {
|
|
74
|
+
emit
|
|
75
|
+
} from "./index-rsrx77fg.js";
|
|
76
|
+
import {
|
|
77
|
+
ZodError,
|
|
78
|
+
init_zod
|
|
79
|
+
} from "./index-bpmtbmy9.js";
|
|
79
80
|
import {
|
|
80
81
|
__esm,
|
|
81
82
|
__export,
|
|
@@ -2659,6 +2660,7 @@ async function isPlanMdInSync(directory, plan, cache) {
|
|
|
2659
2660
|
return false;
|
|
2660
2661
|
}
|
|
2661
2662
|
async function regeneratePlanMarkdown(directory, plan) {
|
|
2663
|
+
assertProjectRoot(directory);
|
|
2662
2664
|
const swarmDir = path8.resolve(directory, ".swarm");
|
|
2663
2665
|
const contentHash = computePlanContentHash(plan);
|
|
2664
2666
|
const markdown = derivePlanMarkdown(plan);
|
|
@@ -2771,6 +2773,7 @@ async function loadPlan(directory, cache) {
|
|
|
2771
2773
|
const preserving = await isObligationPreserving(directory);
|
|
2772
2774
|
if (!preserving) {
|
|
2773
2775
|
try {
|
|
2776
|
+
assertProjectRoot(directory);
|
|
2774
2777
|
const diffInfo = computeSpecDiff(directory);
|
|
2775
2778
|
const specStalenessPath = path8.join(directory, ".swarm", "spec-staleness.json");
|
|
2776
2779
|
await fsPromises.writeFile(specStalenessPath, JSON.stringify({
|
|
@@ -2787,6 +2790,7 @@ async function loadPlan(directory, cache) {
|
|
|
2787
2790
|
invalidateCachedArtifact(specStalenessPath);
|
|
2788
2791
|
} catch {}
|
|
2789
2792
|
try {
|
|
2793
|
+
assertProjectRoot(directory);
|
|
2790
2794
|
const eventsPath = path8.join(directory, ".swarm", "events.jsonl");
|
|
2791
2795
|
const event = {
|
|
2792
2796
|
type: "spec_stale_detected",
|
|
@@ -2942,6 +2946,7 @@ async function savePlan(directory, plan, options) {
|
|
|
2942
2946
|
if (directory === null || directory === undefined || typeof directory !== "string" || directory.trim().length === 0) {
|
|
2943
2947
|
throw new Error(`Invalid directory: directory must be a non-empty string`);
|
|
2944
2948
|
}
|
|
2949
|
+
assertProjectRoot(directory);
|
|
2945
2950
|
const validated = PlanSchema.parse(plan);
|
|
2946
2951
|
if (options?.preserveCompletedStatuses !== false) {
|
|
2947
2952
|
try {
|
|
@@ -3254,6 +3259,7 @@ ${markdown}`;
|
|
|
3254
3259
|
} catch {}
|
|
3255
3260
|
}
|
|
3256
3261
|
async function rebuildPlan(directory, plan, options) {
|
|
3262
|
+
assertProjectRoot(directory);
|
|
3257
3263
|
const targetPlan = plan ?? await replayFromLedger(directory);
|
|
3258
3264
|
if (!targetPlan)
|
|
3259
3265
|
return null;
|
|
@@ -3324,6 +3330,7 @@ ${markdown}`;
|
|
|
3324
3330
|
return targetPlan;
|
|
3325
3331
|
}
|
|
3326
3332
|
async function closePlanTerminalState(directory, plan, options) {
|
|
3333
|
+
assertProjectRoot(directory);
|
|
3327
3334
|
const planId = derivePlanId(plan);
|
|
3328
3335
|
const validated = PlanSchema.parse(plan);
|
|
3329
3336
|
const hashAfter = computePlanHash(validated);
|
|
@@ -3684,7 +3691,6 @@ import {
|
|
|
3684
3691
|
statSync as statSync2
|
|
3685
3692
|
} from "fs";
|
|
3686
3693
|
import * as fs7 from "fs/promises";
|
|
3687
|
-
import * as os4 from "os";
|
|
3688
3694
|
import * as path10 from "path";
|
|
3689
3695
|
|
|
3690
3696
|
// src/evaluation/retention.ts
|
|
@@ -3793,6 +3799,7 @@ var _retentionInternals = {
|
|
|
3793
3799
|
removeCandidate
|
|
3794
3800
|
};
|
|
3795
3801
|
async function archiveEvaluationArtifacts(args) {
|
|
3802
|
+
assertProjectRoot(args.directory);
|
|
3796
3803
|
return withEvidenceLock(args.directory, path9.join("evolution", "retention-index"), "evaluation-retention", "archive", async () => {
|
|
3797
3804
|
const inventory = await retentionCandidates(args.directory);
|
|
3798
3805
|
let protectedKeys = await _retentionInternals.protectedArtifacts(args.directory);
|
|
@@ -3993,6 +4000,7 @@ async function rewriteAtomic(filePath, survivors) {
|
|
|
3993
4000
|
return Buffer.byteLength(payload, "utf8");
|
|
3994
4001
|
}
|
|
3995
4002
|
async function pruneEvidenceDocuments(args) {
|
|
4003
|
+
assertProjectRoot(args.directory);
|
|
3996
4004
|
const dryRun = args.dryRun === true;
|
|
3997
4005
|
const capsUnset = (typeof args.maxBytes !== "number" || args.maxBytes <= 0) && (typeof args.maxRecords !== "number" || args.maxRecords <= 0);
|
|
3998
4006
|
const filePath = validateSwarmPath(args.directory, EVIDENCE_CACHE_FILE);
|
|
@@ -4097,82 +4105,11 @@ function isValidEvidenceType(type) {
|
|
|
4097
4105
|
return VALID_EVIDENCE_TYPES.includes(type);
|
|
4098
4106
|
}
|
|
4099
4107
|
var sanitizeTaskId2 = sanitizeTaskId;
|
|
4100
|
-
var MAX_DEPTH = 20;
|
|
4101
|
-
var PROJECT_INDICATORS = [
|
|
4102
|
-
"package.json",
|
|
4103
|
-
".git",
|
|
4104
|
-
".opencode",
|
|
4105
|
-
"Cargo.toml",
|
|
4106
|
-
"go.mod",
|
|
4107
|
-
"pyproject.toml",
|
|
4108
|
-
"Gemfile",
|
|
4109
|
-
"composer.json",
|
|
4110
|
-
"pom.xml",
|
|
4111
|
-
"build.gradle",
|
|
4112
|
-
"CMakeLists.txt"
|
|
4113
|
-
];
|
|
4114
|
-
function isWeakConfigContainerRoot(directory) {
|
|
4115
|
-
try {
|
|
4116
|
-
const resolved = realpathSync(directory);
|
|
4117
|
-
return resolved === realpathSync(os4.tmpdir()) || resolved === realpathSync(os4.homedir());
|
|
4118
|
-
} catch {
|
|
4119
|
-
const resolved = path10.resolve(directory);
|
|
4120
|
-
return resolved === path10.resolve(os4.tmpdir()) || resolved === path10.resolve(os4.homedir());
|
|
4121
|
-
}
|
|
4122
|
-
}
|
|
4123
|
-
function hasAccessibleProjectIndicator(directory, options = {}) {
|
|
4124
|
-
const allowConfigOnly = options.allowConfigOnly ?? true;
|
|
4125
|
-
for (const indicator of PROJECT_INDICATORS) {
|
|
4126
|
-
if (!allowConfigOnly && indicator === ".opencode") {
|
|
4127
|
-
continue;
|
|
4128
|
-
}
|
|
4129
|
-
try {
|
|
4130
|
-
const indicatorStat = statSync2(path10.join(directory, indicator));
|
|
4131
|
-
if (indicatorStat.isFile() || indicatorStat.isDirectory()) {
|
|
4132
|
-
return true;
|
|
4133
|
-
}
|
|
4134
|
-
} catch {}
|
|
4135
|
-
}
|
|
4136
|
-
return false;
|
|
4137
|
-
}
|
|
4138
4108
|
function validateProjectRoot(directory) {
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
}
|
|
4143
|
-
warn(`[evidence] Cannot canonicalize directory "${directory}" \u2014 failing closed`);
|
|
4144
|
-
throw new Error(`Cannot verify project root for "${directory}" \u2014 directory may not exist or is inaccessible`);
|
|
4145
|
-
}
|
|
4146
|
-
let current = resolved;
|
|
4147
|
-
let depth = 0;
|
|
4148
|
-
while (true) {
|
|
4149
|
-
if (depth >= MAX_DEPTH)
|
|
4150
|
-
break;
|
|
4151
|
-
depth++;
|
|
4152
|
-
const parent = path10.dirname(current);
|
|
4153
|
-
if (parent === current)
|
|
4154
|
-
break;
|
|
4155
|
-
if (path10.dirname(parent) === parent) {
|
|
4156
|
-
current = parent;
|
|
4157
|
-
continue;
|
|
4158
|
-
}
|
|
4159
|
-
const parentSwarm = path10.join(parent, ".swarm");
|
|
4160
|
-
try {
|
|
4161
|
-
if (statSync2(parentSwarm).isDirectory()) {
|
|
4162
|
-
if (hasAccessibleProjectIndicator(parent, {
|
|
4163
|
-
allowConfigOnly: !isWeakConfigContainerRoot(parent)
|
|
4164
|
-
})) {
|
|
4165
|
-
warn(`[evidence] Rejecting write to subdirectory "${resolved}" \u2014 parent "${parent}" already contains .swarm/`);
|
|
4166
|
-
throw new Error(`Cannot write evidence in "${resolved}" \u2014 parent directory "${parent}" already contains a .swarm/ folder. Evidence must be written to the project root.`);
|
|
4167
|
-
}
|
|
4168
|
-
}
|
|
4169
|
-
} catch (error2) {
|
|
4170
|
-
if (error2 instanceof Error && error2.message.startsWith("Cannot write evidence")) {
|
|
4171
|
-
throw error2;
|
|
4172
|
-
}
|
|
4173
|
-
}
|
|
4174
|
-
current = parent;
|
|
4175
|
-
}
|
|
4109
|
+
assertProjectRoot(directory, {
|
|
4110
|
+
realpathSync: _internals11.realpathSync,
|
|
4111
|
+
statSync: _internals11.statSync
|
|
4112
|
+
}, "evidence");
|
|
4176
4113
|
}
|
|
4177
4114
|
async function saveEvidence(directory, taskId, evidence, abortSignal) {
|
|
4178
4115
|
abortSignal?.throwIfAborted();
|
|
@@ -4297,6 +4234,7 @@ async function loadEvidence(directory, taskId, options) {
|
|
|
4297
4234
|
return { status: "found", bundle: validated };
|
|
4298
4235
|
}
|
|
4299
4236
|
try {
|
|
4237
|
+
validateProjectRoot(directory);
|
|
4300
4238
|
await withEvidenceLock(directory, relativePath, "evidence-loader", sanitizedTaskId, async () => {
|
|
4301
4239
|
const evidenceDir = path10.dirname(evidencePath);
|
|
4302
4240
|
const bundleJson = JSON.stringify(validated);
|
|
@@ -4364,6 +4302,11 @@ async function listEvidenceTaskIds(directory) {
|
|
|
4364
4302
|
}
|
|
4365
4303
|
async function deleteEvidence(directory, taskId) {
|
|
4366
4304
|
const sanitizedTaskId = sanitizeTaskId2(taskId);
|
|
4305
|
+
try {
|
|
4306
|
+
validateProjectRoot(directory);
|
|
4307
|
+
} catch {
|
|
4308
|
+
return false;
|
|
4309
|
+
}
|
|
4367
4310
|
const relativePath = path10.join("evidence", sanitizedTaskId);
|
|
4368
4311
|
const evidenceDir = validateSwarmPath(directory, relativePath);
|
|
4369
4312
|
try {
|
|
@@ -4494,6 +4437,8 @@ var _internals11 = {
|
|
|
4494
4437
|
saveEvidence,
|
|
4495
4438
|
deleteEvidence,
|
|
4496
4439
|
pruneEvidenceDocuments,
|
|
4440
|
+
realpathSync,
|
|
4441
|
+
statSync: statSync2,
|
|
4497
4442
|
now: () => new Date
|
|
4498
4443
|
};
|
|
4499
4444
|
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
assertProjectRoot,
|
|
4
|
+
withEvidenceLock
|
|
5
|
+
} from "./index-s0qc4gj6.js";
|
|
2
6
|
import {
|
|
3
7
|
ExecutionProfileSchema,
|
|
4
8
|
PlanSchema,
|
|
5
9
|
TaskStatusSchema
|
|
6
10
|
} from "./index-1kz6da87.js";
|
|
7
|
-
import {
|
|
8
|
-
withEvidenceLock
|
|
9
|
-
} from "./index-5j6chvj8.js";
|
|
10
|
-
import {
|
|
11
|
-
emit
|
|
12
|
-
} from "./index-a5eba0t8.js";
|
|
13
11
|
import {
|
|
14
12
|
criticalWarn,
|
|
15
13
|
init_logger,
|
|
16
14
|
log
|
|
17
15
|
} from "./index-zgwm4ryv.js";
|
|
16
|
+
import {
|
|
17
|
+
emit
|
|
18
|
+
} from "./index-rsrx77fg.js";
|
|
18
19
|
|
|
19
20
|
// src/plan/utils.ts
|
|
20
21
|
function derivePlanId(plan) {
|
|
@@ -180,6 +181,7 @@ async function readLedgerEvents(directory) {
|
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
183
|
async function initLedger(directory, planId, initialPlanHash, initialPlan) {
|
|
184
|
+
assertProjectRoot(directory);
|
|
183
185
|
const ledgerPath = getLedgerPath(directory);
|
|
184
186
|
const planJsonPath = getPlanJsonPath(directory);
|
|
185
187
|
if (fs.existsSync(ledgerPath)) {
|
|
@@ -217,6 +219,7 @@ async function initLedger(directory, planId, initialPlanHash, initialPlan) {
|
|
|
217
219
|
writeFileFsyncedThenRename(tempPath, ledgerPath, line);
|
|
218
220
|
}
|
|
219
221
|
async function appendLedgerEvent(directory, eventInput, options) {
|
|
222
|
+
assertProjectRoot(directory);
|
|
220
223
|
return withEvidenceLock(directory, LEDGER_LOCK_PATH, "plan-ledger", "append-ledger-event", async () => {
|
|
221
224
|
const ledgerPath = getLedgerPath(directory);
|
|
222
225
|
const latestSeq = await getLatestLedgerSeq(directory);
|
|
@@ -484,6 +487,7 @@ async function quarantineLedgerSuffix(directory, badSuffix) {
|
|
|
484
487
|
} catch {}
|
|
485
488
|
}
|
|
486
489
|
try {
|
|
490
|
+
assertProjectRoot(directory);
|
|
487
491
|
const hash = crypto.createHash("sha256").update(badSuffix, "utf8").digest("hex").slice(0, 12);
|
|
488
492
|
const swarmDir = path.join(directory, ".swarm");
|
|
489
493
|
try {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
bunSpawn
|
|
4
|
+
} from "./index-4nt52yr9.js";
|
|
2
5
|
import {
|
|
3
6
|
advisoryWarn,
|
|
4
7
|
init_warning_buffer
|
|
5
8
|
} from "./index-4rhhvd1a.js";
|
|
9
|
+
import {
|
|
10
|
+
log
|
|
11
|
+
} from "./index-zgwm4ryv.js";
|
|
6
12
|
import {
|
|
7
13
|
SWARM_WORKTREE_DIR_NAME,
|
|
8
14
|
init_constants
|
|
9
15
|
} from "./index-4wjk296r.js";
|
|
10
|
-
import {
|
|
11
|
-
bunSpawn
|
|
12
|
-
} from "./index-4nt52yr9.js";
|
|
13
|
-
import {
|
|
14
|
-
log
|
|
15
|
-
} from "./index-zgwm4ryv.js";
|
|
16
16
|
import {
|
|
17
17
|
__require
|
|
18
18
|
} from "./index-a76rekgs.js";
|
|
@@ -86,7 +86,7 @@ var _internals = {
|
|
|
86
86
|
symlinkSync: fs.symlinkSync
|
|
87
87
|
},
|
|
88
88
|
writeScopeToDisk: async (directory, taskId, files) => {
|
|
89
|
-
const { writeScopeToDisk: realWrite } = await import("./scope-persistence-
|
|
89
|
+
const { writeScopeToDisk: realWrite } = await import("./scope-persistence-tj6qway9.js");
|
|
90
90
|
return realWrite(directory, taskId, files);
|
|
91
91
|
},
|
|
92
92
|
writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
|
|
@@ -6,14 +6,10 @@ import {
|
|
|
6
6
|
} from "./index-ae75rja9.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveKnowledgeStoreDir
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-33skgk1a.js";
|
|
10
10
|
import {
|
|
11
11
|
atomicWriteFile
|
|
12
|
-
} from "./index-
|
|
13
|
-
import {
|
|
14
|
-
init_knowledge_types,
|
|
15
|
-
isActiveStatus
|
|
16
|
-
} from "./index-bk5tah7q.js";
|
|
12
|
+
} from "./index-6r522srn.js";
|
|
17
13
|
import {
|
|
18
14
|
readCachedParsedFile
|
|
19
15
|
} from "./index-ed5ykebp.js";
|
|
@@ -24,6 +20,10 @@ import {
|
|
|
24
20
|
init_logger,
|
|
25
21
|
log
|
|
26
22
|
} from "./index-zgwm4ryv.js";
|
|
23
|
+
import {
|
|
24
|
+
init_knowledge_types,
|
|
25
|
+
isActiveStatus
|
|
26
|
+
} from "./index-bk5tah7q.js";
|
|
27
27
|
import {
|
|
28
28
|
__require,
|
|
29
29
|
__toESM
|
|
@@ -702,7 +702,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
|
|
|
702
702
|
const recovered = touched.filter((e) => e.confidence > CONFIDENCE_FLOOR + FLOOR_EPSILON && e.confidence_floor_demoted);
|
|
703
703
|
if (atFloor.length === 0 && recovered.length === 0)
|
|
704
704
|
return;
|
|
705
|
-
const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-
|
|
705
|
+
const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-yjkszs87.js");
|
|
706
706
|
const rollups = await readKnowledgeCounterRollups(directory);
|
|
707
707
|
const flagIds = new Set;
|
|
708
708
|
for (const e of atFloor) {
|
|
@@ -769,11 +769,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
|
|
|
769
769
|
});
|
|
770
770
|
}
|
|
771
771
|
if (action === "quarantine" && toQuarantine.length > 0) {
|
|
772
|
-
const { quarantineEntry } = await import("./knowledge-validator-
|
|
773
|
-
const { KnowledgeConfigSchema } = await import("./schema-
|
|
772
|
+
const { quarantineEntry } = await import("./knowledge-validator-rwptbkpz.js");
|
|
773
|
+
const { KnowledgeConfigSchema } = await import("./schema-9v8wgmxf.js");
|
|
774
774
|
let config;
|
|
775
775
|
try {
|
|
776
|
-
const { loadPluginConfigWithMeta } = await import("./index-
|
|
776
|
+
const { loadPluginConfigWithMeta } = await import("./index-hhgbbceq.js");
|
|
777
777
|
const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
|
|
778
778
|
config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
|
|
779
779
|
} catch {
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
detectPosixWrites,
|
|
13
13
|
detectWindowsWrites,
|
|
14
14
|
resolveWriteTargets
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-2ga0zt4s.js";
|
|
16
16
|
import {
|
|
17
17
|
checkFileAuthority,
|
|
18
18
|
classifyFile,
|
|
19
19
|
isInDeclaredScope,
|
|
20
20
|
redactPath,
|
|
21
21
|
redactShellCommand
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-w9tezcdd.js";
|
|
23
23
|
|
|
24
24
|
// src/services/guardrail-explain-service.ts
|
|
25
25
|
import path from "path";
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
advisoryWarn,
|
|
4
|
+
init_warning_buffer
|
|
5
|
+
} from "./index-4rhhvd1a.js";
|
|
2
6
|
import {
|
|
3
7
|
ExternalSkillsConfigSchema,
|
|
4
8
|
GATE_CONFIG_KNOWN_SECTION_KEYS,
|
|
@@ -6,11 +10,7 @@ import {
|
|
|
6
10
|
PluginConfigSchema,
|
|
7
11
|
init_schema,
|
|
8
12
|
resolveExternalSkillsConfig
|
|
9
|
-
} from "./index-
|
|
10
|
-
import {
|
|
11
|
-
advisoryWarn,
|
|
12
|
-
init_warning_buffer
|
|
13
|
-
} from "./index-4rhhvd1a.js";
|
|
13
|
+
} from "./index-z0tt5j2s.js";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_WORKTREE_ISOLATION_CONFIG,
|
|
16
16
|
init_constants
|
|
@@ -717,4 +717,4 @@ function resolveWorktreeIsolationConfig(config) {
|
|
|
717
717
|
// src/config/index.ts
|
|
718
718
|
var _internals = { loadPluginConfigWithMeta };
|
|
719
719
|
|
|
720
|
-
export {
|
|
720
|
+
export { loadPluginConfig, loadPluginConfigWithMeta, getSafeDefaultConfigLoadResult, loadPluginConfigWithMetaAsync, loadAgentPrompt, exports_loader, init_loader, resolveWorktreeIsolationConfig, _internals };
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
readKnowledge,
|
|
4
4
|
transactKnowledge
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-9rbwfydj.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveKnowledgeStoreDir
|
|
8
|
-
} from "./index-
|
|
9
|
-
import {
|
|
10
|
-
init_knowledge_types,
|
|
11
|
-
isActiveStatus
|
|
12
|
-
} from "./index-bk5tah7q.js";
|
|
8
|
+
} from "./index-33skgk1a.js";
|
|
13
9
|
import {
|
|
14
10
|
init_logger,
|
|
15
11
|
log
|
|
16
12
|
} from "./index-zgwm4ryv.js";
|
|
13
|
+
import {
|
|
14
|
+
init_knowledge_types,
|
|
15
|
+
isActiveStatus
|
|
16
|
+
} from "./index-bk5tah7q.js";
|
|
17
17
|
import {
|
|
18
18
|
__require,
|
|
19
19
|
__toESM
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
log
|
|
4
|
+
} from "./index-zgwm4ryv.js";
|
|
2
5
|
import {
|
|
3
6
|
FALLBACK_MODELS_MAX,
|
|
4
7
|
GATE_CONFIG_KNOWN_SECTION_KEYS,
|
|
@@ -6,14 +9,11 @@ import {
|
|
|
6
9
|
PluginConfigSchema,
|
|
7
10
|
init_schema,
|
|
8
11
|
stripKnownSwarmPrefix
|
|
9
|
-
} from "./index-
|
|
12
|
+
} from "./index-z0tt5j2s.js";
|
|
10
13
|
import {
|
|
11
14
|
ALL_AGENT_NAMES,
|
|
12
15
|
init_constants
|
|
13
16
|
} from "./index-4wjk296r.js";
|
|
14
|
-
import {
|
|
15
|
-
log
|
|
16
|
-
} from "./index-zgwm4ryv.js";
|
|
17
17
|
|
|
18
18
|
// src/services/config-doctor.ts
|
|
19
19
|
init_constants();
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
loadPluginConfigWithMeta,
|
|
8
8
|
loadPluginConfigWithMetaAsync,
|
|
9
9
|
resolveWorktreeIsolationConfig
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-fb11cwqr.js";
|
|
11
11
|
import {
|
|
12
12
|
ApprovalEvidenceSchema,
|
|
13
13
|
BaseEvidenceSchema,
|
|
@@ -33,6 +33,17 @@ import {
|
|
|
33
33
|
SwarmSpecSchema,
|
|
34
34
|
validateSpecContent
|
|
35
35
|
} from "./index-n832052r.js";
|
|
36
|
+
import {
|
|
37
|
+
MigrationStatusSchema,
|
|
38
|
+
PhaseSchema,
|
|
39
|
+
PhaseStatusSchema,
|
|
40
|
+
PlanSchema,
|
|
41
|
+
TaskSchema,
|
|
42
|
+
TaskSizeSchema,
|
|
43
|
+
TaskStatusSchema
|
|
44
|
+
} from "./index-1kz6da87.js";
|
|
45
|
+
import"./index-4rhhvd1a.js";
|
|
46
|
+
import"./index-zgwm4ryv.js";
|
|
36
47
|
import {
|
|
37
48
|
AUTO_REVIEW_V8_BURN_IN_DECISION,
|
|
38
49
|
AgentOverrideConfigSchema,
|
|
@@ -54,18 +65,7 @@ import {
|
|
|
54
65
|
TurboConfigSchema,
|
|
55
66
|
WorktreeIsolationConfigSchema,
|
|
56
67
|
resolveAutoReviewConfig
|
|
57
|
-
} from "./index-
|
|
58
|
-
import"./index-bk5tah7q.js";
|
|
59
|
-
import {
|
|
60
|
-
MigrationStatusSchema,
|
|
61
|
-
PhaseSchema,
|
|
62
|
-
PhaseStatusSchema,
|
|
63
|
-
PlanSchema,
|
|
64
|
-
TaskSchema,
|
|
65
|
-
TaskSizeSchema,
|
|
66
|
-
TaskStatusSchema
|
|
67
|
-
} from "./index-1kz6da87.js";
|
|
68
|
-
import"./index-4rhhvd1a.js";
|
|
68
|
+
} from "./index-z0tt5j2s.js";
|
|
69
69
|
import {
|
|
70
70
|
ALL_AGENT_NAMES,
|
|
71
71
|
ALL_SUBAGENT_NAMES,
|
|
@@ -76,9 +76,9 @@ import {
|
|
|
76
76
|
isQAAgent,
|
|
77
77
|
isSubagent
|
|
78
78
|
} from "./index-4wjk296r.js";
|
|
79
|
-
import"./index-bpmtbmy9.js";
|
|
80
79
|
import"./index-zjygnfay.js";
|
|
81
|
-
import"./index-
|
|
80
|
+
import"./index-bk5tah7q.js";
|
|
81
|
+
import"./index-bpmtbmy9.js";
|
|
82
82
|
import"./index-a76rekgs.js";
|
|
83
83
|
export {
|
|
84
84
|
validateSpecContent,
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
validateSwarmPath
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-k46me75h.js";
|
|
5
5
|
import {
|
|
6
6
|
withEvidenceLock
|
|
7
|
-
} from "./index-
|
|
8
|
-
import {
|
|
9
|
-
exports_external,
|
|
10
|
-
init_zod
|
|
11
|
-
} from "./index-bpmtbmy9.js";
|
|
7
|
+
} from "./index-s0qc4gj6.js";
|
|
12
8
|
import {
|
|
13
9
|
bunWrite
|
|
14
10
|
} from "./index-4nt52yr9.js";
|
|
@@ -16,6 +12,10 @@ import {
|
|
|
16
12
|
init_logger,
|
|
17
13
|
warn
|
|
18
14
|
} from "./index-zgwm4ryv.js";
|
|
15
|
+
import {
|
|
16
|
+
exports_external,
|
|
17
|
+
init_zod
|
|
18
|
+
} from "./index-bpmtbmy9.js";
|
|
19
19
|
|
|
20
20
|
// src/background/pending-delegations.ts
|
|
21
21
|
init_zod();
|