dsh-context-compression-improved 0.9.8 → 0.9.9-beta.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 (239) hide show
  1. package/README.md +15 -98
  2. package/README.zh.md +14 -92
  3. package/THIRD_PARTY_NOTICES.md +25 -7
  4. package/{packages/selector/dsh.plugin.json → dsh.plugin.json} +1 -1
  5. package/{packages/selector/lib → lib}/client.d.ts +16 -0
  6. package/{packages/selector/lib → lib}/client.js +393 -116
  7. package/{packages/selector/lib → lib}/index.js +829 -10
  8. package/{packages/selector/lib → lib}/invariant.js +2 -1
  9. package/{packages/selector/lib → lib}/pruner.d.ts +1 -1
  10. package/{packages/selector/lib → lib}/pruner.js +77 -983
  11. package/lib/savings-integral.js +4515 -0
  12. package/{packages/selector/lib → lib}/tail-trim.js +2 -90
  13. package/lib/tool-result.js +150 -0
  14. package/package.json +125 -112
  15. package/screenshots.json +3 -6
  16. package/.gitattributes +0 -2
  17. package/.githooks/pre-push +0 -37
  18. package/.github/workflows/ci.yml +0 -39
  19. package/CHANGELOG.de.md +0 -580
  20. package/CHANGELOG.es.md +0 -588
  21. package/CHANGELOG.fr.md +0 -576
  22. package/CHANGELOG.it.md +0 -577
  23. package/CHANGELOG.ja.md +0 -261
  24. package/CHANGELOG.ko.md +0 -254
  25. package/CHANGELOG.md +0 -536
  26. package/CHANGELOG.ru.md +0 -554
  27. package/CHANGELOG.zh.md +0 -236
  28. package/CONTRIBUTING.md +0 -22
  29. package/README.de.md +0 -96
  30. package/README.es.md +0 -96
  31. package/README.fr.md +0 -96
  32. package/README.it.md +0 -96
  33. package/README.ja.md +0 -102
  34. package/README.ko.md +0 -102
  35. package/README.ru.md +0 -96
  36. package/SECURITY.md +0 -18
  37. package/assets/board.png +0 -0
  38. package/assets/context.png +0 -0
  39. package/docs/assets/context-compression-selector-profiles.jpg +0 -0
  40. package/docs/assets/context-compression-selector-settings.png +0 -0
  41. package/docs/compat-0.1.5-report.md +0 -77
  42. package/docs/installation.de.md +0 -104
  43. package/docs/installation.es.md +0 -104
  44. package/docs/installation.fr.md +0 -104
  45. package/docs/installation.it.md +0 -104
  46. package/docs/installation.ja.md +0 -78
  47. package/docs/installation.ko.md +0 -78
  48. package/docs/installation.md +0 -103
  49. package/docs/installation.ru.md +0 -104
  50. package/docs/installation.zh.md +0 -100
  51. package/docs/repair-log.md +0 -657
  52. package/eslint.config.js +0 -30
  53. package/packages/selector/LICENSE +0 -21
  54. package/packages/selector/README.md +0 -26
  55. package/packages/selector/README.zh.md +0 -24
  56. package/packages/selector/THIRD_PARTY_NOTICES.md +0 -32
  57. package/packages/selector/docs/history-tool-call-working-set-spec.md +0 -112
  58. package/packages/selector/docs/native-tool-result-selector-spec.md +0 -34
  59. package/packages/selector/docs/subagent-cache-reuse-spec.md +0 -46
  60. package/packages/selector/lib/config.js +0 -1777
  61. package/packages/selector/lib/host-generation.js +0 -62
  62. package/packages/selector/lib/style.css +0 -350
  63. package/packages/selector/package.json +0 -174
  64. package/packages/selector/screenshots.json +0 -3
  65. package/packages/selector/src/client/CompressionProfileControls.tsx +0 -293
  66. package/packages/selector/src/client/CompressionProfileSelector.module.css +0 -199
  67. package/packages/selector/src/client/CompressionProfileSelector.tsx +0 -85
  68. package/packages/selector/src/client/CustomPolicyEditor.tsx +0 -216
  69. package/packages/selector/src/client/EstimatorControls.tsx +0 -277
  70. package/packages/selector/src/client/bridge-scope.ts +0 -125
  71. package/packages/selector/src/client/decode.ts +0 -57
  72. package/packages/selector/src/client/index.ts +0 -421
  73. package/packages/selector/src/client/locales/de.ts +0 -142
  74. package/packages/selector/src/client/locales/es.ts +0 -142
  75. package/packages/selector/src/client/locales/fr.ts +0 -142
  76. package/packages/selector/src/client/locales/it.ts +0 -142
  77. package/packages/selector/src/client/locales/ja.ts +0 -142
  78. package/packages/selector/src/client/locales/ko.ts +0 -142
  79. package/packages/selector/src/client/locales/ru.ts +0 -142
  80. package/packages/selector/src/client/locales.ts +0 -284
  81. package/packages/selector/src/client/monitor-fab.ts +0 -349
  82. package/packages/selector/src/client/preset-options.ts +0 -88
  83. package/packages/selector/src/client/savings-card.tsx +0 -150
  84. package/packages/selector/src/client/scope-face.ts +0 -24
  85. package/packages/selector/src/client/settings-section.tsx +0 -140
  86. package/packages/selector/src/compat/host-generation.ts +0 -96
  87. package/packages/selector/src/compat/llm-messages.ts +0 -50
  88. package/packages/selector/src/compat/settings-lease.ts +0 -108
  89. package/packages/selector/src/compat/tool-result.ts +0 -91
  90. package/packages/selector/src/css-modules.d.ts +0 -6
  91. package/packages/selector/src/deepseek-v4-tokenizer.ts +0 -205
  92. package/packages/selector/src/estimator-catalog.ts +0 -104
  93. package/packages/selector/src/index.ts +0 -655
  94. package/packages/selector/src/invariant.ts +0 -113
  95. package/packages/selector/src/preset-overlay.ts +0 -749
  96. package/packages/selector/src/profiles.ts +0 -431
  97. package/packages/selector/src/pruner/content.ts +0 -198
  98. package/packages/selector/src/pruner/session.ts +0 -97
  99. package/packages/selector/src/pruner/state.ts +0 -61
  100. package/packages/selector/src/pruner/tuning.ts +0 -23
  101. package/packages/selector/src/pruner/types.ts +0 -78
  102. package/packages/selector/src/pruner.ts +0 -2868
  103. package/packages/selector/src/runtime/adaptive-cost.ts +0 -205
  104. package/packages/selector/src/runtime/audit.ts +0 -303
  105. package/packages/selector/src/runtime/config.ts +0 -756
  106. package/packages/selector/src/runtime/custom-policy.ts +0 -278
  107. package/packages/selector/src/runtime/deepseek-official-pricing.ts +0 -298
  108. package/packages/selector/src/runtime/deepseek-v4-vision-tokens.ts +0 -254
  109. package/packages/selector/src/runtime/measurement.ts +0 -444
  110. package/packages/selector/src/runtime/monitor.ts +0 -235
  111. package/packages/selector/src/runtime/reducers.ts +0 -1754
  112. package/packages/selector/src/runtime/retrieve.ts +0 -484
  113. package/packages/selector/src/runtime/savings-projection.ts +0 -226
  114. package/packages/selector/src/runtime/savings.ts +0 -417
  115. package/packages/selector/src/runtime/session-events.ts +0 -30
  116. package/packages/selector/src/runtime/summary-command.ts +0 -127
  117. package/packages/selector/src/runtime/tail-trim.ts +0 -176
  118. package/packages/selector/src/runtime/token-count.ts +0 -72
  119. package/packages/selector/src/runtime/tokenpilot/advisor-prompt.ts +0 -233
  120. package/packages/selector/src/runtime/tokenpilot/advisor-state.ts +0 -204
  121. package/packages/selector/src/runtime/tokenpilot/advisor.ts +0 -419
  122. package/packages/selector/src/runtime/tokenpilot/benefit.ts +0 -200
  123. package/packages/selector/src/runtime/tokenpilot/dedup.ts +0 -81
  124. package/packages/selector/src/runtime/tokenpilot/estimator.ts +0 -151
  125. package/packages/selector/src/runtime/tokenpilot/intent-fold.ts +0 -53
  126. package/packages/selector/src/runtime/tokenpilot/intent-gate.ts +0 -65
  127. package/packages/selector/src/runtime/tokenpilot/intent-input-mask.ts +0 -125
  128. package/packages/selector/src/runtime/tokenpilot/intent-range.ts +0 -37
  129. package/packages/selector/src/runtime/tokenpilot/locator.ts +0 -128
  130. package/packages/selector/src/runtime/tokenpilot/read-state.ts +0 -98
  131. package/packages/selector/src/runtime/tokenpilot/sidechannel.ts +0 -303
  132. package/packages/selector/src/runtime/toolclass.ts +0 -103
  133. package/packages/selector/src/runtime/types.ts +0 -365
  134. package/packages/selector/src/runtime/value.ts +0 -48
  135. package/packages/selector/src/settings-bridge.ts +0 -175
  136. package/packages/selector/tests/advisor-report.host.spec.ts +0 -223
  137. package/packages/selector/tests/auto-compact.client.spec.tsx +0 -214
  138. package/packages/selector/tests/built/client-artifact.spec.ts +0 -56
  139. package/packages/selector/tests/cache-prefix-audit.spec.ts +0 -123
  140. package/packages/selector/tests/code-skeleton.client.spec.ts +0 -98
  141. package/packages/selector/tests/compat/compat-narrow-waist.spec.ts +0 -150
  142. package/packages/selector/tests/custom-contract.client.spec.ts +0 -226
  143. package/packages/selector/tests/estimator-catalog.spec.ts +0 -70
  144. package/packages/selector/tests/estimator-channel.client.spec.tsx +0 -253
  145. package/packages/selector/tests/estimator-route-registration.host.spec.ts +0 -199
  146. package/packages/selector/tests/helpers/legacy-namespace.ts +0 -35
  147. package/packages/selector/tests/helpers/legacy-settings/index.ts +0 -15
  148. package/packages/selector/tests/helpers/legacy-settings/legacy/provider.d.ts +0 -41
  149. package/packages/selector/tests/helpers/legacy-settings/legacy/provider.js +0 -647
  150. package/packages/selector/tests/helpers/legacy-settings/legacy/redact.js +0 -78
  151. package/packages/selector/tests/helpers/legacy-settings/legacy/util-values.js +0 -234
  152. package/packages/selector/tests/host-preset-overlay.host.spec.ts +0 -204
  153. package/packages/selector/tests/monitor-fab.client.spec.ts +0 -138
  154. package/packages/selector/tests/preset-options-write.client.spec.ts +0 -192
  155. package/packages/selector/tests/preset-overlay-loader.e2e.host.spec.ts +0 -200
  156. package/packages/selector/tests/preset-overlay.host.spec.ts +0 -246
  157. package/packages/selector/tests/profiles.client.spec.tsx +0 -436
  158. package/packages/selector/tests/public/package-contract.client.spec.ts +0 -86
  159. package/packages/selector/tests/runtime/adaptive-cost.spec.ts +0 -167
  160. package/packages/selector/tests/runtime/advice-never-withholds.host.spec.ts +0 -230
  161. package/packages/selector/tests/runtime/advisor-invariant.spec.ts +0 -272
  162. package/packages/selector/tests/runtime/advisor.spec.ts +0 -226
  163. package/packages/selector/tests/runtime/audit.spec.ts +0 -275
  164. package/packages/selector/tests/runtime/auto-compact-config.spec.ts +0 -523
  165. package/packages/selector/tests/runtime/char-basis.spec.ts +0 -30
  166. package/packages/selector/tests/runtime/code-skeleton.spec.ts +0 -152
  167. package/packages/selector/tests/runtime/deepseek-official-pricing.spec.ts +0 -186
  168. package/packages/selector/tests/runtime/deepseek-v4-tokenizer.spec.ts +0 -122
  169. package/packages/selector/tests/runtime/deepseek-v4-vision-tokens.spec.ts +0 -122
  170. package/packages/selector/tests/runtime/deprecated-preset-options.spec.ts +0 -96
  171. package/packages/selector/tests/runtime/fixtures/profile-baseline.json +0 -273
  172. package/packages/selector/tests/runtime/fixtures/tokenizer-golden.json +0 -106
  173. package/packages/selector/tests/runtime/fixtures/vision-golden.json +0 -459
  174. package/packages/selector/tests/runtime/frequency-longstrings.spec.ts +0 -74
  175. package/packages/selector/tests/runtime/fresh-gate.spec.ts +0 -43
  176. package/packages/selector/tests/runtime/html-reducer.spec.ts +0 -212
  177. package/packages/selector/tests/runtime/intent-gate.spec.ts +0 -62
  178. package/packages/selector/tests/runtime/intent-summary.spec.ts +0 -156
  179. package/packages/selector/tests/runtime/jsonl-reducer.spec.ts +0 -79
  180. package/packages/selector/tests/runtime/line-mapping.spec.ts +0 -153
  181. package/packages/selector/tests/runtime/monitor.spec.ts +0 -301
  182. package/packages/selector/tests/runtime/prose-reducers.spec.ts +0 -133
  183. package/packages/selector/tests/runtime/public/public-runtime.spec.ts +0 -2782
  184. package/packages/selector/tests/runtime/read-input-cap.spec.ts +0 -33
  185. package/packages/selector/tests/runtime/savings-projection.spec.ts +0 -89
  186. package/packages/selector/tests/runtime/savings.spec.ts +0 -139
  187. package/packages/selector/tests/runtime/search-reducer.spec.ts +0 -110
  188. package/packages/selector/tests/runtime/session-events.spec.ts +0 -27
  189. package/packages/selector/tests/runtime/settings-unwrap.spec.ts +0 -58
  190. package/packages/selector/tests/runtime/sidechannel.spec.ts +0 -241
  191. package/packages/selector/tests/runtime/summary-command.spec.ts +0 -154
  192. package/packages/selector/tests/runtime/toc-and-bundled.spec.ts +0 -159
  193. package/packages/selector/tests/runtime/tokenizer-golden.spec.ts +0 -53
  194. package/packages/selector/tests/runtime/tokenpilot/benefit.spec.ts +0 -217
  195. package/packages/selector/tests/runtime/tokenpilot/dedup.spec.ts +0 -52
  196. package/packages/selector/tests/runtime/tokenpilot/estimator.spec.ts +0 -79
  197. package/packages/selector/tests/runtime/tokenpilot/locator.spec.ts +0 -76
  198. package/packages/selector/tests/runtime/tokenpilot/profile-baseline.spec.ts +0 -119
  199. package/packages/selector/tests/runtime/tokenpilot/read-state.spec.ts +0 -82
  200. package/packages/selector/tests/runtime/toolclass.spec.ts +0 -156
  201. package/packages/selector/tests/runtime/value.spec.ts +0 -23
  202. package/packages/selector/tests/settings-seat.client.spec.ts +0 -215
  203. package/packages/selector/tests/standing-generation.host.spec.ts +0 -724
  204. package/packages/selector/tests/subagent-cache-reuse.host.spec.ts +0 -269
  205. package/packages/selector/tests/support/cache-prefix-audit.ts +0 -105
  206. package/packages/selector/tests/support/mock-adapter.ts +0 -37
  207. package/packages/selector/tests/support/ui-primitives.tsx +0 -34
  208. package/packages/selector/tsconfig.json +0 -11
  209. package/packages/selector/tsdown.client.config.ts +0 -102
  210. package/packages/selector/tsdown.config.ts +0 -20
  211. package/pnpm-workspace.yaml +0 -72
  212. package/scripts/capture-profile-baseline.mjs +0 -42
  213. package/scripts/cell-browser-e2e.mjs +0 -354
  214. package/scripts/generate-tokenizer-fixtures.py +0 -81
  215. package/scripts/generate-vision-fixtures.py +0 -208
  216. package/scripts/hosts.mjs +0 -78
  217. package/scripts/packed-components-smoke.mjs +0 -763
  218. package/scripts/packed-install-e2e.mjs +0 -1346
  219. package/scripts/sync-hosts.mjs +0 -174
  220. package/scripts/toolclass-corpus-replay.mjs +0 -281
  221. package/scripts/verify-release.mjs +0 -335
  222. package/tests/TEST_INVENTORY.md +0 -41
  223. package/tsconfig.base.json +0 -18
  224. package/tsconfig.json +0 -7
  225. package/tsconfig.tests.json +0 -15
  226. package/vitest.built.config.ts +0 -9
  227. package/vitest.config.ts +0 -46
  228. /package/{packages/selector/assets → assets}/deepseek-v4/LICENSE.DeepSeek-V4-Pro.txt +0 -0
  229. /package/{packages/selector/assets → assets}/deepseek-v4/manifest.json +0 -0
  230. /package/{packages/selector/assets → assets}/deepseek-v4/tokenizer.json +0 -0
  231. /package/{packages/selector/assets → assets}/deepseek-v4/tokenizer_config.json +0 -0
  232. /package/{packages/selector/assets → assets}/deepseek-v4-vision-exp/LICENSE.DeepSeek-V4-Flash-Vision-Exp.txt +0 -0
  233. /package/{packages/selector/assets → assets}/deepseek-v4-vision-exp/manifest.json +0 -0
  234. /package/{packages/selector/assets → assets}/deepseek-v4-vision-exp/tokenizer.json +0 -0
  235. /package/{packages/selector/assets → assets}/deepseek-v4-vision-exp/tokenizer_config.json +0 -0
  236. /package/{packages/selector/cordis.patch.yml → cordis.patch.yml} +0 -0
  237. /package/{packages/selector/lib → lib}/index.d.ts +0 -0
  238. /package/{packages/selector/lib → lib}/invariant.d.ts +0 -0
  239. /package/{packages/selector/lib → lib}/profiles.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { r as hostGenerationSnapshot } from "./host-generation.js";
