opencode-swarm 7.164.6 → 7.164.7

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.
Files changed (93) hide show
  1. package/README.md +1 -1
  2. package/dist/background/pending-delegations.d.ts +3 -0
  3. package/dist/background/pr-subscriptions.d.ts +1 -8
  4. package/dist/cli/{coder-settlement-6qgvzx40.js → coder-settlement-p8wwmtnn.js} +14 -14
  5. package/dist/cli/{config-doctor-d1cbh67h.js → config-doctor-wxf488mw.js} +5 -3
  6. package/dist/cli/{core-g0cvvj3b.js → core-671ybpbt.js} +2 -2
  7. package/dist/cli/{curation-policy-7f8x9yg6.js → curation-policy-de7emfqc.js} +7 -6
  8. package/dist/cli/{curator-drift-0r0scc8r.js → curator-drift-nvxv8xkk.js} +7 -5
  9. package/dist/cli/{curator-q3qn89wn.js → curator-eaz5rj6k.js} +39 -37
  10. package/dist/cli/curator-llm-factory-swzyfnh6.js +68 -0
  11. package/dist/cli/{dispatch-q4v8x2pk.js → dispatch-dqybvj8v.js} +10 -6
  12. package/dist/cli/{evidence-summary-service-3meyb8rc.js → evidence-summary-service-deqsc8hj.js} +19 -16
  13. package/dist/cli/{gate-evidence-mhc0w7vp.js → gate-evidence-mafg71qb.js} +14 -8
  14. package/dist/cli/guardrail-explain-ygq7cx9w.js +69 -0
  15. package/dist/cli/{guardrail-log-0nd1eqvz.js → guardrail-log-k3w9dq6x.js} +9 -8
  16. package/dist/cli/{guardrail-reset-mzeyd6jh.js → guardrail-reset-ae2step4.js} +39 -37
  17. package/dist/cli/hive-promoter-a4cs5sbr.js +83 -0
  18. package/dist/cli/{index-x6zyc38w.js → index-0zjwnbze.js} +1 -1
  19. package/dist/cli/{index-qdbgc16x.js → index-1ekzd5wf.js} +20 -12
  20. package/dist/cli/{index-fxxja498.js → index-2czt53wz.js} +1 -1
  21. package/dist/cli/{index-g5714mpv.js → index-388sxv1b.js} +17 -8
  22. package/dist/cli/{index-kvb4dwgf.js → index-3kgg2n6z.js} +12 -6
  23. package/dist/cli/{index-pvp5tnn2.js → index-3sv8t7ca.js} +2 -2
  24. package/dist/cli/{index-hdapetg1.js → index-46yrz972.js} +3 -3
  25. package/dist/cli/{index-zypacgjc.js → index-4vx89ymn.js} +5 -5
  26. package/dist/cli/{index-6f9yvd67.js → index-581bcqp9.js} +2 -2
  27. package/dist/cli/{index-gwg7a00b.js → index-63enf73z.js} +20 -15
  28. package/dist/cli/index-7qefgq4j.js +71 -0
  29. package/dist/cli/{index-5p1tzpwh.js → index-8ck1jkhd.js} +3 -2
  30. package/dist/cli/{index-zfwd65c2.js → index-8ntf8jnj.js} +19 -18
  31. package/dist/cli/{index-m1nrd3yd.js → index-8psybzzf.js} +1 -1
  32. package/dist/cli/{index-2c3np82d.js → index-8tqqmsav.js} +1 -1
  33. package/dist/cli/{index-tegp2mny.js → index-93znbdam.js} +9 -5
  34. package/dist/cli/{index-x76mprg2.js → index-9qkytpwa.js} +185 -376
  35. package/dist/cli/{index-p56xc59p.js → index-9ydhzegh.js} +28 -17
  36. package/dist/cli/{index-935ww10s.js → index-bvjwmmdc.js} +1233 -1190
  37. package/dist/cli/{index-ty3vtqe2.js → index-c4j9sjcs.js} +4 -4
  38. package/dist/cli/index-cw912re7.js +200 -0
  39. package/dist/cli/{index-j3hsjynw.js → index-fq1wfsmw.js} +100 -97
  40. package/dist/cli/{index-59hvr3f4.js → index-gm65h7bh.js} +9 -6
  41. package/dist/cli/{index-jzvrvdmr.js → index-h3k3rgyr.js} +4 -4
  42. package/dist/cli/{index-12xzj0hm.js → index-jkwfajh1.js} +4 -4
  43. package/dist/cli/{index-1dz8hv7p.js → index-kvq1e82k.js} +3 -3
  44. package/dist/cli/{index-ze5zyv28.js → index-mr3h3sm5.js} +2 -2
  45. package/dist/cli/{index-rysxqae0.js → index-rey1tzcw.js} +7 -7
  46. package/dist/cli/index-ry16d01s.js +107 -0
  47. package/dist/cli/{index-ay9cr8tr.js → index-ry4mwbc2.js} +1 -1
  48. package/dist/cli/{index-b0m3efpf.js → index-sxxh4ams.js} +2 -2
  49. package/dist/cli/{index-cyhw0der.js → index-t1qzjhnj.js} +13 -13
  50. package/dist/cli/{index-j645xpsm.js → index-v1fj9exz.js} +12 -5
  51. package/dist/cli/{index-3f7hqtgg.js → index-w3gtqey0.js} +4 -1
  52. package/dist/cli/{index-9qvmsyab.js → index-wgqeqy68.js} +2 -2
  53. package/dist/cli/{index-g94qqwnz.js → index-x2t2tbm2.js} +2 -2
  54. package/dist/cli/{index-zjg5ajf5.js → index-x3qzt684.js} +71 -47
  55. package/dist/cli/{index-t1nkr7cz.js → index-xc3q62ev.js} +2 -2
  56. package/dist/cli/{index-ew99d4y6.js → index-xy59dnvq.js} +1 -1
  57. package/dist/cli/{index-4k16cz8r.js → index-y75xd50f.js} +36 -27
  58. package/dist/cli/{index-7v3bb0h3.js → index-yzn1fm9a.js} +1 -1
  59. package/dist/cli/{index-yh8wxegw.js → index-zg34ngdf.js} +21 -11
  60. package/dist/cli/{index-y4z0rhsa.js → index-zg8tvjb0.js} +41 -39
  61. package/dist/cli/index.js +39 -37
  62. package/dist/cli/{knowledge-escalator-aca0nhqg.js → knowledge-escalator-t532h2ym.js} +15 -14
  63. package/dist/cli/{knowledge-events-n5t313ht.js → knowledge-events-hdtc0cxe.js} +13 -12
  64. package/dist/cli/{knowledge-link-8ea4ksda.js → knowledge-link-hhnmc4g1.js} +6 -5
  65. package/dist/cli/{knowledge-store-j97ejf6a.js → knowledge-store-45jadhmb.js} +7 -6
  66. package/dist/cli/{knowledge-validator-01evhydg.js → knowledge-validator-5e6qbq6h.js} +9 -8
  67. package/dist/cli/{model-preflight-pmnbfzjv.js → model-preflight-bq035tfh.js} +1 -1
  68. package/dist/cli/{pending-delegations-w73abdk3.js → pending-delegations-z0crvst3.js} +7 -7
  69. package/dist/cli/{pr-subscriptions-05dzvavk.js → pr-subscriptions-73fs8y3n.js} +7 -6
  70. package/dist/cli/{pr-workflow-gate-t0tnkx5f.js → pr-workflow-gate-rpdts7wy.js} +39 -37
  71. package/dist/cli/{runner-fh7t0mn9.js → runner-5qqh83e2.js} +6 -6
  72. package/dist/cli/{scan-cursor-63zx2qd8.js → scan-cursor-t75qznf3.js} +8 -7
  73. package/dist/cli/{schema-t1scx08g.js → schema-8dfjsrk6.js} +2 -2
  74. package/dist/cli/{scope-persistence-1a5qmchf.js → scope-persistence-zfmz4sws.js} +12 -10
  75. package/dist/cli/{skill-generator-7werbwgv.js → skill-generator-psdb10jw.js} +17 -16
  76. package/dist/cli/{telemetry-j14cj552.js → telemetry-85gxedng.js} +1 -1
  77. package/dist/cli/{workspace-snapshot-yq0tc49d.js → workspace-snapshot-eh18vgkn.js} +2 -1
  78. package/dist/cli/{worktree-collision-ownership-wzdzky33.js → worktree-collision-ownership-xrqssqzd.js} +12 -15
  79. package/dist/cli/{worktree-isolation-m02ay3kg.js → worktree-isolation-s9m3bgah.js} +39 -37
  80. package/dist/db/canonical-project.d.ts +10 -3
  81. package/dist/db/project-db.d.ts +4 -0
  82. package/dist/evidence/task-gate-repair.d.ts +1 -1
  83. package/dist/gate-evidence.d.ts +19 -1
  84. package/dist/index.js +581 -581
  85. package/dist/plan/ledger.d.ts +2 -0
  86. package/dist/tools/pre-check-batch.d.ts +1 -1
  87. package/dist/utils/canonical-root.d.ts +21 -1
  88. package/dist/utils/filesystem-identity.d.ts +59 -0
  89. package/package.json +2 -1
  90. package/dist/cli/curator-llm-factory-dw7md4nr.js +0 -66
  91. package/dist/cli/guardrail-explain-6cbszhw1.js +0 -67
  92. package/dist/cli/hive-promoter-w7g879cm.js +0 -81
  93. package/dist/cli/index-ddszzne4.js +0 -42
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  _internals,
4
4
  resolveWorktreeIsolationConfig
