opencode-swarm 7.133.0 → 7.134.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.
Files changed (77) hide show
  1. package/dist/background/completion-observer.d.ts +17 -7
  2. package/dist/background/pending-delegations.d.ts +305 -30
  3. package/dist/cli/{config-doctor-8nbdwnn6.js → config-doctor-t5r92674.js} +3 -3
  4. package/dist/cli/{core-egwpry19.js → core-d6yd2jzv.js} +3 -3
  5. package/dist/cli/{curation-policy-gae3xm5d.js → curation-policy-3smfn2a3.js} +7 -7
  6. package/dist/cli/{curator-drift-ea0p8nh1.js → curator-drift-tsyyf4b4.js} +6 -6
  7. package/dist/cli/{curator-e88bm4mg.js → curator-hva8f3nf.js} +31 -28
  8. package/dist/cli/{curator-llm-factory-1a7esr69.js → curator-llm-factory-p3aqev12.js} +31 -28
  9. package/dist/cli/{dispatch-3mhgqj2x.js → dispatch-gxbeb2ps.js} +2 -2
  10. package/dist/cli/{evidence-summary-service-nhsmsap8.js → evidence-summary-service-mrzsjpg4.js} +13 -12
  11. package/dist/cli/{gate-evidence-cy2te3x8.js → gate-evidence-b5v1xvxp.js} +4 -4
  12. package/dist/cli/guardrail-explain-k8mcvk61.js +57 -0
  13. package/dist/cli/{guardrail-log-fjgyx76r.js → guardrail-log-absma1rv.js} +5 -5
  14. package/dist/cli/{hive-promoter-2b04e0wh.js → hive-promoter-jwd51gzk.js} +31 -28
  15. package/dist/cli/{index-g4mnf3p5.js → index-1j3682j8.js} +5 -5
  16. package/dist/cli/{index-7ftthvqt.js → index-2njes601.js} +8 -8
  17. package/dist/cli/{index-17zjp67y.js → index-2t1n9k7b.js} +4 -4
  18. package/dist/cli/{index-mwqfyjja.js → index-3dtjhr26.js} +48538 -48840
  19. package/dist/cli/{index-2tn5h2zp.js → index-4p02dp92.js} +6 -6
  20. package/dist/cli/index-b4z7s917.js +80 -0
  21. package/dist/cli/{index-wzb4dv5s.js → index-b5ek2cge.js} +4 -4
  22. package/dist/cli/index-b8zgtz81.js +123 -0
  23. package/dist/cli/{index-j5pnah1w.js → index-baawkm48.js} +12 -12
  24. package/dist/cli/{index-sp7tm8t7.js → index-c3e0ymrg.js} +1 -1
  25. package/dist/cli/{index-q27bajqb.js → index-cfkvc5q9.js} +3 -3
  26. package/dist/cli/{index-7mkpsw6g.js → index-dd7ttx8x.js} +1 -1
  27. package/dist/cli/{index-bz08438z.js → index-dgxgvzab.js} +7 -7
  28. package/dist/cli/{index-mhcge2ry.js → index-eedq2y40.js} +33 -30
  29. package/dist/cli/{index-tj2mkfb3.js → index-g87ty4wp.js} +1 -1
  30. package/dist/cli/{index-mmvaf4t6.js → index-hgh01f6h.js} +25 -3
  31. package/dist/cli/{index-0vd91yb8.js → index-j6ywarjp.js} +3 -3
  32. package/dist/cli/{index-cpest8sa.js → index-jpkxjmfw.js} +5 -5
  33. package/dist/cli/{index-r260ybay.js → index-k742ecbm.js} +178 -222
  34. package/dist/cli/{index-hfpw5m0e.js → index-kapharv7.js} +3 -3
  35. package/dist/cli/{index-66zght9d.js → index-m2s0gbzt.js} +2 -2
  36. package/dist/cli/{index-74tptrss.js → index-p8hezdtz.js} +1 -1
  37. package/dist/cli/{index-sw82jvf2.js → index-rkyhv4p5.js} +2 -2
  38. package/dist/cli/{index-3x761jqv.js → index-wk1h5ec2.js} +1 -1
  39. package/dist/cli/{index-kc1m6vpr.js → index-xfejq1p9.js} +2 -2
  40. package/dist/cli/{index-wz36r0fk.js → index-y0kk3rtv.js} +2 -2
  41. package/dist/cli/index-y3v1404y.js +1625 -0
  42. package/dist/cli/index.js +31 -28
  43. package/dist/cli/{knowledge-escalator-hzkw1ban.js → knowledge-escalator-mkdac2m7.js} +8 -8
  44. package/dist/cli/{knowledge-events-pbycdhqd.js → knowledge-events-jjc9qbe0.js} +6 -6
  45. package/dist/cli/{knowledge-link-4yd2z8ev.js → knowledge-link-nc4y2zkq.js} +5 -5
  46. package/dist/cli/{knowledge-store-45jawb2p.js → knowledge-store-9e0w1kxm.js} +6 -6
  47. package/dist/cli/{knowledge-validator-ge576f8n.js → knowledge-validator-h1nrn2pk.js} +9 -9
  48. package/dist/cli/pending-delegations-v9e40hfk.js +96 -0
  49. package/dist/cli/{pr-subscriptions-zqbmctwz.js → pr-subscriptions-ztq40hrt.js} +7 -7
  50. package/dist/cli/{scan-cursor-kvw872be.js → scan-cursor-mk3tq3sf.js} +7 -7
  51. package/dist/cli/{schema-a2zm2m3r.js → schema-bjb0yzsq.js} +2 -2
  52. package/dist/cli/{scope-persistence-5qypzxxm.js → scope-persistence-hz3zmmsv.js} +5 -5
  53. package/dist/cli/{skill-generator-ch79hvxh.js → skill-generator-p1de0wkr.js} +10 -10
  54. package/dist/cli/worktree-collision-ownership-c4bdnjtx.js +221 -0
  55. package/dist/evaluation/contracts.d.ts +1 -1
  56. package/dist/evaluation/public-api.d.ts +1 -1
  57. package/dist/hooks/delegation-gate/worktree-collision-ownership.d.ts +28 -0
  58. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +63 -1
  59. package/dist/hooks/delegation-gate/worktree-merge-status.d.ts +14 -0
  60. package/dist/hooks/delegation-gate/worktree-ownership-tag.d.ts +19 -0
  61. package/dist/hooks/delegation-gate/worktree-provisioning-owner.d.ts +30 -0
  62. package/dist/hooks/delegation-gate.d.ts +14 -5
  63. package/dist/hooks/index.d.ts +1 -1
  64. package/dist/hooks/init-orphan-recovery.d.ts +17 -0
  65. package/dist/index.js +476 -470
  66. package/dist/memory/schema.d.ts +4 -4
  67. package/dist/session/snapshot-writer.d.ts +2 -0
  68. package/dist/state.d.ts +43 -1
  69. package/dist/tools/dispatch-lanes.d.ts +1 -1
  70. package/dist/tools/epic-record-divergence.d.ts +5 -5
  71. package/dist/worktree/merge.d.ts +47 -1
  72. package/package.json +1 -1
  73. package/dist/cli/guardrail-explain-zgja2b9m.js +0 -54
  74. package/dist/cli/pending-delegations-kxy8mdqg.js +0 -75
  75. package/dist/cli/{index-9f71ye47.js → index-13xxjfhn.js} +3 -3
  76. package/dist/cli/{index-s80bsjkj.js → index-2ghkk9ve.js} +6 -6
  77. package/dist/cli/{index-76kvm9z5.js → index-5nybajn9.js} +3 -3
