@goodandready/dsh-russian-lang 0.1.15 → 0.1.17
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/lib/client.js +858 -22
- package/lib/index.js +21 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -15,11 +15,31 @@ const RussianLangSettingsSchema = z.object({
|
|
|
15
15
|
typography: z.object({
|
|
16
16
|
enabled: z.boolean().required(false),
|
|
17
17
|
yo: z.boolean().required(false)
|
|
18
|
-
}).required(false)
|
|
18
|
+
}).required(false),
|
|
19
|
+
agentPrompt: z.boolean().required(false)
|
|
19
20
|
})
|
|
20
21
|
|
|
21
22
|
export function apply(ctx) {
|
|
22
23
|
ctx.inject(['settings'], (settingsCtx) => {
|
|
23
24
|
settingsCtx.settings.register(settingsNamespace('russian-lang'), RussianLangSettingsSchema)
|
|
24
25
|
})
|
|
26
|
+
|
|
27
|
+
// #68: русский системный промпт агента (опционально). Регистрируем секцию
|
|
28
|
+
// промпта, которая просит отвечать по-русски, когда включён флаг
|
|
29
|
+
// russian-lang.agentPrompt. Секция — официальная точка расширения ядра.
|
|
30
|
+
ctx.inject(['settings', 'systemPrompt'], (settingsCtx, prompt) => {
|
|
31
|
+
const NS = settingsNamespace('russian-lang')
|
|
32
|
+
const RU_SECTION = 'dsh-russian-lang-agent-prompt'
|
|
33
|
+
const RU_TEXT = 'Отвечай пользователю на русском языке. Если пользователь пишет на другом языке, отвечай на его языке.'
|
|
34
|
+
let current = false
|
|
35
|
+
const sync = () => {
|
|
36
|
+
const value = settingsCtx.settings.get(NS)
|
|
37
|
+
const want = !!(value && value.agentPrompt)
|
|
38
|
+
if (want === current) return
|
|
39
|
+
current = want
|
|
40
|
+
prompt.section({ name: RU_SECTION, order: 1000, text: want ? RU_TEXT : '' })
|
|
41
|
+
}
|
|
42
|
+
ctx.on('settings/updated', (ns) => { if (ns === NS) sync() })
|
|
43
|
+
sync()
|
|
44
|
+
})
|
|
25
45
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-russian-lang",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"description": "Russian localization for the DeepSeek Harness web UI: adds Русский as the third option in the native Settings - General - Language menu. Translates the full core surface (100% coverage of DSH 0.1.1-rc.2) plus 16 community plugin namespaces - 52 namespaces, 2795 strings (many machine-drafted, queued for manual review), with Russian plural forms, count-key plurals, a typography pass (guillemets, em dash, nbsp), a wrong-layout input hint and browser spellcheck. The locale runtime snapshot is extended at runtime on unpatched cores; no files in the DSH installation are modified. The choice is persisted through the plugin-owned russian-lang namespace.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|