opencode-swarm 7.144.2 → 7.144.4

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 (80) hide show
  1. package/.opencode/skills/swarm-pr-review/SKILL.md +3 -1
  2. package/.opencode/skills/swarm-pr-review/references/lane-output-recoverability.md +124 -0
  3. package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +2 -0
  4. package/README.md +3 -1
  5. package/dist/background/pending-delegations.d.ts +34 -0
  6. package/dist/cli/{config-doctor-7dfvxwjb.js → config-doctor-rw9zrjk6.js} +3 -3
  7. package/dist/cli/{core-dwmwdc4y.js → core-zjx9aqaf.js} +3 -3
  8. package/dist/cli/{curation-policy-pkb2eeb1.js → curation-policy-0wbrh11c.js} +5 -5
  9. package/dist/cli/curator-drift-2jbjv03a.js +1 -1
  10. package/dist/cli/{curator-w213v33y.js → curator-g54a7wv0.js} +33 -33
  11. package/dist/cli/{curator-llm-factory-rrs1q4hg.js → curator-llm-factory-xgb4pxmm.js} +33 -33
  12. package/dist/cli/{evidence-summary-service-t7n2h1he.js → evidence-summary-service-fnr5y54e.js} +14 -14
  13. package/dist/cli/{gate-evidence-xvxn603y.js → gate-evidence-2xt1x07r.js} +7 -7
  14. package/dist/cli/{guardrail-explain-v1mwsnkq.js → guardrail-explain-6wcgr9tz.js} +34 -34
  15. package/dist/cli/{guardrail-log-dn03dpz2.js → guardrail-log-5w4b9zrw.js} +4 -4
  16. package/dist/cli/{hive-promoter-asjtj7ga.js → hive-promoter-x63ehffd.js} +35 -35
  17. package/dist/cli/{index-ckrasab9.js → index-03pv47h2.js} +9 -9
  18. package/dist/cli/{index-4q9vfav6.js → index-1csyxv0f.js} +1 -1
  19. package/dist/cli/{index-s2rcz51a.js → index-1jsmmx7y.js} +66 -34
  20. package/dist/cli/{index-jsfghpy2.js → index-2m7mavaz.js} +2 -2
  21. package/dist/cli/{index-p3tnmkvc.js → index-4w5qdbk7.js} +12 -12
  22. package/dist/cli/{index-dhh2j2nd.js → index-8j0va7jp.js} +2 -2
  23. package/dist/cli/{index-y95nwsge.js → index-9qq7c18c.js} +1 -1
  24. package/dist/cli/{index-qpt8ahph.js → index-az8etqpp.js} +12 -12
  25. package/dist/cli/{index-gdd4jt6b.js → index-bt9aa01f.js} +1 -1
  26. package/dist/cli/{index-333kvewd.js → index-btmsqv7p.js} +4 -4
  27. package/dist/cli/{index-d55crzd4.js → index-cz25e8xp.js} +7 -7
  28. package/dist/cli/{index-g2ajae1z.js → index-d12jd5mn.js} +2 -2
  29. package/dist/cli/{index-tq5s07ta.js → index-dty5qgk2.js} +1 -1
  30. package/dist/cli/{index-k31en0ja.js → index-f9vvg5xb.js} +3 -3
  31. package/dist/cli/{index-k92cagmt.js → index-fqcjragy.js} +2 -2
  32. package/dist/cli/{index-jb4tchvy.js → index-h98t1m88.js} +2 -2
  33. package/dist/cli/{index-4fda8kkw.js → index-jabkn643.js} +30 -5
  34. package/dist/cli/{index-erfnw81g.js → index-mazgg5s2.js} +1 -1
  35. package/dist/cli/{index-m6wv2qdr.js → index-nckg4gxb.js} +2 -2
  36. package/dist/cli/{index-tg9fn2dy.js → index-p7cm3gtj.js} +38 -36
  37. package/dist/cli/{index-dg2w0wr4.js → index-psvxq93b.js} +3 -3
  38. package/dist/cli/{index-zr370283.js → index-pw83zgny.js} +3 -3
  39. package/dist/cli/{index-nretd4qn.js → index-q4ed1jk7.js} +1539 -963
  40. package/dist/cli/{index-hqvt3mhk.js → index-q67jb94n.js} +1 -1
  41. package/dist/cli/{index-whezv7vc.js → index-v3y3qg48.js} +1 -1
  42. package/dist/cli/{index-av0f6mm0.js → index-x6tp0hfr.js} +9 -9
  43. package/dist/cli/{index-h3z64mhz.js → index-y8j8ehc8.js} +2 -2
  44. package/dist/cli/{index-ne8cfgw5.js → index-yts89pqg.js} +4 -4
  45. package/dist/cli/{index-w7x7qxz2.js → index-ywn7vtxp.js} +1 -1
  46. package/dist/cli/{index-g1c5fgaw.js → index-z6v7kwpa.js} +4 -4
  47. package/dist/cli/{index-7ca3a6gj.js → index-zb0xcz9t.js} +10 -10
  48. package/dist/cli/index.js +34 -34
  49. package/dist/cli/{knowledge-escalator-cg19dhe5.js → knowledge-escalator-ypg14d5r.js} +13 -13
  50. package/dist/cli/{knowledge-events-yzvysaqd.js → knowledge-events-nkrym4wb.js} +11 -11
  51. package/dist/cli/{knowledge-link-fn5j3r4q.js → knowledge-link-e4qgqmpx.js} +4 -4
  52. package/dist/cli/{knowledge-store-6f77xpmm.js → knowledge-store-vh3nhtg2.js} +6 -6
  53. package/dist/cli/{knowledge-validator-4b28zdxa.js → knowledge-validator-jrxvexv6.js} +8 -8
  54. package/dist/cli/{pending-delegations-thy8g30k.js → pending-delegations-pw79c8ds.js} +3 -3
  55. package/dist/cli/{pr-subscriptions-jyav582d.js → pr-subscriptions-fk628bhc.js} +3 -3
  56. package/dist/cli/{runner-pde6b5sx.js → runner-b02sz2vx.js} +5 -5
  57. package/dist/cli/{scan-cursor-nqbb1xt6.js → scan-cursor-fp7w5jmc.js} +7 -7
  58. package/dist/cli/{schema-jj2pb6zp.js → schema-rptwqbm4.js} +2 -2
  59. package/dist/cli/{scope-persistence-63nasq0z.js → scope-persistence-0bkaxawa.js} +7 -7
  60. package/dist/cli/{skill-generator-nsymtdqm.js → skill-generator-nh8b4gjv.js} +16 -16
  61. package/dist/cli/{telemetry-xyfb5vm8.js → telemetry-cybx6cfz.js} +1 -1
  62. package/dist/cli/{worktree-collision-ownership-j6d33p49.js → worktree-collision-ownership-hqd9ypsz.js} +6 -6
  63. package/dist/cli/{worktree-isolation-g54kxw6x.js → worktree-isolation-canf3rj8.js} +33 -33
  64. package/dist/commands/index.d.ts +1 -0
  65. package/dist/commands/recover.d.ts +17 -0
  66. package/dist/commands/registry.d.ts +10 -2
  67. package/dist/commands/reset-session.d.ts +2 -0
  68. package/dist/hooks/context-budget.d.ts +4 -0
  69. package/dist/hooks/context-usage.d.ts +48 -0
  70. package/dist/hooks/pr-workflow-gate.d.ts +160 -4
  71. package/dist/index.js +556 -550
  72. package/dist/observability/catalog.d.ts +8 -6
  73. package/dist/sast/semgrep.d.ts +3 -2
  74. package/dist/telemetry.d.ts +17 -1
  75. package/dist/tools/context-status.d.ts +9 -3
  76. package/dist/tools/dispatch-lanes.d.ts +27 -2
  77. package/dist/tools/pre-check-batch.d.ts +9 -0
  78. package/dist/tools/sast-scan.d.ts +3 -0
  79. package/dist/workflow/coder-settlement.d.ts +74 -0
  80. package/package.json +1 -1