@@ -4,17 +4,17 @@ import {
4
4
  PlanSchema,
5
5
  TaskStatusSchema
6
6
  } from "./index-1kz6da87.js";
7
- import {
8
- criticalWarn,
9
- init_logger,
10
- log
11
- } from "./index-zgwm4ryv.js";
12
7
  import {
13
8
  withEvidenceLock
14
- } from "./index-76kvm9z5.js";
9
+ } from "./index-5nybajn9.js";
15
10
  import {
16
11
  emit
17
12
  } from "./index-q2rrv0cy.js";
13
+ import {
14
+ criticalWarn,
15
+ init_logger,
16
+ log
17
+ } from "./index-zgwm4ryv.js";
18
18
 
19
19
  // src/plan/utils.ts
20
20
  function derivePlanId(plan) {
@@ -0,0 +1,80 @@
1
+ // @bun
2
+ import {
3
+ validateSwarmPath
4
+ } from "./index-2ghkk9ve.js";
5
+
6
+ // src/hooks/delegation-gate/worktree-provisioning-owner.ts
7
+ import * as fs from "fs";
8
+ import * as path from "path";
9
+ var PROVISIONING_OWNER_DIR = "worktree-provisioning-owners";
10
+ var MAX_PROVISIONING_OWNERS = 512;
11
+ var MAX_PROVISIONING_OWNER_BYTES = 16 * 1024;
12
+ function ownerDirectory(directory) {
13
+ return path.dirname(validateSwarmPath(directory, path.join(PROVISIONING_OWNER_DIR, ".containment-anchor")));
14
+ }
15
+ function isOwner(value) {
16
+ if (!value || typeof value !== "object" || Array.isArray(value))
17
+ return false;
18
+ const candidate = value;
19
+ const schemaVersion = candidate.schemaVersion;
20
+ const validTaskIdentity = schemaVersion === 1 ? candidate.taskId === undefined : schemaVersion === 2 && typeof candidate.taskId === "string" && candidate.taskId.length > 0 && candidate.taskId.length <= 512;
21
+ return (schemaVersion === 1 || schemaVersion === 2) && validTaskIdentity && typeof candidate.callID === "string" && candidate.callID.length > 0 && candidate.callID.length <= 512 && typeof candidate.parentSessionId === "string" && candidate.parentSessionId.length > 0 && candidate.parentSessionId.length <= 512 && typeof candidate.worktreeSessionId === "string" && candidate.worktreeSessionId.length > 0 && candidate.worktreeSessionId.length <= 512 && typeof candidate.createdAt === "number" && Number.isFinite(candidate.createdAt) && candidate.createdAt >= 0;
22
+ }
23
+ function scanWorktreeProvisioningOwnersForRecovery(directory) {
24
+ let directoryPath;
25
+ let entries;
26
+ try {
27
+ directoryPath = ownerDirectory(directory);
28
+ entries = fs.readdirSync(directoryPath, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json"));
29
+ } catch (error) {
30
+ if (error.code === "ENOENT") {
31
+ return { status: "ok", owners: [] };
32
+ }
33
+ return {
34
+ status: "uncertain",
35
+ reason: `worktree provisioning-owner directory is unreadable: ${error instanceof Error ? error.message : String(error)}`
36
+ };
37
+ }
38
+ if (entries.length > MAX_PROVISIONING_OWNERS) {
39
+ return {
40
+ status: "uncertain",
41
+ reason: `worktree provisioning-owner count exceeds the ${MAX_PROVISIONING_OWNERS}-marker safety bound`
42
+ };
43
+ }
44
+ const owners = [];
45
+ for (const entry of entries) {
46
+ const absolutePath = path.join(directoryPath, entry.name);
47
+ try {
48
+ const stat = fs.statSync(absolutePath);
49
+ if (stat.size > MAX_PROVISIONING_OWNER_BYTES) {
50
+ return {
51
+ status: "uncertain",
52
+ reason: `worktree provisioning owner "${entry.name}" exceeds the recovery size bound`
53
+ };
54
+ }
55
+ const raw = fs.readFileSync(absolutePath, "utf8");
56
+ if (Buffer.byteLength(raw, "utf8") > MAX_PROVISIONING_OWNER_BYTES) {
57
+ return {
58
+ status: "uncertain",
59
+ reason: `worktree provisioning owner "${entry.name}" changed beyond the recovery size bound`
60
+ };
61
+ }
62
+ const parsed = JSON.parse(raw);
63
+ if (!isOwner(parsed)) {
64
+ return {
65
+ status: "uncertain",
66
+ reason: `worktree provisioning owner "${entry.name}" is invalid`
67
+ };
68
+ }
69
+ owners.push(parsed);
70
+ } catch (error) {
71
+ return {
72
+ status: "uncertain",
73
+ reason: `worktree provisioning owner "${entry.name}" is unreadable or malformed: ${error instanceof Error ? error.message : String(error)}`
74
+ };
75
+ }
76
+ }
77
+ return { status: "ok", owners };
78
+ }
79
+
80
+ export { scanWorktreeProvisioningOwnersForRecovery };
@@ -3,13 +3,13 @@ import {
3
3
  OUTCOME_BLOCK_THRESHOLD,
4
4
  init_knowledge_types
5
5
  } from "./index-bk5tah7q.js";
6
- import {
7
- init_merge
8
- } from "./index-zjygnfay.js";
9
6
  import {
10
7
  exports_external,
11
8
  init_zod
12
9
  } from "./index-bpmtbmy9.js";
10
+ import {
11
+ init_merge
12
+ } from "./index-zjygnfay.js";
13
13
  import {
14
14
  __esm
15
15
  } from "./index-a76rekgs.js";
@@ -19,7 +19,7 @@ var package_default;
19
19
  var init_package = __esm(() => {
20
20
  package_default = {
21
21
  name: "opencode-swarm",
22
- version: "7.133.0",
22
+ version: "7.134.0",
23
23
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
24
24
  main: "dist/index.js",
25
25
  types: "dist/index.d.ts",
@@ -0,0 +1,123 @@
1
+ // @bun
2
+ // src/hooks/delegation-gate/worktree-merge-status.ts
3
+ import * as fs from "fs";
4
+ import * as path from "path";
5
+ var failuresByTask = new Map;
6
+ var durableStatusPath;
7
+ var MAX_RECOVERY_STATUS_BYTES = 2 * 1024 * 1024;
8
+ var MAX_RECOVERY_STATUS_ENTRIES = 512;
9
+ var hasLoaded = false;
10
+ function loadDurableStatus(statusPath) {
11
+ try {
12
+ hasLoaded = true;
13
+ if (!fs.existsSync(statusPath)) {
14
+ failuresByTask.clear();
15
+ return;
16
+ }
17
+ const data = JSON.parse(fs.readFileSync(statusPath, "utf-8"));
18
+ if (data && typeof data === "object") {
19
+ failuresByTask.clear();
20
+ for (const [taskId, failure] of Object.entries(data)) {
21
+ failuresByTask.set(taskId, failure);
22
+ }
23
+ }
24
+ } catch {
25
+ failuresByTask.clear();
26
+ }
27
+ }
28
+ function isRecoveryFailure(value) {
29
+ if (!value || typeof value !== "object" || Array.isArray(value))
30
+ return false;
31
+ const candidate = value;
32
+ if (candidate.outcome !== "partial" && candidate.outcome !== "failed" || typeof candidate.stage !== "string" || !candidate.stage || typeof candidate.message !== "string" || !candidate.message) {
33
+ return false;
34
+ }
35
+ for (const key of ["worktreePath", "branch"]) {
36
+ if (candidate[key] !== undefined && (typeof candidate[key] !== "string" || candidate[key].length === 0)) {
37
+ return false;
38
+ }
39
+ }
40
+ for (const key of ["queuedAt", "completedAt"]) {
41
+ if (candidate[key] !== undefined && (typeof candidate[key] !== "number" || !Number.isFinite(candidate[key]) || candidate[key] < 0)) {
42
+ return false;
43
+ }
44
+ }
45
+ return true;
46
+ }
47
+ function scanWorktreeMergeFailuresForRecovery(projectDir) {
48
+ const statusPath = path.join(projectDir, ".swarm", "worktree-merge-status.json");
49
+ try {
50
+ const stat = fs.statSync(statusPath);
51
+ if (stat.size > MAX_RECOVERY_STATUS_BYTES) {
52
+ return {
53
+ status: "uncertain",
54
+ reason: `worktree merge-status file exceeds the ${MAX_RECOVERY_STATUS_BYTES}-byte recovery bound`
55
+ };
56
+ }
57
+ const raw = fs.readFileSync(statusPath, "utf-8");
58
+ if (Buffer.byteLength(raw, "utf8") > MAX_RECOVERY_STATUS_BYTES) {
59
+ return {
60
+ status: "uncertain",
61
+ reason: `worktree merge-status file changed beyond the ${MAX_RECOVERY_STATUS_BYTES}-byte recovery bound`
62
+ };
63
+ }
64
+ const parsed = JSON.parse(raw);
65
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
66
+ return {
67
+ status: "uncertain",
68
+ reason: "worktree merge-status file does not contain an object"
69
+ };
70
+ }
71
+ const entries = Object.entries(parsed);
72
+ if (entries.length > MAX_RECOVERY_STATUS_ENTRIES) {
73
+ return {
74
+ status: "uncertain",
75
+ reason: `worktree merge-status owner count exceeds the ${MAX_RECOVERY_STATUS_ENTRIES}-entry safety bound`
76
+ };
77
+ }
78
+ for (const [taskId, failure] of entries) {
79
+ if (!taskId || !isRecoveryFailure(failure)) {
80
+ return {
81
+ status: "uncertain",
82
+ reason: `worktree merge-status has an invalid owner record for task "${taskId}"`
83
+ };
84
+ }
85
+ }
86
+ return {
87
+ status: "ok",
88
+ failures: entries
89
+ };
90
+ } catch (error) {
91
+ if (error.code === "ENOENT") {
92
+ return { status: "ok", failures: [] };
93
+ }
94
+ return {
95
+ status: "uncertain",
96
+ reason: `worktree merge-status is unreadable or malformed: ${error instanceof Error ? error.message : String(error)}`
97
+ };
98
+ }
99
+ }
100
+ function initDurableStatusPath(projectDir) {
101
+ if (typeof projectDir !== "string" || projectDir.length === 0)
102
+ return;
103
+ const nextPath = path.join(projectDir, ".swarm", "worktree-merge-status.json");
104
+ if (durableStatusPath === nextPath && hasLoaded)
105
+ return;
106
+ durableStatusPath = nextPath;
107
+ hasLoaded = false;
108
+ loadDurableStatus(durableStatusPath);
109
+ }
110
+ function getWorktreeMergeFailure(taskId) {
111
+ if (!hasLoaded && durableStatusPath) {
112
+ loadDurableStatus(durableStatusPath);
113
+ }
114
+ return failuresByTask.get(taskId);
115
+ }
116
+ function getAllWorktreeMergeFailures() {
117
+ if (!hasLoaded && durableStatusPath) {
118
+ loadDurableStatus(durableStatusPath);
119
+ }
120
+ return failuresByTask.entries();
121
+ }
122
+
123
+ export { scanWorktreeMergeFailuresForRecovery, initDurableStatusPath, getWorktreeMergeFailure, getAllWorktreeMergeFailures };
@@ -6,24 +6,24 @@ import {
6
6
  } from "./index-ae75rja9.js";
7
7
  import {
8
8
  resolveKnowledgeStoreDir
9
- } from "./index-q27bajqb.js";
9
+ } from "./index-cfkvc5q9.js";
10
+ import {
11
+ atomicWriteFile
12
+ } from "./index-dd7ttx8x.js";
10
13
  import {
11
14
  init_knowledge_types,
12
15
  isActiveStatus
13
16
  } from "./index-bk5tah7q.js";
14
- import {
15
- init_logger,
16
- log
17
- } from "./index-zgwm4ryv.js";
18
- import {
19
- atomicWriteFile
20
- } from "./index-7mkpsw6g.js";
21
17
  import {
22
18
  readCachedParsedFile
23
19
  } from "./index-fsrp8wp3.js";
24
20
  import {
25
21
  require_proper_lockfile
26
22
  } from "./index-7g4c7s5r.js";
23
+ import {
24
+ init_logger,
25
+ log
26
+ } from "./index-zgwm4ryv.js";
27
27
  import {
28
28
  __require,
29
29
  __toESM
@@ -702,7 +702,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
702
702
  const recovered = touched.filter((e) => e.confidence > CONFIDENCE_FLOOR + FLOOR_EPSILON && e.confidence_floor_demoted);
703
703
  if (atFloor.length === 0 && recovered.length === 0)
704
704
  return;
705
- const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-pbycdhqd.js");
705
+ const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-jjc9qbe0.js");
706
706
  const rollups = await readKnowledgeCounterRollups(directory);
707
707
  const flagIds = new Set;
708
708
  for (const e of atFloor) {
@@ -769,11 +769,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
769
769
  });
770
770
  }
771
771
  if (action === "quarantine" && toQuarantine.length > 0) {
772
- const { quarantineEntry } = await import("./knowledge-validator-ge576f8n.js");
773
- const { KnowledgeConfigSchema } = await import("./schema-a2zm2m3r.js");
772
+ const { quarantineEntry } = await import("./knowledge-validator-h1nrn2pk.js");
773
+ const { KnowledgeConfigSchema } = await import("./schema-bjb0yzsq.js");
774
774
  let config;
775
775
  try {
776
- const { loadPluginConfigWithMeta } = await import("./index-hfpw5m0e.js");
776
+ const { loadPluginConfigWithMeta } = await import("./index-kapharv7.js");
777
777
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
778
778
  config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
779
779
  } catch {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  redactPath,
4
4
  redactShellCommand
5
- } from "./index-mmvaf4t6.js";
5
+ } from "./index-hgh01f6h.js";
6
6
 
7
7
  // src/services/guardrail-log-service.ts
8
8
  import * as fs from "fs/promises";
@@ -1,11 +1,11 @@
1
1
  // @bun
2
+ import {
3
+ atomicWriteFile
4
+ } from "./index-dd7ttx8x.js";
2
5
  import {
3
6
  init_logger,
4
7
  warn
5
8
  } from "./index-zgwm4ryv.js";
6
- import {
7
- atomicWriteFile
8
- } from "./index-7mkpsw6g.js";
9
9
 
10
10
  // src/hooks/knowledge-link.ts
11
11
  import {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-fsrp8wp3.js";
5
5
  import {
6
6
  withEvidenceLock
7
- } from "./index-76kvm9z5.js";
7
+ } from "./index-5nybajn9.js";
8
8
  import {
9
9
  bunWrite
10
10
  } from "./index-qe3v54nb.js";
@@ -4,17 +4,17 @@ import {
4
4
  } from "./index-ae75rja9.js";
5
5
  import {
6
6
  resolveKnowledgeStoreDir
7
- } from "./index-q27bajqb.js";
8
- import {
9
- init_logger,
10
- warn
11
- } from "./index-zgwm4ryv.js";
7
+ } from "./index-cfkvc5q9.js";
12
8
  import {
13
9
  atomicWriteFile
14
- } from "./index-7mkpsw6g.js";
10
+ } from "./index-dd7ttx8x.js";
15
11
  import {
16
12
  require_proper_lockfile
17
13
  } from "./index-7g4c7s5r.js";
