opencode-swarm 7.140.4 → 7.140.6

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 (100) hide show
  1. package/.opencode/skills/plan/SKILL.md +40 -12
  2. package/.opencode/skills/swarm-pr-review/SKILL.md +2 -4
  3. package/.opencode/skills/swarm-pr-review/references/lane-output-recoverability.md +54 -0
  4. package/dist/agents/architect.d.ts +2 -1
  5. package/dist/background/candidate-contract.d.ts +1 -1
  6. package/dist/background/pending-delegations.d.ts +5 -0
  7. package/dist/background/pr-review-trigger-contract.d.ts +36 -0
  8. package/dist/cli/{config-doctor-qqe6172n.js → config-doctor-y5qeh18c.js} +3 -3
  9. package/dist/cli/{core-52k057mf.js → core-pwd9604e.js} +2 -2
  10. package/dist/cli/{curation-policy-9291bdat.js → curation-policy-avvb56x2.js} +6 -6
  11. package/dist/cli/curator-llm-factory-96pnc23w.js +61 -0
  12. package/dist/cli/{curator-04xqq68e.js → curator-q1nchgpg.js} +36 -36
  13. package/dist/cli/{evidence-summary-service-em58myd7.js → evidence-summary-service-18142mr3.js} +14 -11
  14. package/dist/cli/gate-evidence-smn2wqft.js +51 -0
  15. package/dist/cli/guardrail-explain-kyd89z8z.js +62 -0
  16. package/dist/cli/{guardrail-log-vb5zkegf.js → guardrail-log-cahp1ews.js} +4 -4
  17. package/dist/cli/{hive-promoter-z09khawt.js → hive-promoter-vcbcvcsh.js} +36 -36
  18. package/dist/cli/{index-ysa38bnr.js → index-1p72dtym.js} +3 -3
  19. package/dist/cli/{index-s8g7jh1k.js → index-2778hhh7.js} +2 -2
  20. package/dist/cli/{index-v3xhc7kg.js → index-4s7xgzbm.js} +1 -1
  21. package/dist/cli/{index-wk8s1m7b.js → index-4zxrkk1h.js} +217 -15
  22. package/dist/cli/{index-hz0refz4.js → index-56rqw2hs.js} +70 -29
  23. package/dist/cli/{index-djbhe0yh.js → index-5qd5vt2d.js} +38 -38
  24. package/dist/cli/{index-35qep0v7.js → index-912qz4y0.js} +88 -88
  25. package/dist/cli/{index-2rb3x0fk.js → index-92n3d5ky.js} +7 -7
  26. package/dist/cli/{index-ryq97w1x.js → index-bjqpdr83.js} +4 -4
  27. package/dist/cli/{index-c5kr20nz.js → index-c432knmy.js} +1 -1
  28. package/dist/cli/{index-v3x7j9ey.js → index-dtqjxfw9.js} +2 -2
  29. package/dist/cli/{index-hfwzxh3j.js → index-e58e3v0v.js} +12 -10
  30. package/dist/cli/{index-bfhwtdsw.js → index-epvhf50h.js} +3 -3
  31. package/dist/cli/{index-vrmkg8fm.js → index-fejfzy2j.js} +9 -9
  32. package/dist/cli/{index-mpytsq6k.js → index-h01wb18g.js} +2 -2
  33. package/dist/cli/{index-hxvkfx6t.js → index-jqsfsqbx.js} +15 -2
  34. package/dist/cli/{index-bn17ycxn.js → index-m9xrdjn0.js} +1 -1
  35. package/dist/cli/{index-a1fjhx4w.js → index-nakkgkkt.js} +37922 -35984
  36. package/dist/cli/index-p04qrwck.js +43 -0
  37. package/dist/cli/{index-arza4m4j.js → index-p2ty3eee.js} +2 -2
  38. package/dist/cli/{index-4hp8nvwb.js → index-p8kk34am.js} +3 -3
  39. package/dist/cli/{index-1kyex7z2.js → index-qwm6vdyv.js} +32 -1
  40. package/dist/cli/{index-dtam929z.js → index-qy1nq52t.js} +1 -1
  41. package/dist/cli/{index-rrb6cz2f.js → index-s1v0wza5.js} +6 -2
  42. package/dist/cli/{index-w4etfamq.js → index-t5pytnca.js} +2 -2
  43. package/dist/cli/{index-tj04dj06.js → index-thp186x0.js} +2 -2
  44. package/dist/cli/index-tjqzr3jc.js +623 -0
  45. package/dist/cli/{index-mrpfd1jx.js → index-vh05t3w5.js} +1 -1
  46. package/dist/cli/{index-7begd9aq.js → index-y9q9f6ms.js} +4 -4
  47. package/dist/cli/{index-v1an91bq.js → index-z0z9pe7b.js} +5 -5
  48. package/dist/cli/{index-hfjvepk2.js → index-z3s0a44b.js} +3 -3
  49. package/dist/cli/{index-pp5m7xga.js → index-zd4qhnr7.js} +70 -34
  50. package/dist/cli/{index-b8zgtz81.js → index-zsrtt42s.js} +34 -1
  51. package/dist/cli/index.js +35 -35
  52. package/dist/cli/{knowledge-escalator-gdjnwszd.js → knowledge-escalator-gj58za4g.js} +12 -12
  53. package/dist/cli/{knowledge-events-581x4q7n.js → knowledge-events-3m5jnnv6.js} +10 -10
  54. package/dist/cli/{knowledge-link-axx45d1h.js → knowledge-link-m9p80f4r.js} +5 -5
  55. package/dist/cli/{knowledge-store-ttg33482.js → knowledge-store-0vy8wbzd.js} +6 -6
  56. package/dist/cli/{knowledge-validator-8kywqt8b.js → knowledge-validator-mvcs8wf6.js} +8 -8
  57. package/dist/cli/{pending-delegations-btwqsvz4.js → pending-delegations-cxx9tezp.js} +4 -4
  58. package/dist/cli/{pr-subscriptions-83y1cdwv.js → pr-subscriptions-2sfnb599.js} +4 -4
  59. package/dist/cli/{runner-fh3r41nw.js → runner-mky3vvht.js} +6 -6
  60. package/dist/cli/{scan-cursor-j8ytdpam.js → scan-cursor-wznc7p7p.js} +7 -7
  61. package/dist/cli/{schema-6xfqtpvn.js → schema-k596bhds.js} +2 -2
  62. package/dist/cli/{scope-persistence-8c72jrgp.js → scope-persistence-0ny5fn07.js} +10 -5
  63. package/dist/cli/{skill-generator-n8vm1yhn.js → skill-generator-vrks0jjj.js} +14 -14
  64. package/dist/cli/{telemetry-fb44gpba.js → telemetry-0x6kszvk.js} +1 -1
  65. package/dist/cli/{worktree-collision-ownership-f28r473k.js → worktree-collision-ownership-wm5pse49.js} +8 -8
  66. package/dist/cli/worktree-isolation-zgk7314k.js +102 -0
  67. package/dist/cli/worktree-provisioning-owner-sjh7te1h.js +22 -0
  68. package/dist/commands/acknowledge-spec-drift.d.ts +4 -5
  69. package/dist/config/evidence-schema.d.ts +3 -3
  70. package/dist/config/index.d.ts +2 -2
  71. package/dist/config/plan-schema.d.ts +8 -0
  72. package/dist/config/schema.d.ts +2 -2
  73. package/dist/council/council-evidence-writer.d.ts +1 -1
  74. package/dist/gate-evidence.d.ts +117 -4
  75. package/dist/hooks/delegation-gate.d.ts +21 -0
  76. package/dist/hooks/pr-workflow-gate.d.ts +20 -0
  77. package/dist/index.js +775 -748
  78. package/dist/plan/ledger.d.ts +55 -0
  79. package/dist/plan/manager.d.ts +9 -0
  80. package/dist/plan/planning-profile.d.ts +27 -0
  81. package/dist/services/spec-drift-recovery.d.ts +84 -0
  82. package/dist/session/snapshot-writer.d.ts +3 -1
  83. package/dist/state.d.ts +19 -17
  84. package/dist/summaries/schema.d.ts +2 -2
  85. package/dist/tools/convene-council.d.ts +6 -6
  86. package/dist/tools/save-plan.d.ts +8 -0
  87. package/dist/tools/submit-phase-council-verdicts.d.ts +6 -6
  88. package/dist/tools/tool-metadata.d.ts +28 -28
  89. package/dist/tools/update-task-status.d.ts +13 -0
  90. package/dist/tools/write-final-council-evidence.d.ts +6 -6
  91. package/dist/types/events.d.ts +29 -1
  92. package/dist/workflow/coder-settlement.d.ts +62 -0
  93. package/dist/workflow/task-repair.d.ts +30 -0
  94. package/dist/workflow/task-terminal.d.ts +52 -0
  95. package/package.json +1 -1
  96. package/dist/cli/curator-llm-factory-cfm8fhdw.js +0 -61
  97. package/dist/cli/gate-evidence-ezxfkb22.js +0 -32
  98. package/dist/cli/guardrail-explain-pn1bcgfz.js +0 -62
  99. package/dist/cli/index-d181x9zr.js +0 -71
  100. package/dist/cli/index-dtyeabmj.js +0 -239
