opencode-swarm 7.186.1 → 7.186.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 (93) 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/cli/{auto-checkpoint-fsd4a9q9.js → auto-checkpoint-c7ykm2vt.js} +8 -8
  4. package/dist/cli/{checkpoint-rc61fd93.js → checkpoint-jafvsq23.js} +16 -16
  5. package/dist/cli/{coder-settlement-x198191a.js → coder-settlement-n00djebn.js} +12 -12
  6. package/dist/cli/{config-doctor-mj4ae4jn.js → config-doctor-17yft6hp.js} +2 -2
  7. package/dist/cli/{core-fvsjr20m.js → core-trk38w53.js} +3 -3
  8. package/dist/cli/{curation-policy-pxwagyh7.js → curation-policy-1zdsb3h0.js} +6 -6
  9. package/dist/cli/{curator-drift-t150w08d.js → curator-drift-b6cjgsq3.js} +8 -8
  10. package/dist/cli/curator-llm-factory-a1hy89ea.js +81 -0
  11. package/dist/cli/{curator-h7j1xse4.js → curator-yvp2e7tk.js} +41 -41
  12. package/dist/cli/{evidence-summary-service-h42y6hwq.js → evidence-summary-service-9vh0t896.js} +19 -19
  13. package/dist/cli/{gate-evidence-c7caa5x2.js → gate-evidence-tbjsm6r8.js} +7 -7
  14. package/dist/cli/guardrail-explain-a16eabym.js +82 -0
  15. package/dist/cli/{guardrail-log-hcr5rptq.js → guardrail-log-4kj5e7da.js} +7 -7
  16. package/dist/cli/{guardrail-reset-fqgf5sdb.js → guardrail-reset-fstvd42q.js} +41 -41
  17. package/dist/cli/{hive-promoter-632ewk29.js → hive-promoter-68prvn82.js} +41 -41
  18. package/dist/cli/{index-w6w6ny06.js → index-1f7mkb7p.js} +58 -58
  19. package/dist/cli/{index-dbcwvc1v.js → index-1m3502g5.js} +7 -7
  20. package/dist/cli/{index-pe1wgpvg.js → index-27yspj61.js} +7 -7
  21. package/dist/cli/{index-8fnayk3x.js → index-3h80xyek.js} +5 -5
  22. package/dist/cli/{index-qg0nhcke.js → index-3w0v6n9x.js} +5 -5
  23. package/dist/cli/{index-c5e1wr7h.js → index-4tpwp24b.js} +2 -2
  24. package/dist/cli/{index-gbmsvfp2.js → index-52s3tsmj.js} +2 -2
  25. package/dist/cli/{index-4z0zdcd7.js → index-5cybjkj0.js} +3 -3
  26. package/dist/cli/{index-nnmgg6z6.js → index-5qbm61fh.js} +1 -1
  27. package/dist/cli/{index-9z9g1897.js → index-5z1xrkaa.js} +2 -2
  28. package/dist/cli/{index-0t61279z.js → index-70m4cxys.js} +3 -3
  29. package/dist/cli/{index-gjrs1epm.js → index-8ehsv9yw.js} +1 -1
  30. package/dist/cli/{index-xe34ymp8.js → index-8n2emawn.js} +2 -2
  31. package/dist/cli/{index-hmwnegkz.js → index-8r96zar7.js} +1 -1
  32. package/dist/cli/{index-bpqw4n2f.js → index-98hksf1k.js} +1 -1
  33. package/dist/cli/{index-xkxt1b08.js → index-a07nc99k.js} +3 -3
  34. package/dist/cli/{index-ef3pecd4.js → index-b58k1wy8.js} +178 -142
  35. package/dist/cli/{index-92bbwjek.js → index-cbpggzdm.js} +2 -2
  36. package/dist/cli/{index-3rd7gqfg.js → index-d7kz64yr.js} +2 -2
  37. package/dist/cli/{index-jwkybwv0.js → index-f2mtzrsr.js} +4 -4
  38. package/dist/cli/{index-03d68zxw.js → index-fxvthwwk.js} +43 -43
  39. package/dist/cli/{index-hq9f7fwf.js → index-g23nwtfq.js} +2 -2
  40. package/dist/cli/{index-m8dry0a6.js → index-g319bdeh.js} +1 -1
  41. package/dist/cli/{index-chaa1v0b.js → index-g7rp7200.js} +5 -5
  42. package/dist/cli/{index-q9wnbz9q.js → index-gvch83kc.js} +1 -1
  43. package/dist/cli/{index-92y6cpqn.js → index-h8pb617g.js} +2 -2
  44. package/dist/cli/{index-8jq3jsas.js → index-hdeqj1k4.js} +1 -1
  45. package/dist/cli/{index-5v1sqv3m.js → index-j2m9q6w1.js} +1 -1
  46. package/dist/cli/{index-syt8wykh.js → index-js4spqjf.js} +4 -4
  47. package/dist/cli/{index-4h6e73bx.js → index-k3gz8b6j.js} +7 -7
  48. package/dist/cli/{index-y7s92gte.js → index-kbcx6rqh.js} +2 -2
  49. package/dist/cli/{index-t46swpqf.js → index-mdxqv3r9.js} +1 -1
  50. package/dist/cli/{index-mnb1pg1n.js → index-mqc6phah.js} +4 -4
  51. package/dist/cli/{index-teyvb5tr.js → index-msejg9hk.js} +1 -1
  52. package/dist/cli/{index-ay508kfq.js → index-n8aep8en.js} +5 -5
  53. package/dist/cli/{index-98j268bh.js → index-nq6evkky.js} +4 -4
  54. package/dist/cli/{index-hw8w4mkh.js → index-pppczpa6.js} +41 -41
  55. package/dist/cli/{index-010en5sq.js → index-q4vf9k47.js} +1 -1
  56. package/dist/cli/{index-qj7ewgrf.js → index-qd5pnbz9.js} +8 -8
  57. package/dist/cli/{index-ptp6d5mm.js → index-s5ek7jdr.js} +11 -11
  58. package/dist/cli/{index-w12y73z5.js → index-sqksezk4.js} +1 -1
  59. package/dist/cli/{index-ezttvjcf.js → index-tnt9dnvm.js} +7 -7
  60. package/dist/cli/{index-j42256hj.js → index-w3fyzw3s.js} +1 -1
  61. package/dist/cli/{index-vvajq163.js → index-y8prb5a1.js} +3 -3
  62. package/dist/cli/{index-6cjpmvpa.js → index-y9wsfekf.js} +1 -1
  63. package/dist/cli/{index-wrhf5apg.js → index-zyx7p0kb.js} +2 -2
  64. package/dist/cli/index.js +42 -42
  65. package/dist/cli/{knowledge-escalator-gajaew60.js → knowledge-escalator-7xdvw9qy.js} +13 -13
  66. package/dist/cli/{knowledge-events-fsbgfz4z.js → knowledge-events-hp5yr9dm.js} +11 -11
  67. package/dist/cli/{knowledge-link-jnnk0nmk.js → knowledge-link-5jhded41.js} +5 -5
  68. package/dist/cli/{knowledge-store-vaq1g1dx.js → knowledge-store-7erepd4t.js} +6 -6
  69. package/dist/cli/{knowledge-validator-pdr6m77a.js → knowledge-validator-ejdh74qq.js} +8 -8
  70. package/dist/cli/{mcp-5sn4e5t2.js → mcp-msrbe1bx.js} +1 -1
  71. package/dist/cli/{model-preflight-z9p55ssn.js → model-preflight-gsesc142.js} +41 -41
  72. package/dist/cli/{pending-delegations-asyc469v.js → pending-delegations-97pcsaak.js} +12 -12
  73. package/dist/cli/{pr-subscriptions-nacx8r6a.js → pr-subscriptions-p0dm693y.js} +12 -12
  74. package/dist/cli/{pr-workflow-gate-j3r636zg.js → pr-workflow-gate-y122hbd1.js} +41 -41
  75. package/dist/cli/{runner-fns4esbf.js → runner-fbmancth.js} +6 -6
  76. package/dist/cli/{scan-cursor-y9rchz83.js → scan-cursor-yp2kvnjz.js} +7 -7
  77. package/dist/cli/{schema-g377jsvv.js → schema-0jatfw66.js} +1 -1
  78. package/dist/cli/{scope-persistence-dtympt37.js → scope-persistence-hqw7br2s.js} +15 -15
  79. package/dist/cli/{server-n51pvxds.js → server-kyqq4pan.js} +41 -41
  80. package/dist/cli/{skill-generator-k3hnf8xx.js → skill-generator-0hbmdy2p.js} +15 -15
  81. package/dist/cli/{snapshot-coordination-init-k1f93806.js → snapshot-coordination-init-akt1wad4.js} +41 -41
  82. package/dist/cli/{speckit-checkoff-w7qbrzph.js → speckit-checkoff-rnfy30qb.js} +4 -4
  83. package/dist/cli/{telemetry-n6y2sjhg.js → telemetry-3bjvjbcp.js} +1 -1
  84. package/dist/cli/{workspace-snapshot-1sa8m2ea.js → workspace-snapshot-hcgztg7w.js} +3 -3
  85. package/dist/cli/{worktree-collision-ownership-4yxah5wy.js → worktree-collision-ownership-q4604rmc.js} +13 -13
  86. package/dist/cli/{worktree-isolation-p0pz81a1.js → worktree-isolation-5bafpzf9.js} +41 -41
  87. package/dist/index.d.ts +21 -0
  88. package/dist/index.js +11 -11
  89. package/dist/review/evidence.d.ts +8 -4
  90. package/dist/services/cost-accounting.d.ts +21 -12
  91. package/package.json +1 -1
  92. package/dist/cli/curator-llm-factory-29cswvhr.js +0 -81
  93. package/dist/cli/guardrail-explain-yfd11za1.js +0 -82