14
+ import {
15
+ init_logger,
16
+ warn
17
+ } from "./index-zgwm4ryv.js";
18
18
  import {
19
19
  __require,
20
20
  __toESM
@@ -608,7 +608,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
608
608
  deltas.push({ id, delta });
609
609
  }
610
610
  if (deltas.length > 0) {
611
- const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-45jawb2p.js");
611
+ const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-9e0w1kxm.js");
612
612
  await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
613
613
  }
614
614
  return {
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-sw82jvf2.js";
4
+ } from "./index-rkyhv4p5.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-sp7tm8t7.js";
7
+ } from "./index-c3e0ymrg.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
@@ -84,29 +84,30 @@ import {
84
84
  handleWriteRetroCommand,
85
85
  normalizeSwarmCommandInput,
86
86
  resolveCommand
87
- } from "./index-mwqfyjja.js";
88
- import"./index-mmvaf4t6.js";
89
- import"./index-tj2mkfb3.js";
90
- import"./index-r260ybay.js";
87
+ } from "./index-3dtjhr26.js";
88
+ import"./index-13xxjfhn.js";
89
+ import"./index-hgh01f6h.js";
90
+ import"./index-g87ty4wp.js";
91
+ import"./index-k742ecbm.js";
91
92
  import"./index-4905hd2m.js";