1
+ import { n as viewToolResult, s as sessionEvents, t as compressionMessageSource } from "./tool-result.js";
2
2
  //#region src/compat/llm-messages.ts
3
3
  /** Recursive `Object.freeze` over own enumerable properties (arrays included). */
4
4
  function deepFreeze(value) {
@@ -23,94 +23,6 @@ function createUserMessage(input) {
23
23
  }));
24
24
  }
25
25
  //#endregion
26
- //#region src/runtime/session-events.ts
27
- /**
28
- * Read one immutable Session event snapshot.
29
- *
30
- * Harness rc.2 exposed `events`; Alpha 5 replaced it with the public
31
- * `snapshotEvents()` method. Prefer the new API when present and retain the
32
- * old accessor as the compatibility fallback for already-supported hosts.
33
- */
34
- function sessionEvents(session) {
35
- const snapshot = session.snapshotEvents;
36
- if (typeof snapshot === "function") return snapshot.call(session);
37
- return session.events ?? [];
38
- }
39
- /**
40
- * Resolve one surface-node seq to its event. 0.1.5 surface nodes are
41
- * positional and may replace earlier ranges, so a node's seq is not
42
- * guaranteed to equal the snapshot array index: always resolve by seq.
43
- */
44
- function eventBySeq(events, seq) {
45
- return events[Number(seq)];
46
- }
47
- //#endregion
48
- //#region src/compat/tool-result.ts
49
- /**
50
- * Tool-result envelope adapter (audit N2: three-axis relocation, not a
51
- * single-axis unwrap) + legacy message-source kind escape (audit B6).
52
- *
53
- * Three-axis mapping, main's own comment as evidence
54
- * (pruner/session.ts: "0.1.7-rc.2: isError moved from the result block onto
55
- * the message itself"):
56
- *
57
- * semantics Gen D (0.1.7-rc.2+ / 0.2.0) Gen A/B/C (0.1.0–0.1.5)
58
- * content blocks message.content message.content[0].content
59
- * error location message.isError message.content[0].isError
60
- * call id message.toolCallId message.source.callId
61
- *
62
- * Every consumer must take the whole triple from viewToolResult(); touching
63
- * a single axis inline is how the isError/callId axes get silently dropped.
64
- * A strict legacy signature overrides the generation flag per message (the
65
- * 0.1.7-rc.1 envelope shape was only load-verified, not session-verified —
66
- * this makes a wrong flag self-correcting instead of silently misreading).
67
- */
68
- /** Strict signature of the enveloped (0.1.x) tool/result message. */
69
- function envelopedShape(content) {
70
- return Array.isArray(content) && content.length === 1 && typeof content[0] === "object" && content[0] !== null && content[0].type === "tool-result" && Array.isArray(content[0].content);
71
- }
72
- function viewToolResult(message, generation) {
73
- const gen = generation ?? hostGenerationSnapshot();
74
- const content = message.content;
75
- if (envelopedShape(content)) {
76
- const wrapper = content[0];
77
- return {
78
- blocks: wrapper.content,
79
- isError: wrapper.isError === true,
80
- callId: typeof message.source?.callId === "string" ? message.source.callId : void 0
81
- };
82
- }
83
- if (gen === "legacy") {
84
- const wrapper = Array.isArray(content) ? content[0] : void 0;
85
- if (wrapper && typeof wrapper === "object" && Array.isArray(wrapper.content)) return {
86
- blocks: wrapper.content,
87
- isError: wrapper.isError === true,
88
- callId: typeof message.source?.callId === "string" ? message.source.callId : void 0
89
- };
90
- }
91
- return {
92
- blocks: Array.isArray(content) ? content : [],
93
- isError: message.isError === true,
94
- callId: typeof message.toolCallId === "string" ? message.toolCallId : gen === "legacy" && typeof message.source?.callId === "string" ? message.source.callId : void 0
95
- };
96
- }
97
- /**
98
- * Per-producer source kind, generation-gated. Modern hosts accept the
99
- * producer-declared kind (declared in pruner.ts's `MessageSourceMap`
100
- * augmentation); 0.1.x hosts only know the shared `{ kind: 'plugin' }` kind
101
- * — the dev bed's dsh-llm@0.2.0-rc.1 type face has no such member (audit B6,
102
- * empirically confirmed), so the legacy object escapes through `as never`
103
- * HERE and nowhere else.
104
- */
105
- const PLUGIN_ID = "dsh-context-compression-improved";
106
- function compressionMessageSource(generation) {
107
- if ((generation ?? hostGenerationSnapshot()) === "legacy") return {
108
- kind: "plugin",
109
- plugin: PLUGIN_ID
110
- };
111
- return { kind: "dsh-context-compression" };
112
- }
113
- //#endregion
114
26
  //#region src/runtime/tail-trim.ts
