dsh-context-compression-improved 0.2.3 → 0.2.4

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 (52) hide show
  1. package/.github/workflows/ci.yml +39 -39
  2. package/CHANGELOG.md +137 -135
  3. package/README.md +112 -112
  4. package/package.json +142 -142
  5. package/packages/selector/README.md +31 -31
  6. package/packages/selector/README.zh.md +31 -31
  7. package/packages/selector/dsh.plugin.json +16 -16
  8. package/packages/selector/lib/client.d.ts +228 -228
  9. package/packages/selector/lib/client.js +1462 -1462
  10. package/packages/selector/lib/config.js +856 -842
  11. package/packages/selector/lib/index.d.ts +37 -37
  12. package/packages/selector/lib/index.js +693 -645
  13. package/packages/selector/lib/invariant.js +70 -70
  14. package/packages/selector/lib/pruner.d.ts +728 -683
  15. package/packages/selector/lib/pruner.js +4765 -3807
  16. package/packages/selector/lib/style.css +46 -46
  17. package/packages/selector/lib/tail-trim.js +136 -136
  18. package/packages/selector/package.json +9 -1
  19. package/packages/selector/src/client/index.ts +111 -111
  20. package/packages/selector/src/preset-overlay.ts +60 -1
  21. package/packages/selector/src/pruner/content.ts +18 -5
  22. package/packages/selector/src/pruner/types.ts +23 -5
  23. package/packages/selector/src/pruner.ts +164 -154
  24. package/packages/selector/src/runtime/adaptive-cost.ts +23 -12
  25. package/packages/selector/src/runtime/audit.ts +18 -2
  26. package/packages/selector/src/runtime/config.ts +30 -1
  27. package/packages/selector/src/runtime/measurement.ts +31 -2
  28. package/packages/selector/src/runtime/reducers.ts +1115 -97
  29. package/packages/selector/src/runtime/tokenpilot/dedup.ts +1 -1
  30. package/packages/selector/src/runtime/tokenpilot/locator.ts +1 -1
  31. package/packages/selector/src/runtime/tokenpilot/read-state.ts +23 -2
  32. package/packages/selector/src/runtime/tokenpilot/sidechannel.ts +275 -0
  33. package/packages/selector/src/runtime/toolclass.ts +103 -0
  34. package/packages/selector/src/runtime/types.ts +16 -0
  35. package/packages/selector/tests/preset-overlay.host.spec.ts +256 -243
  36. package/packages/selector/tests/runtime/adaptive-cost.spec.ts +7 -7
  37. package/packages/selector/tests/runtime/audit.spec.ts +44 -1
  38. package/packages/selector/tests/runtime/char-basis.spec.ts +30 -0
  39. package/packages/selector/tests/runtime/code-skeleton.spec.ts +14 -3
  40. package/packages/selector/tests/runtime/frequency-longstrings.spec.ts +74 -0
  41. package/packages/selector/tests/runtime/html-reducer.spec.ts +212 -0
  42. package/packages/selector/tests/runtime/line-mapping.spec.ts +153 -0
  43. package/packages/selector/tests/runtime/prose-reducers.spec.ts +133 -0
  44. package/packages/selector/tests/runtime/public/public-runtime.spec.ts +198 -27
  45. package/packages/selector/tests/runtime/read-input-cap.spec.ts +33 -0
  46. package/packages/selector/tests/runtime/search-reducer.spec.ts +110 -0
  47. package/packages/selector/tests/runtime/sidechannel.spec.ts +241 -0
  48. package/packages/selector/tests/runtime/toc-and-bundled.spec.ts +159 -0
  49. package/packages/selector/tests/runtime/tokenpilot/read-state.spec.ts +24 -0
  50. package/packages/selector/tests/runtime/toolclass.spec.ts +156 -0
  51. package/packages/selector/tests/standing-generation.host.spec.ts +642 -631
  52. package/scripts/toolclass-corpus-replay.mjs +273 -0
