dsh-context-compression-improved 0.6.4 → 0.7.0-beta.1

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 (75) hide show
  1. package/CHANGELOG.ja.md +51 -0
  2. package/CHANGELOG.ko.md +47 -0
  3. package/CHANGELOG.md +72 -0
  4. package/CHANGELOG.zh.md +47 -0
  5. package/README.ja.md +2 -2
  6. package/README.ko.md +2 -2
  7. package/README.md +6 -3
  8. package/README.zh.md +3 -2
  9. package/eslint.config.js +76 -30
  10. package/package.json +164 -162
  11. package/packages/selector/dsh.plugin.json +16 -16
  12. package/packages/selector/lib/client.js +16 -4
  13. package/packages/selector/lib/index.js +92 -1
  14. package/packages/selector/lib/{advisor-state.js → intent-gate.js} +91 -3
  15. package/packages/selector/lib/profiles.d.ts +9 -0
  16. package/packages/selector/lib/pruner.d.ts +59 -0
  17. package/packages/selector/lib/pruner.js +410 -8
  18. package/packages/selector/package.json +114 -114
  19. package/packages/selector/src/client/decode.ts +6 -2
  20. package/packages/selector/src/client/index.ts +213 -232
  21. package/packages/selector/src/client/scope-face.ts +24 -24
  22. package/packages/selector/src/deepseek-v4-tokenizer.ts +1 -1
  23. package/packages/selector/src/index.ts +418 -412
  24. package/packages/selector/src/preset-overlay.ts +3 -0
  25. package/packages/selector/src/profiles.ts +30 -10
  26. package/packages/selector/src/pruner/content.ts +1 -1
  27. package/packages/selector/src/pruner/state.ts +7 -0
  28. package/packages/selector/src/pruner.ts +253 -10
  29. package/packages/selector/src/runtime/audit.ts +17 -0
  30. package/packages/selector/src/runtime/config.ts +36 -11
  31. package/packages/selector/src/runtime/reducers.ts +1 -1
  32. package/packages/selector/src/runtime/summary-command.ts +133 -0
  33. package/packages/selector/src/runtime/tokenpilot/advisor-prompt.ts +46 -1
  34. package/packages/selector/src/runtime/tokenpilot/advisor-state.ts +55 -0
  35. package/packages/selector/src/runtime/tokenpilot/intent-fold.ts +53 -0
  36. package/packages/selector/src/runtime/tokenpilot/intent-gate.ts +65 -0
  37. package/packages/selector/src/runtime/tokenpilot/intent-input-mask.ts +125 -0
  38. package/packages/selector/src/runtime/tokenpilot/intent-range.ts +37 -0
  39. package/packages/selector/src/runtime/tokenpilot/locator.ts +2 -2
  40. package/packages/selector/src/runtime/tokenpilot/sidechannel.ts +4 -1
  41. package/packages/selector/src/runtime/types.ts +12 -0
  42. package/packages/selector/tests/auto-compact.client.spec.tsx +214 -213
  43. package/packages/selector/tests/built/client-artifact.spec.ts +2 -0
  44. package/packages/selector/tests/code-skeleton.client.spec.ts +94 -93
  45. package/packages/selector/tests/custom-contract.client.spec.ts +3 -2
  46. package/packages/selector/tests/estimator-channel.client.spec.tsx +252 -252
  47. package/packages/selector/tests/helpers/legacy-namespace.ts +8 -4
  48. package/packages/selector/tests/helpers/legacy-settings/index.ts +15 -0
  49. package/packages/selector/tests/helpers/legacy-settings/legacy/provider.d.ts +41 -0
  50. package/packages/selector/tests/helpers/legacy-settings/legacy/provider.js +647 -0
  51. package/packages/selector/tests/helpers/legacy-settings/legacy/redact.js +78 -0
  52. package/packages/selector/tests/helpers/legacy-settings/legacy/util-values.js +234 -0
  53. package/packages/selector/tests/host-preset-overlay.host.spec.ts +204 -206
  54. package/packages/selector/tests/preset-options-write.client.spec.ts +188 -187
  55. package/packages/selector/tests/preset-overlay-loader.e2e.host.spec.ts +200 -206
  56. package/packages/selector/tests/profiles.client.spec.tsx +436 -434
  57. package/packages/selector/tests/public/package-contract.client.spec.ts +78 -78
  58. package/packages/selector/tests/runtime/advice-never-withholds.host.spec.ts +230 -233
  59. package/packages/selector/tests/runtime/audit.spec.ts +275 -274
  60. package/packages/selector/tests/runtime/auto-compact-config.spec.ts +3 -3
  61. package/packages/selector/tests/runtime/deepseek-v4-tokenizer.spec.ts +4 -4
  62. package/packages/selector/tests/runtime/intent-gate.spec.ts +62 -0
  63. package/packages/selector/tests/runtime/intent-summary.spec.ts +156 -0
  64. package/packages/selector/tests/runtime/public/public-runtime.spec.ts +2736 -2727
  65. package/packages/selector/tests/runtime/summary-command.spec.ts +154 -0
  66. package/packages/selector/tests/settings-seat.client.spec.ts +165 -165
  67. package/packages/selector/tests/standing-generation.host.spec.ts +704 -704
  68. package/packages/selector/tests/subagent-cache-reuse.host.spec.ts +18 -2
  69. package/packages/selector/tests/support/ui-primitives.tsx +34 -34
  70. package/pnpm-workspace.yaml +1 -1
  71. package/scripts/packed-components-smoke.mjs +2 -0
  72. package/scripts/packed-install-e2e.mjs +1275 -1273
  73. package/scripts/verify-release.mjs +318 -317
  74. package/tsconfig.tests.json +3 -1
  75. package/vitest.config.ts +14 -0