92
93
  import"./index-134d35c1.js";
93
- import"./index-9f71ye47.js";
94
- import"./index-0vd91yb8.js";
95
- import"./index-cpest8sa.js";
96
- import"./index-66zght9d.js";
94
+ import"./index-j6ywarjp.js";
95
+ import"./index-jpkxjmfw.js";
96
+ import"./index-m2s0gbzt.js";
97
97
  import"./index-vxv732ex.js";
98
98
  import"./index-c8s9a3zh.js";
99
99
  import"./index-9ss2m4rs.js";
100
- import"./index-g4mnf3p5.js";
101
- import"./index-s80bsjkj.js";
102
- import"./index-7ftthvqt.js";
103
- import"./index-wz36r0fk.js";
100
+ import"./index-wk1h5ec2.js";
101
+ import"./index-1j3682j8.js";
102
+ import"./index-2njes601.js";
103
+ import"./index-y0kk3rtv.js";
104
104
  import"./index-rtry5xyf.js";
105
- import"./index-j5pnah1w.js";
106
- import"./index-bz08438z.js";
105
+ import"./index-baawkm48.js";
106
+ import"./index-dgxgvzab.js";
107
107
  import"./index-ae75rja9.js";
108
- import"./index-q27bajqb.js";
109
- import"./index-kc1m6vpr.js";
108
+ import"./index-cfkvc5q9.js";
109
+ import"./index-dd7ttx8x.js";
110
+ import"./index-xfejq1p9.js";
110
111
  import"./index-k5jrywpr.js";