@@ -0,0 +1,43 @@
1
+ // @bun
2
+ import {
3
+ init_loader,
4
+ loadPluginConfigWithMeta
5
+ } from "./index-zd4qhnr7.js";
6
+ import {
7
+ init_schema
8
+ } from "./index-thp186x0.js";
9
+ import {
10
+ DEFAULT_WORKTREE_ISOLATION_CONFIG,
11
+ init_constants
12
+ } from "./index-jqsfsqbx.js";
13
+
14
+ // src/config/index.ts
15
+ init_constants();
16
+ init_loader();
17
+ init_loader();
18
+ init_schema();
19
+
20
+ // src/config/worktree-isolation-config.ts
21
+ init_constants();
22
+ function resolveWorktreeIsolationConfig(config) {
23
+ if (config.worktree) {
24
+ return { ...DEFAULT_WORKTREE_ISOLATION_CONFIG, ...config.worktree };
25
+ }
26
+ const lean = config.turbo?.strategy === "lean" ? config.turbo.lean : undefined;
27
+ if (lean?.worktree_isolation) {
28
+ return {
29
+ ...DEFAULT_WORKTREE_ISOLATION_CONFIG,
30
+ policy: "auto",
31
+ merge_strategy: lean.merge_strategy ?? "merge",
32
+ worktree_dir: lean.worktree_dir,
33
+ deps_strategy: lean.deps_strategy ?? "skip",
34
+ runtime_isolation: lean.runtime_isolation ?? DEFAULT_WORKTREE_ISOLATION_CONFIG.runtime_isolation
35
+ };
36
+ }
37
+ return DEFAULT_WORKTREE_ISOLATION_CONFIG;
38
+ }
39
+
40
+ // src/config/index.ts
41
+ var _internals = { loadPluginConfigWithMeta };
42
+
43
+ export { resolveWorktreeIsolationConfig, _internals };
@@ -9,11 +9,11 @@ import {
9
9
  PluginConfigSchema,
10
10
  init_schema,
11
11
  stripKnownSwarmPrefix
12
- } from "./index-tj04dj06.js";
12
+ } from "./index-thp186x0.js";
13
13
  import {
14
14
  ALL_AGENT_NAMES,
15
15
  init_constants
16
- } from "./index-hxvkfx6t.js";
16
+ } from "./index-jqsfsqbx.js";
17
17
 
