opencode-swarm 7.154.1 → 7.154.3

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 (79) hide show
  1. package/dist/background/completion-observer.d.ts +10 -1
  2. package/dist/background/pending-delegations.d.ts +47 -0
  3. package/dist/cli/coder-settlement-7c9h07f5.js +54 -0
  4. package/dist/cli/{config-doctor-keasv3r8.js → config-doctor-8zjz6dej.js} +2 -2
  5. package/dist/cli/{core-7aj5g3f4.js → core-dn8bn81g.js} +2 -2
  6. package/dist/cli/{curation-policy-a6tve11y.js → curation-policy-2jkbybw7.js} +4 -4
  7. package/dist/cli/{curator-drift-h57z6tm3.js → curator-drift-g6w4ga1q.js} +2 -2
  8. package/dist/cli/{curator-llm-factory-cr5ckwbd.js → curator-llm-factory-mxdjw6kz.js} +33 -31
  9. package/dist/cli/{curator-anz136hr.js → curator-v12rhct2.js} +33 -31
  10. package/dist/cli/{evidence-summary-service-6tgme7p3.js → evidence-summary-service-zzvvcaa9.js} +11 -11
  11. package/dist/cli/{gate-evidence-36nfx4vb.js → gate-evidence-16jkjre9.js} +6 -6
  12. package/dist/cli/{guardrail-explain-frb5xd5h.js → guardrail-explain-11fx66cx.js} +34 -32
  13. package/dist/cli/{guardrail-log-fvma65xm.js → guardrail-log-ahvfn58c.js} +3 -3
  14. package/dist/cli/{guardrail-reset-3qk6k334.js → guardrail-reset-zp5xe0n5.js} +33 -31
  15. package/dist/cli/{hive-promoter-v3dhtzfa.js → hive-promoter-k6y06jj8.js} +33 -31
  16. package/dist/cli/{index-c809a69b.js → index-0f4b9ywa.js} +2 -2
  17. package/dist/cli/{index-akm1dbr9.js → index-2rgm3hgq.js} +4 -4
  18. package/dist/cli/{index-1sjnqsc8.js → index-4dt91x6e.js} +1 -1
  19. package/dist/cli/{index-qm8b3aaj.js → index-4n557t8w.js} +3 -3
  20. package/dist/cli/{index-h7pamys0.js → index-6vcrkz80.js} +4 -4
  21. package/dist/cli/{index-wqp8kk0w.js → index-7fyv62b2.js} +11 -12
  22. package/dist/cli/{index-zak84bqr.js → index-7qky94rr.js} +1 -1
  23. package/dist/cli/{index-bmkxc6sa.js → index-94e20w95.js} +2 -2
  24. package/dist/cli/{index-wxpemcdj.js → index-9nw6z98k.js} +35 -33
  25. package/dist/cli/{index-4r46q7tk.js → index-a6xjn2zt.js} +5 -5
  26. package/dist/cli/{index-107cv0dr.js → index-bhjkxasn.js} +1 -1
  27. package/dist/cli/{index-97q41ds3.js → index-ckp0z9d4.js} +2 -2
  28. package/dist/cli/{index-sx5f2fq9.js → index-d7r6y724.js} +4 -4
  29. package/dist/cli/index-ddszzne4.js +42 -0
  30. package/dist/cli/{index-4cgee5vh.js → index-dtn0pne5.js} +20 -1
  31. package/dist/cli/{index-9wzgztj9.js → index-ed13peqr.js} +1 -1
  32. package/dist/cli/{index-tmgbwgsm.js → index-env8fk17.js} +1 -1
  33. package/dist/cli/{index-9znypky4.js → index-g1bh7980.js} +3 -3
  34. package/dist/cli/{index-p17hs70t.js → index-gbkdj7ay.js} +2 -2
  35. package/dist/cli/{index-9xev69y4.js → index-kck2gtxk.js} +228 -2
  36. package/dist/cli/{index-r0yavfvm.js → index-m0fy8jra.js} +2309 -2920
  37. package/dist/cli/{index-wmxke5se.js → index-n7nnz0jp.js} +6 -6
  38. package/dist/cli/{index-xsbf2mmf.js → index-q0prhdds.js} +7 -7
  39. package/dist/cli/{index-3md256qr.js → index-qdnmnq65.js} +1 -1
  40. package/dist/cli/{index-y7gyhe13.js → index-qxj63890.js} +1 -1
  41. package/dist/cli/{index-50cy1a3p.js → index-s23q9v6t.js} +6 -6
  42. package/dist/cli/{index-0vss7vdg.js → index-s5p8ryar.js} +1 -1
  43. package/dist/cli/{index-yy4yps8w.js → index-v6xkgxts.js} +2 -2
  44. package/dist/cli/{index-garsang6.js → index-vntggpez.js} +2 -2
  45. package/dist/cli/{index-155pbsan.js → index-wkagbmpt.js} +1 -1
  46. package/dist/cli/{index-fz9xcq6z.js → index-y3kw1zpm.js} +2 -1
  47. package/dist/cli/index-ymgsmjba.js +875 -0
  48. package/dist/cli/{index-2ppbt5cf.js → index-zak50rve.js} +1 -1
  49. package/dist/cli/index.js +33 -31
  50. package/dist/cli/{knowledge-escalator-1gjv97hj.js → knowledge-escalator-yew2fbxb.js} +11 -11
  51. package/dist/cli/{knowledge-events-94hfvp85.js → knowledge-events-zfg423hp.js} +9 -9
  52. package/dist/cli/{knowledge-link-fs8hgh4h.js → knowledge-link-ydv6shg2.js} +3 -3
  53. package/dist/cli/{knowledge-store-g7grbt7h.js → knowledge-store-zcv9stzz.js} +4 -4
  54. package/dist/cli/{knowledge-validator-ep0ym1e4.js → knowledge-validator-q68wx2bf.js} +6 -6
  55. package/dist/cli/{pending-delegations-0pf2dtwx.js → pending-delegations-yet1rza6.js} +15 -2
  56. package/dist/cli/{pr-subscriptions-e70phj71.js → pr-subscriptions-mp7fyh1r.js} +3 -3
  57. package/dist/cli/{runner-b7pskcxb.js → runner-s89ja08q.js} +4 -4
  58. package/dist/cli/{scan-cursor-8zps8v46.js → scan-cursor-38bzfhwf.js} +5 -5
  59. package/dist/cli/{schema-8sx9jp7v.js → schema-9hqyt4t6.js} +1 -1
  60. package/dist/cli/{scope-persistence-zacyjnx9.js → scope-persistence-dd9s9q2b.js} +6 -6
  61. package/dist/cli/{skill-generator-xs5n5j4k.js → skill-generator-b28ezazm.js} +13 -13
  62. package/dist/cli/{worktree-collision-ownership-yjk5ya71.js → worktree-collision-ownership-zw65t2p9.js} +9 -8
  63. package/dist/cli/{worktree-isolation-cpf6b8ns.js → worktree-isolation-0ag393t0.js} +33 -31
  64. package/dist/evaluation/contracts.d.ts +4 -4
  65. package/dist/evaluation/gate-ground-truth.d.ts +1 -1
  66. package/dist/hooks/final-context-accounting.d.ts +60 -0
  67. package/dist/hooks/index.d.ts +1 -0
  68. package/dist/hooks/knowledge-injector.d.ts +1 -1
  69. package/dist/hooks/system-enhancer.d.ts +13 -0
  70. package/dist/hooks/utils.d.ts +11 -0
  71. package/dist/index.js +561 -556
  72. package/dist/services/compaction-service.d.ts +9 -3
  73. package/dist/services/context-budget-service.d.ts +7 -3
  74. package/dist/services/injection-budget.d.ts +103 -26
  75. package/dist/state.d.ts +69 -0
  76. package/dist/summaries/summarizer.d.ts +34 -3
  77. package/dist/utils/canonical-root.d.ts +2 -0
  78. package/dist/workflow/coder-settlement.d.ts +14 -0
  79. package/package.json +2 -1