@@ -1,38 +1,38 @@
1
- import z from "@deepseek-ai/schemastery";
2
- import { Context } from "@deepseek-ai/cordis";
3
- //#region src/index.d.ts
4
- /** Standalone Bundle behavior; the settings/UI owner remains safe when false. */
5
- interface Config {
6
- /** Add the canonical compression stack to every non-Minimal preset. */
7
- presetOverlay?: boolean;
8
- /**
9
- * Own the estimator catalog HTTP route. Set on the Loader row that declares
10
- * `inject: [webServer]`.
11
- *
12
- * **Measured, and it contradicts the note this field was introduced with.**
13
- * The original justification — "registering a route authorizes against the
14
- * calling fiber, and a fiber that has not declared `webServer` cannot reach
15
- * it, not even through `ctx.inject` or `ctx.get`" — is wrong on both halves:
16
- * the host's `register` performs no authorization at all (it reads
17
- * `this.exact` / `this.prefixes` and throws only on a duplicate
18
- * `(kind, path)`), and `ctx.get(name, strict)` checks only that the providing
19
- * fiber is active (`state === 2`), never the caller's `inject` list. The one
20
- * inject-gated path is the `ctx.webServer` **property** access, which this
21
- * plugin never uses: `registerEstimatorCatalogRoute` uses `ctx.get` plus its
22
- * own `ctx.inject(['webServer'], …)`.
23
- *
24
- * So the row-level `inject` is **not load-bearing**; it is kept as
25
- * belt-and-braces so the route row stays inactive until `webServer` exists,
26
- * and the flag keeps the route off standalone Bundle rows on profiles that
27
- * have no web server. The internal two-channel registration is what actually
28
- * covers both arrival orders. Do not cite this comment as a rule to the
29
- * 0.1.5 replay — cite the host source.
30
- */
31
- estimatorCatalogRoute?: boolean;
32
- }
33
- /** Loader validation for the standalone Bundle opt-in. */
34
- declare const Config: z<Config>;
35
- /** Register the persisted default read by the currently mounted root pruner. */
36
- declare function apply(ctx: Context, config?: Config): void;
37
- //#endregion
1
+ import z from "@deepseek-ai/schemastery";
2
+ import { Context } from "@deepseek-ai/cordis";
3
+ //#region src/index.d.ts
4
+ /** Standalone Bundle behavior; the settings/UI owner remains safe when false. */
5
+ interface Config {
6
+ /** Add the canonical compression stack to every non-Minimal preset. */
7
+ presetOverlay?: boolean;
8
+ /**
9
+ * Own the estimator catalog HTTP route. Set on the Loader row that declares
10
+ * `inject: [webServer]`.
11
+ *
12
+ * **Measured, and it contradicts the note this field was introduced with.**
13
+ * The original justification — "registering a route authorizes against the
14
+ * calling fiber, and a fiber that has not declared `webServer` cannot reach
15
+ * it, not even through `ctx.inject` or `ctx.get`" — is wrong on both halves:
16
+ * the host's `register` performs no authorization at all (it reads
17
+ * `this.exact` / `this.prefixes` and throws only on a duplicate
18
+ * `(kind, path)`), and `ctx.get(name, strict)` checks only that the providing
19
+ * fiber is active (`state === 2`), never the caller's `inject` list. The one
20
+ * inject-gated path is the `ctx.webServer` **property** access, which this
21
+ * plugin never uses: `registerEstimatorCatalogRoute` uses `ctx.get` plus its
22
+ * own `ctx.inject(['webServer'], …)`.
23
+ *
24
+ * So the row-level `inject` is **not load-bearing**; it is kept as
25
+ * belt-and-braces so the route row stays inactive until `webServer` exists,
26
+ * and the flag keeps the route off standalone Bundle rows on profiles that
27
+ * have no web server. The internal two-channel registration is what actually
28
+ * covers both arrival orders. Do not cite this comment as a rule to the
29
+ * 0.1.5 replay — cite the host source.
30
+ */
31
+ estimatorCatalogRoute?: boolean;
32
+ }
33
+ /** Loader validation for the standalone Bundle opt-in. */
34
+ declare const Config: z<Config>;
35
+ /** Register the persisted default read by the currently mounted root pruner. */
36
+ declare function apply(ctx: Context, config?: Config): void;
37
+ //#endregion
38
38
  export { Config, apply };