115
27
  /** Plugin-owned TailTrim publication protocol over official Session events. */
116
28
  const TAIL_TRIM_REF_PATTERN = /^session:\/\/([^/]+)\/tailtrim\/(\d+)$/;
@@ -231,4 +143,4 @@ function sameNumbers(left, right) {
231
143
  return left !== void 0 && left.length === right.length && left.every((value, index) => value === right[index]);
232
144
  }
233
145
  //#endregion
234
- export { validatePublishedTailTrim as a, eventBySeq as c, freezeMessage as d, tailTrimStub as i, sessionEvents as l, tailTrimMessage as n, compressionMessageSource as o, tailTrimRef as r, viewToolResult as s, parseTailTrimRef as t, createUserMessage as u };
146
+ export { validatePublishedTailTrim as a, tailTrimStub as i, tailTrimMessage as n, createUserMessage as o, tailTrimRef as r, freezeMessage as s, parseTailTrimRef as t };
@@ -0,0 +1,150 @@
1
+ //#region src/runtime/session-events.ts
2
+ /**
3
+ * Read one immutable Session event snapshot.
4
+ *
5
+ * Harness rc.2 exposed `events`; Alpha 5 replaced it with the public
6
+ * `snapshotEvents()` method. Prefer the new API when present and retain the
7
+ * old accessor as the compatibility fallback for already-supported hosts.
8
+ */
9
+ function sessionEvents(session) {
10
+ const snapshot = session.snapshotEvents;
11
+ if (typeof snapshot === "function") return snapshot.call(session);
12
+ return session.events ?? [];
13
+ }
14
+ /**
15
+ * Resolve one surface-node seq to its event. 0.1.5 surface nodes are
16
+ * positional and may replace earlier ranges, so a node's seq is not
17
+ * guaranteed to equal the snapshot array index: always resolve by seq.
18
+ */
19
+ function eventBySeq(events, seq) {
20
+ return events[Number(seq)];
21
+ }
22
+ //#endregion
23
+ //#region src/compat/host-generation.ts
24
+ let cached;
25
+ /**
26
+ * Pure classifier from a RESOLVED settings service face. A service that still
27
+ * exposes `register` is a pre-0.1.7 host (0.1.0–0.1.5 lines, dsh-settings pack
28
+ * evidence — verified on the real 0.1.0-rc.2 host: `register(ns, schema,
29
+ * options)` at dsh-settings/lib/index.js:311); from 0.1.7-rc.1 the service
30
+ * drops register entirely and settings live in the loader-managed entry
31
+ * config.
32
+ */
33
+ function classifySettingsFace(settings) {
34
+ return typeof settings?.register === "function" ? "legacy" : "modern";
35
+ }
36
+ /**
37
+ * Probe the host generation from the settings service face.
38
+ *
39
+ * A verdict is only CACHED from a resolved service object. Rows compose
40
+ * before host services on every line (measured: the wire-time probe on a real
41
+ * 0.1.0-rc.2 cell saw no settings service yet and the old code cached
42
+ * 'modern' forever — the legacy lease arm went dead on the exact line it was
43
+ * built for). While the service is absent the answer is a provisional
44
+ * 'modern' and deliberately uncached, so the definitive
45
+ * `noteResolvedSettingsService` evidence can still flip it.
46
+ */
47
+ function detectHostGeneration(ctx) {
48
+ if (cached !== void 0) return cached;
49
+ let settings;
50
+ try {
51
+ settings = ctx.get("settings");
52
+ } catch {
53
+ return "modern";
54
+ }
55
+ if (settings === null || typeof settings !== "object") return "modern";
56
+ cached = classifySettingsFace(settings);
57
+ return cached;
58
+ }
59
+ /**
60
+ * Definitive verdict from the resolved service (evidence observed, not
61
+ * guessed): the settings inject callback calls this once the service has
62
+ * actually composed. Always (re)writes the cache — a provisional earlier
63
+ * verdict must not survive real evidence.
64
+ */
65
+ function noteResolvedSettingsService(settings) {
66
+ cached = classifySettingsFace(settings);
67
+ return cached;
68
+ }
69
+ /**
70
+ * Server-plane snapshot for code paths that hold no ctx (the tool-result
71
+ * adapters). The bridge's inject callback has already noted the resolved
72
+ * service by the time any session message flows, so this reads real evidence
73
+ * on every line; without it the only safe answer is the provisional default.
74
+ */
75
+ function hostGenerationSnapshot() {
76
+ return cached ?? "modern";
77
+ }
78
+ function compatLog(ctx, level = "info") {
79
+ if (detectHostGeneration(ctx) === "legacy") return (message, ...rest) => console[level](`[dsh-context-compression-improved] ${message}`, ...rest);
80
+ const sink = ctx.logger?.[level]?.bind(ctx.logger) ?? ((...rest) => console[level](...rest));
81
+ return (message, ...rest) => sink(`[dsh-context-compression-improved] ${message}`, ...rest);
82
+ }
83
+ //#endregion
84
+ //#region src/compat/tool-result.ts
85
+ /**
86
+ * Tool-result envelope adapter (audit N2: three-axis relocation, not a
87
+ * single-axis unwrap) + legacy message-source kind escape (audit B6).
88
+ *
89
+ * Three-axis mapping, main's own comment as evidence
90
+ * (pruner/session.ts: "0.1.7-rc.2: isError moved from the result block onto
91
+ * the message itself"):
92
+ *
93
+ * semantics Gen D (0.1.7-rc.2+ / 0.2.0) Gen A/B/C (0.1.0–0.1.5)
94
+ * content blocks message.content message.content[0].content
95
+ * error location message.isError message.content[0].isError
96
+ * call id message.toolCallId message.source.callId
97
+ *
98
+ * Every consumer must take the whole triple from viewToolResult(); touching
99
+ * a single axis inline is how the isError/callId axes get silently dropped.
100
+ * A strict legacy signature overrides the generation flag per message (the
101
+ * 0.1.7-rc.1 envelope shape was only load-verified, not session-verified —
102
+ * this makes a wrong flag self-correcting instead of silently misreading).
103
+ */
104
+ /** Strict signature of the enveloped (0.1.x) tool/result message. */
105
+ function envelopedShape(content) {
106
+ return Array.isArray(content) && content.length === 1 && typeof content[0] === "object" && content[0] !== null && content[0].type === "tool-result" && Array.isArray(content[0].content);
107
+ }
108
+ function viewToolResult(message, generation) {
109
+ const gen = generation ?? hostGenerationSnapshot();
110
+ const content = message.content;
111
+ if (envelopedShape(content)) {
112
+ const wrapper = content[0];
113
+ return {
114
+ blocks: wrapper.content,
115
+ isError: wrapper.isError === true,
116
+ callId: typeof message.source?.callId === "string" ? message.source.callId : void 0
117
+ };
118
+ }
119
+ if (gen === "legacy") {
120
+ const wrapper = Array.isArray(content) ? content[0] : void 0;
121
+ if (wrapper && typeof wrapper === "object" && Array.isArray(wrapper.content)) return {
122
+ blocks: wrapper.content,
123
+ isError: wrapper.isError === true,
124
+ callId: typeof message.source?.callId === "string" ? message.source.callId : void 0
125
+ };
126
+ }
127
+ return {
128
+ blocks: Array.isArray(content) ? content : [],
129
+ isError: message.isError === true,
130
+ callId: typeof message.toolCallId === "string" ? message.toolCallId : gen === "legacy" && typeof message.source?.callId === "string" ? message.source.callId : void 0
131
+ };
132
+ }
133
+ /**
134
+ * Per-producer source kind, generation-gated. Modern hosts accept the
135
+ * producer-declared kind (declared in pruner.ts's `MessageSourceMap`
136
+ * augmentation); 0.1.x hosts only know the shared `{ kind: 'plugin' }` kind
137
+ * — the dev bed's dsh-llm@0.2.0-rc.1 type face has no such member (audit B6,
138
+ * empirically confirmed), so the legacy object escapes through `as never`
139
+ * HERE and nowhere else.
140
+ */
141
+ const PLUGIN_ID = "dsh-context-compression-improved";
142
+ function compressionMessageSource(generation) {
143
+ if ((generation ?? hostGenerationSnapshot()) === "legacy") return {
144
+ kind: "plugin",
145
+ plugin: PLUGIN_ID
146
+ };
147
+ return { kind: "dsh-context-compression" };
148
+ }
149
+ //#endregion
150
+ export { noteResolvedSettingsService as a, detectHostGeneration as i, viewToolResult as n, eventBySeq as o, compatLog as r, sessionEvents as s, compressionMessageSource as t };
package/package.json CHANGED
@@ -1,165 +1,178 @@
1
1
  {
2
2
  "name": "dsh-context-compression-improved",
3
- "version": "0.9.8",
4
- "publishConfig": {
5
- "registry": "https://registry.npmjs.org",
6
- "tag": "latest"
7
- },
3
+ "version": "0.9.9-beta.0",
4
+ "description": "One-install context-compression selector bundle for DeepSeek Harness",
8
5
  "type": "module",
9
- "main": "packages/selector/lib/index.js",
10
- "types": "packages/selector/lib/index.d.ts",
6
+ "main": "lib/index.js",
7
+ "types": "lib/index.d.ts",
11
8
  "exports": {
12
9
  ".": {
13
- "types": "./packages/selector/lib/index.d.ts",
14
- "default": "./packages/selector/lib/index.js"
10
+ "types": "./lib/index.d.ts",
11
+ "default": "./lib/index.js"
15
12
  },
16
13
  "./invariant": {
17
- "types": "./packages/selector/lib/invariant.d.ts",
18
- "default": "./packages/selector/lib/invariant.js"
14
+ "types": "./lib/invariant.d.ts",
15
+ "default": "./lib/invariant.js"
19
16
  },
20
17
  "./pruner": {
21
- "types": "./packages/selector/lib/pruner.d.ts",
22
- "default": "./packages/selector/lib/pruner.js"
18
+ "types": "./lib/pruner.d.ts",
19
+ "default": "./lib/pruner.js"
23
20
  },
24
21
  "./client": {
25
- "types": "./packages/selector/lib/client.d.ts",
26
- "default": "./packages/selector/lib/client.js"
22
+ "types": "./lib/client.d.ts",
23
+ "default": "./lib/client.js"
27
24
  },
28
25
  "./package.json": "./package.json"
29
26
  },
30
- "dependencies": {
31
- "@deepseek-ai/schemastery": "3.18.4",
32
- "@huggingface/tokenizers": "0.1.3",
33
- "js-yaml": "^4.3.2"
34
- },
27
+ "files": [
28
+ "lib/**/*.js",
29
+ "lib/**/*.d.ts",
30
+ "cordis.patch.yml",
31
+ "dsh.plugin.json",
32
+ "screenshots.json",
33
+ "assets",
34
+ "README.md",
35
+ "README.zh.md",
36
+ "LICENSE",
37
+ "THIRD_PARTY_NOTICES.md"
38
+ ],
35
39
  "dsh": {
36
40
  "client": {
37
41
  "inject": [
38
42
  "@deepseek-ai/dsh-client-locale",
39
- "@deepseek-ai/dsh-client-ui-primitives",
40
43
  "@deepseek-ai/dsh-client-ui-slots",
41
44
  "@deepseek-ai/dsh-client-ui-settings"
42
45
  ],
43
46
  "platform": "web"
44
47
  },
45
48
  "bundle": {
46
- "patch": "./packages/selector/cordis.patch.yml"
47
- }
49
+ "patch": "./cordis.patch.yml"
50
+ },
51
+ "pluginDependencies": [
52
+ "dsh-reference-session-collector"
53
+ ]
54
+ },
55
+ "scripts": {
56
+ "bundle": "tsdown --config tsdown.config.ts && tsdown --config tsdown.client.config.ts",
57
+ "typecheck": "tsc --noEmit -p tsconfig.json",
58
+ "test": "vitest run --root ../.. --config vitest.config.ts --project runtime --project selector-host --project selector-client",
59
+ "pack:dry-run": "npm pack --dry-run"
48
60
  },
