opencode-swarm 7.144.8 → 7.145.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 (79) hide show
  1. package/dist/cli/{config-doctor-zbqfp0v6.js → config-doctor-dzsv3pqy.js} +2 -2
  2. package/dist/cli/{core-pz9gwatq.js → core-qkh9me8x.js} +2 -2
  3. package/dist/cli/{curation-policy-a511r0qz.js → curation-policy-5x6346tf.js} +7 -7
  4. package/dist/cli/{curator-drift-ckjm272w.js → curator-drift-yn5d0mvq.js} +3 -3
  5. package/dist/cli/{curator-llm-factory-3nq3p02z.js → curator-llm-factory-q5p4578g.js} +32 -31
  6. package/dist/cli/{curator-sk0dyvke.js → curator-zssndq5x.js} +32 -31
  7. package/dist/cli/dispatch-ndxbsk98.js +1 -1
  8. package/dist/cli/{evidence-summary-service-abwrjqd0.js → evidence-summary-service-dqcpapj8.js} +14 -13
  9. package/dist/cli/{gate-evidence-aa7vvtcd.js → gate-evidence-bkdqryqg.js} +9 -8
  10. package/dist/cli/guardrail-explain-kspf83x5.js +65 -0
  11. package/dist/cli/{guardrail-log-jw5mzs0d.js → guardrail-log-qg4sq6gr.js} +4 -4
  12. package/dist/cli/{hive-promoter-m20j63yg.js → hive-promoter-3h7dhnek.js} +32 -31
  13. package/dist/cli/{index-r14qx363.js → index-0jr9zn34.js} +1 -1
  14. package/dist/cli/{index-7qb0hn8n.js → index-0pcq32y2.js} +1 -1
  15. package/dist/cli/{index-nmy6rss1.js → index-2dnqazyr.js} +1 -1
  16. package/dist/cli/{index-r2rkwvzq.js → index-4e5a28h7.js} +2 -2
  17. package/dist/cli/index-4evasm2b.js +514 -0
  18. package/dist/cli/{index-k7fk9fjs.js → index-4zwjc9sb.js} +10 -29
  19. package/dist/cli/{index-c2rpht77.js → index-6ezbzd5e.js} +2504 -1993
  20. package/dist/cli/{index-xp5g9eps.js → index-6hqhyb0f.js} +4 -4
  21. package/dist/cli/{index-9s8drsf9.js → index-6q3agdmr.js} +4 -21
  22. package/dist/cli/{index-hkdgkkhb.js → index-77ef8gye.js} +2 -2
  23. package/dist/cli/{index-0v1f2sdb.js → index-7g276m9m.js} +2 -2
  24. package/dist/cli/{index-tffg4mwr.js → index-apjdytwx.js} +3 -3
  25. package/dist/cli/{index-xx8tm58n.js → index-b3xret0a.js} +5 -5
  26. package/dist/cli/{index-cx51wy0c.js → index-c13ttmak.js} +8 -8
  27. package/dist/cli/{index-d1dbpxxk.js → index-e00wbqw5.js} +2 -2
  28. package/dist/cli/{index-cwtpqm5f.js → index-e1pxav9g.js} +1 -1
  29. package/dist/cli/{index-n4hwcsbd.js → index-ffdwj1an.js} +5 -5
  30. package/dist/cli/{index-vdha477y.js → index-fp464as8.js} +1 -1
  31. package/dist/cli/{index-8dbzaf0m.js → index-h4hasck4.js} +4 -4
  32. package/dist/cli/{index-t72g4a7y.js → index-hfzcztv6.js} +34 -33
  33. package/dist/cli/{index-wknz5c8q.js → index-jy9bwa9k.js} +2 -2
  34. package/dist/cli/{index-bv44950t.js → index-k6pdsct6.js} +1 -1
  35. package/dist/cli/{index-t2ntgzts.js → index-kp87kr1a.js} +3 -3
  36. package/dist/cli/{index-sxe5nyq4.js → index-mkks7jwg.js} +13 -15
  37. package/dist/cli/{index-f9vvg5xb.js → index-pa86tpgt.js} +67 -2
  38. package/dist/cli/{index-3k3nbs52.js → index-qfawexc8.js} +9 -9
  39. package/dist/cli/{index-jdxnzbah.js → index-s6cwsnrw.js} +8 -8
  40. package/dist/cli/{index-h1p08s3n.js → index-s72naw1j.js} +1 -1
  41. package/dist/cli/{index-z4fssj97.js → index-v64kjqvg.js} +15 -15
  42. package/dist/cli/{index-6z5jtf7d.js → index-wk54ey3h.js} +4 -4
  43. package/dist/cli/{index-gfvkttvd.js → index-zfhe7vbb.js} +1 -1
  44. package/dist/cli/{index-1jsmmx7y.js → index-zz5qsjd1.js} +64 -35
  45. package/dist/cli/index.js +32 -31
  46. package/dist/cli/{knowledge-escalator-mg8qb7tm.js → knowledge-escalator-w1mbaktt.js} +14 -13
  47. package/dist/cli/{knowledge-events-3zxf8xpb.js → knowledge-events-a0dj6gy6.js} +12 -11
  48. package/dist/cli/{knowledge-link-4cg4776a.js → knowledge-link-mzdjvjsd.js} +6 -6
  49. package/dist/cli/{knowledge-store-awnm8s6c.js → knowledge-store-8kk3rghx.js} +7 -7
  50. package/dist/cli/{knowledge-validator-3ke5scx3.js → knowledge-validator-91ym56e0.js} +9 -9
  51. package/dist/cli/{pending-delegations-9h1jmtw1.js → pending-delegations-6vsrmw5w.js} +6 -6
  52. package/dist/cli/{pr-subscriptions-8pg34pev.js → pr-subscriptions-zc3skxde.js} +6 -6
  53. package/dist/cli/{runner-cqecp1na.js → runner-jj32v8bk.js} +8 -7
  54. package/dist/cli/{scan-cursor-00rbxkb4.js → scan-cursor-12jxwd14.js} +8 -8
  55. package/dist/cli/{schema-5nmkp1pc.js → schema-nq9tcz87.js} +1 -1
  56. package/dist/cli/{scope-persistence-6m79atw9.js → scope-persistence-dv6z7n08.js} +8 -7
  57. package/dist/cli/{skill-generator-gv70s796.js → skill-generator-drscnzq9.js} +16 -15
  58. package/dist/cli/{telemetry-cybx6cfz.js → telemetry-z54dgdrh.js} +1 -1
  59. package/dist/cli/{workspace-snapshot-d89zm6wm.js → workspace-snapshot-q21mgbsh.js} +2 -2
  60. package/dist/cli/{worktree-collision-ownership-vy0kxa98.js → worktree-collision-ownership-rfyyjjct.js} +9 -9
  61. package/dist/cli/{worktree-isolation-bne0p54w.js → worktree-isolation-4tehtym5.js} +32 -31
  62. package/dist/cli/{worktree-provisioning-owner-zzkjycp1.js → worktree-provisioning-owner-72cyddz5.js} +3 -3
  63. package/dist/commands/close.d.ts +8 -1
  64. package/dist/config/evidence-schema.d.ts +6 -6
  65. package/dist/config/plan-schema.d.ts +2 -2
  66. package/dist/config/schema.d.ts +7 -7
  67. package/dist/evidence/task-file.d.ts +16 -16
  68. package/dist/index.js +560 -530
  69. package/dist/memory/schema.d.ts +3 -3
  70. package/dist/observability/catalog.d.ts +5 -4
  71. package/dist/observability/envelope.d.ts +2 -2
  72. package/dist/services/swarm-residue.d.ts +151 -0
  73. package/dist/telemetry.d.ts +20 -1
  74. package/dist/tools/knowledge-receipt.d.ts +1 -1
  75. package/dist/utils/atomic-write.d.ts +185 -0
  76. package/package.json +1 -1
  77. package/dist/cli/guardrail-explain-hvtyr2fz.js +0 -64
  78. package/dist/cli/{index-f36ybbsv.js → index-b30x236n.js} +3 -3
  79. package/dist/cli/{index-fv0s19g9.js → index-w8pgjr75.js} +3 -3
