dsh-context-compression-improved 0.10.3 → 0.10.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.
- package/README.md +15 -110
- package/README.zh.md +14 -104
- package/THIRD_PARTY_NOTICES.md +25 -7
- package/{packages/selector/dsh.plugin.json → dsh.plugin.json} +2 -2
- package/{packages/selector/lib → lib}/client.d.ts +4 -0
- package/{packages/selector/lib → lib}/client.js +70 -5
- package/{packages/selector/lib → lib}/invariant.js +1 -1
- package/{packages/selector/lib → lib}/profiles.d.ts +3 -1
- package/{packages/selector/lib → lib}/pruner.d.ts +4 -2
- package/{packages/selector/lib → lib}/pruner.js +40 -37
- package/{packages/selector/lib → lib}/savings-integral.js +83 -24
- package/{packages/selector/lib → lib}/tail-trim.js +2 -2
- package/{packages/selector/lib → lib}/tool-result.js +22 -1
- package/package.json +129 -116
- package/screenshots.json +3 -6
- package/.agents/plans/improve/checklist.md +0 -32
- package/.agents/plans/improve/findings.md +0 -102
- package/.agents/plans/improve/spec.md +0 -53
- package/.agents/plans/improve/tasks.md +0 -70
- package/.gitattributes +0 -2
- package/.githooks/pre-push +0 -37
- package/.github/workflows/ci.yml +0 -39
- package/CHANGELOG.de.md +0 -580
- package/CHANGELOG.es.md +0 -588
- package/CHANGELOG.fr.md +0 -576
- package/CHANGELOG.it.md +0 -577
- package/CHANGELOG.ja.md +0 -261
- package/CHANGELOG.ko.md +0 -254
- package/CHANGELOG.md +0 -549
- package/CHANGELOG.ru.md +0 -554
- package/CHANGELOG.zh.md +0 -238
- package/CONTRIBUTING.md +0 -22
- package/README.de.md +0 -96
- package/README.es.md +0 -96
- package/README.fr.md +0 -96
- package/README.it.md +0 -96
- package/README.ja.md +0 -102
- package/README.ko.md +0 -102
- package/README.ru.md +0 -96
- package/SECURITY.md +0 -18
- package/assets/board.png +0 -0
- package/assets/context.png +0 -0
- package/docs/assets/context-compression-selector-profiles.jpg +0 -0
- package/docs/assets/context-compression-selector-settings.png +0 -0
- package/docs/compat-0.1.5-report.md +0 -77
- package/docs/installation.de.md +0 -104
- package/docs/installation.es.md +0 -104
- package/docs/installation.fr.md +0 -104
- package/docs/installation.it.md +0 -104
- package/docs/installation.ja.md +0 -78
- package/docs/installation.ko.md +0 -78
- package/docs/installation.md +0 -103
- package/docs/installation.ru.md +0 -104
- package/docs/installation.zh.md +0 -100
- package/docs/repair-log.md +0 -657
- package/eslint.config.js +0 -30
- package/packages/selector/LICENSE +0 -21
- package/packages/selector/README.md +0 -26
- package/packages/selector/README.zh.md +0 -24
- package/packages/selector/THIRD_PARTY_NOTICES.md +0 -32
- package/packages/selector/docs/history-tool-call-working-set-spec.md +0 -112
- package/packages/selector/docs/native-tool-result-selector-spec.md +0 -34
- package/packages/selector/docs/subagent-cache-reuse-spec.md +0 -46
- package/packages/selector/lib/style.css +0 -350
- package/packages/selector/package.json +0 -178
- package/packages/selector/screenshots.json +0 -3
- package/packages/selector/src/client/CompressionProfileControls.tsx +0 -293
- package/packages/selector/src/client/CompressionProfileSelector.module.css +0 -199
- package/packages/selector/src/client/CompressionProfileSelector.tsx +0 -85
- package/packages/selector/src/client/CustomPolicyEditor.tsx +0 -216
- package/packages/selector/src/client/EstimatorControls.tsx +0 -277
- package/packages/selector/src/client/bridge-scope.ts +0 -125
- package/packages/selector/src/client/decode.ts +0 -57
- package/packages/selector/src/client/fab-pos.ts +0 -71
- package/packages/selector/src/client/index.ts +0 -424
- package/packages/selector/src/client/locales/de.ts +0 -158
- package/packages/selector/src/client/locales/es.ts +0 -158
- package/packages/selector/src/client/locales/fr.ts +0 -158
- package/packages/selector/src/client/locales/it.ts +0 -158
- package/packages/selector/src/client/locales/ja.ts +0 -158
- package/packages/selector/src/client/locales/ko.ts +0 -158
- package/packages/selector/src/client/locales/ru.ts +0 -158
- package/packages/selector/src/client/locales.ts +0 -316
- package/packages/selector/src/client/monitor-fab.ts +0 -431
- package/packages/selector/src/client/preset-options.ts +0 -88
- package/packages/selector/src/client/savings-card.tsx +0 -269
- package/packages/selector/src/client/scope-face.ts +0 -24
- package/packages/selector/src/client/settings-section.tsx +0 -140
- package/packages/selector/src/compat/host-generation.ts +0 -96
- package/packages/selector/src/compat/llm-messages.ts +0 -50
- package/packages/selector/src/compat/settings-lease.ts +0 -108
- package/packages/selector/src/compat/tool-result.ts +0 -91
- package/packages/selector/src/css-modules.d.ts +0 -6
- package/packages/selector/src/deepseek-v4-tokenizer.ts +0 -205
- package/packages/selector/src/estimator-catalog.ts +0 -104
- package/packages/selector/src/index.ts +0 -890
- package/packages/selector/src/invariant.ts +0 -113
- package/packages/selector/src/preset-overlay.ts +0 -749
- package/packages/selector/src/profiles.ts +0 -431
- package/packages/selector/src/pruner/content.ts +0 -198
- package/packages/selector/src/pruner/session.ts +0 -97
- package/packages/selector/src/pruner/state.ts +0 -61
- package/packages/selector/src/pruner/tuning.ts +0 -23
- package/packages/selector/src/pruner/types.ts +0 -78
- package/packages/selector/src/pruner.ts +0 -2914
- package/packages/selector/src/runtime/adaptive-cost.ts +0 -205
- package/packages/selector/src/runtime/audit.ts +0 -320
- package/packages/selector/src/runtime/config.ts +0 -756
- package/packages/selector/src/runtime/custom-policy.ts +0 -278
- package/packages/selector/src/runtime/deepseek-official-pricing.ts +0 -298
- package/packages/selector/src/runtime/deepseek-v4-vision-tokens.ts +0 -254
- package/packages/selector/src/runtime/display-prefs.ts +0 -98
- package/packages/selector/src/runtime/measurement.ts +0 -444
- package/packages/selector/src/runtime/monitor.ts +0 -310
- package/packages/selector/src/runtime/panel-command.ts +0 -213
- package/packages/selector/src/runtime/reducers.ts +0 -1754
- package/packages/selector/src/runtime/retrieve.ts +0 -503
- package/packages/selector/src/runtime/savings-integral.ts +0 -117
- package/packages/selector/src/runtime/savings-projection.ts +0 -229
- package/packages/selector/src/runtime/savings-verify.ts +0 -446
- package/packages/selector/src/runtime/savings.ts +0 -526
- package/packages/selector/src/runtime/session-events.ts +0 -30
- package/packages/selector/src/runtime/session-file-decode.ts +0 -523
- package/packages/selector/src/runtime/stats-backfill.ts +0 -541
- package/packages/selector/src/runtime/stats-db.ts +0 -492
- package/packages/selector/src/runtime/stats-schema.ts +0 -123
- package/packages/selector/src/runtime/stats-sync.ts +0 -307
- package/packages/selector/src/runtime/summary-command.ts +0 -127
- package/packages/selector/src/runtime/tail-trim.ts +0 -176
- package/packages/selector/src/runtime/token-count.ts +0 -72
- package/packages/selector/src/runtime/tokenpilot/advisor-prompt.ts +0 -233
- package/packages/selector/src/runtime/tokenpilot/advisor-state.ts +0 -204
- package/packages/selector/src/runtime/tokenpilot/advisor.ts +0 -419
- package/packages/selector/src/runtime/tokenpilot/benefit.ts +0 -200
- package/packages/selector/src/runtime/tokenpilot/dedup.ts +0 -81
- package/packages/selector/src/runtime/tokenpilot/estimator.ts +0 -151
- package/packages/selector/src/runtime/tokenpilot/intent-fold.ts +0 -53
- package/packages/selector/src/runtime/tokenpilot/intent-gate.ts +0 -65
- package/packages/selector/src/runtime/tokenpilot/intent-input-mask.ts +0 -125
- package/packages/selector/src/runtime/tokenpilot/intent-range.ts +0 -37
- package/packages/selector/src/runtime/tokenpilot/locator.ts +0 -128
- package/packages/selector/src/runtime/tokenpilot/read-state.ts +0 -98
- package/packages/selector/src/runtime/tokenpilot/sidechannel.ts +0 -303
- package/packages/selector/src/runtime/toolclass.ts +0 -103
- package/packages/selector/src/runtime/types.ts +0 -365
- package/packages/selector/src/runtime/value.ts +0 -48
- package/packages/selector/src/settings-bridge.ts +0 -175
- package/packages/selector/tests/advisor-report.host.spec.ts +0 -223
- package/packages/selector/tests/auto-compact.client.spec.tsx +0 -214
- package/packages/selector/tests/built/client-artifact.spec.ts +0 -56
- package/packages/selector/tests/cache-prefix-audit.spec.ts +0 -123
- package/packages/selector/tests/code-skeleton.client.spec.ts +0 -98
- package/packages/selector/tests/compat/compat-narrow-waist.spec.ts +0 -150
- package/packages/selector/tests/custom-contract.client.spec.ts +0 -226
- package/packages/selector/tests/estimator-catalog.spec.ts +0 -70
- package/packages/selector/tests/estimator-channel.client.spec.tsx +0 -253
- package/packages/selector/tests/estimator-route-registration.host.spec.ts +0 -202
- package/packages/selector/tests/fab-pos.client.spec.ts +0 -47
- package/packages/selector/tests/helpers/legacy-namespace.ts +0 -35
- package/packages/selector/tests/helpers/legacy-settings/index.ts +0 -15
- package/packages/selector/tests/helpers/legacy-settings/legacy/provider.d.ts +0 -41
- package/packages/selector/tests/helpers/legacy-settings/legacy/provider.js +0 -647
- package/packages/selector/tests/helpers/legacy-settings/legacy/redact.js +0 -78
- package/packages/selector/tests/helpers/legacy-settings/legacy/util-values.js +0 -234
- package/packages/selector/tests/host-preset-overlay.host.spec.ts +0 -204
- package/packages/selector/tests/monitor-fab.client.spec.ts +0 -240
- package/packages/selector/tests/preset-options-write.client.spec.ts +0 -192
- package/packages/selector/tests/preset-overlay-loader.e2e.host.spec.ts +0 -200
- package/packages/selector/tests/preset-overlay.host.spec.ts +0 -246
- package/packages/selector/tests/profiles.client.spec.tsx +0 -436
- package/packages/selector/tests/public/package-contract.client.spec.ts +0 -86
- package/packages/selector/tests/runtime/adaptive-cost.spec.ts +0 -167
- package/packages/selector/tests/runtime/advice-never-withholds.host.spec.ts +0 -230
- package/packages/selector/tests/runtime/advisor-invariant.spec.ts +0 -272
- package/packages/selector/tests/runtime/advisor.spec.ts +0 -226
- package/packages/selector/tests/runtime/audit.spec.ts +0 -275
- package/packages/selector/tests/runtime/auto-compact-config.spec.ts +0 -523
- package/packages/selector/tests/runtime/char-basis.spec.ts +0 -30
- package/packages/selector/tests/runtime/code-skeleton.spec.ts +0 -152
- package/packages/selector/tests/runtime/deepseek-official-pricing.spec.ts +0 -186
- package/packages/selector/tests/runtime/deepseek-v4-tokenizer.spec.ts +0 -122
- package/packages/selector/tests/runtime/deepseek-v4-vision-tokens.spec.ts +0 -122
- package/packages/selector/tests/runtime/deprecated-preset-options.spec.ts +0 -96
- package/packages/selector/tests/runtime/fixtures/profile-baseline.json +0 -273
- package/packages/selector/tests/runtime/fixtures/session-v4-dump.jsonl +0 -46
- package/packages/selector/tests/runtime/fixtures/tokenizer-golden.json +0 -106
- package/packages/selector/tests/runtime/fixtures/vision-golden.json +0 -459
- package/packages/selector/tests/runtime/frequency-longstrings.spec.ts +0 -74
- package/packages/selector/tests/runtime/fresh-gate.spec.ts +0 -43
- package/packages/selector/tests/runtime/html-reducer.spec.ts +0 -212
- package/packages/selector/tests/runtime/intent-gate.spec.ts +0 -62
- package/packages/selector/tests/runtime/intent-summary.spec.ts +0 -156
- package/packages/selector/tests/runtime/jsonl-reducer.spec.ts +0 -79
- package/packages/selector/tests/runtime/line-mapping.spec.ts +0 -153
- package/packages/selector/tests/runtime/monitor.spec.ts +0 -354
- package/packages/selector/tests/runtime/panel-command.spec.ts +0 -101
- package/packages/selector/tests/runtime/prose-reducers.spec.ts +0 -133
- package/packages/selector/tests/runtime/public/public-runtime.spec.ts +0 -2781
- package/packages/selector/tests/runtime/read-input-cap.spec.ts +0 -33
- package/packages/selector/tests/runtime/savings-accounting.spec.ts +0 -291
- package/packages/selector/tests/runtime/savings-integral.spec.ts +0 -169
- package/packages/selector/tests/runtime/savings-projection.spec.ts +0 -89
- package/packages/selector/tests/runtime/savings-verify.spec.ts +0 -226
- package/packages/selector/tests/runtime/savings.spec.ts +0 -139
- package/packages/selector/tests/runtime/search-reducer.spec.ts +0 -110
- package/packages/selector/tests/runtime/session-events.spec.ts +0 -27
- package/packages/selector/tests/runtime/session-file-decode.spec.ts +0 -281
- package/packages/selector/tests/runtime/settings-unwrap.spec.ts +0 -58
- package/packages/selector/tests/runtime/sidechannel.spec.ts +0 -241
- package/packages/selector/tests/runtime/stats-backfill-scheduler.spec.ts +0 -167
- package/packages/selector/tests/runtime/stats-backfill.spec.ts +0 -348
- package/packages/selector/tests/runtime/stats-db.spec.ts +0 -361
- package/packages/selector/tests/runtime/stats-privacy.spec.ts +0 -55
- package/packages/selector/tests/runtime/stats-sync.spec.ts +0 -278
- package/packages/selector/tests/runtime/summary-command.spec.ts +0 -154
- package/packages/selector/tests/runtime/toc-and-bundled.spec.ts +0 -159
- package/packages/selector/tests/runtime/tokenizer-golden.spec.ts +0 -53
- package/packages/selector/tests/runtime/tokenpilot/benefit.spec.ts +0 -217
- package/packages/selector/tests/runtime/tokenpilot/dedup.spec.ts +0 -52
- package/packages/selector/tests/runtime/tokenpilot/estimator.spec.ts +0 -79
- package/packages/selector/tests/runtime/tokenpilot/locator.spec.ts +0 -76
- package/packages/selector/tests/runtime/tokenpilot/profile-baseline.spec.ts +0 -119
- package/packages/selector/tests/runtime/tokenpilot/read-state.spec.ts +0 -82
- package/packages/selector/tests/runtime/toolclass.spec.ts +0 -156
- package/packages/selector/tests/runtime/value.spec.ts +0 -23
- package/packages/selector/tests/savings-sessions.client.spec.tsx +0 -140
- package/packages/selector/tests/settings-seat.client.spec.ts +0 -215
- package/packages/selector/tests/standing-generation.host.spec.ts +0 -724
- package/packages/selector/tests/subagent-cache-reuse.host.spec.ts +0 -269
- package/packages/selector/tests/support/cache-prefix-audit.ts +0 -105
- package/packages/selector/tests/support/mock-adapter.ts +0 -37
- package/packages/selector/tests/support/ui-primitives.tsx +0 -34
- package/packages/selector/tsconfig.json +0 -11
- package/packages/selector/tsdown.client.config.ts +0 -102
- package/packages/selector/tsdown.config.ts +0 -20
- package/pnpm-workspace.yaml +0 -76
- package/scripts/capture-profile-baseline.mjs +0 -42
- package/scripts/cell-browser-e2e.mjs +0 -354
- package/scripts/generate-tokenizer-fixtures.py +0 -81
- package/scripts/generate-vision-fixtures.py +0 -208
- package/scripts/hosts.mjs +0 -78
- package/scripts/packed-components-smoke.mjs +0 -763
- package/scripts/packed-install-e2e.mjs +0 -1346
- package/scripts/sync-hosts.mjs +0 -174
- package/scripts/toolclass-corpus-replay.mjs +0 -281
- package/scripts/verify-release.mjs +0 -338
- package/tests/TEST_INVENTORY.md +0 -41
- package/tsconfig.base.json +0 -18
- package/tsconfig.json +0 -7
- package/tsconfig.tests.json +0 -15
- package/vitest.built.config.ts +0 -9
- package/vitest.config.ts +0 -54
- /package/{packages/selector/assets → assets}/deepseek-v4/LICENSE.DeepSeek-V4-Pro.txt +0 -0
- /package/{packages/selector/assets → assets}/deepseek-v4/manifest.json +0 -0
- /package/{packages/selector/assets → assets}/deepseek-v4/tokenizer.json +0 -0
- /package/{packages/selector/assets → assets}/deepseek-v4/tokenizer_config.json +0 -0
- /package/{packages/selector/assets → assets}/deepseek-v4-vision-exp/LICENSE.DeepSeek-V4-Flash-Vision-Exp.txt +0 -0
- /package/{packages/selector/assets → assets}/deepseek-v4-vision-exp/manifest.json +0 -0
- /package/{packages/selector/assets → assets}/deepseek-v4-vision-exp/tokenizer.json +0 -0
- /package/{packages/selector/assets → assets}/deepseek-v4-vision-exp/tokenizer_config.json +0 -0
- /package/{packages/selector/cordis.patch.yml → cordis.patch.yml} +0 -0
- /package/{packages/selector/lib → lib}/index.d.ts +0 -0
- /package/{packages/selector/lib → lib}/index.js +0 -0
- /package/{packages/selector/lib → lib}/invariant.d.ts +0 -0
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-context-compression-improved",
|
|
3
|
-
"version": "0.10.3",
|
|
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
|
-
"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"
|
|
60
|
-
},
|
|
61
|
-
"repository": {
|
|
62
|
-
"type": "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"
|
|
69
|
-
},
|
|
70
|
-
"author": "WilliamShi666",
|
|
71
|
-
"engines": {
|
|
72
|
-
"node": "^22.19.0 || >=24.0.0",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5"
|
|
74
|
-
},
|
|
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": "latest"
|
|
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"
|
|
93
|
-
},
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
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 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5",
|
|
117
|
-
"react": ">=18 <19"
|
|
118
|
-
},
|
|
119
|
-
"peerDependenciesMeta": {
|
|
120
|
-
"@deepseek-ai/dsh-agent": {
|
|
121
|
-
"optional": true
|
|
122
|
-
},
|
|
123
|
-
"@deepseek-ai/dsh-agent-presets": {
|
|
124
|
-
"optional": true
|
|
125
|
-
},
|
|
126
|
-
"@deepseek-ai/dsh-client-locale": {
|
|
127
|
-
"optional": true
|
|
128
|
-
},
|
|
129
|
-
"@deepseek-ai/dsh-client-store": {
|
|
130
|
-
"optional": true
|
|
131
|
-
},
|
|
132
|
-
"@deepseek-ai/dsh-client-ui-primitives": {
|
|
133
|
-
"optional": true
|
|
134
|
-
},
|
|
135
|
-
"@deepseek-ai/dsh-client-ui-session": {
|
|
136
|
-
"optional": true
|
|
137
|
-
},
|
|
138
|
-
"@deepseek-ai/dsh-client-ui-settings": {
|
|
139
|
-
"optional": true
|
|
140
|
-
},
|
|
141
|
-
"@deepseek-ai/dsh-client-ui-slots": {
|
|
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
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CompressionProfileControls: dropdown selector for compression profiles,
|
|
3
|
-
* plus AutoCompactThresholdControls and CodeSkeletonControls sub-components.
|
|
4
|
-
*
|
|
5
|
-
* Extracted from CompressionProfileSelector.tsx to reduce god-module size.
|
|
6
|
-
*
|
|
7
|
-
* @module dsh-context-compression-improved/client/CompressionProfileControls
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { useEffect, useId, useState } from 'react'
|
|
11
|
-
import { IconChevronDownOutlineMedium, Menu } from '@deepseek-ai/dsh-client-ui-primitives'
|
|
12
|
-
import type { ContextCompressionLocaleKey } from './locales.ts'
|
|
13
|
-
import css from './CompressionProfileSelector.module.css'
|
|
14
|
-
import {
|
|
15
|
-
AUTO_COMPACT_THRESHOLD_LIMITS,
|
|
16
|
-
COMPRESSION_PROFILES,
|
|
17
|
-
isValidAutoCompactThresholdPercent,
|
|
18
|
-
type CompressionProfile,
|
|
19
|
-
type CustomCompressionPolicyV3,
|
|
20
|
-
} from '../profiles.ts'
|
|
21
|
-
import type { CompressionProfileSelectorProps } from './CompressionProfileSelector.tsx'
|
|
22
|
-
import { CustomPolicyEditor, editableCustom } from './CustomPolicyEditor.tsx'
|
|
23
|
-
|
|
24
|
-
export function CompressionProfileControls({
|
|
25
|
-
useCompression, select, saveCustom, resetCustom, t, showCustomEditor,
|
|
26
|
-
}: CompressionProfileSelectorProps & { showCustomEditor: boolean }) {
|
|
27
|
-
const state = useCompression(snapshot => snapshot)
|
|
28
|
-
// Harness 0.1.5 dropped browser-side agentPreset from session summaries; see
|
|
29
|
-
// the section component note. Only Minimal used to block initial
|
|
30
|
-
// configuration, and that signal is no longer available client-side.
|
|
31
|
-
const contextCompressionAvailable = true
|
|
32
|
-
const [open, setOpen] = useState(false)
|
|
33
|
-
const [saving, setSaving] = useState(false)
|
|
34
|
-
const [saveError, setSaveError] = useState<string | null>(null)
|
|
35
|
-
const [draft, setDraft] = useState<CustomCompressionPolicyV3 | null>(null)
|
|
36
|
-
const unavailableId = useId()
|
|
37
|
-
const current = state.value?.profile ?? 'balanced'
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (state.status === 'ready' && state.writable && contextCompressionAvailable) return
|
|
40
|
-
setOpen(false)
|
|
41
|
-
}, [contextCompressionAvailable, state.status, state.writable])
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
const custom = state.value?.custom
|
|
44
|
-
setDraft(current === 'custom' && custom !== undefined ? editableCustom(custom) : null)
|
|
45
|
-
}, [current, state.value?.custom])
|
|
46
|
-
if (state.status === 'unavailable') return null
|
|
47
|
-
const busy = state.status === 'loading' || saving
|
|
48
|
-
const label = busy ? t('status.loading') : t(`profile.${current}`)
|
|
49
|
-
return (
|
|
50
|
-
<div className={css.root}>
|
|
51
|
-
<Menu
|
|
52
|
-
open={open && contextCompressionAvailable}
|
|
53
|
-
onClose={() => { setOpen(false) }}
|
|
54
|
-
selectedId={current}
|
|
55
|
-
items={COMPRESSION_PROFILES.map(profile => ({
|
|
56
|
-
id: profile,
|
|
57
|
-
label: (
|
|
58
|
-
<span className={css.menuCopy}>
|
|
59
|
-
<span className={css.menuTitle}>{t(`profile.${profile}`)}</span>
|
|
60
|
-
<span className={css.menuDetail}>{t(`detail.${profile}`)}</span>
|
|
61
|
-
</span>
|
|
62
|
-
),
|
|
63
|
-
}))}
|
|
64
|
-
onSelect={(id) => {
|
|
65
|
-
setOpen(false)
|
|
66
|
-
if (id === current || !COMPRESSION_PROFILES.includes(id as CompressionProfile)) return
|
|
67
|
-
setSaveError(null)
|
|
68
|
-
setSaving(true)
|
|
69
|
-
void select(id as CompressionProfile).then(
|
|
70
|
-
() => { setSaving(false) },
|
|
71
|
-
(error: unknown) => {
|
|
72
|
-
setSaving(false)
|
|
73
|
-
setSaveError(error instanceof Error && error.message !== '' ? error.message : t('status.saveFailed'))
|
|
74
|
-
},
|
|
75
|
-
)
|
|
76
|
-
}}
|
|
77
|
-
align="start"
|
|
78
|
-
portal
|
|
79
|
-
anchor={(
|
|
80
|
-
<button
|
|
81
|
-
type="button"
|
|
82
|
-
className={css.button}
|
|
83
|
-
aria-haspopup="menu"
|
|
84
|
-
aria-expanded={open && contextCompressionAvailable}
|
|
85
|
-
aria-describedby={contextCompressionAvailable ? undefined : unavailableId}
|
|
86
|
-
disabled={busy || !state.writable || !contextCompressionAvailable}
|
|
87
|
-
onClick={() => { setOpen(value => !value) }}
|
|
88
|
-
>
|
|
89
|
-
<span className={css.copy}>
|
|
90
|
-
<span className={css.label}>{t('label')}</span>
|
|
91
|
-
<span className={css.value}>{label}</span>
|
|
92
|
-
</span>
|
|
93
|
-
<IconChevronDownOutlineMedium className={css.chevron} />
|
|
94
|
-
</button>
|
|
95
|
-
)}
|
|
96
|
-
/>
|
|
97
|
-
{contextCompressionAvailable ? null : (
|
|
98
|
-
<div id={unavailableId} className={css.unavailable} role="status">
|
|
99
|
-
{t('status.minimalUnavailable')}
|
|
100
|
-
</div>
|
|
101
|
-
)}
|
|
102
|
-
<div className={css.pricing}>{t('pricing.disclosure')}</div>
|
|
103
|
-
<div className={css.settingsHint}>
|
|
104
|
-
{t('autoCompact.summaryHint').replace('{percent}', String(state.value?.autoCompact?.thresholdPercent ?? AUTO_COMPACT_THRESHOLD_LIMITS.default))}
|
|
105
|
-
</div>
|
|
106
|
-
{current !== 'custom' || showCustomEditor ? null : (
|
|
107
|
-
<div className={css.settingsHint}>{t('custom.settingsHint')}</div>
|
|
108
|
-
)}
|
|
109
|
-
{current !== 'custom' || draft === null || !showCustomEditor ? null : (
|
|
110
|
-
<CustomPolicyEditor
|
|
111
|
-
value={draft}
|
|
112
|
-
disabled={busy || !state.writable || !contextCompressionAvailable}
|
|
113
|
-
setValue={setDraft}
|
|
114
|
-
save={() => saveCustom(structuredClone(draft))}
|
|
115
|
-
reset={resetCustom}
|
|
116
|
-
settle={(operation) => {
|
|
117
|
-
setSaveError(null)
|
|
118
|
-
setSaving(true)
|
|
119
|
-
void operation().then(
|
|
120
|
-
() => { setSaving(false) },
|
|
121
|
-
(error: unknown) => {
|
|
122
|
-
setSaving(false)
|
|
123
|
-
setSaveError(error instanceof Error && error.message !== '' ? error.message : t('status.saveFailed'))
|
|
124
|
-
},
|
|
125
|
-
)
|
|
126
|
-
}}
|
|
127
|
-
t={t}
|
|
128
|
-
/>
|
|
129
|
-
)}
|
|
130
|
-
{saveError === null ? null : <div className={css.error} role="alert">{saveError}</div>}
|
|
131
|
-
</div>
|
|
132
|
-
)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
interface AutoCompactThresholdControlsProps {
|
|
136
|
-
value: number
|
|
137
|
-
disabled: boolean
|
|
138
|
-
save: (thresholdPercent: number) => Promise<void>
|
|
139
|
-
settle: (operation: () => Promise<void>) => void
|
|
140
|
-
t: (key: ContextCompressionLocaleKey) => string
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* The authoritative Auto Compact threshold editor for the context-compression
|
|
145
|
-
* section. A typed number input and its save path are kept deliberately simple;
|
|
146
|
-
* values outside the recommended 70–85 band warn without blocking.
|
|
147
|
-
*/
|
|
148
|
-
export function AutoCompactThresholdControls({ value, disabled, save, settle, t }: AutoCompactThresholdControlsProps) {
|
|
149
|
-
const [draft, setDraft] = useState(String(value))
|
|
150
|
-
useEffect(() => { setDraft(String(value)) }, [value])
|
|
151
|
-
const parsed = Number(draft)
|
|
152
|
-
// Number inputs legally produce value-equivalent drafts such as '8e1';
|
|
153
|
-
// only the parsed value needs to be a valid threshold.
|
|
154
|
-
const valid = isValidAutoCompactThresholdPercent(parsed)
|
|
155
|
-
const risk = !valid
|
|
156
|
-
? 'autoCompact.invalid'
|
|
157
|
-
: parsed < 70 ? 'autoCompact.riskLow'
|
|
158
|
-
: parsed > 85 ? 'autoCompact.riskHigh'
|
|
159
|
-
: undefined
|
|
160
|
-
return (
|
|
161
|
-
<section className={css.autoCompact} aria-labelledby="context-compression-autocompact-title">
|
|
162
|
-
<h3 id="context-compression-autocompact-title" className={css.autoCompactTitle}>{t('autoCompact.title')}</h3>
|
|
163
|
-
<p className={css.customNote}>{t('autoCompact.description')}</p>
|
|
164
|
-
<label className={css.field}>
|
|
165
|
-
<span>{t('autoCompact.inputLabel')}</span>
|
|
166
|
-
<input
|
|
167
|
-
type="number"
|
|
168
|
-
value={draft}
|
|
169
|
-
min={AUTO_COMPACT_THRESHOLD_LIMITS.min}
|
|
170
|
-
max={AUTO_COMPACT_THRESHOLD_LIMITS.max}
|
|
171
|
-
step={AUTO_COMPACT_THRESHOLD_LIMITS.step}
|
|
172
|
-
disabled={disabled}
|
|
173
|
-
aria-invalid={!valid}
|
|
174
|
-
onChange={(event) => { setDraft(event.currentTarget.value) }}
|
|
175
|
-
/>
|
|
176
|
-
</label>
|
|
177
|
-
{risk === undefined ? null : (
|
|
178
|
-
<div className={risk === 'autoCompact.invalid' ? css.error : css.autoCompactRisk} role={risk === 'autoCompact.invalid' ? 'alert' : 'note'}>
|
|
179
|
-
{t(risk)}
|
|
180
|
-
</div>
|
|
181
|
-
)}
|
|
182
|
-
<div className={css.actions}>
|
|
183
|
-
<button
|
|
184
|
-
type="button"
|
|
185
|
-
disabled={disabled || !valid || parsed === value}
|
|
186
|
-
onClick={() => { settle(() => save(parsed)) }}
|
|
187
|
-
>
|
|
188
|
-
{t('autoCompact.save')}
|
|
189
|
-
</button>
|
|
190
|
-
</div>
|
|
191
|
-
</section>
|
|
192
|
-
)
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
interface CodeSkeletonControlsProps {
|
|
196
|
-
value: boolean
|
|
197
|
-
disabled: boolean
|
|
198
|
-
save: (enabled: boolean) => Promise<void>
|
|
199
|
-
settle: (operation: () => Promise<void>) => void
|
|
200
|
-
t: (key: ContextCompressionLocaleKey) => string
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* The authoritative code-skeleton reducer gate for the context-compression
|
|
205
|
-
* section. Deliberately minimal — an on/off select plus its own save path —
|
|
206
|
-
* because the gate is orthogonal to every profile and carries no parameters.
|
|
207
|
-
*/
|
|
208
|
-
interface IntentSummaryControlsProps {
|
|
209
|
-
value: boolean
|
|
210
|
-
disabled: boolean
|
|
211
|
-
save: (enabled: boolean) => Promise<void>
|
|
212
|
-
settle: (operation: () => Promise<void>) => void
|
|
213
|
-
t: (key: ContextCompressionLocaleKey) => string
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* The turn-tail intent summary fold gate. Same deliberately minimal shape as
|
|
218
|
-
* the code-skeleton gate: an on/off select with its own save path; the fold
|
|
219
|
-
* itself is gated by the growth constants and the per-session /ctx-summary
|
|
220
|
-
* override, none of which belong in this card.
|
|
221
|
-
*/
|
|
222
|
-
export function IntentSummaryControls({ value, disabled, save, settle, t }: IntentSummaryControlsProps) {
|
|
223
|
-
return (
|
|
224
|
-
<section className={css.autoCompact} aria-labelledby="context-compression-intentsummary-title">
|
|
225
|
-
<h3 id="context-compression-intentsummary-title" className={css.autoCompactTitle}>{t('intentSummary.title')}</h3>
|
|
226
|
-
<p className={css.customNote}>{t('intentSummary.description')}</p>
|
|
227
|
-
<label className={css.field}>
|
|
228
|
-
<span>{t('intentSummary.enabled')}</span>
|
|
229
|
-
<select
|
|
230
|
-
value={value ? 'on' : 'off'}
|
|
231
|
-
disabled={disabled}
|
|
232
|
-
onChange={(event) => { settle(() => save(event.currentTarget.value === 'on')) }}
|
|
233
|
-
>
|
|
234
|
-
<option value="on">{t('intentSummary.enabled.on')}</option>
|
|
235
|
-
<option value="off">{t('intentSummary.enabled.off')}</option>
|
|
236
|
-
</select>
|
|
237
|
-
</label>
|
|
238
|
-
</section>
|
|
239
|
-
)
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
interface MonitorPanelControlsProps {
|
|
243
|
-
value: boolean
|
|
244
|
-
disabled: boolean
|
|
245
|
-
save: (enabled: boolean) => Promise<void>
|
|
246
|
-
settle: (operation: () => Promise<void>) => void
|
|
247
|
-
t: (key: ContextCompressionLocaleKey) => string
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Visibility switch of the floating compression-monitor panel (FAB). The
|
|
252
|
-
* panel itself is a body-level overlay driven by the monitor route; this card
|
|
253
|
-
* only decides whether it mounts.
|
|
254
|
-
*/
|
|
255
|
-
export function MonitorPanelControls({ value, disabled, save, settle, t }: MonitorPanelControlsProps) {
|
|
256
|
-
return (
|
|
257
|
-
<section className={css.autoCompact} aria-labelledby="context-compression-monitorpanel-title">
|
|
258
|
-
<h3 id="context-compression-monitorpanel-title" className={css.autoCompactTitle}>{t('monitorPanel.title')}</h3>
|
|
259
|
-
<p className={css.customNote}>{t('monitorPanel.description')}</p>
|
|
260
|
-
<label className={css.field}>
|
|
261
|
-
<span>{t('monitorPanel.enabled')}</span>
|
|
262
|
-
<select
|
|
263
|
-
value={value ? 'on' : 'off'}
|
|
264
|
-
disabled={disabled}
|
|
265
|
-
onChange={(event) => { settle(() => save(event.currentTarget.value === 'on')) }}
|
|
266
|
-
>
|
|
267
|
-
<option value="on">{t('monitorPanel.enabled.on')}</option>
|
|
268
|
-
<option value="off">{t('monitorPanel.enabled.off')}</option>
|
|
269
|
-
</select>
|
|
270
|
-
</label>
|
|
271
|
-
</section>
|
|
272
|
-
)
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
export function CodeSkeletonControls({ value, disabled, save, settle, t }: CodeSkeletonControlsProps) {
|
|
276
|
-
return (
|
|
277
|
-
<section className={css.autoCompact} aria-labelledby="context-compression-codeskeleton-title">
|
|
278
|
-
<h3 id="context-compression-codeskeleton-title" className={css.autoCompactTitle}>{t('codeSkeleton.title')}</h3>
|
|
279
|
-
<p className={css.customNote}>{t('codeSkeleton.description')}</p>
|
|
280
|
-
<label className={css.field}>
|
|
281
|
-
<span>{t('codeSkeleton.enabled')}</span>
|
|
282
|
-
<select
|
|
283
|
-
value={value ? 'on' : 'off'}
|
|
284
|
-
disabled={disabled}
|
|
285
|
-
onChange={(event) => { settle(() => save(event.currentTarget.value === 'on')) }}
|
|
286
|
-
>
|
|
287
|
-
<option value="on">{t('codeSkeleton.enabled.on')}</option>
|
|
288
|
-
<option value="off">{t('codeSkeleton.enabled.off')}</option>
|
|
289
|
-
</select>
|
|
290
|
-
</label>
|
|
291
|
-
</section>
|
|
292
|
-
)
|
|
293
|
-
}
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
.settingsSection {
|
|
2
|
-
display: flex;
|
|
3
|
-
max-width: 720px;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
gap: 12px;
|
|
6
|
-
color: var(--dsw-alias-label-primary);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.settingsTitle {
|
|
10
|
-
margin: 0;
|
|
11
|
-
color: var(--dsw-alias-label-primary);
|
|
12
|
-
font-size: 16px;
|
|
13
|
-
font-weight: 500;
|
|
14
|
-
line-height: 24px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.settingsDescription {
|
|
18
|
-
margin: 0;
|
|
19
|
-
color: var(--dsw-alias-label-tertiary);
|
|
20
|
-
font-size: 14px;
|
|
21
|
-
line-height: 22px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.root {
|
|
25
|
-
width: 100%;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.profileGrid {
|
|
29
|
-
display: grid;
|
|
30
|
-
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
31
|
-
gap: 10px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.profileCard {
|
|
35
|
-
min-height: 112px;
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
gap: 8px;
|
|
39
|
-
padding: 14px;
|
|
40
|
-
border: 1px solid var(--dsw-alias-border-l2);
|
|
41
|
-
border-radius: 10px;
|
|
42
|
-
background: transparent;
|
|
43
|
-
color: var(--dsw-alias-label-primary);
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
text-align: left;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.profileCard:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }
|
|
49
|
-
.profileCard[aria-pressed="true"] { border-color: var(--dsw-alias-label-primary); }
|
|
50
|
-
.profileCard:active:not(:disabled) { transform: scale(.99); }
|
|
51
|
-
.profileCard:disabled { cursor: default; opacity: .6; }
|
|
52
|
-
.profileCard:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
|
|
53
|
-
.profileCardTop { display: flex; align-items: center; gap: 8px; }
|
|
54
|
-
.profileCardTitle { font-size: 14px; font-weight: 500; line-height: 20px; }
|
|
55
|
-
.profileCurrent { padding: 1px 6px; border-radius: 999px; background: var(--dsw-alias-label-primary); color: var(--dsw-alias-bg-base); font-size: 10px; line-height: 14px; }
|
|
56
|
-
.profileCardDetail { color: var(--dsw-alias-label-secondary); font-size: 12px; line-height: 18px; }
|
|
57
|
-
|
|
58
|
-
.button {
|
|
59
|
-
width: 100%;
|
|
60
|
-
min-height: 34px;
|
|
61
|
-
display: flex;
|
|
62
|
-
align-items: center;
|
|
63
|
-
gap: 8px;
|
|
64
|
-
padding: 6px 8px;
|
|
65
|
-
border: 1px solid var(--dsw-alias-border-l2);
|
|
66
|
-
border-radius: 10px;
|
|
67
|
-
background: transparent;
|
|
68
|
-
color: var(--dsw-alias-label-primary);
|
|
69
|
-
cursor: pointer;
|
|
70
|
-
text-align: left;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.button:hover { background: var(--dsw-alias-interactive-bg-hover); }
|
|
74
|
-
.button:disabled { cursor: default; opacity: .6; }
|
|
75
|
-
|
|
76
|
-
.copy { flex: 1; min-width: 0; }
|
|
77
|
-
.label { font-size: 11px; line-height: 14px; color: var(--dsw-alias-label-tertiary); }
|
|
78
|
-
.value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 17px; }
|
|
79
|
-
.chevron { flex: none; color: var(--dsw-alias-label-secondary); }
|
|
80
|
-
|
|
81
|
-
.menuCopy { display: flex; min-width: 220px; flex-direction: column; gap: 2px; }
|
|
82
|
-
.menuTitle { font-size: 13px; line-height: 17px; }
|
|
83
|
-
.menuDetail { max-width: 290px; white-space: normal; font-size: 11px; line-height: 15px; color: var(--dsw-alias-label-tertiary); }
|
|
84
|
-
|
|
85
|
-
.error {
|
|
86
|
-
padding: 4px 8px 0;
|
|
87
|
-
color: var(--dsw-alias-state-error-primary);
|
|
88
|
-
font-size: 11px;
|
|
89
|
-
line-height: 15px;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.unavailable {
|
|
93
|
-
padding: 4px 8px 0;
|
|
94
|
-
color: var(--dsw-alias-label-tertiary);
|
|
95
|
-
font-size: 11px;
|
|
96
|
-
line-height: 15px;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.settingsHint {
|
|
100
|
-
padding: 4px 8px 0;
|
|
101
|
-
color: var(--dsw-alias-label-secondary);
|
|
102
|
-
font-size: 11px;
|
|
103
|
-
line-height: 15px;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.pricing {
|
|
107
|
-
padding: 4px 8px 0;
|
|
108
|
-
color: var(--dsw-alias-label-tertiary);
|
|
109
|
-
font-size: 11px;
|
|
110
|
-
line-height: 15px;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.custom {
|
|
114
|
-
margin-top: 16px;
|
|
115
|
-
padding: 16px 0 0;
|
|
116
|
-
border-top: 1px solid var(--dsw-alias-border-l2);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.customTitle { margin: 0 0 6px; font-size: 13px; line-height: 17px; }
|
|
120
|
-
.customNote { margin: 4px 0; color: var(--dsw-alias-label-tertiary); font-size: 11px; line-height: 15px; }
|
|
121
|
-
|
|
122
|
-
.stage {
|
|
123
|
-
margin: 12px 0 0;
|
|
124
|
-
padding: 12px 0 0;
|
|
125
|
-
border: 0;
|
|
126
|
-
border-top: 1px solid var(--dsw-alias-border-l2);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.stageToggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; }
|
|
130
|
-
.fieldGrid { display: grid; grid-template-columns: 1fr; gap: 8px; }
|
|
131
|
-
.field { display: flex; min-width: 0; flex-direction: column; gap: 4px; margin-top: 8px; color: var(--dsw-alias-label-secondary); font-size: 11px; line-height: 15px; }
|
|
132
|
-
.field input, .field select {
|
|
133
|
-
width: 100%;
|
|
134
|
-
min-width: 0;
|
|
135
|
-
min-height: 30px;
|
|
136
|
-
box-sizing: border-box;
|
|
137
|
-
padding: 4px 6px;
|
|
138
|
-
border: 1px solid var(--dsw-alias-border-l2);
|
|
139
|
-
border-radius: 7px;
|
|
140
|
-
background: var(--dsw-alias-bg-base);
|
|
141
|
-
color: var(--dsw-alias-label-primary);
|
|
142
|
-
}
|
|
143
|
-
.field input:focus-visible, .field select:focus-visible, .actions button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
|
|
144
|
-
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
|
|
145
|
-
.actions button { min-height: 30px; padding: 4px 8px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 7px; background: transparent; color: var(--dsw-alias-label-primary); }
|
|
146
|
-
.actions button:active:not(:disabled) { transform: scale(.98); }
|
|
147
|
-
.actions button:disabled { opacity: .6; }
|
|
148
|
-
|
|
149
|
-
@media (max-width: 560px) {
|
|
150
|
-
.profileGrid { grid-template-columns: 1fr; }
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.autoCompact {
|
|
154
|
-
margin-top: 24px;
|
|
155
|
-
padding: 16px;
|
|
156
|
-
border: 1px solid rgba(128, 128, 128, 0.35);
|
|
157
|
-
border-radius: 8px;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.autoCompactTitle {
|
|
161
|
-
margin: 0 0 8px;
|
|
162
|
-
font-size: 15px;
|
|
163
|
-
font-weight: 600;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.autoCompactRisk {
|
|
167
|
-
margin: 8px 0 0;
|
|
168
|
-
font-size: 12px;
|
|
169
|
-
opacity: 0.9;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.savingsCard {
|
|
173
|
-
margin-top: 14px;
|
|
174
|
-
padding: 10px 12px;
|
|
175
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
176
|
-
border-radius: 8px;
|
|
177
|
-
display: flex;
|
|
178
|
-
flex-direction: column;
|
|
179
|
-
gap: 4px;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.savingsRow {
|
|
183
|
-
display: flex;
|
|
184
|
-
justify-content: space-between;
|
|
185
|
-
align-items: baseline;
|
|
186
|
-
gap: 12px;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.savingsNetPositive strong { color: #30d158; }
|
|
190
|
-
.savingsNetNegative strong { color: #ff9f0a; }
|
|
191
|
-
.savingsMuted { opacity: 0.66; font-size: 0.92em; }
|
|
192
|
-
|
|
193
|
-
.savingsBreakdown {
|
|
194
|
-
border-top: 1px solid rgba(255, 255, 255, 0.08);
|
|
195
|
-
margin-top: 4px;
|
|
196
|
-
padding-top: 4px;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.savingsNote { opacity: 0.5; font-size: 0.85em; margin-top: 4px; }
|