dsh-session-guard 4.2.8 → 4.2.10
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.de.md +280 -0
- package/CHANGELOG.es.md +280 -0
- package/CHANGELOG.fr.md +280 -0
- package/CHANGELOG.it.md +280 -0
- package/CHANGELOG.md +5 -1
- package/CHANGELOG.ru.md +280 -0
- package/INSTALL.de.md +117 -0
- package/INSTALL.es.md +117 -0
- package/INSTALL.fr.md +117 -0
- package/INSTALL.it.md +117 -0
- package/INSTALL.ru.md +117 -0
- package/README.de.md +1 -1
- package/README.es.md +1 -1
- package/README.fr.md +1 -1
- package/README.it.md +1 -1
- package/README.md +13 -2
- package/README.ru.md +1 -1
- package/dsh.plugin.json +16 -16
- package/lib/client.js +347 -0
- package/lib/client.js.map +1 -1
- package/locale/de.json +6 -0
- package/locale/en.json +6 -0
- package/locale/es.json +6 -0
- package/locale/fr.json +6 -0
- package/locale/it.json +6 -0
- package/locale/ja.json +6 -0
- package/locale/ko.json +6 -0
- package/locale/ru.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +126 -109
- package/src/client/index.ts +22 -0
- package/src/client/locales.ts +361 -163
- package/src/index.js +101 -5
- package/src/step-gate.js +12 -0
package/package.json
CHANGED
|
@@ -1,109 +1,126 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-session-guard",
|
|
3
|
-
"version": "4.2.
|
|
4
|
-
"publishConfig": {
|
|
5
|
-
"registry": "https://registry.npmjs.org",
|
|
6
|
-
"tag": "latest"
|
|
7
|
-
},
|
|
8
|
-
"type": "module",
|
|
9
|
-
"description": "高峰自动会话门:周末模式 + 高峰自动暂停 + 官方源二维判定 + 会话级冻结 + 后端自动重试。",
|
|
10
|
-
"keywords": [
|
|
11
|
-
"deepseek-harness",
|
|
12
|
-
"dsh",
|
|
13
|
-
"plugin",
|
|
14
|
-
"peak",
|
|
15
|
-
"off-peak",
|
|
16
|
-
"weekend",
|
|
17
|
-
"pause",
|
|
18
|
-
"freeze",
|
|
19
|
-
"retry",
|
|
20
|
-
"session-gate"
|
|
21
|
-
],
|
|
22
|
-
"license": "MIT",
|
|
23
|
-
"repository": {
|
|
24
|
-
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/drscrewdriver/dsh-session-guard.git"
|
|
26
|
-
},
|
|
27
|
-
"homepage": "https://github.com/drscrewdriver/dsh-session-guard",
|
|
28
|
-
"main": "src/index.js",
|
|
29
|
-
"exports": {
|
|
30
|
-
".": "./src/index.js",
|
|
31
|
-
"./client": "./lib/client.js",
|
|
32
|
-
"./
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"README.
|
|
41
|
-
"README.
|
|
42
|
-
"README.
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"@deepseek-ai/dsh-client-ui-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
"
|
|
101
|
-
"@
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-session-guard",
|
|
3
|
+
"version": "4.2.10",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"registry": "https://registry.npmjs.org",
|
|
6
|
+
"tag": "latest"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"description": "高峰自动会话门:周末模式 + 高峰自动暂停 + 官方源二维判定 + 会话级冻结 + 后端自动重试。",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"deepseek-harness",
|
|
12
|
+
"dsh",
|
|
13
|
+
"plugin",
|
|
14
|
+
"peak",
|
|
15
|
+
"off-peak",
|
|
16
|
+
"weekend",
|
|
17
|
+
"pause",
|
|
18
|
+
"freeze",
|
|
19
|
+
"retry",
|
|
20
|
+
"session-gate"
|
|
21
|
+
],
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/drscrewdriver/dsh-session-guard.git"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/drscrewdriver/dsh-session-guard",
|
|
28
|
+
"main": "src/index.js",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": "./src/index.js",
|
|
31
|
+
"./client": "./lib/client.js",
|
|
32
|
+
"./locale/*.json": "./locale/*.json",
|
|
33
|
+
"./package.json": "./package.json"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"src/",
|
|
37
|
+
"lib/",
|
|
38
|
+
"cordis.patch.yml",
|
|
39
|
+
"dsh.plugin.json",
|
|
40
|
+
"README.md",
|
|
41
|
+
"README.en.md",
|
|
42
|
+
"README.ja.md",
|
|
43
|
+
"README.ko.md",
|
|
44
|
+
"README.fr.md",
|
|
45
|
+
"README.de.md",
|
|
46
|
+
"README.it.md",
|
|
47
|
+
"README.ru.md",
|
|
48
|
+
"README.es.md",
|
|
49
|
+
"INSTALL.md",
|
|
50
|
+
"INSTALL.zh.md",
|
|
51
|
+
"INSTALL.ja.md",
|
|
52
|
+
"INSTALL.ko.md",
|
|
53
|
+
"INSTALL.fr.md",
|
|
54
|
+
"INSTALL.de.md",
|
|
55
|
+
"INSTALL.it.md",
|
|
56
|
+
"INSTALL.ru.md",
|
|
57
|
+
"INSTALL.es.md",
|
|
58
|
+
"CHANGELOG.md",
|
|
59
|
+
"CHANGELOG.ja.md",
|
|
60
|
+
"CHANGELOG.ko.md",
|
|
61
|
+
"CHANGELOG.fr.md",
|
|
62
|
+
"CHANGELOG.de.md",
|
|
63
|
+
"CHANGELOG.it.md",
|
|
64
|
+
"CHANGELOG.ru.md",
|
|
65
|
+
"CHANGELOG.es.md",
|
|
66
|
+
"locale",
|
|
67
|
+
"LICENSE"
|
|
68
|
+
],
|
|
69
|
+
"dsh": {
|
|
70
|
+
"client": {
|
|
71
|
+
"inject": [
|
|
72
|
+
"@deepseek-ai/dsh-client-locale"
|
|
73
|
+
],
|
|
74
|
+
"platform": "web"
|
|
75
|
+
},
|
|
76
|
+
"bundle": {
|
|
77
|
+
"patch": "./cordis.patch.yml"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"build": "tsdown",
|
|
82
|
+
"prepack": "npm run build",
|
|
83
|
+
"lint": "eslint src tests",
|
|
84
|
+
"test": "node --test \"tests/*.test.mjs\""
|
|
85
|
+
},
|
|
86
|
+
"engines": {
|
|
87
|
+
"node": ">=20",
|
|
88
|
+
"dsh": ">=0.1.0-rc.2 <0.3.0-0"
|
|
89
|
+
},
|
|
90
|
+
"dependencies": {
|
|
91
|
+
"@deepseek-ai/schemastery": "^3.18.4"
|
|
92
|
+
},
|
|
93
|
+
"peerDependencies": {
|
|
94
|
+
"@deepseek-ai/cordis": "^4.0.4",
|
|
95
|
+
"@deepseek-ai/dsh-client-locale": ">=0.1.0-rc.2 <0.3.0-0",
|
|
96
|
+
"@deepseek-ai/dsh-client-ui-renderer": ">=0.1.0-rc.2 <0.3.0-0",
|
|
97
|
+
"@deepseek-ai/dsh-client-ui-settings": ">=0.1.0-rc.2 <0.3.0-0",
|
|
98
|
+
"@deepseek-ai/dsh-client-ui-slots": ">=0.1.0-rc.2 <0.3.0-0"
|
|
99
|
+
},
|
|
100
|
+
"peerDependenciesMeta": {
|
|
101
|
+
"@deepseek-ai/cordis": {
|
|
102
|
+
"optional": true
|
|
103
|
+
},
|
|
104
|
+
"@deepseek-ai/dsh-client-locale": {
|
|
105
|
+
"optional": true
|
|
106
|
+
},
|
|
107
|
+
"@deepseek-ai/dsh-client-ui-renderer": {
|
|
108
|
+
"optional": true
|
|
109
|
+
},
|
|
110
|
+
"@deepseek-ai/dsh-client-ui-settings": {
|
|
111
|
+
"optional": true
|
|
112
|
+
},
|
|
113
|
+
"@deepseek-ai/dsh-client-ui-slots": {
|
|
114
|
+
"optional": true
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"devDependencies": {
|
|
118
|
+
"@eslint/js": "^10.0.1",
|
|
119
|
+
"@types/react": "~18.3.1",
|
|
120
|
+
"eslint": "^10.8.1",
|
|
121
|
+
"react": "^18.2.0",
|
|
122
|
+
"tsdown": "^0.22.2",
|
|
123
|
+
"typescript": "^5.6.0",
|
|
124
|
+
"typescript-eslint": "^8.67.0"
|
|
125
|
+
}
|
|
126
|
+
}
|
package/src/client/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { BridgeDocHandle } from './settings-bridge.ts'
|
|
|
23
23
|
import { GuardFamilySection, type FamilyTabEntry } from './family-section'
|
|
24
24
|
import type { SessionGuardConfig } from './settings-card'
|
|
25
25
|
import type { SettingsScope } from './scope-face'
|
|
26
|
+
import { NS, dictionaries } from './locales'
|
|
26
27
|
|
|
27
28
|
// 起子插件族共用设置节:宿主 dsh-thinking-levels 注册顶级 `settings.section`
|
|
28
29
|
// (id `dsh-family`)并声明 `dsh-family.tab` 子席位,本插件贡献卡片。宿主缺席
|
|
@@ -92,6 +93,14 @@ interface ClientCtx {
|
|
|
92
93
|
_names: string[],
|
|
93
94
|
_fn: (sctx: { configForms?: ConfigFormsFactoryFace; settingsScope?: SettingsScopeFactoryFace }) => void,
|
|
94
95
|
) => void
|
|
96
|
+
/** locale 服务(宿主 0.1.x 起提供;缺席时字典不注册,UI 回退到宿主默认文案)。 */
|
|
97
|
+
locale?: LocaleFace
|
|
98
|
+
effect?: (_fn: () => (() => void) | void, _label: string) => void
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** 宿主 locale 服务面:一次 register 激活全部语言。 */
|
|
102
|
+
interface LocaleFace {
|
|
103
|
+
register(_ns: string, _dicts: Record<string, Record<string, string>>): () => void
|
|
95
104
|
}
|
|
96
105
|
|
|
97
106
|
/** 单面注册护栏:某条宿主线上未知槽名/缺服务的同步异常不得带走其它面。 */
|
|
@@ -164,6 +173,19 @@ function mountConfigCards(ctx: ClientCtx): void {
|
|
|
164
173
|
}
|
|
165
174
|
|
|
166
175
|
export function apply(ctx: ClientCtx) {
|
|
176
|
+
// 注册全部 9 种语言字典(zh/en/ja/ko/fr/de/it/ru/es)。
|
|
177
|
+
// 本插件此前 locales.ts 未被任何模块 import → 字典从未进入 bundle、从未注册(死代码)。
|
|
178
|
+
// guarded:register 抛错不得带走下面的席位注册;effect 缺席时直接调一次(同语义)。
|
|
179
|
+
safe('locale/dictionaries', () => {
|
|
180
|
+
const locale = ctx.locale
|
|
181
|
+
if (!locale) return
|
|
182
|
+
if (typeof ctx.effect === 'function') {
|
|
183
|
+
ctx.effect(() => locale.register(NS, dictionaries), 'dsh-session-guard: dictionaries')
|
|
184
|
+
} else {
|
|
185
|
+
locale.register(NS, dictionaries)
|
|
186
|
+
}
|
|
187
|
+
})
|
|
188
|
+
|
|
167
189
|
// 暂停会话按钮(v0.2.0):step 级门控的状态显示 + 手动解除。
|
|
168
190
|
// order 20 < input-traffic 冻结按钮的 30 → 排在左侧,两者并列互不取代(ADR-001/002)。
|
|
169
191
|
safe('conversation.input.right/pause', () => ctx.slots.inject('conversation.input.right', () => ctx.slots.register({
|