opencode-swarm 7.166.0 → 7.166.2

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 (107) hide show
  1. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  2. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  3. package/dist/background/candidate-contract.d.ts +14 -0
  4. package/dist/background/pr-subscriptions.d.ts +33 -1
  5. package/dist/background/workspace-snapshot.d.ts +41 -0
  6. package/dist/cli/{coder-settlement-ydg2jfrk.js → coder-settlement-pv86n7n4.js} +14 -14
  7. package/dist/cli/{config-doctor-drqx6tzc.js → config-doctor-fy1aytwt.js} +5 -5
  8. package/dist/cli/{core-x6sftfwt.js → core-1d9vqbt4.js} +4 -4
  9. package/dist/cli/{curation-policy-jtzwz6bc.js → curation-policy-gnpgc3z7.js} +7 -5
  10. package/dist/cli/{curator-kg2h8jjf.js → curator-a4rbehfr.js} +40 -40
  11. package/dist/cli/{curator-drift-2vwtkegg.js → curator-drift-efmgp1v2.js} +6 -6
  12. package/dist/cli/curator-llm-factory-cwg62ynw.js +70 -0
  13. package/dist/cli/{dispatch-c7xjt7js.js → dispatch-tmb929w8.js} +3 -3
  14. package/dist/cli/{evidence-summary-service-ry5ebnmq.js → evidence-summary-service-dvp1kbm4.js} +18 -18
  15. package/dist/cli/{gate-evidence-qgeceqy8.js → gate-evidence-qf27gdfx.js} +10 -9
  16. package/dist/cli/guardrail-explain-zskpzgsr.js +71 -0
  17. package/dist/cli/guardrail-log-qhw3knjt.js +23 -0
  18. package/dist/cli/{guardrail-reset-4nmy7xas.js → guardrail-reset-84ydxdg3.js} +40 -40
  19. package/dist/cli/hive-promoter-y2daybf6.js +85 -0
  20. package/dist/cli/{index-mg43w8p2.js → index-0a0jsbhg.js} +16 -7
  21. package/dist/cli/{index-a0d4fp6r.js → index-0tc0pcmh.js} +1 -1
  22. package/dist/cli/{index-a7rw4g4s.js → index-14z9en94.js} +3 -3
  23. package/dist/cli/{index-gy0nyfbw.js → index-19hjpqsy.js} +61 -16
  24. package/dist/cli/{index-fywshabz.js → index-22sannyk.js} +7 -7
  25. package/dist/cli/{index-p04pa9c9.js → index-2n1v8ft1.js} +2 -2
  26. package/dist/cli/{index-jc9cxh90.js → index-3nww2vnx.js} +11 -11
  27. package/dist/cli/{index-9hy5q7gp.js → index-3wtfrjcx.js} +4 -4
  28. package/dist/cli/{index-anxs69ad.js → index-4kwxpnf8.js} +13 -6
  29. package/dist/cli/{index-8m12y79g.js → index-7mxrqy4r.js} +7 -7
  30. package/dist/cli/{index-jx9f4ke1.js → index-7pp8fz4j.js} +1 -1
  31. package/dist/cli/{index-a5w71m8f.js → index-8nv3bc9h.js} +4 -4
  32. package/dist/cli/{index-30f4fe30.js → index-9ccxcjdm.js} +4 -4
  33. package/dist/cli/{index-hwj25q9r.js → index-bks56jbg.js} +70 -53
  34. package/dist/cli/{index-8hqkrd2j.js → index-bysyj3z4.js} +1 -1
  35. package/dist/cli/{index-8n62bphd.js → index-c0eyq4rp.js} +4 -4
  36. package/dist/cli/{index-c20gf089.js → index-c23w8t46.js} +1 -1
  37. package/dist/cli/{index-8d90gzaz.js → index-d5qf7hvh.js} +3 -3
  38. package/dist/cli/{index-nb924ar6.js → index-e0bjbadr.js} +2 -2
  39. package/dist/cli/{index-z6xqpmqg.js → index-ee6ydtfe.js} +1 -1
  40. package/dist/cli/{index-axf65x87.js → index-fkk7x6sy.js} +5 -5
  41. package/dist/cli/{index-17yszqs5.js → index-ft1tnx0e.js} +1 -1
  42. package/dist/cli/{index-an89qzd9.js → index-gy55mc55.js} +749 -755
  43. package/dist/cli/{index-2dvk153d.js → index-hbjax6hy.js} +17 -17
  44. package/dist/cli/{index-2v17wb75.js → index-hgphhnrp.js} +2 -2
  45. package/dist/cli/{index-hvk3zs62.js → index-j81kpway.js} +1 -1
  46. package/dist/cli/{index-hrkamw9q.js → index-jgtje76m.js} +7 -7
  47. package/dist/cli/{index-czr3jcg6.js → index-jr6tppv9.js} +47 -13
  48. package/dist/cli/{index-apxaa755.js → index-kd68b6mg.js} +3 -3
  49. package/dist/cli/{index-289epdpc.js → index-nrdj94za.js} +42 -42
  50. package/dist/cli/{index-79sr3fd1.js → index-nthqfxzz.js} +2 -2
  51. package/dist/cli/{index-6chhqq2n.js → index-p0r5fn7y.js} +94 -3
  52. package/dist/cli/{index-2rm5x9ps.js → index-qmp4gxac.js} +2 -2
  53. package/dist/cli/{index-rkn17q5e.js → index-st47knj6.js} +5 -5
  54. package/dist/cli/{index-edm41q4j.js → index-sxe3t040.js} +2 -2
  55. package/dist/cli/{index-52jfm5s0.js → index-sxsyd7kf.js} +9 -9
  56. package/dist/cli/{index-359djbj1.js → index-ty0wg9yp.js} +5 -5
  57. package/dist/cli/{index-qkq56zyr.js → index-wz258yje.js} +69 -18
  58. package/dist/cli/{index-bw7r2b2m.js → index-x4azb6qj.js} +2 -2
  59. package/dist/cli/{index-8bdk7124.js → index-x8cvbkjs.js} +2 -2
  60. package/dist/cli/{index-aftapk6j.js → index-y3dtdn2f.js} +3 -3
  61. package/dist/cli/{index-4mpdy32j.js → index-ytsts0zj.js} +1 -1
  62. package/dist/cli/{index-ejf6w8vw.js → index-z1kmkh72.js} +2 -2
  63. package/dist/cli/index-zpsr8rpc.js +68 -0
  64. package/dist/cli/index.js +40 -40
  65. package/dist/cli/{knowledge-escalator-xdzmr31d.js → knowledge-escalator-aq7gzhpd.js} +15 -15
  66. package/dist/cli/{knowledge-events-1t1t0bv7.js → knowledge-events-9z5sskyv.js} +13 -13
  67. package/dist/cli/{knowledge-link-1zykfk1p.js → knowledge-link-ps2v4s18.js} +6 -4
  68. package/dist/cli/{knowledge-store-m2snb0xg.js → knowledge-store-1hzt2a0t.js} +7 -5
  69. package/dist/cli/{knowledge-validator-tf7yq2pd.js → knowledge-validator-xe1fza7c.js} +9 -7
  70. package/dist/cli/{model-preflight-3s1c0zpc.js → model-preflight-b3b5pgsc.js} +2 -2
  71. package/dist/cli/{pending-delegations-jr8hwxrz.js → pending-delegations-0nfjg7vp.js} +13 -13
  72. package/dist/cli/{pr-subscriptions-ca1xmf9r.js → pr-subscriptions-8974hwa0.js} +19 -13
  73. package/dist/cli/{pr-workflow-gate-fb1dj0zx.js → pr-workflow-gate-xgak5wvz.js} +40 -40
  74. package/dist/cli/{runner-j3acybhs.js → runner-7zqbp81n.js} +8 -5
  75. package/dist/cli/{scan-cursor-3gdvy0ym.js → scan-cursor-hc4v0c90.js} +8 -6
  76. package/dist/cli/{schema-mzb1354k.js → schema-w1hsvw1h.js} +3 -3
  77. package/dist/cli/{scope-persistence-c4n21b5n.js → scope-persistence-k17003v4.js} +17 -16
  78. package/dist/cli/{skill-generator-dvpvwt8k.js → skill-generator-tbxgpc9x.js} +17 -17
  79. package/dist/cli/{snapshot-coordination-init-g7v63zcm.js → snapshot-coordination-init-vaf34wf0.js} +40 -40
  80. package/dist/cli/{telemetry-9h1z2w9d.js → telemetry-8qn4eag5.js} +5 -1
  81. package/dist/cli/{workspace-snapshot-6z9rk7xw.js → workspace-snapshot-y85jy6gs.js} +11 -1
  82. package/dist/cli/{worktree-collision-ownership-k15qrpy9.js → worktree-collision-ownership-r3jdke7h.js} +14 -14
  83. package/dist/cli/{worktree-isolation-y7ec1pm5.js → worktree-isolation-sa1tbqff.js} +40 -40
  84. package/dist/evidence/phase-participation.d.ts +1 -1
  85. package/dist/git/pr.d.ts +4 -2
  86. package/dist/git/safe-ref.d.ts +51 -0
  87. package/dist/hooks/guardrails/execution-stall.d.ts +10 -5
  88. package/dist/hooks/hive-promoter.d.ts +28 -5
  89. package/dist/hooks/repo-graph-builder.d.ts +14 -0
  90. package/dist/hooks/system-enhancer.d.ts +21 -0
  91. package/dist/index.js +250 -248
  92. package/dist/observability/catalog.d.ts +1 -1
  93. package/dist/session/snapshot-writer.d.ts +42 -0
  94. package/dist/telemetry.d.ts +31 -1
  95. package/dist/tools/co-change-analyzer.d.ts +7 -0
  96. package/dist/tools/gh-evidence.d.ts +15 -8
  97. package/dist/tools/pkg-audit.d.ts +23 -0
  98. package/dist/utils/atomic-write.d.ts +32 -0
  99. package/dist/utils/gh-executable.d.ts +106 -0
  100. package/dist/utils/merge.d.ts +26 -0
  101. package/dist/utils/swarm-artifact-cache.d.ts +6 -0
  102. package/package.json +1 -1
  103. package/dist/cli/curator-llm-factory-7znajprp.js +0 -70
  104. package/dist/cli/guardrail-explain-jdv4n2j3.js +0 -71
  105. package/dist/cli/guardrail-log-s7c3rpde.js +0 -23
  106. package/dist/cli/hive-promoter-w5tsgttc.js +0 -85
  107. package/dist/cli/index-zjygnfay.js +0 -33
