opencode-swarm 7.179.0 → 7.180.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 (118) hide show
  1. package/.opencode/skills/execute/SKILL.md +9 -8
  2. package/.opencode/skills/running-tests/SKILL.md +41 -36
  3. package/.opencode/skills/writing-tests/SKILL.md +11 -4
  4. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  5. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  6. package/dist/agents/explorer.d.ts +1 -1
  7. package/dist/background/pr-event-subscribers.d.ts +2 -0
  8. package/dist/background/pr-feedback-event-queue.d.ts +7 -0
  9. package/dist/background/pr-feedback-loop.d.ts +162 -0
  10. package/dist/cli/{coder-settlement-7pt3a0y0.js → coder-settlement-34z9xgnx.js} +13 -13
  11. package/dist/cli/{config-doctor-82w4bp4b.js → config-doctor-tkfrwztz.js} +2 -2
  12. package/dist/cli/{core-9rqzs794.js → core-z9ybzpvr.js} +4 -5
  13. package/dist/cli/{curation-policy-c7mdsf7m.js → curation-policy-gwzmjmt7.js} +6 -5
  14. package/dist/cli/{curator-drift-d93pwt8h.js → curator-drift-3bbn011w.js} +22 -12
  15. package/dist/cli/curator-llm-factory-e162g7xp.js +74 -0
  16. package/dist/cli/{curator-m8act07j.js → curator-zv4qs07j.js} +46 -44
  17. package/dist/cli/{dispatch-3rwdxpp2.js → dispatch-p5zjg5e6.js} +1 -1
  18. package/dist/cli/{evidence-summary-service-a99bgje1.js → evidence-summary-service-wrfth5tr.js} +22 -20
  19. package/dist/cli/{explorer-z0cf5cz0.js → explorer-m50sfrp7.js} +1 -1
  20. package/dist/cli/{gate-evidence-yssmxba5.js → gate-evidence-adqbxnm7.js} +8 -8
  21. package/dist/cli/guardrail-explain-dn96802k.js +75 -0
  22. package/dist/cli/{guardrail-log-j2wtq7p2.js → guardrail-log-rcza6v3y.js} +6 -6
  23. package/dist/cli/{guardrail-reset-07byr7nr.js → guardrail-reset-fjn42e0n.js} +46 -44
  24. package/dist/cli/hive-promoter-hgqqn7qw.js +89 -0
  25. package/dist/cli/{index-7zmbtxw1.js → index-06crt1ej.js} +2 -2
  26. package/dist/cli/{index-wrt875kh.js → index-0725jpp7.js} +1 -1
  27. package/dist/cli/{index-f2v90gfc.js → index-0v1rtanv.js} +24 -165
  28. package/dist/cli/{index-0bc8jdnv.js → index-1hzqyx13.js} +9 -1
  29. package/dist/cli/{index-80q47hpw.js → index-1p8fk9jb.js} +2 -2
  30. package/dist/cli/{index-1rwyfvq2.js → index-2h0qng38.js} +3 -3
  31. package/dist/cli/{index-amf88k1e.js → index-3jap3516.js} +1 -1
  32. package/dist/cli/{index-8815e95e.js → index-5gmn0a3j.js} +8 -8
  33. package/dist/cli/{index-yagqxt2p.js → index-5m378633.js} +4 -4
  34. package/dist/cli/{index-0h3cr7pn.js → index-5yc5n4ae.js} +1 -1
  35. package/dist/cli/{index-pxtye2ng.js → index-7pj0x345.js} +50 -48
  36. package/dist/cli/{index-etmwjgre.js → index-7w6dnpvc.js} +46 -44
  37. package/dist/cli/{index-6tnkvqr9.js → index-8b1f2t5q.js} +8 -10
  38. package/dist/cli/{index-cvg402ha.js → index-91dhg3wr.js} +2 -2
  39. package/dist/cli/{index-3pzwsesm.js → index-92m05mew.js} +2 -2
  40. package/dist/cli/{index-6r92fw88.js → index-93vk5s7v.js} +8 -8
  41. package/dist/cli/{index-ne9zamcs.js → index-989v83pb.js} +1 -1
  42. package/dist/cli/{index-g6nyk713.js → index-aspxz5r5.js} +1 -1
  43. package/dist/cli/index-b9z9gvx0.js +339 -0
  44. package/dist/cli/{index-2b0ktpbf.js → index-bdpgfep1.js} +5 -5
  45. package/dist/cli/{index-nzekzzs2.js → index-bv4b8tpa.js} +5 -5
  46. package/dist/cli/{index-n1tcj1q7.js → index-bx70zs8d.js} +187 -47
  47. package/dist/cli/{index-kmhnkn6t.js → index-caj76d0f.js} +6 -8
  48. package/dist/cli/{index-549wxbe1.js → index-cjapb4hy.js} +1 -1
  49. package/dist/cli/{index-3hne91yd.js → index-cxgr6ad5.js} +13 -15
  50. package/dist/cli/{index-kanxpgf8.js → index-dcttq1mn.js} +2 -2
  51. package/dist/cli/{index-twtez316.js → index-defq2crz.js} +13 -3
  52. package/dist/cli/{index-d66zb40k.js → index-dnbqmay5.js} +3054 -1454
  53. package/dist/cli/index-ejhxgyvm.js +147 -0
  54. package/dist/cli/{index-hwcra3y9.js → index-ekgc71m1.js} +10 -10
  55. package/dist/cli/{index-s4bkey0q.js → index-gc6h1fmf.js} +4 -4
  56. package/dist/cli/index-gx2vp8gx.js +100 -0
  57. package/dist/cli/{index-zgvzbz48.js → index-hamqvzqn.js} +69 -13
  58. package/dist/cli/{index-h59vsbch.js → index-htrb9ec3.js} +1 -1
  59. package/dist/cli/{index-yfpswnjt.js → index-jmrsfhwq.js} +3 -3
  60. package/dist/cli/{index-9p1pqykb.js → index-jrfv2am8.js} +7 -7
  61. package/dist/cli/{index-pskba939.js → index-jscqefqm.js} +1 -1
  62. package/dist/cli/{index-wvpsm8ja.js → index-kp654qcw.js} +32 -17
  63. package/dist/cli/{index-tmy46dtd.js → index-mhrn7hbb.js} +8 -7
  64. package/dist/cli/{index-h4nh6s8b.js → index-nhxykfyy.js} +1 -1
  65. package/dist/cli/{index-ndwbb3xm.js → index-pnt98k7z.js} +7 -7
  66. package/dist/cli/{index-1c1dbwze.js → index-rdec0y3z.js} +1 -1
  67. package/dist/cli/{index-qxk5qkfh.js → index-ret97f1t.js} +5 -5
  68. package/dist/cli/{index-sv4y1cma.js → index-v1sc1gxv.js} +6 -6
  69. package/dist/cli/{index-a11ztzs5.js → index-vmthakz0.js} +1 -1
  70. package/dist/cli/{index-09wm3963.js → index-x6kjbjya.js} +9 -7
  71. package/dist/cli/{index-1sz02k85.js → index-zptq8mp1.js} +4 -103
  72. package/dist/cli/{index-34bwqcea.js → index-zvxy0mev.js} +1 -1
  73. package/dist/cli/{index-zz7gzw57.js → index-zxdawwc7.js} +88 -4
  74. package/dist/cli/index.js +47 -45
  75. package/dist/cli/{knowledge-escalator-yx97q9c1.js → knowledge-escalator-x8vcmb6k.js} +16 -15
  76. package/dist/cli/{knowledge-events-p269fyvv.js → knowledge-events-naf9kyyc.js} +14 -13
  77. package/dist/cli/{knowledge-link-gfz47ves.js → knowledge-link-g0q25hqv.js} +5 -4
  78. package/dist/cli/{knowledge-store-36zemyqa.js → knowledge-store-dnv0ph42.js} +6 -5
  79. package/dist/cli/{knowledge-validator-rd20yq41.js → knowledge-validator-a1rfzkmv.js} +8 -7
  80. package/dist/cli/{mcp-sg9zrkz2.js → mcp-hnb0m05a.js} +1 -1
  81. package/dist/cli/{pending-delegations-8p2gf4kt.js → pending-delegations-05p6cmbh.js} +13 -12
  82. package/dist/cli/{pr-subscriptions-4dj9r71h.js → pr-subscriptions-a2djfzyx.js} +13 -12
  83. package/dist/cli/{pr-workflow-gate-8dgz5z1h.js → pr-workflow-gate-wkmx8nr6.js} +48 -44
  84. package/dist/cli/{runner-16b691ba.js → runner-hkbds12j.js} +6 -5
  85. package/dist/cli/{scan-cursor-nx0jv9ya.js → scan-cursor-4khfn5pm.js} +8 -8
  86. package/dist/cli/{schema-q6gsrxwz.js → schema-a5zb02h8.js} +3 -1
  87. package/dist/cli/{scope-persistence-1k4xsyh7.js → scope-persistence-nsw324ce.js} +18 -17
  88. package/dist/cli/{server-shhxq34t.js → server-exj4wt8j.js} +54 -52
  89. package/dist/cli/{skill-generator-6j7tq2tb.js → skill-generator-r2cdtx7b.js} +18 -17
  90. package/dist/cli/{snapshot-coordination-init-h8n8w1cm.js → snapshot-coordination-init-sad6q0a2.js} +46 -44
  91. package/dist/cli/speckit-checkoff-46g9sqak.js +31 -0
  92. package/dist/cli/{workspace-snapshot-rfnn80dg.js → workspace-snapshot-4m2ex1ey.js} +4 -5
  93. package/dist/cli/{worktree-collision-ownership-97jzh4ra.js → worktree-collision-ownership-4znkfq1t.js} +16 -16
  94. package/dist/cli/{worktree-isolation-g4w74ccb.js → worktree-isolation-mv9ee00v.js} +46 -44
  95. package/dist/commands/pr-feedback-loop.d.ts +1 -0
  96. package/dist/commands/registry.d.ts +10 -2
  97. package/dist/config/schema.d.ts +27 -0
  98. package/dist/hooks/delegation-tracker.d.ts +6 -1
  99. package/dist/hooks/pr-workflow-gate.d.ts +1 -1
  100. package/dist/index.js +639 -606
  101. package/dist/lang/backends/go.d.ts +2 -0
  102. package/dist/mutation/engine.d.ts +1 -0
  103. package/dist/sdd/effective-spec.d.ts +35 -22
  104. package/dist/sdd/speckit-checkoff.d.ts +113 -0
  105. package/dist/session/hydration-ownership.d.ts +83 -0
  106. package/dist/session/snapshot-coordination-init.d.ts +2 -1
  107. package/dist/session/snapshot-reader.d.ts +25 -7
  108. package/dist/state.d.ts +32 -2
  109. package/dist/test-impact/analyzer.d.ts +46 -4
  110. package/dist/test-impact/constants.d.ts +4 -0
  111. package/dist/tools/mutation-test.d.ts +11 -5
  112. package/dist/tools/test-runner.d.ts +34 -6
  113. package/opencode-swarm.schema.json +40 -0
  114. package/package.json +1 -1
  115. package/dist/cli/curator-llm-factory-cbm1ny30.js +0 -72
  116. package/dist/cli/guardrail-explain-ffwmhf7s.js +0 -73
  117. package/dist/cli/hive-promoter-ewrz7vh1.js +0 -87
  118. package/dist/cli/index-4ddpvd5c.js +0 -94