@@ -1,4 +1,7 @@
1
1
  // @bun
2
+ import {
3
+ bunSpawn
4
+ } from "./index-zj6t9zgx.js";
2
5
  import {
3
6
  SWARM_WORKTREE_DIR_NAME,
4
7
  init_constants
@@ -11,9 +14,6 @@ import {
11
14
  advisoryWarn,
12
15
  init_warning_buffer
13
16
  } from "./index-4rhhvd1a.js";
14
- import {
15
- bunSpawn
16
- } from "./index-zj6t9zgx.js";
17
17
  import {
18
18
  log
19
19
  } from "./index-zgwm4ryv.js";
@@ -92,7 +92,7 @@ var _internals = {
92
92
  symlinkSync: fs.symlinkSync
93
93
  },
94
94
  writeScopeToDisk: async (directory, taskId, files) => {
95
- const { writeScopeToDisk: realWrite } = await import("./scope-persistence-6m79atw9.js");
95
+ const { writeScopeToDisk: realWrite } = await import("./scope-persistence-dv6z7n08.js");
96
96
  return realWrite(directory, taskId, files);
97
97
  },
98
98
  writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
@@ -1,16 +1,12 @@
1
1
  // @bun
2
2
  import {
3
- invalidateCachedArtifact
4
- } from "./index-ed5ykebp.js";
3
+ atomicWriteFileAnyRoot
4
+ } from "./index-4evasm2b.js";
5
5
  import {
6
6
  withEvidenceLock
7
- } from "./index-f9vvg5xb.js";
8
- import {
9
- bunWrite
10
- } from "./index-zj6t9zgx.js";
7
+ } from "./index-pa86tpgt.js";
11
8
 