@@ -1,32 +1,32 @@
1
1
  // @bun
2
+ import {
3
+ validateSwarmPath
4
+ } from "./index-rn0eq85g.js";
2
5
  import {
3
6
  loadPluginConfigWithMeta
4
- } from "./index-y95nwsge.js";
7
+ } from "./index-9qq7c18c.js";
5
8
  import {
6
9
  KnowledgeConfigSchema,
7
10
  init_schema
8
- } from "./index-h3z64mhz.js";
9
- import {
10
- validateSwarmPath
11
- } from "./index-rn0eq85g.js";
11
+ } from "./index-y8j8ehc8.js";
12
12
  import {
13
13
  resolveHiveEventsPath
14
14
  } from "./index-ae75rja9.js";
15
15
  import {
16
16
  resolveKnowledgeStoreDir
17
- } from "./index-w7x7qxz2.js";
17
+ } from "./index-ywn7vtxp.js";
18
18
  import {
19
19
  atomicWriteFile
20
- } from "./index-erfnw81g.js";
20
+ } from "./index-mazgg5s2.js";
21
21
  import {
22
22
  assertProjectRoot
23
- } from "./index-k31en0ja.js";
23
+ } from "./index-f9vvg5xb.js";
24
+ import {
25
+ emit
26
+ } from "./index-1jsmmx7y.js";
24
27
  import {
25
28
  require_proper_lockfile
26
29
  } from "./index-7g4c7s5r.js";