@@ -3,57 +3,59 @@ import {
3
3
  getAgentSession,
4
4
  getBlockingActionCircuit,
5
5
  resetActionCircuitExternally
6
- } from "./index-r0yavfvm.js";
7
- import"./index-y7gyhe13.js";
8
- import"./index-155pbsan.js";
9
- import"./index-wqp8kk0w.js";
6
+ } from "./index-m0fy8jra.js";
7
+ import"./index-qdnmnq65.js";
8
+ import"./index-qxj63890.js";
9
+ import"./index-wkagbmpt.js";
10
+ import"./index-7fyv62b2.js";
11
+ import"./index-env8fk17.js";
10
12
  import"./index-134d35c1.js";
11
13
  import"./index-nj6rmyeh.js";
12
- import"./index-3md256qr.js";
13
- import"./index-tmgbwgsm.js";
14
14
  import"./index-y8552snf.js";
15
- import"./index-yy4yps8w.js";
15
+ import"./index-a6xjn2zt.js";
16
+ import"./index-v6xkgxts.js";
16
17
  import"./index-70ha9e09.js";
17
18
  import"./index-c8s9a3zh.js";
18
19
  import"./index-9ss2m4rs.js";
19
- import"./index-vnn7qq8c.js";
20
- import"./index-bmkxc6sa.js";
21
- import"./index-akm1dbr9.js";
22
- import"./index-4r46q7tk.js";
23
- import"./index-h7pamys0.js";
24
- import"./index-2ppbt5cf.js";
25
- import"./index-rtry5xyf.js";
26
- import"./index-garsang6.js";
20
+ import"./index-94e20w95.js";
27
21
  import"./index-zsrtt42s.js";