111
112
  import"./index-n832052r.js";
112
113
  import {
@@ -115,27 +116,29 @@ import {
115
116
  init_constants,
116
117
  init_schema,
117
118
  stripKnownSwarmPrefix
118
- } from "./index-wzb4dv5s.js";
119
+ } from "./index-b5ek2cge.js";
119
120
  import"./index-bk5tah7q.js";
120
121
  import"./index-8fwhhayc.js";
121
122
  import"./index-q1exe2b3.js";
122
- import"./index-74tptrss.js";
123
- import"./index-2tn5h2zp.js";
123
+ import"./index-p8hezdtz.js";
124
+ import"./index-4p02dp92.js";
124
125
  import"./index-1kz6da87.js";
125
- import"./index-17zjp67y.js";
126
- import"./index-z6xqpmqg.js";
126
+ import"./index-b4z7s917.js";
127
+ import"./index-b8zgtz81.js";
128
+ import"./index-2t1n9k7b.js";
127
129
  import"./index-4rhhvd1a.js";
128
- import"./index-zjygnfay.js";
129
- import"./index-zgwm4ryv.js";
130
- import"./index-h3k62043.js";
131
- import"./index-3x761jqv.js";
132
- import"./index-7mkpsw6g.js";
130
+ import"./index-y3v1404y.js";
131
+ import"./index-2ghkk9ve.js";
133
132
  import"./index-fsrp8wp3.js";
