opencode-swarm 7.139.2 → 7.139.4
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/.opencode/skills/phase-wrap/SKILL.md +2 -2
- package/README.md +2 -2
- package/dist/background/stage-b-gates.d.ts +5 -1
- package/dist/background/task-envelope.d.ts +4 -4
- package/dist/cli/{config-doctor-hrb61yqe.js → config-doctor-whxr386t.js} +6 -6
- package/dist/cli/{core-g2dfh9fq.js → core-aj5g7an6.js} +5 -5
- package/dist/cli/{curation-policy-4tp0mbcb.js → curation-policy-anym2y3v.js} +8 -8
- package/dist/cli/{curator-drift-vfh07mqy.js → curator-drift-49p3jnte.js} +7 -7
- package/dist/cli/{curator-vpcs1p1v.js → curator-e8cvb55d.js} +41 -41
- package/dist/cli/curator-llm-factory-h9xbpgmw.js +61 -0
- package/dist/cli/{dispatch-b1fge4xk.js → dispatch-2s23fbcs.js} +4 -4
- package/dist/cli/{evidence-summary-service-kzxr71yd.js → evidence-summary-service-g82bsjqa.js} +16 -16
- package/dist/cli/{gate-evidence-z2b1ymnw.js → gate-evidence-72cgrvs2.js} +6 -5
- package/dist/cli/guardrail-explain-0be7msvq.js +62 -0
- package/dist/cli/{guardrail-log-2ftew0p3.js → guardrail-log-9mm5443g.js} +9 -9
- package/dist/cli/{hive-promoter-mpf0cfkk.js → hive-promoter-nnzs5x1r.js} +41 -41
- package/dist/cli/{index-w71cq27a.js → index-0e95eck5.js} +5 -5
- package/dist/cli/{index-5zyk8qgv.js → index-0xkjhgrf.js} +5 -5
- package/dist/cli/{index-q7ezzgwq.js → index-1kyex7z2.js} +1 -1
- package/dist/cli/{index-668dpw5e.js → index-33skgk1a.js} +1 -1
- package/dist/cli/{index-vm4xw9z3.js → index-41hkt36g.js} +2 -2
- package/dist/cli/{index-y111zefa.js → index-4nt52yr9.js} +80 -31
- package/dist/cli/{index-3jcyn8g6.js → index-4wjk296r.js} +1 -1
- package/dist/cli/{index-3radty3f.js → index-5azdnaty.js} +2 -2
- package/dist/cli/{index-8p9pasnp.js → index-5s23pfsy.js} +8 -8
- package/dist/cli/{index-5w7ekpy3.js → index-5z2xps64.js} +2 -2
- package/dist/cli/{index-0wp67gqj.js → index-6nzmp937.js} +61 -111
- package/dist/cli/{index-gvhvz176.js → index-6r522srn.js} +2 -2
- package/dist/cli/{index-4xbyy6aw.js → index-6rxgb5r9.js} +10 -6
- package/dist/cli/{index-cyw81ngh.js → index-6vh6vrnk.js} +10 -10
- package/dist/cli/{index-a12906mj.js → index-6z0a940s.js} +8 -8
- package/dist/cli/{index-wsdnttf4.js → index-74hpm6sh.js} +1 -1
- package/dist/cli/{index-6w1re1qn.js → index-9cdj4020.js} +6 -6
- package/dist/cli/{index-y47dwge1.js → index-e1k9vpqn.js} +5 -5
- package/dist/cli/{index-y64jv2pe.js → index-ejbcpbzp.js} +7 -7
- package/dist/cli/{index-6c5f309q.js → index-gfmrw2f5.js} +2 -2
- package/dist/cli/{index-prmb5qfp.js → index-j77frjq8.js} +7 -7
- package/dist/cli/{index-ffpmqx30.js → index-jnfyxeap.js} +4 -4
- package/dist/cli/{index-e9tx99ds.js → index-k41dn8me.js} +3 -3
- package/dist/cli/{index-x9q4bbhd.js → index-k46me75h.js} +4 -4
- package/dist/cli/{index-s608d3hw.js → index-nrx08gcr.js} +6 -2
- package/dist/cli/{index-ktagrqxw.js → index-pg84msyc.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-q11t5erh.js → index-s58vghgj.js} +7 -7
- package/dist/cli/{index-se8xc78k.js → index-sa15nfgg.js} +45 -45
- package/dist/cli/{index-wrt6m5ze.js → index-sd657fkp.js} +291 -75
- package/dist/cli/{index-yr6x707c.js → index-vfsqpcz6.js} +16 -16
- package/dist/cli/{index-a7nh382r.js → index-vyqd1hzm.js} +20593 -19882
- package/dist/cli/{index-8gftfvpp.js → index-xb1zq933.js} +1 -1
- package/dist/cli/{index-3eddtgxt.js → index-xmhhhjjw.js} +39 -4
- package/dist/cli/index.js +43 -43
- package/dist/cli/{knowledge-escalator-n9pmx4qr.js → knowledge-escalator-a6z30y9p.js} +10 -10
- package/dist/cli/{knowledge-events-raevm18w.js → knowledge-events-deq0ds8e.js} +7 -7
- package/dist/cli/{knowledge-link-3tq8w6gs.js → knowledge-link-bmbatt8s.js} +6 -6
- package/dist/cli/{knowledge-store-bcfqz8fr.js → knowledge-store-vdr19mnq.js} +8 -8
- package/dist/cli/{knowledge-validator-jxqj96cx.js → knowledge-validator-5hgacnrf.js} +11 -11
- package/dist/cli/{pending-delegations-tmyf18p4.js → pending-delegations-7ayryxbg.js} +8 -8
- package/dist/cli/{pr-subscriptions-hhx6yk24.js → pr-subscriptions-w5y08ebc.js} +8 -8
- package/dist/cli/{runner-w30gazew.js → runner-h7vmgkth.js} +7 -6
- package/dist/cli/{scan-cursor-ah5swtyh.js → scan-cursor-d6qcg9hr.js} +9 -9
- package/dist/cli/{schema-f7jgrtxj.js → schema-y1zekrag.js} +3 -3
- package/dist/cli/{scope-persistence-3f0d4fwv.js → scope-persistence-tj6qway9.js} +7 -7
- package/dist/cli/{skill-generator-hp7as46c.js → skill-generator-bw8xhzzn.js} +13 -13
- package/dist/cli/{task-envelope-qn0qtnh0.js → task-envelope-jp2fdsvn.js} +11 -8
- package/dist/cli/{telemetry-4tgrfhaz.js → telemetry-62cn5t24.js} +1 -1
- package/dist/cli/{workspace-snapshot-h5rzw37b.js → workspace-snapshot-w3tg4ne5.js} +2 -2
- package/dist/cli/{worktree-collision-ownership-vexb0b6r.js → worktree-collision-ownership-hs5c2qzp.js} +9 -9
- package/dist/commands/approve-plan-critic.d.ts +2 -2
- package/dist/commands/registry.d.ts +1 -1
- package/dist/config/agent-model.d.ts +35 -0
- package/dist/db/qa-gate-profile.d.ts +11 -3
- package/dist/evidence/manager.d.ts +5 -2
- package/dist/evidence/phase-participation.d.ts +44 -0
- package/dist/hooks/compaction-customizer.d.ts +30 -2
- package/dist/hooks/context-budget.d.ts +1 -1
- package/dist/hooks/delegation-gate.d.ts +3 -3
- package/dist/hooks/guardrails/index.d.ts +5 -1
- package/dist/hooks/guardrails/messages-transform.d.ts +2 -0
- package/dist/hooks/guardrails/pre-check-result.d.ts +20 -0
- package/dist/index.js +616 -609
- 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/sast/semgrep.d.ts +15 -32
- package/dist/services/compaction-service.d.ts +3 -1
- package/dist/session/snapshot-writer.d.ts +1 -0
- package/dist/state.d.ts +119 -19
- package/dist/summaries/schema.d.ts +2 -2
- package/dist/tools/context-status.d.ts +4 -1
- package/dist/tools/convene-council.d.ts +1 -1
- package/dist/tools/lint.d.ts +48 -22
- package/dist/tools/pre-check-batch.d.ts +41 -13
- package/dist/tools/quality-budget.d.ts +3 -2
- package/dist/tools/resolve-working-directory.d.ts +4 -4
- package/dist/tools/sast-baseline.d.ts +1 -0
- package/dist/tools/sast-scan.d.ts +4 -1
- package/dist/tools/secretscan.d.ts +2 -2
- package/dist/tools/set-qa-gates.d.ts +5 -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/bun-compat.d.ts +20 -0
- package/dist/utils/external-tool-runner.d.ts +10 -0
- package/dist/utils/project-boundary.d.ts +34 -0
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-hvw13hmr.js +0 -61
- package/dist/cli/guardrail-explain-k62h3c92.js +0 -62
- package/dist/cli/index-5j6chvj8.js +0 -159
- package/dist/cli/{index-z6xqpmqg.js → index-ee3x66a5.js} +3 -3
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
require_proper_lockfile
|
|
4
|
+
} from "./index-7g4c7s5r.js";
|
|
5
|
+
import {
|
|
6
|
+
init_logger,
|
|
7
|
+
warn
|
|
8
|
+
} from "./index-zgwm4ryv.js";
|
|
9
|
+
import {
|
|
10
|
+
emit
|
|
11
|
+
} from "./index-rsrx77fg.js";
|
|
12
|
+
import {
|
|
13
|
+
__toESM
|
|
14
|
+
} from "./index-a76rekgs.js";
|
|
15
|
+
|
|
16
|
+
// src/utils/project-boundary.ts
|
|
17
|
+
init_logger();
|
|
18
|
+
import * as fs from "fs";
|
|
19
|
+
import * as os from "os";
|
|
20
|
+
import * as path from "path";
|
|
21
|
+
var MAX_PROJECT_ROOT_DEPTH = 20;
|
|
22
|
+
var PROJECT_ROOT_INDICATORS = [
|
|
23
|
+
"package.json",
|
|
24
|
+
".git",
|
|
25
|
+
".opencode",
|
|
26
|
+
"Cargo.toml",
|
|
27
|
+
"go.mod",
|
|
28
|
+
"pyproject.toml",
|
|
29
|
+
"Gemfile",
|
|
30
|
+
"composer.json",
|
|
31
|
+
"pom.xml",
|
|
32
|
+
"build.gradle",
|
|
33
|
+
"CMakeLists.txt"
|
|
34
|
+
];
|
|
35
|
+
var PROJECT_BOUNDARY_MARKERS = [
|
|
36
|
+
{
|
|
37
|
+
name: ".git",
|
|
38
|
+
accepts: (stat) => stat.isFile() || stat.isDirectory()
|
|
39
|
+
},
|
|
40
|
+
{ name: ".opencode", accepts: (stat) => stat.isDirectory() }
|
|
41
|
+
];
|
|
42
|
+
function isAbsoluteDirectoryInput(value) {
|
|
43
|
+
return typeof value === "string" && value.trim().length > 0 && path.isAbsolute(value);
|
|
44
|
+
}
|
|
45
|
+
function hasExplicitProjectBoundary(directory) {
|
|
46
|
+
if (!isAbsoluteDirectoryInput(directory))
|
|
47
|
+
return false;
|
|
48
|
+
for (const marker of PROJECT_BOUNDARY_MARKERS) {
|
|
49
|
+
try {
|
|
50
|
+
const stat = _internals.lstatSync(path.join(directory, marker.name));
|
|
51
|
+
if (!stat.isSymbolicLink() && marker.accepts(stat))
|
|
52
|
+
return true;
|
|
53
|
+
} catch {}
|
|
54
|
+
}
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
function isStrictPathDescendant(candidate, root) {
|
|
58
|
+
if (!isAbsoluteDirectoryInput(candidate) || !isAbsoluteDirectoryInput(root)) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
const relative2 = path.relative(root, candidate);
|
|
62
|
+
return relative2 !== "" && relative2 !== ".." && !relative2.startsWith(`..${path.sep}`) && !path.isAbsolute(relative2);
|
|
63
|
+
}
|
|
64
|
+
function isMissingPathError(error) {
|
|
65
|
+
const code = error?.code;
|
|
66
|
+
return code === "ENOENT" || code === "ENOTDIR";
|
|
67
|
+
}
|
|
68
|
+
function isWeakConfigContainerRoot(directory, dependencies) {
|
|
69
|
+
try {
|
|
70
|
+
const resolved = dependencies.realpathSync(directory);
|
|
71
|
+
return resolved === dependencies.realpathSync(os.tmpdir()) || resolved === dependencies.realpathSync(os.homedir());
|
|
72
|
+
} catch {
|
|
73
|
+
const resolved = path.resolve(directory);
|
|
74
|
+
return resolved === path.resolve(os.tmpdir()) || resolved === path.resolve(os.homedir());
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function projectIndicatorState(directory, dependencies, options = {}) {
|
|
78
|
+
const allowConfigOnly = options.allowConfigOnly ?? true;
|
|
79
|
+
for (const indicator of PROJECT_ROOT_INDICATORS) {
|
|
80
|
+
if (!allowConfigOnly && indicator === ".opencode")
|
|
81
|
+
continue;
|
|
82
|
+
try {
|
|
83
|
+
const indicatorStat = dependencies.statSync(path.join(directory, indicator));
|
|
84
|
+
if (indicatorStat.isFile() || indicatorStat.isDirectory())
|
|
85
|
+
return "present";
|
|
86
|
+
} catch (error) {
|
|
87
|
+
if (!isMissingPathError(error))
|
|
88
|
+
return "inaccessible";
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return "absent";
|
|
92
|
+
}
|
|
93
|
+
function assertProjectRoot(directory, dependencies = fs, artifactLabel = "runtime state") {
|
|
94
|
+
let resolved;
|
|
95
|
+
try {
|
|
96
|
+
resolved = dependencies.realpathSync(directory);
|
|
97
|
+
} catch {
|
|
98
|
+
warn(`[project-boundary] Cannot canonicalize directory "${directory}" \u2014 failing closed`);
|
|
99
|
+
throw new Error(`Cannot verify project root for "${directory}" \u2014 directory may not exist or is inaccessible`);
|
|
100
|
+
}
|
|
101
|
+
if (hasExplicitProjectBoundary(resolved))
|
|
102
|
+
return;
|
|
103
|
+
let current = resolved;
|
|
104
|
+
let depth = 0;
|
|
105
|
+
while (true) {
|
|
106
|
+
if (depth >= MAX_PROJECT_ROOT_DEPTH) {
|
|
107
|
+
warn(`[project-boundary] Ancestor search exceeded ${MAX_PROJECT_ROOT_DEPTH} levels for "${resolved}" \u2014 failing closed`);
|
|
108
|
+
throw new Error(`Cannot verify project root for "${resolved}" \u2014 ancestor search exceeded ${MAX_PROJECT_ROOT_DEPTH} levels`);
|
|
109
|
+
}
|
|
110
|
+
depth++;
|
|
111
|
+
const parent = path.dirname(current);
|
|
112
|
+
if (parent === current)
|
|
113
|
+
break;
|
|
114
|
+
if (path.dirname(parent) === parent) {
|
|
115
|
+
current = parent;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
const parentSwarm = path.join(parent, ".swarm");
|
|
119
|
+
let parentSwarmStat;
|
|
120
|
+
try {
|
|
121
|
+
parentSwarmStat = dependencies.statSync(parentSwarm);
|
|
122
|
+
} catch (error) {
|
|
123
|
+
if (isMissingPathError(error)) {
|
|
124
|
+
current = parent;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
warn(`[project-boundary] Cannot inspect ancestor state "${parentSwarm}" \u2014 failing closed`);
|
|
128
|
+
throw new Error(`Cannot verify project root for "${resolved}" \u2014 ancestor state "${parentSwarm}" is inaccessible`);
|
|
129
|
+
}
|
|
130
|
+
if (parentSwarmStat.isDirectory()) {
|
|
131
|
+
const indicatorState = projectIndicatorState(parent, dependencies, {
|
|
132
|
+
allowConfigOnly: !isWeakConfigContainerRoot(parent, dependencies)
|
|
133
|
+
});
|
|
134
|
+
if (indicatorState === "inaccessible") {
|
|
135
|
+
warn(`[project-boundary] Cannot inspect project indicators in ancestor "${parent}" \u2014 failing closed`);
|
|
136
|
+
throw new Error(`Cannot verify project root for "${resolved}" \u2014 project indicators in ancestor "${parent}" are inaccessible`);
|
|
137
|
+
}
|
|
138
|
+
if (indicatorState === "present") {
|
|
139
|
+
warn(`[project-boundary] Rejecting write to subdirectory "${resolved}" \u2014 parent "${parent}" already contains .swarm/`);
|
|
140
|
+
throw new Error(`Cannot write ${artifactLabel} in "${resolved}" \u2014 parent directory "${parent}" already contains a .swarm/ folder. Runtime state must be written to the project root.`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
current = parent;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
var _internals = {
|
|
147
|
+
lstatSync: fs.lstatSync
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
// src/parallel/file-locks.ts
|
|
151
|
+
var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
|
|
152
|
+
import * as crypto from "crypto";
|
|
153
|
+
import * as fs2 from "fs";
|
|
154
|
+
import * as path2 from "path";
|
|
155
|
+
var LOCKS_DIR = ".swarm/locks";
|
|
156
|
+
var LOCK_TIMEOUT_MS = 5 * 60 * 1000;
|
|
157
|
+
var _internals2 = {
|
|
158
|
+
tryAcquireLock,
|
|
159
|
+
writeFile: fs2.promises.writeFile
|
|
160
|
+
};
|
|
161
|
+
function getLockFilePath(directory, filePath) {
|
|
162
|
+
const normalized = path2.resolve(directory, filePath);
|
|
163
|
+
const baseDir = path2.resolve(directory) + path2.sep;
|
|
164
|
+
const pathOk = process.platform === "win32" ? normalized.toLowerCase().startsWith(baseDir.toLowerCase()) : normalized.startsWith(baseDir);
|
|
165
|
+
if (!pathOk) {
|
|
166
|
+
throw new Error("Invalid file path: path traversal not allowed");
|
|
167
|
+
}
|
|
168
|
+
const pathForHash = process.platform === "win32" ? normalized.toLowerCase() : normalized;
|
|
169
|
+
const hash = crypto.createHash("sha256").update(pathForHash).digest("hex");
|
|
170
|
+
const lockPath = path2.join(directory, LOCKS_DIR, `${hash}.lock`);
|
|
171
|
+
const legacyPaths = [pathForHash];
|
|
172
|
+
if (process.platform === "win32" && normalized !== pathForHash) {
|
|
173
|
+
legacyPaths.push(normalized);
|
|
174
|
+
}
|
|
175
|
+
for (const legacyPath of legacyPaths) {
|
|
176
|
+
const oldHash = Buffer.from(legacyPath).toString("base64").replace(/[/+=]/g, "_");
|
|
177
|
+
const oldLockPath = path2.join(directory, LOCKS_DIR, `${oldHash}.lock`);
|
|
178
|
+
if (fs2.existsSync(oldLockPath)) {
|
|
179
|
+
return oldLockPath;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return lockPath;
|
|
183
|
+
}
|
|
184
|
+
async function tryAcquireLock(directory, filePath, agent, taskId) {
|
|
185
|
+
const lockPath = getLockFilePath(directory, filePath);
|
|
186
|
+
const locksDir = path2.dirname(lockPath);
|
|
187
|
+
if (!fs2.existsSync(locksDir)) {
|
|
188
|
+
fs2.mkdirSync(locksDir, { recursive: true });
|
|
189
|
+
}
|
|
190
|
+
if (!fs2.existsSync(lockPath)) {
|
|
191
|
+
fs2.writeFileSync(lockPath, "", "utf-8");
|
|
192
|
+
}
|
|
193
|
+
let release;
|
|
194
|
+
try {
|
|
195
|
+
release = await import_proper_lockfile.default.lock(lockPath, {
|
|
196
|
+
stale: LOCK_TIMEOUT_MS,
|
|
197
|
+
retries: {
|
|
198
|
+
retries: 5,
|
|
199
|
+
minTimeout: 10,
|
|
200
|
+
maxTimeout: 500,
|
|
201
|
+
factor: 2
|
|
202
|
+
},
|
|
203
|
+
realpath: false
|
|
204
|
+
});
|
|
205
|
+
} catch (err) {
|
|
206
|
+
const code = err.code;
|
|
207
|
+
if (code === "ELOCKED" || code === "EEXIST") {
|
|
208
|
+
return { acquired: false };
|
|
209
|
+
}
|
|
210
|
+
throw err;
|
|
211
|
+
}
|
|
212
|
+
const lock = {
|
|
213
|
+
filePath,
|
|
214
|
+
agent,
|
|
215
|
+
taskId,
|
|
216
|
+
timestamp: new Date().toISOString(),
|
|
217
|
+
expiresAt: Date.now() + LOCK_TIMEOUT_MS,
|
|
218
|
+
_release: release
|
|
219
|
+
};
|
|
220
|
+
return { acquired: true, lock };
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// src/evidence/lock.ts
|
|
224
|
+
class EvidenceLockTimeoutError extends Error {
|
|
225
|
+
directory;
|
|
226
|
+
evidencePath;
|
|
227
|
+
agent;
|
|
228
|
+
taskId;
|
|
229
|
+
constructor(directory, evidencePath, agent, taskId, timeoutMs) {
|
|
230
|
+
super(`Evidence lock timeout after ${timeoutMs}ms for ${evidencePath} (agent=${agent}, task=${taskId})`);
|
|
231
|
+
this.name = "EvidenceLockTimeoutError";
|
|
232
|
+
this.directory = directory;
|
|
233
|
+
this.evidencePath = evidencePath;
|
|
234
|
+
this.agent = agent;
|
|
235
|
+
this.taskId = taskId;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
var BACKOFF_START_MS = 50;
|
|
239
|
+
var BACKOFF_MAX_MS = 2000;
|
|
240
|
+
var BACKOFF_JITTER_RATIO = 0.25;
|
|
241
|
+
function backoffMs(attempt) {
|
|
242
|
+
const base = Math.min(BACKOFF_START_MS * 2 ** attempt, BACKOFF_MAX_MS);
|
|
243
|
+
const jitter = base * BACKOFF_JITTER_RATIO * (Math.random() * 2 - 1);
|
|
244
|
+
return Math.max(1, Math.round(base + jitter));
|
|
245
|
+
}
|
|
246
|
+
async function withEvidenceLock(directory, evidencePath, agent, taskId, fn, timeoutMs = 60000) {
|
|
247
|
+
assertProjectRoot(directory);
|
|
248
|
+
const deadline = Date.now() + timeoutMs;
|
|
249
|
+
let attempt = 0;
|
|
250
|
+
while (true) {
|
|
251
|
+
const result = await tryAcquireLock(directory, evidencePath, agent, taskId);
|
|
252
|
+
if (result.acquired) {
|
|
253
|
+
const lock = result.lock;
|
|
254
|
+
if (attempt > 0) {
|
|
255
|
+
emit("evidence_lock_stale_recovered", {
|
|
256
|
+
directory,
|
|
257
|
+
evidencePath,
|
|
258
|
+
agent,
|
|
259
|
+
taskId,
|
|
260
|
+
attempt
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
emit("evidence_lock_acquired", {
|
|
264
|
+
directory,
|
|
265
|
+
evidencePath,
|
|
266
|
+
agent,
|
|
267
|
+
taskId,
|
|
268
|
+
attempt
|
|
269
|
+
});
|
|
270
|
+
try {
|
|
271
|
+
return await fn();
|
|
272
|
+
} finally {
|
|
273
|
+
if (lock._release) {
|
|
274
|
+
try {
|
|
275
|
+
await lock._release();
|
|
276
|
+
} catch {}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
if (Date.now() >= deadline) {
|
|
281
|
+
throw new EvidenceLockTimeoutError(directory, evidencePath, agent, taskId, timeoutMs);
|
|
282
|
+
}
|
|
283
|
+
emit("evidence_lock_contended", {
|
|
284
|
+
directory,
|
|
285
|
+
evidencePath,
|
|
286
|
+
agent,
|
|
287
|
+
taskId,
|
|
288
|
+
attempt
|
|
289
|
+
});
|
|
290
|
+
const delay = Math.min(backoffMs(attempt), deadline - Date.now());
|
|
291
|
+
if (delay > 0) {
|
|
292
|
+
await new Promise((resolve3) => setTimeout(resolve3, delay));
|
|
293
|
+
}
|
|
294
|
+
attempt++;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export { tryAcquireLock, hasExplicitProjectBoundary, isStrictPathDescendant, assertProjectRoot, withEvidenceLock };
|
|
@@ -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,15 +10,11 @@ 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-5s23pfsy.js";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_WORKTREE_ISOLATION_CONFIG,
|
|
16
16
|
init_constants
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-4wjk296r.js";
|
|
18
18
|
import {
|
|
19
19
|
MAX_MERGE_DEPTH,
|
|
20
20
|
deepMerge,
|
|
@@ -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 };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-gfmrw2f5.js";
|
|
5
5
|
import {
|
|
6
6
|
handleGuardrailLog
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-xb1zq933.js";
|
|
8
8
|
import {
|
|
9
9
|
COMMAND_REGISTRY,
|
|
10
10
|
SWARM_COMMAND_TOOL_ALLOWLIST,
|
|
@@ -84,67 +84,67 @@ import {
|
|
|
84
84
|
handleWriteRetroCommand,
|
|
85
85
|
normalizeSwarmCommandInput,
|
|
86
86
|
resolveCommand
|
|
87
|
-
} from "./index-
|
|
88
|
-
import"./index-
|
|
89
|
-
import"./index-
|
|
90
|
-
import"./index-
|
|
91
|
-
import"./index-
|
|
92
|
-
import"./index-
|
|
93
|
-
import"./index-
|
|
87
|
+
} from "./index-vyqd1hzm.js";
|
|
88
|
+
import"./index-41hkt36g.js";
|
|
89
|
+
import"./index-sd657fkp.js";
|
|
90
|
+
import"./index-ejbcpbzp.js";
|
|
91
|
+
import"./index-e1k9vpqn.js";
|
|
92
|
+
import"./index-6nzmp937.js";
|
|
93
|
+
import"./index-nrx08gcr.js";
|
|
94
94
|
import"./index-y8552snf.js";
|
|
95
95
|
import"./index-4905hd2m.js";
|
|
96
96
|
import"./index-134d35c1.js";
|
|
97
|
-
import"./index-
|
|
98
|
-
import"./index-
|
|
99
|
-
import"./index-
|
|
97
|
+
import"./index-pg84msyc.js";
|
|
98
|
+
import"./index-0e95eck5.js";
|
|
99
|
+
import"./index-9cdj4020.js";
|
|
100
100
|
import"./index-6mjf4vr1.js";
|
|
101
101
|
import"./index-c8s9a3zh.js";
|
|
102
102
|
import"./index-9ss2m4rs.js";
|
|
103
|
-
import"./index-
|
|
104
|
-
import"./index-
|
|
105
|
-
import"./index-
|
|
106
|
-
import"./index-
|
|
103
|
+
import"./index-0xkjhgrf.js";
|
|
104
|
+
import"./index-xmhhhjjw.js";
|
|
105
|
+
import"./index-556ja8an.js";
|
|
106
|
+
import"./index-6rxgb5r9.js";
|
|
107
|
+
import"./index-1kyex7z2.js";
|
|
108
|
+
import"./index-b8zgtz81.js";
|
|
109
|
+
import"./index-6z0a940s.js";
|
|
110
|
+
import"./index-j77frjq8.js";
|
|
111
|
+
import"./index-k46me75h.js";
|
|
112
|
+
import"./index-ee3x66a5.js";
|
|
113
|
+
import"./index-74hpm6sh.js";
|
|
114
|
+
import"./index-5z2xps64.js";
|
|
115
|
+
import"./index-8fwhhayc.js";
|
|
116
|
+
import"./index-q1exe2b3.js";
|
|
117
|
+
import"./index-jnfyxeap.js";
|
|
118
|
+
import"./index-5azdnaty.js";
|
|
107
119
|
import"./index-rtry5xyf.js";
|
|
108
|
-
import"./index-
|
|
109
|
-
import"./index-
|
|
120
|
+
import"./index-6vh6vrnk.js";
|
|
121
|
+
import"./index-k41dn8me.js";
|
|
110
122
|
import"./index-ae75rja9.js";
|
|
111
|
-
import"./index-
|
|
112
|
-
import"./index-
|
|
113
|
-
import"./index-
|
|
123
|
+
import"./index-33skgk1a.js";
|
|
124
|
+
import"./index-6r522srn.js";
|
|
125
|
+
import"./index-ed5ykebp.js";
|
|
126
|
+
import"./index-s0qc4gj6.js";
|
|
127
|
+
import"./index-7g4c7s5r.js";
|
|
128
|
+
import"./index-4nt52yr9.js";
|
|
129
|
+
import"./index-s58vghgj.js";
|
|
114
130
|
import"./index-gprxjmm7.js";
|
|
115
131
|
import"./index-n832052r.js";
|
|
132
|
+
import"./index-1kz6da87.js";
|
|
133
|
+
import"./index-4rhhvd1a.js";
|
|
134
|
+
import"./index-zgwm4ryv.js";
|
|
116
135
|
import {
|
|
117
136
|
init_schema,
|
|
118
137
|
stripKnownSwarmPrefix
|
|
119
|
-
} from "./index-
|
|
120
|
-
import"./index-bk5tah7q.js";
|
|
121
|
-
import"./index-8fwhhayc.js";
|
|
122
|
-
import"./index-q1exe2b3.js";
|
|
123
|
-
import"./index-5zyk8qgv.js";
|
|
124
|
-
import"./index-3eddtgxt.js";
|
|
125
|
-
import"./index-556ja8an.js";
|
|
126
|
-
import"./index-4xbyy6aw.js";
|
|
127
|
-
import"./index-1kz6da87.js";
|
|
128
|
-
import"./index-q7ezzgwq.js";
|
|
129
|
-
import"./index-b8zgtz81.js";
|
|
130
|
-
import"./index-a12906mj.js";
|
|
131
|
-
import"./index-4rhhvd1a.js";
|
|
138
|
+
} from "./index-5s23pfsy.js";
|
|
132
139
|
import {
|
|
133
140
|
AGENT_TOOL_MAP,
|
|
134
141
|
ORCHESTRATOR_NAME,
|
|
135
142
|
init_constants
|
|
136
|
-
} from "./index-
|
|
137
|
-
import"./index-prmb5qfp.js";
|
|
138
|
-
import"./index-x9q4bbhd.js";
|
|
139
|
-
import"./index-ed5ykebp.js";
|
|
140
|
-
import"./index-5j6chvj8.js";
|
|
141
|
-
import"./index-7g4c7s5r.js";
|
|
142
|
-
import"./index-a5eba0t8.js";
|
|
143
|
-
import"./index-bpmtbmy9.js";
|
|
144
|
-
import"./index-z6xqpmqg.js";
|
|
143
|
+
} from "./index-4wjk296r.js";
|
|
145
144
|
import"./index-zjygnfay.js";
|
|
146
|
-
import"./index-
|
|
147
|
-
import"./index-
|
|
145
|
+
import"./index-bk5tah7q.js";
|
|
146
|
+
import"./index-rsrx77fg.js";
|
|
147
|
+
import"./index-bpmtbmy9.js";
|
|
148
148
|
import"./index-a76rekgs.js";
|
|
149
149
|
|
|
150
150
|
// src/commands/index.ts
|