28
- import"./index-9znypky4.js";
29
- import"./index-zak84bqr.js";
30
- import"./index-9xev69y4.js";
31
- import"./index-qm8b3aaj.js";
32
- import"./index-0vss7vdg.js";
22
+ import"./index-ymgsmjba.js";
23
+ import"./index-vntggpez.js";
24
+ import"./index-2rgm3hgq.js";
25
+ import"./index-6vcrkz80.js";
26
+ import"./index-zak50rve.js";
27
+ import"./index-rtry5xyf.js";
28
+ import"./index-g1bh7980.js";
29
+ import"./index-7qky94rr.js";
30
+ import"./index-kck2gtxk.js";
31
+ import"./index-ddszzne4.js";
32
+ import"./index-vnn7qq8c.js";
33
+ import"./index-4n557t8w.js";
34
+ import"./index-s5p8ryar.js";
33
35
  import"./index-xdy28ngt.js";
34
36
  import"./index-556ja8an.js";
37
+ import"./index-4fwbbad3.js";
35
38
  import"./index-b43rt5ph.js";
36
39
  import"./index-q7sjgr1y.js";
37
- import"./index-4fwbbad3.js";
38
- import"./index-wmxke5se.js";
39
- import"./index-50cy1a3p.js";
40
- import"./index-p17hs70t.js";
40
+ import"./index-n7nnz0jp.js";
41
+ import"./index-s23q9v6t.js";
42
+ import"./index-gbkdj7ay.js";
41
43
  import"./index-gprxjmm7.js";
42
44
  import"./index-n832052r.js";
43
- import"./index-4cgee5vh.js";
45
+ import"./index-dtn0pne5.js";
44
46
  import"./index-z6xqpmqg.js";
45
47
  import"./index-r3mvsbtq.js";
46
- import"./index-xsbf2mmf.js";
47
- import"./index-fz9xcq6z.js";
48
+ import"./index-q0prhdds.js";
49
+ import"./index-y3kw1zpm.js";
48
50
  import"./index-myt57pht.js";
51
+ import"./index-zjygnfay.js";
49
52
  import"./index-9e6fdz2h.js";
50
53
  import"./index-4rhhvd1a.js";
51
- import"./index-zjygnfay.js";
52
54
  import"./index-ae75rja9.js";
53
- import"./index-9wzgztj9.js";
54
- import"./index-107cv0dr.js";
55
+ import"./index-ed13peqr.js";
56
+ import"./index-bhjkxasn.js";
55
57
  import"./index-bk5tah7q.js";
56
- import"./index-c809a69b.js";
58
+ import"./index-0f4b9ywa.js";
57
59
  import"./index-xagq35tf.js";
58
60
  import"./index-ed5ykebp.js";
59
61
  import"./index-h1g8w4v0.js";
@@ -7,59 +7,61 @@ import {
7
7
  isHiveEligible,
8
8
  promoteFromSwarm,
9
9
  promoteToHive
10
- } from "./index-r0yavfvm.js";
11
- import"./index-y7gyhe13.js";
12
- import"./index-155pbsan.js";
13
- import"./index-wqp8kk0w.js";
10
+ } from "./index-m0fy8jra.js";
11
+ import"./index-qdnmnq65.js";
12
+ import"./index-qxj63890.js";
13
+ import"./index-wkagbmpt.js";
14
+ import"./index-7fyv62b2.js";
15
+ import"./index-env8fk17.js";
14
16
  import"./index-134d35c1.js";
15
17
  import"./index-nj6rmyeh.js";
16
- import"./index-3md256qr.js";
17
- import"./index-tmgbwgsm.js";
18
18
  import"./index-y8552snf.js";
19
- import"./index-yy4yps8w.js";
19
+ import"./index-a6xjn2zt.js";
20
+ import"./index-v6xkgxts.js";
20
21
  import"./index-70ha9e09.js";
21
22
  import"./index-c8s9a3zh.js";
22
23
  import"./index-9ss2m4rs.js";
23
- import"./index-vnn7qq8c.js";
24
- import"./index-bmkxc6sa.js";
25
- import"./index-akm1dbr9.js";
26
- import"./index-4r46q7tk.js";
27
- import"./index-h7pamys0.js";
28
- import"./index-2ppbt5cf.js";
29
- import"./index-rtry5xyf.js";
30
- import"./index-garsang6.js";
24
+ import"./index-94e20w95.js";
31
25
  import"./index-zsrtt42s.js";