27
- import {
28
- emit
29
- } from "./index-s2rcz51a.js";
30
30
  import {
31
31
  init_logger,
32
32
  warn
@@ -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-6f77xpmm.js");
2548
+ const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-vh3nhtg2.js");
2549
2549
  bumps = await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
2550
2550
  }
2551
2551
  return {
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  SWARM_WORKTREE_DIR_NAME,
8
8
  init_constants
9
- } from "./index-whezv7vc.js";
9
+ } from "./index-v3y3qg48.js";
10
10
  import {
11
11
  bunSpawn
12
12
  } from "./index-4nt52yr9.js";
@@ -86,7 +86,7 @@ var _internals = {
86
86
  symlinkSync: fs.symlinkSync
87
87
  },
88
88
  writeScopeToDisk: async (directory, taskId, files) => {
89
- const { writeScopeToDisk: realWrite } = await import("./scope-persistence-63nasq0z.js");
89
+ const { writeScopeToDisk: realWrite } = await import("./scope-persistence-0bkaxawa.js");
90
90
  return realWrite(directory, taskId, files);
91
91
  },
92
92
  writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
@@ -6,7 +6,7 @@ import {
6
6
  PluginConfigSchema,
7
7
  init_schema,
8
8
  resolveExternalSkillsConfig
9
- } from "./index-h3z64mhz.js";
9
+ } from "./index-y8j8ehc8.js";
10
10
  import {
11
11
  advisoryWarn,
12
12
  init_warning_buffer
@@ -6,16 +6,19 @@ import {
6
6
  EvaluationRunV1Schema,
7
7
  GateAuditResultV1Schema,
8
8
  getProtectedEvaluationRunIds
9
- } from "./index-k92cagmt.js";
9
+ } from "./index-fqcjragy.js";
10
10
  import {
11
11
  readEffectiveSpecSync
12
12
  } from "./index-9ss2m4rs.js";
