opencode-live-compact 0.0.0-stage → 0.1.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 (58) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +138 -2
  3. package/README.zh-CN.md +139 -0
  4. package/dist/config.d.ts +15 -0
  5. package/dist/config.js +33 -0
  6. package/dist/config.js.map +1 -0
  7. package/dist/engine/checkpoint.d.ts +8 -0
  8. package/dist/engine/checkpoint.js +50 -0
  9. package/dist/engine/checkpoint.js.map +1 -0
  10. package/dist/engine/eligibility.d.ts +30 -0
  11. package/dist/engine/eligibility.js +149 -0
  12. package/dist/engine/eligibility.js.map +1 -0
  13. package/dist/engine/planner.d.ts +22 -0
  14. package/dist/engine/planner.js +56 -0
  15. package/dist/engine/planner.js.map +1 -0
  16. package/dist/engine/reducer.d.ts +13 -0
  17. package/dist/engine/reducer.js +48 -0
  18. package/dist/engine/reducer.js.map +1 -0
  19. package/dist/engine/span.d.ts +19 -0
  20. package/dist/engine/span.js +363 -0
  21. package/dist/engine/span.js.map +1 -0
  22. package/dist/hooks/context.d.ts +4 -0
  23. package/dist/hooks/context.js +29 -0
  24. package/dist/hooks/context.js.map +1 -0
  25. package/dist/hooks/replacement.d.ts +11 -0
  26. package/dist/hooks/replacement.js +278 -0
  27. package/dist/hooks/replacement.js.map +1 -0
  28. package/dist/hooks/session.d.ts +4 -0
  29. package/dist/hooks/session.js +53 -0
  30. package/dist/hooks/session.js.map +1 -0
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.js +64 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/metrics/collector.d.ts +41 -0
  35. package/dist/metrics/collector.js +17 -0
  36. package/dist/metrics/collector.js.map +1 -0
  37. package/dist/recovery/integrity.d.ts +11 -0
  38. package/dist/recovery/integrity.js +24 -0
  39. package/dist/recovery/integrity.js.map +1 -0
  40. package/dist/recovery/payloads.d.ts +19 -0
  41. package/dist/recovery/payloads.js +182 -0
  42. package/dist/recovery/payloads.js.map +1 -0
  43. package/dist/recovery/private-directory.d.ts +1 -0
  44. package/dist/recovery/private-directory.js +121 -0
  45. package/dist/recovery/private-directory.js.map +1 -0
  46. package/dist/recovery/restore.d.ts +12 -0
  47. package/dist/recovery/restore.js +32 -0
  48. package/dist/recovery/restore.js.map +1 -0
  49. package/dist/recovery/store.d.ts +51 -0
  50. package/dist/recovery/store.js +308 -0
  51. package/dist/recovery/store.js.map +1 -0
  52. package/dist/state/reconciliation.d.ts +32 -0
  53. package/dist/state/reconciliation.js +173 -0
  54. package/dist/state/reconciliation.js.map +1 -0
  55. package/docs/architecture.md +52 -0
  56. package/docs/assets/benchmarks-en.svg +106 -0
  57. package/docs/assets/benchmarks-zh-CN.svg +106 -0
  58. package/package.json +65 -4