@@ -8,13 +8,13 @@ import {
8
8
  protectedRoots,
9
9
  redactDecisionLineForArchive,
10
10
  stableCanonicalStringify
11
- } from "./index-vvajq163.js";
11
+ } from "./index-y8prb5a1.js";
12
12
  import {
13
13
  detectStraySwarmDirs,
14
14
  readDoctorArtifact,
15
15
  removeStraySwarmDir,
16
16
  runConfigDoctor
17
- } from "./index-hmwnegkz.js";
17
+ } from "./index-8r96zar7.js";
18
18
  import {
19
19
  archiveEvidence,
20
20
  checkRequirementCoverage,
@@ -26,7 +26,7 @@ import {
26
26
  sanitizeTaskId,
27
27
  saveEvidence,
28
28
  validateProjectRoot
29
- } from "./index-chaa1v0b.js";
29
+ } from "./index-g7rp7200.js";
30
30
  import {
31
31
  LANGUAGE_REGISTRY,
32
32
  _internals as _internals3,
@@ -44,7 +44,7 @@ import {
44
44
  runEvaluation,
45
45
  runExternalTool,
46
46
  withDisposableWorktree
47
- } from "./index-w12y73z5.js";
47
+ } from "./index-sqksezk4.js";
48
48
  import {
49
49
  EvaluationTaskV1Schema,
50
50
  GateAuditManifestV1Schema,
@@ -61,7 +61,7 @@ import {
61
61
  saveGateAuditResult,
62
62
  savePromotionDecision,
63
63
  saveTaskSetSnapshot
64
- } from "./index-92y6cpqn.js";
64
+ } from "./index-h8pb617g.js";
65
65
  import {
66
66
  canonicalHash,
67
67
  canonicalJson,
@@ -77,7 +77,7 @@ import {
77
77
  alreadyCuratedThisGeneration,
78
78
  claimNextScanBatch,
79
79
  resolveCohortId
80
- } from "./index-xe34ymp8.js";
80
+ } from "./index-8n2emawn.js";
81
81
  import {
82
82
  CURATOR_CONSOLIDATION_PROMPT,
83
83
  CURATOR_INIT_PROMPT,
@@ -96,13 +96,13 @@ import {
96
96
  getGroupCommitWriter,
97
97
  importLegacyJsonl,
98
98
  readPriorDriftReports
99
- } from "./index-0t61279z.js";
99
+ } from "./index-70m4cxys.js";
100
100
  import {
101
101
  assertNoUnsettledCoderDispatch,
102
102
  listCoderSettlementWalStates,
103
103
  recoverCoderSettlement,
104
104
  recoverStaleCoderSettlements
105
- } from "./index-4h6e73bx.js";
105
+ } from "./index-k3gz8b6j.js";
106
106
  import {
107
107
  BUNDLED_PROJECT_SKILL_ROOT,
108
108
  DEFAULT_SKILL_MIN_CONFIDENCE,
@@ -123,11 +123,11 @@ import {
123
123
  retireSkill,
124
124
  selectCandidateEntries,
125
125
  syncBundledProjectSkillsIfMissingAsync
126
- } from "./index-mnb1pg1n.js";
126
+ } from "./index-mqc6phah.js";
127
127
  import {
128
128
  buildEscalationBriefing,
129
129
  readRecentEscalations
130
- } from "./index-qg0nhcke.js";
130
+ } from "./index-3w0v6n9x.js";
131
131
  import {
132
132
  parsePorcelainV2Snapshot,
133
133
  resolveCommitCountSince,
@@ -155,7 +155,7 @@ import {
155
155
  resolveRemoteUrlIdentity,
156
156
  resolveRemoteUrlIdentityAsync,
157
157
  switchPrFeedbackTrackingCandidateAsync
158
- } from "./index-9z9g1897.js";
158
+ } from "./index-5z1xrkaa.js";
159
159
  import {
160
160
  buildCorrelationId,
161
161
  buildIssueUrl,
@@ -176,12 +176,12 @@ import {
176
176
  sweepStale,
177
177
  unsubscribe,
178
178
  updateSnapshot
179
- } from "./index-dbcwvc1v.js";
179
+ } from "./index-1m3502g5.js";
180
180
  import {
181
181
  WORKTREE_LIFECYCLE_LOCK_FILE,
182
182
  recordWorktreeProvisioningOwner,
183
183
  removeWorktreeProvisioningOwner
184
- } from "./index-wrhf5apg.js";
184
+ } from "./index-zyx7p0kb.js";
185
185
  import {
186
186
  getLanguageForExtension
187
187
  } from "./index-pt7h91zc.js";
@@ -194,7 +194,7 @@ import {
194
194
  checkpoint,
195
195
  createSwarmTool,
196
196
  resolveWorkingDirectory
197
- } from "./index-syt8wykh.js";
197
+ } from "./index-js4spqjf.js";
198
198
  import {
199
199
  MAX_TRANSIENT_RETRIES,
200
200
  PlanRecoverySupersededError,
@@ -222,7 +222,7 @@ import {
222
222
  transientBackoff,
223
223
  updateTaskStatus,
224
224
  withPlanLifecycleLock
225
- } from "./index-ptp6d5mm.js";
225
+ } from "./index-s5ek7jdr.js";
226
226
  import {
227
227
  containsControlChars,
228
228
  containsPathTraversal,
@@ -238,7 +238,7 @@ import {
238
238
  resolveSpeckitProjection,
239
239
  validateSpeckit,
240
240
  writeProjectedSpecSync
241
- } from "./index-8jq3jsas.js";
241
+ } from "./index-hdeqj1k4.js";
242
242
  import {
243
243
  clearWorktreeMergeStatus,
244
244
  getAllWorktreeMergeFailures,
@@ -269,7 +269,7 @@ import {
269
269
  transitionTaskWorkflowEvidenceWithStatus,
270
270
  withTaskEvidenceTransaction,
271
271
  writeWorkflowWalFile
272
- } from "./index-98j268bh.js";
272
+ } from "./index-nq6evkky.js";
273
273
  import {
274
274
  isPathUnderSwarmWorktreeBase,
275
275
  listLiveLaneOwners,
@@ -278,7 +278,7 @@ import {
278
278
  recordLiveLaneOwner,
279
279
  removeWorktree,
280
280
  resolveWorktreeBaseDir
281
- } from "./index-4z0zdcd7.js";
281
+ } from "./index-5cybjkj0.js";
282
282
  import {
283
283
  DEFAULT_STALE_DELEGATION_TIMEOUT_MS,
284
284
  DELEGATION_COMPACTION_HIGH_WATER_BYTES,
@@ -312,7 +312,7 @@ import {
312
312
  scanBackgroundCoderReservationsForAdmission,
313
313
  scanDelegationsForRecovery,
314
314
  sweepStaleDelegations
315
- } from "./index-ezttvjcf.js";
315
+ } from "./index-tnt9dnvm.js";
316
316
  import {
317
317
  MAX_EVENT_LOG_ENTRIES,
318
318
  _internals,
@@ -331,7 +331,7 @@ import {
331
331
  recordKnowledgeEvent,
332
332
  recordPhaseCloseIntent,
333
333
  resolveKnowledgeEventsPath
334
- } from "./index-qj7ewgrf.js";
334
+ } from "./index-qd5pnbz9.js";
335
335
  import {
336
336
  estimateCharsForTokens,
337
337
  estimateTokens,
@@ -339,7 +339,7 @@ import {
339
339
  readSwarmFileAsync,
340
340
  safeHook,
341
341
  validateSwarmPath
342
- } from "./index-5v1sqv3m.js";
342
+ } from "./index-j2m9q6w1.js";
343
343
  import {
344
344
  bunFile,
345
345
  bunSpawn,
@@ -359,18 +359,18 @@ import {
359
359
  validateActionableFields,
360
360
  validateLesson,
361
361
  validateSkillPath
362
- } from "./index-jwkybwv0.js";
362
+ } from "./index-f2mtzrsr.js";
363
363
  import {
364
364
  MAX_CURATION_PROPOSALS,
365
365
  authorizeCuration,
366
366
  buildConfigFingerprintInput
367
- } from "./index-bpqw4n2f.js";
367
+ } from "./index-98hksf1k.js";
368
368
  import {
369
369
  cohortConfigFingerprint
370
370
  } from "./index-rtry5xyf.js";