@@ -1,11 +1,11 @@
1
1
  // @bun
2
2
  import {
3
- captureWorkspaceSnapshot,
4
- changedFilesSinceSnapshot
5
- } from "./index-6chhqq2n.js";
3
+ captureWorkspaceSnapshotAsync,
4
+ changedFilesSinceSnapshotAsync
5
+ } from "./index-p0r5fn7y.js";
6
6
  import {
7
7
  removeWorktreeProvisioningOwner
8
- } from "./index-8bdk7124.js";
8
+ } from "./index-x8cvbkjs.js";
9
9
  import {
10
10
  SOURCE_WORKTREE_GONE_STAGE,
11
11
  ensureTaskGateRequirementsReceiptForSettledTransition,
@@ -14,19 +14,19 @@ import {
14
14
  reconcileLandedMerge,
15
15
  withTaskEvidenceTransaction,
16
16
  writeWorkflowWalFile
17
- } from "./index-8n62bphd.js";
17
+ } from "./index-c0eyq4rp.js";
18
18
  import {
19
19
  validateSwarmPath
20
- } from "./index-anxs69ad.js";
20
+ } from "./index-4kwxpnf8.js";
21
21
  import {
22
22
  appendCoreEventSync
23
- } from "./index-2v17wb75.js";
23
+ } from "./index-hgphhnrp.js";
24
+ import {
25
+ tryAcquireLock
26
+ } from "./index-sxe3t040.js";
24
27
  import {
25
28
  canonicalRootKeyFresh
26
29
  } from "./index-7qefgq4j.js";