13
+ import {
14
+ getWorktreeMergeFailure
15
+ } from "./index-zsrtt42s.js";
13
16
  import {
14
17
  isValidTaskId,
15
18
  readTaskEvidence,
16
19
  readTaskEvidenceRaw,
17
20
  sanitizeTaskId
18
- } from "./index-d55crzd4.js";
21
+ } from "./index-cz25e8xp.js";
19
22
  import {
20
23
  LedgerStaleWriterError,
21
24
  appendLedgerEvent,
@@ -35,10 +38,7 @@ import {
35
38
  replayFromLedgerWithStatus,
36
39
  takeSnapshotEvent,
37
40
  takeSnapshotWithRetry
38
- } from "./index-g1c5fgaw.js";
39
- import {
40
- getWorktreeMergeFailure
41
- } from "./index-zsrtt42s.js";
41
+ } from "./index-z6v7kwpa.js";
42
42
  import {
43
43
  _internals,
44
44
  buildDefaultPolicy,
@@ -51,13 +51,13 @@ import {
51
51
  EvidenceBundleSchema,
52
52
  EvidenceSchema
53
53
  } from "./index-gprxjmm7.js";
54
- import {
55
- PlanSchema
56
- } from "./index-y95nwsge.js";
57
54
  import {
58
55
  readSwarmFileAsync,
59
56
  validateSwarmPath
60
57
  } from "./index-rn0eq85g.js";
58
+ import {
59
+ PlanSchema
60
+ } from "./index-9qq7c18c.js";
61
61
  import {
62
62
  invalidateCachedArtifact,
63
63
  readCachedParsedFile
@@ -66,10 +66,10 @@ import {
66
66
  assertProjectRoot,
67
67
  tryAcquireLock,
68
68
  withEvidenceLock
69
- } from "./index-k31en0ja.js";
69
+ } from "./index-f9vvg5xb.js";
70
70
  import {
71
71
  emit
72
- } from "./index-s2rcz51a.js";
72
+ } from "./index-1jsmmx7y.js";
73
73
  import {
74
74
  ZodError,
75
75
  init_zod
@@ -5212,4 +5212,4 @@ function mergeDurableGateEntriesFromEvidence(taskId, entries, evidence) {
5212
5212
  return merged;
5213
5213
  }
5214
5214
 
5215
- export { projectDbExists, getProjectDb, closeProjectDb, buildTaskCompletionDescriptor, ensureTaskCheckpointReceipt, updateTaskCheckpointReceipt, isValidEnvKey, getExecutor, init_executor, MAX_TRANSIENT_RETRIES, isTransientSpawnError, transientBackoff, getGitRepositoryStatus, isGitRepo, getDefaultBaseBranch, detectDefaultRemoteBranch, resetToRemoteBranch, resetToMainAfterMerge, containsPathTraversal, containsControlChars, validateSymlinkBoundary, isStateUnreadable, loadEpicSessionState, isEpicModeActive, enableEpicMode, disableEpicMode, normalizePath, pathsConflict, isGlobalFile, isProtectedPath, readTaskScopes, loadPlanJsonOnly, loadPlan, savePlan, closePlanTerminalState, updateTaskStatus, derivePlanMarkdown, isValidEvidenceType, sanitizeTaskId2 as sanitizeTaskId, validateProjectRoot, saveEvidence, loadEvidence, listEvidenceTaskIds, checkRequirementCoverage, archiveEvidence, readDurableGateEvidence, getDurableGateEvidenceStatus, getDurableGateEvidenceStatusForTask, mergeDurableGateEntriesFromEvidence };
5215
+ export { projectDbExists, getProjectDb, closeProjectDb, normalizePath, buildTaskCompletionDescriptor, ensureTaskCheckpointReceipt, updateTaskCheckpointReceipt, isValidEnvKey, getExecutor, init_executor, MAX_TRANSIENT_RETRIES, isTransientSpawnError, transientBackoff, getGitRepositoryStatus, isGitRepo, getDefaultBaseBranch, detectDefaultRemoteBranch, resetToRemoteBranch, resetToMainAfterMerge, containsPathTraversal, containsControlChars, validateSymlinkBoundary, isStateUnreadable, loadEpicSessionState, isEpicModeActive, enableEpicMode, disableEpicMode, pathsConflict, isGlobalFile, isProtectedPath, readTaskScopes, loadPlanJsonOnly, loadPlan, savePlan, closePlanTerminalState, updateTaskStatus, derivePlanMarkdown, isValidEvidenceType, sanitizeTaskId2 as sanitizeTaskId, validateProjectRoot, saveEvidence, loadEvidence, listEvidenceTaskIds, checkRequirementCoverage, archiveEvidence, readDurableGateEvidence, getDurableGateEvidenceStatus, getDurableGateEvidenceStatusForTask, mergeDurableGateEntriesFromEvidence };
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-rn0eq85g.js";
5
5
  import {
6
6
  withEvidenceLock
7
- } from "./index-k31en0ja.js";
7
+ } from "./index-f9vvg5xb.js";
8
8
  import {
9
9
  exports_external,
10
10
  init_zod
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  _internals,
4
4
  resolveWorktreeIsolationConfig
5
- } from "./index-dg2w0wr4.js";
5
+ } from "./index-psvxq93b.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-y95nwsge.js";
45
+ } from "./index-9qq7c18c.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-h3z64mhz.js";
67
+ } from "./index-y8j8ehc8.js";
68
68
  import"./index-4rhhvd1a.js";
69
69
  import {
70
70
  ALL_AGENT_NAMES,
@@ -75,7 +75,7 @@ import {
75
75
  QA_AGENTS,
76
76
  isQAAgent,
77
77
  isSubagent
78
- } from "./index-whezv7vc.js";
78
+ } from "./index-v3y3qg48.js";
79
79
  import"./index-zjygnfay.js";
80
80
  import"./index-bk5tah7q.js";
81
81
  import"./index-bpmtbmy9.js";
@@ -1,12 +1,12 @@
1
1
  // @bun
2
+ import {
3
+ autoCommitDirty,
4
+ cleanUntrackedFiles
5
+ } from "./index-8j0va7jp.js";
2
6
  import {
3
7
  isPathWithinDeclaredScope,
4
8
  unsafePathTextReason
5
9
  } from "./index-556ja8an.js";
6
- import {
7
- autoCommitDirty,
8
- cleanUntrackedFiles
9
- } from "./index-dhh2j2nd.js";
10
10
  import {
11
11
  validateSwarmPath
12
12
  } from "./index-rn0eq85g.js";