32
- import"./index-9znypky4.js";
33
- import"./index-zak84bqr.js";
34
- import"./index-9xev69y4.js";
35
- import"./index-qm8b3aaj.js";
36
- import"./index-0vss7vdg.js";
26
+ import"./index-ymgsmjba.js";
27
+ import"./index-vntggpez.js";
28
+ import"./index-2rgm3hgq.js";
29
+ import"./index-6vcrkz80.js";
30
+ import"./index-zak50rve.js";
31
+ import"./index-rtry5xyf.js";
32
+ import"./index-g1bh7980.js";
33
+ import"./index-7qky94rr.js";
34
+ import"./index-kck2gtxk.js";
35
+ import"./index-ddszzne4.js";
36
+ import"./index-vnn7qq8c.js";
37
+ import"./index-4n557t8w.js";
38
+ import"./index-s5p8ryar.js";
37
39
  import"./index-xdy28ngt.js";
38
40
  import"./index-556ja8an.js";
41
+ import"./index-4fwbbad3.js";
39
42
  import"./index-b43rt5ph.js";
40
43
  import"./index-q7sjgr1y.js";
41
- import"./index-4fwbbad3.js";
42
44
  import {
43
45
  resolveHiveKnowledgePath
44
- } from "./index-wmxke5se.js";
45
- import"./index-50cy1a3p.js";
46
- import"./index-p17hs70t.js";
46
+ } from "./index-n7nnz0jp.js";
47
+ import"./index-s23q9v6t.js";
48
+ import"./index-gbkdj7ay.js";
47
49
  import"./index-gprxjmm7.js";
48
50
  import"./index-n832052r.js";
49
- import"./index-4cgee5vh.js";
51
+ import"./index-dtn0pne5.js";
50
52
  import"./index-z6xqpmqg.js";
51
53
  import"./index-r3mvsbtq.js";
52
- import"./index-xsbf2mmf.js";
53
- import"./index-fz9xcq6z.js";
54
+ import"./index-q0prhdds.js";
55
+ import"./index-y3kw1zpm.js";
54
56
  import"./index-myt57pht.js";
57
+ import"./index-zjygnfay.js";
55
58
  import"./index-9e6fdz2h.js";
56
59
  import"./index-4rhhvd1a.js";
57
- import"./index-zjygnfay.js";
58
60
  import"./index-ae75rja9.js";
59
- import"./index-9wzgztj9.js";
60
- import"./index-107cv0dr.js";
61
+ import"./index-ed13peqr.js";
62
+ import"./index-bhjkxasn.js";
61
63
  import"./index-bk5tah7q.js";
62
- import"./index-c809a69b.js";
64
+ import"./index-0f4b9ywa.js";
63
65
  import"./index-xagq35tf.js";
64
66
  import"./index-ed5ykebp.js";
65
67
  import"./index-h1g8w4v0.js";
@@ -123,7 +123,7 @@ var SWARM_TEMP_GRAMMARS = [
123
123
  "src/tools/spec-write.ts:98",
124
124
  "src/sdd/effective-spec.ts:1149",
125
125
  "src/background/lane-output-store.ts:353",
126
- "src/background/pending-delegations.ts:1053",
126
+ "src/background/pending-delegations.ts:1070",
127
127
  "src/background/delegation-health.ts:390",
128
128
  "src/tools/submit-phase-council-verdicts.ts:458",
129
129
  "src/summaries/store.ts:46 (pre-#2035)"
@@ -247,7 +247,7 @@ var SWARM_TEMP_GRAMMARS = [
247
247
  "src/tools/checkpoint.ts:195",
248
248
  "src/full-auto/state.ts:460",
249
249
  "src/context-map/persistence.ts:119",
250
- "src/context-map/capsule-persistence.ts:107",
250
+ "src/context-map/capsule-persistence.ts:109",
251
251
  "src/test-impact/history-store.ts:225",
252
252
  "src/test-impact/history-store.ts:353",
253
253
  "src/hooks/promotion-evidence-store.ts:102",
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ALLOWED_SKILL_PATH_PREFIXES,
4
4
  validateSkillPath
5
- } from "./index-h7pamys0.js";
5
+ } from "./index-6vcrkz80.js";
6
6
  import {
7
7
  withTimeoutSignal
8
8
  } from "./index-q7sjgr1y.js";