27
- import {
28
- tryAcquireLock
29
- } from "./index-edm41q4j.js";
30
30
  import {
31
31
  init_git_executable,
32
32
  resolveGitExecutable
@@ -167,9 +167,9 @@ function isProcessAlive(processId) {
167
167
  return error.code === "EPERM";
168
168
  }
169
169
  }
170
- function scopedObservedFiles(directory, context) {
170
+ async function scopedObservedFiles(directory, context) {
171
171
  const baseline = { ...context.baseline, directory };
172
- const observed = changedFilesSinceSnapshot(directory, baseline);
172
+ const observed = await changedFilesSinceSnapshotAsync(directory, baseline);
173
173
  if (!observed || !context.declaredFiles)
174
174
  return null;
175
175
  return observed.filter((filePath) => isPathWithinDeclaredScope(filePath, context.declaredFiles ?? [], directory));
@@ -244,7 +244,7 @@ async function commitPrepared(directory, wal) {
244
244
  }
245
245
  async function beginCoderSettlement(options) {
246
246
  if (options.context.baseline.gitHead === null) {
247
- const rootBaseline = captureWorkspaceSnapshot(options.directory);
247
+ const rootBaseline = await captureWorkspaceSnapshotAsync(options.directory);
248
248
  if (rootBaseline.gitHead !== null) {
249
249
  throw new Error(`CODER_SETTLEMENT_BASELINE_UNAVAILABLE: the launch baseline for task ${options.taskId} has no git HEAD \u2014 the observation directory (${options.context.baseline.directory}) is not a git repository or git is unavailable there. ` + "An unregistered worktree lane (a lane directory that git worktree list does not know) produces exactly this. " + 'The task was not dispatched and no settlement state was created; retry the dispatch, or set worktree.policy "disabled" to run coders in the primary tree.');
250
250
  }
@@ -489,7 +489,7 @@ async function cleanupRecoveredWorktree(directory, descriptor) {
489
489
  awaitingMergeByCallID,
490
490
  cleanupStandardWorktreeForCallId,
491
491
  standardWorktreeByCallID
492
- } = await import("./worktree-isolation-y7ec1pm5.js");
492
+ } = await import("./worktree-isolation-sa1tbqff.js");
493
493
  standardWorktreeByCallID.delete(descriptor.callID);
494
494
  if (hasResidue)
495
495
  awaitingMergeByCallID.set(descriptor.callID, {
@@ -581,7 +581,7 @@ async function recoverCoderSettlement(directory, taskId) {
581
581
  if (wal.state === "DISPATCHED") {
582
582
  if (wal.worktree) {
583
583
  const worktree = wal.worktree;
584
- const observed2 = wal.observedFiles ?? scopedObservedFiles(worktree.worktreePath, wal.context);
584
+ const observed2 = wal.observedFiles ?? await scopedObservedFiles(worktree.worktreePath, wal.context);
585
585
  if (observed2 === null) {
586
586
  throw new Error(`CODER_SETTLEMENT_RECOVERY_UNCERTAIN: transition ${wal.transitionId} for isolated task ${taskId} could not attribute worktree changes to the declared scope (${filePath}, state ${wal.state}). Run /swarm recover ${taskId} (or /swarm reset-session), then retry; do not remove the WAL by hand.`);
587
587
  }
@@ -613,7 +613,7 @@ async function recoverCoderSettlement(directory, taskId) {
613
613
  awaitingMergeByCallID,
614
614
  finishStandardWorktreeDispatch,
615
615
  standardWorktreeByCallID
616
- } = await import("./worktree-isolation-y7ec1pm5.js");
616
+ } = await import("./worktree-isolation-sa1tbqff.js");
617
617
  const descriptor = wal.worktree;
618
618
  const reconstructedDispatch = {
619
619
  callID: descriptor.callID,
@@ -682,7 +682,7 @@ async function recoverCoderSettlement(directory, taskId) {
682
682
  });
683
683
  return recovered;
684
684
  }
685
- const rawObserved = changedFilesSinceSnapshot(directory, wal.context.baseline);
685
+ const rawObserved = await changedFilesSinceSnapshotAsync(directory, wal.context.baseline);
686
686
  let observed;
687
687
  if (rawObserved === null) {
688
688
  if (baselineAttributionDoomed(wal.context.baseline)) {
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  observeStoreHealth
4
- } from "./index-axf65x87.js";
4
+ } from "./index-fkk7x6sy.js";
5
5
  import {
6
6
  telemetry
7
- } from "./index-hwj25q9r.js";
7
+ } from "./index-bks56jbg.js";
8
8
  import {
9
9
  init_logger,
10
10
  warn
@@ -9,7 +9,7 @@ import {
9
9
  readEvaluationRun,
10
10
  saveEvaluationRun,
11
11
  saveTaskSetSnapshot
12
- } from "./index-17yszqs5.js";
12
+ } from "./index-ft1tnx0e.js";
13
13
  import {
14
14
  canonicalHash,
15
15
  computeCandidateInputContentHash,
@@ -5,25 +5,25 @@ import {
5
5
  import {
6
6
  effectiveRetrievalOutcomes,
7
7
  readAuthoritativeKnowledgeCounterRollups
8
- } from "./index-jc9cxh90.js";
8
+ } from "./index-3nww2vnx.js";
9
9
  import {
10
10
  ALLOWED_SKILL_PATH_PREFIXES,
11
11
  validateSkillPath
12
- } from "./index-a5w71m8f.js";
12
+ } from "./index-8nv3bc9h.js";
13
13
  import {
14
14
  computeOutcomeSignal,
15
15
  readKnowledge,
16
16
  resolveHiveKnowledgePath,
17
17
  resolveSwarmKnowledgePath,
18
18
  transactKnowledge
19
- } from "./index-fywshabz.js";
20
- import {
21
- canonicalRootKeyFresh
22
- } from "./index-7qefgq4j.js";
19
+ } from "./index-22sannyk.js";
23
20
  import {
24
21
  atomicWriteFileAnyRoot,
25
22
  atomicWriteSwarmFile
26
- } from "./index-gy0nyfbw.js";
23
+ } from "./index-19hjpqsy.js";
24
+ import {
25
+ canonicalRootKeyFresh
26
+ } from "./index-7qefgq4j.js";
27
27
  import {
28
28
  advisoryWarn,
29
29
  init_warning_buffer
@@ -1,35 +1,35 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-anxs69ad.js";
4
+ } from "./index-4kwxpnf8.js";
5
5
  import {
6
6
  deleteCoordinationState,
7
7
  importCoordinationOnce,
8
8
  listCoordinationStates,
9
9
  transitionCoordinationState,
10
10
  withCoordinationTransaction
11
- } from "./index-jx9f4ke1.js";
11
+ } from "./index-7pp8fz4j.js";
12
12
  import {
13
13
  getProjectDb,
14
14
  projectDbExists
15
- } from "./index-aftapk6j.js";
15
+ } from "./index-y3dtdn2f.js";
16
16
  import {
17
17
  observeStoreHealth
18
- } from "./index-axf65x87.js";
19
- import {
20
- canonicalRootKey,
21
- canonicalRootKeyFresh,
22
- sameProjectRoot
23
- } from "./index-7qefgq4j.js";
18
+ } from "./index-fkk7x6sy.js";
24
19
  import {
25
20
  withEvidenceLock
26
- } from "./index-edm41q4j.js";
21
+ } from "./index-sxe3t040.js";
27
22
  import {
28
23
  atomicWriteSwarmFileSync
29
- } from "./index-gy0nyfbw.js";
24
+ } from "./index-19hjpqsy.js";
30
25
  import {
31
26
  telemetry
32
- } from "./index-hwj25q9r.js";
27
+ } from "./index-bks56jbg.js";
28
+ import {
29
+ canonicalRootKey,
30
+ canonicalRootKeyFresh,
31
+ sameProjectRoot
32
+ } from "./index-7qefgq4j.js";
33
33
  import {
34
34
  exports_external,
35
35
  init_zod
@@ -75,7 +75,41 @@ var PR_SUBSCRIPTION_LIMITS = {
75
75
  };
76
76
  var onSubscriptionCreated = null;
77
77
  function setOnSubscriptionCreated(callback) {
78
+ const previous = onSubscriptionCreated;
78
79
  onSubscriptionCreated = callback;
80
+ return previous;
81
+ }
82
+ var prMonitorWorkerHandlers = new Map;
83
+ var MAX_PR_MONITOR_WORKER_HANDLERS = 64;
84
+ function registerPrMonitorWorkerHandler(directory, handler) {
85
+ const key = canonicalRootKey(directory);
86
+ while (prMonitorWorkerHandlers.size >= MAX_PR_MONITOR_WORKER_HANDLERS && !prMonitorWorkerHandlers.has(key)) {
87
+ const oldest = prMonitorWorkerHandlers.keys().next().value;
88
+ if (oldest === undefined)
89
+ break;
90
+ prMonitorWorkerHandlers.delete(oldest);
91
+ }
92
+ prMonitorWorkerHandlers.set(key, handler);
93
+ }
94
+ function removePrMonitorWorkerHandler(directory, expectedHandler) {
95
+ const key = canonicalRootKey(directory);
96
+ if (expectedHandler !== undefined && prMonitorWorkerHandlers.get(key) !== expectedHandler) {
97
+ return;
98
+ }
99
+ prMonitorWorkerHandlers.delete(key);
100
+ }
101
+ function dispatchPrMonitorWorkerHandler(directory, record) {
102
+ const handler = prMonitorWorkerHandlers.get(canonicalRootKey(directory));
103
+ if (handler)
104
+ handler(directory, record);
105
+ }
106
+ function ensurePrSubscriptionDispatcherInstalled() {
107
+ if (onSubscriptionCreated === dispatchPrMonitorWorkerHandler)
108
+ return;
109
+ const previous = setOnSubscriptionCreated(dispatchPrMonitorWorkerHandler);
110
+ if (previous !== null) {
111
+ log("[pr-monitor] superseded a previous on-subscription-created callback (installing the per-project dispatcher)");
112
+ }
79
113
  }
80
114
  var RecordSchema = exports_external.object({
81
115
  correlationId: exports_external.string().min(1),
@@ -2429,4 +2463,4 @@ var _internals = {
2429
2463
  writeCheckpointFile
2430
2464
  };
2431
2465
 
2432
- export { PR_SUBSCRIPTIONS_FILE, PR_SUBSCRIPTIONS_CHECKPOINT_FILE, PR_SUBSCRIPTIONS_AUDIT_FILE, PR_SUBSCRIPTION_LIMITS, setOnSubscriptionCreated, PrSubscriptionCapacityError, isPrSubscriptionCapacityError, buildCorrelationId, subscribe, unsubscribe, listActive, lookupByPr, updateSnapshot, sweepStale, getPrSubscriptionHealth, _internals };
2466
+ export { PR_SUBSCRIPTIONS_FILE, PR_SUBSCRIPTIONS_CHECKPOINT_FILE, PR_SUBSCRIPTIONS_AUDIT_FILE, PR_SUBSCRIPTION_LIMITS, setOnSubscriptionCreated, registerPrMonitorWorkerHandler, removePrMonitorWorkerHandler, ensurePrSubscriptionDispatcherInstalled, PrSubscriptionCapacityError, isPrSubscriptionCapacityError, buildCorrelationId, subscribe, unsubscribe, listActive, lookupByPr, updateSnapshot, sweepStale, getPrSubscriptionHealth, _internals };
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  init_loader,
4
4
  loadPluginConfigWithMeta
5
- } from "./index-mg43w8p2.js";
5
+ } from "./index-0a0jsbhg.js";
6
6
  import {
7
7
  init_schema
8
- } from "./index-nb924ar6.js";
8
+ } from "./index-e0bjbadr.js";
9
9
  import {
10
10
  DEFAULT_WORKTREE_ISOLATION_CONFIG,
11
11
  init_constants
12
- } from "./index-a0d4fp6r.js";
12
+ } from "./index-0tc0pcmh.js";
13
13
 
