opencode-swarm 7.113.1 → 7.113.3
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/engineering-conventions/SKILL.md +5 -0
- package/.opencode/skills/gate-attribution/SKILL.md +2 -0
- package/binaries/win32-arm64/.gitkeep +0 -0
- package/binaries/win32-x64/.gitkeep +0 -0
- package/dist/background/event-bus.d.ts +1 -1
- package/dist/background/pending-delegations.d.ts +8 -0
- package/dist/background/queue.d.ts +11 -0
- package/dist/background/trigger.d.ts +1 -0
- package/dist/background/workspace-snapshot.d.ts +7 -0
- package/dist/cli/{capability-probe-sh9bwh39.js → capability-probe-f1paszww.js} +1 -1
- package/dist/cli/{config-doctor-az11cwf5.js → config-doctor-xbdfrbwt.js} +2 -2
- package/dist/cli/{core-f4cbabe7.js → core-zg8s1jwx.js} +2 -2
- package/dist/cli/{curator-nm2c9y1p.js → curator-ckzb8ww4.js} +23 -22
- package/dist/cli/{curator-drift-jvs1v6em.js → curator-drift-c0by7063.js} +2 -2
- package/dist/cli/curator-llm-factory-mhjcpy1s.js +41 -0
- package/dist/cli/{dispatch-wst7bypk.js → dispatch-mczsxy5s.js} +2 -2
- package/dist/cli/{evidence-summary-service-j6fnsfeq.js → evidence-summary-service-8g594znj.js} +7 -7
- package/dist/cli/{gate-evidence-mk0ss1re.js → gate-evidence-vkpqt300.js} +5 -5
- package/dist/cli/guardrail-explain-kabd97j8.js +42 -0
- package/dist/cli/{guardrail-log-hysxdwg9.js → guardrail-log-qfc2j0tb.js} +4 -4
- package/dist/cli/hive-promoter-h21wzpsr.js +49 -0
- package/dist/cli/{index-0dab9w37.js → index-0p660a87.js} +2 -2
- package/dist/cli/{index-32bx4kch.js → index-0q7rrh59.js} +4 -4
- package/dist/cli/{index-1ey3dxq7.js → index-147ja18h.js} +0 -4
- package/dist/cli/{index-0gf6de8b.js → index-2148358e.js} +45 -1
- package/dist/cli/{index-30ejh1tx.js → index-43khae15.js} +3 -3
- package/dist/cli/{index-pm992z24.js → index-4h2ea8h5.js} +12 -9
- package/dist/cli/{index-5mkc2f9z.js → index-4sckv7y6.js} +1 -1
- package/dist/cli/{index-q1jaeynn.js → index-80jkseqw.js} +2 -2
- package/dist/cli/{index-wvrj16f0.js → index-8fwhhayc.js} +4 -0
- package/dist/cli/{index-npd9rypp.js → index-dh87tpc5.js} +176 -63
- package/dist/cli/{workspace-snapshot-w58jr2ga.js → index-dqh3zhhc.js} +53 -10
- package/dist/cli/{index-d0w40jm3.js → index-f6y341yk.js} +14 -11
- package/dist/cli/{index-db1fh1fv.js → index-g40r5d08.js} +1 -1
- package/dist/cli/{index-8f256d7t.js → index-g6va6n3t.js} +1 -1
- package/dist/cli/{index-9fxs0rm1.js → index-ga4ta3cr.js} +1 -1
- package/dist/cli/{index-t6wfwdm1.js → index-h7q1bvzm.js} +3 -3
- package/dist/cli/{index-rqpm9cwe.js → index-hw4tcxs9.js} +25 -24
- package/dist/cli/{index-h389ed8y.js → index-mr4whary.js} +3 -3
- package/dist/cli/{index-g55nzpwn.js → index-n6fa2hhk.js} +1 -1
- package/dist/cli/{index-vn263hqt.js → index-pa6t33pt.js} +17 -10
- package/dist/cli/{index-h91bv3hy.js → index-qe3v54nb.js} +6 -1
- package/dist/cli/{index-hpp2r0sd.js → index-qzqx2qky.js} +3 -3
- package/dist/cli/{index-fhmw7evd.js → index-rdwfqhp7.js} +2 -2
- package/dist/cli/{index-ky8eb4q6.js → index-srvqfcyj.js} +2 -2
- package/dist/cli/{index-1rga1vvb.js → index-wh8949ef.js} +1 -1
- package/dist/cli/{index-r9fjzr3k.js → index-xbe1wtme.js} +1 -1
- package/dist/cli/index.js +23 -22
- package/dist/cli/{knowledge-escalator-4gbz527n.js → knowledge-escalator-0q1p6br7.js} +8 -8
- package/dist/cli/{knowledge-events-b6x28fgc.js → knowledge-events-9518gzsp.js} +6 -6
- package/dist/cli/{knowledge-store-h3cjx4dg.js → knowledge-store-k5rab79h.js} +6 -6
- package/dist/cli/{knowledge-validator-q6jw2p0t.js → knowledge-validator-csay9wqj.js} +7 -7
- package/dist/cli/{pending-delegations-gc3a2hfx.js → pending-delegations-ddbkbgxy.js} +11 -4
- package/dist/cli/{pr-subscriptions-p8g2rzxd.js → pr-subscriptions-vwv7zm2p.js} +5 -5
- package/dist/cli/{schema-qb313fyy.js → schema-e5kd993s.js} +1 -1
- package/dist/cli/{scope-persistence-5ccgtebg.js → scope-persistence-fm0gzhnk.js} +2 -2
- package/dist/cli/{skill-generator-nnwn4sq0.js → skill-generator-z01sjppf.js} +9 -9
- package/dist/cli/{telemetry-jm7t8031.js → telemetry-jny76r83.js} +1 -1
- package/dist/cli/workspace-snapshot-eyf6gd0d.js +22 -0
- package/dist/commands/registry.d.ts +7 -0
- package/dist/config/constants.d.ts +1 -1
- package/dist/config/skill-mirrors.d.ts +3 -1
- package/dist/gate-evidence-classification.d.ts +5 -0
- package/dist/gate-evidence.d.ts +14 -3
- package/dist/hooks/messages-transform.d.ts +22 -1
- package/dist/hooks/spawn-helper.d.ts +10 -0
- package/dist/index.js +302 -300
- package/dist/memory/schema.d.ts +4 -4
- package/dist/sandbox/capability-probe.d.ts +14 -0
- package/dist/sandbox/macos/sandbox-exec-executor.d.ts +5 -0
- package/dist/tools/phase-complete.d.ts +8 -0
- package/dist/tools/sast-scan.d.ts +2 -0
- package/dist/tools/tool-metadata.d.ts +1 -1
- package/dist/utils/path-security.d.ts +28 -0
- package/package.json +2 -1
- package/dist/cli/curator-llm-factory-nmhzc774.js +0 -40
- package/dist/cli/guardrail-explain-q1np1xaw.js +0 -41
- package/dist/cli/hive-promoter-z4dezw62.js +0 -48
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
readDoctorArtifact,
|
|
8
8
|
removeStraySwarmDir,
|
|
9
9
|
runConfigDoctor
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-2148358e.js";
|
|
11
11
|
import {
|
|
12
12
|
AGENT_TOOL_MAP,
|
|
13
13
|
ALL_SUBAGENT_NAMES,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
getCanonicalAgentRole,
|
|
24
24
|
resolveExternalSkillsConfig,
|
|
25
25
|
stripKnownSwarmPrefix
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-147ja18h.js";
|
|
27
27
|
import {
|
|
28
28
|
MAX_TRANSIENT_RETRIES,
|
|
29
29
|
PlanSchema,
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
savePlan,
|
|
69
69
|
transientBackoff,
|
|
70
70
|
validateProjectRoot
|
|
71
|
-
} from "./index-
|
|
71
|
+
} from "./index-f6y341yk.js";
|
|
72
72
|
import {
|
|
73
73
|
buildOpenSpecProjectionSync,
|
|
74
74
|
detectSpeckit,
|
|
@@ -83,13 +83,13 @@ import {
|
|
|
83
83
|
_internals1 as _internals2,
|
|
84
84
|
isCommandAvailable,
|
|
85
85
|
tool
|
|
86
|
-
} from "./index-
|
|
86
|
+
} from "./index-ga4ta3cr.js";
|
|
87
87
|
import {
|
|
88
88
|
buildCorrelationId,
|
|
89
89
|
listActive,
|
|
90
90
|
subscribe,
|
|
91
91
|
unsubscribe
|
|
92
|
-
} from "./index-
|
|
92
|
+
} from "./index-80jkseqw.js";
|
|
93
93
|
import {
|
|
94
94
|
BUNDLED_PROJECT_SKILL_ROOT,
|
|
95
95
|
DEFAULT_SKILL_MIN_CONFIDENCE,
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
retireSkill,
|
|
112
112
|
selectCandidateEntries,
|
|
113
113
|
syncBundledProjectSkillsIfMissingAsync
|
|
114
|
-
} from "./index-
|
|
114
|
+
} from "./index-mr4whary.js";
|
|
115
115
|
import {
|
|
116
116
|
appendUnactionable,
|
|
117
117
|
quarantineEntry,
|
|
@@ -121,10 +121,10 @@ import {
|
|
|
121
121
|
validateActionability,
|
|
122
122
|
validateActionableFields,
|
|
123
123
|
validateLesson
|
|
124
|
-
} from "./index-
|
|
124
|
+
} from "./index-43khae15.js";
|
|
125
125
|
import {
|
|
126
126
|
readRecentEscalations
|
|
127
|
-
} from "./index-
|
|
127
|
+
} from "./index-h7q1bvzm.js";
|
|
128
128
|
import {
|
|
129
129
|
effectiveRetrievalOutcomes,
|
|
130
130
|
readKnowledgeCounterRollups,
|
|
@@ -132,7 +132,7 @@ import {
|
|
|
132
132
|
recordHiveKnowledgeEvent,
|
|
133
133
|
recordKnowledgeEvent,
|
|
134
134
|
resolveKnowledgeEventsPath
|
|
135
|
-
} from "./index-
|
|
135
|
+
} from "./index-qzqx2qky.js";
|
|
136
136
|
import {
|
|
137
137
|
appendKnowledge,
|
|
138
138
|
appendRejectedLesson,
|
|
@@ -156,7 +156,7 @@ import {
|
|
|
156
156
|
rewriteKnowledge,
|
|
157
157
|
transactFile,
|
|
158
158
|
transactKnowledge
|
|
159
|
-
} from "./index-
|
|
159
|
+
} from "./index-0q7rrh59.js";
|
|
160
160
|
import {
|
|
161
161
|
KNOWLEDGE_SCHEMA_VERSION,
|
|
162
162
|
OUTCOME_BLOCK_THRESHOLD,
|
|
@@ -170,7 +170,7 @@ import {
|
|
|
170
170
|
resolveLinkDir,
|
|
171
171
|
sanitizeLinkId,
|
|
172
172
|
writeLinkPointer
|
|
173
|
-
} from "./index-
|
|
173
|
+
} from "./index-g40r5d08.js";
|
|
174
174
|
import {
|
|
175
175
|
CURATOR_INIT_PROMPT,
|
|
176
176
|
CURATOR_PHASE_PROMPT,
|
|
@@ -179,15 +179,15 @@ import {
|
|
|
179
179
|
import {
|
|
180
180
|
SandboxCapabilityProbe,
|
|
181
181
|
init_capability_probe
|
|
182
|
-
} from "./index-
|
|
182
|
+
} from "./index-8fwhhayc.js";
|
|
183
183
|
import {
|
|
184
184
|
clearAllScopes
|
|
185
|
-
} from "./index-
|
|
185
|
+
} from "./index-n6fa2hhk.js";
|
|
186
186
|
import {
|
|
187
187
|
readSwarmFileAsync,
|
|
188
188
|
safeHook,
|
|
189
189
|
validateSwarmPath
|
|
190
|
-
} from "./index-
|
|
190
|
+
} from "./index-wh8949ef.js";
|
|
191
191
|
import {
|
|
192
192
|
deepMerge
|
|
193
193
|
} from "./index-p0arc26j.js";
|
|
@@ -199,16 +199,16 @@ import {
|
|
|
199
199
|
} from "./index-zgwm4ryv.js";
|
|
200
200
|
import {
|
|
201
201
|
atomicWriteFile
|
|
202
|
-
} from "./index-
|
|
202
|
+
} from "./index-0p660a87.js";
|
|
203
203
|
import {
|
|
204
204
|
exports_external
|
|
205
205
|
} from "./index-293f68mj.js";
|
|
206
206
|
import {
|
|
207
207
|
tryAcquireLock
|
|
208
|
-
} from "./index-
|
|
208
|
+
} from "./index-4sckv7y6.js";
|
|
209
209
|
import {
|
|
210
210
|
telemetry
|
|
211
|
-
} from "./index-
|
|
211
|
+
} from "./index-pa6t33pt.js";
|
|
212
212
|
import {
|
|
213
213
|
require_proper_lockfile
|
|
214
214
|
} from "./index-vvk2g744.js";
|
|
@@ -216,7 +216,7 @@ import {
|
|
|
216
216
|
bunSpawn,
|
|
217
217
|
bunWrite,
|
|
218
218
|
mergeEnvForChild
|
|
219
|
-
} from "./index-
|
|
219
|
+
} from "./index-qe3v54nb.js";
|
|
220
220
|
import {
|
|
221
221
|
__require,
|
|
222
222
|
__toESM
|
|
@@ -4397,6 +4397,7 @@ var head = null;
|
|
|
4397
4397
|
var tail = null;
|
|
4398
4398
|
var entriesByKey = new Map;
|
|
4399
4399
|
var deferredEntries = new Set;
|
|
4400
|
+
var resolvedKeyCache = new Map;
|
|
4400
4401
|
function markAsPooled(provider) {
|
|
4401
4402
|
const originalClose = provider.close;
|
|
4402
4403
|
provider.close = () => {
|
|
@@ -4524,10 +4525,19 @@ function unlinkEntry(entry) {
|
|
|
4524
4525
|
tail = entry.prev;
|
|
4525
4526
|
}
|
|
4526
4527
|
function resolvePoolKey(directory) {
|
|
4528
|
+
const rawKey = path6.resolve(directory);
|
|
4527
4529
|
try {
|
|
4528
|
-
|
|
4530
|
+
const canonical = realpathSync(directory);
|
|
4531
|
+
resolvedKeyCache.delete(rawKey);
|
|
4532
|
+
resolvedKeyCache.set(rawKey, canonical);
|
|
4533
|
+
if (resolvedKeyCache.size > MAX_POOL_SIZE) {
|
|
4534
|
+
const oldest = resolvedKeyCache.keys().next().value;
|
|
4535
|
+
if (oldest !== undefined)
|
|
4536
|
+
resolvedKeyCache.delete(oldest);
|
|
4537
|
+
}
|
|
4538
|
+
return canonical;
|
|
4529
4539
|
} catch {
|
|
4530
|
-
return
|
|
4540
|
+
return resolvedKeyCache.get(rawKey) ?? rawKey;
|
|
4531
4541
|
}
|
|
4532
4542
|
}
|
|
4533
4543
|
function evictAndClose(directory) {
|
|
@@ -4923,6 +4933,73 @@ function sanitizeGatesConfig(raw) {
|
|
|
4923
4933
|
function sanitizeSectionConfigs(raw) {
|
|
4924
4934
|
return sanitizeGatesConfig(sanitizeExternalSkillsConfig(raw));
|
|
4925
4935
|
}
|
|
4936
|
+
function stripUnrecognizedKeys(raw, error2) {
|
|
4937
|
+
const removed = [];
|
|
4938
|
+
const cleaned = structuredClone(raw);
|
|
4939
|
+
for (const issue of error2.issues) {
|
|
4940
|
+
if (issue.code !== "unrecognized_keys")
|
|
4941
|
+
continue;
|
|
4942
|
+
const keys = issue.keys ?? [];
|
|
4943
|
+
let node = cleaned;
|
|
4944
|
+
for (const seg of issue.path) {
|
|
4945
|
+
if (node && typeof node === "object") {
|
|
4946
|
+
node = node[seg];
|
|
4947
|
+
} else {
|
|
4948
|
+
node = undefined;
|
|
4949
|
+
break;
|
|
4950
|
+
}
|
|
4951
|
+
}
|
|
4952
|
+
if (!node || typeof node !== "object")
|
|
4953
|
+
continue;
|
|
4954
|
+
for (const key of keys) {
|
|
4955
|
+
if (key in node) {
|
|
4956
|
+
delete node[key];
|
|
4957
|
+
const dotted = [...issue.path.map(String), key].join(".");
|
|
4958
|
+
removed.push(dotted);
|
|
4959
|
+
}
|
|
4960
|
+
}
|
|
4961
|
+
}
|
|
4962
|
+
return { cleaned, removed };
|
|
4963
|
+
}
|
|
4964
|
+
function parseConfigWithFallback(mergedRaw, rawUserConfig, failedResult, loadedFromFile, configHadErrors) {
|
|
4965
|
+
const result = failedResult;
|
|
4966
|
+
const secure = (config) => loadedFromFile && configHadErrors ? PluginConfigSchema.parse({
|
|
4967
|
+
...config,
|
|
4968
|
+
guardrails: { enabled: true }
|
|
4969
|
+
}) : config;
|
|
4970
|
+
const { cleaned, removed } = stripUnrecognizedKeys(mergedRaw, result.error);
|
|
4971
|
+
if (removed.length > 0) {
|
|
4972
|
+
const recovered = PluginConfigSchema.safeParse(cleaned);
|
|
4973
|
+
if (recovered.success) {
|
|
4974
|
+
advisoryWarn(`[opencode-swarm] Ignored ${removed.length} unrecognized config key(s): ${removed.join(", ")}. The rest of your configuration was preserved. Fix or remove these keys.`);
|
|
4975
|
+
return secure(recovered.data);
|
|
4976
|
+
}
|
|
4977
|
+
}
|
|
4978
|
+
if (rawUserConfig) {
|
|
4979
|
+
const userSanitized = sanitizeSectionConfigs(rawUserConfig ?? {});
|
|
4980
|
+
const userParseResult = PluginConfigSchema.safeParse(userSanitized);
|
|
4981
|
+
if (userParseResult.success) {
|
|
4982
|
+
advisoryWarn("[opencode-swarm] Project config ignored due to validation errors. Using user config.");
|
|
4983
|
+
return secure(userParseResult.data);
|
|
4984
|
+
}
|
|
4985
|
+
const userStripped = stripUnrecognizedKeys(userSanitized, userParseResult.error);
|
|
4986
|
+
if (userStripped.removed.length > 0) {
|
|
4987
|
+
const userRecovered = PluginConfigSchema.safeParse(userStripped.cleaned);
|
|
4988
|
+
if (userRecovered.success) {
|
|
4989
|
+
advisoryWarn(`[opencode-swarm] Project config ignored; also ignored ${userStripped.removed.length} unrecognized user-config key(s): ${userStripped.removed.join(", ")}.`);
|
|
4990
|
+
return secure(userRecovered.data);
|
|
4991
|
+
}
|
|
4992
|
+
}
|
|
4993
|
+
}
|
|
4994
|
+
const offending = stripUnrecognizedKeys(mergedRaw, result.error).removed;
|
|
4995
|
+
if (offending.length > 0) {
|
|
4996
|
+
advisoryWarn(`[opencode-swarm] Merged config validation failed. Unrecognized key(s): ${offending.join(", ")}.`);
|
|
4997
|
+
} else {
|
|
4998
|
+
advisoryWarn("[opencode-swarm] Merged config validation failed:", result.error.format());
|
|
4999
|
+
}
|
|
5000
|
+
advisoryWarn("[opencode-swarm] \u26A0\uFE0F SECURITY: Falling back to conservative defaults with guardrails ENABLED. Fix the config file to restore custom configuration.");
|
|
5001
|
+
return PluginConfigSchema.parse({ guardrails: { enabled: true } });
|
|
5002
|
+
}
|
|
4926
5003
|
function rawFullAutoLocked(raw) {
|
|
4927
5004
|
if (!raw || typeof raw !== "object")
|
|
4928
5005
|
return false;
|
|
@@ -4955,27 +5032,16 @@ function loadPluginConfig(directory) {
|
|
|
4955
5032
|
mergedRaw = migratePresetsConfig(mergedRaw);
|
|
4956
5033
|
mergedRaw = sanitizeSectionConfigs(mergedRaw);
|
|
4957
5034
|
const result = PluginConfigSchema.safeParse(mergedRaw);
|
|
4958
|
-
if (
|
|
4959
|
-
if (
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
}
|
|
5035
|
+
if (result.success) {
|
|
5036
|
+
if (loadedFromFile && configHadErrors) {
|
|
5037
|
+
return PluginConfigSchema.parse({
|
|
5038
|
+
...mergedRaw,
|
|
5039
|
+
guardrails: { enabled: true }
|
|
5040
|
+
});
|
|
4965
5041
|
}
|
|
4966
|
-
|
|
4967
|
-
advisoryWarn("[opencode-swarm] \u26A0\uFE0F SECURITY: Falling back to conservative defaults with guardrails ENABLED. Fix the config file to restore custom configuration.");
|
|
4968
|
-
return PluginConfigSchema.parse({
|
|
4969
|
-
guardrails: { enabled: true }
|
|
4970
|
-
});
|
|
5042
|
+
return result.data;
|
|
4971
5043
|
}
|
|
4972
|
-
|
|
4973
|
-
return PluginConfigSchema.parse({
|
|
4974
|
-
...mergedRaw,
|
|
4975
|
-
guardrails: { enabled: true }
|
|
4976
|
-
});
|
|
4977
|
-
}
|
|
4978
|
-
return result.data;
|
|
5044
|
+
return parseConfigWithFallback(mergedRaw, rawUserConfig, result, loadedFromFile, configHadErrors);
|
|
4979
5045
|
}
|
|
4980
5046
|
function loadPluginConfigWithMeta(directory) {
|
|
4981
5047
|
const userConfigPath = path7.join(getUserConfigDir(), "opencode", CONFIG_FILENAME);
|
|
@@ -8976,7 +9042,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
|
|
|
8976
9042
|
}
|
|
8977
9043
|
if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
|
|
8978
9044
|
try {
|
|
8979
|
-
const skillModule = await import("./skill-generator-
|
|
9045
|
+
const skillModule = await import("./skill-generator-z01sjppf.js");
|
|
8980
9046
|
for (const cand of skillCandidates) {
|
|
8981
9047
|
if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
|
|
8982
9048
|
continue;
|
|
@@ -9257,7 +9323,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
|
|
|
9257
9323
|
} catch {}
|
|
9258
9324
|
}
|
|
9259
9325
|
if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
|
|
9260
|
-
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-
|
|
9326
|
+
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-0q1p6br7.js");
|
|
9261
9327
|
for (const { id } of contradictedEntries) {
|
|
9262
9328
|
try {
|
|
9263
9329
|
await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
|
|
@@ -10214,15 +10280,15 @@ var _internals12 = {
|
|
|
10214
10280
|
verifyPostMortemKnowledgeActions,
|
|
10215
10281
|
repairPostMortemActions,
|
|
10216
10282
|
loadDefaultKnowledgeConfig: async () => {
|
|
10217
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
10283
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-e5kd993s.js");
|
|
10218
10284
|
return KnowledgeConfigSchema2.parse({});
|
|
10219
10285
|
},
|
|
10220
10286
|
applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig) => {
|
|
10221
|
-
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-
|
|
10287
|
+
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-ckzb8ww4.js");
|
|
10222
10288
|
return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig);
|
|
10223
10289
|
},
|
|
10224
10290
|
checkHivePromotions: async (entries, knowledgeConfig) => {
|
|
10225
|
-
const { checkHivePromotions } = await import("./hive-promoter-
|
|
10291
|
+
const { checkHivePromotions } = await import("./hive-promoter-h21wzpsr.js");
|
|
10226
10292
|
return checkHivePromotions(entries, knowledgeConfig);
|
|
10227
10293
|
},
|
|
10228
10294
|
applyProposalTriage: async (directory, triage) => {
|
|
@@ -10231,7 +10297,7 @@ var _internals12 = {
|
|
|
10231
10297
|
activateProposal,
|
|
10232
10298
|
listSkills: listSkills2,
|
|
10233
10299
|
sanitizeSlug
|
|
10234
|
-
} = await import("./skill-generator-
|
|
10300
|
+
} = await import("./skill-generator-z01sjppf.js");
|
|
10235
10301
|
const result = {
|
|
10236
10302
|
approved: [],
|
|
10237
10303
|
rejected: [],
|
|
@@ -10273,7 +10339,7 @@ var _internals12 = {
|
|
|
10273
10339
|
return result;
|
|
10274
10340
|
},
|
|
10275
10341
|
readPriorDriftReports: async (directory) => {
|
|
10276
|
-
const { readPriorDriftReports } = await import("./curator-drift-
|
|
10342
|
+
const { readPriorDriftReports } = await import("./curator-drift-c0by7063.js");
|
|
10277
10343
|
return readPriorDriftReports(directory);
|
|
10278
10344
|
},
|
|
10279
10345
|
readSwarmKnowledge: (directory) => readKnowledge(resolveSwarmKnowledgePath(directory))
|
|
@@ -15166,7 +15232,7 @@ async function runFinalizeStage(ctx) {
|
|
|
15166
15232
|
}
|
|
15167
15233
|
}
|
|
15168
15234
|
try {
|
|
15169
|
-
const { CuratorConfigSchema: CCS } = await import("./schema-
|
|
15235
|
+
const { CuratorConfigSchema: CCS } = await import("./schema-e5kd993s.js");
|
|
15170
15236
|
const { config: pmLoadedConfig } = _internals19.loadPluginConfigWithMeta(ctx.directory);
|
|
15171
15237
|
const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
|
|
15172
15238
|
if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
|
|
@@ -17279,9 +17345,9 @@ var _internals23 = {
|
|
|
17279
17345
|
readSwarmFileAsync,
|
|
17280
17346
|
loadCuratorDeps: async () => {
|
|
17281
17347
|
const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
|
|
17282
|
-
import("./schema-
|
|
17283
|
-
import("./curator-
|
|
17284
|
-
import("./curator-llm-factory-
|
|
17348
|
+
import("./schema-e5kd993s.js"),
|
|
17349
|
+
import("./curator-ckzb8ww4.js"),
|
|
17350
|
+
import("./curator-llm-factory-mhjcpy1s.js")
|
|
17285
17351
|
]);
|
|
17286
17352
|
return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
|
|
17287
17353
|
}
|
|
@@ -17777,7 +17843,7 @@ import { fileURLToPath } from "url";
|
|
|
17777
17843
|
// package.json
|
|
17778
17844
|
var package_default = {
|
|
17779
17845
|
name: "opencode-swarm",
|
|
17780
|
-
version: "7.113.
|
|
17846
|
+
version: "7.113.3",
|
|
17781
17847
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
17782
17848
|
main: "dist/index.js",
|
|
17783
17849
|
types: "dist/index.d.ts",
|
|
@@ -17817,6 +17883,7 @@ var package_default = {
|
|
|
17817
17883
|
files: [
|
|
17818
17884
|
"dist",
|
|
17819
17885
|
"dist/lang/grammars",
|
|
17886
|
+
"binaries",
|
|
17820
17887
|
".opencode/skills/brainstorm",
|
|
17821
17888
|
".opencode/skills/specify",
|
|
17822
17889
|
".opencode/skills/clarify-spec",
|
|
@@ -18818,10 +18885,19 @@ async function getSandboxStatus() {
|
|
|
18818
18885
|
const executor = await _internals24.getSandboxExecutor();
|
|
18819
18886
|
const hasExecutor = executor !== null;
|
|
18820
18887
|
if (hasExecutor) {
|
|
18888
|
+
const executorStrength = executor?.strength;
|
|
18889
|
+
const strength = executorStrength === "weak" || executorStrength === "advisory" ? "advisory" : capability.strength ?? executorStrength ?? "strong";
|
|
18890
|
+
if (strength === "advisory") {
|
|
18891
|
+
return {
|
|
18892
|
+
name: "Sandbox",
|
|
18893
|
+
status: "\u26A0\uFE0F",
|
|
18894
|
+
detail: `Mechanism: ${mechanism.toLowerCase()} | Available: advisory only | Strength: ADVISORY (env-scrub, NOT kernel-enforced) | Commands are NOT strongly sandboxed`
|
|
18895
|
+
};
|
|
18896
|
+
}
|
|
18821
18897
|
return {
|
|
18822
18898
|
name: "Sandbox",
|
|
18823
18899
|
status: "\u2705",
|
|
18824
|
-
detail: `Mechanism: ${mechanism.toLowerCase()} | Available: yes | Sandboxing commands: yes`
|
|
18900
|
+
detail: `Mechanism: ${mechanism.toLowerCase()} | Available: yes | Strength: strong (kernel-enforced) | Sandboxing commands: yes`
|
|
18825
18901
|
};
|
|
18826
18902
|
}
|
|
18827
18903
|
if (mechanism !== "none") {
|
|
@@ -19237,7 +19313,7 @@ async function handleDoctorCommand(directory, args) {
|
|
|
19237
19313
|
const result = runConfigDoctor(config, directory);
|
|
19238
19314
|
let output;
|
|
19239
19315
|
if (enableAutoFix && result.hasAutoFixableIssues) {
|
|
19240
|
-
const { runConfigDoctorWithFixes } = await import("./config-doctor-
|
|
19316
|
+
const { runConfigDoctorWithFixes } = await import("./config-doctor-xbdfrbwt.js");
|
|
19241
19317
|
const fixResult = await runConfigDoctorWithFixes(directory, config, true);
|
|
19242
19318
|
output = formatDoctorMarkdown(fixResult.result);
|
|
19243
19319
|
} else {
|
|
@@ -20050,7 +20126,7 @@ async function handleEvidenceCommand(directory, args) {
|
|
|
20050
20126
|
return formatTaskEvidenceMarkdown(evidenceData);
|
|
20051
20127
|
}
|
|
20052
20128
|
async function handleEvidenceSummaryCommand(directory) {
|
|
20053
|
-
const { buildEvidenceSummary } = await import("./evidence-summary-service-
|
|
20129
|
+
const { buildEvidenceSummary } = await import("./evidence-summary-service-8g594znj.js");
|
|
20054
20130
|
const artifact = await buildEvidenceSummary(directory);
|
|
20055
20131
|
if (!artifact) {
|
|
20056
20132
|
return "No plan found. Run `/swarm plan` to check plan status.";
|
|
@@ -26848,7 +26924,7 @@ var DISPATCH_FRAMEWORK_MAP = {
|
|
|
26848
26924
|
};
|
|
26849
26925
|
async function detectTestFrameworkViaDispatch(cwd) {
|
|
26850
26926
|
try {
|
|
26851
|
-
const { pickBackend } = await import("./dispatch-
|
|
26927
|
+
const { pickBackend } = await import("./dispatch-mczsxy5s.js");
|
|
26852
26928
|
const backend = await pickBackend(cwd);
|
|
26853
26929
|
if (!backend?.selectTestFramework)
|
|
26854
26930
|
return "none";
|
|
@@ -26864,7 +26940,7 @@ async function buildTestCommandViaDispatch(framework, scope, files, coverage, ba
|
|
|
26864
26940
|
if (framework === "none")
|
|
26865
26941
|
return null;
|
|
26866
26942
|
try {
|
|
26867
|
-
const { pickBackend } = await import("./dispatch-
|
|
26943
|
+
const { pickBackend } = await import("./dispatch-mczsxy5s.js");
|
|
26868
26944
|
const backend = await pickBackend(baseDir);
|
|
26869
26945
|
if (backend?.buildTestCommand) {
|
|
26870
26946
|
const cmd = backend.buildTestCommand(framework, files, baseDir, {
|
|
@@ -26884,7 +26960,7 @@ async function parseTestOutputViaDispatch(framework, output, baseDir) {
|
|
|
26884
26960
|
if (framework === "none")
|
|
26885
26961
|
return null;
|
|
26886
26962
|
try {
|
|
26887
|
-
const { pickBackend } = await import("./dispatch-
|
|
26963
|
+
const { pickBackend } = await import("./dispatch-mczsxy5s.js");
|
|
26888
26964
|
const backend = await pickBackend(baseDir);
|
|
26889
26965
|
if (!backend?.parseTestOutput)
|
|
26890
26966
|
return null;
|
|
@@ -29517,12 +29593,14 @@ class AutomationQueue {
|
|
|
29517
29593
|
defaultBackoffMs;
|
|
29518
29594
|
maxBackoffMs;
|
|
29519
29595
|
eventBus;
|
|
29596
|
+
overflowStrategy;
|
|
29520
29597
|
itemCounter = 0;
|
|
29521
29598
|
constructor(config) {
|
|
29522
29599
|
this.maxSize = config?.maxSize ?? 1000;
|
|
29523
29600
|
this.defaultMaxRetries = config?.defaultMaxRetries ?? 3;
|
|
29524
29601
|
this.defaultBackoffMs = config?.defaultBackoffMs ?? 1000;
|
|
29525
29602
|
this.maxBackoffMs = config?.maxBackoffMs ?? 60000;
|
|
29603
|
+
this.overflowStrategy = config?.overflowStrategy ?? "throw";
|
|
29526
29604
|
this.eventBus = getGlobalEventBus();
|
|
29527
29605
|
}
|
|
29528
29606
|
generateId() {
|
|
@@ -29530,7 +29608,20 @@ class AutomationQueue {
|
|
|
29530
29608
|
}
|
|
29531
29609
|
enqueue(payload, priority = "normal", metadata) {
|
|
29532
29610
|
if (this.items.length >= this.maxSize) {
|
|
29533
|
-
|
|
29611
|
+
if (this.overflowStrategy === "evict-oldest") {
|
|
29612
|
+
let oldestIdx = 0;
|
|
29613
|
+
for (let i = 1;i < this.items.length; i++) {
|
|
29614
|
+
if (this.items[i].createdAt < this.items[oldestIdx].createdAt) {
|
|
29615
|
+
oldestIdx = i;
|
|
29616
|
+
}
|
|
29617
|
+
}
|
|
29618
|
+
const [evicted] = this.items.splice(oldestIdx, 1);
|
|
29619
|
+
if (evicted) {
|
|
29620
|
+
this.eventBus.publish("queue.item.evicted", { itemId: evicted.id });
|
|
29621
|
+
}
|
|
29622
|
+
} else {
|
|
29623
|
+
throw new Error(`Queue is full (max ${this.maxSize} items)`);
|
|
29624
|
+
}
|
|
29534
29625
|
}
|
|
29535
29626
|
const item = {
|
|
29536
29627
|
id: this.generateId(),
|
|
@@ -32618,7 +32709,7 @@ function buildDetailedHelp(commandName, entry) {
|
|
|
32618
32709
|
async function handleHelpCommand(ctx) {
|
|
32619
32710
|
const targetCommand = ctx.args.join(" ");
|
|
32620
32711
|
if (!targetCommand) {
|
|
32621
|
-
const { buildHelpText } = await import("./index-
|
|
32712
|
+
const { buildHelpText } = await import("./index-hw4tcxs9.js");
|
|
32622
32713
|
return buildHelpText();
|
|
32623
32714
|
}
|
|
32624
32715
|
const tokens = targetCommand.split(/\s+/);
|
|
@@ -32627,7 +32718,7 @@ async function handleHelpCommand(ctx) {
|
|
|
32627
32718
|
return _internals48.buildDetailedHelp(resolved.key, resolved.entry);
|
|
32628
32719
|
}
|
|
32629
32720
|
const similar = _internals48.findSimilarCommands(targetCommand);
|
|
32630
|
-
const { buildHelpText: fullHelp } = await import("./index-
|
|
32721
|
+
const { buildHelpText: fullHelp } = await import("./index-hw4tcxs9.js");
|
|
32631
32722
|
if (similar.length > 0) {
|
|
32632
32723
|
return `Command '/swarm ${targetCommand}' not found.
|
|
32633
32724
|
|
|
@@ -32760,7 +32851,7 @@ var COMMAND_REGISTRY = {
|
|
|
32760
32851
|
},
|
|
32761
32852
|
"guardrail explain": {
|
|
32762
32853
|
handler: async (ctx) => {
|
|
32763
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
32854
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-kabd97j8.js");
|
|
32764
32855
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
32765
32856
|
},
|
|
32766
32857
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -32768,9 +32859,19 @@ var COMMAND_REGISTRY = {
|
|
|
32768
32859
|
toolPolicy: "agent",
|
|
32769
32860
|
toolNoArgs: false
|
|
32770
32861
|
},
|
|
32862
|
+
"guardrail-explain": {
|
|
32863
|
+
handler: async (ctx) => {
|
|
32864
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-kabd97j8.js");
|
|
32865
|
+
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
32866
|
+
},
|
|
32867
|
+
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
32868
|
+
category: "diagnostics",
|
|
32869
|
+
aliasOf: "guardrail explain",
|
|
32870
|
+
deprecated: true
|
|
32871
|
+
},
|
|
32771
32872
|
"guardrail-log": {
|
|
32772
32873
|
handler: async (ctx) => {
|
|
32773
|
-
const { handleGuardrailLog } = await import("./guardrail-log-
|
|
32874
|
+
const { handleGuardrailLog } = await import("./guardrail-log-qfc2j0tb.js");
|
|
32774
32875
|
return handleGuardrailLog(ctx.directory, ctx.args);
|
|
32775
32876
|
},
|
|
32776
32877
|
description: "Read the guardrail decision log (use --blocks-only for blocks)",
|
|
@@ -36019,6 +36120,9 @@ function dcStripOneWrapper(cmd) {
|
|
|
36019
36120
|
const shellMatch = /^(?:bash|sh|zsh|dash|fish)(?:\.exe)?\s+-c\s+"?(.*?)"?\s*$/is.exec(t);
|
|
36020
36121
|
if (shellMatch)
|
|
36021
36122
|
return shellMatch[1].trim();
|
|
36123
|
+
const evalMatch = /^eval\s+(.+)$/is.exec(t);
|
|
36124
|
+
if (evalMatch)
|
|
36125
|
+
return evalMatch[1].replace(/^["']|["']$/g, "").trim();
|
|
36022
36126
|
const prefixMatch = /^(?:sudo|time|nohup)\s+(.+)$/is.exec(t) ?? /^env(?:\s+[A-Za-z_][A-Za-z0-9_]*=[^\s]*)*\s+(.+)$/is.exec(t) ?? /^nice\s+(?:-n\s+\d+\s+)?(.+)$/is.exec(t);
|
|
36023
36127
|
if (prefixMatch)
|
|
36024
36128
|
return prefixMatch[1].trim();
|
|
@@ -36080,6 +36184,15 @@ function dcSplitSegments(cmd) {
|
|
|
36080
36184
|
current = "";
|
|
36081
36185
|
continue;
|
|
36082
36186
|
}
|
|
36187
|
+
if (ch === "&" && next !== "&") {
|
|
36188
|
+
const prev = cmd[i - 1];
|
|
36189
|
+
const isFdRedirect = prev === ">" || next === ">";
|
|
36190
|
+
if (!isFdRedirect) {
|
|
36191
|
+
segments.push(current.trim());
|
|
36192
|
+
current = "";
|
|
36193
|
+
continue;
|
|
36194
|
+
}
|
|
36195
|
+
}
|
|
36083
36196
|
}
|
|
36084
36197
|
current += ch;
|
|
36085
36198
|
}
|
|
@@ -38727,7 +38840,7 @@ function hasActiveEpicMode(sessionID) {
|
|
|
38727
38840
|
async function rehydratePrSubscriptions(sessionID, directory) {
|
|
38728
38841
|
const map = new Map;
|
|
38729
38842
|
try {
|
|
38730
|
-
const { listActive: listActive2 } = await import("./pr-subscriptions-
|
|
38843
|
+
const { listActive: listActive2 } = await import("./pr-subscriptions-vwv7zm2p.js");
|
|
38731
38844
|
const records = await listActive2(directory);
|
|
38732
38845
|
for (const record of records) {
|
|
38733
38846
|
if (record.sessionID !== sessionID)
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./index-a76rekgs.js";
|
|
3
|
-
|
|
4
2
|
// src/background/workspace-snapshot.ts
|
|
5
3
|
import * as child_process from "child_process";
|
|
6
4
|
import { createHash } from "crypto";
|
|
@@ -19,6 +17,30 @@ function runGit(directory, args) {
|
|
|
19
17
|
return null;
|
|
20
18
|
return typeof result.stdout === "string" ? result.stdout.trimEnd() : null;
|
|
21
19
|
}
|
|
20
|
+
function parseNulPaths(output) {
|
|
21
|
+
return output.split("\x00").filter((entry) => entry.length > 0);
|
|
22
|
+
}
|
|
23
|
+
function parsePorcelainPaths(output) {
|
|
24
|
+
const entries = parseNulPaths(output);
|
|
25
|
+
const paths = [];
|
|
26
|
+
for (let index = 0;index < entries.length; index++) {
|
|
27
|
+
const entry = entries[index];
|
|
28
|
+
if (entry.length < 4 || entry[2] !== " ")
|
|
29
|
+
return null;
|
|
30
|
+
const status = entry.slice(0, 2);
|
|
31
|
+
const changedPath = entry.slice(3);
|
|
32
|
+
if (!changedPath)
|
|
33
|
+
return null;
|
|
34
|
+
paths.push(changedPath);
|
|
35
|
+
if (status.includes("R") || status.includes("C")) {
|
|
36
|
+
const originalPath = entries[++index];
|
|
37
|
+
if (!originalPath)
|
|
38
|
+
return null;
|
|
39
|
+
paths.push(originalPath);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return [...new Set(paths)];
|
|
43
|
+
}
|
|
22
44
|
function captureWorkspaceSnapshot(directory, optionsOrScope = null, prHeadShaArg = null) {
|
|
23
45
|
const scope = typeof optionsOrScope === "object" && optionsOrScope !== null ? optionsOrScope.scope ?? null : optionsOrScope;
|
|
24
46
|
const prHeadSha = (() => {
|
|
@@ -34,16 +56,43 @@ function captureWorkspaceSnapshot(directory, optionsOrScope = null, prHeadShaArg
|
|
|
34
56
|
const porcelain = runGit(directory, [
|
|
35
57
|
"status",
|
|
36
58
|
"--porcelain=v1",
|
|
59
|
+
"-z",
|
|
37
60
|
"--untracked-files=all"
|
|
38
61
|
]);
|
|
62
|
+
const changedFiles = porcelain === null ? null : parsePorcelainPaths(porcelain);
|
|
39
63
|
return {
|
|
40
64
|
directory: path.resolve(directory),
|
|
41
65
|
gitHead,
|
|
42
66
|
dirtyHash: porcelain === null ? null : digest(porcelain),
|
|
67
|
+
changedFiles,
|
|
43
68
|
prHeadSha,
|
|
44
69
|
scope
|
|
45
70
|
};
|
|
46
71
|
}
|
|
72
|
+
function changedFilesSinceSnapshot(directory, baseline) {
|
|
73
|
+
if (!baseline?.gitHead || baseline.changedFiles == null)
|
|
74
|
+
return null;
|
|
75
|
+
if (baseline.changedFiles.length > 0)
|
|
76
|
+
return null;
|
|
77
|
+
const current = captureWorkspaceSnapshot(directory);
|
|
78
|
+
if (!current.gitHead || current.changedFiles == null)
|
|
79
|
+
return null;
|
|
80
|
+
const changed = new Set(current.changedFiles);
|
|
81
|
+
if (baseline.gitHead !== current.gitHead) {
|
|
82
|
+
const committed = runGit(directory, [
|
|
83
|
+
"diff",
|
|
84
|
+
"--name-only",
|
|
85
|
+
"-z",
|
|
86
|
+
baseline.gitHead,
|
|
87
|
+
current.gitHead
|
|
88
|
+
]);
|
|
89
|
+
if (committed === null)
|
|
90
|
+
return null;
|
|
91
|
+
for (const changedPath of parseNulPaths(committed))
|
|
92
|
+
changed.add(changedPath);
|
|
93
|
+
}
|
|
94
|
+
return [...changed];
|
|
95
|
+
}
|
|
47
96
|
function workspaceSnapshotMatches(expected, current) {
|
|
48
97
|
if (!expected)
|
|
49
98
|
return { ok: true };
|
|
@@ -80,11 +129,5 @@ function digest(text) {
|
|
|
80
129
|
var _internals = {
|
|
81
130
|
spawnSync: child_process.spawnSync
|
|
82
131
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
digest,
|
|
86
|
-
compareWorkspaceSnapshots,
|
|
87
|
-
compareWorkspaceSnapshot,
|
|
88
|
-
captureWorkspaceSnapshot,
|
|
89
|
-
_internals
|
|
90
|
-
};
|
|
132
|
+
|
|
133
|
+
export { parsePorcelainPaths, captureWorkspaceSnapshot, changedFilesSinceSnapshot, workspaceSnapshotMatches, compareWorkspaceSnapshot, compareWorkspaceSnapshots, digest, _internals };
|