371
371
  import {
372
372
  resolveWorktreeIsolationConfig
373
- } from "./index-hq9f7fwf.js";
373
+ } from "./index-g23nwtfq.js";
374
374
  import {
375
375
  RetrospectiveEvidenceSchema
376
376
  } from "./index-frcemc0b.js";
@@ -382,7 +382,7 @@ import {
382
382
  clearScopeBindings,
383
383
  readAuthoritativeScopeBindingSet,
384
384
  readDeclaredScopeFilesFromBindings
385
- } from "./index-8fnayk3x.js";
385
+ } from "./index-3h80xyek.js";
386
386
  import {
387
387
  clearPlanLedgerForReset,
388
388
  computePlanStructureHash,
@@ -398,7 +398,7 @@ import {
398
398
  replayFromLedgerWithStatus,
399
399
  resolvePlanningProfile,
400
400
  takeSnapshotEvent
401
- } from "./index-ay508kfq.js";
401
+ } from "./index-n8aep8en.js";
402
402
  import {
403
403
  CORE_EVENT_LOCKED,
404
404
  appendCoreEventSync,
@@ -408,7 +408,7 @@ import {
408
408
  hasSpecDriftAuditEvent,
409
409
  hasTaskRepairAuditEvent,
410
410
  readCoreEvents
411
- } from "./index-y7s92gte.js";
411
+ } from "./index-kbcx6rqh.js";
412
412
  import {
413
413
  DEFAULT_QA_GATES,
414
414
  computeProfileHash,
@@ -416,7 +416,7 @@ import {
416
416
  getEffectiveGates,
417
417
  getProfileLookupForIdentity,
418
418
  setGatesForIdentity
419
- } from "./index-010en5sq.js";
419
+ } from "./index-q4vf9k47.js";
420
420
  import {
421
421
  MAX_COORDINATION_STATE_LIST_ROWS,
422
422
  deleteCoordinationImports,
@@ -427,7 +427,7 @@ import {
427
427
  listCoordinationStates,
428
428
  transitionCoordinationState,
429
429
  withCoordinationTransaction
430
- } from "./index-q9wnbz9q.js";
430
+ } from "./index-gvch83kc.js";
431
431
  import {
432
432
  DURABILITY_CLASSES,
433
433
  closeAllProjectDbs,
@@ -436,7 +436,7 @@ import {
436
436
  projectDbExists,
437
437
  projectDbPath,
438
438
  withImmediateTransaction
439
- } from "./index-t46swpqf.js";
439
+ } from "./index-mdxqv3r9.js";
440
440
  import {
441
441
  canonicalExistingFilesystemPath,
442
442
  canonicalPathForFutureIo,
@@ -456,7 +456,7 @@ import {
456
456
  observeModelLimitResolution,
457
457
  observeStoreHealth,
458
458
  readLearningHealth
459
- } from "./index-92bbwjek.js";
459
+ } from "./index-cbpggzdm.js";
460
460
  import {
461
461
  appendKnowledge,
462
462
  appendRejectedLesson,
@@ -487,7 +487,7 @@ import {
487
487
  transactFile,
488
488
  transactKnowledge,
489
489
  wordBigrams
490
- } from "./index-pe1wgpvg.js";
490
+ } from "./index-27yspj61.js";
491
491
  import {
492
492
  readTailJsonl,
493
493
  readTailJsonlDetailed,
@@ -508,13 +508,13 @@ import {
508
508
  resolveLinkDir,
509
509
  sanitizeLinkId,
510
510
  writeLinkPointer
511
- } from "./index-gjrs1epm.js";
511
+ } from "./index-8ehsv9yw.js";
512
512
  import {
513
513
  atomicWriteFile
514
- } from "./index-c5e1wr7h.js";
514
+ } from "./index-4tpwp24b.js";
515
515
  import {
516
516
  withEvidenceLock
517
- } from "./index-6cjpmvpa.js";
517
+ } from "./index-y9wsfekf.js";
518
518
  import {
519
519
  assertProjectRoot
520
520
  } from "./index-t7hmqgjy.js";