@@ -11,16 +11,16 @@ import {
11
11
  } from "./index-ae75rja9.js";
12
12
  import {
13
13
  resolveKnowledgeStoreDir
14
- } from "./index-34bwqcea.js";
14
+ } from "./index-zvxy0mev.js";
15
15
  import {
16
16
  atomicWriteFile
17
- } from "./index-f2v90gfc.js";
17
+ } from "./index-0v1rtanv.js";
18
18
  import {
19
19
  require_proper_lockfile
20
20
  } from "./index-7g4c7s5r.js";
21
21
  import {
22
22
  readCachedParsedFile
23
- } from "./index-ne9zamcs.js";
23
+ } from "./index-989v83pb.js";
24
24
  import {
25
25
  init_knowledge_types,
26
26
  isActiveStatus
@@ -739,7 +739,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
739
739
  const {
740
740
  readAuthoritativeKnowledgeCounterRollups,
741
741
  effectiveRetrievalOutcomes
742
- } = await import("./knowledge-events-p269fyvv.js");
742
+ } = await import("./knowledge-events-naf9kyyc.js");
743
743
  const rollups = await readAuthoritativeKnowledgeCounterRollups(directory);
744
744
  const flagIds = new Set;
745
745
  for (const e of atFloor) {
@@ -806,11 +806,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
806
806
  });