12
9
  // src/evidence/task-file.ts
13
- import { renameSync, unlinkSync } from "fs";
14
10
  import * as path from "path";
15
11
  function taskEvidenceRelPath(taskId) {
16
12
  return path.join("evidence", `${taskId}.json`);
@@ -18,21 +14,8 @@ function taskEvidenceRelPath(taskId) {
18
14
  function taskEvidencePath(directory, taskId) {
19
15
  return path.join(directory, ".swarm", taskEvidenceRelPath(taskId));
20
16
  }
21
- var _internals = {
22
- renameSync,
23
- unlinkSync
24
- };
25
17
  async function atomicWriteFile(targetPath, content) {
26
- const tempPath = `${targetPath}.tmp.${Date.now()}.${Math.floor(Math.random() * 1e9)}`;
27
- try {
28
- await bunWrite(tempPath, content);
29
- _internals.renameSync(tempPath, targetPath);
30
- } finally {
31
- try {
32
- _internals.unlinkSync(tempPath);
33
- } catch {}
34
- }
35
- invalidateCachedArtifact(targetPath);
18
+ await atomicWriteFileAnyRoot(targetPath, content);
36
19
  }
37
20
  function withTaskEvidenceLock(directory, taskId, agent, fn) {
38
21
  return withEvidenceLock(directory, taskEvidenceRelPath(taskId), agent, taskId, fn);
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-fv0s19g9.js";
4
+ } from "./index-w8pgjr75.js";
5
5
  import {
6
6
  withEvidenceLock
7
- } from "./index-f9vvg5xb.js";
7
+ } from "./index-pa86tpgt.js";
8
8
  import {
9
9
  exports_external,
10
10
  init_zod
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  init_loader,
4
4
  loadPluginConfigWithMeta
5
- } from "./index-7qb0hn8n.js";
5
+ } from "./index-0pcq32y2.js";
6
6
  import {
7
7
  init_schema
8
- } from "./index-gfvkttvd.js";
8
+ } from "./index-zfhe7vbb.js";
9
9
  import {
10
10
  DEFAULT_WORKTREE_ISOLATION_CONFIG,
11
11
  init_constants
@@ -4,14 +4,14 @@ import {
4
4
  PlanSchema,
5
5
  TaskStatusSchema,
6
6
  init_loader
7
- } from "./index-7qb0hn8n.js";
7
+ } from "./index-0pcq32y2.js";
8
8
  import {
9
9
  assertProjectRoot,
10
10
  withEvidenceLock
11
- } from "./index-f9vvg5xb.js";
11
+ } from "./index-pa86tpgt.js";
12
12
  import {
13
13
  emit
14
- } from "./index-1jsmmx7y.js";
14
+ } from "./index-zz5qsjd1.js";
15
15
  import {
16
16
  criticalWarn,
17
17
  init_logger,
@@ -6,12 +6,12 @@ import {
6
6
  resolveSwarmKnowledgePath,
7
7
  transactKnowledge,
8
8
  wordBigrams
9
- } from "./index-3k3nbs52.js";
9
+ } from "./index-qfawexc8.js";
10
10
  import {
11
11
  queryHistoricalOutcomes,
12
12
  readKnowledgeEvents,
13
13
  recordKnowledgeEvent
14
- } from "./index-cx51wy0c.js";
14
+ } from "./index-c13ttmak.js";
15
15
  import {
16
16
  init_knowledge_types,
17
17
  isActiveStatus
@@ -224,11 +224,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
224
224
  alreadyInactive: true
225
225
  };
