dsh-context-compression-improved 0.7.0-beta.1 → 0.7.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 (83) hide show
  1. package/.github/workflows/ci.yml +39 -39
  2. package/CHANGELOG.ja.md +217 -220
  3. package/CHANGELOG.ko.md +211 -214
  4. package/CHANGELOG.md +401 -376
  5. package/CHANGELOG.zh.md +196 -199
  6. package/README.md +97 -97
  7. package/README.zh.md +86 -86
  8. package/package.json +1 -1
  9. package/packages/selector/dsh.plugin.json +1 -1
  10. package/packages/selector/lib/client.d.ts +44 -0
  11. package/packages/selector/lib/client.js +1733 -6
  12. package/packages/selector/lib/{intent-gate.js → config.js} +799 -136
  13. package/packages/selector/lib/index.d.ts +13 -1
  14. package/packages/selector/lib/index.js +204 -3
  15. package/packages/selector/lib/profiles.d.ts +6 -0
  16. package/packages/selector/lib/pruner.d.ts +6 -0
  17. package/packages/selector/lib/pruner.js +90 -258
  18. package/packages/selector/lib/style.css +88 -46
  19. package/packages/selector/src/client/CompressionProfileControls.tsx +293 -226
  20. package/packages/selector/src/client/CompressionProfileSelector.module.css +199 -170
  21. package/packages/selector/src/client/CompressionProfileSelector.tsx +85 -83
  22. package/packages/selector/src/client/decode.ts +57 -53
  23. package/packages/selector/src/client/index.ts +307 -213
  24. package/packages/selector/src/client/locales/de.ts +141 -0
  25. package/packages/selector/src/client/locales/es.ts +141 -0
  26. package/packages/selector/src/client/locales/fr.ts +141 -0
  27. package/packages/selector/src/client/locales/it.ts +141 -0
  28. package/packages/selector/src/client/locales/ja.ts +141 -0
  29. package/packages/selector/src/client/locales/ko.ts +141 -0
  30. package/packages/selector/src/client/locales/ru.ts +141 -0
  31. package/packages/selector/src/client/locales.ts +282 -196
  32. package/packages/selector/src/client/monitor-fab.ts +336 -0
  33. package/packages/selector/src/client/savings-card.tsx +150 -0
  34. package/packages/selector/src/client/settings-section.tsx +140 -124
  35. package/packages/selector/src/deepseek-v4-tokenizer.ts +205 -205
  36. package/packages/selector/src/index.ts +207 -5
  37. package/packages/selector/src/preset-overlay.ts +629 -629
  38. package/packages/selector/src/profiles.ts +431 -414
  39. package/packages/selector/src/pruner/content.ts +198 -198
  40. package/packages/selector/src/pruner/state.ts +57 -57
  41. package/packages/selector/src/pruner.ts +2759 -2665
  42. package/packages/selector/src/runtime/audit.ts +303 -303
  43. package/packages/selector/src/runtime/config.ts +756 -731
  44. package/packages/selector/src/runtime/monitor.ts +235 -0
  45. package/packages/selector/src/runtime/reducers.ts +1674 -1674
  46. package/packages/selector/src/runtime/retrieve.ts +479 -457
  47. package/packages/selector/src/runtime/savings.ts +337 -0
  48. package/packages/selector/src/runtime/summary-command.ts +133 -133
  49. package/packages/selector/src/runtime/tokenpilot/advisor-prompt.ts +233 -233
  50. package/packages/selector/src/runtime/tokenpilot/advisor-state.ts +204 -204
  51. package/packages/selector/src/runtime/tokenpilot/intent-fold.ts +53 -53
  52. package/packages/selector/src/runtime/tokenpilot/intent-gate.ts +65 -65
  53. package/packages/selector/src/runtime/tokenpilot/intent-input-mask.ts +125 -125
  54. package/packages/selector/src/runtime/tokenpilot/intent-range.ts +37 -37
  55. package/packages/selector/src/runtime/tokenpilot/locator.ts +128 -128
  56. package/packages/selector/src/runtime/tokenpilot/sidechannel.ts +306 -306
  57. package/packages/selector/src/runtime/types.ts +365 -358
  58. package/packages/selector/tests/built/client-artifact.spec.ts +61 -61
  59. package/packages/selector/tests/code-skeleton.client.spec.ts +2 -2
  60. package/packages/selector/tests/custom-contract.client.spec.ts +2 -2
  61. package/packages/selector/tests/estimator-channel.client.spec.tsx +2 -0
  62. package/packages/selector/tests/estimator-route-registration.host.spec.ts +194 -188
  63. package/packages/selector/tests/helpers/legacy-settings/index.ts +15 -15
  64. package/packages/selector/tests/helpers/legacy-settings/legacy/provider.d.ts +41 -41
  65. package/packages/selector/tests/helpers/legacy-settings/legacy/provider.js +647 -647
  66. package/packages/selector/tests/helpers/legacy-settings/legacy/redact.js +78 -78
  67. package/packages/selector/tests/helpers/legacy-settings/legacy/util-values.js +234 -234
  68. package/packages/selector/tests/host-preset-overlay.host.spec.ts +203 -203
  69. package/packages/selector/tests/monitor-fab.client.spec.ts +138 -0
  70. package/packages/selector/tests/runtime/auto-compact-config.spec.ts +523 -523
  71. package/packages/selector/tests/runtime/deepseek-v4-tokenizer.spec.ts +122 -122
  72. package/packages/selector/tests/runtime/intent-gate.spec.ts +62 -62
  73. package/packages/selector/tests/runtime/intent-summary.spec.ts +156 -156
  74. package/packages/selector/tests/runtime/monitor.spec.ts +301 -0
  75. package/packages/selector/tests/runtime/savings.spec.ts +120 -0
  76. package/packages/selector/tests/runtime/summary-command.spec.ts +154 -154
  77. package/packages/selector/tests/settings-seat.client.spec.ts +177 -165
  78. package/scripts/packed-components-smoke.mjs +734 -734
  79. package/scripts/packed-install-e2e.mjs +1 -1
  80. package/scripts/verify-release.mjs +1 -1
  81. package/tests/TEST_INVENTORY.md +41 -41
  82. package/tsconfig.tests.json +17 -17
  83. package/vitest.config.ts +57 -57