18
18
  // src/services/config-doctor.ts
19
19
  init_constants();
@@ -1,10 +1,10 @@
1
1
  // @bun
2
+ import {
3
+ withEvidenceLock
4
+ } from "./index-912qz4y0.js";
2
5
  import {
3
6
  invalidateCachedArtifact
4
7
  } from "./index-ed5ykebp.js";
5
- import {
6
- withEvidenceLock
7
- } from "./index-35qep0v7.js";
8
8
  import {
9
9
  bunWrite
10
10
  } from "./index-4nt52yr9.js";
@@ -11,6 +11,7 @@ var PROVISIONING_OWNER_DIR = "worktree-provisioning-owners";
11
11
  var MAX_PROVISIONING_OWNERS = 512;
12
12
  var MAX_PROVISIONING_OWNER_BYTES = 16 * 1024;
13
13
  var WORKTREE_PROVISIONING_OWNER_LEASE_MS = 5 * 60 * 1000;
14
+ var WORKTREE_LIFECYCLE_LOCK_FILE = ".swarm/locks/init-orphan-recovery.lock";
14
15
  function ownerDirectory(directory) {
15
16
  return path.dirname(validateSwarmPath(directory, path.join(PROVISIONING_OWNER_DIR, ".containment-anchor")));
16
17
  }
