opencode-swarm 7.21.1 → 7.21.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/dist/cli/index.js +1 -1
- package/dist/index.js +73 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var package_default;
|
|
|
34
34
|
var init_package = __esm(() => {
|
|
35
35
|
package_default = {
|
|
36
36
|
name: "opencode-swarm",
|
|
37
|
-
version: "7.21.
|
|
37
|
+
version: "7.21.3",
|
|
38
38
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
39
39
|
main: "dist/index.js",
|
|
40
40
|
types: "dist/index.d.ts",
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var package_default;
|
|
|
33
33
|
var init_package = __esm(() => {
|
|
34
34
|
package_default = {
|
|
35
35
|
name: "opencode-swarm",
|
|
36
|
-
version: "7.21.
|
|
36
|
+
version: "7.21.3",
|
|
37
37
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
38
38
|
main: "dist/index.js",
|
|
39
39
|
types: "dist/index.d.ts",
|
|
@@ -24285,7 +24285,7 @@ function getMostRecentAssistantText(messages) {
|
|
|
24285
24285
|
function isTransientProviderFailureText(text) {
|
|
24286
24286
|
if (!text.trim())
|
|
24287
24287
|
return false;
|
|
24288
|
-
const providerFailureMarker = /provider[_\s-]?unavailable|network\s+connection\s+lost/i.test(text);
|
|
24288
|
+
const providerFailureMarker = /provider[_\s-]?unavailable|network\s+connection\s+lost|ECONNRESET|ECONNREFUSED|ETIMEDOUT|EPIPE|ENOTFOUND|broken.?pipe|dns(?:[\s_-]+(?:resolution)?)?[\s_-]+fail|name.?not.?resolved|EAI_AGAIN|connection\s+reset|connection\s+refused/i.test(text);
|
|
24289
24289
|
if (!providerFailureMarker)
|
|
24290
24290
|
return false;
|
|
24291
24291
|
const status = extractStatusCode(text);
|
|
@@ -24922,6 +24922,46 @@ function createGuardrailsHooks(directory, directoryOrConfig, config2, authorityC
|
|
|
24922
24922
|
if (/^mkfs[./]/.test(seg)) {
|
|
24923
24923
|
throw new Error(`BLOCKED: Disk format command (mkfs) detected — disk formatting operation`);
|
|
24924
24924
|
}
|
|
24925
|
+
if (/^\\?mv\s/i.test(seg)) {
|
|
24926
|
+
const mvMatch = seg.match(/^\\?mv\s+(.+)$/i);
|
|
24927
|
+
if (mvMatch) {
|
|
24928
|
+
const argsStr = mvMatch[1];
|
|
24929
|
+
const strippedArgs = argsStr.replace(/["']/g, "");
|
|
24930
|
+
if (/\.swarm(?:[\x5c/\s]|$)/.test(strippedArgs)) {
|
|
24931
|
+
throw new Error(`BLOCKED: "mv" targeting .swarm/ detected — move operations under .swarm/ are not allowed from shell commands`);
|
|
24932
|
+
}
|
|
24933
|
+
}
|
|
24934
|
+
}
|
|
24935
|
+
if (/^\\?(?:move|ren)(?:\.exe)?\s/i.test(seg)) {
|
|
24936
|
+
const moveMatch = seg.match(/^\\?(?:move|ren)(?:\.exe)?\s+(.+)$/i);
|
|
24937
|
+
if (moveMatch) {
|
|
24938
|
+
const argsStr = moveMatch[1].replace(/["']/g, "");
|
|
24939
|
+
if (/\.swarm(?:[\x5c/\s]|$)/i.test(argsStr)) {
|
|
24940
|
+
throw new Error(`BLOCKED: "move" or "ren" targeting .swarm/ detected — move/rename operations under .swarm/ are not allowed from shell commands`);
|
|
24941
|
+
}
|
|
24942
|
+
}
|
|
24943
|
+
}
|
|
24944
|
+
if (/^\\?(?:Move-Item|Rename-Item|move|mi|mv|ren|rni)\b.*\.swarm(?:[\x5c/\s]|$)/i.test(seg)) {
|
|
24945
|
+
throw new Error(`BLOCKED: PowerShell Move-Item or Rename-Item targeting .swarm/ detected — move/rename operations under .swarm/ are not allowed from shell commands`);
|
|
24946
|
+
}
|
|
24947
|
+
if (/^\\?rm\b/i.test(seg) && !/^\\?rm\s+(?:-[a-zA-Z]*[rR][a-zA-Z]*|--recursive)\b/i.test(seg) && /\.swarm(?:[\x5c/\s]|$)/i.test(seg)) {
|
|
24948
|
+
throw new Error(`BLOCKED: "rm" targeting .swarm/ detected — deleting files under .swarm/ is not allowed from shell commands`);
|
|
24949
|
+
}
|
|
24950
|
+
if (/\bcp\b.*\.swarm(?:[\x5c/\s]|$)/i.test(seg) && /\brm\b.*\.swarm(?:[\x5c/\s]|$)/i.test(seg)) {
|
|
24951
|
+
throw new Error(`BLOCKED: "cp" of .swarm/ file followed by "rm" of .swarm/ source detected — copy-and-delete bypass is not allowed`);
|
|
24952
|
+
}
|
|
24953
|
+
if (/^rsync\b.*--remove-source-files\b/i.test(seg) && /\.swarm(?:[\x5c/\s]|$)/i.test(seg)) {
|
|
24954
|
+
throw new Error(`BLOCKED: "rsync" with delete-source flag targeting .swarm/ detected — archive with source deletion under .swarm/ is not allowed`);
|
|
24955
|
+
}
|
|
24956
|
+
if (/^tar\b.*--remove-files\b/i.test(seg) && /\.swarm(?:[\x5c/\s]|$)/i.test(seg)) {
|
|
24957
|
+
throw new Error(`BLOCKED: "tar" with delete-source flag targeting .swarm/ detected — archive with source deletion under .swarm/ is not allowed`);
|
|
24958
|
+
}
|
|
24959
|
+
if (/^zip\b.*\s-m\b/i.test(seg) && /\.swarm(?:[\x5c/\s]|$)/i.test(seg)) {
|
|
24960
|
+
throw new Error(`BLOCKED: "zip" with delete-source flag targeting .swarm/ detected — archive with source deletion under .swarm/ is not allowed`);
|
|
24961
|
+
}
|
|
24962
|
+
if (/^7z\b.*\s-sdel\b/i.test(seg) && /\.swarm(?:[\x5c/\s]|$)/i.test(seg)) {
|
|
24963
|
+
throw new Error(`BLOCKED: "7z" with delete-source flag targeting .swarm/ detected — archive with source deletion under .swarm/ is not allowed`);
|
|
24964
|
+
}
|
|
24925
24965
|
}
|
|
24926
24966
|
}
|
|
24927
24967
|
async function checkGateLimits(params) {
|
|
@@ -25722,6 +25762,35 @@ ${textPart2.text}`;
|
|
|
25722
25762
|
}
|
|
25723
25763
|
session.pendingAdvisoryMessages = [];
|
|
25724
25764
|
} else if (!isArchitectSession && session && (session.pendingAdvisoryMessages?.length ?? 0) > 0) {
|
|
25765
|
+
const allAdvisories = session.pendingAdvisoryMessages ?? [];
|
|
25766
|
+
const TRANSIENT_PREFIXES = [
|
|
25767
|
+
"TRANSIENT ERROR:",
|
|
25768
|
+
"MODEL FALLBACK:",
|
|
25769
|
+
"DEGRADED:"
|
|
25770
|
+
];
|
|
25771
|
+
const transientAdvisories = allAdvisories.filter((m) => TRANSIENT_PREFIXES.some((p) => m.startsWith(p)));
|
|
25772
|
+
if (transientAdvisories.length > 0) {
|
|
25773
|
+
let targetMsg = systemMessages[0];
|
|
25774
|
+
if (!targetMsg) {
|
|
25775
|
+
const newMsg = {
|
|
25776
|
+
info: { role: "system" },
|
|
25777
|
+
parts: [{ type: "text", text: "" }]
|
|
25778
|
+
};
|
|
25779
|
+
messages.unshift(newMsg);
|
|
25780
|
+
targetMsg = newMsg;
|
|
25781
|
+
}
|
|
25782
|
+
const textPart2 = (targetMsg.parts ?? []).find((part) => part.type === "text" && typeof part.text === "string");
|
|
25783
|
+
if (textPart2) {
|
|
25784
|
+
const joined = transientAdvisories.join(`
|
|
25785
|
+
---
|
|
25786
|
+
`);
|
|
25787
|
+
textPart2.text = `[ADVISORIES]
|
|
25788
|
+
${joined}
|
|
25789
|
+
[/ADVISORIES]
|
|
25790
|
+
|
|
25791
|
+
${textPart2.text}`;
|
|
25792
|
+
}
|
|
25793
|
+
}
|
|
25725
25794
|
session.pendingAdvisoryMessages = [];
|
|
25726
25795
|
}
|
|
25727
25796
|
if (isArchitectSession && session?.prmHardStopPending) {
|
|
@@ -26197,7 +26266,7 @@ var init_guardrails = __esm(() => {
|
|
|
26197
26266
|
]);
|
|
26198
26267
|
storedInputArgs = new Map;
|
|
26199
26268
|
TRANSIENT_STATUS_CODES = new Set([408, 429, 500, 502, 503, 504, 529]);
|
|
26200
|
-
TRANSIENT_MODEL_ERROR_PATTERN = /rate.?limit|429|500|502|503|504|529|timeout|overloaded|model.?not.?found|temporarily.?unavailable|provider[_\s-]?unavailable|server.?error|network.?connection.?lost|connection.?(refused|reset|timeout|lost)|bad.?gateway|gateway.?timeout|internal.?server.?error|service.?unavailable/i;
|
|
26269
|
+
TRANSIENT_MODEL_ERROR_PATTERN = /rate.?limit|429|500|502|503|504|529|timeout|overloaded|model.?not.?found|temporarily.?unavailable|provider[_\s-]?unavailable|server.?error|network.?connection.?lost|connection.?(refused|reset|timeout|lost)|bad.?gateway|gateway.?timeout|internal.?server.?error|service.?unavailable|ECONNRESET|ECONNREFUSED|ETIMEDOUT|EPIPE|ENOTFOUND|broken.?pipe|dns(?:[\s_-]+(?:resolution)?)?[\s_-]+fail|name.?not.?resolved|EAI_AGAIN/i;
|
|
26201
26270
|
DEGRADED_ERROR_PATTERN = /context.?length|token.?(limit|budget)|input.?too.?long|content.?filter|exceeds?.?(maximum.?)?tokens|maximum.?context|context.?window|too.?many.?tokens|prompt.?too.?long|message.?too.?long|request.?too.?large|max.?tokens/i;
|
|
26202
26271
|
CONTENT_FILTER_PATTERN = /content.?filter/i;
|
|
26203
26272
|
toolCallsSinceLastWrite = new Map;
|
|
@@ -62574,6 +62643,7 @@ If a tool modifies a file, it is a CODER tool. Delegate.
|
|
|
62574
62643
|
- Before you delegate a coding task, call declare_scope with { taskId, files } where \`files\` is the exact list of paths the coder is allowed to write. Bundle any generated/lockfile paths that the change will produce (e.g. package-lock.json, Cargo.lock, dist/*).
|
|
62575
62644
|
- If coder returns "WRITE BLOCKED" for a path outside the declared list: call declare_scope again with the missing path added. Do NOT instruct the coder to use bash, sed, echo, cat, tee, dd, or any interpreter eval (python -c, node -e, bun -e, ruby -e) to bypass the block. Those routes bypass the authority check and violate scope discipline.
|
|
62576
62645
|
- Never wrap a file write in eval, bash -c, sh -c, a subshell, or a heredoc-to-file redirect. Those are bash workarounds and are banned even when scope appears to permit them — the write-authority guard is tool-scoped; bash is unguarded and must not be used as a write path.
|
|
62646
|
+
- Do NOT use mv, Move-Item, move, ren, Rename-Item, or cp-then-rm chains to relocate, rename, or delete files under \`.swarm/\` as a workaround for blocked destructive commands. Those are file-move shell bypasses and are banned. Use the tool's dedicated tools (\`.swarm/\` file management or evidence manager tools) instead.
|
|
62577
62647
|
- If you cannot enumerate files up front (e.g. a broad refactor), declare the containing directories — declare_scope accepts directory entries and grants containment.
|
|
62578
62648
|
- Rationale: declare_scope persists the allowed set to disk (.swarm/scopes/scope-\${taskId}.json) so it survives cross-process delegation. Without a call, the coder process reads an empty scope and every Edit/Write is denied.
|
|
62579
62649
|
<!-- BEHAVIORAL_GUIDANCE_END -->
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.21.
|
|
3
|
+
"version": "7.21.3",
|
|
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",
|