@@ -528,7 +528,7 @@ import {
528
528
  pseudonymousRef,
529
529
  resolveLineageSalt,
530
530
  telemetry
531
- } from "./index-w6w6ny06.js";
531
+ } from "./index-1f7mkb7p.js";
532
532
  import {
533
533
  SESSION_KEY_SEPARATOR,
534
534
  canonicalRootKey,
@@ -554,7 +554,7 @@ import {
554
554
  matchTempGrammar,
555
555
  parseTargetBasename,
556
556
  resetSwarmArtifactCache
557
- } from "./index-m8dry0a6.js";
557
+ } from "./index-g319bdeh.js";
558
558
  import {
559
559
  PlanSchema,
560
560
  TaskStatusSchema,
@@ -568,7 +568,7 @@ import {
568
568
  loadGateOverrides,
569
569
  loadPluginConfig,
570
570
  loadPluginConfigWithMeta
571
- } from "./index-teyvb5tr.js";
571
+ } from "./index-msejg9hk.js";
572
572
  import {
573
573
  addDeferredWarning,
574
574
  advisoryWarn,
@@ -600,7 +600,7 @@ import {
600
600
  resolveContextWindow,
601
601
  resolveGeneratedAgentRole,
602
602
  stripKnownSwarmPrefix
603
- } from "./index-nnmgg6z6.js";
603
+ } from "./index-5qbm61fh.js";
604
604
  import {
605
605
  AGENT_TOOL_MAP,
606
606
  ALL_AGENT_NAMES,
@@ -3389,7 +3389,7 @@ async function importLegacyPrWorkflowGateStateIfNeeded(directory, sessionID, all
3389
3389
  return null;
3390
3390
  throw error2;
3391
3391
  }
3392
- const legacy = allowSalvagedImport ? (await (await import("./pr-workflow-gate-j3r636zg.js")).readPrWorkflowGateStateForRecovery(directory, sessionID))?.state ?? null : await readPrWorkflowGateStateFileFromDisk(filePath, sessionID);
3392
+ const legacy = allowSalvagedImport ? (await (await import("./pr-workflow-gate-y122hbd1.js")).readPrWorkflowGateStateForRecovery(directory, sessionID))?.state ?? null : await readPrWorkflowGateStateFileFromDisk(filePath, sessionID);
3393
3393
  if (!legacy)
3394
3394
  return null;
3395
3395
  const namespace = workflowGateStateCoordinationNamespace(sessionID);
@@ -3476,7 +3476,7 @@ async function deleteStateWhileLocked(directory, sessionID, options = {}) {
3476
3476
  let recoveryState = null;
3477
3477
  if (!currentAuthoritative) {
3478
3478
  if (options.allowSalvagedRead) {
3479
- const { readPrWorkflowGateStateForRecovery } = await import("./pr-workflow-gate-j3r636zg.js");
3479
+ const { readPrWorkflowGateStateForRecovery } = await import("./pr-workflow-gate-y122hbd1.js");
3480
3480
  recoveryState = (await readPrWorkflowGateStateForRecovery(directory, normalizedSessionID))?.state ?? null;
3481
3481
  }
3482
3482
  if (!recoveryState) {
@@ -15039,7 +15039,7 @@ function isLaneOwnedByCurrentSession(branchName, expectedSessionId) {
15039
15039
  return extracted === expectedSessionId;
15040
15040
  }
15041
15041
  async function inspectStandardWorktreeCollisionOwnership(identity) {
15042
- const collisionOwnership = await import("./worktree-collision-ownership-4yxah5wy.js");
15042
+ const collisionOwnership = await import("./worktree-collision-ownership-q4604rmc.js");
15043
15043
  return collisionOwnership.inspectStandardWorktreeCollisionOwnership(identity);
15044
15044
  }
15045
15045
  async function runRecoveryGit(directory, args, timeoutMs = 15000) {
@@ -15465,7 +15465,7 @@ async function precreateStandardWorktreeSession(args) {
15465
15465
  const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, handle.worktreePath);
15466
15466
  if (laneProfile) {
15467
15467
  try {
15468
- const { writeLaneProfileToDiskReal } = await import("./core-fvsjr20m.js");
15468
+ const { writeLaneProfileToDiskReal } = await import("./core-trk38w53.js");
15469
15469
  await writeLaneProfileToDiskReal(handle.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
15470
15470
  } catch {}
15471
15471
  }
@@ -16444,7 +16444,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
16444
16444
  }
16445
16445
  clearWorktreeMergeStatus(statusKey);
16446
16446
  try {
16447
- const { removeLaneProfileFromDiskReal } = await import("./core-fvsjr20m.js");
16447
+ const { removeLaneProfileFromDiskReal } = await import("./core-trk38w53.js");
16448
16448
  await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
16449
16449
  } catch {}
16450
16450
  const state = serializationStateBySessionID.get(dispatch.parentSessionID);
@@ -24083,7 +24083,7 @@ function clearCriticalShownIds(sessionID) {
24083
24083
  async function rehydratePrSubscriptions(sessionID, directory) {
24084
24084
  const map = new Map;
24085
24085
  try {
24086
- const { listActive: listActive2 } = await import("./pr-subscriptions-nacx8r6a.js");
24086
+ const { listActive: listActive2 } = await import("./pr-subscriptions-p0dm693y.js");
24087
24087
  const records = await listActive2(directory);
24088
24088
  for (const record of records) {
24089
24089
  if (record.sessionID !== sessionID)
@@ -33926,12 +33926,27 @@ import * as fs20 from "fs";
33926
33926
  init_logger();
33927
33927
  import * as os2 from "os";
33928
33928
  import * as path32 from "path";
33929
- var ZERO_USAGE = {
33930
- tokens_input: 0,
33931
- tokens_output: 0,
33932
- tokens_reasoning: 0,
33933
- tokens_cache: 0
33929
+ var UNKNOWN_USAGE = {
33930
+ tokens_input: null,
33931
+ tokens_output: null,
33932
+ tokens_reasoning: null,
33933
+ tokens_cache: null
33934
33934
  };
33935
+ function maxKnownAxis(a, b) {
33936
+ if (a === null)
33937
+ return b;
33938
+ if (b === null)
33939
+ return a;
33940
+ return Math.max(a, b);
33941
+ }
33942
+ function sumKnownAxis(total, value) {
33943
+ if (value === null)
33944
+ return total;
33945
+ return total === null ? value : total + value;
33946
+ }
33947
+ function isUnknownUsage(usage) {
33948
+ return usage.tokens_input === null && usage.tokens_output === null && usage.tokens_reasoning === null && usage.tokens_cache === null;
33949
+ }
33935
33950
  var MAX_EVIDENCE_ITEMS = 8;
33936
33951
  var MAX_COST_STRING_LENGTH = 128;
33937
33952
  var MAX_PROVIDER_REPORTED_COST_USD = 1e9;
@@ -33940,7 +33955,7 @@ var BUNDLED_MODEL_PRICING = {};
33940
33955
  function buildDelegationCostFields(input = {}) {
33941
33956
  const evidence2 = extractCostEvidence(input.raw, input);
33942
33957
  const projection = projectCostEvidence(evidence2);
33943
- const usage = evidence2.reduce(mergeUsage, { ...ZERO_USAGE });
33958
+ const usage = evidence2.reduce(mergeUsage, { ...UNKNOWN_USAGE });
33944
33959
  const model = evidence2.find((item) => item.model)?.model ?? input.model;
33945
33960
  return {
33946
33961
  ...usage,
@@ -33970,7 +33985,7 @@ function extractCostEvidence(raw, input = {}) {
33970
33985
  model: candidate.model
33971
33986
  });
33972
33987
  }
33973
- const usage = mergeUsage(candidates.reduce(mergeUsage, { ...ZERO_USAGE }), readLegacyUsage(raw));
33988
+ const usage = mergeUsage(candidates.reduce(mergeUsage, { ...UNKNOWN_USAGE }), readLegacyUsage(raw));
33974
33989
  const model = candidates.find((candidate) => candidate.model)?.model ?? input.model;
33975
33990
  const estimate = estimateCostUsd(usage, model, input.pricing);
33976
33991
  if (estimate !== null || input.pricing?.subscription_unbilled) {
@@ -34210,7 +34225,7 @@ function readEventEvidence(event) {
34210
34225
  const kind = item.kind === "provider_reported" || item.kind === "normalized_estimate" ? item.kind : null;
34211
34226
  const sourcePath = isCostSourcePath(item.source_path) ? item.source_path : null;
34212
34227
  const amount = readBoundedReportedCost(item.amount_usd);
34213
- const usage = isRecord(item.usage) ? readPinnedTokens(item.usage) : { ...ZERO_USAGE };
34228
+ const usage = isRecord(item.usage) ? readPinnedTokens(item.usage) : { ...UNKNOWN_USAGE };
34214
34229
  if (!kind || !sourcePath)
34215
34230
  return [];
34216
34231
  return [
@@ -34237,10 +34252,10 @@ function legacyEventEvidence(event) {
34237
34252
  source_path: "legacy.cost",
34238
34253
  reason: amount === null ? "legacy" : "authoritative",
34239
34254
  usage: {
34240
- tokens_input: readFiniteNonNegative(event.tokens_input) ?? 0,
34241
- tokens_output: readFiniteNonNegative(event.tokens_output) ?? 0,
34242
- tokens_reasoning: readFiniteNonNegative(event.tokens_reasoning) ?? 0,
34243
- tokens_cache: readFiniteNonNegative(event.tokens_cache) ?? 0
34255
+ tokens_input: readFiniteNonNegative(event.tokens_input),
34256
+ tokens_output: readFiniteNonNegative(event.tokens_output),
34257
+ tokens_reasoning: readFiniteNonNegative(event.tokens_reasoning),
34258
+ tokens_cache: readFiniteNonNegative(event.tokens_cache)
34244
34259
  }
34245
34260
  }
34246
34261
  ];
@@ -34281,9 +34296,10 @@ function isCostUpgrade(current, next) {
34281
34296
  return false;
34282
34297
  if (currentProjection.cost_usd !== nextProjection.cost_usd)
34283
34298
  return true;
34284
- const currentUsage = current.reduce(mergeUsage, { ...ZERO_USAGE });
34285
- const nextUsage = next.reduce(mergeUsage, { ...ZERO_USAGE });
34286
- return Object.keys(currentUsage).some((key) => nextUsage[key] > currentUsage[key]);
34299
+ const currentUsage = current.reduce(mergeUsage, { ...UNKNOWN_USAGE });
34300
+ const nextUsage = next.reduce(mergeUsage, { ...UNKNOWN_USAGE });
34301
+ const knownValue = (value) => value === null ? Number.NEGATIVE_INFINITY : value;
34302
+ return Object.keys(currentUsage).some((key) => knownValue(nextUsage[key]) > knownValue(currentUsage[key]));
34287
34303
  }
34288
34304
  function readTelemetryEvents(directory) {
34289
34305
  const swarmDir = path32.join(directory, ".swarm");
@@ -34370,8 +34386,9 @@ function estimateCostUsd(usage, model, pricing) {
34370
34386
  const entry = table[model] ?? table[model.toLowerCase()];
34371
34387
  if (!entry)
34372
34388
  return null;
34373
- const cost = usage.tokens_input / 1e6 * entry.input_per_million + usage.tokens_output / 1e6 * entry.output_per_million + usage.tokens_reasoning / 1e6 * (entry.reasoning_per_million ?? entry.output_per_million) + usage.tokens_cache / 1e6 * (entry.cache_per_million ?? entry.input_per_million);
34374
- const hasUsage = Object.values(usage).some((value) => value > 0);
34389
+ const perMillion = (value, rate) => (value ?? 0) / 1e6 * rate;
34390
+ const cost = perMillion(usage.tokens_input, entry.input_per_million) + perMillion(usage.tokens_output, entry.output_per_million) + perMillion(usage.tokens_reasoning, entry.reasoning_per_million ?? entry.output_per_million) + perMillion(usage.tokens_cache, entry.cache_per_million ?? entry.input_per_million);
34391
+ const hasUsage = Object.values(usage).some((value) => value !== null && value > 0);
34375
34392
  return hasUsage && Number.isFinite(cost) && cost >= 0 ? cost : null;
34376
34393
  }
34377
34394
  function collectPinnedCandidates(raw, input) {
@@ -34446,15 +34463,15 @@ function collectPinnedCandidates(raw, input) {
34446
34463
  function readPinnedTokens(record) {
34447
34464
  const tokens = isRecord(record.tokens) ? record.tokens : isRecord(record.usage) ? record.usage : record;
34448
34465
  return {
34449
- tokens_input: readFiniteNonNegative(tokens.tokens_input ?? tokens.input ?? tokens.input_tokens ?? tokens.prompt_tokens) ?? 0,
34450
- tokens_output: readFiniteNonNegative(tokens.tokens_output ?? tokens.output ?? tokens.output_tokens ?? tokens.completion_tokens) ?? 0,
34451
- tokens_reasoning: readFiniteNonNegative(tokens.tokens_reasoning ?? tokens.reasoning ?? tokens.reasoning_tokens) ?? 0,
34452
- tokens_cache: readFiniteNonNegative(tokens.tokens_cache) ?? readCacheTokens(tokens) ?? 0
34466
+ tokens_input: readFiniteNonNegative(tokens.tokens_input ?? tokens.input ?? tokens.input_tokens ?? tokens.prompt_tokens) ?? null,
34467
+ tokens_output: readFiniteNonNegative(tokens.tokens_output ?? tokens.output ?? tokens.output_tokens ?? tokens.completion_tokens) ?? null,
34468
+ tokens_reasoning: readFiniteNonNegative(tokens.tokens_reasoning ?? tokens.reasoning ?? tokens.reasoning_tokens) ?? null,
34469
+ tokens_cache: readFiniteNonNegative(tokens.tokens_cache) ?? readCacheTokens(tokens) ?? null
34453
34470
  };
34454
34471
  }
34455
34472
  function readLegacyUsage(raw) {
34456
34473
  if (!isRecord(raw))
34457
- return { ...ZERO_USAGE };
34474
+ return { ...UNKNOWN_USAGE };
34458
34475
  const output = isRecord(raw.output) ? raw.output : raw;
34459
34476
  const usage = isRecord(output.usage) ? output.usage : output;
34460
34477
  return readPinnedTokens(usage);
@@ -34462,10 +34479,10 @@ function readLegacyUsage(raw) {
34462
34479
  function mergeUsage(total, next) {
34463
34480
  const usage = "usage" in next && next.usage ? next.usage : next;
34464
34481
  return {
34465
- tokens_input: Math.max(total.tokens_input, usage.tokens_input),
34466
- tokens_output: Math.max(total.tokens_output, usage.tokens_output),
34467
- tokens_reasoning: Math.max(total.tokens_reasoning, usage.tokens_reasoning),
34468
- tokens_cache: Math.max(total.tokens_cache, usage.tokens_cache)
34482
+ tokens_input: maxKnownAxis(total.tokens_input, usage.tokens_input),
34483
+ tokens_output: maxKnownAxis(total.tokens_output, usage.tokens_output),
34484
+ tokens_reasoning: maxKnownAxis(total.tokens_reasoning, usage.tokens_reasoning),
34485
+ tokens_cache: maxKnownAxis(total.tokens_cache, usage.tokens_cache)
34469
34486
  };
34470
34487
  }
34471
34488
  function readFiniteNonNegative(value) {
@@ -34564,12 +34581,13 @@ function createEmptySummary() {
34564
34581
  total_cost_usd: 0,
34565
34582
  total_reported_usd: 0,
34566
34583
  total_estimated_usd: 0,
34567
- total_input_tokens: 0,
34568
- total_output_tokens: 0,
34569
- total_reasoning_tokens: 0,
34570
- total_cache_tokens: 0,
34584
+ total_input_tokens: null,
34585
+ total_output_tokens: null,
34586
+ total_reasoning_tokens: null,
34587
+ total_cache_tokens: null,
34571
34588
  delegations: 0,
34572
34589
  unavailable_delegations: 0,
34590
+ unknown_usage_delegations: 0,
34573
34591
  by_agent: [],
34574
34592
  by_task: [],
34575
34593
  by_gate: [],
@@ -34611,24 +34629,26 @@ function addDelegationEvent(summary, event) {
34611
34629
  summary.currencies.push(item.currency);
34612
34630
  }
34613
34631
  const legacyUsage = {
34614
- tokens_input: readNumber(event, ["tokens_input"]) ?? 0,
34615
- tokens_output: readNumber(event, ["tokens_output"]) ?? 0,
34616
- tokens_reasoning: readNumber(event, ["tokens_reasoning"]) ?? 0,
34617
- tokens_cache: readNumber(event, ["tokens_cache"]) ?? 0
34632
+ tokens_input: readNumber(event, ["tokens_input"]),
34633
+ tokens_output: readNumber(event, ["tokens_output"]),
34634
+ tokens_reasoning: readNumber(event, ["tokens_reasoning"]),
34635
+ tokens_cache: readNumber(event, ["tokens_cache"])
34618
34636
  };
34619
34637
  const evidenceUsage = evidence2.reduce((acc, item) => ({
34620
- tokens_input: Math.max(acc.tokens_input, item.usage.tokens_input),
34621
- tokens_output: Math.max(acc.tokens_output, item.usage.tokens_output),
34622
- tokens_reasoning: Math.max(acc.tokens_reasoning, item.usage.tokens_reasoning),
34623
- tokens_cache: Math.max(acc.tokens_cache, item.usage.tokens_cache)
34624
- }), { ...ZERO_USAGE });
34638
+ tokens_input: maxKnownAxis(acc.tokens_input, item.usage.tokens_input),
34639
+ tokens_output: maxKnownAxis(acc.tokens_output, item.usage.tokens_output),
34640
+ tokens_reasoning: maxKnownAxis(acc.tokens_reasoning, item.usage.tokens_reasoning),
34641
+ tokens_cache: maxKnownAxis(acc.tokens_cache, item.usage.tokens_cache)
34642
+ }), { ...UNKNOWN_USAGE });
34625
34643
  const usage = hasRecord ? evidenceUsage : legacyUsage;
34626
34644
  summary.delegations++;
34627
34645
  summary.total_cost_usd += cost;
34628
- summary.total_input_tokens += usage.tokens_input;
34629
- summary.total_output_tokens += usage.tokens_output;
34630
- summary.total_reasoning_tokens += usage.tokens_reasoning;
34631
- summary.total_cache_tokens += usage.tokens_cache;
34646
+ if (isUnknownUsage(usage))
34647
+ summary.unknown_usage_delegations++;
34648
+ summary.total_input_tokens = sumKnownAxis(summary.total_input_tokens, usage.tokens_input);
34649
+ summary.total_output_tokens = sumKnownAxis(summary.total_output_tokens, usage.tokens_output);
34650
+ summary.total_reasoning_tokens = sumKnownAxis(summary.total_reasoning_tokens, usage.tokens_reasoning);
34651
+ summary.total_cache_tokens = sumKnownAxis(summary.total_cache_tokens, usage.tokens_cache);
34632
34652
  summary.by_source[costSource].delegations++;
34633
34653
  summary.by_source[costSource].cost_usd += cost;
34634
34654
  if (costSource === "reported")
@@ -34665,20 +34685,20 @@ function addRow(rows, name, input) {
34665
34685
  name,
34666
34686
  delegations: 0,
34667
34687
  cost_usd: 0,
34668
- input_tokens: 0,
34669
- output_tokens: 0,
34670
- reasoning_tokens: 0,
34671
- cache_tokens: 0,
34688
+ input_tokens: null,
34689
+ output_tokens: null,
34690
+ reasoning_tokens: null,
34691
+ cache_tokens: null,
34672
34692
  unavailable_delegations: 0
34673
34693
  };
34674
34694
  rows.push(row);
34675
34695
  }
34676
34696
  row.delegations++;
34677
34697
  row.cost_usd += input.cost;
34678
- row.input_tokens += input.usage.tokens_input;
34679
- row.output_tokens += input.usage.tokens_output;
34680
- row.reasoning_tokens += input.usage.tokens_reasoning;
34681
- row.cache_tokens += input.usage.tokens_cache;
34698
+ row.input_tokens = sumKnownAxis(row.input_tokens, input.usage.tokens_input);
34699
+ row.output_tokens = sumKnownAxis(row.output_tokens, input.usage.tokens_output);
34700
+ row.reasoning_tokens = sumKnownAxis(row.reasoning_tokens, input.usage.tokens_reasoning);
34701
+ row.cache_tokens = sumKnownAxis(row.cache_tokens, input.usage.tokens_cache);
34682
34702
  if (input.costSource === "unavailable")
34683
34703
  row.unavailable_delegations++;
34684
34704
  }
@@ -34687,6 +34707,12 @@ function finalizeSummary(summary) {
34687
34707
  summary.total_reported_usd = roundUsd(summary.total_reported_usd);
34688
34708
  summary.total_estimated_usd = roundUsd(summary.total_estimated_usd);
34689
34709
  summary.total_legacy_usd = roundUsd(summary.total_legacy_usd);
34710
+ if (summary.delegations === 0) {
34711
+ summary.total_input_tokens ??= 0;
34712
+ summary.total_output_tokens ??= 0;
34713
+ summary.total_reasoning_tokens ??= 0;
34714
+ summary.total_cache_tokens ??= 0;
34715
+ }
34690
34716
  for (const source of Object.values(summary.by_source)) {
34691
34717
  source.cost_usd = roundUsd(source.cost_usd);
34692
34718
  }
@@ -40494,9 +40520,9 @@ function hashContent(content) {
40494
40520
  return createHash27("sha1").update(content).digest("hex");
40495
40521
  }
40496
40522
  async function loadConfigForPolicyCurator(directory) {
40497
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-g377jsvv.js");
40523
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-0jatfw66.js");
40498
40524
  try {
40499
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-xkxt1b08.js");
40525
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-a07nc99k.js");
40500
40526
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
40501
40527
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
40502
40528
  } catch {
@@ -43554,7 +43580,7 @@ async function resolveCuratorLLMDelegate(directory, mode, sessionId) {
43554
43580
  const seam = _internals38.createCuratorLLMDelegate;
43555
43581
  if (seam)
43556
43582
  return seam(directory, mode, sessionId);
43557
- const { createCuratorLLMDelegate } = await import("./curator-llm-factory-29cswvhr.js");
43583
+ const { createCuratorLLMDelegate } = await import("./curator-llm-factory-a1hy89ea.js");
43558
43584
  return createCuratorLLMDelegate(directory, mode, sessionId);
43559
43585
  }
43560
43586
  async function reconcileCloseTerminalStateForPlan(directory, targetPlan, options) {
@@ -43949,7 +43975,7 @@ async function runFinalizeStage(ctx) {
43949
43975
  }
43950
43976
  }
43951
43977
  try {
43952
- const { CuratorConfigSchema: CCS } = await import("./schema-g377jsvv.js");
43978
+ const { CuratorConfigSchema: CCS } = await import("./schema-0jatfw66.js");
43953
43979
  const { config: pmLoadedConfig } = _internals38.loadPluginConfigWithMeta(ctx.directory);
43954
43980
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
43955
43981
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -46135,7 +46161,7 @@ function serializeAgentSession(s) {
46135
46161
  }
46136
46162
  async function writeSnapshot(directory, state) {
46137
46163
  try {
46138
- const { ensureSnapshotCoordinationReady } = await import("./snapshot-coordination-init-k1f93806.js");
46164
+ const { ensureSnapshotCoordinationReady } = await import("./snapshot-coordination-init-akt1wad4.js");
46139
46165
  await ensureSnapshotCoordinationReady(directory);
46140
46166
  const snapshot = {
46141
46167
  version: 3,
@@ -49313,7 +49339,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
49313
49339
  };
49314
49340
  }
49315
49341
  async function sweepActiveNearDuplicates(directory, options = {}) {
49316
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-xkxt1b08.js");
49342
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-a07nc99k.js");
49317
49343
  const { config } = loadPluginConfigWithMeta2(directory);
49318
49344
  const sweepConfig = config.learning?.dedup_sweep;
49319
49345
  if (sweepConfig?.enabled === false)
@@ -50437,7 +50463,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
50437
50463
  }
50438
50464
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
50439
50465
  try {
50440
- const skillModule = await import("./skill-generator-k3hnf8xx.js");
50466
+ const skillModule = await import("./skill-generator-0hbmdy2p.js");
50441
50467
  for (const cand of skillCandidates) {
50442
50468
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
50443
50469
  continue;
@@ -50909,7 +50935,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
50909
50935
  } catch {}
50910
50936
  }
50911
50937
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
50912
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-gajaew60.js");
50938
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-7xdvw9qy.js");
50913
50939
  for (const { id } of contradictedEntries) {
50914
50940
  try {
50915
50941
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -51741,7 +51767,7 @@ async function runCuratorPostMortem(directory, options = {}) {
51741
51767
  warnings.push("Failed to collect knowledge summary.");
51742
51768
  }
51743
51769
  try {
51744
- const { getScanStatus } = await import("./scan-cursor-y9rchz83.js");
51770
+ const { getScanStatus } = await import("./scan-cursor-yp2kvnjz.js");
51745
51771
  const scanStatus = await getScanStatus(directory);
51746
51772
  if (scanStatus.remaining_estimate > 0) {
51747
51773
  warnings.push(`Fair scan: reviewed ${knowledgeSummary.length} entries this sweep (generation ${scanStatus.generation}); ${scanStatus.remaining_estimate} more eligible entries will be visited in future curation sweeps.`);
@@ -51913,9 +51939,9 @@ var _internals57 = {
51913
51939
  verifyPostMortemKnowledgeActions,
51914
51940
  repairPostMortemActions,
51915
51941
  loadDefaultKnowledgeConfig: async (directory) => {
51916
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-g377jsvv.js");
51942
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-0jatfw66.js");
51917
51943
  try {
51918
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-xkxt1b08.js");
51944
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-a07nc99k.js");
51919
51945
  const loaded = loadPluginConfigWithMeta2(directory);
51920
51946
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
51921
51947
  } catch {
@@ -51923,11 +51949,11 @@ var _internals57 = {
51923
51949
  }
51924
51950
  },
51925
51951
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
51926
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-h7j1xse4.js");
51952
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-yvp2e7tk.js");
51927
51953
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
51928
51954
  },
51929
51955
  checkHivePromotions: async (entries2, knowledgeConfig, directory) => {
51930
- const { checkHivePromotions } = await import("./hive-promoter-632ewk29.js");
51956
+ const { checkHivePromotions } = await import("./hive-promoter-68prvn82.js");
51931
51957
  return checkHivePromotions(entries2, knowledgeConfig, directory);
51932
51958
  },
51933
51959
  applyProposalTriage: async (directory, triage) => {
@@ -51936,7 +51962,7 @@ var _internals57 = {
51936
51962
  activateProposal,
51937
51963
  listSkills: listSkills2,
51938
51964
  sanitizeSlug
51939
- } = await import("./skill-generator-k3hnf8xx.js");
51965
+ } = await import("./skill-generator-0hbmdy2p.js");
51940
51966
  const result = {
51941
51967
  approved: [],
51942
51968
  rejected: [],
@@ -51978,7 +52004,7 @@ var _internals57 = {
51978
52004
  return result;
51979
52005
  },
51980
52006
  readPriorDriftReports: async (directory) => {
51981
- const { readPriorDriftReports: readPriorDriftReports2 } = await import("./curator-drift-t150w08d.js");
52007
+ const { readPriorDriftReports: readPriorDriftReports2 } = await import("./curator-drift-b6cjgsq3.js");
51982
52008
  return readPriorDriftReports2(directory);
51983
52009
  },
51984
52010
  readSwarmKnowledge: (directory) => readKnowledge(resolveSwarmKnowledgePath(directory))
@@ -60422,7 +60448,7 @@ function wireCloseInternals() {
60422
60448
  archiveEvidence,
60423
60449
  endAgentSession,
60424
60450
  flushAndDrainTelemetry: async () => {
60425
- const { flushAndDrainTelemetry } = await import("./telemetry-n6y2sjhg.js");
60451
+ const { flushAndDrainTelemetry } = await import("./telemetry-3bjvjbcp.js");
60426
60452
  return flushAndDrainTelemetry();
60427
60453
  },
60428
60454
  finalizeContextTelemetry,
@@ -60951,7 +60977,8 @@ function renderCostSummary(summary) {
60951
60977
  "",
60952
60978
  `Total tracked cost: ${formatUsd(summary.total_cost_usd)}`,
60953
60979
  `Delegations: ${summary.delegations}`,
60954
- `Tokens: input ${summary.total_input_tokens.toLocaleString()}, output ${summary.total_output_tokens.toLocaleString()}, reasoning ${summary.total_reasoning_tokens.toLocaleString()}, cache ${summary.total_cache_tokens.toLocaleString()}`,
60980
+ `Tokens: input ${formatTokens(summary.total_input_tokens)}, output ${formatTokens(summary.total_output_tokens)}, reasoning ${formatTokens(summary.total_reasoning_tokens)}, cache ${formatTokens(summary.total_cache_tokens)}`,
60981
+ `Unknown usage: ${summary.unknown_usage_delegations}`,
60955
60982
  `Cost source: reported ${formatUsd(summary.total_reported_usd)}, estimated ${formatUsd(summary.total_estimated_usd)}, unavailable ${summary.unavailable_delegations}`,
60956
60983
  `Evidence: ${summary.evidence_status}; joins missed ${summary.join_miss_count}; telemetry errors ${summary.telemetry_error_count}; corrections accepted ${summary.accepted_corrections}, rejected ${summary.rejected_corrections}, duplicate ${summary.duplicate_corrections}`,
60957
60984
  "",
@@ -60974,9 +61001,12 @@ function appendCostRows(lines, label, rows, emptyMessage) {
60974
61001
  }
60975
61002
  lines.push(`| ${label} | Delegations | Cost | Input | Output | Reasoning | Cache | Unavailable |`, "|------|-------------|------|-------|--------|-----------|-------|-------------|");
60976
61003
  for (const row of rows) {
60977
- lines.push(`| ${row.name} | ${row.delegations} | ${formatUsd(row.cost_usd)} | ${row.input_tokens.toLocaleString()} | ${row.output_tokens.toLocaleString()} | ${row.reasoning_tokens.toLocaleString()} | ${row.cache_tokens.toLocaleString()} | ${row.unavailable_delegations} |`);
61004
+ lines.push(`| ${row.name} | ${row.delegations} | ${formatUsd(row.cost_usd)} | ${formatTokens(row.input_tokens)} | ${formatTokens(row.output_tokens)} | ${formatTokens(row.reasoning_tokens)} | ${formatTokens(row.cache_tokens)} | ${row.unavailable_delegations} |`);
60978
61005
  }
60979
61006
  }
61007
+ function formatTokens(value) {
61008
+ return value === null ? "unknown" : value.toLocaleString();
61009
+ }
60980
61010
  function formatUsd(value) {
60981
61011
  return `$${value.toFixed(6)}`;
60982
61012
  }
@@ -61774,9 +61804,9 @@ var _internals67 = {
61774
61804
  loadPluginConfigWithMeta,
61775
61805
  loadCuratorDeps: async () => {
61776
61806
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate }] = await Promise.all([
61777
- import("./schema-g377jsvv.js"),
61778
- import("./curator-h7j1xse4.js"),
61779
- import("./curator-llm-factory-29cswvhr.js")
61807
+ import("./schema-0jatfw66.js"),
61808
+ import("./curator-yvp2e7tk.js"),
61809
+ import("./curator-llm-factory-a1hy89ea.js")
61780
61810
  ]);
61781
61811
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate };
61782
61812
  }
@@ -64169,7 +64199,7 @@ async function computeCurationDiagnostics(directory, entries2) {
64169
64199
  let scanCompleted = false;
64170
64200
  let scanRemaining = 0;
64171
64201
  try {
64172
- const { getScanStatus } = await import("./scan-cursor-y9rchz83.js");
64202
+ const { getScanStatus } = await import("./scan-cursor-yp2kvnjz.js");
64173
64203
  const status = await getScanStatus(directory);
64174
64204
  scanGeneration = status.generation;
64175
64205
  scanCompleted = status.completed;
@@ -64177,19 +64207,19 @@ async function computeCurationDiagnostics(directory, entries2) {
64177
64207
  } catch {}
64178
64208
  let configMatch = null;
64179
64209
  try {
64180
- const { isLinked: isLinked2 } = await import("./knowledge-link-jnnk0nmk.js");
64210
+ const { isLinked: isLinked2 } = await import("./knowledge-link-5jhded41.js");
64181
64211
  if (isLinked2(directory)) {
64182
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-g377jsvv.js");
64212
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-0jatfw66.js");
64183
64213
  let config;
64184
64214
  try {
64185
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-xkxt1b08.js");
64215
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-a07nc99k.js");
64186
64216
  const loaded = loadPluginConfigWithMeta2(directory);
64187
64217
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
64188
64218
  } catch {
64189
64219
  config = KnowledgeConfigSchema2.parse({});
64190
64220
  }
64191
64221
  const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
64192
- const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-pxwagyh7.js");
64222
+ const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-1zdsb3h0.js");
64193
64223
  const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
64194
64224
  const cohortFp = await readCohortConfigFingerprint(directory);
64195
64225
  configMatch = cohortFp === null ? null : currentFp === cohortFp;
@@ -65637,7 +65667,7 @@ async function handleDoctorCommand(directory, args) {
65637
65667
  const result = runConfigDoctor(config, directory);
65638
65668
  let output;
65639
65669
  if (enableAutoFix && result.hasAutoFixableIssues) {
65640
- const { runConfigDoctorWithFixes } = await import("./config-doctor-mj4ae4jn.js");
65670
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-17yft6hp.js");
65641
65671
  const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
65642
65672
  applyLossy: true
65643
65673
  });
@@ -65675,7 +65705,7 @@ async function handleDoctorCommand(directory, args) {
65675
65705
  `;
65676
65706
  }
65677
65707
  try {
65678
- const { runModelPreflight } = await import("./model-preflight-z9p55ssn.js");
65708
+ const { runModelPreflight } = await import("./model-preflight-gsesc142.js");
65679
65709
  const preflight = await runModelPreflight(config, swarmState.opencodeClient, { generatedAgentNames: swarmState.generatedAgentNames });
65680
65710
  const missingSelection = preflight.resolutions.filter((resolution) => resolution.status === "missing-selection");
65681
65711
  const unresolved = preflight.catalogAvailable ? preflight.resolutions.filter((resolution) => resolution.status === "unresolved") : [];
@@ -66602,7 +66632,7 @@ async function handleEvidenceCommand(directory, args) {
66602
66632
  return formatTaskEvidenceMarkdown(evidenceData);
66603
66633
  }
66604
66634
  async function handleEvidenceSummaryCommand(directory) {
66605
- const { buildEvidenceSummary } = await import("./evidence-summary-service-h42y6hwq.js");
66635
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-9vh0t896.js");
66606
66636
  const artifact = await buildEvidenceSummary(directory);
66607
66637
  if (!artifact) {
66608
66638
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -90935,7 +90965,7 @@ function createCuratorLLMDelegate(directory, mode = "init", sessionId) {
90935
90965
  }
90936
90966
  const sdkOpts = signal ? { signal } : {};
90937
90967
  try {
90938
- const { getSwarmAgents: getSwarmAgents2, resolveFallbackModel: resolveFallbackModel2 } = await import("./index-hw8w4mkh.js");
90968
+ const { getSwarmAgents: getSwarmAgents2, resolveFallbackModel: resolveFallbackModel2 } = await import("./index-pppczpa6.js");
90939
90969
  const createResult = await client.session.create({
90940
90970
  ...sessionId ? {
90941
90971
  body: {
@@ -93272,7 +93302,7 @@ async function cancelPrFeedbackLoopUnlocked(directory, sessionID, reason) {
93272
93302
  clearedEvents: []
93273
93303
  };
93274
93304
  try {
93275
- const { cancelPrFeedbackPublication: cancelPrFeedbackPublication2 } = await import("./pr-workflow-gate-j3r636zg.js");
93305
+ const { cancelPrFeedbackPublication: cancelPrFeedbackPublication2 } = await import("./pr-workflow-gate-y122hbd1.js");
93276
93306
  await cancelPrFeedbackPublication2(directory, sessionID, reason);
93277
93307
  } catch (err) {
93278
93308
  warn(`[pr-feedback-loop] cancelPrFeedbackPublication failed (fail-open): ${err instanceof Error ? err.message : String(err)}`);
@@ -104457,6 +104487,11 @@ async function dispatchReviewerWithFallback(input, prompt, timeoutMs, promptByte
104457
104487
  }
104458
104488
  return { result: attempts[0], attempts };
104459
104489
  }
104490
+ function sumKnown(total, value) {
104491
+ if (value === null)
104492
+ return total;
104493
+ return total === null ? value : total + value;
104494
+ }
104460
104495
  function addCost(evidence2, dispatches) {
104461
104496
  const MAX_REVIEW_COST_EVIDENCE = 32;
104462
104497
  evidence2.cost.model_calls = dispatches.length;
@@ -104472,10 +104507,10 @@ function addCost(evidence2, dispatches) {
104472
104507
  evidence2.cost.evidence_status = "inconclusive";
104473
104508
  evidence2.cost.evidence_reason = fields?.evidence_reason ?? "missing_cost";
104474
104509
  }
104475
- evidence2.cost.tokens_input += fields?.tokens_input ?? 0;
104476
- evidence2.cost.tokens_output += fields?.tokens_output ?? 0;
104477
- evidence2.cost.tokens_reasoning += fields?.tokens_reasoning ?? 0;
104478
- evidence2.cost.tokens_cache += fields?.tokens_cache ?? 0;
104510
+ evidence2.cost.tokens_input = sumKnown(evidence2.cost.tokens_input, fields?.tokens_input ?? null);
104511
+ evidence2.cost.tokens_output = sumKnown(evidence2.cost.tokens_output, fields?.tokens_output ?? null);
104512
+ evidence2.cost.tokens_reasoning = sumKnown(evidence2.cost.tokens_reasoning, fields?.tokens_reasoning ?? null);
104513
+ evidence2.cost.tokens_cache = sumKnown(evidence2.cost.tokens_cache, fields?.tokens_cache ?? null);
104479
104514
  if (typeof fields?.cost_usd === "number") {
104480
104515
  evidence2.cost.cost_usd = (evidence2.cost.cost_usd ?? 0) + fields.cost_usd;
104481
104516
  evidence2.cost.cost_source = fields.cost_source === "estimated" ? "estimated" : evidence2.cost.cost_source === "estimated" ? "estimated" : "reported";
@@ -104515,10 +104550,10 @@ function baseEvidence(input, diff, status) {
104515
104550
  model_calls: 0,
104516
104551
  diff_bytes: diff.reviewTextBytes,
104517
104552
  prompt_bytes: 0,
104518
- tokens_input: 0,
104519
- tokens_output: 0,
104520
- tokens_reasoning: 0,
104521
- tokens_cache: 0,
104553
+ tokens_input: null,
104554
+ tokens_output: null,
104555
+ tokens_reasoning: null,
104556
+ tokens_cache: null,
104522
104557
  cost_usd: null,
104523
104558
  cost_source: "unavailable",
104524
104559
  cost_evidence: [],
@@ -105010,7 +105045,8 @@ function costLine(evidence2) {
105010
105045
  return "Cost: unavailable (durable evidence was not readable)";
105011
105046
  const cost = evidence2.cost;
105012
105047
  const dollars = cost.cost_usd === null ? `unavailable (${cost.cost_source})` : `$${cost.cost_usd.toFixed(6)} (${cost.cost_source})`;
105013
- return `Cost: ${dollars}; tokens ${cost.tokens_input} input / ${cost.tokens_output} output / ${cost.tokens_reasoning} reasoning / ${cost.tokens_cache} cache; prompt ${cost.prompt_bytes} bytes`;
105048
+ const axis = (value) => value === null ? "unknown" : String(value);
105049
+ return `Cost: ${dollars}; tokens ${axis(cost.tokens_input)} input / ${axis(cost.tokens_output)} output / ${axis(cost.tokens_reasoning)} reasoning / ${axis(cost.tokens_cache)} cache; prompt ${cost.prompt_bytes} bytes`;
105014
105050
  }
105015
105051
  function renderHuman(result, evidence2, requestedSelector) {
105016
105052
  const selector = evidence2?.scope.selector ?? requestedSelector;
@@ -106897,7 +106933,7 @@ async function runValidationWithTransientRetry(input, candidateContent, baseline
106897
106933
  if (!input.dispatcher) {
106898
106934
  throw new Error("no evaluation dispatcher available (cannot run validation)");
106899
106935
  }
106900
- const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-fns4esbf.js");
106936
+ const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-fbmancth.js");
106901
106937
  const executor = createModelEvaluationExecutor2(input.dispatcher, input.sessionId);
106902
106938
  const result = await withProtectedSetIntegrity([evalInputRoot, ...protectedRoots(input.directory)], () => _internals129.evaluateCandidateV1({
106903
106939
  projectRoot: input.directory,
@@ -109526,7 +109562,7 @@ function buildDetailedHelp(commandName, entry) {
109526
109562
  async function handleHelpCommand(ctx) {
109527
109563
  const targetCommand = ctx.args.join(" ");
109528
109564
  if (!targetCommand) {
109529
- const { buildHelpText } = await import("./index-03d68zxw.js");
109565
+ const { buildHelpText } = await import("./index-fxvthwwk.js");
109530
109566
  return buildHelpText();
109531
109567
  }
109532
109568
  const tokens = targetCommand.split(/\s+/);
@@ -109540,7 +109576,7 @@ async function handleHelpCommand(ctx) {
109540
109576
  > Note: \`/swarm ${resolved.key}\` is a deprecated alias for \`/swarm ${aliasTarget}\`.` : detailed;
109541
109577
  }
109542
109578
  const similar = _internals27.findSimilarCommands(targetCommand);
109543
- const { buildHelpText: fullHelp } = await import("./index-03d68zxw.js");
109579
+ const { buildHelpText: fullHelp } = await import("./index-fxvthwwk.js");
109544
109580
  if (similar.length > 0) {
109545
109581
  return `Command '/swarm ${targetCommand}' not found.
109546
109582
 
@@ -109868,7 +109904,7 @@ var COMMAND_REGISTRY = {
109868
109904
  },
109869
109905
  "guardrail explain": {
109870
109906
  handler: async (ctx) => {
109871
- const { handleGuardrailExplain } = await import("./guardrail-explain-yfd11za1.js");
109907
+ const { handleGuardrailExplain } = await import("./guardrail-explain-a16eabym.js");
109872
109908
  return handleGuardrailExplain(ctx.directory, ctx.args);
109873
109909
  },
109874
109910
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -109878,7 +109914,7 @@ var COMMAND_REGISTRY = {
109878
109914
  },
109879
109915
  "guardrail reset": {
109880
109916
  handler: async (ctx) => {
109881
- const { handleGuardrailReset } = await import("./guardrail-reset-fqgf5sdb.js");
109917
+ const { handleGuardrailReset } = await import("./guardrail-reset-fstvd42q.js");
109882
109918
  return handleGuardrailReset(ctx.args, ctx.sessionID);
109883
109919
  },
109884
109920
  description: "Reset one exact active invocation/action circuit after repair",
@@ -109899,7 +109935,7 @@ var COMMAND_REGISTRY = {
109899
109935
  },
109900
109936
  "guardrail-log": {
109901
109937
  handler: async (ctx) => {
109902
- const { handleGuardrailLog } = await import("./guardrail-log-hcr5rptq.js");
109938
+ const { handleGuardrailLog } = await import("./guardrail-log-4kj5e7da.js");
109903
109939
  return handleGuardrailLog(ctx.directory, ctx.args);
109904
109940
  },
109905
109941
  description: "Read the guardrail decision log (use --blocks-only for blocks)",