134
- import"./index-76kvm9z5.js";
133
+ import"./index-5nybajn9.js";
134
+ import"./index-7g4c7s5r.js";
135
135
  import"./index-q2rrv0cy.js";
136
136
  import"./index-bpmtbmy9.js";
137
- import"./index-7g4c7s5r.js";
137
+ import"./index-z6xqpmqg.js";
138
+ import"./index-zjygnfay.js";
138
139
  import"./index-qe3v54nb.js";
140
+ import"./index-zgwm4ryv.js";
141
+ import"./index-h3k62043.js";
139
142
  import"./index-a76rekgs.js";
140
143
 
141
144
  // src/commands/index.ts
@@ -8,7 +8,7 @@ import {
8
8
  init_constants,
9
9
  init_schema,
10
10
  stripKnownSwarmPrefix
11
- } from "./index-wzb4dv5s.js";
11
+ } from "./index-b5ek2cge.js";
12
12
  import {
13
13
  log
14
14
  } from "./index-zgwm4ryv.js";
@@ -3,7 +3,7 @@ import {
3
3
  init_constants,
4
4
  init_schema,
5
5
  stripKnownSwarmPrefix
6
- } from "./index-wzb4dv5s.js";
6
+ } from "./index-b5ek2cge.js";
7
7
  import {
8
8
  init_logger,
9
9
  warn
@@ -2212,6 +2212,28 @@ function isInDeclaredScope(filePath, scopeEntries, cwd) {
2212
2212
  return rel.length > 0 && !rel.startsWith("..") && !path.isAbsolute(rel);
2213
2213
  });