226
226
  }
227
- const { quarantineEntry } = await import("./knowledge-validator-3ke5scx3.js");
227
+ const { quarantineEntry } = await import("./knowledge-validator-91ym56e0.js");
228
228
  let policyConfig;
229
229
  try {
230
- const { KnowledgeConfigSchema } = await import("./schema-5nmkp1pc.js");
231
- const { loadPluginConfigWithMeta } = await import("./index-t2ntgzts.js");
230
+ const { KnowledgeConfigSchema } = await import("./schema-nq9tcz87.js");
231
+ const { loadPluginConfigWithMeta } = await import("./index-kp87kr1a.js");
232
232
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
233
233
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
234
234
  } catch {
@@ -1,29 +1,29 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-fv0s19g9.js";
4
+ } from "./index-w8pgjr75.js";
5
5
  import {
6
6
  loadPluginConfigWithMeta
7
- } from "./index-7qb0hn8n.js";
7
+ } from "./index-0pcq32y2.js";
8
8
  import {
9
9
  KnowledgeConfigSchema,
10
10
  init_schema
11
- } from "./index-gfvkttvd.js";
11
+ } from "./index-zfhe7vbb.js";
12
12
  import {
13
13
  resolveHiveEventsPath
14
14
  } from "./index-ae75rja9.js";
15
15
  import {
16
16
  resolveKnowledgeStoreDir
17
- } from "./index-h1p08s3n.js";
17
+ } from "./index-s72naw1j.js";
18
18
  import {
19
19
  atomicWriteFile
20
- } from "./index-9s8drsf9.js";
20
+ } from "./index-6q3agdmr.js";
21
21
  import {
22
22
  assertProjectRoot
23
- } from "./index-f9vvg5xb.js";
23
+ } from "./index-pa86tpgt.js";
24
24
  import {
25
25
  emit
26
- } from "./index-1jsmmx7y.js";
26
+ } from "./index-zz5qsjd1.js";
27
27
  import {
28
28
  require_proper_lockfile
29
29
  } from "./index-7g4c7s5r.js";
@@ -2545,7 +2545,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
2545
2545
  }
2546
2546
  let bumps = 0;
2547
2547
  if (deltas.length > 0) {
2548
- const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-awnm8s6c.js");
2548
+ const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-8kk3rghx.js");
2549
2549
  bumps = await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
2550
2550
  }
2551
2551
  return {
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  readKnowledge,
4
4
  transactKnowledge
5
- } from "./index-3k3nbs52.js";
5
+ } from "./index-qfawexc8.js";
6
6
  import {
7
7
  init_git_executable,
8
8
  resolveGitExecutableAsync
9
9
  } from "./index-9e6fdz2h.js";
10
10
  import {
11
11
  resolveKnowledgeStoreDir
12
- } from "./index-h1p08s3n.js";
12
+ } from "./index-s72naw1j.js";
13
13
  import {
14
14
  init_knowledge_types,
15
15
  isActiveStatus
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-fv0s19g9.js";
4
+ } from "./index-w8pgjr75.js";
5
5
 
6
6
  // src/hooks/delegation-gate/worktree-provisioning-owner.ts
7
7
  import { createHash, randomBytes } from "crypto";
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-fv0s19g9.js";
4
+ } from "./index-w8pgjr75.js";
5
+ import {
6
+ bunWrite
7
+ } from "./index-zj6t9zgx.js";
5
8
  import {
6
9
  withEvidenceLock
7
- } from "./index-f9vvg5xb.js";
10
+ } from "./index-pa86tpgt.js";
8
11
  import {
9
12
  exports_external,
10
13
  init_zod
11
14
  } from "./index-bpmtbmy9.js";