@@ -18,10 +18,10 @@ import {
18
18
  atomicWriteFile,
19
19
  taskEvidencePath,
20
20
  withTaskEvidenceLock
21
- } from "./index-erfnw81g.js";
21
+ } from "./index-mazgg5s2.js";
22
22
  import {
23
23
  telemetry
24
- } from "./index-s2rcz51a.js";
24
+ } from "./index-1jsmmx7y.js";
25
25
  import {
26
26
  exports_external,
27
27
  init_zod
@@ -847,7 +847,7 @@ function assertTaskEvidenceWriteAllowed(directory, taskId, event) {
847
847
  const coderWalPath = validateSwarmPath(directory, `coder-settlements/${taskId}.json`);
848
848
  const coderWal = readWorkflowWalFileSync("coder-settlement", coderWalPath, taskId);
849
849
  if ((coderWal?.state === "DISPATCHED" || coderWal?.state === "PREPARED") && !(event != null && event.transitionId === coderWal.transitionId && (event.type === "dispatch_attempted" || event.type === "dispatch_no_mutation" || event.type === "accepted_mutation"))) {
850
- throw new Error(`CODER_SETTLEMENT_IN_PROGRESS: transition ${String(coderWal.transitionId)} owns evidence for task ${taskId}`);
850
+ throw new Error(`CODER_SETTLEMENT_IN_PROGRESS: transition ${String(coderWal.transitionId)} owns evidence for task ${taskId}. Wait for the owning transition to settle or run /swarm recover ${taskId} (or /swarm reset-session), then retry; do not remove the WAL by hand.`);
851
851
  }
852
852
  const terminalWalPath = validateSwarmPath(directory, `task-terminals/${taskId}.json`);
853
853
  const terminalWal = readWorkflowWalFileSync("task-terminal", terminalWalPath, taskId);
@@ -11,10 +11,10 @@ import {
11
11
  import {
12
12
  init_schema,
13
13
  stripKnownSwarmPrefix
14
- } from "./index-h3z64mhz.js";
14
+ } from "./index-y8j8ehc8.js";
15
15
  import {
16
16
  init_constants
17
- } from "./index-whezv7vc.js";
17
+ } from "./index-v3y3qg48.js";
18
18
  import {
19
19
  init_logger,
20
20
  warn
@@ -7,7 +7,7 @@ import {
7
7
  readLinkPointer,
8
8
  resolveKnowledgeStoreDir,
9
9
  resolveLinkDir
10
- } from "./index-w7x7qxz2.js";
10
+ } from "./index-ywn7vtxp.js";
11
11
 
12
12
  // src/knowledge/curation-policy.ts
13
13
  import { appendFile, mkdir as mkdir2, readFile as readFile2 } from "fs/promises";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
+ import {
3
+ emit
4
+ } from "./index-1jsmmx7y.js";
2
5
  import {
3
6
  require_proper_lockfile
4
7
  } from "./index-7g4c7s5r.js";
5
- import {
6
- emit
7
- } from "./index-s2rcz51a.js";
8
8
  import {
9
9
  init_logger,
10
10
  warn
@@ -9,11 +9,11 @@ import {
9
9
  } from "./index-y8552snf.js";
10
10
  import {
11
11
  atomicWriteFile
12
- } from "./index-erfnw81g.js";
12
+ } from "./index-mazgg5s2.js";
13
13
  import {
14
14
  assertProjectRoot,
15
15
  withEvidenceLock
16
- } from "./index-k31en0ja.js";
16
+ } from "./index-f9vvg5xb.js";
17
17
  import {
18
18
  exports_external,
19
19
  init_zod
@@ -6,11 +6,11 @@ import {
6
6
  PluginConfigSchema,
7
7
  init_schema,
8
8
  stripKnownSwarmPrefix
9
- } from "./index-h3z64mhz.js";
9
+ } from "./index-y8j8ehc8.js";
10
10
  import {
11
11
  ALL_AGENT_NAMES,
12
12
  init_constants
13
- } from "./index-whezv7vc.js";
13
+ } from "./index-v3y3qg48.js";
14
14
  import {
15
15
  log
16
16
  } from "./index-zgwm4ryv.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-rn0eq85g.js";