@@ -1,114 +1,114 @@
1
- {
2
- "name": "dsh-context-compression-improved",
3
- "version": "0.2.0",
4
- "description": "One-install context-compression selector bundle for DeepSeek Harness",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "types": "lib/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./lib/index.d.ts",
11
- "default": "./lib/index.js"
12
- },
13
- "./invariant": {
14
- "types": "./lib/invariant.d.ts",
15
- "default": "./lib/invariant.js"
16
- },
17
- "./pruner": {
18
- "types": "./lib/pruner.d.ts",
19
- "default": "./lib/pruner.js"
20
- },
21
- "./client": {
22
- "types": "./lib/client.d.ts",
23
- "default": "./lib/client.js"
24
- },
25
- "./package.json": "./package.json"
26
- },
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
- ],
39
- "dsh": {
40
- "client": {
41
- "inject": [
42
- "@deepseek-ai/dsh-client-locale",
43
- "@deepseek-ai/dsh-client-ui-slots",
44
- "@deepseek-ai/dsh-client-ui-settings"
45
- ],
46
- "platform": "web"
47
- },
48
- "bundle": {
49
- "patch": "./cordis.patch.yml"
50
- }
51
- },
52
- "scripts": {
53
- "bundle": "tsdown --config tsdown.config.ts && tsdown --config tsdown.client.config.ts",
54
- "typecheck": "tsc --noEmit -p tsconfig.json",
55
- "test": "vitest run --root ../.. --config vitest.config.ts --project runtime --project selector-host --project selector-client",
56
- "pack:dry-run": "npm pack --dry-run"
57
- },
58
- "repository": {
59
- "type": "git",
60
- "url": "git+https://github.com/drscrewdriver/dsh-context-compression-improved.git",
61
- "directory": "packages/selector"
62
- },
63
- "homepage": "https://github.com/drscrewdriver/dsh-context-compression-improved#readme",
64
- "bugs": {
65
- "url": "https://github.com/drscrewdriver/dsh-context-compression-improved/issues"
66
- },
67
- "author": "WilliamShi666",
68
- "engines": {
69
- "node": "^22.19.0 || >=24.0.0",
70
- "dsh": ">=0.1.7-rc.1 <0.1.8-0"
71
- },
72
- "keywords": [
73
- "deepseek",
74
- "harness",
75
- "context",
76
- "compression",
77
- "plugin"
78
- ],
79
- "license": "MIT",
80
- "publishConfig": {
81
- "access": "public",
82
- "tag": "latest"
83
- },
84
- "dependencies": {
85
- "@deepseek-ai/schemastery": "3.18.4",
86
- "@huggingface/tokenizers": "0.1.3",
87
- "js-yaml": "^4.3.2"
88
- },
89
- "peerDependencies": {
90
- "@deepseek-ai/cordis": ">=4.0.1 <5",
91
- "@deepseek-ai/cordis-plugin-include": ">=1.0.6 <2",
92
- "@deepseek-ai/cordis-plugin-loader": ">=1.0.2 <2",
93
- "@deepseek-ai/dsh-agent": ">=0.1.7-rc.1 <0.2.0-0",
94
- "@deepseek-ai/dsh-agent-presets": ">=0.1.7-rc.1 <0.2.0-0",
95
- "@deepseek-ai/dsh-client-locale": ">=0.1.7-rc.1 <0.2.0-0",
96
- "@deepseek-ai/dsh-client-store": ">=0.1.7-rc.1 <0.2.0-0",
97
- "@deepseek-ai/dsh-client-ui-primitives": ">=0.1.7-rc.1 <0.2.0-0",
98
- "@deepseek-ai/dsh-client-ui-session": ">=0.1.7-rc.1 <0.2.0-0",
99
- "@deepseek-ai/dsh-client-ui-settings": ">=0.1.7-rc.1 <0.2.0-0",
100
- "@deepseek-ai/dsh-client-ui-slots": ">=0.1.7-rc.1 <0.2.0-0",
101
- "@deepseek-ai/dsh-client-ui-workspace": ">=0.1.7-rc.1 <0.2.0-0",
102
- "@deepseek-ai/dsh-command-compact": ">=0.1.7-rc.1 <0.2.0-0",
103
- "@deepseek-ai/dsh-compaction": ">=0.1.7-rc.1 <0.2.0-0",
104
- "@deepseek-ai/dsh-compaction-basic": ">=0.1.7-rc.1 <0.2.0-0",
105
- "@deepseek-ai/dsh-invariants": ">=0.1.7-rc.1 <0.2.0-0",
106
- "@deepseek-ai/dsh-llm": ">=0.1.7-rc.1 <0.2.0-0",
107
- "@deepseek-ai/dsh-session": ">=0.1.7-rc.1 <0.2.0-0",
108
- "@deepseek-ai/dsh-settings": ">=0.1.7-rc.1 <0.2.0-0",
109
- "@deepseek-ai/dsh-system-prompt": ">=0.1.7-rc.1 <0.2.0-0",
110
- "@deepseek-ai/dsh-token-meter": ">=0.1.7-rc.1 <0.2.0-0",
111
- "@deepseek-ai/dsh-tools": ">=0.1.7-rc.1 <0.2.0-0",
112
- "react": ">=18 <19"
113
- }
114
- }
1
+ {
2
+ "name": "dsh-context-compression-improved",
3
+ "version": "0.2.0",
4
+ "description": "One-install context-compression selector bundle for DeepSeek Harness",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "types": "lib/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/index.d.ts",
11
+ "default": "./lib/index.js"
12
+ },
13
+ "./invariant": {
14
+ "types": "./lib/invariant.d.ts",
15
+ "default": "./lib/invariant.js"
16
+ },
17
+ "./pruner": {
18
+ "types": "./lib/pruner.d.ts",
19
+ "default": "./lib/pruner.js"
20
+ },
21
+ "./client": {
22
+ "types": "./lib/client.d.ts",
23
+ "default": "./lib/client.js"
24
+ },
25
+ "./package.json": "./package.json"
26
+ },
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
+ ],
39
+ "dsh": {
40
+ "client": {
41
+ "inject": [
42
+ "@deepseek-ai/dsh-client-locale",
43
+ "@deepseek-ai/dsh-client-ui-slots",
44
+ "@deepseek-ai/dsh-client-ui-settings"
45
+ ],
46
+ "platform": "web"
47
+ },
48
+ "bundle": {
49
+ "patch": "./cordis.patch.yml"
50
+ }
51
+ },
52
+ "scripts": {
53
+ "bundle": "tsdown --config tsdown.config.ts && tsdown --config tsdown.client.config.ts",
54
+ "typecheck": "tsc --noEmit -p tsconfig.json",
55
+ "test": "vitest run --root ../.. --config vitest.config.ts --project runtime --project selector-host --project selector-client",
56
+ "pack:dry-run": "npm pack --dry-run"
57
+ },
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "git+https://github.com/drscrewdriver/dsh-context-compression-improved.git",
61
+ "directory": "packages/selector"
62
+ },
63
+ "homepage": "https://github.com/drscrewdriver/dsh-context-compression-improved#readme",
64
+ "bugs": {
65
+ "url": "https://github.com/drscrewdriver/dsh-context-compression-improved/issues"
66
+ },
67
+ "author": "WilliamShi666",
68
+ "engines": {
69
+ "node": "^22.19.0 || >=24.0.0",
70
+ "dsh": ">=0.1.7-rc.1 <0.1.8-0"
71
+ },
72
+ "keywords": [
73
+ "deepseek",
74
+ "harness",
75
+ "context",
76
+ "compression",
77
+ "plugin"
78
+ ],
79
+ "license": "MIT",
80
+ "publishConfig": {
81
+ "access": "public",
82
+ "tag": "latest"
83
+ },
84
+ "dependencies": {
85
+ "@deepseek-ai/schemastery": "3.18.4",
86
+ "@huggingface/tokenizers": "0.1.3",
87
+ "js-yaml": "^4.3.2"
88
+ },
89
+ "peerDependencies": {
90
+ "@deepseek-ai/cordis": ">=4.0.1 <5",
91
+ "@deepseek-ai/cordis-plugin-include": ">=1.0.6 <2",
92
+ "@deepseek-ai/cordis-plugin-loader": ">=1.0.2 <2",
93
+ "@deepseek-ai/dsh-agent": ">=0.1.7-rc.1 <0.2.0-0",
94
+ "@deepseek-ai/dsh-agent-presets": ">=0.1.7-rc.1 <0.2.0-0",
95
+ "@deepseek-ai/dsh-client-locale": ">=0.1.7-rc.1 <0.2.0-0",
96
+ "@deepseek-ai/dsh-client-store": ">=0.1.7-rc.1 <0.2.0-0",
97
+ "@deepseek-ai/dsh-client-ui-primitives": ">=0.1.7-rc.1 <0.2.0-0",
98
+ "@deepseek-ai/dsh-client-ui-session": ">=0.1.7-rc.1 <0.2.0-0",
99
+ "@deepseek-ai/dsh-client-ui-settings": ">=0.1.7-rc.1 <0.2.0-0",
100
+ "@deepseek-ai/dsh-client-ui-slots": ">=0.1.7-rc.1 <0.2.0-0",
101
+ "@deepseek-ai/dsh-client-ui-workspace": ">=0.1.7-rc.1 <0.2.0-0",
102
+ "@deepseek-ai/dsh-command-compact": ">=0.1.7-rc.1 <0.2.0-0",
103
+ "@deepseek-ai/dsh-compaction": ">=0.1.7-rc.1 <0.2.0-0",
104
+ "@deepseek-ai/dsh-compaction-basic": ">=0.1.7-rc.1 <0.2.0-0",
105
+ "@deepseek-ai/dsh-invariants": ">=0.1.7-rc.1 <0.2.0-0",
106
+ "@deepseek-ai/dsh-llm": ">=0.1.7-rc.1 <0.2.0-0",
107
+ "@deepseek-ai/dsh-session": ">=0.1.7-rc.1 <0.2.0-0",
108
+ "@deepseek-ai/dsh-settings": ">=0.1.7-rc.1 <0.2.0-0",
109
+ "@deepseek-ai/dsh-system-prompt": ">=0.1.7-rc.1 <0.2.0-0",
110
+ "@deepseek-ai/dsh-token-meter": ">=0.1.7-rc.1 <0.2.0-0",
111
+ "@deepseek-ai/dsh-tools": ">=0.1.7-rc.1 <0.2.0-0",
112
+ "react": ">=18 <19"
113
+ }
114
+ }
@@ -5,6 +5,7 @@ import {
5
5
  COMPRESSION_PROFILES,
6
6
  decodeAutoCompactSettings,
7
7
  decodeCodeSkeletonSettings,
8
+ decodeIntentSummarySettings,
8
9
  decodePresetOptionsSettings,
9
10
  isCustomCompressionPolicy,
10
11
  isPlainRecord,
@@ -15,7 +16,7 @@ import {
15
16
  /**
16
17
  * Decode one stored context-compression settings document with exactly the
17
18
  * runtime schema's strictness: a plain object with only `profile`, `custom`,
18
- * `autoCompact`, and `codeSkeleton` keys, a supported profile, a valid Custom
19
+ * `autoCompact`, `codeSkeleton`, and `intentSummary` keys, a supported profile, a valid Custom
19
20
  * document canonicalized to v3 exactly as the runtime resolver would, a
20
21
  * strictly-shaped autoCompact section (absent inherits the 80% default), and
21
22
  * a strictly-shaped codeSkeleton gate (absent inherits off). Anything else
@@ -25,24 +26,27 @@ import {
25
26
  export function decodeSettings(value: unknown): ContextCompressionSettings | undefined {
26
27
  if (!isPlainRecord(value)) return undefined
27
28
  const keys = Object.keys(value)
28
- if (keys.some(key => key !== 'profile' && key !== 'custom' && key !== 'autoCompact' && key !== 'codeSkeleton' && key !== 'presetOptions')) {
29
+ if (keys.some(key => key !== 'profile' && key !== 'custom' && key !== 'autoCompact' && key !== 'codeSkeleton' && key !== 'intentSummary' && key !== 'presetOptions')) {
29
30
  return undefined
30
31
  }
31
32
  const profile = (value as { profile?: unknown }).profile
32
33
  const custom = (value as { custom?: unknown }).custom
33
34
  const autoCompact = decodeAutoCompactSettings((value as { autoCompact?: unknown }).autoCompact)
34
35
  const codeSkeleton = decodeCodeSkeletonSettings((value as { codeSkeleton?: unknown }).codeSkeleton)
36
+ const intentSummary = decodeIntentSummarySettings((value as { intentSummary?: unknown }).intentSummary)
35
37
  const presetOptions = decodePresetOptionsSettings((value as { presetOptions?: unknown }).presetOptions)
36
38
  return typeof profile === 'string'
37
39
  && (COMPRESSION_PROFILES as readonly string[]).includes(profile)
38
40
  && isCustomCompressionPolicy(custom)
39
41
  && autoCompact !== undefined
40
42
  && codeSkeleton !== undefined
43
+ && intentSummary !== undefined
41
44
  ? {
42
45
  profile: profile as CompressionProfile,
43
46
  custom: canonicalizeCustomPolicy(custom),
44
47
  autoCompact,
45
48
  codeSkeleton,
49
+ intentSummary,
46
50
  ...presetOptions === undefined ? {} : { presetOptions },
47
51
  }
48
52
  : undefined