2214
2214
  }
2215
+ var MAX_ALLOWED_HINT_ENTRIES = 20;
2216
+ function formatAllowedHints(rules) {
2217
+ const fmt = (items) => {
2218
+ if (!items || items.length === 0)
2219
+ return "(none)";
2220
+ if (items.length <= MAX_ALLOWED_HINT_ENTRIES)
2221
+ return items.join(", ");
2222
+ const omitted = items.length - MAX_ALLOWED_HINT_ENTRIES;
2223
+ return `${items.slice(0, MAX_ALLOWED_HINT_ENTRIES).join(", ")}, \u2026 (+${omitted} more)`;
2224
+ };
2225
+ const parts = [];
2226
+ if (rules.allowedExact && rules.allowedExact.length > 0) {
2227
+ parts.push(`Allowed exact paths: ${fmt(rules.allowedExact)}`);
2228
+ }
2229
+ parts.push(`Allowed prefixes: ${fmt(rules.allowedPrefix)}`);
2230
+ parts.push(`Allowed globs: ${fmt(rules.allowedGlobs)}`);
2231
+ if (rules.allowedCaseSensitiveGlobs && rules.allowedCaseSensitiveGlobs.length > 0) {
2232
+ parts.push(`Allowed case-sensitive globs: ${fmt(rules.allowedCaseSensitiveGlobs)}`);
2233
+ }
2234
+ parts.push("Block rules (blocked zones/prefixes/globs/exact) and universal deny paths still apply.");
2235
+ return parts.join(" ");
2236
+ }
2215
2237
  function checkFileAuthorityWithRules(agentName, filePath, cwd, effectiveRules, options) {
2216
2238
  const normalizedAgent = agentName.toLowerCase();
2217
2239
  const strippedAgent = stripKnownSwarmPrefix(agentName).toLowerCase();
@@ -2321,13 +2343,13 @@ function checkFileAuthorityWithRules(agentName, filePath, cwd, effectiveRules, o
2321
2343
  if (!isAllowed) {
2322
2344
  return {
2323
2345
  allowed: false,
2324
- reason: `Path ${normalizedPath} not in allowed list for ${normalizedAgent}`
2346
+ reason: `Path ${normalizedPath} not in allowed list for ${normalizedAgent}. ${formatAllowedHints(rules)}`
2325
2347
  };
2326
2348
  }
2327
2349
  } else if (rules.allowedPrefix != null && rules.allowedPrefix.length === 0) {
2328
2350
  return {
2329
2351
  allowed: false,
2330
- reason: `Path ${normalizedPath} not in allowed list for ${normalizedAgent}`
2352
+ reason: `Path ${normalizedPath} not in allowed list for ${normalizedAgent}. ${formatAllowedHints(rules)}`
2331
2353
  };
2332
2354
  }
2333
2355
  }
