opencode-swarm 7.50.2 → 7.50.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/dist/cli/index.js +12 -3
- package/dist/index.js +138 -103
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -52,7 +52,7 @@ var package_default;
|
|
|
52
52
|
var init_package = __esm(() => {
|
|
53
53
|
package_default = {
|
|
54
54
|
name: "opencode-swarm",
|
|
55
|
-
version: "7.50.
|
|
55
|
+
version: "7.50.4",
|
|
56
56
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
57
57
|
main: "dist/index.js",
|
|
58
58
|
types: "dist/index.d.ts",
|
|
@@ -21701,8 +21701,9 @@ var init_guardrails = __esm(() => {
|
|
|
21701
21701
|
function clearPendingCoderScope() {
|
|
21702
21702
|
pendingCoderScopeByTaskId.clear();
|
|
21703
21703
|
}
|
|
21704
|
-
var pendingCoderScopeByTaskId, ACTIVE_PARALLEL_TASK_STATES;
|
|
21704
|
+
var EvidenceTaskIdPlanSchema, pendingCoderScopeByTaskId, ACTIVE_PARALLEL_TASK_STATES;
|
|
21705
21705
|
var init_delegation_gate = __esm(() => {
|
|
21706
|
+
init_zod();
|
|
21706
21707
|
init_schema();
|
|
21707
21708
|
init_manager();
|
|
21708
21709
|
init_state();
|
|
@@ -21712,6 +21713,14 @@ var init_delegation_gate = __esm(() => {
|
|
|
21712
21713
|
init_guardrails();
|
|
21713
21714
|
init_normalize_tool_name();
|
|
21714
21715
|
init_utils2();
|
|
21716
|
+
EvidenceTaskIdPlanSchema = exports_external.object({
|
|
21717
|
+
phases: exports_external.array(exports_external.object({
|
|
21718
|
+
tasks: exports_external.array(exports_external.object({
|
|
21719
|
+
id: exports_external.string(),
|
|
21720
|
+
status: exports_external.string().optional()
|
|
21721
|
+
}).passthrough()).optional()
|
|
21722
|
+
}).passthrough()).optional()
|
|
21723
|
+
}).passthrough();
|
|
21715
21724
|
pendingCoderScopeByTaskId = new Map;
|
|
21716
21725
|
ACTIVE_PARALLEL_TASK_STATES = new Set([
|
|
21717
21726
|
"coder_delegated",
|
|
@@ -40477,7 +40486,7 @@ function getPluginLockFilePaths() {
|
|
|
40477
40486
|
var init_cache_paths = () => {};
|
|
40478
40487
|
|
|
40479
40488
|
// src/gate-evidence.ts
|
|
40480
|
-
import { mkdirSync as mkdirSync8, readFileSync as readFileSync7 } from "fs";
|
|
40489
|
+
import { mkdirSync as mkdirSync8, readFileSync as readFileSync7, realpathSync as realpathSync3 } from "fs";
|
|
40481
40490
|
function isValidTaskId(taskId) {
|
|
40482
40491
|
return isStrictTaskId(taskId);
|
|
40483
40492
|
}
|
package/dist/index.js
CHANGED
|
@@ -69,7 +69,7 @@ var package_default;
|
|
|
69
69
|
var init_package = __esm(() => {
|
|
70
70
|
package_default = {
|
|
71
71
|
name: "opencode-swarm",
|
|
72
|
-
version: "7.50.
|
|
72
|
+
version: "7.50.4",
|
|
73
73
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
74
74
|
main: "dist/index.js",
|
|
75
75
|
types: "dist/index.d.ts",
|
|
@@ -40402,7 +40402,7 @@ __export(exports_gate_evidence, {
|
|
|
40402
40402
|
deriveRequiredGates: () => deriveRequiredGates,
|
|
40403
40403
|
DEFAULT_REQUIRED_GATES: () => DEFAULT_REQUIRED_GATES
|
|
40404
40404
|
});
|
|
40405
|
-
import { mkdirSync as mkdirSync8, readFileSync as readFileSync5 } from "node:fs";
|
|
40405
|
+
import { mkdirSync as mkdirSync8, readFileSync as readFileSync5, realpathSync as realpathSync5 } from "node:fs";
|
|
40406
40406
|
import * as path18 from "node:path";
|
|
40407
40407
|
function isValidTaskId(taskId) {
|
|
40408
40408
|
return isStrictTaskId(taskId);
|
|
@@ -40438,7 +40438,23 @@ function expandRequiredGates(existingGates, newAgentType) {
|
|
|
40438
40438
|
return combined.sort();
|
|
40439
40439
|
}
|
|
40440
40440
|
function getEvidenceDir(directory) {
|
|
40441
|
-
|
|
40441
|
+
const swarmDir = path18.resolve(directory, ".swarm");
|
|
40442
|
+
const evidenceDir = path18.join(swarmDir, "evidence");
|
|
40443
|
+
mkdirSync8(evidenceDir, { recursive: true });
|
|
40444
|
+
let resolvedSwarmDir;
|
|
40445
|
+
let resolvedEvidenceDir;
|
|
40446
|
+
try {
|
|
40447
|
+
resolvedSwarmDir = path18.normalize(realpathSync5(swarmDir));
|
|
40448
|
+
resolvedEvidenceDir = path18.normalize(realpathSync5(evidenceDir));
|
|
40449
|
+
} catch (error49) {
|
|
40450
|
+
throw new Error(`Unable to resolve evidence directory: ${error49.message}`);
|
|
40451
|
+
}
|
|
40452
|
+
const swarmPrefix = `${resolvedSwarmDir}${path18.sep}`;
|
|
40453
|
+
const withinSwarmBoundary = process.platform === "win32" ? resolvedEvidenceDir.toLowerCase().startsWith(swarmPrefix.toLowerCase()) : resolvedEvidenceDir.startsWith(swarmPrefix);
|
|
40454
|
+
if (!withinSwarmBoundary) {
|
|
40455
|
+
throw new Error(`Evidence path escapes .swarm boundary: ${resolvedEvidenceDir}`);
|
|
40456
|
+
}
|
|
40457
|
+
return resolvedEvidenceDir;
|
|
40442
40458
|
}
|
|
40443
40459
|
function getEvidencePath(directory, taskId) {
|
|
40444
40460
|
assertValidTaskId(taskId);
|
|
@@ -40457,10 +40473,9 @@ function readExisting(evidencePath, taskId) {
|
|
|
40457
40473
|
}
|
|
40458
40474
|
async function recordGateEvidence(directory, taskId, gate, sessionId, turbo) {
|
|
40459
40475
|
assertValidTaskId(taskId);
|
|
40460
|
-
const evidenceDir = getEvidenceDir(directory);
|
|
40461
|
-
mkdirSync8(evidenceDir, { recursive: true });
|
|
40462
40476
|
await withTaskEvidenceLock(directory, taskId, gate, async () => {
|
|
40463
|
-
const
|
|
40477
|
+
const resolvedEvidenceDir = getEvidenceDir(directory);
|
|
40478
|
+
const evidencePath = path18.join(resolvedEvidenceDir, `${taskId}.json`);
|
|
40464
40479
|
let existing = null;
|
|
40465
40480
|
try {
|
|
40466
40481
|
existing = readExisting(evidencePath, taskId);
|
|
@@ -40488,10 +40503,9 @@ async function recordGateEvidence(directory, taskId, gate, sessionId, turbo) {
|
|
|
40488
40503
|
}
|
|
40489
40504
|
async function recordAgentDispatch(directory, taskId, agentType, turbo) {
|
|
40490
40505
|
assertValidTaskId(taskId);
|
|
40491
|
-
const evidenceDir = getEvidenceDir(directory);
|
|
40492
|
-
mkdirSync8(evidenceDir, { recursive: true });
|
|
40493
40506
|
await withTaskEvidenceLock(directory, taskId, agentType, async () => {
|
|
40494
|
-
const
|
|
40507
|
+
const resolvedEvidenceDir = getEvidenceDir(directory);
|
|
40508
|
+
const evidencePath = path18.join(resolvedEvidenceDir, `${taskId}.json`);
|
|
40495
40509
|
let existing = null;
|
|
40496
40510
|
try {
|
|
40497
40511
|
existing = readExisting(evidencePath, taskId);
|
|
@@ -40714,6 +40728,7 @@ function isParallelGuidancePhaseComplete(phase) {
|
|
|
40714
40728
|
return phase.status === "complete" || phase.status === "completed" || phase.status === "closed";
|
|
40715
40729
|
}
|
|
40716
40730
|
async function getEvidenceTaskId(session, directory) {
|
|
40731
|
+
let resolvedPlanPath;
|
|
40717
40732
|
const primary = session.currentTaskId ?? session.lastCoderDelegationTaskId;
|
|
40718
40733
|
if (primary)
|
|
40719
40734
|
return primary;
|
|
@@ -40726,12 +40741,12 @@ async function getEvidenceTaskId(session, directory) {
|
|
|
40726
40741
|
}
|
|
40727
40742
|
const resolvedDirectory = path19.resolve(directory);
|
|
40728
40743
|
const planPath = path19.join(resolvedDirectory, ".swarm", "plan.json");
|
|
40729
|
-
|
|
40744
|
+
resolvedPlanPath = path19.resolve(planPath);
|
|
40730
40745
|
if (!resolvedPlanPath.startsWith(resolvedDirectory + path19.sep) && resolvedPlanPath !== resolvedDirectory) {
|
|
40731
40746
|
return null;
|
|
40732
40747
|
}
|
|
40733
40748
|
const planContent = await fs12.promises.readFile(resolvedPlanPath, "utf-8");
|
|
40734
|
-
const plan = JSON.parse(planContent);
|
|
40749
|
+
const plan = EvidenceTaskIdPlanSchema.parse(JSON.parse(planContent));
|
|
40735
40750
|
if (!plan || !Array.isArray(plan.phases)) {
|
|
40736
40751
|
return null;
|
|
40737
40752
|
}
|
|
@@ -40745,6 +40760,11 @@ async function getEvidenceTaskId(session, directory) {
|
|
|
40745
40760
|
}
|
|
40746
40761
|
}
|
|
40747
40762
|
} catch (err2) {
|
|
40763
|
+
if (err2 instanceof ZodError) {
|
|
40764
|
+
const issueSummary = err2.issues.slice(0, 3).map((issue2) => issue2.message).join("; ");
|
|
40765
|
+
warn(`[delegation-gate] getEvidenceTaskId ignored invalid plan schema at ${resolvedPlanPath ?? "unknown path"}: ${issueSummary}`);
|
|
40766
|
+
return null;
|
|
40767
|
+
}
|
|
40748
40768
|
if (process.env.DEBUG_SWARM && err2 instanceof Error) {
|
|
40749
40769
|
warn(`[delegation-gate] getEvidenceTaskId error: ${err2.message} (code=${err2.code ?? "none"})`);
|
|
40750
40770
|
}
|
|
@@ -41391,8 +41411,9 @@ ${warningLines.join(`
|
|
|
41391
41411
|
toolAfter
|
|
41392
41412
|
};
|
|
41393
41413
|
}
|
|
41394
|
-
var pendingCoderScopeByTaskId, ACTIVE_PARALLEL_TASK_STATES;
|
|
41414
|
+
var EvidenceTaskIdPlanSchema, pendingCoderScopeByTaskId, ACTIVE_PARALLEL_TASK_STATES;
|
|
41395
41415
|
var init_delegation_gate = __esm(() => {
|
|
41416
|
+
init_zod();
|
|
41396
41417
|
init_schema();
|
|
41397
41418
|
init_manager();
|
|
41398
41419
|
init_state();
|
|
@@ -41402,6 +41423,14 @@ var init_delegation_gate = __esm(() => {
|
|
|
41402
41423
|
init_guardrails();
|
|
41403
41424
|
init_normalize_tool_name();
|
|
41404
41425
|
init_utils2();
|
|
41426
|
+
EvidenceTaskIdPlanSchema = exports_external.object({
|
|
41427
|
+
phases: exports_external.array(exports_external.object({
|
|
41428
|
+
tasks: exports_external.array(exports_external.object({
|
|
41429
|
+
id: exports_external.string(),
|
|
41430
|
+
status: exports_external.string().optional()
|
|
41431
|
+
}).passthrough()).optional()
|
|
41432
|
+
}).passthrough()).optional()
|
|
41433
|
+
}).passthrough();
|
|
41405
41434
|
pendingCoderScopeByTaskId = new Map;
|
|
41406
41435
|
ACTIVE_PARALLEL_TASK_STATES = new Set([
|
|
41407
41436
|
"coder_delegated",
|
|
@@ -56868,12 +56897,12 @@ async function appendRejectedLesson(directory, lesson) {
|
|
|
56868
56897
|
await appendKnowledge(filePath, lesson);
|
|
56869
56898
|
}
|
|
56870
56899
|
}
|
|
56871
|
-
function
|
|
56900
|
+
function normalize4(text) {
|
|
56872
56901
|
const s = typeof text === "string" ? text : String(text ?? "");
|
|
56873
56902
|
return s.toLowerCase().replace(/[^\w\s]/g, " ").replace(/\s+/g, " ").trim();
|
|
56874
56903
|
}
|
|
56875
56904
|
function wordBigrams(text) {
|
|
56876
|
-
const words =
|
|
56905
|
+
const words = normalize4(text).split(" ").filter(Boolean);
|
|
56877
56906
|
const bigrams = new Set;
|
|
56878
56907
|
for (let i2 = 0;i2 < words.length - 1; i2++) {
|
|
56879
56908
|
bigrams.add(`${words[i2]} ${words[i2 + 1]}`);
|
|
@@ -59936,11 +59965,11 @@ async function processRetractions(retractions, directory) {
|
|
|
59936
59965
|
const existingRetractions = await readRetractionRecords(directory);
|
|
59937
59966
|
const existingSuppressedLessons = new Set(existingRetractions.map((record3) => record3.normalized_lesson).filter((value) => typeof value === "string" && value.length > 0));
|
|
59938
59967
|
for (const retractionText of retractions) {
|
|
59939
|
-
const normalizedRetraction =
|
|
59968
|
+
const normalizedRetraction = normalize4(retractionText);
|
|
59940
59969
|
const matchedSwarmIds = [];
|
|
59941
59970
|
const matchedHiveIds = [];
|
|
59942
59971
|
for (const entry of swarmEntries) {
|
|
59943
|
-
const normalizedLesson =
|
|
59972
|
+
const normalizedLesson = normalize4(entry.lesson);
|
|
59944
59973
|
if (normalizedLesson === normalizedRetraction) {
|
|
59945
59974
|
matchedSwarmIds.push(entry.id);
|
|
59946
59975
|
await quarantineEntry(directory, entry.id, `Retracted by architect: ${retractionText}`, "architect");
|
|
@@ -59948,7 +59977,7 @@ async function processRetractions(retractions, directory) {
|
|
|
59948
59977
|
}
|
|
59949
59978
|
}
|
|
59950
59979
|
for (const entry of hiveEntries) {
|
|
59951
|
-
if (
|
|
59980
|
+
if (normalize4(entry.lesson) === normalizedRetraction) {
|
|
59952
59981
|
matchedHiveIds.push(entry.id);
|
|
59953
59982
|
}
|
|
59954
59983
|
}
|
|
@@ -68392,7 +68421,7 @@ function parseContextMd(content) {
|
|
|
68392
68421
|
for (const bullet of bullets) {
|
|
68393
68422
|
if (bullet.length < 15)
|
|
68394
68423
|
continue;
|
|
68395
|
-
const normalized =
|
|
68424
|
+
const normalized = normalize4(bullet);
|
|
68396
68425
|
if (seen.has(normalized))
|
|
68397
68426
|
continue;
|
|
68398
68427
|
seen.add(normalized);
|
|
@@ -73602,7 +73631,7 @@ async function _detectAvailableLinter(_projectDir, biomeBin, eslintBin) {
|
|
|
73602
73631
|
stderr: "pipe"
|
|
73603
73632
|
});
|
|
73604
73633
|
const biomeExit = biomeProc.exited;
|
|
73605
|
-
const timeout = new Promise((
|
|
73634
|
+
const timeout = new Promise((resolve18) => setTimeout(() => resolve18("timeout"), DETECT_TIMEOUT));
|
|
73606
73635
|
const result = await Promise.race([biomeExit, timeout]);
|
|
73607
73636
|
if (result === "timeout") {
|
|
73608
73637
|
biomeProc.kill();
|
|
@@ -73616,7 +73645,7 @@ async function _detectAvailableLinter(_projectDir, biomeBin, eslintBin) {
|
|
|
73616
73645
|
stderr: "pipe"
|
|
73617
73646
|
});
|
|
73618
73647
|
const eslintExit = eslintProc.exited;
|
|
73619
|
-
const timeout = new Promise((
|
|
73648
|
+
const timeout = new Promise((resolve18) => setTimeout(() => resolve18("timeout"), DETECT_TIMEOUT));
|
|
73620
73649
|
const result = await Promise.race([eslintExit, timeout]);
|
|
73621
73650
|
if (result === "timeout") {
|
|
73622
73651
|
eslintProc.kill();
|
|
@@ -77641,9 +77670,9 @@ async function runTests(framework, scope, files, coverage, timeout_ms, cwd) {
|
|
|
77641
77670
|
stderr: "pipe",
|
|
77642
77671
|
cwd
|
|
77643
77672
|
});
|
|
77644
|
-
const timeoutPromise = new Promise((
|
|
77673
|
+
const timeoutPromise = new Promise((resolve22) => setTimeout(() => {
|
|
77645
77674
|
proc.kill();
|
|
77646
|
-
|
|
77675
|
+
resolve22(-1);
|
|
77647
77676
|
}, timeout_ms));
|
|
77648
77677
|
const [exitCode, stdoutResult, stderrResult] = await Promise.all([
|
|
77649
77678
|
Promise.race([proc.exited, timeoutPromise]),
|
|
@@ -79190,13 +79219,13 @@ class CircuitBreaker {
|
|
|
79190
79219
|
if (this.config.callTimeoutMs <= 0) {
|
|
79191
79220
|
return fn2();
|
|
79192
79221
|
}
|
|
79193
|
-
return new Promise((
|
|
79222
|
+
return new Promise((resolve23, reject) => {
|
|
79194
79223
|
const timeout = setTimeout(() => {
|
|
79195
79224
|
reject(new Error(`Call timeout after ${this.config.callTimeoutMs}ms`));
|
|
79196
79225
|
}, this.config.callTimeoutMs);
|
|
79197
79226
|
fn2().then((result) => {
|
|
79198
79227
|
clearTimeout(timeout);
|
|
79199
|
-
|
|
79228
|
+
resolve23(result);
|
|
79200
79229
|
}).catch((error93) => {
|
|
79201
79230
|
clearTimeout(timeout);
|
|
79202
79231
|
reject(error93);
|
|
@@ -79483,7 +79512,7 @@ var init_queue = __esm(() => {
|
|
|
79483
79512
|
|
|
79484
79513
|
// src/background/worker.ts
|
|
79485
79514
|
function sleep(ms) {
|
|
79486
|
-
return new Promise((
|
|
79515
|
+
return new Promise((resolve23) => setTimeout(resolve23, ms));
|
|
79487
79516
|
}
|
|
79488
79517
|
|
|
79489
79518
|
class WorkerManager {
|
|
@@ -86843,9 +86872,9 @@ function validateFilename(filename) {
|
|
|
86843
86872
|
throw new Error("Invalid filename: contains null byte");
|
|
86844
86873
|
}
|
|
86845
86874
|
const pathSeparators = ["/", "\\", ".."];
|
|
86846
|
-
for (const
|
|
86847
|
-
if (filename.includes(
|
|
86848
|
-
throw new Error(`Invalid filename: contains path separator '${
|
|
86875
|
+
for (const sep10 of pathSeparators) {
|
|
86876
|
+
if (filename.includes(sep10)) {
|
|
86877
|
+
throw new Error(`Invalid filename: contains path separator '${sep10}'`);
|
|
86849
86878
|
}
|
|
86850
86879
|
}
|
|
86851
86880
|
if (filename.startsWith("/") || filename.startsWith("\\") || /^[a-zA-Z]:/.test(filename)) {
|
|
@@ -89263,8 +89292,8 @@ ${JSON.stringify(symbolNames, null, 2)}`);
|
|
|
89263
89292
|
var moduleRtn;
|
|
89264
89293
|
var Module = moduleArg;
|
|
89265
89294
|
var readyPromiseResolve, readyPromiseReject;
|
|
89266
|
-
var readyPromise = new Promise((
|
|
89267
|
-
readyPromiseResolve =
|
|
89295
|
+
var readyPromise = new Promise((resolve31, reject) => {
|
|
89296
|
+
readyPromiseResolve = resolve31;
|
|
89268
89297
|
readyPromiseReject = reject;
|
|
89269
89298
|
});
|
|
89270
89299
|
var ENVIRONMENT_IS_WEB = typeof window == "object";
|
|
@@ -89344,13 +89373,13 @@ ${JSON.stringify(symbolNames, null, 2)}`);
|
|
|
89344
89373
|
}
|
|
89345
89374
|
readAsync = /* @__PURE__ */ __name(async (url3) => {
|
|
89346
89375
|
if (isFileURI(url3)) {
|
|
89347
|
-
return new Promise((
|
|
89376
|
+
return new Promise((resolve31, reject) => {
|
|
89348
89377
|
var xhr = new XMLHttpRequest;
|
|
89349
89378
|
xhr.open("GET", url3, true);
|
|
89350
89379
|
xhr.responseType = "arraybuffer";
|
|
89351
89380
|
xhr.onload = () => {
|
|
89352
89381
|
if (xhr.status == 200 || xhr.status == 0 && xhr.response) {
|
|
89353
|
-
|
|
89382
|
+
resolve31(xhr.response);
|
|
89354
89383
|
return;
|
|
89355
89384
|
}
|
|
89356
89385
|
reject(xhr.status);
|
|
@@ -89570,10 +89599,10 @@ ${JSON.stringify(symbolNames, null, 2)}`);
|
|
|
89570
89599
|
__name(receiveInstantiationResult, "receiveInstantiationResult");
|
|
89571
89600
|
var info2 = getWasmImports();
|
|
89572
89601
|
if (Module["instantiateWasm"]) {
|
|
89573
|
-
return new Promise((
|
|
89602
|
+
return new Promise((resolve31, reject) => {
|
|
89574
89603
|
Module["instantiateWasm"](info2, (mod, inst) => {
|
|
89575
89604
|
receiveInstance(mod, inst);
|
|
89576
|
-
|
|
89605
|
+
resolve31(mod.exports);
|
|
89577
89606
|
});
|
|
89578
89607
|
});
|
|
89579
89608
|
}
|
|
@@ -91449,13 +91478,13 @@ async function extractDocConstraints(directory, taskFiles, taskDescription) {
|
|
|
91449
91478
|
const knowledgePath = resolveSwarmKnowledgePath(directory);
|
|
91450
91479
|
const existingEntries = await readKnowledge(knowledgePath);
|
|
91451
91480
|
const taskContext = [...taskFiles, taskDescription].join(" ");
|
|
91452
|
-
const taskBigrams = wordBigrams(
|
|
91481
|
+
const taskBigrams = wordBigrams(normalize4(taskContext));
|
|
91453
91482
|
let extractedCount = 0;
|
|
91454
91483
|
let skippedCount = 0;
|
|
91455
91484
|
const details = [];
|
|
91456
91485
|
for (const docFile of manifest.files) {
|
|
91457
91486
|
const docContext = `${docFile.path} ${docFile.title} ${docFile.summary}`;
|
|
91458
|
-
const docBigrams = wordBigrams(
|
|
91487
|
+
const docBigrams = wordBigrams(normalize4(docContext));
|
|
91459
91488
|
const score = jaccardBigram(taskBigrams, docBigrams);
|
|
91460
91489
|
if (score <= RELEVANCE_THRESHOLD) {
|
|
91461
91490
|
skippedCount++;
|
|
@@ -91686,7 +91715,7 @@ async function readMergedKnowledge(directory, config3, context, opts) {
|
|
|
91686
91715
|
const seenLessons = new Set;
|
|
91687
91716
|
const merged = [];
|
|
91688
91717
|
for (const entry of hiveEntries) {
|
|
91689
|
-
const normalized =
|
|
91718
|
+
const normalized = normalize4(entry.lesson);
|
|
91690
91719
|
seenLessons.add(normalized);
|
|
91691
91720
|
merged.push({
|
|
91692
91721
|
...entry,
|
|
@@ -91695,15 +91724,15 @@ async function readMergedKnowledge(directory, config3, context, opts) {
|
|
|
91695
91724
|
});
|
|
91696
91725
|
}
|
|
91697
91726
|
for (const entry of swarmEntries) {
|
|
91698
|
-
const normalized =
|
|
91727
|
+
const normalized = normalize4(entry.lesson);
|
|
91699
91728
|
if (seenLessons.has(normalized)) {
|
|
91700
91729
|
continue;
|
|
91701
91730
|
}
|
|
91702
91731
|
const swarmBigrams = wordBigrams(normalized);
|
|
91703
|
-
const isHiveNearDup = hiveEntries.some((hiveEntry) => jaccardBigram(swarmBigrams, wordBigrams(
|
|
91732
|
+
const isHiveNearDup = hiveEntries.some((hiveEntry) => jaccardBigram(swarmBigrams, wordBigrams(normalize4(hiveEntry.lesson))) >= JACCARD_THRESHOLD2);
|
|
91704
91733
|
if (isHiveNearDup)
|
|
91705
91734
|
continue;
|
|
91706
|
-
const isSwarmNearDup = merged.some((m) => m.tier === "swarm" && jaccardBigram(swarmBigrams, wordBigrams(
|
|
91735
|
+
const isSwarmNearDup = merged.some((m) => m.tier === "swarm" && jaccardBigram(swarmBigrams, wordBigrams(normalize4(m.lesson))) >= JACCARD_THRESHOLD2);
|
|
91707
91736
|
if (isSwarmNearDup)
|
|
91708
91737
|
continue;
|
|
91709
91738
|
seenLessons.add(normalized);
|
|
@@ -91716,7 +91745,7 @@ async function readMergedKnowledge(directory, config3, context, opts) {
|
|
|
91716
91745
|
const retractionRecords = await readRetractionRecords(directory);
|
|
91717
91746
|
const suppressedLessons = new Set(retractionRecords.map((record3) => record3.normalized_lesson).filter((value) => typeof value === "string" && value.length > 0));
|
|
91718
91747
|
const scopeFilter = config3.scope_filter ?? ["global"];
|
|
91719
|
-
const filtered = merged.filter((entry) => (opts?.skipScopeFilter || scopeFilter.some((pattern) => (entry.scope ?? "global") === pattern)) && NORMAL_RETRIEVAL_STATUSES.has(entry.status) && !suppressedLessons.has(
|
|
91748
|
+
const filtered = merged.filter((entry) => (opts?.skipScopeFilter || scopeFilter.some((pattern) => (entry.scope ?? "global") === pattern)) && NORMAL_RETRIEVAL_STATUSES.has(entry.status) && !suppressedLessons.has(normalize4(entry.lesson)));
|
|
91720
91749
|
const ranked = filtered.map((entry) => {
|
|
91721
91750
|
let categoryScore = 0;
|
|
91722
91751
|
if (context?.currentPhase) {
|
|
@@ -91960,14 +91989,14 @@ async function searchKnowledge(params) {
|
|
|
91960
91989
|
});
|
|
91961
91990
|
}
|
|
91962
91991
|
const queryText = (query ?? "").trim();
|
|
91963
|
-
const queryBigrams = queryText ? wordBigrams(
|
|
91992
|
+
const queryBigrams = queryText ? wordBigrams(normalize4(queryText)) : null;
|
|
91964
91993
|
const hasQuery = queryBigrams !== null;
|
|
91965
91994
|
const textWeight = hasQuery ? TEXT_WEIGHT : 0;
|
|
91966
91995
|
const metaWeight = hasQuery ? META_WEIGHT : 1;
|
|
91967
91996
|
const minConf = typeof config3.directive_min_confidence === "number" ? config3.directive_min_confidence : DIRECTIVE_BOOST_MIN_CONFIDENCE;
|
|
91968
91997
|
const scored = candidates.map((entry) => {
|
|
91969
91998
|
const retrievalOutcomes = effectiveRetrievalOutcomes(entry.retrieval_outcomes, counterRollups.get(entry.id));
|
|
91970
|
-
const textScore = queryBigrams ? jaccardBigram(queryBigrams, wordBigrams(
|
|
91999
|
+
const textScore = queryBigrams ? jaccardBigram(queryBigrams, wordBigrams(normalize4(entryText(entry)))) : 0;
|
|
91971
92000
|
const metaScore = entry.finalScore;
|
|
91972
92001
|
const ds = context ? scoreDirectiveAgainstContext(entry, context) : { triggerHit: false, actionHit: false, agentHit: false, score: 0 };
|
|
91973
92002
|
const confBoost = context && entry.confidence >= minConf && (ds.actionHit || ds.agentHit) ? 0.25 : 0;
|
|
@@ -92940,13 +92969,13 @@ class PlanSyncWorker {
|
|
|
92940
92969
|
} catch {}
|
|
92941
92970
|
}
|
|
92942
92971
|
withTimeout(promise3, ms, timeoutMessage) {
|
|
92943
|
-
return new Promise((
|
|
92972
|
+
return new Promise((resolve25, reject) => {
|
|
92944
92973
|
const timer = setTimeout(() => {
|
|
92945
92974
|
reject(new Error(`${timeoutMessage} (${ms}ms)`));
|
|
92946
92975
|
}, ms);
|
|
92947
92976
|
promise3.then((result) => {
|
|
92948
92977
|
clearTimeout(timer);
|
|
92949
|
-
|
|
92978
|
+
resolve25(result);
|
|
92950
92979
|
}).catch((error93) => {
|
|
92951
92980
|
clearTimeout(timer);
|
|
92952
92981
|
reject(error93);
|
|
@@ -95393,7 +95422,7 @@ import * as path85 from "node:path";
|
|
|
95393
95422
|
init_logger();
|
|
95394
95423
|
init_path_security();
|
|
95395
95424
|
import * as fsSync4 from "node:fs";
|
|
95396
|
-
import { existsSync as existsSync47, realpathSync as
|
|
95425
|
+
import { existsSync as existsSync47, realpathSync as realpathSync11 } from "node:fs";
|
|
95397
95426
|
import * as fsPromises5 from "node:fs/promises";
|
|
95398
95427
|
import * as os13 from "node:os";
|
|
95399
95428
|
import * as path81 from "node:path";
|
|
@@ -95415,8 +95444,8 @@ async function withTimeout(promise3, ms, timeoutError) {
|
|
|
95415
95444
|
}
|
|
95416
95445
|
}
|
|
95417
95446
|
function yieldToEventLoop() {
|
|
95418
|
-
return new Promise((
|
|
95419
|
-
const t = setTimeout(
|
|
95447
|
+
return new Promise((resolve25) => {
|
|
95448
|
+
const t = setTimeout(resolve25, 0);
|
|
95420
95449
|
if (typeof t.unref === "function") {
|
|
95421
95450
|
t.unref();
|
|
95422
95451
|
}
|
|
@@ -95757,8 +95786,8 @@ var symbols = createSwarmTool({
|
|
|
95757
95786
|
});
|
|
95758
95787
|
|
|
95759
95788
|
// src/tools/repo-graph/safe-realpath.ts
|
|
95760
|
-
import { realpathSync as
|
|
95761
|
-
function safeRealpathSync(targetPath, fallback, realpathResolver =
|
|
95789
|
+
import { realpathSync as realpathSync10 } from "node:fs";
|
|
95790
|
+
function safeRealpathSync(targetPath, fallback, realpathResolver = realpathSync10) {
|
|
95762
95791
|
try {
|
|
95763
95792
|
return realpathResolver(targetPath);
|
|
95764
95793
|
} catch (error93) {
|
|
@@ -96016,7 +96045,7 @@ function resolveModuleSpecifier(workspaceRoot, sourceFile, specifier) {
|
|
|
96016
96045
|
function isRefusedWorkspaceRoot(target) {
|
|
96017
96046
|
let resolved;
|
|
96018
96047
|
try {
|
|
96019
|
-
resolved =
|
|
96048
|
+
resolved = realpathSync11(target);
|
|
96020
96049
|
} catch {
|
|
96021
96050
|
resolved = path81.resolve(target);
|
|
96022
96051
|
}
|
|
@@ -96485,7 +96514,7 @@ async function saveGraph(workspace, graph, options) {
|
|
|
96485
96514
|
lastError = error93 instanceof Error ? error93 : new Error(String(error93));
|
|
96486
96515
|
if (lastError instanceof Error && "code" in lastError && lastError.code === "EEXIST" && retries < WINDOWS_RENAME_MAX_RETRIES2 - 1) {
|
|
96487
96516
|
retries++;
|
|
96488
|
-
await new Promise((
|
|
96517
|
+
await new Promise((resolve27) => setTimeout(resolve27, WINDOWS_RENAME_RETRY_DELAY_MS2));
|
|
96489
96518
|
continue;
|
|
96490
96519
|
}
|
|
96491
96520
|
throw lastError;
|
|
@@ -97459,26 +97488,26 @@ function pLimit(concurrency) {
|
|
|
97459
97488
|
activeCount--;
|
|
97460
97489
|
resumeNext();
|
|
97461
97490
|
};
|
|
97462
|
-
const run2 = async (function_,
|
|
97491
|
+
const run2 = async (function_, resolve29, arguments_2) => {
|
|
97463
97492
|
const result = (async () => function_(...arguments_2))();
|
|
97464
|
-
|
|
97493
|
+
resolve29(result);
|
|
97465
97494
|
try {
|
|
97466
97495
|
await result;
|
|
97467
97496
|
} catch {}
|
|
97468
97497
|
next();
|
|
97469
97498
|
};
|
|
97470
|
-
const enqueue = (function_,
|
|
97499
|
+
const enqueue = (function_, resolve29, reject, arguments_2) => {
|
|
97471
97500
|
const queueItem = { reject };
|
|
97472
97501
|
new Promise((internalResolve) => {
|
|
97473
97502
|
queueItem.run = internalResolve;
|
|
97474
97503
|
queue.enqueue(queueItem);
|
|
97475
|
-
}).then(run2.bind(undefined, function_,
|
|
97504
|
+
}).then(run2.bind(undefined, function_, resolve29, arguments_2));
|
|
97476
97505
|
if (activeCount < concurrency) {
|
|
97477
97506
|
resumeNext();
|
|
97478
97507
|
}
|
|
97479
97508
|
};
|
|
97480
|
-
const generator = (function_, ...arguments_2) => new Promise((
|
|
97481
|
-
enqueue(function_,
|
|
97509
|
+
const generator = (function_, ...arguments_2) => new Promise((resolve29, reject) => {
|
|
97510
|
+
enqueue(function_, resolve29, reject, arguments_2);
|
|
97482
97511
|
});
|
|
97483
97512
|
Object.defineProperties(generator, {
|
|
97484
97513
|
activeCount: {
|
|
@@ -99340,7 +99369,7 @@ function isGitBinaryMissing(err2) {
|
|
|
99340
99369
|
// src/hooks/semantic-diff-injection.ts
|
|
99341
99370
|
async function execGit(directory, args2, options) {
|
|
99342
99371
|
try {
|
|
99343
|
-
const stdout = await new Promise((
|
|
99372
|
+
const stdout = await new Promise((resolve32, reject) => {
|
|
99344
99373
|
const execOpts = {
|
|
99345
99374
|
encoding: "utf-8",
|
|
99346
99375
|
cwd: directory,
|
|
@@ -99353,7 +99382,7 @@ async function execGit(directory, args2, options) {
|
|
|
99353
99382
|
reject(error93);
|
|
99354
99383
|
return;
|
|
99355
99384
|
}
|
|
99356
|
-
|
|
99385
|
+
resolve32(output ?? "");
|
|
99357
99386
|
});
|
|
99358
99387
|
});
|
|
99359
99388
|
return stdout;
|
|
@@ -102556,7 +102585,7 @@ import * as path98 from "node:path";
|
|
|
102556
102585
|
import * as child_process6 from "node:child_process";
|
|
102557
102586
|
var WIN32_CMD_BINARIES = new Set(["npm", "npx", "pnpm", "yarn"]);
|
|
102558
102587
|
function spawnAsync(command, cwd, timeoutMs) {
|
|
102559
|
-
return new Promise((
|
|
102588
|
+
return new Promise((resolve34) => {
|
|
102560
102589
|
try {
|
|
102561
102590
|
const [rawCmd, ...args2] = command;
|
|
102562
102591
|
const cmd = process.platform === "win32" && WIN32_CMD_BINARIES.has(rawCmd) && !rawCmd.includes(".") ? `${rawCmd}.cmd` : rawCmd;
|
|
@@ -102603,24 +102632,24 @@ function spawnAsync(command, cwd, timeoutMs) {
|
|
|
102603
102632
|
try {
|
|
102604
102633
|
proc.kill();
|
|
102605
102634
|
} catch {}
|
|
102606
|
-
|
|
102635
|
+
resolve34(null);
|
|
102607
102636
|
}, timeoutMs);
|
|
102608
102637
|
proc.on("close", (code) => {
|
|
102609
102638
|
if (done)
|
|
102610
102639
|
return;
|
|
102611
102640
|
done = true;
|
|
102612
102641
|
clearTimeout(timer);
|
|
102613
|
-
|
|
102642
|
+
resolve34({ exitCode: code ?? 1, stdout, stderr });
|
|
102614
102643
|
});
|
|
102615
102644
|
proc.on("error", () => {
|
|
102616
102645
|
if (done)
|
|
102617
102646
|
return;
|
|
102618
102647
|
done = true;
|
|
102619
102648
|
clearTimeout(timer);
|
|
102620
|
-
|
|
102649
|
+
resolve34(null);
|
|
102621
102650
|
});
|
|
102622
102651
|
} catch {
|
|
102623
|
-
|
|
102652
|
+
resolve34(null);
|
|
102624
102653
|
}
|
|
102625
102654
|
});
|
|
102626
102655
|
}
|
|
@@ -106107,7 +106136,7 @@ import {
|
|
|
106107
106136
|
mkdirSync as mkdirSync27,
|
|
106108
106137
|
mkdtempSync as mkdtempSync2,
|
|
106109
106138
|
readFileSync as readFileSync39,
|
|
106110
|
-
realpathSync as
|
|
106139
|
+
realpathSync as realpathSync14,
|
|
106111
106140
|
renameSync as renameSync20,
|
|
106112
106141
|
rmdirSync,
|
|
106113
106142
|
unlinkSync as unlinkSync17,
|
|
@@ -106141,8 +106170,8 @@ function containsStrictControlChars(str) {
|
|
|
106141
106170
|
}
|
|
106142
106171
|
function isCanonicalProtectedPath(targetPath, workspace) {
|
|
106143
106172
|
try {
|
|
106144
|
-
const canonicalTarget =
|
|
106145
|
-
const canonicalWorkspace =
|
|
106173
|
+
const canonicalTarget = realpathSync14(targetPath);
|
|
106174
|
+
const canonicalWorkspace = realpathSync14(workspace);
|
|
106146
106175
|
const relative21 = path109.relative(canonicalWorkspace, canonicalTarget).replace(/\\/g, "/");
|
|
106147
106176
|
const segments = relative21.split("/").filter(Boolean);
|
|
106148
106177
|
return segments.some((seg) => seg === ".git" || seg === ".swarm");
|
|
@@ -106151,8 +106180,8 @@ function isCanonicalProtectedPath(targetPath, workspace) {
|
|
|
106151
106180
|
if (parentDir === targetPath)
|
|
106152
106181
|
return false;
|
|
106153
106182
|
try {
|
|
106154
|
-
const canonicalParent =
|
|
106155
|
-
const canonicalWorkspace =
|
|
106183
|
+
const canonicalParent = realpathSync14(parentDir);
|
|
106184
|
+
const canonicalWorkspace = realpathSync14(workspace);
|
|
106156
106185
|
const relative21 = path109.relative(canonicalWorkspace, canonicalParent).replace(/\\/g, "/");
|
|
106157
106186
|
const segments = relative21.split("/").filter(Boolean);
|
|
106158
106187
|
return segments.some((seg) => seg === ".git" || seg === ".swarm");
|
|
@@ -106163,8 +106192,8 @@ function isCanonicalProtectedPath(targetPath, workspace) {
|
|
|
106163
106192
|
}
|
|
106164
106193
|
function isCanonicalPathWithinWorkspace(targetPath, workspaceRoot) {
|
|
106165
106194
|
try {
|
|
106166
|
-
const canonicalTarget =
|
|
106167
|
-
const canonicalWorkspace =
|
|
106195
|
+
const canonicalTarget = realpathSync14(targetPath);
|
|
106196
|
+
const canonicalWorkspace = realpathSync14(workspaceRoot);
|
|
106168
106197
|
const relative21 = path109.relative(canonicalWorkspace, canonicalTarget);
|
|
106169
106198
|
if (relative21.startsWith("..") || path109.isAbsolute(relative21))
|
|
106170
106199
|
return false;
|
|
@@ -106178,8 +106207,8 @@ function isCanonicalPathWithinWorkspace(targetPath, workspaceRoot) {
|
|
|
106178
106207
|
return false;
|
|
106179
106208
|
}
|
|
106180
106209
|
try {
|
|
106181
|
-
const canonicalParent =
|
|
106182
|
-
const canonicalWorkspace =
|
|
106210
|
+
const canonicalParent = realpathSync14(parentDir);
|
|
106211
|
+
const canonicalWorkspace = realpathSync14(workspaceRoot);
|
|
106183
106212
|
const relative21 = path109.relative(canonicalWorkspace, canonicalParent);
|
|
106184
106213
|
if (relative21.startsWith("..") || path109.isAbsolute(relative21))
|
|
106185
106214
|
return false;
|
|
@@ -106457,7 +106486,7 @@ function atomicWriteFileSync(targetPath, content) {
|
|
|
106457
106486
|
const tempPrefix = `.apply-patch-${Date.now()}-${process.pid}`;
|
|
106458
106487
|
let tempPath;
|
|
106459
106488
|
try {
|
|
106460
|
-
const tempDir =
|
|
106489
|
+
const tempDir = realpathSync14(mkdtempSync2(path109.join(dir, tempPrefix)));
|
|
106461
106490
|
tempPath = path109.join(tempDir, "content");
|
|
106462
106491
|
} catch {
|
|
106463
106492
|
tempPath = path109.join(dir, `${tempPrefix}.tmp`);
|
|
@@ -108652,6 +108681,7 @@ ${body2}`);
|
|
|
108652
108681
|
}
|
|
108653
108682
|
|
|
108654
108683
|
// src/council/council-evidence-writer.ts
|
|
108684
|
+
init_zod();
|
|
108655
108685
|
init_task_file();
|
|
108656
108686
|
import { appendFileSync as appendFileSync12, existsSync as existsSync63, mkdirSync as mkdirSync29, readFileSync as readFileSync45 } from "node:fs";
|
|
108657
108687
|
import { join as join95 } from "node:path";
|
|
@@ -108659,6 +108689,7 @@ var EVIDENCE_DIR2 = ".swarm/evidence";
|
|
|
108659
108689
|
var VALID_TASK_ID = /^\d+\.\d+(\.\d+)*$/;
|
|
108660
108690
|
var COUNCIL_GATE_NAME = "council";
|
|
108661
108691
|
var COUNCIL_AGENT_ID = "architect";
|
|
108692
|
+
var EvidenceFileSchema = exports_external.record(exports_external.string(), exports_external.unknown());
|
|
108662
108693
|
var _internals53 = {
|
|
108663
108694
|
withTaskEvidenceLock
|
|
108664
108695
|
};
|
|
@@ -108698,10 +108729,8 @@ async function writeCouncilEvidence(workingDir, synthesis) {
|
|
|
108698
108729
|
const existingRoot = Object.create(null);
|
|
108699
108730
|
if (existsSync63(filePath)) {
|
|
108700
108731
|
try {
|
|
108701
|
-
const parsed = JSON.parse(readFileSync45(filePath, "utf-8"));
|
|
108702
|
-
|
|
108703
|
-
safeAssignOwnProps(existingRoot, parsed);
|
|
108704
|
-
}
|
|
108732
|
+
const parsed = EvidenceFileSchema.parse(JSON.parse(readFileSync45(filePath, "utf-8")));
|
|
108733
|
+
safeAssignOwnProps(existingRoot, parsed);
|
|
108705
108734
|
} catch {}
|
|
108706
108735
|
}
|
|
108707
108736
|
const existingGatesRaw = existingRoot.gates;
|
|
@@ -109059,9 +109088,19 @@ function buildFinalCouncilFeedback(projectSummary, verdict, vetoedBy, requiredFi
|
|
|
109059
109088
|
}
|
|
109060
109089
|
|
|
109061
109090
|
// src/council/criteria-store.ts
|
|
109091
|
+
init_zod();
|
|
109062
109092
|
import { existsSync as existsSync64, mkdirSync as mkdirSync30, readFileSync as readFileSync46, writeFileSync as writeFileSync22 } from "node:fs";
|
|
109063
109093
|
import { join as join96 } from "node:path";
|
|
109064
109094
|
var COUNCIL_DIR = ".swarm/council";
|
|
109095
|
+
var CouncilCriteriaSchema = exports_external.object({
|
|
109096
|
+
taskId: exports_external.string(),
|
|
109097
|
+
criteria: exports_external.array(exports_external.object({
|
|
109098
|
+
id: exports_external.string(),
|
|
109099
|
+
description: exports_external.string(),
|
|
109100
|
+
mandatory: exports_external.boolean()
|
|
109101
|
+
})),
|
|
109102
|
+
declaredAt: exports_external.string()
|
|
109103
|
+
});
|
|
109065
109104
|
function writeCriteria(workingDir, taskId, criteria) {
|
|
109066
109105
|
const dir = join96(workingDir, COUNCIL_DIR);
|
|
109067
109106
|
mkdirSync30(dir, { recursive: true });
|
|
@@ -109077,11 +109116,7 @@ function readCriteria(workingDir, taskId) {
|
|
|
109077
109116
|
if (!existsSync64(filePath))
|
|
109078
109117
|
return null;
|
|
109079
109118
|
try {
|
|
109080
|
-
|
|
109081
|
-
if (parsed && typeof parsed === "object" && typeof parsed.taskId === "string" && Array.isArray(parsed.criteria)) {
|
|
109082
|
-
return parsed;
|
|
109083
|
-
}
|
|
109084
|
-
return null;
|
|
109119
|
+
return CouncilCriteriaSchema.parse(JSON.parse(readFileSync46(filePath, "utf-8")));
|
|
109085
109120
|
} catch {
|
|
109086
109121
|
return null;
|
|
109087
109122
|
}
|
|
@@ -110437,7 +110472,7 @@ init_create_tool();
|
|
|
110437
110472
|
init_resolve_working_directory();
|
|
110438
110473
|
async function execGit2(workingDir, args2, options) {
|
|
110439
110474
|
try {
|
|
110440
|
-
const stdout = await new Promise((
|
|
110475
|
+
const stdout = await new Promise((resolve42, reject) => {
|
|
110441
110476
|
const execOpts = {
|
|
110442
110477
|
encoding: "utf-8",
|
|
110443
110478
|
cwd: workingDir,
|
|
@@ -110450,7 +110485,7 @@ async function execGit2(workingDir, args2, options) {
|
|
|
110450
110485
|
reject(error93);
|
|
110451
110486
|
return;
|
|
110452
110487
|
}
|
|
110453
|
-
|
|
110488
|
+
resolve42(output ?? "");
|
|
110454
110489
|
});
|
|
110455
110490
|
});
|
|
110456
110491
|
return stdout;
|
|
@@ -111390,7 +111425,7 @@ init_create_tool();
|
|
|
111390
111425
|
var GITINGEST_TIMEOUT_MS = 1e4;
|
|
111391
111426
|
var GITINGEST_MAX_RESPONSE_BYTES = 5242880;
|
|
111392
111427
|
var GITINGEST_MAX_RETRIES = 2;
|
|
111393
|
-
var delay = (ms) => new Promise((
|
|
111428
|
+
var delay = (ms) => new Promise((resolve43) => setTimeout(resolve43, ms));
|
|
111394
111429
|
async function fetchGitingest(args2) {
|
|
111395
111430
|
for (let attempt = 0;attempt <= GITINGEST_MAX_RETRIES; attempt++) {
|
|
111396
111431
|
try {
|
|
@@ -112245,7 +112280,7 @@ function filterSwarmEntries(entries, filters, suppressedLessons, scopeFilter) {
|
|
|
112245
112280
|
return false;
|
|
112246
112281
|
}
|
|
112247
112282
|
}
|
|
112248
|
-
if (suppressedLessons.has(
|
|
112283
|
+
if (suppressedLessons.has(normalize4(entry.lesson))) {
|
|
112249
112284
|
return false;
|
|
112250
112285
|
}
|
|
112251
112286
|
return true;
|
|
@@ -112266,7 +112301,7 @@ function filterHiveEntries(entries, filters, suppressedLessons) {
|
|
|
112266
112301
|
if (filters.minScore !== undefined && entry.confidence < filters.minScore) {
|
|
112267
112302
|
return false;
|
|
112268
112303
|
}
|
|
112269
|
-
if (suppressedLessons.has(
|
|
112304
|
+
if (suppressedLessons.has(normalize4(entry.lesson))) {
|
|
112270
112305
|
return false;
|
|
112271
112306
|
}
|
|
112272
112307
|
return true;
|
|
@@ -117129,7 +117164,7 @@ async function runNpmAudit(directory) {
|
|
|
117129
117164
|
stderr: "pipe",
|
|
117130
117165
|
cwd: directory
|
|
117131
117166
|
});
|
|
117132
|
-
const timeoutPromise = new Promise((
|
|
117167
|
+
const timeoutPromise = new Promise((resolve47) => setTimeout(() => resolve47("timeout"), AUDIT_TIMEOUT_MS));
|
|
117133
117168
|
const result = await Promise.race([
|
|
117134
117169
|
Promise.all([proc.stdout.text(), proc.stderr.text()]).then(([stdout2, stderr2]) => ({ stdout: stdout2, stderr: stderr2 })),
|
|
117135
117170
|
timeoutPromise
|
|
@@ -117249,7 +117284,7 @@ async function runPipAudit(directory) {
|
|
|
117249
117284
|
stderr: "pipe",
|
|
117250
117285
|
cwd: directory
|
|
117251
117286
|
});
|
|
117252
|
-
const timeoutPromise = new Promise((
|
|
117287
|
+
const timeoutPromise = new Promise((resolve47) => setTimeout(() => resolve47("timeout"), AUDIT_TIMEOUT_MS));
|
|
117253
117288
|
const result = await Promise.race([
|
|
117254
117289
|
Promise.all([proc.stdout.text(), proc.stderr.text()]).then(([stdout2, stderr2]) => ({ stdout: stdout2, stderr: stderr2 })),
|
|
117255
117290
|
timeoutPromise
|
|
@@ -117377,7 +117412,7 @@ async function runCargoAudit(directory) {
|
|
|
117377
117412
|
stderr: "pipe",
|
|
117378
117413
|
cwd: directory
|
|
117379
117414
|
});
|
|
117380
|
-
const timeoutPromise = new Promise((
|
|
117415
|
+
const timeoutPromise = new Promise((resolve47) => setTimeout(() => resolve47("timeout"), AUDIT_TIMEOUT_MS));
|
|
117381
117416
|
const result = await Promise.race([
|
|
117382
117417
|
Promise.all([proc.stdout.text(), proc.stderr.text()]).then(([stdout2, stderr]) => ({ stdout: stdout2, stderr })),
|
|
117383
117418
|
timeoutPromise
|
|
@@ -117501,7 +117536,7 @@ async function runGoAudit(directory) {
|
|
|
117501
117536
|
stderr: "pipe",
|
|
117502
117537
|
cwd: directory
|
|
117503
117538
|
});
|
|
117504
|
-
const timeoutPromise = new Promise((
|
|
117539
|
+
const timeoutPromise = new Promise((resolve47) => setTimeout(() => resolve47("timeout"), AUDIT_TIMEOUT_MS));
|
|
117505
117540
|
const result = await Promise.race([
|
|
117506
117541
|
Promise.all([proc.stdout.text(), proc.stderr.text()]).then(([stdout2, stderr]) => ({ stdout: stdout2, stderr })),
|
|
117507
117542
|
timeoutPromise
|
|
@@ -117634,7 +117669,7 @@ async function runDotnetAudit(directory) {
|
|
|
117634
117669
|
stderr: "pipe",
|
|
117635
117670
|
cwd: directory
|
|
117636
117671
|
});
|
|
117637
|
-
const timeoutPromise = new Promise((
|
|
117672
|
+
const timeoutPromise = new Promise((resolve47) => setTimeout(() => resolve47("timeout"), AUDIT_TIMEOUT_MS));
|
|
117638
117673
|
const result = await Promise.race([
|
|
117639
117674
|
Promise.all([proc.stdout.text(), proc.stderr.text()]).then(([stdout2, stderr]) => ({ stdout: stdout2, stderr })),
|
|
117640
117675
|
timeoutPromise
|
|
@@ -117750,7 +117785,7 @@ async function runBundleAudit(directory) {
|
|
|
117750
117785
|
stderr: "pipe",
|
|
117751
117786
|
cwd: directory
|
|
117752
117787
|
});
|
|
117753
|
-
const timeoutPromise = new Promise((
|
|
117788
|
+
const timeoutPromise = new Promise((resolve47) => setTimeout(() => resolve47("timeout"), AUDIT_TIMEOUT_MS));
|
|
117754
117789
|
const result = await Promise.race([
|
|
117755
117790
|
Promise.all([proc.stdout.text(), proc.stderr.text()]).then(([stdout2, stderr]) => ({ stdout: stdout2, stderr })),
|
|
117756
117791
|
timeoutPromise
|
|
@@ -117895,7 +117930,7 @@ async function runDartAudit(directory) {
|
|
|
117895
117930
|
stderr: "pipe",
|
|
117896
117931
|
cwd: directory
|
|
117897
117932
|
});
|
|
117898
|
-
const timeoutPromise = new Promise((
|
|
117933
|
+
const timeoutPromise = new Promise((resolve47) => setTimeout(() => resolve47("timeout"), AUDIT_TIMEOUT_MS));
|
|
117899
117934
|
const result = await Promise.race([
|
|
117900
117935
|
Promise.all([proc.stdout.text(), proc.stderr.text()]).then(([stdout2, stderr]) => ({ stdout: stdout2, stderr })),
|
|
117901
117936
|
timeoutPromise
|
|
@@ -118010,7 +118045,7 @@ async function runComposerAudit(directory) {
|
|
|
118010
118045
|
stderr: "pipe",
|
|
118011
118046
|
cwd: directory
|
|
118012
118047
|
});
|
|
118013
|
-
const timeoutPromise = new Promise((
|
|
118048
|
+
const timeoutPromise = new Promise((resolve47) => setTimeout(() => resolve47("timeout"), AUDIT_TIMEOUT_MS));
|
|
118014
118049
|
const result = await Promise.race([
|
|
118015
118050
|
Promise.all([proc.stdout.text(), proc.stderr.text()]).then(([stdout2, stderr]) => ({ stdout: stdout2, stderr })),
|
|
118016
118051
|
timeoutPromise
|
|
@@ -119671,7 +119706,7 @@ function mapSemgrepSeverity(severity) {
|
|
|
119671
119706
|
}
|
|
119672
119707
|
}
|
|
119673
119708
|
async function executeWithTimeout(command, args2, options) {
|
|
119674
|
-
return new Promise((
|
|
119709
|
+
return new Promise((resolve49) => {
|
|
119675
119710
|
const child = child_process9.spawn(command, args2, {
|
|
119676
119711
|
shell: false,
|
|
119677
119712
|
cwd: options.cwd
|
|
@@ -119680,7 +119715,7 @@ async function executeWithTimeout(command, args2, options) {
|
|
|
119680
119715
|
let stderr = "";
|
|
119681
119716
|
const timeout = setTimeout(() => {
|
|
119682
119717
|
child.kill("SIGTERM");
|
|
119683
|
-
|
|
119718
|
+
resolve49({
|
|
119684
119719
|
stdout,
|
|
119685
119720
|
stderr: "Process timed out",
|
|
119686
119721
|
exitCode: 124
|
|
@@ -119694,7 +119729,7 @@ async function executeWithTimeout(command, args2, options) {
|
|
|
119694
119729
|
});
|
|
119695
119730
|
child.on("close", (code) => {
|
|
119696
119731
|
clearTimeout(timeout);
|
|
119697
|
-
|
|
119732
|
+
resolve49({
|
|
119698
119733
|
stdout,
|
|
119699
119734
|
stderr,
|
|
119700
119735
|
exitCode: code ?? 0
|
|
@@ -119702,7 +119737,7 @@ async function executeWithTimeout(command, args2, options) {
|
|
|
119702
119737
|
});
|
|
119703
119738
|
child.on("error", (err2) => {
|
|
119704
119739
|
clearTimeout(timeout);
|
|
119705
|
-
|
|
119740
|
+
resolve49({
|
|
119706
119741
|
stdout,
|
|
119707
119742
|
stderr: err2.message,
|
|
119708
119743
|
exitCode: 1
|
|
@@ -119901,7 +119936,7 @@ async function acquireLock2(lockPath) {
|
|
|
119901
119936
|
};
|
|
119902
119937
|
} catch {
|
|
119903
119938
|
if (attempt < LOCK_RETRY_DELAYS_MS.length) {
|
|
119904
|
-
await new Promise((
|
|
119939
|
+
await new Promise((resolve50) => setTimeout(resolve50, LOCK_RETRY_DELAYS_MS[attempt]));
|
|
119905
119940
|
}
|
|
119906
119941
|
}
|
|
119907
119942
|
}
|
|
@@ -123912,7 +123947,7 @@ async function ripgrepSearch(opts) {
|
|
|
123912
123947
|
stderr: "pipe",
|
|
123913
123948
|
cwd: opts.workspace
|
|
123914
123949
|
});
|
|
123915
|
-
const timeout = new Promise((
|
|
123950
|
+
const timeout = new Promise((resolve56) => setTimeout(() => resolve56("timeout"), REGEX_TIMEOUT_MS));
|
|
123916
123951
|
const exitPromise = proc.exited;
|
|
123917
123952
|
const result = await Promise.race([exitPromise, timeout]);
|
|
123918
123953
|
if (result === "timeout") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.50.
|
|
3
|
+
"version": "7.50.4",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|