807
807
  }
808
808
  if (action === "quarantine" && toQuarantine.length > 0) {
809
- const { quarantineEntry } = await import("./knowledge-validator-rd20yq41.js");
810
- const { KnowledgeConfigSchema } = await import("./schema-q6gsrxwz.js");
809
+ const { quarantineEntry } = await import("./knowledge-validator-a1rfzkmv.js");
810
+ const { KnowledgeConfigSchema } = await import("./schema-a5zb02h8.js");
811
811
  let config;
812
812
  try {
813
- const { loadPluginConfigWithMeta } = await import("./index-tmy46dtd.js");
813
+ const { loadPluginConfigWithMeta } = await import("./index-mhrn7hbb.js");
814
814
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
815
815
  config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
816
816
  } catch {
@@ -38,7 +38,7 @@ INPUT: [focus areas/paths]
38
38
 
39
39
  ACTIONS:
40
40
  - FIRST call \`repo_map action="ask"\` with your mission question, and \`action="context_pack"\` (with include_source: true) for your target symbols; use the hits to decide what to read
41
- - Locate symbols by name with \`repo_map action="symbol_search"\` before reading files; treat hits as pointers, not evidence
41
+ - For symbol discovery call \`repo_map action="symbol_search" symbol="<name>" top_n=25\`, resolve a selected hit with \`repo_map action="symbol_context" file="<path>" symbol="<name>" include_source=true top_n=25\`, and use \`repo_map action="graph_explain" file="<path>" symbol="<name>" line=<line> top_n=20\` when the graph relationship needs explanation. Verify every graph claim and provenance against source; if the graph is missing, stale, unsupported, or fails, fall back to tree/glob/grep, direct reads, and search.
42
42
  - Graph output is orientation \u2014 read the located files before reporting on them
43
43
  - Fall back to tree/glob/grep only where the graph has no coverage (\`stale: true\`, missing files, or non-code assets)
44
44
  - Read key files (README, configs, entry points)
@@ -3,7 +3,7 @@ import {
3
3
  queryHistoricalOutcomes,
4
4
  readKnowledgeEvents,
5
5
  recordKnowledgeEvent
6
- } from "./index-hwcra3y9.js";
6
+ } from "./index-ekgc71m1.js";
7
7
  import {
8
8
  jaccardBigram,
9
9
  readKnowledge,
@@ -11,7 +11,7 @@ import {
11
11
  resolveSwarmKnowledgePath,
12
12
  transactKnowledge,
13
13
  wordBigrams
14
- } from "./index-ndwbb3xm.js";
14
+ } from "./index-pnt98k7z.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-rd20yq41.js");
227
+ const { quarantineEntry } = await import("./knowledge-validator-a1rfzkmv.js");
228
228
  let policyConfig;
229
229
  try {
230
- const { KnowledgeConfigSchema } = await import("./schema-q6gsrxwz.js");
231
- const { loadPluginConfigWithMeta } = await import("./index-tmy46dtd.js");
230
+ const { KnowledgeConfigSchema } = await import("./schema-a5zb02h8.js");
231
+ const { loadPluginConfigWithMeta } = await import("./index-mhrn7hbb.js");
232
232
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
233
233
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
234
234
  } catch {
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-s4bkey0q.js";
4
+ } from "./index-gc6h1fmf.js";
5
5
  import {
6
6
  bunWrite
7
7
  } from "./index-2s7dvzff.js";
@@ -18,18 +18,18 @@ import {
18
18
  releaseCoordinationLease,
19
19
  transitionCoordinationState,
20
20
  withCoordinationTransaction
21
- } from "./index-a11ztzs5.js";
21
+ } from "./index-vmthakz0.js";
22
22
  import {
23
23
  getProjectDb,
24
24
  projectDbExists
25
- } from "./index-nzekzzs2.js";
25
+ } from "./index-bv4b8tpa.js";
26
26
  import {
27
27
  observeDelegationLedgerPressure
28
- } from "./index-yfpswnjt.js";
28
+ } from "./index-jmrsfhwq.js";
29
29
  import {
30
30
  EvidenceLockTimeoutError,
31
31
  withEvidenceLock
32
- } from "./index-f2v90gfc.js";
32
+ } from "./index-0v1rtanv.js";
33
33
  import {
34
34
  telemetry
35
35
  } from "./index-qt0793qm.js";
@@ -4660,7 +4660,7 @@ async function reconcileLegacyCoderSettlements(directory, maxRecords, onReconcil
4660
4660
  const candidates = readDelegations(directory).filter((record) => record.normalizedAgent === "coder" && Boolean(record.legacyCoderSettlementTransfer) && Boolean(record.terminalResult)).slice(0, maxRecords);
4661
4661
  if (candidates.length === 0)
4662
4662
  return 0;
4663
- const { transferCoderSettlementToBackground } = await import("./coder-settlement-7pt3a0y0.js");
4663
+ const { transferCoderSettlementToBackground } = await import("./coder-settlement-34z9xgnx.js");
4664
4664
  let transferred = 0;
4665
4665
  for (const record of candidates) {
4666
4666
  try {
@@ -4,7 +4,7 @@ import {
4
4
  getProjectDb,
5
5
  projectDbExists,
6
6
  withImmediateTransaction
7
- } from "./index-nzekzzs2.js";
7
+ } from "./index-bv4b8tpa.js";
8
8
 
9
9
  // src/db/coordination-store.ts
10
10
  import { createHash } from "crypto";
@@ -2,17 +2,17 @@
2
2
  import {
3
3
  derivePlanId,
4
4
  derivePlanIdentityHash
5
- } from "./index-a11ztzs5.js";
5
+ } from "./index-vmthakz0.js";
6
6
  import {
7
7
  getProjectDb,
8
8
  projectDbExists,
9
9
  withImmediateTransaction,
10
10
  withProjectDbReadOnly
11
- } from "./index-nzekzzs2.js";
11
+ } from "./index-bv4b8tpa.js";
12
12
  import {
13
13
  assertProjectRoot,
14
14
  withEvidenceLock
15
- } from "./index-f2v90gfc.js";
15
+ } from "./index-0v1rtanv.js";
16
16
  import {
17
17
  emit
18
18
  } from "./index-qt0793qm.js";
@@ -20,14 +20,16 @@ import {
20
20
  ExecutionProfileSchema,
21
21
  PlanSchema,
22
22
  TaskStatusSchema,
23
- init_loader,
24
- loadPluginConfig,
25
23
  normalizeCurrentPhaseInPlace
26
- } from "./index-1sz02k85.js";
24
+ } from "./index-gx2vp8gx.js";
25
+ import {
26
+ init_loader,
27
+ loadPluginConfig
28
+ } from "./index-zptq8mp1.js";
27
29
  import {
28
30
  init_package,
29
31
  package_default
30
- } from "./index-twtez316.js";
32
+ } from "./index-defq2crz.js";
31
33
  import {
32
34
  criticalWarn,
33
35
  init_logger,
@@ -1,12 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  GIT_BINARY_ENV_VAR,
4
- init_git_executable
5
- } from "./index-zz7gzw57.js";
6
- import {
7
4
  advisoryWarn,
5
+ init_git_executable,
8
6
  init_warning_buffer
9
- } from "./index-4ddpvd5c.js";
7
+ } from "./index-zxdawwc7.js";
10
8
  import {
11
9
  ExternalSkillsConfigSchema,
12
10
  GATE_CONFIG_KNOWN_SECTION_KEYS,
@@ -14,11 +12,7 @@ import {
14
12
  PluginConfigSchema,
15
13
  init_schema,
16
14
  resolveExternalSkillsConfig
17
- } from "./index-twtez316.js";
18
- import {
19
- exports_external,
20
- init_zod
21
- } from "./index-gknz3bv1.js";
15
+ } from "./index-defq2crz.js";
22
16
  import {
23
17
  DangerousMergeKeyError,
24
18
  MAX_MERGE_DEPTH,
@@ -808,97 +802,4 @@ var init_loader = __esm(() => {
808
802
  };
809
803
  });
810
804
 
811
- // src/config/plan-schema.ts
812
- init_zod();
813
- var ExecutionProfileSchema = exports_external.object({
814
- parallelization_enabled: exports_external.boolean().default(false),
815
- max_concurrent_tasks: exports_external.number().int().min(1).max(64).default(10),
816
- council_parallel: exports_external.boolean().default(true),
817
- locked: exports_external.boolean().default(false),
818
- auto_proceed: exports_external.boolean().default(false),
819
- commit_after_each_completed_task: exports_external.boolean().default(false),
820
- planning_profile: exports_external.enum(["balanced", "strict"]).optional()
821
- });
822
- var TaskStatusSchema = exports_external.enum([
823
- "pending",
824
- "in_progress",
825
- "completed",
826
- "blocked",
827
- "closed"
828
- ]);
829
- var TaskSizeSchema = exports_external.enum(["small", "medium", "large"]);
830
- var PhaseStatusSchema = exports_external.enum([
831
- "pending",
832
- "in_progress",
833
- "complete",
834
- "completed",
835
- "blocked",
836
- "closed"
837
- ]);
838
- var MigrationStatusSchema = exports_external.enum([
839
- "native",
840
- "migrated",
841
- "migration_failed"
842
- ]);
843
- var TaskSchema = exports_external.object({
844
- id: exports_external.string(),
845
- phase: exports_external.number().int().min(1),
846
- status: TaskStatusSchema.default("pending"),
847
- size: TaskSizeSchema.default("small"),
848
- description: exports_external.string().min(1),
849
- depends: exports_external.array(exports_external.string()).default([]),
850
- acceptance: exports_external.string().optional(),
851
- files_touched: exports_external.array(exports_external.string()).default([]),
852
- evidence_path: exports_external.string().optional(),
853
- blocked_reason: exports_external.string().optional(),
854
- fr_refs: exports_external.array(exports_external.string()).optional()
855
- });
856
- var PhaseSchema = exports_external.object({
857
- id: exports_external.number().int().min(1),
858
- name: exports_external.string().min(1),
859
- status: PhaseStatusSchema.default("pending"),
860
- tasks: exports_external.array(TaskSchema).default([]),
861
- type: exports_external.enum(["code", "non-code"]).optional(),
862
- required_agents: exports_external.array(exports_external.string()).optional()
863
- });
864
- var PlanSchema = exports_external.object({
865
- schema_version: exports_external.literal("1.0.0"),
866
- title: exports_external.string().min(1),
867
- swarm: exports_external.string().min(1),
868
- current_phase: exports_external.number().int().min(1).optional(),
869
- phases: exports_external.array(PhaseSchema).min(1),
870
- migration_status: MigrationStatusSchema.optional(),
871
- specMtime: exports_external.string().optional(),
872
- specHash: exports_external.string().optional(),
873
- execution_profile: ExecutionProfileSchema.optional()
874
- });
875
- function isPhaseStatusTerminal(status) {
876
- return status === "complete" || status === "completed" || status === "closed";
877
- }
878
- function isPhaseEffectivelyTerminal(phase) {
879
- if (isPhaseStatusTerminal(phase.status))
880
- return true;
881
- const tasks = phase.tasks ?? [];
882
- return tasks.length > 0 && tasks.every((task) => task.status === "completed" || task.status === "closed");
883
- }
884
- function resolveActivePhaseId(plan) {
885
- const cursor = plan.current_phase;
886
- if (cursor !== undefined) {
887
- const cursorPhase = plan.phases.find((phase) => phase.id === cursor);
888
- if (cursorPhase && !isPhaseEffectivelyTerminal(cursorPhase)) {
889
- return cursorPhase.id;
890
- }
891
- }
892
- const firstNonTerminal = plan.phases.find((phase) => !isPhaseEffectivelyTerminal(phase));
893
- if (firstNonTerminal)
894
- return firstNonTerminal.id;
895
- return plan.phases[plan.phases.length - 1]?.id ?? 1;
896
- }
897
- function normalizeCurrentPhaseInPlace(plan) {
898
- plan.current_phase = resolveActivePhaseId(plan);
899
- }
900
- function getCurrentPhase(plan) {
901
- return resolveActivePhaseId(plan);
902
- }
903
-
904
- export { loadPluginConfig, loadPluginConfigWithMeta, loadGateOverrides, resetConfigAdvisoryDedup, getSafeDefaultConfigLoadResult, loadPluginConfigWithMetaAsync, loadAgentPrompt, exports_loader, init_loader, ExecutionProfileSchema, TaskStatusSchema, TaskSizeSchema, PhaseStatusSchema, MigrationStatusSchema, TaskSchema, PhaseSchema, PlanSchema, resolveActivePhaseId, normalizeCurrentPhaseInPlace, getCurrentPhase };
805
+ export { loadPluginConfig, loadPluginConfigWithMeta, loadGateOverrides, resetConfigAdvisoryDedup, getSafeDefaultConfigLoadResult, loadPluginConfigWithMetaAsync, loadAgentPrompt, exports_loader, init_loader };
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  atomicWriteFile
4
- } from "./index-f2v90gfc.js";
4
+ } from "./index-0v1rtanv.js";
5
5
  import {
6
6
  canonicalRootKeyFresh
7
7
  } from "./index-1xnse449.js";
@@ -1,12 +1,96 @@
1
1
  // @bun
2
2
  import {
3
- advisoryWarn,
4
- init_warning_buffer
5
- } from "./index-4ddpvd5c.js";
3
+ init_logger,
4
+ log
5
+ } from "./index-zgwm4ryv.js";
6
6
  import {
7
7
  __esm
8
8
  } from "./index-a76rekgs.js";
9
9
 
10
+ // src/observability/startup-contract.ts
11
+ function noteStartupAdvisory() {
12
+ if (!state.advisoryWindowOpen)
13
+ return;
14
+ state.advisoryCount += 1;
15
+ }
16
+ var state;
17
+ var init_startup_contract = __esm(() => {
18
+ state = {
19
+ importMarkMs: null,
20
+ serverStartMark: null,
21
+ serverResolvedMark: null,
22
+ serverMs: null,
23
+ queueScheduledAt: null,
24
+ queuePending: 0,
25
+ queueTasks: 0,
26
+ queueCompleted: 0,
27
+ queueFailed: 0,
28
+ queueSettled: false,
29
+ queueSettledMs: null,
30
+ advisoryCount: 0,
31
+ advisoryWindowOpen: false,
32
+ firstTurnDone: false,
33
+ firstToolDone: false,
34
+ firstToolName: null,
35
+ firstTurnMs: null,
36
+ firstToolMs: null
37
+ };
38
+ });
39
+
40
+ // src/services/warning-buffer.ts
41
+ function sanitizeBufferedLine(s) {
42
+ return s.replace(/\s+/g, " ").replace(CONTROL_CHARS_RE, "").replace(/\s+/g, " ").trim();
43
+ }
44
+ function addDeferredWarning(warning) {
45
+ noteStartupAdvisory();
46
+ const sanitized = sanitizeBufferedLine(warning);
47
+ if (deferredWarnings.length < MAX_DEFERRED_WARNINGS - 1) {
48
+ deferredWarnings.push(sanitized);
49
+ return;
50
+ }
51
+ if (!deferredWarningsTruncated) {
52
+ deferredWarnings.push(`[opencode-swarm] ${MAX_DEFERRED_WARNINGS - 1} deferred warnings buffered; additional advisories were dropped (cap reached). Run with OPENCODE_SWARM_DEBUG=1 to see all advisories in the debug log.`);
53
+ deferredWarningsTruncated = true;
54
+ }
55
+ }
56
+ function renderAdvisoryDetail(data) {
57
+ if (data === undefined || data === null)
58
+ return "";
59
+ let raw;
60
+ if (typeof data === "string") {
61
+ raw = data;
62
+ } else if (data instanceof Error) {
63
+ raw = data.message;
64
+ } else if (Array.isArray(data) && data.every((d) => typeof d === "string")) {
65
+ raw = data.join("; ");
66
+ } else {
67
+ try {
68
+ raw = JSON.stringify(data) ?? String(data);
69
+ } catch {
70
+ raw = String(data);
71
+ }
72
+ }
73
+ const collapsed = sanitizeBufferedLine(raw);
74
+ if (collapsed === "")
75
+ return "";
76
+ return collapsed.length > MAX_ADVISORY_DETAIL_CHARS ? `${collapsed.slice(0, MAX_ADVISORY_DETAIL_CHARS - 1)}\u2026` : collapsed;
77
+ }
78
+ function advisoryWarn(message, data) {
79
+ const detail = renderAdvisoryDetail(data);
80
+ addDeferredWarning(detail ? `${message} ${detail}` : message);
81
+ log(message, data);
82
+ }
83
+ function getDeferredWarnings() {
84
+ return [...deferredWarnings];
85
+ }
86
+ var deferredWarnings, MAX_DEFERRED_WARNINGS = 50, deferredWarningsTruncated = false, CONTROL_CHARS_RE, MAX_ADVISORY_DETAIL_CHARS = 600;
87
+ var init_warning_buffer = __esm(() => {
88
+ init_startup_contract();
89
+ init_logger();
90
+ deferredWarnings = [];
91
+ CONTROL_CHARS_RE = /[\x00-\x1F\x7F-\x9F]/g;
92
+ });
93
+
10
94
  // src/utils/git-executable.ts
11
95
  import { spawnSync } from "child_process";
12
96
  import * as fs from "fs";
@@ -279,4 +363,4 @@ var init_git_executable = __esm(() => {
279
363
  };
280
364
  });
281
365
 
282
- export { GIT_BINARY_ENV_VAR, resolveGitExecutable, resolveGitExecutableAsync, describeGitResolution, init_git_executable };
366
+ export { addDeferredWarning, advisoryWarn, getDeferredWarnings, init_warning_buffer, GIT_BINARY_ENV_VAR, resolveGitExecutable, resolveGitExecutableAsync, describeGitResolution, init_git_executable };
package/dist/cli/index.js CHANGED
@@ -14,67 +14,69 @@ import {
14
14
  readCachePackageVersion,
15
15
  resolveCommand,
16
16
  safeRealpathSync
17
- } from "./index-d66zb40k.js";
18
- import"./index-zgvzbz48.js";
19
- import"./index-pskba939.js";
20
- import"./index-7zmbtxw1.js";
21
- import"./index-h4nh6s8b.js";
22
- import"./index-0bc8jdnv.js";
23
- import"./index-wvpsm8ja.js";
24
- import"./index-g6nyk713.js";
17
+ } from "./index-dnbqmay5.js";
18
+ import"./index-06crt1ej.js";
19
+ import"./index-hamqvzqn.js";
20
+ import"./index-jscqefqm.js";
21
+ import"./index-nhxykfyy.js";
22
+ import"./index-1hzqyx13.js";
23
+ import"./index-kp654qcw.js";
24
+ import"./index-aspxz5r5.js";
25
25
  import"./index-txdagbh7.js";
26
- import"./index-n1tcj1q7.js";
26
+ import"./index-bx70zs8d.js";
27
27
  import"./index-6b295cas.js";
28
- import"./index-8815e95e.js";
29
- import"./index-qxk5qkfh.js";
30
- import"./index-1rwyfvq2.js";
31
- import"./index-1c1dbwze.js";
32
- import"./index-6r92fw88.js";
33
- import"./index-549wxbe1.js";
28
+ import"./index-5gmn0a3j.js";
29
+ import"./index-ret97f1t.js";
30
+ import"./index-2h0qng38.js";
31
+ import"./index-rdec0y3z.js";
32
+ import"./index-93vk5s7v.js";
33
+ import"./index-cjapb4hy.js";
34
34
  import"./index-zsrtt42s.js";
35
- import"./index-3hne91yd.js";
36
- import"./index-2b0ktpbf.js";
37
- import"./index-3pzwsesm.js";
35
+ import"./index-cxgr6ad5.js";
36
+ import"./index-bdpgfep1.js";
37
+ import"./index-92m05mew.js";
38
38
  import"./index-pt7h91zc.js";
39
39
  import"./index-q7sjgr1y.js";
40
- import"./index-kmhnkn6t.js";
41
- import"./index-6tnkvqr9.js";
42
- import"./index-sv4y1cma.js";
43
- import"./index-hwcra3y9.js";
44
- import"./index-s4bkey0q.js";
40
+ import"./index-b9z9gvx0.js";
41
+ import"./index-caj76d0f.js";
42
+ import"./index-8b1f2t5q.js";
43
+ import"./index-v1sc1gxv.js";
44
+ import"./index-ekgc71m1.js";
45
+ import"./index-gc6h1fmf.js";
45
46
  import"./index-2s7dvzff.js";
46
- import"./index-yagqxt2p.js";
47
- import"./index-0h3cr7pn.js";
47
+ import"./index-5m378633.js";
48
+ import"./index-5yc5n4ae.js";
48
49
  import"./index-rtry5xyf.js";
49
- import"./index-kanxpgf8.js";
50
+ import"./index-dcttq1mn.js";
50
51
  import"./index-frcemc0b.js";
51
- import"./index-wrt875kh.js";
52
- import"./index-9p1pqykb.js";
53
- import"./index-09wm3963.js";
54
- import"./index-h59vsbch.js";
55
- import"./index-cvg402ha.js";
56
- import"./index-a11ztzs5.js";
57
- import"./index-nzekzzs2.js";
58
- import"./index-ry16d01s.js";
52
+ import"./index-0725jpp7.js";
53
+ import"./index-jrfv2am8.js";
54
+ import"./index-x6kjbjya.js";
55
+ import"./index-htrb9ec3.js";
56
+ import"./index-91dhg3wr.js";
57
+ import"./index-vmthakz0.js";
58
+ import"./index-bv4b8tpa.js";
59
59
  import"./index-rdm3px0g.js";
60
- import"./index-yfpswnjt.js";
61
- import"./index-ndwbb3xm.js";
60
+ import"./index-ry16d01s.js";
61
+ import"./index-jmrsfhwq.js";
62
+ import"./index-pnt98k7z.js";
62
63
  import"./index-vzm6zre7.js";
63
64
  import"./index-ae75rja9.js";
64
- import"./index-34bwqcea.js";
65
- import"./index-f2v90gfc.js";
66
- import"./index-7g4c7s5r.js";
65
+ import"./index-zvxy0mev.js";
66
+ import"./index-0v1rtanv.js";
67
67
  import"./index-qt0793qm.js";
68
- import"./index-ne9zamcs.js";
69
68
  import"./index-1xnse449.js";
70
69
  import"./index-c1ggtmpm.js";
71
- import"./index-1sz02k85.js";
72
- import"./index-zz7gzw57.js";
73
- import"./index-4ddpvd5c.js";
70
+ import"./index-ejhxgyvm.js";
71
+ import"./index-7g4c7s5r.js";
72
+ import"./index-989v83pb.js";
73
+ import"./index-gx2vp8gx.js";
74
+ import"./index-zptq8mp1.js";
75
+ import"./index-zxdawwc7.js";
74
76
  import {
75
77
  init_package,
76
78
  package_default
77
- } from "./index-twtez316.js";
79
+ } from "./index-defq2crz.js";
78
80
  import {
79
81
  DEFAULT_AGENT_CONFIGS,
80
82
  init_constants
@@ -642,7 +644,7 @@ async function main() {
642
644
  const exitCode = await run(["ci", ...args.slice(1)]);
643
645
  process.exit(exitCode);
644
646
  } else if (command === "mcp") {
645
- const { handleMcpCommand } = await import("./mcp-sg9zrkz2.js");
647
+ const { handleMcpCommand } = await import("./mcp-hnb0m05a.js");
646
648
  const exitCode = await handleMcpCommand(args.slice(1));
647
649
  process.exit(exitCode);
648
650
  } else {
@@ -9,28 +9,29 @@ import {
9
9
  maybeEscalateOnViolation,
10
10
  maybeQuarantineOnContradiction,
11
11
  readRecentEscalations
12
- } from "./index-qxk5qkfh.js";
13
- import"./index-hwcra3y9.js";
14
- import"./index-s4bkey0q.js";
12
+ } from "./index-ret97f1t.js";
13
+ import"./index-ekgc71m1.js";
14
+ import"./index-gc6h1fmf.js";
15
15
  import"./index-2s7dvzff.js";
16
- import"./index-kanxpgf8.js";
16
+ import"./index-dcttq1mn.js";
17
17
  import"./index-frcemc0b.js";
18
- import"./index-wrt875kh.js";
19
- import"./index-yfpswnjt.js";
20
- import"./index-ndwbb3xm.js";
18
+ import"./index-0725jpp7.js";
19
+ import"./index-jmrsfhwq.js";
20
+ import"./index-pnt98k7z.js";
21
21
  import"./index-vzm6zre7.js";
22
22
  import"./index-ae75rja9.js";
23
- import"./index-34bwqcea.js";
24
- import"./index-f2v90gfc.js";
25
- import"./index-7g4c7s5r.js";
23
+ import"./index-zvxy0mev.js";
24
+ import"./index-0v1rtanv.js";
26
25
  import"./index-qt0793qm.js";
27
- import"./index-ne9zamcs.js";
28
26
  import"./index-1xnse449.js";
29
27
  import"./index-c1ggtmpm.js";
30
- import"./index-1sz02k85.js";
31
- import"./index-zz7gzw57.js";
32
- import"./index-4ddpvd5c.js";
33
- import"./index-twtez316.js";
28
+ import"./index-ejhxgyvm.js";
29
+ import"./index-7g4c7s5r.js";
30
+ import"./index-989v83pb.js";
31
+ import"./index-gx2vp8gx.js";
32
+ import"./index-zptq8mp1.js";
33
+ import"./index-zxdawwc7.js";
34
+ import"./index-defq2crz.js";
34
35
  import"./index-w872yykk.js";
35
36
  import"./index-bk5tah7q.js";
36
37
  import"./index-gknz3bv1.js";
@@ -29,25 +29,26 @@ import {
29
29
  resolveKnowledgeCounterBaselinePath,
30
30
  resolveKnowledgeEventsPath,
31
31
  resolveLegacyApplicationLogPath
32
- } from "./index-hwcra3y9.js";
33
- import"./index-s4bkey0q.js";
32
+ } from "./index-ekgc71m1.js";
33
+ import"./index-gc6h1fmf.js";
34
34
  import"./index-2s7dvzff.js";
35
- import"./index-kanxpgf8.js";
35
+ import"./index-dcttq1mn.js";
36
36
  import"./index-frcemc0b.js";
37
- import"./index-wrt875kh.js";
38
- import"./index-yfpswnjt.js";
37
+ import"./index-0725jpp7.js";
38
+ import"./index-jmrsfhwq.js";
39
39
  import"./index-ae75rja9.js";
40
- import"./index-34bwqcea.js";
41
- import"./index-f2v90gfc.js";
42
- import"./index-7g4c7s5r.js";
40
+ import"./index-zvxy0mev.js";
41
+ import"./index-0v1rtanv.js";
43
42
  import"./index-qt0793qm.js";
44
- import"./index-ne9zamcs.js";
45
43
  import"./index-1xnse449.js";
46
44
  import"./index-c1ggtmpm.js";
47
- import"./index-1sz02k85.js";
48
- import"./index-zz7gzw57.js";
49
- import"./index-4ddpvd5c.js";
50
- import"./index-twtez316.js";
45
+ import"./index-ejhxgyvm.js";
46
+ import"./index-7g4c7s5r.js";
47
+ import"./index-989v83pb.js";
48
+ import"./index-gx2vp8gx.js";
49
+ import"./index-zptq8mp1.js";
50
+ import"./index-zxdawwc7.js";
51
+ import"./index-defq2crz.js";
51
52
  import"./index-w872yykk.js";
52
53
  import"./index-bk5tah7q.js";
53
54
  import"./index-gknz3bv1.js";
@@ -12,13 +12,14 @@ import {
12
12
  resolveLinkDir,
13
13
  sanitizeLinkId,
14
14
  writeLinkPointer
15
- } from "./index-34bwqcea.js";
16
- import"./index-f2v90gfc.js";
17
- import"./index-7g4c7s5r.js";
15
+ } from "./index-zvxy0mev.js";
16
+ import"./index-0v1rtanv.js";
18
17
  import"./index-qt0793qm.js";
19
- import"./index-ne9zamcs.js";
20
18
  import"./index-1xnse449.js";
21
19
  import"./index-c1ggtmpm.js";
20
+ import"./index-ejhxgyvm.js";
21
+ import"./index-7g4c7s5r.js";
22
+ import"./index-989v83pb.js";
22
23
  import"./index-gknz3bv1.js";
23
24
  import"./index-zpsr8rpc.js";
24
25
  import"./index-zgwm4ryv.js";