5
- } from "./index-hdapetg1.js";
5
+ } from "./index-46yrz972.js";
6
6
  import {
7
7
  ApprovalEvidenceSchema,
8
8
  BaseEvidenceSchema,
@@ -44,7 +44,7 @@ import {
44
44
  loadPluginConfigWithMeta,
45
45
  loadPluginConfigWithMetaAsync,
46
46
  resetConfigAdvisoryDedup
47
- } from "./index-ew99d4y6.js";
47
+ } from "./index-xy59dnvq.js";
48
48
  import {
49
49
  AUTO_REVIEW_V8_BURN_IN_DECISION,
50
50
  AgentOverrideConfigSchema,
@@ -68,7 +68,7 @@ import {
68
68
  TurboConfigSchema,
69
69
  WorktreeIsolationConfigSchema,
70
70
  resolveAutoReviewConfig
71
- } from "./index-5p1tzpwh.js";
71
+ } from "./index-8ck1jkhd.js";
72
72
  import"./index-9e6fdz2h.js";
73
73
  import"./index-4rhhvd1a.js";
74
74
  import {
@@ -80,7 +80,7 @@ import {
80
80
  QA_AGENTS,
81
81
  isQAAgent,
82
82
  isSubagent
83
- } from "./index-m1nrd3yd.js";
83
+ } from "./index-8psybzzf.js";
84
84
  import"./index-zjygnfay.js";