@@ -12,11 +12,11 @@ import {
12
12
  resolveHiveKnowledgePath,
13
13
  resolveSwarmKnowledgePath,
14
14
  transactKnowledge
15
- } from "./index-wmxke5se.js";
15
+ } from "./index-n7nnz0jp.js";
16
16
  import {
17
17
  effectiveRetrievalOutcomes,
18
18
  readAuthoritativeKnowledgeCounterRollups
19
- } from "./index-50cy1a3p.js";
19
+ } from "./index-s23q9v6t.js";
20
20
  import {
21
21
  advisoryWarn,
22
22
  init_warning_buffer
@@ -28,7 +28,7 @@ import {
28
28
  import {
29
29
  atomicWriteFileAnyRoot,
30
30
  atomicWriteSwarmFile
31
- } from "./index-c809a69b.js";
31
+ } from "./index-0f4b9ywa.js";
32
32
  import {
33
33
  init_logger,
34
34
  log,
@@ -4,7 +4,7 @@ import {
4
4
  readShellAuditTail,
5
5
  redactPath,
6
6
  redactShellCommand
7
- } from "./index-y7gyhe13.js";
7
+ } from "./index-qxj63890.js";
8
8
 
9
9
  // src/services/guardrail-log-service.ts
10
10
  var BLOCK_TYPES = new Set([
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  computePlanStructureHash,
4
4
  derivePlanId
5
- } from "./index-0vss7vdg.js";
5
+ } from "./index-s5p8ryar.js";
6
6
  import {
7
7
  appendCoreEventSync
8
8
  } from "./index-xdy28ngt.js";
@@ -11,11 +11,11 @@ import {
11
11
  } from "./index-556ja8an.js";
12
12
  import {
13
13
  PlanSchema
14
- } from "./index-xsbf2mmf.js";
14
+ } from "./index-q0prhdds.js";
15
15
  import {
16
16
  atomicWriteSwarmFile,
17
17
  atomicWriteSwarmFileSync
18
- } from "./index-c809a69b.js";
18
+ } from "./index-0f4b9ywa.js";
19
19
  import {
20
20
  assertProjectRoot
21
21
  } from "./index-xagq35tf.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  authorizeCuration
4
- } from "./index-2ppbt5cf.js";
4
+ } from "./index-zak50rve.js";
5
5
  import {
6
6
  findNearDuplicate,
7
7
  inferTags,
@@ -9,13 +9,13 @@ import {
9
9
  resolveSwarmKnowledgePath,
10
10
  resolveSwarmRejectedPath,
11
11
  transactKnowledge
12
- } from "./index-wmxke5se.js";
12
+ } from "./index-n7nnz0jp.js";
13
13
  import {
14
14
  resolveKnowledgeStoreDir
15
- } from "./index-9wzgztj9.js";
15
+ } from "./index-ed13peqr.js";
16
16
  import {
17
17
  atomicWriteFile
18
- } from "./index-107cv0dr.js";
18
+ } from "./index-bhjkxasn.js";
19
19
  import {
20
20
  require_proper_lockfile
21
21
  } from "./index-7g4c7s5r.js";
@@ -1,12 +1,12 @@
1
1
  // @bun
2
- import {
3
- loadDatabaseCtor
4
- } from "./index-134d35c1.js";
5
2
  import {
6
3
  EvaluationRunV1Schema,
7
4
  GateAuditResultV1Schema,
8
5
  getProtectedEvaluationRunIds
9
- } from "./index-tmgbwgsm.js";
6
+ } from "./index-env8fk17.js";
7
+ import {
8
+ loadDatabaseCtor
9
+ } from "./index-134d35c1.js";
10
10
  import {
11
11
  readEffectiveSpecSync
12
12
  } from "./index-9ss2m4rs.js";
@@ -23,7 +23,7 @@ import {
23
23
  readTaskEvidence,
24
24
  readTaskEvidenceRaw,
25
25
  sanitizeTaskId
26
- } from "./index-9znypky4.js";
26
+ } from "./index-g1bh7980.js";
27
27
  import {
28
28
  LedgerStaleWriterError,
29
29
  appendLedgerEvent,
@@ -43,7 +43,7 @@ import {
43
43
  replayFromLedgerWithStatus,
44
44
  takeSnapshotEvent,
45
45
  takeSnapshotWithRetry
46
- } from "./index-0vss7vdg.js";
46
+ } from "./index-s5p8ryar.js";
47
47
  import {
48
48
  appendCoreEventSync
49
49
  } from "./index-xdy28ngt.js";
@@ -58,9 +58,11 @@ import {
58
58
  EvidenceSchema
59
59
  } from "./index-gprxjmm7.js";