@@ -26,6 +27,36 @@ function isOwner(value) {
26
27
  const validTaskIdentity = schemaVersion === 1 ? candidate.taskId === undefined : schemaVersion === 2 && typeof candidate.taskId === "string" && candidate.taskId.length > 0 && candidate.taskId.length <= 512;
27
28
  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;
28
29
  }
30
+ function recordWorktreeProvisioningOwner(directory, input) {
31
+ const owner = {
32
+ schemaVersion: input.taskId ? 2 : 1,
33
+ callID: input.callID,
34
+ parentSessionId: input.parentSessionId,
35
+ worktreeSessionId: input.worktreeSessionId,
36
+ ...input.taskId ? { taskId: input.taskId } : {},
37
+ createdAt: Date.now()
38
+ };
39
+ if (!isOwner(owner)) {
40
+ throw new Error("invalid worktree provisioning owner");
41
+ }
42
+ const absolutePath = ownerPath(directory, input.callID);
43
+ fs.mkdirSync(path.dirname(absolutePath), { recursive: true });
44
+ const tempPath = `${absolutePath}.tmp-${randomBytes(8).toString("hex")}`;
45
+ try {
46
+ fs.writeFileSync(tempPath, `${JSON.stringify(owner)}
47
+ `, {
48
+ encoding: "utf8",
49
+ flag: "wx"
50
+ });
51
+ fs.renameSync(tempPath, absolutePath);
52
+ } catch (error) {
53
+ try {
54
+ fs.unlinkSync(tempPath);
55
+ } catch {}
56
+ throw error;
57
+ }
58
+ return owner;
59
+ }
29
60
  function removeWorktreeProvisioningOwner(directory, callID) {
30
61
  try {
31
62
  fs.unlinkSync(ownerPath(directory, callID));
@@ -91,4 +122,4 @@ function scanWorktreeProvisioningOwnersForRecovery(directory) {
91
122
  return { status: "ok", owners };
92
123
  }
93
124
 
94
- export { WORKTREE_PROVISIONING_OWNER_LEASE_MS, removeWorktreeProvisioningOwner, scanWorktreeProvisioningOwnersForRecovery };
125
+ export { WORKTREE_PROVISIONING_OWNER_LEASE_MS, WORKTREE_LIFECYCLE_LOCK_FILE, recordWorktreeProvisioningOwner, removeWorktreeProvisioningOwner, scanWorktreeProvisioningOwnersForRecovery };
@@ -7,7 +7,7 @@ import {
7
7
  readLinkPointer,
8
8
  resolveKnowledgeStoreDir,
9
9
  resolveLinkDir
10
- } from "./index-mrpfd1jx.js";
10
+ } from "./index-vh05t3w5.js";
11
11
 
12
12
  // src/knowledge/curation-policy.ts
13
13
  import { appendFile, mkdir as mkdir2, readFile as readFile2 } from "fs/promises";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-k46me75h.js";
5
5
  import {
6
6
  withEvidenceLock
7
- } from "./index-35qep0v7.js";
7
+ } from "./index-912qz4y0.js";
8
8
  import {
9
9
  bunWrite
10
10
  } from "./index-4nt52yr9.js";