14
14
  // src/config/index.ts
15
15
  init_constants();
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-ejf6w8vw.js";
4
+ } from "./index-z1kmkh72.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-4mpdy32j.js";
7
+ } from "./index-ytsts0zj.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
@@ -94,73 +94,73 @@ import {
94
94
  handleWriteRetroCommand,
95
95
  normalizeSwarmCommandInput,
96
96
  resolveCommand
97
- } from "./index-an89qzd9.js";
98
- import"./index-8d90gzaz.js";
99
- import"./index-hvk3zs62.js";
100
- import"./index-9hy5q7gp.js";
101
- import"./index-p04pa9c9.js";
102
- import"./index-qkq56zyr.js";
103
- import"./index-17yszqs5.js";
97
+ } from "./index-gy55mc55.js";
98
+ import"./index-d5qf7hvh.js";
99
+ import"./index-j81kpway.js";
100
+ import"./index-3wtfrjcx.js";
101
+ import"./index-2n1v8ft1.js";
102
+ import"./index-wz258yje.js";
103
+ import"./index-ft1tnx0e.js";
104
104
  import"./index-txdagbh7.js";
105
105
  import"./index-cw912re7.js";
106
- import"./index-hrkamw9q.js";
107
- import"./index-359djbj1.js";
108
- import"./index-bw7r2b2m.js";
106
+ import"./index-jgtje76m.js";
107
+ import"./index-ty0wg9yp.js";
108
+ import"./index-x4azb6qj.js";
109
109
  import"./index-70ha9e09.js";