60
60
  import {
61
+ estimateCharsForTokens,
62
+ estimateTokens,
61
63
  readSwarmFileAsync,
62
64
  validateSwarmPath
63
- } from "./index-4cgee5vh.js";
65
+ } from "./index-dtn0pne5.js";
64
66
  import {
65
67
  bunHash,
66
68
  bunWrite,
@@ -68,7 +70,7 @@ import {
68
70
  } from "./index-r3mvsbtq.js";
69
71
  import {
70
72
  PlanSchema
71
- } from "./index-xsbf2mmf.js";
73
+ } from "./index-q0prhdds.js";
72
74
  import {
73
75
  GIT_BINARY_ENV_VAR,
74
76
  describeGitResolution,
@@ -1413,9 +1415,6 @@ async function getRunMemorySummary(directory) {
1413
1415
  Use this data to avoid repeating known failure patterns.`;
1414
1416
  let summaryText = summaries.join(`
1415
1417
  `);
1416
- const estimateTokens = (text) => {
1417
- return Math.ceil(text.length * 0.33);
1418
- };
1419
1418
  const totalText = prefix + summaryText + suffix;
1420
1419
  const estimatedTokens = estimateTokens(totalText);
1421
1420
  if (estimatedTokens > MAX_SUMMARY_TOKENS) {
@@ -1423,7 +1422,7 @@ Use this data to avoid repeating known failure patterns.`;
1423
1422
  const suffixTokens = estimateTokens(suffix);
1424
1423
  const availableContentTokens = MAX_SUMMARY_TOKENS - prefixTokens - suffixTokens;
1425
1424
  if (availableContentTokens > 0) {
1426
- const maxContentChars = Math.floor(availableContentTokens / 0.33);
1425
+ const maxContentChars = estimateCharsForTokens(availableContentTokens);
1427
1426
  summaryText = summaryText.slice(0, maxContentChars);
1428
1427
  } else {
1429
1428
  summaryText = "";
@@ -92,7 +92,7 @@ var _internals = {
92
92
  symlinkSync: fs.symlinkSync
93
93
  },
94
94
  writeScopeToDisk: async (directory, taskId, files) => {
95
- const { writeScopeToDisk: realWrite } = await import("./scope-persistence-zacyjnx9.js");
95
+ const { writeScopeToDisk: realWrite } = await import("./scope-persistence-dd9s9q2b.js");
96
96
  return realWrite(directory, taskId, files);
97
97
  },
98
98
  writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-4cgee5vh.js";
4
+ } from "./index-dtn0pne5.js";
5
5
  import {
6
6
  atomicWriteSwarmFileSync
7
- } from "./index-c809a69b.js";
7
+ } from "./index-0f4b9ywa.js";
8
8
  import {
9
9
  withEvidenceLock
10
10
  } from "./index-xagq35tf.js";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-97q41ds3.js";
4
+ } from "./index-ckp0z9d4.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-1sjnqsc8.js";
7
+ } from "./index-4dt91x6e.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
@@ -86,64 +86,66 @@ import {
86
86
  handleWriteRetroCommand,
87
87
  normalizeSwarmCommandInput,
88
88
  resolveCommand
89
- } from "./index-r0yavfvm.js";
90
- import"./index-y7gyhe13.js";
91
- import"./index-155pbsan.js";
92
- import"./index-wqp8kk0w.js";
89
+ } from "./index-m0fy8jra.js";
90
+ import"./index-qdnmnq65.js";
91
+ import"./index-qxj63890.js";
92
+ import"./index-wkagbmpt.js";
93
+ import"./index-7fyv62b2.js";
94
+ import"./index-env8fk17.js";
93
95
  import"./index-134d35c1.js";
94
96
  import"./index-nj6rmyeh.js";
95
- import"./index-3md256qr.js";
96
- import"./index-tmgbwgsm.js";
97
97
  import"./index-y8552snf.js";
98
- import"./index-yy4yps8w.js";
98
+ import"./index-a6xjn2zt.js";
99
+ import"./index-v6xkgxts.js";
99
100
  import"./index-70ha9e09.js";
100
101
  import"./index-c8s9a3zh.js";
101
102
  import"./index-9ss2m4rs.js";
102
- import"./index-vnn7qq8c.js";
103
- import"./index-bmkxc6sa.js";
104
- import"./index-akm1dbr9.js";
105
- import"./index-4r46q7tk.js";
106
- import"./index-h7pamys0.js";
107
- import"./index-2ppbt5cf.js";
108
- import"./index-rtry5xyf.js";
109
- import"./index-garsang6.js";
103
+ import"./index-94e20w95.js";
110
104
  import"./index-zsrtt42s.js";
