opencode-swarm 7.138.3 → 7.139.0
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/execute/SKILL.md +11 -2
- package/.opencode/skills/swarm-implement/SKILL.md +1 -1
- package/dist/cli/{config-doctor-2mwgdbsn.js → config-doctor-aszp7z1h.js} +2 -2
- package/dist/cli/{core-v6bte964.js → core-3s832mxx.js} +1 -1
- package/dist/cli/{curation-policy-5dqexw5j.js → curation-policy-a3hs73f7.js} +6 -6
- package/dist/cli/{curator-llm-factory-wkjme59b.js → curator-llm-factory-e8ngwyjm.js} +26 -25
- package/dist/cli/{curator-jjtp9hn2.js → curator-zxjqcc8r.js} +26 -25
- package/dist/cli/{evidence-summary-service-6cttrkzw.js → evidence-summary-service-qfhjfxdz.js} +7 -7
- package/dist/cli/{gate-evidence-ecx4djaw.js → gate-evidence-m2grv70v.js} +4 -4
- package/dist/cli/{guardrail-explain-xppwfnxr.js → guardrail-explain-rqpmzxyy.js} +27 -26
- package/dist/cli/{guardrail-log-swet7rch.js → guardrail-log-vd4a0ng5.js} +4 -3
- package/dist/cli/{hive-promoter-xvq8jzbs.js → hive-promoter-jc5vym27.js} +26 -25
- package/dist/cli/{index-tc61fybd.js → index-0tsetsxs.js} +4 -4
- package/dist/cli/{index-jhb8kjc5.js → index-3nr2sn32.js} +3 -3
- package/dist/cli/{index-y06a43sk.js → index-4ft523nb.js} +323 -80
- package/dist/cli/index-556ja8an.js +62 -0
- package/dist/cli/{index-31vfewmn.js → index-5bkpyvdf.js} +271 -94
- package/dist/cli/{index-wqg74mwj.js → index-67yqywan.js} +2 -2
- package/dist/cli/{index-gda7cwqz.js → index-6q240xgm.js} +30 -68
- package/dist/cli/{index-adde7nm2.js → index-84s6x604.js} +5 -5
- package/dist/cli/{index-j0xx9wpj.js → index-85hstja2.js} +1 -1
- package/dist/cli/{index-xybtaph7.js → index-a614s16f.js} +1 -1
- package/dist/cli/{index-10mz5js6.js → index-chvqee1j.js} +2 -2
- package/dist/cli/{index-rrxcfxrd.js → index-ddmnhv4h.js} +1 -1
- package/dist/cli/{index-1v89yst3.js → index-gytyqv1d.js} +2 -2
- package/dist/cli/{index-93ky909v.js → index-kv36s0x0.js} +3 -3
- package/dist/cli/{index-z7jgvm9b.js → index-nbgw5dxa.js} +1 -1
- package/dist/cli/{index-tqshdzaw.js → index-nc544sfw.js} +1 -1
- package/dist/cli/{index-js7th5my.js → index-nsnfvckc.js} +1 -1
- package/dist/cli/{index-4fmztnrq.js → index-p2dz85tv.js} +2 -2
- package/dist/cli/{index-y6dvs5tt.js → index-q3qtgtd0.js} +1 -1
- package/dist/cli/{index-99af5gvd.js → index-r3pth9a7.js} +230 -118
- package/dist/cli/{index-ab57h0yq.js → index-rtetrxxq.js} +1 -1
- package/dist/cli/{index-rjratees.js → index-s428dmy6.js} +2 -2
- package/dist/cli/{index-q344kj84.js → index-t26nfmcs.js} +1 -1
- package/dist/cli/{index-1djv5684.js → index-t31cc7kv.js} +6 -6
- package/dist/cli/{index-39k6y018.js → index-tcdcj1g2.js} +2 -2
- package/dist/cli/{index-en4fb04r.js → index-tyh0p5e8.js} +1 -1
- package/dist/cli/{index-xgmx9had.js → index-y46anh5e.js} +28 -27
- package/dist/cli/index-ymszzvnr.js +1725 -0
- package/dist/cli/{index-ngqxzkqm.js → index-z1tkxzq4.js} +2 -2
- package/dist/cli/{index-btx8j39p.js → index-zd15ya1w.js} +1 -1
- package/dist/cli/index.js +26 -25
- package/dist/cli/{knowledge-escalator-7n384ys1.js → knowledge-escalator-6473ey4c.js} +7 -7
- package/dist/cli/{knowledge-events-yaj0yjd6.js → knowledge-events-wwzpz8m4.js} +5 -5
- package/dist/cli/{knowledge-link-xc6yhxmz.js → knowledge-link-trfydkzm.js} +4 -4
- package/dist/cli/{knowledge-store-d99k0z2d.js → knowledge-store-99gd42jy.js} +5 -5
- package/dist/cli/{knowledge-validator-e5fqy9h4.js → knowledge-validator-v2eevvdg.js} +8 -8
- package/dist/cli/{pending-delegations-7dbc0j2a.js → pending-delegations-p6n83x67.js} +3 -3
- package/dist/cli/{pr-subscriptions-m943zn6g.js → pr-subscriptions-xbrfr51c.js} +3 -3
- package/dist/cli/{runner-x1hy047y.js → runner-9an52tmz.js} +5 -5
- package/dist/cli/{scan-cursor-9y9msabt.js → scan-cursor-39zxpw34.js} +6 -6
- package/dist/cli/{schema-xg5f11md.js → schema-xhfwr6b2.js} +1 -1
- package/dist/cli/scope-persistence-nsa6ra9s.js +61 -0
- package/dist/cli/{skill-generator-arvwfdfh.js → skill-generator-5px81476.js} +9 -9
- package/dist/cli/{telemetry-0yqed3jv.js → telemetry-7nt7zhyp.js} +1 -1
- package/dist/cli/{worktree-collision-ownership-hjrt5hx2.js → worktree-collision-ownership-9x4s4890.js} +3 -3
- package/dist/hooks/guardrails/destructive-command.d.ts +35 -0
- package/dist/hooks/guardrails/file-authority.d.ts +71 -26
- package/dist/hooks/guardrails/index.d.ts +2 -0
- package/dist/hooks/guardrails/tool-before.d.ts +5 -0
- package/dist/hooks/scope-guard.d.ts +3 -1
- package/dist/index.js +533 -522
- package/dist/plan/manager.d.ts +2 -0
- package/dist/scope/path-identity.d.ts +27 -0
- package/dist/scope/scope-binding.d.ts +90 -2
- package/dist/scope/scope-lease-renewal.d.ts +28 -0
- package/dist/scope/scope-persistence.d.ts +102 -19
- package/dist/scope/scope-resolution-diagnostic.d.ts +7 -0
- package/dist/services/run-memory.d.ts +53 -5
- package/dist/tools/declare-scope.d.ts +3 -1
- package/dist/tools/save-plan.d.ts +2 -0
- package/dist/tools/update-task-status.d.ts +2 -0
- package/dist/turbo/lean/lane-scope.d.ts +1 -1
- package/dist/utils/path-security.d.ts +25 -1
- package/package.json +1 -1
- package/dist/cli/index-2y4jy0de.js +0 -642
- package/dist/cli/scope-persistence-n1bryhzf.js +0 -38
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
DC_SAFE_TARGETS,
|
|
4
3
|
HUMAN_ONLY_SWARM_COMMANDS,
|
|
5
4
|
dcCheckJunctionCreation,
|
|
5
|
+
dcEvaluateRecursiveDeleteTargets,
|
|
6
6
|
dcExtractPowerShellTargets,
|
|
7
|
+
dcExtractRecursiveRmTargets,
|
|
7
8
|
dcExtractWindowsCmdTargets,
|
|
8
9
|
dcNormalizeCommand,
|
|
9
10
|
dcSplitSegments,
|
|
10
11
|
dcUnwrapWrappers,
|
|
11
|
-
dcValidateTargets,
|
|
12
12
|
detectPosixWrites,
|
|
13
13
|
detectWindowsWrites,
|
|
14
14
|
resolveWriteTargets
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-r3pth9a7.js";
|
|
16
16
|
import {
|
|
17
17
|
checkFileAuthority,
|
|
18
18
|
classifyFile,
|
|
19
19
|
isInDeclaredScope,
|
|
20
20
|
redactPath,
|
|
21
21
|
redactShellCommand
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-5bkpyvdf.js";
|
|
23
23
|
|
|
24
24
|
// src/services/guardrail-explain-service.ts
|
|
25
25
|
import path from "path";
|
|
@@ -90,98 +90,60 @@ function evaluateDestructiveDecision(rawCommand, cwd, declaredScope) {
|
|
|
90
90
|
firingRule: "destructive_block: junction creation"
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const targetPart = rmAnyMatch[rmShortMatch ? 2 : 1].trim();
|
|
98
|
-
const targets = targetPart.split(/\s+/);
|
|
99
|
-
const validateBlock = dcValidateTargets(targets, cwd);
|
|
100
|
-
if (validateBlock) {
|
|
93
|
+
const targets = dcExtractRecursiveRmTargets(seg);
|
|
94
|
+
if (targets) {
|
|
95
|
+
const targetDecision = dcEvaluateRecursiveDeleteTargets({ targets, cwd });
|
|
96
|
+
if (!targetDecision.allowed) {
|
|
101
97
|
return {
|
|
102
98
|
decision: "block",
|
|
103
|
-
firingRule:
|
|
99
|
+
firingRule: `${targetDecision.code}: ${targetDecision.reason}`
|
|
104
100
|
};
|
|
105
101
|
}
|
|
106
|
-
const allSafe = targets.every((t) => DC_SAFE_TARGETS.has(t.replace(/^["']|["']$/g, "").trim()));
|
|
107
|
-
if (!allSafe) {
|
|
108
|
-
const scopeExempt = declaredScope != null && declaredScope.length > 0 && targets.every((t) => isInDeclaredScope(t.replace(/^["']|["']$/g, "").trim(), declaredScope, cwd));
|
|
109
|
-
if (!scopeExempt) {
|
|
110
|
-
return {
|
|
111
|
-
decision: "block",
|
|
112
|
-
firingRule: `destructive_block: rm recursive/force on unsafe path: ${redactPath(targetPart)}`
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
102
|
}
|
|
117
103
|
if (/^(?:rmdir|rd)(?:\.exe)?\s+.*\/[sS]/i.test(seg)) {
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
104
|
+
const targets2 = dcExtractWindowsCmdTargets(seg);
|
|
105
|
+
if (targets2.length === 0) {
|
|
120
106
|
return {
|
|
121
107
|
decision: "block",
|
|
122
108
|
firingRule: "destructive_block: Windows recursive directory delete (rmdir /s)"
|
|
123
109
|
};
|
|
124
110
|
}
|
|
125
|
-
const
|
|
126
|
-
if (
|
|
111
|
+
const targetDecision = dcEvaluateRecursiveDeleteTargets({ targets: targets2, cwd });
|
|
112
|
+
if (!targetDecision.allowed) {
|
|
127
113
|
return {
|
|
128
114
|
decision: "block",
|
|
129
|
-
firingRule:
|
|
115
|
+
firingRule: `${targetDecision.code}: ${targetDecision.reason}`
|
|
130
116
|
};
|
|
131
117
|
}
|
|
132
|
-
const allSafe = targets.every((t) => DC_SAFE_TARGETS.has(t.trim()));
|
|
133
|
-
if (!allSafe) {
|
|
134
|
-
const scopeExempt = declaredScope != null && declaredScope.length > 0 && targets.every((t) => isInDeclaredScope(t.trim(), declaredScope, cwd));
|
|
135
|
-
if (!scopeExempt) {
|
|
136
|
-
return {
|
|
137
|
-
decision: "block",
|
|
138
|
-
firingRule: `destructive_block: rmdir /s on unsafe path: ${redactPath(targets.join(", "))}`
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
118
|
}
|
|
143
119
|
if (/^del(?:\.exe)?\s+.*\/[sS]/i.test(seg)) {
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
146
|
-
const
|
|
147
|
-
|
|
120
|
+
const targets2 = dcExtractWindowsCmdTargets(seg);
|
|
121
|
+
if (targets2.length > 0) {
|
|
122
|
+
const targetDecision = dcEvaluateRecursiveDeleteTargets({
|
|
123
|
+
targets: targets2,
|
|
124
|
+
cwd
|
|
125
|
+
});
|
|
126
|
+
if (!targetDecision.allowed) {
|
|
148
127
|
return {
|
|
149
128
|
decision: "block",
|
|
150
|
-
firingRule:
|
|
129
|
+
firingRule: `${targetDecision.code}: ${targetDecision.reason}`
|
|
151
130
|
};
|
|
152
131
|
}
|
|
153
|
-
const allSafe = targets.every((t) => DC_SAFE_TARGETS.has(t.trim()));
|
|
154
|
-
if (!allSafe) {
|
|
155
|
-
const scopeExempt = declaredScope != null && declaredScope.length > 0 && targets.every((t) => isInDeclaredScope(t.trim(), declaredScope, cwd));
|
|
156
|
-
if (!scopeExempt) {
|
|
157
|
-
return {
|
|
158
|
-
decision: "block",
|
|
159
|
-
firingRule: `destructive_block: del /s on unsafe path: ${redactPath(targets.join(", "))}`
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
132
|
}
|
|
164
133
|
}
|
|
165
134
|
if (/^(?:Remove-Item|ri|rm|rmdir|del|erase|rd)\b.*-[Rr]ecurse\b/i.test(seg) || /^(?:Remove-Item|ri|rm|rmdir|del|erase|rd)\b.*-[Rr]\b/i.test(seg)) {
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
168
|
-
const
|
|
169
|
-
|
|
135
|
+
const targets2 = dcExtractPowerShellTargets(seg);
|
|
136
|
+
if (targets2.length > 0) {
|
|
137
|
+
const targetDecision = dcEvaluateRecursiveDeleteTargets({
|
|
138
|
+
targets: targets2,
|
|
139
|
+
cwd
|
|
140
|
+
});
|
|
141
|
+
if (!targetDecision.allowed) {
|
|
170
142
|
return {
|
|
171
143
|
decision: "block",
|
|
172
|
-
firingRule:
|
|
144
|
+
firingRule: `${targetDecision.code}: ${targetDecision.reason}`
|
|
173
145
|
};
|
|
174
146
|
}
|
|
175
|
-
const allSafe = targets.every((t) => DC_SAFE_TARGETS.has(t.trim()));
|
|
176
|
-
if (!allSafe) {
|
|
177
|
-
const scopeExempt = declaredScope != null && declaredScope.length > 0 && targets.every((t) => isInDeclaredScope(t.trim(), declaredScope, cwd));
|
|
178
|
-
if (!scopeExempt) {
|
|
179
|
-
return {
|
|
180
|
-
decision: "block",
|
|
181
|
-
firingRule: `destructive_block: PowerShell recursive delete on unsafe path: ${redactPath(targets.join(", "))}`
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
147
|
} else {
|
|
186
148
|
return {
|
|
187
149
|
decision: "block",
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
resolveSwarmKnowledgePath,
|
|
7
7
|
transactKnowledge,
|
|
8
8
|
wordBigrams
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-t31cc7kv.js";
|
|
10
10
|
import {
|
|
11
11
|
countEntryContradictionsInWindow,
|
|
12
12
|
countEntryViolationsInWindow,
|
|
13
13
|
readKnowledgeEvents,
|
|
14
14
|
recordKnowledgeEvent
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-kv36s0x0.js";
|
|
16
16
|
import {
|
|
17
17
|
init_knowledge_types,
|
|
18
18
|
isActiveStatus
|
|
@@ -190,11 +190,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
|
|
|
190
190
|
alreadyInactive: true
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
const { quarantineEntry } = await import("./knowledge-validator-
|
|
193
|
+
const { quarantineEntry } = await import("./knowledge-validator-v2eevvdg.js");
|
|
194
194
|
let policyConfig;
|
|
195
195
|
try {
|
|
196
|
-
const { KnowledgeConfigSchema } = await import("./schema-
|
|
197
|
-
const { loadPluginConfigWithMeta } = await import("./index-
|
|
196
|
+
const { KnowledgeConfigSchema } = await import("./schema-xhfwr6b2.js");
|
|
197
|
+
const { loadPluginConfigWithMeta } = await import("./index-gytyqv1d.js");
|
|
198
198
|
const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
|
|
199
199
|
policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
|
|
200
200
|
} catch {
|
|
@@ -86,7 +86,7 @@ var _internals = {
|
|
|
86
86
|
symlinkSync: fs.symlinkSync
|
|
87
87
|
},
|
|
88
88
|
writeScopeToDisk: async (directory, taskId, files) => {
|
|
89
|
-
const { writeScopeToDisk: realWrite } = await import("./scope-persistence-
|
|
89
|
+
const { writeScopeToDisk: realWrite } = await import("./scope-persistence-nsa6ra9s.js");
|
|
90
90
|
return realWrite(directory, taskId, files);
|
|
91
91
|
},
|
|
92
92
|
writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
|
|
@@ -532,7 +532,7 @@ var CATALOG_SOURCE = [
|
|
|
532
532
|
category: "plan",
|
|
533
533
|
severity: "notice",
|
|
534
534
|
privacyClass: "operational",
|
|
535
|
-
producer: "src/plan/manager.ts:
|
|
535
|
+
producer: "src/plan/manager.ts:332",
|
|
536
536
|
consumers: NO_CONSUMERS,
|
|
537
537
|
futureOwnerIssue: ISSUE_SINK,
|
|
538
538
|
retentionOwnerIssue: ISSUE_PLAN_EVIDENCE_RETENTION,
|
|
@@ -545,7 +545,7 @@ var CATALOG_SOURCE = [
|
|
|
545
545
|
category: "plan",
|
|
546
546
|
severity: "warning",
|
|
547
547
|
privacyClass: "sensitive",
|
|
548
|
-
producer: "src/plan/manager.ts:
|
|
548
|
+
producer: "src/plan/manager.ts:1699",
|
|
549
549
|
consumers: NO_CONSUMERS,
|
|
550
550
|
futureOwnerIssue: ISSUE_SINK,
|
|
551
551
|
retentionOwnerIssue: ISSUE_PLAN_EVIDENCE_RETENTION,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
loadPluginConfigWithMeta,
|
|
8
8
|
loadPluginConfigWithMetaAsync,
|
|
9
9
|
resolveWorktreeIsolationConfig
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-q3qtgtd0.js";
|
|
11
11
|
import {
|
|
12
12
|
ApprovalEvidenceSchema,
|
|
13
13
|
BaseEvidenceSchema,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
TurboConfigSchema,
|
|
55
55
|
WorktreeIsolationConfigSchema,
|
|
56
56
|
resolveAutoReviewConfig
|
|
57
|
-
} from "./index-
|
|
57
|
+
} from "./index-rtetrxxq.js";
|
|
58
58
|
import"./index-bk5tah7q.js";
|
|
59
59
|
import {
|
|
60
60
|
MigrationStatusSchema,
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./index-ae75rja9.js";
|
|
5
5
|
import {
|
|
6
6
|
resolveKnowledgeStoreDir
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-tyh0p5e8.js";
|
|
8
8
|
import {
|
|
9
9
|
atomicWriteFile
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-nc544sfw.js";
|
|
11
11
|
import {
|
|
12
12
|
require_proper_lockfile
|
|
13
13
|
} from "./index-7g4c7s5r.js";
|
|
@@ -625,7 +625,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
|
|
|
625
625
|
deltas.push({ id, delta });
|
|
626
626
|
}
|
|
627
627
|
if (deltas.length > 0) {
|
|
628
|
-
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-
|
|
628
|
+
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-99gd42jy.js");
|
|
629
629
|
await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
|
|
630
630
|
}
|
|
631
631
|
return {
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./index-1kz6da87.js";
|
|
7
7
|
import {
|
|
8
8
|
withEvidenceLock
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-a614s16f.js";
|
|
10
10
|
import {
|
|
11
11
|
emit
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-chvqee1j.js";
|
|
13
13
|
import {
|
|
14
14
|
criticalWarn,
|
|
15
15
|
init_logger,
|