110
- import"./index-8hqkrd2j.js";
110
+ import"./index-bysyj3z4.js";
111
111
  import"./index-9ss2m4rs.js";
112
- import"./index-czr3jcg6.js";
112
+ import"./index-jr6tppv9.js";
113
113
  import"./index-zsrtt42s.js";
114
- import"./index-2dvk153d.js";
115
- import"./index-6chhqq2n.js";
116
- import"./index-8bdk7124.js";
114
+ import"./index-hbjax6hy.js";
115
+ import"./index-p0r5fn7y.js";
116
+ import"./index-x8cvbkjs.js";
117
117
  import"./index-b43rt5ph.js";
118
118
  import"./index-q7sjgr1y.js";
119
- import"./index-8n62bphd.js";
120
- import"./index-2rm5x9ps.js";
121
- import"./index-52jfm5s0.js";
122
- import"./index-jc9cxh90.js";
123
- import"./index-anxs69ad.js";
124
- import"./index-z6xqpmqg.js";
119
+ import"./index-c0eyq4rp.js";
120
+ import"./index-qmp4gxac.js";
121
+ import"./index-sxsyd7kf.js";
122
+ import"./index-3nww2vnx.js";
123
+ import"./index-4kwxpnf8.js";
125
124
  import"./index-p612v1mv.js";
126
- import"./index-a5w71m8f.js";
127
- import"./index-c20gf089.js";
125
+ import"./index-8nv3bc9h.js";
126
+ import"./index-c23w8t46.js";
128
127
  import"./index-rtry5xyf.js";
129
- import"./index-apxaa755.js";
128
+ import"./index-kd68b6mg.js";
130
129
  import"./index-3qf1vxtb.js";
131
130
  import"./index-n832052r.js";