111
- import"./index-9znypky4.js";
112
- import"./index-zak84bqr.js";
113
- import"./index-9xev69y4.js";
114
- import"./index-qm8b3aaj.js";
115
- import"./index-0vss7vdg.js";
105
+ import"./index-ymgsmjba.js";
106
+ import"./index-vntggpez.js";
107
+ import"./index-2rgm3hgq.js";
108
+ import"./index-6vcrkz80.js";
109
+ import"./index-zak50rve.js";
110
+ import"./index-rtry5xyf.js";
111
+ import"./index-g1bh7980.js";
112
+ import"./index-7qky94rr.js";
113
+ import"./index-kck2gtxk.js";
114
+ import"./index-ddszzne4.js";
115
+ import"./index-vnn7qq8c.js";
116
+ import"./index-4n557t8w.js";
117
+ import"./index-s5p8ryar.js";
116
118
  import"./index-xdy28ngt.js";
117
119
  import"./index-556ja8an.js";
120
+ import"./index-4fwbbad3.js";
118
121
  import"./index-b43rt5ph.js";
119
122
  import"./index-q7sjgr1y.js";
120
- import"./index-4fwbbad3.js";
121
- import"./index-wmxke5se.js";
122
- import"./index-50cy1a3p.js";
123
- import"./index-p17hs70t.js";
123
+ import"./index-n7nnz0jp.js";
124
+ import"./index-s23q9v6t.js";
125
+ import"./index-gbkdj7ay.js";
124
126
  import"./index-gprxjmm7.js";
125
127
  import"./index-n832052r.js";
126
- import"./index-4cgee5vh.js";
128
+ import"./index-dtn0pne5.js";
127
129
  import"./index-z6xqpmqg.js";
128
130
  import"./index-r3mvsbtq.js";
129
- import"./index-xsbf2mmf.js";
131
+ import"./index-q0prhdds.js";
130
132
  import {
131
133
  init_schema,
132
134
  stripKnownSwarmPrefix
133
- } from "./index-fz9xcq6z.js";
135
+ } from "./index-y3kw1zpm.js";
134
136
  import {
135
137
  AGENT_TOOL_MAP,
136
138
  ORCHESTRATOR_NAME,
137
139
  init_constants
138
140
  } from "./index-myt57pht.js";
141
+ import"./index-zjygnfay.js";
139
142
  import"./index-9e6fdz2h.js";
140
143
  import"./index-4rhhvd1a.js";
141
- import"./index-zjygnfay.js";
142
144
  import"./index-ae75rja9.js";
143
- import"./index-9wzgztj9.js";
144
- import"./index-107cv0dr.js";
145
+ import"./index-ed13peqr.js";
146
+ import"./index-bhjkxasn.js";
145
147
  import"./index-bk5tah7q.js";
146
- import"./index-c809a69b.js";
148
+ import"./index-0f4b9ywa.js";
147
149
  import"./index-xagq35tf.js";
148
150
  import"./index-ed5ykebp.js";
149
151
  import"./index-h1g8w4v0.js";
@@ -6,12 +6,12 @@ import {
6
6
  resolveSwarmKnowledgePath,
7
7
  transactKnowledge,
8
8
  wordBigrams
9
- } from "./index-wmxke5se.js";
9
+ } from "./index-n7nnz0jp.js";
10
10
  import {
11
11
  queryHistoricalOutcomes,
12
12
  readKnowledgeEvents,
13
13
  recordKnowledgeEvent
14
- } from "./index-50cy1a3p.js";
14
+ } from "./index-s23q9v6t.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-ep0ym1e4.js");
227
+ const { quarantineEntry } = await import("./knowledge-validator-q68wx2bf.js");
228
228
  let policyConfig;
229
229
  try {
230
- const { KnowledgeConfigSchema } = await import("./schema-8sx9jp7v.js");
231
- const { loadPluginConfigWithMeta } = await import("./index-sx5f2fq9.js");
230
+ const { KnowledgeConfigSchema } = await import("./schema-9hqyt4t6.js");
231
+ const { loadPluginConfigWithMeta } = await import("./index-d7r6y724.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
  atomicWriteFileAnyRoot
4
- } from "./index-c809a69b.js";
4
+ } from "./index-0f4b9ywa.js";
5
5
  import {
6
6
  withEvidenceLock
7
7
  } from "./index-xagq35tf.js";
@@ -14,14 +14,14 @@ import {
14
14
  detectWindowsWrites,
15
15
  getSharedClassifierGuardrailBlock,
16
16
  resolveWriteTargets
17
- } from "./index-r0yavfvm.js";
17
+ } from "./index-m0fy8jra.js";
18
18
  import {
19
19
  checkFileAuthority,
20
20
  classifyFile,
21
21
  isInDeclaredScope,
22
22
  redactPath,
23
23
  redactShellCommand
24
- } from "./index-y7gyhe13.js";
24
+ } from "./index-qxj63890.js";
25
25
 
26
26
  // src/services/guardrail-explain-service.ts
27
27
  import path from "path";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  _internals,
4
4
  resolveWorktreeIsolationConfig
