@ragnoryok1/dsh-client-locale-ru 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ragnoryok1
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # @ragnoryok1/dsh-client-locale-ru
2
+
3
+ Русская локаль (`ru`) для веб-интерфейса [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`).
4
+
5
+ Плагин добавляет **русский** как выбираемый язык через контракт языковых пакетов локали: `ctx.locale.addLanguage({ id: 'ru', label: 'Русский', fallback: 'en' })` и по `ru`-словарю на каждый namespace. После выбора **Русский** в Settings → General интерфейс переключается сразу.
6
+
7
+ ## Установка
8
+
9
+ Это **гибридный плагин** (`dsh.bundle` + `dsh.client`), поэтому он ставится как обычный профиль-бандл через `dsh plugin`:
10
+
11
+ ```sh
12
+ dsh plugin --profile web add @ragnoryok1/dsh-client-locale-ru
13
+ ```
14
+
15
+ Дальше при следующем старте `dsh web` в настройках появится **Русский**. Отдельно `pnpm add` в собранный `dsh web` не нужен — плагин тянет штатную локаль через сервис `locale`.
16
+
17
+ ## Почему гибрид
18
+
19
+ `dsh web` берёт клиентские (UI) плагины только из **workspace-пакетов**, а внешний npm-пакет с одним `dsh.client` не подхватывается. Чтобы внешний плагин с UI-частью был устанавливаемым, он должен объявлять **`dsh.bundle`** (профиль-слой), чей `cordis.patch.yml` через `- insert:` добавляет клиентскую строку `locale-ru` в браузерный ростер. Так устроены и другие сторонние плагины (например `@zseven-w/dsh-android`).
20
+
21
+ ## Как это работает
22
+
23
+ - **Хост-половина** (`lib/index.js`) — пустой `apply()`: языковому плагину не нужна серверная логика, она лишь даёт корректную cordis-строку для Loader.
24
+ - **Браузерная половина** (`lib/client.js`) — регистрирует `ru` и словари через сервис `locale` (инжект из `ctx`). Рантайм-импортов фреймворка нет — только сервис.
25
+ - **Рантайм-зависимостей нет** — `lib/client.js` не импортирует другие пакеты, поэтому не тянет тяжёлых зависимостей.
26
+ - **Эффекты** — язык и словари регистрируются через `ctx.effect(...)`, поэтому выгружаются вместе с плагином (HMR-безопасно).
27
+ - **Плюралы** — контракт локали не несёт правил плюрализации (нет ICU/`Intl.PluralRules`); русские формы задаются по ключу.
28
+ - **Фолбэк** — отсутствующий русский ключ падает на `en` (настроенный `fallback`).
29
+
30
+ ## Разработка
31
+
32
+ ```sh
33
+ pnpm install
34
+ pnpm run build # tsdown -> lib/index.js (node half) + lib/client.js (client bundle)
35
+ npm pack # -> ragnoryok1-dsh-client-locale-ru-<version>.tgz
36
+ ```
37
+
38
+ `lib/client.js` собирается в формате, который понимает клиентский загрузчик `dsh` (`__ModuleLoader__.load`), и экспортирует `inject`/`apply`.
39
+
40
+ ## Содержимое
41
+
42
+ - `src/client/dicts.ts` — русские словари (~34 namespace, ~1200 строк). Это и есть основная ценность.
43
+ - `src/client/index.ts` — точка входа клиентского плагина (регистрация `ru` + словарей).
44
+ - `src/index.ts` — пустая host-половина (`apply()`).
45
+ - `cordis.patch.yml` — профиль-патч (`- insert:` клиентской строки `locale-ru`).
46
+
47
+ ## Лицензия
48
+
49
+ MIT
@@ -0,0 +1,8 @@
1
+ # @ragnoryok1/dsh-client-locale-ru profile-bundle patch.
2
+ # Adds the Russian (ru) language pack as a dynamic client-plugin row. Composed
3
+ # at profile boot; the dsh-client-modules host serves lib/client.js via the
4
+ # combo /plugins/??<id>/client.js route. The row name resolves to this package,
5
+ # which declares dsh.client (platform web) and exports ./client.
6
+ - insert:
7
+ - id: locale-ru
8
+ name: '@ragnoryok1/dsh-client-locale-ru'
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Russian (ru) language pack, browser half. The plugin joins the client tree
3
+ * and registers `ru` as a selectable language plus a dictionary per namespace.
4
+ */
5
+ export declare const inject: readonly string[]
6
+ export declare function apply(ctx: unknown): void