132
- import"./index-8m12y79g.js";
133
- import"./index-30f4fe30.js";
134
- import"./index-2v17wb75.js";
135
- import"./index-79sr3fd1.js";
136
- import"./index-jx9f4ke1.js";
137
- import"./index-aftapk6j.js";
131
+ import"./index-7mxrqy4r.js";
132
+ import"./index-9ccxcjdm.js";
133
+ import"./index-hgphhnrp.js";
134
+ import"./index-nthqfxzz.js";
135
+ import"./index-7pp8fz4j.js";
136
+ import"./index-y3dtdn2f.js";
138
137
  import"./index-ry16d01s.js";
139
138
  import"./index-n4fzmqz8.js";
140
- import"./index-axf65x87.js";
141
- import"./index-fywshabz.js";
139
+ import"./index-fkk7x6sy.js";
140
+ import"./index-22sannyk.js";
142
141
  import"./index-ae75rja9.js";
143
- import"./index-a7rw4g4s.js";
142
+ import"./index-14z9en94.js";
143
+ import"./index-sxe3t040.js";
144
+ import"./index-19hjpqsy.js";
145
+ import"./index-bks56jbg.js";
144
146
  import"./index-7qefgq4j.js";
145
- import"./index-edm41q4j.js";
146
- import"./index-gy0nyfbw.js";
147
- import"./index-hwj25q9r.js";
147
+ import"./index-ee6ydtfe.js";
148
148
  import"./index-7g4c7s5r.js";
149
- import"./index-mg43w8p2.js";
149
+ import"./index-0a0jsbhg.js";
150
150
  import"./index-9e6fdz2h.js";
151
151
  import"./index-4rhhvd1a.js";
152
152
  import {
153
153
  init_schema,
154
154
  stripKnownSwarmPrefix
155
- } from "./index-nb924ar6.js";
155
+ } from "./index-e0bjbadr.js";
156
156
  import {
157
157
  AGENT_TOOL_MAP,
158
158
  ORCHESTRATOR_NAME,
159
159
  init_constants
160
- } from "./index-a0d4fp6r.js";
161
- import"./index-zjygnfay.js";
160
+ } from "./index-0tc0pcmh.js";
162
161
  import"./index-bk5tah7q.js";
163
162
  import"./index-bpmtbmy9.js";
163
+ import"./index-zpsr8rpc.js";
164
164
  import"./index-q1r1cfww.js";
165
165
  import"./index-yzjaj53h.js";
166
166
  import"./index-zgwm4ryv.js";
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  derivePlanId,
4
4
  derivePlanIdentityHash