12
- import {
13
- bunWrite
14
- } from "./index-zj6t9zgx.js";
15
15
  import {
16
16
  init_logger,
17
17
  warn
@@ -7,7 +7,7 @@ import {
7
7
  readLinkPointer,
8
8
  resolveKnowledgeStoreDir,
9
9
  resolveLinkDir
10
- } from "./index-h1p08s3n.js";
10
+ } from "./index-s72naw1j.js";
11
11
 
12
12
  // src/knowledge/curation-policy.ts
13
13
  import { appendFile, mkdir as mkdir2, readFile as readFile2 } from "fs/promises";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  authorizeCuration
4
- } from "./index-vdha477y.js";
4
+ } from "./index-fp464as8.js";
5
5
  import {
6
6
  findNearDuplicate,
7
7
  inferTags,
@@ -9,13 +9,13 @@ import {
9
9
  resolveSwarmKnowledgePath,
10
10
  resolveSwarmRejectedPath,
11
11
  transactKnowledge
12
- } from "./index-3k3nbs52.js";
12
+ } from "./index-qfawexc8.js";
13
13
  import {
14
14
  resolveKnowledgeStoreDir
15
- } from "./index-h1p08s3n.js";
15
+ } from "./index-s72naw1j.js";
16
16
  import {
17
17
  atomicWriteFile
18
- } from "./index-9s8drsf9.js";
18
+ } from "./index-6q3agdmr.js";
19
19
  import {
20
20
  require_proper_lockfile
21
21
  } from "./index-7g4c7s5r.js";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-r2rkwvzq.js";
4
+ } from "./index-4e5a28h7.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-bv44950t.js";
7
+ } from "./index-k6pdsct6.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
@@ -85,50 +85,51 @@ import {
85
85
  handleWriteRetroCommand,
86
86
  normalizeSwarmCommandInput,
87
87
  resolveCommand
88
- } from "./index-c2rpht77.js";
89
- import"./index-nmy6rss1.js";
90
- import"./index-r14qx363.js";
91
- import"./index-z4fssj97.js";
88
+ } from "./index-6ezbzd5e.js";
89
+ import"./index-2dnqazyr.js";
90
+ import"./index-0jr9zn34.js";
91
+ import"./index-v64kjqvg.js";
92
92
  import"./index-134d35c1.js";
93
93
  import"./index-abtrcs16.js";
94
- import"./index-6z5jtf7d.js";
95
- import"./index-wknz5c8q.js";
94
+ import"./index-wk54ey3h.js";
95
+ import"./index-jy9bwa9k.js";
96
96
  import"./index-y8552snf.js";
97
- import"./index-d1dbpxxk.js";
97
+ import"./index-e00wbqw5.js";
98
98
  import"./index-70ha9e09.js";
99
99
  import"./index-c8s9a3zh.js";
100
100
  import"./index-9ss2m4rs.js";
101
- import"./index-f36ybbsv.js";
102
- import"./index-hkdgkkhb.js";
103
- import"./index-sxe5nyq4.js";
104
- import"./index-xx8tm58n.js";
105
- import"./index-8dbzaf0m.js";
106
- import"./index-vdha477y.js";
101
+ import"./index-b30x236n.js";
102
+ import"./index-77ef8gye.js";
103
+ import"./index-mkks7jwg.js";
104
+ import"./index-b3xret0a.js";
105
+ import"./index-h4hasck4.js";
106
+ import"./index-fp464as8.js";
107
107
  import"./index-rtry5xyf.js";
108
108
  import"./index-zsrtt42s.js";
109
- import"./index-n4hwcsbd.js";
110
- import"./index-cwtpqm5f.js";
111
- import"./index-jdxnzbah.js";
112
- import"./index-xp5g9eps.js";
113
- import"./index-k7fk9fjs.js";
114
- import"./index-tffg4mwr.js";
109
+ import"./index-ffdwj1an.js";
110
+ import"./index-e1pxav9g.js";
111
+ import"./index-s6cwsnrw.js";
112
+ import"./index-6hqhyb0f.js";
113
+ import"./index-4zwjc9sb.js";
114
+ import"./index-apjdytwx.js";
115
115
  import"./index-556ja8an.js";
116
116
  import"./index-7sy3aa9m.js";