85
85
  import"./index-bk5tah7q.js";
86
86
  import"./index-bpmtbmy9.js";
@@ -0,0 +1,200 @@
1
+ // @bun
2
+ import {
3
+ canonicalExistingFilesystemPath
4
+ } from "./index-ry16d01s.js";
5
+
6
+ // src/utils/path-security.ts
7
+ import * as fs from "fs";
8
+ import * as path from "path";
9
+ function containsPathTraversal(str) {
10
+ if (/\.\.[/\\]/.test(str))
11
+ return true;
12
+ if (/(?:^|[/\\])\.\.(?:[/\\]|$)/.test(str))
13
+ return true;
14
+ if (/%2e%2e/i.test(str))
15
+ return true;
16
+ if (/%2e\./i.test(str))
17
+ return true;
18
+ if (/%2e/i.test(str) && /\.\./.test(str))
19
+ return true;
20
+ if (/%252e%252e/i.test(str))
21
+ return true;
22
+ if (/\uff0e/.test(str))
23
+ return true;
24
+ if (/\u3002/.test(str))
25
+ return true;
26
+ if (/\uff65/.test(str))
27
+ return true;
28
+ if (/%2f/i.test(str))
29
+ return true;
30
+ if (/%5c/i.test(str))
31
+ return true;
32
+ return false;
33
+ }
34
+ function containsControlChars(str) {
35
+ for (const ch of str) {
36
+ const code = ch.codePointAt(0);
37
+ if (code === undefined)
38
+ continue;
39
+ if (code <= 31 || code >= 127 && code <= 159)
40
+ return true;
41
+ if (code >= 8234 && code <= 8238)
42
+ return true;
43
+ if (code >= 8294 && code <= 8297)
44
+ return true;
45
+ }
46
+ return false;
47
+ }
48
+ function validateWorkspaceRoot(directory) {
49
+ validateProjectDirectory(directory);
50
+ }
51
+ function validateDirectory(directory) {
52
+ if (!directory || directory.trim() === "") {
53
+ throw new Error("Invalid directory: empty");
54
+ }
55
+ if (containsPathTraversal(directory)) {
56
+ throw new Error("Invalid directory: path traversal detected");
57
+ }
58
+ if (containsControlChars(directory)) {
59
+ throw new Error("Invalid directory: control characters detected");
60
+ }
61
+ if (directory.startsWith("/") || directory.startsWith("\\")) {
62
+ throw new Error("Invalid directory: absolute path");
63
+ }
64
+ if (/^[A-Za-z]:[/\\]/.test(directory)) {
65
+ throw new Error("Invalid directory: Windows absolute path");
66
+ }
67
+ }
68
+ function validateProjectDirectory(directory) {
69
+ if (!directory || directory.trim() === "") {
70
+ throw new Error("Invalid project directory: empty");
71
+ }
72
+ if (containsPathTraversal(directory)) {
73
+ throw new Error("Invalid project directory: path traversal detected");
74
+ }
75
+ if (containsControlChars(directory)) {
76
+ throw new Error("Invalid project directory: control characters detected");
77
+ }
78
+ if (!path.isAbsolute(directory) && !/^[A-Za-z]:[/\\]/.test(directory)) {
79
+ throw new Error("Invalid project directory: must be an absolute path");
80
+ }
81
+ assertNotSystemLocation(directory);
82
+ }
83
+ var DENIED_ROOT_SUBTREES = new Set([
84
+ "etc",
85
+ "usr",
86
+ "bin",
87
+ "sbin",
88
+ "lib",
89
+ "lib64",
90
+ "boot",
91
+ "dev",
92
+ "proc",
93
+ "sys",
94
+ "windows",
95
+ "winnt",
96
+ "program files",
97
+ "program files (x86)",
98
+ "programdata",
99
+ "system volume information"
100
+ ]);
101
+ var DENIED_EXACT_ROOT_CHILDREN = new Set(["users", "home", "root"]);
102
+ function assertNotSystemLocation(directory) {
103
+ for (const parser of [path.win32, path.posix]) {
104
+ if (!parser.isAbsolute(directory))
105
+ continue;
106
+ const normalized = parser.normalize(directory);
107
+ const { root } = parser.parse(normalized);
108
+ const segments = normalized.slice(root.length).split(/[/\\]/).filter((segment) => segment.length > 0);
109
+ if (segments.length === 0) {
110
+ throw new Error(`Invalid project directory: filesystem root is not a project root (${directory})`);
111
+ }
112
+ const first = (segments[0] ?? "").toLowerCase();
113
+ if (DENIED_ROOT_SUBTREES.has(first) || segments.length === 1 && DENIED_EXACT_ROOT_CHILDREN.has(first)) {
114
+ throw new Error(`Invalid project directory: system location is not a project root (${directory})`);
115
+ }
116
+ }
117
+ }
118
+ function resolveNearestExistingCanonical(inputPath, resolver) {
119
+ try {
120
+ return resolver(inputPath);
121
+ } catch {}
122
+ const lexicallyResolved = path.resolve(inputPath);
123
+ let probe = lexicallyResolved;
124
+ const tail = [];
125
+ for (let i = 0;i < 4096; i++) {
126
+ const parent = path.dirname(probe);
127
+ if (parent === probe) {
128
+ return lexicallyResolved;
129
+ }
130
+ tail.unshift(path.basename(probe));
131
+ probe = parent;
132
+ try {
133
+ const canonicalAncestor = resolver(probe);
134
+ return path.normalize(path.join(canonicalAncestor, ...tail));
135
+ } catch {}
136
+ }
137
+ return lexicallyResolved;
138
+ }
139
+ function validateSymlinkBoundary(targetPath, rootPath) {
140
+ const realTarget = resolveNearestExistingCanonical(targetPath, _internals.realpathSync);
141
+ const realRoot = resolveNearestExistingCanonical(rootPath, _internals.realpathSync);
142
+ const normalizedTarget = path.normalize(realTarget);
143
+ const normalizedRoot = path.normalize(realRoot);
144
+ if (!normalizedTarget.startsWith(normalizedRoot + path.sep) && normalizedTarget !== normalizedRoot) {
145
+ throw new Error(`Symlink resolution escaped boundary: ${realTarget} is not within ${realRoot}`);
146
+ }
147
+ }
148
+ function isCanonicalPathWithinRoot(targetPath, rootPath) {
149
+ const canonicalRoot = canonicalExistingFilesystemPath(rootPath);
150
+ if (canonicalRoot === null)
151
+ return false;
152
+ const rootPrefix = canonicalRoot.endsWith("/") ? canonicalRoot : `${canonicalRoot}/`;
153
+ let probe = path.resolve(targetPath);
154
+ for (let i = 0;i < 4096; i++) {
155
+ const canonicalProbe = canonicalExistingFilesystemPath(probe);
156
+ if (canonicalProbe !== null) {
157
+ return canonicalProbe === canonicalRoot || canonicalProbe.startsWith(rootPrefix);
158
+ }
159
+ const parent = path.dirname(probe);
160
+ if (parent === probe)
161
+ return false;
162
+ probe = parent;
163
+ }
164
+ return false;
165
+ }
166
+ function validateTargetWithinRoot(filePath, root) {
167
+ if (!filePath || filePath.trim() === "") {
168
+ return "Empty path";
169
+ }
170
+ if (path.isAbsolute(filePath) || /^[A-Za-z]:[/\\]/.test(filePath)) {
171
+ return `Absolute path rejected: ${filePath}`;
172
+ }
173
+ if (containsPathTraversal(filePath)) {
174
+ return `Path traversal detected: ${filePath}`;
175
+ }
176
+ if (containsControlChars(filePath)) {
177
+ return `Control characters detected in path: ${filePath}`;
178
+ }
179
+ const resolved = path.resolve(root, filePath);
180
+ const relative2 = path.relative(root, resolved);
181
+ if (relative2.startsWith("..") || path.isAbsolute(relative2)) {
182
+ return `Path escapes root: ${filePath}`;
183
+ }
184
+ if (!isCanonicalPathWithinRoot(resolved, root)) {
185
+ return `Path escapes root via symlink/junction: ${filePath}`;
186
+ }
187
+ return null;
188
+ }
189
+ var _internals = {
190
+ realpathSync: fs.realpathSync,
191
+ containsPathTraversal,
192
+ containsControlChars,
193
+ validateDirectory,
194
+ validateProjectDirectory,
195
+ validateSymlinkBoundary,
196
+ isCanonicalPathWithinRoot,
197
+ validateTargetWithinRoot
198
+ };
199
+
200
+ export { containsPathTraversal, containsControlChars, validateWorkspaceRoot, validateSymlinkBoundary, isCanonicalPathWithinRoot, validateTargetWithinRoot };