@@ -65,7 +65,8 @@ var WorkspaceSchema = exports_external.object({
65
65
  }).strict();
66
66
  var TaskChangeContextSchema = exports_external.object({
67
67
  declaredFiles: exports_external.array(exports_external.string()).nullable(),
68
- baseline: WorkspaceSchema
68
+ baseline: WorkspaceSchema,
69
+ workflowGeneration: exports_external.number().int().nonnegative().optional()
69
70
  }).strict();
70
71
  var WorktreeDescriptorSchema = exports_external.object({
71
72
  callID: exports_external.string().min(1).max(256),
@@ -260,6 +261,7 @@ var RecordSchema = exports_external.object({
260
261
  promptHash: exports_external.string().optional(),
261
262
  workspace: WorkspaceSchema.optional(),
262
263
  taskChangeContext: TaskChangeContextSchema.optional(),
264
+ workflowGeneration: exports_external.number().int().nonnegative().optional(),
263
265
  worktree: WorktreeDescriptorSchema.optional(),
264
266
  coderReservationId: exports_external.string().min(1).max(256).optional(),
265
267
  prompt: PromptSchema.optional(),
@@ -419,6 +421,7 @@ function buildPendingRecord(input, now) {
419
421
  ...input.promptHash ? { promptHash: input.promptHash } : {},
420
422
  ...input.workspace ? { workspace: input.workspace } : {},
421
423
  ...input.taskChangeContext ? { taskChangeContext: input.taskChangeContext } : {},
424
+ ...input.workflowGeneration !== undefined ? { workflowGeneration: input.workflowGeneration } : {},
422
425
  ...input.worktree ? { worktree: input.worktree } : {},
423
426
  ...input.coderReservationId ? { coderReservationId: input.coderReservationId } : {},
424
427
  ...input.prompt ? { prompt: input.prompt } : {},
@@ -444,6 +447,7 @@ function pendingLaunchIdentity(record) {
444
447
  promptHash: record.promptHash,
445
448
  workspace: record.workspace,
446
449
  taskChangeContext: record.taskChangeContext,
450
+ workflowGeneration: record.workflowGeneration,
447
451
  worktree: record.worktree,
448
452
  coderReservationId: record.coderReservationId,
449
453
  prompt: record.prompt,
@@ -9,11 +9,11 @@ import {
9
9
  } from "./index-y8552snf.js";
10
10
  import {
11
11
  atomicWriteFile
12
- } from "./index-4hp8nvwb.js";
12
+ } from "./index-p8kk34am.js";
13
13
  import {
14
14
  assertProjectRoot,
15
15
  withEvidenceLock
16
- } from "./index-35qep0v7.js";
16
+ } from "./index-912qz4y0.js";
17
17
  import {
18
18
  exports_external,
19
19
  init_zod
@@ -3,7 +3,7 @@ import {
3
3
  ALL_AGENT_NAMES,
4
4
  SUMMARIZER_EXEMPT_TOOL_NAMES,
5
5
  init_constants
6
- } from "./index-hxvkfx6t.js";
6
+ } from "./index-jqsfsqbx.js";
7
7
  import {
8
8
  OUTCOME_BLOCK_THRESHOLD,
9
9
  init_knowledge_types
@@ -21,7 +21,7 @@ var package_default;
21
21
  var init_package = __esm(() => {
22
22
  package_default = {
23
23
  name: "opencode-swarm",
24
- version: "7.140.4",
24
+ version: "7.140.6",
25
25
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
26
26
  main: "dist/index.js",
27
27
  types: "dist/index.d.ts",