49
- "license": "MIT",
50
61
  "repository": {
51
62
  "type": "git",
52
- "url": "git+https://github.com/drscrewdriver/dsh-context-compression-improved.git"
63
+ "url": "git+https://github.com/drscrewdriver/dsh-context-compression-improved.git",
64
+ "directory": "packages/selector"
65
+ },
66
+ "homepage": "https://github.com/drscrewdriver/dsh-context-compression-improved#readme",
67
+ "bugs": {
68
+ "url": "https://github.com/drscrewdriver/dsh-context-compression-improved/issues"
53
69
  },
54
- "packageManager": "pnpm@11.7.0",
70
+ "author": "WilliamShi666",
55
71
  "engines": {
56
72
  "node": "^22.19.0 || >=24.0.0",
57
73
  "dsh": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2"
58
74
  },
59
- "scripts": {
60
- "build": "pnpm -r --if-present run bundle",
61
- "typecheck": "pnpm --filter dsh-context-compression-improved run bundle && pnpm --filter dsh-context-compression-improved run typecheck && pnpm run typecheck:tests",
62
- "typecheck:tests": "tsc --noEmit -p tsconfig.tests.json",
63
- "lint": "eslint packages scripts eslint.config.js",
64
- "lint:fix": "eslint packages scripts eslint.config.js --fix",
65
- "test": "vitest run",
66
- "test:watch": "vitest",
67
- "test:built": "vitest run --config vitest.built.config.ts",
68
- "test:e2e:packed": "node scripts/packed-install-e2e.mjs",
69
- "test:browser:e2e": "node scripts/cell-browser-e2e.mjs",
70
- "test:unit": "vitest run",
71
- "verify:release": "node scripts/verify-release.mjs",
72
- "pack:dry-run": "pnpm -r --if-present run pack:dry-run"
75
+ "keywords": [
76
+ "deepseek",
77
+ "harness",
78
+ "context",
79
+ "compression",
80
+ "plugin"
81
+ ],
82
+ "license": "MIT",
83
+ "publishConfig": {
84
+ "access": "public",
85
+ "registry": "https://registry.npmjs.org",
86
+ "tag": "beta"
87
+ },
88
+ "dependencies": {
89
+ "@deepseek-ai/schemastery": "3.18.4",
90
+ "@huggingface/tokenizers": "0.1.3",
91
+ "js-yaml": "^4.3.2",
92
+ "dsh-reference-session-collector": ">=0.2.0-beta.0 <0.3.0"
73
93
  },
74
94
  "peerDependencies": {
95
+ "@deepseek-ai/cordis": ">=4.0.1 <5",
96
+ "@deepseek-ai/cordis-plugin-include": ">=1.0.6 <2",
97
+ "@deepseek-ai/cordis-plugin-loader": ">=1.0.2 <2",
98
+ "@deepseek-ai/dsh-agent": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
99
+ "@deepseek-ai/dsh-agent-presets": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
75
100
  "@deepseek-ai/dsh-client-locale": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
101
+ "@deepseek-ai/dsh-client-store": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
76
102
  "@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
103
+ "@deepseek-ai/dsh-client-ui-session": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
77
104
  "@deepseek-ai/dsh-client-ui-settings": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
78
- "@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2"
105
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
106
+ "@deepseek-ai/dsh-client-ui-workspace": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
107
+ "@deepseek-ai/dsh-command-compact": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
108
+ "@deepseek-ai/dsh-compaction": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
109
+ "@deepseek-ai/dsh-compaction-basic": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
110
+ "@deepseek-ai/dsh-invariants": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
111
+ "@deepseek-ai/dsh-llm": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
112
+ "@deepseek-ai/dsh-session": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
113
+ "@deepseek-ai/dsh-settings": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
114
+ "@deepseek-ai/dsh-system-prompt": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
115
+ "@deepseek-ai/dsh-token-meter": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
116
+ "@deepseek-ai/dsh-tools": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
117
+ "react": ">=18 <19"
79
118
  },
80
119
  "peerDependenciesMeta": {
120
+ "@deepseek-ai/dsh-agent": {
121
+ "optional": true
122
+ },
123
+ "@deepseek-ai/dsh-agent-presets": {
124
+ "optional": true
125
+ },
81
126
  "@deepseek-ai/dsh-client-locale": {
82
127
  "optional": true
83
128
  },
129
+ "@deepseek-ai/dsh-client-store": {
130
+ "optional": true
131
+ },
84
132
  "@deepseek-ai/dsh-client-ui-primitives": {
85
133
  "optional": true
86
134
  },
135
+ "@deepseek-ai/dsh-client-ui-session": {
136
+ "optional": true
137
+ },
87
138
  "@deepseek-ai/dsh-client-ui-settings": {
88
139
  "optional": true
89
140
  },
90
141
  "@deepseek-ai/dsh-client-ui-slots": {
91
142
  "optional": true
143
+ },
144
+ "@deepseek-ai/dsh-client-ui-workspace": {
145
+ "optional": true
146
+ },
147
+ "@deepseek-ai/dsh-command-compact": {
148
+ "optional": true
149
+ },
150
+ "@deepseek-ai/dsh-compaction": {
151
+ "optional": true
152
+ },
153
+ "@deepseek-ai/dsh-compaction-basic": {
154
+ "optional": true
155
+ },
156
+ "@deepseek-ai/dsh-invariants": {
157
+ "optional": true
158
+ },
159
+ "@deepseek-ai/dsh-llm": {
160
+ "optional": true
161
+ },
162
+ "@deepseek-ai/dsh-session": {
163
+ "optional": true
164
+ },
165
+ "@deepseek-ai/dsh-settings": {
166
+ "optional": true
167
+ },
168
+ "@deepseek-ai/dsh-system-prompt": {
169
+ "optional": true
170
+ },
171
+ "@deepseek-ai/dsh-token-meter": {
172
+ "optional": true
173
+ },
174
+ "@deepseek-ai/dsh-tools": {
175
+ "optional": true
92
176
  }
93
- },
94
- "devDependencies": {
95
- "@deepseek-ai/cordis": "4.0.1",
96
- "@deepseek-ai/cordis-plugin-group": "1.0.1",
97
- "@deepseek-ai/cordis-plugin-include": "1.0.6",
98
- "@deepseek-ai/cordis-plugin-loader": "1.0.2",
99
- "@deepseek-ai/dsh-agent": "0.2.0-rc.1",
100
- "@deepseek-ai/dsh-agent-loop": "0.2.0-rc.1",
101
- "@deepseek-ai/dsh-agent-loop-testkit": "0.2.0-rc.1",
102
- "@deepseek-ai/dsh-agent-presets": "0.1.6-alpha.2",
103
- "@deepseek-ai/dsh-anonymous-user-id": "0.2.0-rc.1",
104
- "@deepseek-ai/dsh-api-remotes": "0.2.0-rc.1",
105
- "@deepseek-ai/dsh-api-session-controller": "0.2.0-rc.1",
106
- "@deepseek-ai/dsh-atomic-write": "0.2.0-rc.1",
107
- "@deepseek-ai/dsh-attachment": "0.2.0-rc.1",
108
- "@deepseek-ai/dsh-client-locale": "0.2.0-rc.1",
109
- "@deepseek-ai/dsh-client-store": "0.2.0-rc.1",
110
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.1",
111
- "@deepseek-ai/dsh-client-ui-session": "0.2.0-rc.1",
112
- "@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.1",
113
- "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.1",
114
- "@deepseek-ai/dsh-client-ui-workspace": "0.2.0-rc.1",
115
- "@deepseek-ai/dsh-code-runtime": "0.1.5-rc.3",
116
- "@deepseek-ai/dsh-command-compact": "0.2.0-rc.1",
117
- "@deepseek-ai/dsh-commands": "0.2.0-rc.1",
118
- "@deepseek-ai/dsh-compaction": "0.2.0-rc.1",
119
- "@deepseek-ai/dsh-compaction-basic": "0.2.0-rc.1",
120
- "@deepseek-ai/dsh-cordis-host-runner": "0.2.0-rc.1",
121
- "@deepseek-ai/dsh-credentials": "0.2.0-rc.1",
122
- "@deepseek-ai/dsh-goal": "0.2.0-rc.1",
123
- "@deepseek-ai/dsh-home-paths": "0.2.0-rc.1",
124
- "@deepseek-ai/dsh-host-plugin-inventory": "0.2.0-rc.1",
125
- "@deepseek-ai/dsh-invariants": "0.2.0-rc.1",
126
- "@deepseek-ai/dsh-jobs": "0.2.0-rc.1",
127
- "@deepseek-ai/dsh-launch-environment": "0.2.0-rc.1",
128
- "@deepseek-ai/dsh-llm": "0.2.0-rc.1",
129
- "@deepseek-ai/dsh-llm-deepseek": "0.2.0-rc.1",
130
- "@deepseek-ai/dsh-llm-retry": "0.2.0-rc.1",
131
- "@deepseek-ai/dsh-message-feedback": "0.2.0-rc.1",
132
- "@deepseek-ai/dsh-sandbox": "0.2.0-rc.1",
133
- "@deepseek-ai/dsh-scope": "0.2.0-rc.1",
134
- "@deepseek-ai/dsh-session": "0.2.0-rc.1",
135
- "@deepseek-ai/dsh-session-persistence": "0.2.0-rc.1",
136
- "@deepseek-ai/dsh-session-projection": "0.2.0-rc.1",
137
- "@deepseek-ai/dsh-settings": "0.2.0-rc.1",
138
- "@deepseek-ai/dsh-subagent": "0.2.0-rc.1",
139
- "@deepseek-ai/dsh-subagent-fork-in-process": "0.2.0-rc.1",
140
- "@deepseek-ai/dsh-subagent-in-process-driver": "0.2.0-rc.1",
141
- "@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.0-rc.1",
142
- "@deepseek-ai/dsh-system-prompt": "0.2.0-rc.1",
143
- "@deepseek-ai/dsh-token-meter": "0.2.0-rc.1",
144
- "@deepseek-ai/dsh-tools": "0.2.0-rc.1",
145
- "@deepseek-ai/dsh-user-approval": "0.2.0-rc.1",
146
- "@deepseek-ai/dsh-user-questions": "0.2.0-rc.1",
147
- "@deepseek-ai/schemastery": "3.18.4",
148
- "@eslint/js": "^10.0.1",
149
- "@testing-library/react": "^16.3.2",
150
- "@tsdown/css": "^0.22.14",
151
- "@types/js-yaml": "^4.0.9",
152
- "@types/node": "^22.20.0",
153
- "@types/react": "~18.3.1",
154
- "eslint": "^10.10.0",
155
- "globals": "^17.12.0",
156
- "jsdom": "29.1.1",
157
- "lightningcss": "^1.33.0",
158
- "react": "^18.2.0",
159
- "react-dom": "^18.2.0",
160
- "tsdown": "^0.22.2",
161
- "typescript": "^6.0.3",
162
- "typescript-eslint": "^8.69.0",
163
- "vitest": "^4.1.8"
164
177
  }
165
178
  }