5
- } from "./index-p17hs70t.js";
5
+ } from "./index-gbkdj7ay.js";
6
6
  import {
7
7
  ApprovalEvidenceSchema,
8
8
  BaseEvidenceSchema,
@@ -42,7 +42,7 @@ import {
42
42
  loadPluginConfig,
43
43
  loadPluginConfigWithMeta,
44
44
  loadPluginConfigWithMetaAsync
45
- } from "./index-xsbf2mmf.js";
45
+ } from "./index-q0prhdds.js";
46
46
  import {
47
47
  AUTO_REVIEW_V8_BURN_IN_DECISION,
48
48
  AgentOverrideConfigSchema,
@@ -64,7 +64,7 @@ import {
64
64
  TurboConfigSchema,
65
65
  WorktreeIsolationConfigSchema,
66
66
  resolveAutoReviewConfig
67
- } from "./index-fz9xcq6z.js";
67
+ } from "./index-y3kw1zpm.js";
68
68
  import {
69
69
  ALL_AGENT_NAMES,
70
70
  ALL_SUBAGENT_NAMES,
@@ -75,9 +75,9 @@ import {
75
75
  isQAAgent,
76
76
  isSubagent
77
77
  } from "./index-myt57pht.js";
78
+ import"./index-zjygnfay.js";
78
79
  import"./index-9e6fdz2h.js";
79
80
  import"./index-4rhhvd1a.js";
80
- import"./index-zjygnfay.js";
81
81
  import"./index-bk5tah7q.js";
82
82
  import"./index-bpmtbmy9.js";
83
83
  import"./index-zgwm4ryv.js";
@@ -0,0 +1,42 @@
1
+ // @bun
2
+ // src/utils/canonical-root.ts
3
+ import * as fsSync from "fs";
4
+ import * as path from "path";
5
+ var SESSION_KEY_SEPARATOR = String.fromCharCode(0);
6
+ var canonicalRootMemo = new Map;
7
+ var MAX_CANONICAL_ROOT_CACHE = 128;
8
+ function resolveCanonicalRootKey(directory) {
9
+ let resolved = path.resolve(directory);
10
+ try {
11
+ resolved = fsSync.realpathSync(resolved);
12
+ } catch {}
13
+ const key = process.platform === "win32" ? resolved.toLowerCase() : resolved;
14
+ return key;
15
+ }
16
+ function canonicalRootKey(directory) {
17
+ const memoized = canonicalRootMemo.get(directory);
18
+ if (memoized !== undefined)
19
+ return memoized;
20
+ const key = resolveCanonicalRootKey(directory);
21
+ if (!canonicalRootMemo.has(directory)) {
22
+ while (canonicalRootMemo.size >= MAX_CANONICAL_ROOT_CACHE) {
23
+ const oldest = canonicalRootMemo.keys().next().value;
24
+ if (oldest === undefined)
25
+ break;
26
+ canonicalRootMemo.delete(oldest);
27
+ }
28
+ }
29
+ canonicalRootMemo.set(directory, key);
30
+ return key;
31
+ }
32
+ function canonicalRootKeyFresh(directory) {
33
+ return resolveCanonicalRootKey(directory);
34
+ }
35
+ function compositeSessionKey(directory, sessionId) {
36
+ return `${canonicalRootKey(directory)}${SESSION_KEY_SEPARATOR}${sessionId}`;
37
+ }
38
+ function sessionKeySuffix(sessionId) {
39
+ return `${SESSION_KEY_SEPARATOR}${sessionId}`;
40
+ }
41
+
42
+ export { canonicalRootKeyFresh, compositeSessionKey, sessionKeySuffix };
@@ -168,5 +168,24 @@ async function readSwarmFileAsync(directory, filename, cache) {
168
168
  }
169
169
  return null;
170
170
  }
171
+ var TOKENS_PER_CHAR = 0.33;
172
+ function estimateTokensFromCharCount(chars) {
173
+ if (chars <= 0) {
174
+ return 0;
175
+ }
176
+ return Math.ceil(chars * TOKENS_PER_CHAR);
177
+ }
178
+ function estimateCharsForTokens(tokens) {
179
+ if (tokens <= 0) {
180
+ return 0;
181
+ }
182
+ return Math.floor(tokens / TOKENS_PER_CHAR);
183
+ }
184
+ function estimateTokens(text) {
185
+ if (!text) {
186
+ return 0;
187
+ }
188
+ return estimateTokensFromCharCount(text.length);
189
+ }
171
190
 
172
- export { safeHook, validateSwarmPath, readSwarmFileAsync };
191
+ export { safeHook, validateSwarmPath, readSwarmFileAsync, estimateCharsForTokens, estimateTokens };