117
117
  import"./index-wx8zdh4a.js";
118
118
  import"./index-3g0xk6tk.js";
119
119
  import"./index-85gkedsf.js";
120
- import"./index-3k3nbs52.js";
121
- import"./index-cx51wy0c.js";
122
- import"./index-0v1f2sdb.js";
120
+ import"./index-qfawexc8.js";
121
+ import"./index-c13ttmak.js";
122
+ import"./index-7g276m9m.js";
123
123
  import"./index-gprxjmm7.js";
124
124
  import"./index-n832052r.js";
125
- import"./index-fv0s19g9.js";
125
+ import"./index-w8pgjr75.js";
126
126
  import"./index-z6xqpmqg.js";
127
- import"./index-7qb0hn8n.js";
127
+ import"./index-zj6t9zgx.js";
128
+ import"./index-0pcq32y2.js";
128
129
  import {
129
130
  init_schema,
130
131
  stripKnownSwarmPrefix
131
- } from "./index-gfvkttvd.js";
132
+ } from "./index-zfhe7vbb.js";
132
133
  import {
133
134
  AGENT_TOOL_MAP,
134
135
  ORCHESTRATOR_NAME,
@@ -138,15 +139,15 @@ import"./index-9e6fdz2h.js";
138
139
  import"./index-4rhhvd1a.js";
139
140
  import"./index-zjygnfay.js";
140
141
  import"./index-ae75rja9.js";
141
- import"./index-h1p08s3n.js";
142
- import"./index-9s8drsf9.js";
143
- import"./index-ed5ykebp.js";
142
+ import"./index-s72naw1j.js";
143
+ import"./index-6q3agdmr.js";
144
144
  import"./index-bk5tah7q.js";
145
- import"./index-f9vvg5xb.js";
146
- import"./index-1jsmmx7y.js";
145
+ import"./index-4evasm2b.js";
146
+ import"./index-pa86tpgt.js";
147
+ import"./index-zz5qsjd1.js";
147
148
  import"./index-7g4c7s5r.js";
148
149
  import"./index-bpmtbmy9.js";
149
- import"./index-zj6t9zgx.js";
150
+ import"./index-ed5ykebp.js";
150
151
  import"./index-zgwm4ryv.js";
151
152
  import"./index-a76rekgs.js";
152
153
 
@@ -9,11 +9,11 @@ import {
9
9
  } from "./index-y8552snf.js";
10
10
  import {
11
11
  atomicWriteFile
12
- } from "./index-9s8drsf9.js";
12
+ } from "./index-6q3agdmr.js";
13
13
  import {
14
14
  assertProjectRoot,
15
15
  withEvidenceLock
16
- } from "./index-f9vvg5xb.js";
16
+ } from "./index-pa86tpgt.js";
17
17
  import {
18
18
  exports_external,
19
19
  init_zod
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  redactPath,
4
4
  redactShellCommand
5
- } from "./index-nmy6rss1.js";
5
+ } from "./index-2dnqazyr.js";
6
6
 
7
7
  // src/services/guardrail-log-service.ts
8
8
  import * as fs from "fs/promises";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  _internals,
4
4
  resolveWorktreeIsolationConfig