5
- } from "./index-jx9f4ke1.js";
5
+ } from "./index-7pp8fz4j.js";
6
6
  import {
7
7
  DURABILITY_CLASSES,
8
8
  getProjectDb,
9
9
  projectDbExists,
10
10
  withImmediateTransaction
11
- } from "./index-aftapk6j.js";
11
+ } from "./index-y3dtdn2f.js";
12
12
  import {
13
13
  init_logger,
14
14
  warn
@@ -1,8 +1,15 @@
1
1
  // @bun
2
+ import {
3
+ validateSwarmPath
4
+ } from "./index-4kwxpnf8.js";
2
5
  import {
3
6
  bunSpawn
4
7
  } from "./index-p612v1mv.js";
5
8
  import {
9
+ atomicWriteSwarmFile
10
+ } from "./index-19hjpqsy.js";
11
+ import {
12
+ canonicalRootKey,
6
13
  sameProjectRoot
7
14
  } from "./index-7qefgq4j.js";
8
15
  import {
@@ -1105,7 +1112,8 @@ function porcelainV2PathAfterFields(record, fields) {
1105
1112
  const pathValue = record.slice(offset);
1106
1113
  return pathValue || null;
1107
1114
  }
1108
- function captureWorkspaceSnapshot(directory, optionsOrScope = null, prHeadShaArg = null) {
1115
+ var SNAPSHOT_DIGEST_MARKER_FILENAME = "workspace-snapshot.digest";
1116
+ function parseCaptureOptions(optionsOrScope, prHeadShaArg) {
1109
1117
  const scope = typeof optionsOrScope === "object" && optionsOrScope !== null ? optionsOrScope.scope ?? null : optionsOrScope;
1110
1118
  const configuredPrHeadSha = (() => {
1111
1119
  if (typeof optionsOrScope !== "object" || optionsOrScope === null) {
@@ -1114,6 +1122,16 @@ function captureWorkspaceSnapshot(directory, optionsOrScope = null, prHeadShaArg
1114
1122
  return optionsOrScope.prHeadSha ?? null;
1115
1123
  })();
1116
1124
  const resolveCurrentPrHeadSha = typeof optionsOrScope === "object" && optionsOrScope !== null && optionsOrScope.resolveCurrentPrHeadSha === true;
1125
+ return { scope, configuredPrHeadSha, resolveCurrentPrHeadSha };
1126
+ }
1127
+ function snapshotContentDigest(snapshot) {
1128
+ if (snapshot.gitHead === null || snapshot.dirtyHash === null)
1129
+ return null;
1130
+ return digest(`${snapshot.gitHead}
1131
+ ${snapshot.dirtyHash}`);
1132
+ }
1133
+ function captureWorkspaceSnapshot(directory, optionsOrScope = null, prHeadShaArg = null) {
1134
+ const { scope, configuredPrHeadSha, resolveCurrentPrHeadSha } = parseCaptureOptions(optionsOrScope, prHeadShaArg);
1117
1135
  const upstreamBefore = resolveCurrentPrHeadSha ? runGit(directory, ["rev-parse", "@{upstream}"]) : null;
1118
1136
  const porcelainRaw = runGit(directory, [
1119
1137
  "status",
@@ -1127,7 +1145,7 @@ function captureWorkspaceSnapshot(directory, optionsOrScope = null, prHeadShaArg
1127
1145
  const upstreamAfter = resolveCurrentPrHeadSha ? runGit(directory, ["rev-parse", "@{upstream}"]) : null;
1128
1146
  const prHeadSha = resolveCurrentPrHeadSha ? upstreamBefore && upstreamBefore === upstreamAfter ? upstreamBefore : null : configuredPrHeadSha;
1129
1147
  return {
1130
- directory: path.resolve(directory),
1148
+ directory: canonicalRootKey(directory),
1131
1149
  gitHead: snapshot?.gitHead ?? null,
1132
1150
  dirtyHash: porcelain === null ? null : digest(porcelain),
1133
1151
  changedFiles: snapshot ? [
@@ -1140,6 +1158,52 @@ function captureWorkspaceSnapshot(directory, optionsOrScope = null, prHeadShaArg
1140
1158
  scope
1141
1159
  };
1142
1160
  }
1161
+ async function captureWorkspaceSnapshotAsync(directory, optionsOrScope = null, prHeadShaArg = null) {
1162
+ const { scope, configuredPrHeadSha, resolveCurrentPrHeadSha } = parseCaptureOptions(optionsOrScope, prHeadShaArg);
1163
+ const upstreamBefore = resolveCurrentPrHeadSha ? await runGitAsync(directory, ["rev-parse", "@{upstream}"]) : null;
1164
+ const porcelainRaw = await runGitAsync(directory, [
1165
+ "status",
1166
+ "--porcelain=v2",
1167
+ "--branch",
1168
+ "-z",
1169
+ "--untracked-files=all"
1170
+ ]);
1171
+ const porcelain = porcelainRaw === null ? null : filterSwarmRuntimePorcelain(porcelainRaw);
1172
+ const snapshot = porcelain === null ? null : parsePorcelainV2Snapshot(porcelain);
1173
+ const upstreamAfter = resolveCurrentPrHeadSha ? await runGitAsync(directory, ["rev-parse", "@{upstream}"]) : null;
1174
+ const prHeadSha = resolveCurrentPrHeadSha ? upstreamBefore && upstreamBefore === upstreamAfter ? upstreamBefore : null : configuredPrHeadSha;
1175
+ const captured = {
1176
+ directory: canonicalRootKey(directory),
1177
+ gitHead: snapshot?.gitHead ?? null,
1178
+ dirtyHash: porcelain === null ? null : digest(porcelain),
1179
+ changedFiles: snapshot ? [
1180
+ ...new Set([
1181
+ ...snapshot.dirtyTrackedPaths,
1182
+ ...snapshot.untrackedPaths
1183
+ ])
1184
+ ] : null,
1185
+ prHeadSha,
1186
+ scope
1187
+ };
1188
+ const contentDigest = snapshotContentDigest(captured);
1189
+ if (contentDigest !== null && !shouldSkipSnapshot(directory, contentDigest)) {
1190
+ try {
1191
+ await atomicWriteSwarmFile(validateSwarmPath(directory, SNAPSHOT_DIGEST_MARKER_FILENAME), `${contentDigest}
1192
+ `);
1193
+ } catch {}
1194
+ }
1195
+ return captured;
1196
+ }
1197
+ function shouldSkipSnapshot(directory, digestText) {
1198
+ if (!/^[0-9a-f]{64}$/.test(digestText))
1199
+ return false;
1200
+ try {
1201
+ const stored = fs.readFileSync(validateSwarmPath(directory, SNAPSHOT_DIGEST_MARKER_FILENAME), "utf-8");
1202
+ return stored.trim() === digestText;
1203
+ } catch {
1204
+ return false;
1205
+ }
1206
+ }
1143
1207
  function changedFilesSinceSnapshot(directory, baseline) {
1144
1208
  if (!baseline?.gitHead || baseline.changedFiles == null)
1145
1209
  return null;
@@ -1167,6 +1231,33 @@ function changedFilesSinceSnapshot(directory, baseline) {
1167
1231
  }
1168
1232
  return [...changed];
1169
1233
  }
1234
+ async function changedFilesSinceSnapshotAsync(directory, baseline) {
1235
+ if (!baseline?.gitHead || baseline.changedFiles == null)
1236
+ return null;
1237
+ const baselineDirt = baseline.changedFiles.filter((p) => !isSwarmRuntimePath(p));
1238
+ if (baselineDirt.length > 0)
1239
+ return null;
1240
+ const current = await captureWorkspaceSnapshotAsync(directory);
1241
+ if (!current.gitHead || current.changedFiles == null)
1242
+ return null;
1243
+ const changed = new Set(current.changedFiles);
1244
+ if (baseline.gitHead !== current.gitHead) {
1245
+ const committed = await runGitAsync(directory, [
1246
+ "diff",
1247
+ "--name-only",
1248
+ "-z",
1249
+ baseline.gitHead,
1250
+ current.gitHead
1251
+ ]);
1252
+ if (committed === null)
1253
+ return null;
1254
+ for (const changedPath of parseNulPaths(committed)) {
1255
+ if (!isSwarmRuntimePath(changedPath))
1256
+ changed.add(changedPath);
1257
+ }
1258
+ }
1259
+ return [...changed];
1260
+ }
1170
1261
  function workspaceSnapshotMatches(expected, current) {
1171
1262
  if (!expected)
1172
1263
  return { ok: true };
@@ -1214,4 +1305,4 @@ var _internals = {
1214
1305
  readChangedFileSync: (filePath) => fs.readFileSync(filePath)
1215
1306
  };
1216
1307
 
1217
- export { readGitTextAtRevision, resolveCurrentGitHead, resolveCurrentGitHeadAsync, resolveExactMergeBase, resolveExactMergeBaseAsync, resolvePrReviewDiffStats, resolvePrReviewDiffStatsAsync, resolveCurrentUpstreamRemoteRef, resolveCurrentUpstreamPushTarget, resolveCurrentUpstreamPushTargetAsync, resolveCurrentLocalHeadRefAsync, resolveExactRemoteBranchHead, resolveExactRemoteBranchHeadAsync, redactRemoteUrlIdentity, resolveRemoteUrlIdentity, resolveRemoteUrlIdentityAsync, resolveGitControlStateDigest, resolveGitControlStateDigestAsync, resolveIsWorkingTreeClean, resolveIsWorkingTreeCleanAsync, resolveCommitCountSince, resolveCommitCountSinceAsync, resolveIsExactSingleChildCommit, resolveIsExactSingleChildCommitAsync, resolveRemoteRefsContainingHead, resolveRemoteRefsContainingHeadAsync, resolvePrFeedbackTrackingCandidatesAsync, switchPrFeedbackTrackingCandidateAsync, resolvePrWorkflowRevisionDigestDetailed, resolvePrWorkflowRevisionDigest, resolvePrWorkflowRevisionDigestDetailedAsync, resolvePrWorkflowRevisionDigestAsync, parsePorcelainPaths, isSwarmRuntimePath, parsePorcelainV2Snapshot, captureWorkspaceSnapshot, changedFilesSinceSnapshot, workspaceSnapshotMatches, compareWorkspaceSnapshot, compareWorkspaceSnapshots, digest, _internals };
1308
+ export { readGitTextAtRevision, resolveCurrentGitHead, resolveCurrentGitHeadAsync, resolveExactMergeBase, resolveExactMergeBaseAsync, resolvePrReviewDiffStats, resolvePrReviewDiffStatsAsync, resolveCurrentUpstreamRemoteRef, resolveCurrentUpstreamPushTarget, resolveCurrentUpstreamPushTargetAsync, resolveCurrentLocalHeadRefAsync, resolveExactRemoteBranchHead, resolveExactRemoteBranchHeadAsync, redactRemoteUrlIdentity, resolveRemoteUrlIdentity, resolveRemoteUrlIdentityAsync, resolveGitControlStateDigest, resolveGitControlStateDigestAsync, resolveIsWorkingTreeClean, resolveIsWorkingTreeCleanAsync, resolveCommitCountSince, resolveCommitCountSinceAsync, resolveIsExactSingleChildCommit, resolveIsExactSingleChildCommitAsync, resolveRemoteRefsContainingHead, resolveRemoteRefsContainingHeadAsync, resolvePrFeedbackTrackingCandidatesAsync, switchPrFeedbackTrackingCandidateAsync, resolvePrWorkflowRevisionDigestDetailed, resolvePrWorkflowRevisionDigest, resolvePrWorkflowRevisionDigestDetailedAsync, resolvePrWorkflowRevisionDigestAsync, parsePorcelainPaths, isSwarmRuntimePath, parsePorcelainV2Snapshot, captureWorkspaceSnapshot, captureWorkspaceSnapshotAsync, shouldSkipSnapshot, changedFilesSinceSnapshot, changedFilesSinceSnapshotAsync, workspaceSnapshotMatches, compareWorkspaceSnapshot, compareWorkspaceSnapshots, digest, _internals };
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  SWARM_WORKTREE_DIR_NAME,
15
15
  init_constants
16
- } from "./index-a0d4fp6r.js";
16
+ } from "./index-0tc0pcmh.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-c4n21b5n.js");
95
+ const { writeScopeToDisk: realWrite } = await import("./scope-persistence-k17003v4.js");
96
96
  return realWrite(directory, taskId, files);
97
97
  },
98
98
  writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  _internals,
4
4
  resolveWorktreeIsolationConfig
5
- } from "./index-apxaa755.js";
5
+ } from "./index-kd68b6mg.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-mg43w8p2.js";
47
+ } from "./index-0a0jsbhg.js";
48
48
  import"./index-9e6fdz2h.js";
49
49
  import"./index-4rhhvd1a.js";
50
50
  import {
@@ -70,7 +70,7 @@ import {
70
70
  TurboConfigSchema,
71
71
  WorktreeIsolationConfigSchema,
72
72
  resolveAutoReviewConfig
73
- } from "./index-nb924ar6.js";
73
+ } from "./index-e0bjbadr.js";
74
74
  import {
75
75
  ALL_AGENT_NAMES,
76
76
  ALL_SUBAGENT_NAMES,
@@ -80,10 +80,10 @@ import {
80
80
  QA_AGENTS,
81
81
  isQAAgent,
82
82
  isSubagent
83
- } from "./index-a0d4fp6r.js";
84
- import"./index-zjygnfay.js";
83
+ } from "./index-0tc0pcmh.js";
85
84
  import"./index-bk5tah7q.js";
86
85
  import"./index-bpmtbmy9.js";
86
+ import"./index-zpsr8rpc.js";
87
87
  import"./index-zgwm4ryv.js";
88
88
  import"./index-a76rekgs.js";
89
89
  export {
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  atomicWriteFileAnyRoot
4
- } from "./index-gy0nyfbw.js";
4
+ } from "./index-19hjpqsy.js";
5
5
  import {
6
6
  emit
7
- } from "./index-hwj25q9r.js";
7
+ } from "./index-bks56jbg.js";
8
8
  import {
9
9
  require_proper_lockfile
10
10
  } from "./index-7g4c7s5r.js";