package/screenshots.json CHANGED
@@ -1,6 +1,3 @@
1
- {
2
- "screenshots": [
3
- "assets/board.png",
4
- "assets/context.png"
5
- ]
6
- }
1
+ {
2
+ "screenshots": []
3
+ }
package/.gitattributes DELETED
@@ -1,2 +0,0 @@
1
- packages/selector/assets/** -text
2
- packages/selector/lib/** text eol=lf
@@ -1,37 +0,0 @@
1
- #!/bin/sh
2
- # lib freshness gate (runs before every push from this repo).
3
- #
4
- # The plugin ships lib/ as a committed artifact and never builds on the
5
- # client at install time, so a stale lib pushed to a branch is what users
6
- # actually download. Rebuild here and refuse the push when the committed
7
- # lib no longer matches the committed sources.
8
- #
9
- # Skip conditions:
10
- # - the branch does not track a lib directory (non-plugin branches);
11
- # - pnpm or the build itself fails for reasons unrelated to freshness
12
- # (the push is allowed, the build problem surfaces in CI/typecheck).
13
-
14
- ROOT="$(git rev-parse --show-toplevel)"
15
- LIB_DIR="packages/selector/lib"
16
-
17
- # Nothing to guard on branches without the shipped artifact.
18
- if [ ! -f "$ROOT/$LIB_DIR/index.js" ]; then
19
- exit 0
20
- fi
21
-
22
- echo "[pre-push] rebuilding lib to verify freshness..."
23
- if ! (cd "$ROOT" && pnpm build >/dev/null 2>&1); then
24
- echo "[pre-push] WARNING: pnpm build failed; skipping the lib freshness check." >&2
25
- exit 0
26
- fi
27
-
28
- drift="$(git -C "$ROOT" diff --name-only -- "$LIB_DIR"; git -C "$ROOT" diff --cached --name-only -- "$LIB_DIR")"
29
- if [ -n "$drift" ]; then
30
- echo >&2 "[pre-push] BLOCKED: packages/selector/lib drifted from the committed sources."
31
- echo >&2 "[pre-push] The build just refreshed it. Review and commit the lib changes:"
32
- echo >&2 "[pre-push] git add packages/selector/lib && git commit --amend --no-edit (or a follow-up commit)"
33
- echo >&2 "[pre-push] Then push again."
34
- exit 1
35
- fi
36
-
37
- exit 0
@@ -1,39 +0,0 @@
1
- name: ci
2
-
3
- on:
4
- push:
5
- branches: [main, compat/legacy]
6
- pull_request:
7
-
8
- permissions:
9
- contents: read
10
-
11
- jobs:
12
- verify:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
16
- - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
17
- with:
18
- version: 11.7.0
19
- - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
20
- with:
21
- # The packed E2E builds a clone of the pinned Harness tag, so this must
22
- # be a Node the Harness itself validates (its CI runs 22.19 / 24.9 / 26
23
- # and defaults to the latest 24). Node 24.0.0 is not one of them: on it
24
- # `tsx` 4.22.4 leaves `import.meta.main` undefined, so every guarded
25
- # self-execution script in that clone — including its `build` script,
26
- # which the E2E depends on — exits 0 without doing anything.
27
- node-version: 24.9.0
28
- cache: pnpm
29
- - run: pnpm install --frozen-lockfile
30
- - run: pnpm lint
31
- - run: pnpm typecheck
32
- - run: pnpm build
33
- - run: pnpm test
34
- - run: pnpm --filter dsh-context-compression-improved test
35
- - run: pnpm test:built
36
- - run: pnpm verify:release
37
- - run: pnpm pack:dry-run
38
- - run: pnpm test:e2e:packed
39
- - run: pnpm audit --audit-level high