5
5
  import {
6
6
  withEvidenceLock
7
- } from "./index-k31en0ja.js";
7
+ } from "./index-f9vvg5xb.js";
8
8
  import {
9
9
  exports_external,
10
10
  init_zod
@@ -248,6 +248,16 @@ var INGESTION_CLAIM_LEASE_MS = 30000;
248
248
  var BACKGROUND_INGESTION_LEASE_MS = 30000;
249
249
  var DEFAULT_STALE_DELEGATION_TIMEOUT_MS = 30 * 60000;
250
250
  var DEFAULT_SWEEPABLE_DELEGATION_STATUSES = new Set(["pending", "running", "ingestion_error"]);
251
+ var WorkflowLaneRecoverySchema = exports_external.object({
252
+ workflowLane: exports_external.string(),
253
+ kind: exports_external.enum([
254
+ "parser-normalization",
255
+ "parser-row-recovery",
256
+ "truncated-preview-durable-artifact",
257
+ "transcript-incomplete-terminal-candidate"
258
+ ]),
259
+ reason: exports_external.string()
260
+ }).strict();
251
261
  var ResultSchema = exports_external.object({
252
262
  text: exports_external.string().optional(),
253
263
  error: exports_external.string().optional(),
@@ -260,7 +270,8 @@ var ResultSchema = exports_external.object({
260
270
  outputArtifactError: exports_external.string().optional(),
261
271
  transcriptIncomplete: exports_external.boolean().optional(),
262
272
  messageCount: exports_external.number().optional(),
263
- salvagedWorkflowLanes: exports_external.array(exports_external.string()).optional()
273
+ salvagedWorkflowLanes: exports_external.array(exports_external.string()).optional(),
274
+ salvagedWorkflowLaneRecoveries: exports_external.array(WorkflowLaneRecoverySchema).optional()
264
275
  }).strict();
265
276
  var WorkspaceSchema = exports_external.object({
266
277
  directory: exports_external.string(),
@@ -1412,6 +1423,10 @@ async function appendDelegationTransition(directory, correlationId, transition)
1412
1423
  const current = findRecordForWrite(records, correlationId);
1413
1424
  if (!current)
1414
1425
  return;
1426
+ if (transition.expectedCurrentStatuses && !transition.expectedCurrentStatuses.includes(current.status)) {
1427
+ next = current;
1428
+ return;
1429
+ }
1415
1430
  if (isTerminal(current.status) && transition.status !== "consumed" && transition.status !== "ingestion_error" && !(current.status === "completed" && transition.status === "stale")) {
1416
1431
  next = current;
1417
1432
  return;
@@ -1449,7 +1464,7 @@ function sameTerminalEvent(left, right) {
1449
1464
  return left.eventId === right.eventId && left.status === right.status && sameRetainedResult(left.result, right.result);
1450
1465
  }
1451
1466
  function sameRetainedResult(left, right) {
1452
- return left.chars === right.chars && left.truncated === right.truncated && left.digest === right.digest && left.outputRef === right.outputRef && left.outputPreviewChars === right.outputPreviewChars && left.outputDegraded === right.outputDegraded && left.outputArtifactError === right.outputArtifactError && left.transcriptIncomplete === right.transcriptIncomplete && left.messageCount === right.messageCount && sameJson(left.salvagedWorkflowLanes, right.salvagedWorkflowLanes);
1467
+ return left.chars === right.chars && left.truncated === right.truncated && left.digest === right.digest && left.outputRef === right.outputRef && left.outputPreviewChars === right.outputPreviewChars && left.outputDegraded === right.outputDegraded && left.outputArtifactError === right.outputArtifactError && left.transcriptIncomplete === right.transcriptIncomplete && left.messageCount === right.messageCount && sameJson(left.salvagedWorkflowLanes, right.salvagedWorkflowLanes) && sameJson(left.salvagedWorkflowLaneRecoveries, right.salvagedWorkflowLaneRecoveries);
1453
1468
  }
1454
1469
  function settlementProvenanceFor(record) {
1455
1470
  const baseline = record.taskChangeContext?.baseline;
@@ -2020,12 +2035,18 @@ function findOpenAsyncLaneBatches(directory) {
2020
2035
  function isTerminal(status) {
2021
2036
  return status === "completed" || status === "error" || status === "cancelled" || status === "stale" || status === "consumed";
2022
2037
  }
2023
- function sweepStaleLocked(directory, timeoutMs, now, statuses = DEFAULT_SWEEPABLE_DELEGATION_STATUSES) {
2038
+ function sweepStaleLocked(directory, timeoutMs, now, statuses = DEFAULT_SWEEPABLE_DELEGATION_STATUSES, filters = {}) {
2024
2039
  let swept = 0;
2040
+ const { excludeCorrelationIds, includeCorrelationIds } = filters;
2025
2041
  const records = loadRecordsForWrite(directory);
2026
2042
  if (records === null)
2027
2043
  return 0;
2028
2044
  for (const record of records) {
2045
+ if (includeCorrelationIds !== undefined && !includeCorrelationIds.has(record.correlationId)) {
2046
+ continue;
2047
+ }
2048
+ if (excludeCorrelationIds?.has(record.correlationId))
2049
+ continue;
2029
2050
  if (!statuses.has(record.status))
2030
2051
  continue;
2031
2052
  if (now - record.updatedAt <= timeoutMs)
@@ -2045,8 +2066,12 @@ async function sweepStaleDelegations(directory, timeoutMs, options = {}) {
2045
2066
  if (!timeoutMs || timeoutMs <= 0)
2046
2067
  return 0;
2047
2068
  const statuses = options.statuses ?? DEFAULT_SWEEPABLE_DELEGATION_STATUSES;
2069
+ const filters = {
2070
+ excludeCorrelationIds: options.excludeCorrelationIds,
2071
+ includeCorrelationIds: options.includeCorrelationIds
2072
+ };
2048
2073
  try {
2049
- return await withEvidenceLock(directory, BACKGROUND_DELEGATIONS_FILE, STORE_LOCK_AGENT, STORE_LOCK_TASK, async () => sweepStaleLocked(directory, timeoutMs, Date.now(), statuses));
2074
+ return await withEvidenceLock(directory, BACKGROUND_DELEGATIONS_FILE, STORE_LOCK_AGENT, STORE_LOCK_TASK, async () => sweepStaleLocked(directory, timeoutMs, Date.now(), statuses, filters));
2050
2075
  } catch (err) {
2051
2076
  warn(`[background] sweepStaleDelegations failed: ${err instanceof Error ? err.message : String(err)}`);
2052
2077
  return 0;
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-ed5ykebp.js";
5
5
  import {
6
6
  withEvidenceLock
7
- } from "./index-k31en0ja.js";
7
+ } from "./index-f9vvg5xb.js";
8
8
  import {
9
9
  bunWrite
10
10
  } from "./index-4nt52yr9.js";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  readKnowledge,
4
4
  transactKnowledge
5
- } from "./index-ckrasab9.js";
5
+ } from "./index-03pv47h2.js";
6
6
  import {
7
7
  resolveKnowledgeStoreDir
8
- } from "./index-w7x7qxz2.js";
8
+ } from "./index-ywn7vtxp.js";
9
9
  import {
10
10
  init_knowledge_types,
11
11
  isActiveStatus
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-jsfghpy2.js";
4
+ } from "./index-2m7mavaz.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-hqvt3mhk.js";
7
+ } from "./index-q67jb94n.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
@@ -66,6 +66,7 @@ import {
66
66
  handlePreflightCommand,
67
67
  handlePromoteCommand,
68
68
  handleQaGatesCommand,
69
+ handleRecoverCommand,
69
70
  handleResetCommand,
70
71
  handleResetSessionCommand,
71
72
  handleRetrieveCommand,
@@ -84,65 +85,65 @@ import {
84
85
  handleWriteRetroCommand,
85
86
  normalizeSwarmCommandInput,
86
87
  resolveCommand
87
- } from "./index-nretd4qn.js";
88
- import"./index-g2ajae1z.js";
89
- import"./index-jb4tchvy.js";
90
- import"./index-qpt8ahph.js";
88
+ } from "./index-q4ed1jk7.js";
89
+ import"./index-d12jd5mn.js";
90
+ import"./index-h98t1m88.js";
91
+ import"./index-az8etqpp.js";
91
92
  import"./index-134d35c1.js";
92
93
  import"./index-b6e016tv.js";
93
- import"./index-4q9vfav6.js";
94
- import"./index-k92cagmt.js";
94
+ import"./index-1csyxv0f.js";
95
+ import"./index-fqcjragy.js";
95
96
  import"./index-y8552snf.js";
96
- import"./index-m6wv2qdr.js";
97
+ import"./index-nckg4gxb.js";
97
98
  import"./index-70ha9e09.js";
98
99
  import"./index-c8s9a3zh.js";
99
100
  import"./index-9ss2m4rs.js";
100
- import"./index-d55crzd4.js";
101
101
  import"./index-74hpm6sh.js";
102
- import"./index-7ca3a6gj.js";
103
- import"./index-av0f6mm0.js";
104
- import"./index-zr370283.js";
105
- import"./index-g1c5fgaw.js";
106
- import"./index-556ja8an.js";
107
- import"./index-gdd4jt6b.js";
102
+ import"./index-bt9aa01f.js";
103
+ import"./index-zb0xcz9t.js";
104
+ import"./index-x6tp0hfr.js";
105
+ import"./index-yts89pqg.js";
106
+ import"./index-dty5qgk2.js";
107
+ import"./index-rtry5xyf.js";
108
108
  import"./index-zsrtt42s.js";
109
+ import"./index-jabkn643.js";
109
110
  import"./index-k3cxyk66.js";
110
- import"./index-4fda8kkw.js";
111
- import"./index-dhh2j2nd.js";
112
- import"./index-8fwhhayc.js";
113
- import"./index-q1exe2b3.js";
111
+ import"./index-cz25e8xp.js";
112
+ import"./index-8j0va7jp.js";
113
+ import"./index-pw83zgny.js";
114
+ import"./index-z6v7kwpa.js";
115
+ import"./index-556ja8an.js";
114
116
  import"./index-7sy3aa9m.js";
115
117
  import"./index-wx8zdh4a.js";
116
- import"./index-p3tnmkvc.js";
117
- import"./index-dg2w0wr4.js";
118
+ import"./index-8fwhhayc.js";
119
+ import"./index-q1exe2b3.js";
120
+ import"./index-03pv47h2.js";
121
+ import"./index-4w5qdbk7.js";
122
+ import"./index-psvxq93b.js";
118
123
  import"./index-gprxjmm7.js";
119
124
  import"./index-n832052r.js";
120
- import"./index-y95nwsge.js";
125
+ import"./index-rn0eq85g.js";
126
+ import"./index-z6xqpmqg.js";
127
+ import"./index-9qq7c18c.js";
121
128
  import {
122
129
  init_schema,
123
130
  stripKnownSwarmPrefix
124
- } from "./index-h3z64mhz.js";
125
- import"./index-rn0eq85g.js";
131
+ } from "./index-y8j8ehc8.js";
126
132
  import"./index-4rhhvd1a.js";
127
133
  import {
128
134
  AGENT_TOOL_MAP,
129
135
  ORCHESTRATOR_NAME,
130
136
  init_constants
131
- } from "./index-whezv7vc.js";
132
- import"./index-z6xqpmqg.js";
137
+ } from "./index-v3y3qg48.js";
133
138
  import"./index-zjygnfay.js";
134
- import"./index-ne8cfgw5.js";
135
- import"./index-tq5s07ta.js";
136
- import"./index-rtry5xyf.js";
137
- import"./index-ckrasab9.js";
138
139
  import"./index-ae75rja9.js";
139
- import"./index-w7x7qxz2.js";
140
- import"./index-erfnw81g.js";
141
- import"./index-bk5tah7q.js";
140
+ import"./index-ywn7vtxp.js";
141
+ import"./index-mazgg5s2.js";
142
142
  import"./index-ed5ykebp.js";
143
- import"./index-k31en0ja.js";
143
+ import"./index-bk5tah7q.js";
144
+ import"./index-f9vvg5xb.js";
145
+ import"./index-1jsmmx7y.js";
144
146
  import"./index-7g4c7s5r.js";
145
- import"./index-s2rcz51a.js";
146
147
  import"./index-bpmtbmy9.js";
147
148
  import"./index-4nt52yr9.js";
148
149
  import"./index-zgwm4ryv.js";
@@ -413,6 +414,7 @@ export {
413
414
  handleRetrieveCommand,
414
415
  handleResetSessionCommand,
415
416
  handleResetCommand,
417
+ handleRecoverCommand,
416
418
  handleQaGatesCommand,
417
419
  handlePromoteCommand,
418
420
  handlePreflightCommand,
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  init_loader,
4
4
  loadPluginConfigWithMeta
5
- } from "./index-y95nwsge.js";
5
+ } from "./index-9qq7c18c.js";
6
6
  import {
7
7
  init_schema
8
- } from "./index-h3z64mhz.js";
8
+ } from "./index-y8j8ehc8.js";
9
9
  import {
10
10
  DEFAULT_WORKTREE_ISOLATION_CONFIG,
11
11
  init_constants
12
- } from "./index-whezv7vc.js";
12
+ } from "./index-v3y3qg48.js";
13
13
 
14
14
  // src/config/index.ts
15
15
  init_constants();
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  computePlanStructureHash,
4
4
  derivePlanId
5
- } from "./index-g1c5fgaw.js";
5
+ } from "./index-z6v7kwpa.js";
6
6
  import {
7
7
  unsafePathTextReason
8
8
  } from "./index-556ja8an.js";
9
9
  import {
10
10
  PlanSchema
11
- } from "./index-y95nwsge.js";
11
+ } from "./index-9qq7c18c.js";
12
12
  import {
13
13
  assertProjectRoot
14
- } from "./index-k31en0ja.js";
14
+ } from "./index-f9vvg5xb.js";
15
15
  import {
16
16
  require_proper_lockfile
17
17
  } from "./index-7g4c7s5r.js";