@@ -1,41 +1,41 @@
1
- /**
2
- * Narrow type surface for the vendored 0.1.5 `SettingsProvider` (legacy test-host seam).
3
- *
4
- * The 0.1.7 `@deepseek-ai/dsh-settings` host replaced the namespace-registry
5
- * provider with the declarative `SettingsForms` projector, but the plugin
6
- * deliberately keeps the legacy `ctx.settings.get(ns)` read as a fallback
7
- * "so a host that still serves the old service shape keeps working (test
8
- * hosts do exactly that)" (src/index.ts). The host specs drive that fallback
9
- * through this vendored base class — the verbatim 0.1.5-rc.2 implementation,
10
- * not a behavioral re-implementation.
11
- *
12
- * Only the members the specs and the production fallback actually touch are
13
- * declared; the full 0.1.5 surface exists at runtime in provider.js.
14
- */
15
- import { Service } from '@deepseek-ai/cordis'
16
-
17
- export declare abstract class SettingsProvider extends Service {
18
- /** Register as the `settings` service of `ctx` (implementation: `super(ctx, 'settings')`). */
19
- constructor(ctx: Context)
20
- /** Whether {@linkcode LegacySettingsProvider.update} may persist through this provider. */
21
- abstract readonly writable: boolean
22
- /** Load the provider's raw document (namespace → raw section) once at init. */
23
- protected abstract load(): Promise<Record<string, unknown>>
24
- /** Durably store one namespace's merged user section. */
25
- protected abstract persist(ns: string, section: Record<string, unknown>): Promise<void>
26
- /** Register a namespace schema; duplicate registration fails loud. */
27
- register(ns: string, schema: unknown, options?: unknown): unknown
28
- /** Read one registered namespace's resolved value (undefined while unregistered). */
29
- get(ns: string): unknown
30
- /** Merge a patch into one registered namespace's user layer, validate, persist. */
31
- update(ns: string, patch: object, expectedRevision?: number): Promise<void>
32
- /** Replace one registered namespace's user section wholesale, validate, persist. */
33
- replace(ns: string, section: object, expectedRevision?: number): Promise<void>
34
- /** Apply path-addressed edits to one registered namespace's user section. */
35
- mutate(ns: string, ops: readonly unknown[], expectedRevision?: number): Promise<void>
36
- /** Describe every registered namespace for configuration surfaces. */
37
- describe(options?: { redactSecrets?: boolean }): unknown[]
38
- /** Non-file providers expose no open-document affordance. */
39
- get documentPath(): string | undefined
40
- prepareDocument(): Promise<string | undefined>
41
- }
1
+ /**
2
+ * Narrow type surface for the vendored 0.1.5 `SettingsProvider` (legacy test-host seam).
3
+ *
4
+ * The 0.1.7 `@deepseek-ai/dsh-settings` host replaced the namespace-registry
5
+ * provider with the declarative `SettingsForms` projector, but the plugin
6
+ * deliberately keeps the legacy `ctx.settings.get(ns)` read as a fallback
7
+ * "so a host that still serves the old service shape keeps working (test
8
+ * hosts do exactly that)" (src/index.ts). The host specs drive that fallback
9
+ * through this vendored base class — the verbatim 0.1.5-rc.2 implementation,
10
+ * not a behavioral re-implementation.
11
+ *
12
+ * Only the members the specs and the production fallback actually touch are
13
+ * declared; the full 0.1.5 surface exists at runtime in provider.js.
14
+ */
15
+ import { Service } from '@deepseek-ai/cordis'
16
+
17
+ export declare abstract class SettingsProvider extends Service {
18
+ /** Register as the `settings` service of `ctx` (implementation: `super(ctx, 'settings')`). */
19
+ constructor(ctx: Context)
20
+ /** Whether {@linkcode LegacySettingsProvider.update} may persist through this provider. */
21
+ abstract readonly writable: boolean
22
+ /** Load the provider's raw document (namespace → raw section) once at init. */
23
+ protected abstract load(): Promise<Record<string, unknown>>
24
+ /** Durably store one namespace's merged user section. */
25
+ protected abstract persist(ns: string, section: Record<string, unknown>): Promise<void>
26
+ /** Register a namespace schema; duplicate registration fails loud. */
27
+ register(ns: string, schema: unknown, options?: unknown): unknown
28
+ /** Read one registered namespace's resolved value (undefined while unregistered). */
29
+ get(ns: string): unknown
30
+ /** Merge a patch into one registered namespace's user layer, validate, persist. */
31
+ update(ns: string, patch: object, expectedRevision?: number): Promise<void>
32
+ /** Replace one registered namespace's user section wholesale, validate, persist. */
33
+ replace(ns: string, section: object, expectedRevision?: number): Promise<void>
34
+ /** Apply path-addressed edits to one registered namespace's user section. */
35
+ mutate(ns: string, ops: readonly unknown[], expectedRevision?: number): Promise<void>
36
+ /** Describe every registered namespace for configuration surfaces. */
37
+ describe(options?: { redactSecrets?: boolean }): unknown[]
38
+ /** Non-file providers expose no open-document affordance. */
39
+ get documentPath(): string | undefined
40
+ prepareDocument(): Promise<string | undefined>
41
+ }