dsh-context-compression-improved 0.6.5 → 0.8.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.
- package/CHANGELOG.ja.md +226 -211
- package/CHANGELOG.ko.md +220 -205
- package/CHANGELOG.md +366 -350
- package/CHANGELOG.zh.md +204 -190
- package/README.ja.md +85 -85
- package/README.ko.md +85 -85
- package/README.md +98 -96
- package/README.zh.md +85 -85
- package/package.json +68 -69
- package/packages/selector/dsh.plugin.json +2 -2
- package/packages/selector/lib/pruner.js +0 -1
- package/packages/selector/lib/style.css +46 -46
- package/packages/selector/package.json +114 -114
- package/packages/selector/tests/built/client-artifact.spec.ts +59 -59
- package/packages/selector/tests/helpers/legacy-settings/index.ts +15 -15
- package/packages/selector/tests/helpers/legacy-settings/legacy/provider.d.ts +41 -41
- package/packages/selector/tests/helpers/legacy-settings/legacy/provider.js +647 -647
- package/packages/selector/tests/helpers/legacy-settings/legacy/redact.js +78 -78
- package/packages/selector/tests/helpers/legacy-settings/legacy/util-values.js +234 -234
- package/packages/selector/tests/host-preset-overlay.host.spec.ts +1 -1
- package/packages/selector/tests/preset-overlay-loader.e2e.host.spec.ts +200 -200
- package/packages/selector/tests/public/package-contract.client.spec.ts +78 -78
- package/packages/selector/tests/runtime/advice-never-withholds.host.spec.ts +230 -230
- package/packages/selector/tests/runtime/public/public-runtime.spec.ts +2731 -2731
- package/packages/selector/tests/standing-generation.host.spec.ts +724 -724
- package/pnpm-workspace.yaml +66 -66
- package/scripts/packed-install-e2e.mjs +1273 -1273
- package/scripts/verify-release.mjs +317 -317
- package/.agents-stash-064.patch +0 -39
- package/_dsh_devdeps.json +0 -50
- package/_verify064/package/package.json +0 -162
- package/_verify064/package/packages/selector/src/client/index.ts +0 -232
|
@@ -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.
|
|
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.
|
|
94
|
-
"@deepseek-ai/dsh-agent-presets": ">=0.
|
|
95
|
-
"@deepseek-ai/dsh-client-locale": ">=0.
|
|
96
|
-
"@deepseek-ai/dsh-client-store": ">=0.
|
|
97
|
-
"@deepseek-ai/dsh-client-ui-primitives": ">=0.
|
|
98
|
-
"@deepseek-ai/dsh-client-ui-session": ">=0.
|
|
99
|
-
"@deepseek-ai/dsh-client-ui-settings": ">=0.
|
|
100
|
-
"@deepseek-ai/dsh-client-ui-slots": ">=0.
|
|
101
|
-
"@deepseek-ai/dsh-client-ui-workspace": ">=0.
|
|
102
|
-
"@deepseek-ai/dsh-command-compact": ">=0.
|
|
103
|
-
"@deepseek-ai/dsh-compaction": ">=0.
|
|
104
|
-
"@deepseek-ai/dsh-compaction-basic": ">=0.
|
|
105
|
-
"@deepseek-ai/dsh-invariants": ">=0.
|
|
106
|
-
"@deepseek-ai/dsh-llm": ">=0.
|
|
107
|
-
"@deepseek-ai/dsh-session": ">=0.
|
|
108
|
-
"@deepseek-ai/dsh-settings": ">=0.
|
|
109
|
-
"@deepseek-ai/dsh-system-prompt": ">=0.
|
|
110
|
-
"@deepseek-ai/dsh-token-meter": ">=0.
|
|
111
|
-
"@deepseek-ai/dsh-tools": ">=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.2.0-rc.1 <0.2.1-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.2.0-rc.1 <0.2.1-0",
|
|
94
|
+
"@deepseek-ai/dsh-agent-presets": ">=0.2.0-rc.1 <0.2.1-0",
|
|
95
|
+
"@deepseek-ai/dsh-client-locale": ">=0.2.0-rc.1 <0.2.1-0",
|
|
96
|
+
"@deepseek-ai/dsh-client-store": ">=0.2.0-rc.1 <0.2.1-0",
|
|
97
|
+
"@deepseek-ai/dsh-client-ui-primitives": ">=0.2.0-rc.1 <0.2.1-0",
|
|
98
|
+
"@deepseek-ai/dsh-client-ui-session": ">=0.2.0-rc.1 <0.2.1-0",
|
|
99
|
+
"@deepseek-ai/dsh-client-ui-settings": ">=0.2.0-rc.1 <0.2.1-0",
|
|
100
|
+
"@deepseek-ai/dsh-client-ui-slots": ">=0.2.0-rc.1 <0.2.1-0",
|
|
101
|
+
"@deepseek-ai/dsh-client-ui-workspace": ">=0.2.0-rc.1 <0.2.1-0",
|
|
102
|
+
"@deepseek-ai/dsh-command-compact": ">=0.2.0-rc.1 <0.2.1-0",
|
|
103
|
+
"@deepseek-ai/dsh-compaction": ">=0.2.0-rc.1 <0.2.1-0",
|
|
104
|
+
"@deepseek-ai/dsh-compaction-basic": ">=0.2.0-rc.1 <0.2.1-0",
|
|
105
|
+
"@deepseek-ai/dsh-invariants": ">=0.2.0-rc.1 <0.2.1-0",
|
|
106
|
+
"@deepseek-ai/dsh-llm": ">=0.2.0-rc.1 <0.2.1-0",
|
|
107
|
+
"@deepseek-ai/dsh-session": ">=0.2.0-rc.1 <0.2.1-0",
|
|
108
|
+
"@deepseek-ai/dsh-settings": ">=0.2.0-rc.1 <0.2.1-0",
|
|
109
|
+
"@deepseek-ai/dsh-system-prompt": ">=0.2.0-rc.1 <0.2.1-0",
|
|
110
|
+
"@deepseek-ai/dsh-token-meter": ">=0.2.0-rc.1 <0.2.1-0",
|
|
111
|
+
"@deepseek-ai/dsh-tools": ">=0.2.0-rc.1 <0.2.1-0",
|
|
112
|
+
"react": ">=18 <19"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { readFileSync } from 'node:fs'
|
|
2
|
-
import { resolve } from 'node:path'
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import * as jsxRuntime from 'react/jsx-runtime'
|
|
5
|
-
import { describe, expect, it } from 'vitest'
|
|
6
|
-
|
|
7
|
-
const artifact = resolve(import.meta.dirname, '../../lib/client.js')
|
|
8
|
-
|
|
9
|
-
describe('built Harness client artifact', () => {
|
|
10
|
-
it('registers a self-contained lazy-CJS factory and injects its CSS', () => {
|
|
11
|
-
const code = readFileSync(artifact, 'utf8')
|
|
12
|
-
let registration: { id: string, factory: (require: (id: string) => unknown) => unknown } | undefined
|
|
13
|
-
const moduleLoader = {
|
|
14
|
-
load(value: typeof registration) {
|
|
15
|
-
registration = value
|
|
16
|
-
},
|
|
17
|
-
}
|
|
18
|
-
Object.defineProperty(window, '__ModuleLoader__', { configurable: true, value: moduleLoader })
|
|
19
|
-
|
|
20
|
-
expect(() => Function(code)()).not.toThrow()
|
|
21
|
-
expect(registration?.id).toBe('dsh-context-compression-improved')
|
|
22
|
-
|
|
23
|
-
const modules = new Map<string, unknown>([
|
|
24
|
-
['react', React],
|
|
25
|
-
['react/jsx-runtime', jsxRuntime],
|
|
26
|
-
// The current selector only keeps this official package as a side-effect
|
|
27
|
-
// external. A minimal public-module stub proves the artifact asks the
|
|
28
|
-
// Harness loader for it without importing the package's raw CSS in Node.
|
|
29
|
-
['@deepseek-ai/dsh-client-ui-primitives', {}],
|
|
30
|
-
])
|
|
31
|
-
const exported = registration?.factory((id) => {
|
|
32
|
-
if (!modules.has(id)) throw new Error(`unexpected client dependency: ${id}`)
|
|
33
|
-
return modules.get(id)
|
|
34
|
-
}) as { apply?: unknown, inject?: unknown }
|
|
35
|
-
|
|
36
|
-
expect(exported.apply).toBeTypeOf('function')
|
|
37
|
-
// Declare every consumed service: cordis holds apply until each one is
|
|
38
|
-
// provided, which is the official client-plugin pattern on this 0.1.5 host
|
|
39
|
-
// line (dsh-thinking-levels does the same). The earlier lazy alternative —
|
|
40
|
-
// resolving `locale` / `
|
|
41
|
-
// raced the settings client's activation; on a loss the apply
|
|
42
|
-
// early-returned and EVERY settings entry (the standalone section, the
|
|
43
|
-
// plugins-tab card, the item card) silently vanished. See the rationale
|
|
44
|
-
// recorded in src/client/index.ts.
|
|
45
|
-
expect(exported.inject).toEqual(['slots', 'locale', '
|
|
46
|
-
const style = document.querySelector<HTMLStyleElement>(
|
|
47
|
-
'style[data-plugin-css="dsh-context-compression-improved/CompressionProfileSelector.module.css"]',
|
|
48
|
-
)
|
|
49
|
-
expect(style?.dataset.plugin).toBe('dsh-context-compression-improved')
|
|
50
|
-
expect(style?.textContent).toContain('profileGrid')
|
|
51
|
-
expect(document.querySelectorAll('style[data-plugin-css]').length).toBe(1)
|
|
52
|
-
|
|
53
|
-
registration?.factory((id) => modules.get(id))
|
|
54
|
-
expect(document.querySelectorAll('style[data-plugin-css]').length).toBe(1)
|
|
55
|
-
expect(code).not.toMatch(/^\s*(?:import|export)\s/mu)
|
|
56
|
-
expect(code).not.toMatch(/(?:\/home\/|[A-Za-z]:\\Users\\)/u)
|
|
57
|
-
expect(code).not.toContain('sourceMappingURL')
|
|
58
|
-
})
|
|
59
|
-
})
|
|
1
|
+
import { readFileSync } from 'node:fs'
|
|
2
|
+
import { resolve } from 'node:path'
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import * as jsxRuntime from 'react/jsx-runtime'
|
|
5
|
+
import { describe, expect, it } from 'vitest'
|
|
6
|
+
|
|
7
|
+
const artifact = resolve(import.meta.dirname, '../../lib/client.js')
|
|
8
|
+
|
|
9
|
+
describe('built Harness client artifact', () => {
|
|
10
|
+
it('registers a self-contained lazy-CJS factory and injects its CSS', () => {
|
|
11
|
+
const code = readFileSync(artifact, 'utf8')
|
|
12
|
+
let registration: { id: string, factory: (require: (id: string) => unknown) => unknown } | undefined
|
|
13
|
+
const moduleLoader = {
|
|
14
|
+
load(value: typeof registration) {
|
|
15
|
+
registration = value
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
Object.defineProperty(window, '__ModuleLoader__', { configurable: true, value: moduleLoader })
|
|
19
|
+
|
|
20
|
+
expect(() => Function(code)()).not.toThrow()
|
|
21
|
+
expect(registration?.id).toBe('dsh-context-compression-improved')
|
|
22
|
+
|
|
23
|
+
const modules = new Map<string, unknown>([
|
|
24
|
+
['react', React],
|
|
25
|
+
['react/jsx-runtime', jsxRuntime],
|
|
26
|
+
// The current selector only keeps this official package as a side-effect
|
|
27
|
+
// external. A minimal public-module stub proves the artifact asks the
|
|
28
|
+
// Harness loader for it without importing the package's raw CSS in Node.
|
|
29
|
+
['@deepseek-ai/dsh-client-ui-primitives', {}],
|
|
30
|
+
])
|
|
31
|
+
const exported = registration?.factory((id) => {
|
|
32
|
+
if (!modules.has(id)) throw new Error(`unexpected client dependency: ${id}`)
|
|
33
|
+
return modules.get(id)
|
|
34
|
+
}) as { apply?: unknown, inject?: unknown }
|
|
35
|
+
|
|
36
|
+
expect(exported.apply).toBeTypeOf('function')
|
|
37
|
+
// Declare every consumed service: cordis holds apply until each one is
|
|
38
|
+
// provided, which is the official client-plugin pattern on this 0.1.5 host
|
|
39
|
+
// line (dsh-thinking-levels does the same). The earlier lazy alternative —
|
|
40
|
+
// resolving `locale` / `configForms` through ctx.get() inside apply —
|
|
41
|
+
// raced the settings client's activation; on a loss the apply
|
|
42
|
+
// early-returned and EVERY settings entry (the standalone section, the
|
|
43
|
+
// plugins-tab card, the item card) silently vanished. See the rationale
|
|
44
|
+
// recorded in src/client/index.ts.
|
|
45
|
+
expect(exported.inject).toEqual(['slots', 'locale', 'configForms'])
|
|
46
|
+
const style = document.querySelector<HTMLStyleElement>(
|
|
47
|
+
'style[data-plugin-css="dsh-context-compression-improved/CompressionProfileSelector.module.css"]',
|
|
48
|
+
)
|
|
49
|
+
expect(style?.dataset.plugin).toBe('dsh-context-compression-improved')
|
|
50
|
+
expect(style?.textContent).toContain('profileGrid')
|
|
51
|
+
expect(document.querySelectorAll('style[data-plugin-css]').length).toBe(1)
|
|
52
|
+
|
|
53
|
+
registration?.factory((id) => modules.get(id))
|
|
54
|
+
expect(document.querySelectorAll('style[data-plugin-css]').length).toBe(1)
|
|
55
|
+
expect(code).not.toMatch(/^\s*(?:import|export)\s/mu)
|
|
56
|
+
expect(code).not.toMatch(/(?:\/home\/|[A-Za-z]:\\Users\\)/u)
|
|
57
|
+
expect(code).not.toContain('sourceMappingURL')
|
|
58
|
+
})
|
|
59
|
+
})
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Legacy test-host settings seam.
|
|
3
|
-
*
|
|
4
|
-
* Vendored verbatim from `@deepseek-ai/dsh-settings@0.1.5-rc.2`
|
|
5
|
-
* (`lib/types/index.js` + `lib/types/redact.js`, with the
|
|
6
|
-
* `@deepseek-ai/dsh-util-values@0.1.5-rc.2` helpers inlined as
|
|
7
|
-
* `./legacy/util-values.js`): the 0.1.7 host replaced the
|
|
8
|
-
* namespace-registry provider with declarative `SettingsForms`, while the
|
|
9
|
-
* plugin keeps the legacy `ctx.settings.get(ns)` read as a host-shape
|
|
10
|
-
* fallback (see src/index.ts). The host specs mount a provider subclassing
|
|
11
|
-
* this base to exercise exactly that fallback against the real 0.1.7
|
|
12
|
-
* baseline. Type declarations: `./legacy/provider.d.ts`.
|
|
13
|
-
*/
|
|
14
|
-
export { SettingsProvider as LegacySettingsProvider } from './legacy/provider.js'
|
|
15
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Legacy test-host settings seam.
|
|
3
|
+
*
|
|
4
|
+
* Vendored verbatim from `@deepseek-ai/dsh-settings@0.1.5-rc.2`
|
|
5
|
+
* (`lib/types/index.js` + `lib/types/redact.js`, with the
|
|
6
|
+
* `@deepseek-ai/dsh-util-values@0.1.5-rc.2` helpers inlined as
|
|
7
|
+
* `./legacy/util-values.js`): the 0.1.7 host replaced the
|
|
8
|
+
* namespace-registry provider with declarative `SettingsForms`, while the
|
|
9
|
+
* plugin keeps the legacy `ctx.settings.get(ns)` read as a host-shape
|
|
10
|
+
* fallback (see src/index.ts). The host specs mount a provider subclassing
|
|
11
|
+
* this base to exercise exactly that fallback against the real 0.1.7
|
|
12
|
+
* baseline. Type declarations: `./legacy/provider.d.ts`.
|
|
13
|
+
*/
|
|
14
|
+
export { SettingsProvider as LegacySettingsProvider } from './legacy/provider.js'
|
|
15
|
+
|
|
@@ -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
|
+
}
|