5
- } from "./index-0v1f2sdb.js";
5
+ } from "./index-7g276m9m.js";
6
6
  import {
7
7
  ApprovalEvidenceSchema,
8
8
  BaseEvidenceSchema,
@@ -42,7 +42,7 @@ import {
42
42
  loadPluginConfig,
43
43
  loadPluginConfigWithMeta,
44
44
  loadPluginConfigWithMetaAsync
45
- } from "./index-7qb0hn8n.js";
45
+ } from "./index-0pcq32y2.js";
46
46
  import {
47
47
  AUTO_REVIEW_V8_BURN_IN_DECISION,
48
48
  AgentOverrideConfigSchema,
@@ -64,7 +64,7 @@ import {
64
64
  TurboConfigSchema,
65
65
  WorktreeIsolationConfigSchema,
66
66
  resolveAutoReviewConfig
67
- } from "./index-gfvkttvd.js";
67
+ } from "./index-zfhe7vbb.js";
68
68
  import {
69
69
  ALL_AGENT_NAMES,
70
70
  ALL_SUBAGENT_NAMES,
@@ -2,18 +2,18 @@
2
2
  import {
3
3
  ALLOWED_SKILL_PATH_PREFIXES,
4
4
  validateSkillPath
5
- } from "./index-8dbzaf0m.js";
5
+ } from "./index-h4hasck4.js";
6
6
  import {
7
7
  computeOutcomeSignal,
8
8
  readKnowledge,
9
9
  resolveHiveKnowledgePath,
10
10
  resolveSwarmKnowledgePath,
11
11
  transactKnowledge
12
- } from "./index-3k3nbs52.js";
12
+ } from "./index-qfawexc8.js";
13
13
  import {
14
14
  effectiveRetrievalOutcomes,
15
15
  readAuthoritativeKnowledgeCounterRollups
16
- } from "./index-cx51wy0c.js";
16
+ } from "./index-c13ttmak.js";
17
17
  import {
18
18
  advisoryWarn,
19
19
  init_warning_buffer
@@ -22,6 +22,10 @@ import {
22
22
  init_knowledge_types,
23
23
  isActiveStatus
24
24
  } from "./index-bk5tah7q.js";
25
+ import {
26
+ atomicWriteFileAnyRoot,
27
+ atomicWriteSwarmFile
28
+ } from "./index-4evasm2b.js";
25
29
  import {
26
30
  init_logger,
27
31
  log,
@@ -33,7 +37,7 @@ import {
33
37
 
34
38
  // src/services/skill-generator.ts
35
39
  import { existsSync as existsSync2, unlinkSync } from "fs";
36
- import { mkdir as mkdir4, readFile as readFile4, rename as rename3, unlink, writeFile as writeFile4 } from "fs/promises";
40
+ import { mkdir as mkdir4, readFile as readFile4, unlink, writeFile as writeFile3 } from "fs/promises";
37
41
  import * as path4 from "path";
38
42
 
39
43
  // src/config/bundled-skills.ts
@@ -375,9 +379,7 @@ import {
375
379
  readdir as readdir2,
376
380
  readFile as readFile3,
377
381
  realpath,
378
- rename as rename2,
379
- stat as stat2,
380
- writeFile as writeFile3
382
+ stat as stat2
381
383
  } from "fs/promises";
382
384
  import * as path3 from "path";
383
385
  var SLUG_PATTERN = /^[a-z0-9][a-z0-9-]{0,63}$/;
@@ -692,9 +694,7 @@ async function evaluateSkillChange(req) {
692
694
  }
693
695
  async function atomicWrite(filePath, content) {
694
696
  await mkdir3(path3.dirname(filePath), { recursive: true });
695
- const tmp = `${filePath}.tmp-${process.pid}-${Date.now()}`;
696
- await writeFile3(tmp, content, "utf-8");
697
- await rename2(tmp, filePath);
697
+ await atomicWriteSwarmFile(filePath, content);
698
698
  }
699
699
  async function appendRejectedSkillEdit(req, evaluation) {
700
700
  const filePath = rejectedEditsPath(req.directory);
@@ -1040,9 +1040,7 @@ function escapeMarkdown(s) {
1040
1040
  }
1041
1041
  async function atomicWrite2(p, content) {
1042
1042
  await mkdir4(path4.dirname(p), { recursive: true });
1043
- const tmp = `${p}.tmp-${process.pid}-${Date.now()}`;
1044
- await writeFile4(tmp, content, "utf-8");
1045
- await rename3(tmp, p);
1043
+ await atomicWriteFileAnyRoot(p, content);
1046
1044
  }
1047
1045
  async function generateSkills(req) {
1048
1046
  const minConfidence = req.minConfidence ?? DEFAULT_SKILL_MIN_CONFIDENCE;
@@ -1794,7 +1792,7 @@ async function retireSkill(directory, slug, reason) {
1794
1792
  reason: reason ?? "manual_retire"
1795
1793
  });
1796
1794
  await mkdir4(markerDir, { recursive: true });
1797
- await writeFile4(markerPath, markerContent, "utf-8");
1795
+ await writeFile3(markerPath, markerContent, "utf-8");
1798
1796
  let clearedLinks = [];
1799
1797
  try {
1800
1798
  clearedLinks = await clearRetiredSkillLinks(directory, skillPath, cleanSlug);
@@ -1884,7 +1882,7 @@ async function clearSkillLinks(directory, skillFilePath, slug, mode) {
1884
1882
  }
1885
1883
  async function markSkillStale(skillDir, reason) {
1886
1884
  await mkdir4(skillDir, { recursive: true });
1887
- await writeFile4(path4.join(skillDir, "stale.marker"), reason, "utf-8");
1885
+ await writeFile3(path4.join(skillDir, "stale.marker"), reason, "utf-8");
1888
1886
  }
1889
1887
  async function clearSkillStale(skillDir) {
1890
1888
  const markerPath = path4.join(skillDir, "stale.marker");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  emit
4
- } from "./index-1jsmmx7y.js";
4
+ } from "./index-zz5qsjd1.js";
5
5
  import {
6
6
  require_proper_lockfile
7
7
  } from "./index-7g4c7s5r.js";
@@ -47,6 +47,17 @@ function getLockFilePath(directory, filePath) {
47
47
  }
48
48
  return lockPath;
49
49
  }
50
+ function getMetaPath(lockPath) {
51
+ return `${lockPath.replace(/\.lock$/, "")}.meta`;
52
+ }
53
+ function readMetaFile(metaPath) {
54
+ try {
55
+ const content = fs.readFileSync(metaPath, "utf-8");
56
+ return JSON.parse(content);
57
+ } catch {
58
+ return null;
59
+ }
60
+ }
50
61
  async function tryAcquireLock(directory, filePath, agent, taskId) {
51
62
  const lockPath = getLockFilePath(directory, filePath);
52
63
  const locksDir = path.dirname(lockPath);
@@ -85,6 +96,60 @@ async function tryAcquireLock(directory, filePath, agent, taskId) {
85
96
  };
86
97
  return { acquired: true, lock };
87
98
  }
99
+ function listActiveLocks(directory) {
100
+ const locksDir = path.join(directory, LOCKS_DIR);
101
+ const locks = [];
102
+ if (!fs.existsSync(locksDir)) {
103
+ return locks;
104
+ }
105
+ const files = fs.readdirSync(locksDir);
106
+ const now = Date.now();
107
+ for (const file of files) {
108
+ if (!file.endsWith(".lock"))
109
+ continue;
110
+ const lockPath = path.join(locksDir, file);
111
+ try {
112
+ const stat = fs.statSync(lockPath);
113
+ if (stat.isFile()) {
114
+ const plLockDir = `${lockPath}.lock`;
115
+ if (fs.existsSync(plLockDir)) {
116
+ const metaPath = getMetaPath(lockPath);
117
+ const meta = readMetaFile(metaPath);
118
+ if (meta) {
119
+ if (meta.expiresAt < now) {
120
+ continue;
121
+ }
122
+ locks.push({
123
+ filePath: meta.originalPath,
124
+ agent: meta.agent,
125
+ taskId: meta.taskId,
126
+ timestamp: meta.acquiredAt,
127
+ expiresAt: meta.expiresAt,
128
+ laneId: meta.laneId
129
+ });
130
+ } else {
131
+ let acquiredAt = Date.now();
132
+ try {
133
+ acquiredAt = fs.statSync(plLockDir).mtimeMs;
134
+ } catch {}
135
+ const expiresAt = acquiredAt + LOCK_TIMEOUT_MS;
136
+ if (expiresAt < now) {
137
+ continue;
138
+ }
139
+ locks.push({
140
+ filePath: lockPath,
141
+ agent: "unknown",
142
+ taskId: "unknown",
143
+ timestamp: new Date(acquiredAt).toISOString(),
144
+ expiresAt
145
+ });
146
+ }
147
+ }
148
+ }
149
+ } catch {}
150
+ }
151
+ return locks;
152
+ }
88
153
 
89
154
  // src/utils/project-boundary.ts
90
155
  init_logger();
@@ -295,4 +360,4 @@ async function withEvidenceLock(directory, evidencePath, agent, taskId, fn, time
295
360
  }
296
361
  }
297
362
 
298
- export { tryAcquireLock, hasExplicitProjectBoundary, isStrictPathDescendant, assertProjectRoot, withEvidenceLock };
363
+ export { tryAcquireLock, listActiveLocks, hasExplicitProjectBoundary, isStrictPathDescendant, assertProjectRoot, withEvidenceLock };