@@ -0,0 +1,106 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1120" height="920" viewBox="0 0 1120 920" role="img" aria-labelledby="title desc" xml:lang="en">
2
+ <title id="title">OpenCode Live Compact: Aider and Web-Bench side by side</title>
3
+ <desc id="desc">Aider passed 150/150 in both with 12.3% lower estimated cost. Web-Bench passed 20/20 stages and 59/59 final tests in both with 3.1% lower estimated cost. Web-Bench pause benefit is inconclusive because Original OpenCode never compacted natively.</desc>
4
+ <style>text{font-family:Consolas,SFMono-Regular,Liberation Mono,Noto Sans SC,Microsoft YaHei,monospace;font-variant-numeric:tabular-nums}</style>
5
+ <rect x="0.5" y="0.5" width="1119" height="919" fill="#0b0b0b" stroke="#292929"/>
6
+ <text x="28" y="34" font-size="18" fill="#ededed" >opencode / live compact</text>
7
+ <text x="1092" y="34" font-size="14" fill="#969696" text-anchor="end">OpenCode 2.2.6 / GPT-6 Luna / 2026.11.09</text>
8
+ <path d="M0 57h1120" stroke="#292929"/>
9
+ <path d="M560 57V823" stroke="#353535"/>
10
+ <text x="28" y="96" font-size="27" fill="#ededed" font-weight="600">Aider Polyglot</text>
11
+ <text x="28" y="122" font-size="15" fill="#969696" >150 short exercises / five languages</text>
12
+ <text x="28" y="162" font-size="13" fill="#969696" >ESTIMATED API COST</text>
13
+ <text x="25" y="222" font-size="62" fill="#8cdb9f" font-weight="600" letter-spacing="-3">-12.3%</text>
14
+ <text x="532" y="196" font-size="22" fill="#bdbdbd" text-anchor="end">$6.048</text>
15
+ <text x="532" y="225" font-size="22" fill="#8cdb9f" text-anchor="end">→ $5.302</text>
16
+ <text x="28" y="248" font-size="14" fill="#969696" >Original OpenCode → Live Compact</text>
17
+ <rect x="28" y="268" width="504" height="57" fill="#151b17"/>
18
+ <text x="42" y="291" font-size="19" fill="#8cdb9f" >150/150 exercises passed in both</text>
19
+ <text x="42" y="313" font-size="13" fill="#969696" >First graded attempt: 150/150 in both</text>
20
+ <text x="28" y="357" font-size="16" fill="#ededed" >Peak context</text>
21
+ <text x="532" y="357" font-size="14" fill="#8cdb9f" text-anchor="end">-24.6%</text>
22
+ <rect x="28" y="370" width="357" height="11" fill="#696969"/>
23
+ <rect x="28" y="392" width="269.34025452794305" height="11" fill="#8cdb9f"/>
24
+ <text x="532" y="381" font-size="17" fill="#bdbdbd" text-anchor="end">783K</text>
25
+ <text x="532" y="403" font-size="17" fill="#8cdb9f" text-anchor="end">591K</text>
26
+ <text x="28" y="439" font-size="16" fill="#ededed" >Wall-clock time</text>
27
+ <text x="532" y="439" font-size="14" fill="#8cdb9f" text-anchor="end">-9.3%</text>
28
+ <rect x="28" y="452" width="357" height="11" fill="#696969"/>
29
+ <rect x="28" y="474" width="323.9387125882358" height="11" fill="#8cdb9f"/>
30
+ <text x="532" y="463" font-size="17" fill="#bdbdbd" text-anchor="end">5,106 s</text>
31
+ <text x="532" y="485" font-size="17" fill="#8cdb9f" text-anchor="end">4,633 s</text>
32
+ <path d="M28 505h504" stroke="#292929"/>
33
+ <text x="28" y="533" font-size="13" fill="#969696" >INPUT / CACHE</text>
34
+ <text x="532" y="533" font-size="12" fill="#969696" text-anchor="end">Original → Live Compact</text>
35
+ <text x="28" y="565" font-size="16" fill="#969696" >Cached input</text>
36
+ <text x="384" y="565" font-size="18" fill="#bdbdbd" text-anchor="end">296.35M</text>
37
+ <text x="404" y="565" font-size="17" fill="#696969" >→</text>
38
+ <text x="532" y="565" font-size="18" fill="#8cdb9f" text-anchor="end">266.75M</text>
39
+ <text x="28" y="596" font-size="16" fill="#969696" >Non-cached*</text>
40
+ <text x="384" y="596" font-size="18" fill="#bdbdbd" text-anchor="end">1.519M</text>
41
+ <text x="404" y="596" font-size="17" fill="#696969" >→</text>
42
+ <text x="532" y="596" font-size="18" fill="#ededed" text-anchor="end">1.759M</text>
43
+ <text x="28" y="627" font-size="16" fill="#969696" >Cache hit rate</text>
44
+ <text x="384" y="627" font-size="18" fill="#bdbdbd" text-anchor="end">99.49%</text>
45
+ <text x="404" y="627" font-size="17" fill="#696969" >→</text>
46
+ <text x="532" y="627" font-size="18" fill="#ededed" text-anchor="end">99.34%</text>
47
+ <path d="M28 647h504" stroke="#292929"/>
48
+ <text x="28" y="674" font-size="13" fill="#969696" >COMPACTION</text>
49
+ <text x="28" y="705" font-size="16" fill="#969696" >Native pauses</text>
50
+ <text x="532" y="705" font-size="18" fill="#8cdb9f" text-anchor="end">1 → 0</text>
51
+ <text x="28" y="736" font-size="16" fill="#969696" >Local cuts</text>
52
+ <text x="532" y="736" font-size="17" fill="#ededed" text-anchor="end">0 → 93 / 81 events</text>
53
+ <text x="28" y="767" font-size="16" fill="#969696" >Host wait</text>
54
+ <text x="532" y="767" font-size="18" fill="#8cdb9f" text-anchor="end">16.30 → 5.93 s</text>
55
+ <text x="28" y="795" font-size="13" fill="#8cdb9f" >63.6% less host compaction wait.</text>
56
+ <text x="588" y="96" font-size="27" fill="#ededed" font-weight="600">Web-Bench React</text>
57
+ <text x="588" y="122" font-size="15" fill="#969696" >20 dependent tasks / one React project</text>
58
+ <text x="588" y="162" font-size="13" fill="#969696" >ESTIMATED API COST</text>
59
+ <text x="585" y="222" font-size="62" fill="#8cdb9f" font-weight="600" letter-spacing="-3">-3.1%</text>
60
+ <text x="1092" y="196" font-size="22" fill="#bdbdbd" text-anchor="end">$0.1549</text>
61
+ <text x="1092" y="225" font-size="22" fill="#8cdb9f" text-anchor="end">→ $0.1501</text>
62
+ <text x="588" y="248" font-size="14" fill="#969696" >Original OpenCode → Live Compact</text>
63
+ <rect x="588" y="268" width="504" height="57" fill="#151b17"/>
64
+ <text x="602" y="291" font-size="19" fill="#8cdb9f" >20/20 stages passed in both</text>
65
+ <text x="602" y="313" font-size="13" fill="#969696" >Final browser checks: 59/59 in both</text>
66
+ <text x="588" y="357" font-size="16" fill="#ededed" >Peak context</text>
67
+ <text x="1092" y="357" font-size="14" fill="#8cdb9f" text-anchor="end">-41.5%</text>
68
+ <rect x="588" y="370" width="357" height="11" fill="#696969"/>
69
+ <rect x="588" y="392" width="208.8386833343803" height="11" fill="#8cdb9f"/>
70
+ <text x="1092" y="381" font-size="17" fill="#bdbdbd" text-anchor="end">191K</text>
71
+ <text x="1092" y="403" font-size="17" fill="#8cdb9f" text-anchor="end">112K</text>
72
+ <text x="588" y="439" font-size="16" fill="#ededed" >Wall-clock time</text>
73
+ <text x="1092" y="439" font-size="14" fill="#8cdb9f" text-anchor="end">-7.9%</text>
74
+ <rect x="588" y="452" width="357" height="11" fill="#696969"/>
75
+ <rect x="588" y="474" width="328.9216777208129" height="11" fill="#8cdb9f"/>
76
+ <text x="1092" y="463" font-size="17" fill="#bdbdbd" text-anchor="end">1,346 s</text>
77
+ <text x="1092" y="485" font-size="17" fill="#8cdb9f" text-anchor="end">1,240 s</text>
78
+ <path d="M588 505h504" stroke="#292929"/>
79
+ <text x="588" y="533" font-size="13" fill="#969696" >INPUT / CACHE</text>
80
+ <text x="1092" y="533" font-size="12" fill="#969696" text-anchor="end">Original → Live Compact</text>
81
+ <text x="588" y="565" font-size="16" fill="#969696" >Cached input</text>
82
+ <text x="944" y="565" font-size="18" fill="#bdbdbd" text-anchor="end">9.18M</text>
83
+ <text x="964" y="565" font-size="17" fill="#696969" >→</text>
84
+ <text x="1092" y="565" font-size="18" fill="#8cdb9f" text-anchor="end">4.47M</text>
85
+ <text x="588" y="596" font-size="16" fill="#969696" >Non-cached*</text>
86
+ <text x="944" y="596" font-size="18" fill="#bdbdbd" text-anchor="end">0.191M</text>
87
+ <text x="964" y="596" font-size="17" fill="#696969" >→</text>
88
+ <text x="1092" y="596" font-size="18" fill="#ededed" text-anchor="end">0.568M</text>
89
+ <text x="588" y="627" font-size="16" fill="#969696" >Cache hit rate</text>
90
+ <text x="944" y="627" font-size="18" fill="#bdbdbd" text-anchor="end">97.96%</text>
91
+ <text x="964" y="627" font-size="17" fill="#696969" >→</text>
92
+ <text x="1092" y="627" font-size="18" fill="#ededed" text-anchor="end">88.73%</text>
93
+ <path d="M588 647h504" stroke="#292929"/>
94
+ <text x="588" y="674" font-size="13" fill="#969696" >COMPACTION</text>
95
+ <text x="588" y="705" font-size="16" fill="#969696" >Native pauses</text>
96
+ <text x="1092" y="705" font-size="18" fill="#ededed" text-anchor="end">0 → 0</text>
97
+ <text x="588" y="736" font-size="16" fill="#969696" >Local cuts</text>
98
+ <text x="1092" y="736" font-size="17" fill="#ededed" text-anchor="end">0 → 14 / 12 events</text>
99
+ <text x="588" y="767" font-size="16" fill="#969696" >Host wait</text>
100
+ <text x="1092" y="767" font-size="18" fill="#d2b287" text-anchor="end">0 → 0.435 s</text>
101
+ <text x="588" y="795" font-size="13" fill="#d2b287" >Pause benefit inconclusive: no native pause.</text>
102
+ <path d="M0 823h1120" stroke="#292929"/>
103
+ <text x="28" y="849" font-size="14" fill="#969696" >Web-Bench first grading: Original 19/20 → Live Compact 20/20; repair attempts: 1 → 0.</text>
104
+ <text x="28" y="876" font-size="13" fill="#969696" >One pair per suite; costs are estimated. Tested build uses a 1K net-savings threshold.</text>
105
+ <text x="28" y="897" font-size="13" fill="#969696" >* Non-cached includes writes. Wait includes native + local host events, excluding outside planning.</text>
106
+ </svg>
@@ -0,0 +1,106 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1120" height="920" viewBox="0 0 1120 920" role="img" aria-labelledby="title desc" xml:lang="zh-CN">
2
+ <title id="title">OpenCode Live Compact:Aider 与 Web-Bench 并列对比</title>
3
+ <desc id="desc">Aider 两组通过150/150,Live Compact估算费用降低12.3%。Web-Bench两组完成20/20,最终测试59/59,估算费用降低3.1%;原版没有触发原生压缩,暂停收益尚无结论。</desc>
4
+ <style>text{font-family:Consolas,SFMono-Regular,Liberation Mono,Noto Sans SC,Microsoft YaHei,monospace;font-variant-numeric:tabular-nums}</style>
5
+ <rect x="0.5" y="0.5" width="1119" height="919" fill="#0b0b0b" stroke="#292929"/>
6
+ <text x="28" y="34" font-size="18" fill="#ededed" >opencode / live compact</text>
7
+ <text x="1092" y="34" font-size="14" fill="#969696" text-anchor="end">OpenCode 2.2.6 / GPT-6 Luna / 2026.11.09</text>
8
+ <path d="M0 57h1120" stroke="#292929"/>
9
+ <path d="M560 57V823" stroke="#353535"/>
10
+ <text x="28" y="96" font-size="27" fill="#ededed" font-weight="600">Aider Polyglot</text>
11
+ <text x="28" y="122" font-size="15" fill="#969696" >150 道短题 / 五种编程语言</text>
12
+ <text x="28" y="162" font-size="13" fill="#969696" >估算 API 费用</text>
13
+ <text x="25" y="222" font-size="62" fill="#8cdb9f" font-weight="600" letter-spacing="-3">-12.3%</text>
14
+ <text x="532" y="196" font-size="22" fill="#bdbdbd" text-anchor="end">$6.048</text>
15
+ <text x="532" y="225" font-size="22" fill="#8cdb9f" text-anchor="end">→ $5.302</text>
16
+ <text x="28" y="248" font-size="14" fill="#969696" >原版 OpenCode → Live Compact</text>
17
+ <rect x="28" y="268" width="504" height="57" fill="#151b17"/>
18
+ <text x="42" y="291" font-size="19" fill="#8cdb9f" >两组均通过 150/150 道题</text>
19
+ <text x="42" y="313" font-size="13" fill="#969696" >首次独立评分:两组均通过 150/150</text>
20
+ <text x="28" y="357" font-size="16" fill="#ededed" >上下文峰值</text>
21
+ <text x="532" y="357" font-size="14" fill="#8cdb9f" text-anchor="end">-24.6%</text>
22
+ <rect x="28" y="370" width="357" height="11" fill="#696969"/>
23
+ <rect x="28" y="392" width="269.34025452794305" height="11" fill="#8cdb9f"/>
24
+ <text x="532" y="381" font-size="17" fill="#bdbdbd" text-anchor="end">783K</text>
25
+ <text x="532" y="403" font-size="17" fill="#8cdb9f" text-anchor="end">591K</text>
26
+ <text x="28" y="439" font-size="16" fill="#ededed" >墙钟时间</text>
27
+ <text x="532" y="439" font-size="14" fill="#8cdb9f" text-anchor="end">-9.3%</text>
28
+ <rect x="28" y="452" width="357" height="11" fill="#696969"/>
29
+ <rect x="28" y="474" width="323.9387125882358" height="11" fill="#8cdb9f"/>
30
+ <text x="532" y="463" font-size="17" fill="#bdbdbd" text-anchor="end">5,106 秒</text>
31
+ <text x="532" y="485" font-size="17" fill="#8cdb9f" text-anchor="end">4,633 秒</text>
32
+ <path d="M28 505h504" stroke="#292929"/>
33
+ <text x="28" y="533" font-size="13" fill="#969696" >输入 / 缓存</text>
34
+ <text x="532" y="533" font-size="12" fill="#969696" text-anchor="end">原版 → Live Compact</text>
35
+ <text x="28" y="565" font-size="16" fill="#969696" >缓存命中</text>
36
+ <text x="384" y="565" font-size="18" fill="#bdbdbd" text-anchor="end">296.35M</text>
37
+ <text x="404" y="565" font-size="17" fill="#696969" >→</text>
38
+ <text x="532" y="565" font-size="18" fill="#8cdb9f" text-anchor="end">266.75M</text>
39
+ <text x="28" y="596" font-size="16" fill="#969696" >缓存未命中*</text>
40
+ <text x="384" y="596" font-size="18" fill="#bdbdbd" text-anchor="end">1.519M</text>
41
+ <text x="404" y="596" font-size="17" fill="#696969" >→</text>
42
+ <text x="532" y="596" font-size="18" fill="#ededed" text-anchor="end">1.759M</text>
43
+ <text x="28" y="627" font-size="16" fill="#969696" >缓存命中率</text>
44
+ <text x="384" y="627" font-size="18" fill="#bdbdbd" text-anchor="end">99.49%</text>
45
+ <text x="404" y="627" font-size="17" fill="#696969" >→</text>
46
+ <text x="532" y="627" font-size="18" fill="#ededed" text-anchor="end">99.34%</text>
47
+ <path d="M28 647h504" stroke="#292929"/>
48
+ <text x="28" y="674" font-size="13" fill="#969696" >压缩</text>
49
+ <text x="28" y="705" font-size="16" fill="#969696" >原生暂停</text>
50
+ <text x="532" y="705" font-size="18" fill="#8cdb9f" text-anchor="end">1 → 0</text>
51
+ <text x="28" y="736" font-size="16" fill="#969696" >本地压缩刀数</text>
52
+ <text x="532" y="736" font-size="17" fill="#ededed" text-anchor="end">0 → 93 刀 / 81 次替换</text>
53
+ <text x="28" y="767" font-size="16" fill="#969696" >宿主等待</text>
54
+ <text x="532" y="767" font-size="18" fill="#8cdb9f" text-anchor="end">16.30 → 5.93 秒</text>
55
+ <text x="28" y="795" font-size="13" fill="#8cdb9f" >宿主压缩等待减少 63.6%。</text>
56
+ <text x="588" y="96" font-size="27" fill="#ededed" font-weight="600">Web-Bench React</text>
57
+ <text x="588" y="122" font-size="15" fill="#969696" >20 个依赖任务 / 同一个 React 项目</text>
58
+ <text x="588" y="162" font-size="13" fill="#969696" >估算 API 费用</text>
59
+ <text x="585" y="222" font-size="62" fill="#8cdb9f" font-weight="600" letter-spacing="-3">-3.1%</text>
60
+ <text x="1092" y="196" font-size="22" fill="#bdbdbd" text-anchor="end">$0.1549</text>
61
+ <text x="1092" y="225" font-size="22" fill="#8cdb9f" text-anchor="end">→ $0.1501</text>
62
+ <text x="588" y="248" font-size="14" fill="#969696" >原版 OpenCode → Live Compact</text>
63
+ <rect x="588" y="268" width="504" height="57" fill="#151b17"/>
64
+ <text x="602" y="291" font-size="19" fill="#8cdb9f" >两组均完成 20/20 个任务</text>
65
+ <text x="602" y="313" font-size="13" fill="#969696" >最终浏览器测试:两组均通过 59/59</text>
66
+ <text x="588" y="357" font-size="16" fill="#ededed" >上下文峰值</text>
67
+ <text x="1092" y="357" font-size="14" fill="#8cdb9f" text-anchor="end">-41.5%</text>
68
+ <rect x="588" y="370" width="357" height="11" fill="#696969"/>
69
+ <rect x="588" y="392" width="208.8386833343803" height="11" fill="#8cdb9f"/>
70
+ <text x="1092" y="381" font-size="17" fill="#bdbdbd" text-anchor="end">191K</text>
71
+ <text x="1092" y="403" font-size="17" fill="#8cdb9f" text-anchor="end">112K</text>
72
+ <text x="588" y="439" font-size="16" fill="#ededed" >墙钟时间</text>
73
+ <text x="1092" y="439" font-size="14" fill="#8cdb9f" text-anchor="end">-7.9%</text>
74
+ <rect x="588" y="452" width="357" height="11" fill="#696969"/>
75
+ <rect x="588" y="474" width="328.9216777208129" height="11" fill="#8cdb9f"/>
76
+ <text x="1092" y="463" font-size="17" fill="#bdbdbd" text-anchor="end">1,346 秒</text>
77
+ <text x="1092" y="485" font-size="17" fill="#8cdb9f" text-anchor="end">1,240 秒</text>
78
+ <path d="M588 505h504" stroke="#292929"/>
79
+ <text x="588" y="533" font-size="13" fill="#969696" >输入 / 缓存</text>
80
+ <text x="1092" y="533" font-size="12" fill="#969696" text-anchor="end">原版 → Live Compact</text>
81
+ <text x="588" y="565" font-size="16" fill="#969696" >缓存命中</text>
82
+ <text x="944" y="565" font-size="18" fill="#bdbdbd" text-anchor="end">9.18M</text>
83
+ <text x="964" y="565" font-size="17" fill="#696969" >→</text>
84
+ <text x="1092" y="565" font-size="18" fill="#8cdb9f" text-anchor="end">4.47M</text>
85
+ <text x="588" y="596" font-size="16" fill="#969696" >缓存未命中*</text>
86
+ <text x="944" y="596" font-size="18" fill="#bdbdbd" text-anchor="end">0.191M</text>
87
+ <text x="964" y="596" font-size="17" fill="#696969" >→</text>
88
+ <text x="1092" y="596" font-size="18" fill="#ededed" text-anchor="end">0.568M</text>
89
+ <text x="588" y="627" font-size="16" fill="#969696" >缓存命中率</text>
90
+ <text x="944" y="627" font-size="18" fill="#bdbdbd" text-anchor="end">97.96%</text>
91
+ <text x="964" y="627" font-size="17" fill="#696969" >→</text>
92
+ <text x="1092" y="627" font-size="18" fill="#ededed" text-anchor="end">88.73%</text>
93
+ <path d="M588 647h504" stroke="#292929"/>
94
+ <text x="588" y="674" font-size="13" fill="#969696" >压缩</text>
95
+ <text x="588" y="705" font-size="16" fill="#969696" >原生暂停</text>
96
+ <text x="1092" y="705" font-size="18" fill="#ededed" text-anchor="end">0 → 0</text>
97
+ <text x="588" y="736" font-size="16" fill="#969696" >本地压缩刀数</text>
98
+ <text x="1092" y="736" font-size="17" fill="#ededed" text-anchor="end">0 → 14 刀 / 12 次替换</text>
99
+ <text x="588" y="767" font-size="16" fill="#969696" >宿主等待</text>
100
+ <text x="1092" y="767" font-size="18" fill="#d2b287" text-anchor="end">0 → 0.435 秒</text>
101
+ <text x="588" y="795" font-size="13" fill="#d2b287" >原版未触发原生压缩,暂停收益尚无结论。</text>
102
+ <path d="M0 823h1120" stroke="#292929"/>
103
+ <text x="28" y="849" font-size="14" fill="#969696" >Web-Bench 首次评分:原版 19/20 → Live Compact 20/20;额外修复:1 → 0。</text>
104
+ <text x="28" y="876" font-size="13" fill="#969696" >各一组配对实验;费用为估算。测试版本使用 1K 净节省门槛。</text>
105
+ <text x="28" y="897" font-size="13" fill="#969696" >* 未命中包含缓存写入。等待时间包含原生和本地宿主事件,不含事件之外的规划。</text>
106
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,67 @@
1
1
  {
2
2
  "name": "opencode-live-compact",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Deterministic incremental context compaction for OpenCode V2",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "opencode",
8
+ "opencode-plugin",
9
+ "live-compact",
10
+ "context-compaction",
11
+ "context-management",
12
+ "prompt-caching",
13
+ "coding-agent",
14
+ "typescript"
15
+ ],
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/Haoming9527/opencode-live-compact.git"
19
+ },
20
+ "homepage": "https://github.com/Haoming9527/opencode-live-compact#readme",
21
+ "bugs": {
22
+ "url": "https://github.com/Haoming9527/opencode-live-compact/issues"
23
+ },
24
+ "type": "module",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.js"
29
+ },
30
+ "./server": {
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js"
33
+ }
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "LICENSE",
38
+ "README.md",
39
+ "README.zh-CN.md",
40
+ "docs/architecture.md",
41
+ "docs/assets/benchmarks-en.svg",
42
+ "docs/assets/benchmarks-zh-CN.svg"
43
+ ],
44
+ "scripts": {
45
+ "build": "tsc -p tsconfig.build.json",
46
+ "typecheck": "tsc --noEmit",
47
+ "test": "npm run build && node --test \"tests/*.test.ts\"",
48
+ "test:integration": "npm run build && node --test tests/plugin.integration.ts",
49
+ "benchmark": "node benchmarks/run.ts",
50
+ "prepack": "npm run build"
51
+ },
52
+ "engines": {
53
+ "node": ">=22.18"
54
+ },
55
+ "dependencies": {
56
+ "@opencode/plugin": "2.2.6"
57
+ },
58
+ "devDependencies": {
59
+ "@opencode/client": "2.2.6",
60
+ "@types/node": "22.20.5",
61
+ "typescript": "5.9.3"
62
+ },
63
+ "publishConfig": {
64
+ "access": "public",
65
+ "registry": "https://registry.npmjs.org/"
66
+ }
67
+ }