@@ -2,18 +2,18 @@
2
2
  import {
3
3
  ALLOWED_SKILL_PATH_PREFIXES,
4
4
  validateSkillPath
5
- } from "./index-7ftthvqt.js";
5
+ } from "./index-2njes601.js";
6
6
  import {
7
7
  computeOutcomeSignal,
8
8
  readKnowledge,
9
9
  resolveHiveKnowledgePath,
10
10
  resolveSwarmKnowledgePath,
11
11
  transactKnowledge
12
- } from "./index-j5pnah1w.js";
12
+ } from "./index-baawkm48.js";
13
13
  import {
14
14
  effectiveRetrievalOutcomes,
15
15
  readKnowledgeCounterRollups
16
- } from "./index-bz08438z.js";
16
+ } from "./index-dgxgvzab.js";
17
17
  import {
18
18
  init_knowledge_types,
19
19
  isActiveStatus
@@ -6,13 +6,13 @@ import {
6
6
  resolveSwarmKnowledgePath,
7
7
  transactKnowledge,
8
8
  wordBigrams
9
- } from "./index-j5pnah1w.js";
9
+ } from "./index-baawkm48.js";
10
10
  import {
11
11
  countEntryContradictionsInWindow,
12
12
  countEntryViolationsInWindow,
13
13
  readKnowledgeEvents,
14
14
  recordKnowledgeEvent
15
- } from "./index-bz08438z.js";
15
+ } from "./index-dgxgvzab.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-ge576f8n.js");
193
+ const { quarantineEntry } = await import("./knowledge-validator-h1nrn2pk.js");
194
194
  let policyConfig;
195
195
  try {
196
- const { KnowledgeConfigSchema } = await import("./schema-a2zm2m3r.js");
197
- const { loadPluginConfigWithMeta } = await import("./index-hfpw5m0e.js");
196
+ const { KnowledgeConfigSchema } = await import("./schema-bjb0yzsq.js");
197
+ const { loadPluginConfigWithMeta } = await import("./index-kapharv7.js");
198
198
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
199
199
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
200
200
  } catch {