tensorgrid-ui 1.6.1 → 2.0.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/lib/reviewers.js CHANGED
@@ -44,9 +44,56 @@ const STDERR_CAP = 64 * 1024
44
44
  * список устарел бы при первом же выпуске нового имени модели.
45
45
  */
46
46
  export const REVIEWERS = {
47
+ // ── Наши ревизоры ────────────────────────────────────────────────────
48
+ //
49
+ // Работают не отдельными продуктами, а нашими подагентами на нашем же
50
+ // маршруте моделей. Их ДВА, и это не прихоть: два разных СЕМЕЙСТВА
51
+ // моделей и есть то разнообразие, ради которого раньше звали чужое.
52
+ //
53
+ // Чистый опыт показал, что обвязка почти ничего не решает: одна модель в
54
+ // Claude Code и у нас дала совпадение 13 находок из 14. Разное находят
55
+ // разные МОДЕЛИ, а не разные обвязки. А обе подписки — Anthropic и
56
+ // OpenAI — доступны прямо здесь, со своими списками моделей и без
57
+ // поштучной оплаты.
58
+ //
59
+ // Список моделей пуст намеренно: он приходит живым из маршрута. Внешние
60
+ // продукты понимают только свои имена, а здесь доступно всё подключённое,
61
+ // включая сотни моделей через OpenRouter.
62
+ internal: {
63
+ label: 'Наш ревизор',
64
+ kind: 'internal',
65
+ models: [],
66
+ efforts: ['low', 'medium', 'high', 'max'],
67
+ defaultProvider: 'anthropic',
68
+ defaultModel: 'claude-opus-5',
69
+ },
70
+ 'internal-alt': {
71
+ label: 'Наш ревизор, вторая модель',
72
+ kind: 'internal',
73
+ models: [],
74
+ efforts: ['low', 'medium', 'high', 'max'],
75
+ // Намеренно ДРУГОЕ семейство: два прогона одной модели дадут почти
76
+ // одинаковые находки, и второй ревизор не окупит своего времени.
77
+ defaultProvider: 'openai-codex',
78
+ defaultModel: 'gpt-6-astra',
79
+ },
80
+
81
+ // ── Внешние продукты ─────────────────────────────────────────────────
82
+ //
83
+ // Оставлены, но НЕ требуются: в умолчания не входят, в установку не
84
+ // включены, и без них всё работает.
85
+ //
86
+ // Причина не в том, что они плохи, а в том, что не добавляют. По деньгам
87
+ // — подписка работает и у нас. По находкам — совпадение 13 из 14. А
88
+ // стоят они двух лишних установок сотруднику и почти всех дефектов,
89
+ // которые пришлось чинить: аргументы, поток ввода, забор ответа,
90
+ // обёртки Windows, ключи авторизации, отмена, тайм-аут.
91
+ //
92
+ // Кому они уже установлены — пусть включает и пользуется.
47
93
  'claude-code': {
48
94
  label: 'Claude Code',
49
95
  kind: 'external',
96
+ optional: true,
50
97
  command: 'claude',
51
98
  // Список — подсказка, а НЕ ограничение: интерфейс даёт ввести и своё имя.
52
99
  // Жёсткий перечень устарел бы при первом же выпуске новой модели, а
@@ -59,27 +106,12 @@ export const REVIEWERS = {
59
106
  codex: {
60
107
  label: 'Codex',
61
108
  kind: 'external',
109
+ optional: true,
62
110
  command: 'codex',
63
111
  models: ['gpt-6-astra', 'gpt-5.6-sol'],
64
112
  efforts: ['low', 'medium', 'high', 'xhigh'],
65
113
  authEnv: ['OPENAI_API_KEY', 'CODEX_HOME'],
66
114
  },
67
- internal: {
68
- label: 'Наш ревизор',
69
- // Единственный, кто работает НЕ отдельным продуктом, а нашим подагентом
70
- // на нашем же маршруте моделей.
71
- //
72
- // Он появился из опыта: та же модель в другой обвязке нашла почти
73
- // непересекающийся набор находок. Значит третий угол зрения даёт не
74
- // только другая модель, но и другое окружение.
75
- //
76
- // И он единственный, чей список моделей берётся ЖИВЫМ из маршрута:
77
- // Claude Code и Codex понимают только свои имена, а здесь доступно всё,
78
- // что подключено — включая сотни моделей через OpenRouter.
79
- kind: 'internal',
80
- models: [],
81
- efforts: ['low', 'medium', 'high', 'max'],
82
- },
83
115
  }
84
116
 
85
117
  /**
@@ -108,6 +140,19 @@ export const KNOWN = Object.keys(REVIEWERS)
108
140
  const SAFE_VALUE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/
109
141
  const SAFE_ROUTE_VALUE = /^[A-Za-z0-9][A-Za-z0-9._\-/]{0,95}$/
110
142
 
143
+ /**
144
+ * Что разрешено НАШЕМУ ревизору.
145
+ *
146
+ * Список РАЗРЕШЕНИЙ, а не запретов, и это принципиально. Запрет пришлось бы
147
+ * дополнять при каждом новом инструменте харнесса: забыли один раз — и
148
+ * ревизор снова умеет писать. Разрешение ошибается в безопасную сторону:
149
+ * незнакомый инструмент по умолчанию недоступен.
150
+ *
151
+ * Те же три возможности, что у Claude Code: читать файл, искать по именам,
152
+ * искать по содержимому. Больше обзору не нужно ничего.
153
+ */
154
+ const REVIEW_TOOLS = { allow: ['Read', 'Glob', 'Grep'] }
155
+
111
156
  /**
112
157
  * Вернуть ревизору его собственные ключи авторизации.
113
158
  *
@@ -217,6 +262,18 @@ async function runInternal(ctx, kind, { prompt, provider, model, effort, signal
217
262
  prompt: [{ type: 'text', text: prompt }],
218
263
  parent: ctx.reviewParent,
219
264
  signal,
265
+ // ТОЛЬКО ЧТЕНИЕ — так же, как у внешних ревизоров.
266
+ //
267
+ // Без этого ревизор наследовал бы весь набор инструментов родителя,
268
+ // включая запись файлов и запуск команд. Ровно та дыра, которую оба
269
+ // внешних ревизора назвали критичной у Claude Code: я убрал её там и
270
+ // немедленно завёл здесь, просто не передав ограничения.
271
+ //
272
+ // Асимметрия недопустима: обзор, который «ничего не меняет», не должен
273
+ // иметь права изменить всё — тем более что ревизор по заданию читает
274
+ // чужой непроверенный код и указание внутри этого кода исполнилось бы
275
+ // без подтверждения.
276
+ toolFilter: REVIEW_TOOLS,
220
277
  ...(Object.keys(agentOptions).length > 0 ? { agentOptions } : {}),
221
278
  })
222
279
  const result = await run.result
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tensorgrid-ui",
3
- "version": "1.6.1",
3
+ "version": "2.0.0",
4
4
  "description": "TENSOR GRID — фирменный интерфейс поверх DeepSeek Harness: палитра, живой ambient-слой, айдентика и русский язык-пакет",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -16,8 +16,18 @@
16
16
  },
17
17
  "./package.json": "./package.json"
18
18
  },
19
+ "bin": {
20
+ "tensorgrid-ui": "lib/cli.mjs"
21
+ },
19
22
  "files": [
20
- "lib"
23
+ "lib",
24
+ "install.ps1",
25
+ "preset",
26
+ "profile",
27
+ "brand/tensorgrid.ico",
28
+ "tools/round-ico-corners.mjs",
29
+ "env/snapshot.json",
30
+ "LICENSE"
21
31
  ],
22
32
  "peerDependencies": {
23
33
  "@deepseek-ai/dsh-tools": "*"
@@ -0,0 +1,304 @@
1
+ # ─────────────────────────────────────────────────────────────────────────
2
+ # TENSOR GRID — агент-пресет компании.
3
+ #
4
+ # Копия поставочного `standard`, сделанная штатной службой agentPresets.
5
+ # Поставочные пресеты править нельзя: их затирает обновление dsh, и
6
+ # порча `cordis` отключила бы саму возможность авторства пресетов.
7
+ #
8
+ # Отличия от `standard`:
9
+ # · persona — брендирована и задаёт язык ответа;
10
+ # · строки делегирования в Codex и Claude Code снабжены инструкцией
11
+ # включения (сами по-прежнему отключены, см. раздел delegation).
12
+ #
13
+ # Всё остальное — дословно как в поставке, чтобы при обновлении dsh было
14
+ # легко сравнить diff-ом и перенести изменения.
15
+ #
16
+ # Файл: ~/.dsh/.agent-presets/tensorgrid/agent.cordis.yml
17
+ # ─────────────────────────────────────────────────────────────────────────
18
+
19
+ # The `standard` agent preset: the full coding agent, mounted once per process.
20
+ #
21
+ # This file is an AGENT-PLANE composition. The roster mounts it ONCE under a
22
+ # standing scope; every session naming it joins by scope parentage, so the
23
+ # tools and prompt sections registered here cover each joined agent while a
24
+ # session's own state stays keyed per Session/Agent inside the plugins. The
25
+ # host composition (`base.cordis.yml` + `web.cordis.yml`) keeps everything a
26
+ # preset must not own: the registries themselves, the sandbox and approval
27
+ # stack, persistence, and the model route.
28
+ #
29
+ # A service row here MUST sit inside a group carrying an `isolate` realm.
30
+ # Without one it publishes into the root realm, where it is process-global —
31
+ # another preset publishing the same name collides, and a host reader would
32
+ # resolve one preset's instance for every session; `dsh-agent-presets` rejects
33
+ # that at mount. `true` means an entry-local realm: this standing mount's own
34
+ # private instance, apart from every other preset's. (A shared label does NOT
35
+ # pool instances — `provide()` throws on the second registration under the
36
+ # same realm symbol; labels join REALMS, and are not what this file needs.)
37
+
38
+ # ── identity ────────────────────────────────────────────────────────────────
39
+
40
+ # The preset's own persona, shadowing the deployment default for this agent.
41
+ # `{{model}}` and `{{cwd}}` resolve from the agent's own route and workspace.
42
+ - id: persona
43
+ name: '@deepseek-ai/dsh-persona'
44
+ config:
45
+ suffix: Рабочий каталог — {{cwd}}.
46
+ prefix: |-
47
+ Ты TENSOR GRID — рабочий агент компании, работающий на модели {{model}}.
48
+
49
+ Отвечай на языке собеседника; по умолчанию русский.
50
+
51
+ Пиши по делу: без вступлений, без пересказа задания, без лишних
52
+ извинений. Если чего-то не знаешь или не проверил — скажи прямо,
53
+ вместо того чтобы строить догадки и выдавать их за факт.
54
+
55
+ - id: agent-instructions
56
+ name: '@deepseek-ai/dsh-agent-instructions'
57
+ config:
58
+ maxBytes: 65536
59
+
60
+ # ── shell ───────────────────────────────────────────────────────────────────
61
+
62
+ # `shell-env` stays in the HOST composition: `apps/cli/src/web.ts` injects it to
63
+ # publish `DSH_WEB_URL`/`DSH_WEB_MODE`, and a host row that injects a service is
64
+ # the criterion for host-plane ownership — injection resolves before any session
65
+ # exists, so there is no agent to key by. Behind a preset realm those variables
66
+ # never reached the model's shell at all. Both shell tools consume the host
67
+ # registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
68
+ # host-plane too.
69
+ - id: tool-bash
70
+ name: '@deepseek-ai/dsh-tool-bash'
71
+ disabled: !!js process.platform === 'win32'
72
+
73
+ - id: tool-pwsh
74
+ name: '@deepseek-ai/dsh-tool-pwsh'
75
+ disabled: !!js process.platform !== 'win32'
76
+
77
+ # ── filesystem ──────────────────────────────────────────────────────────────
78
+
79
+ # Both register into the host `tools` registry and provide nothing, so
80
+ # they need no realm. The `fs` service and its policy stay in the host.
81
+ - id: tool-fs
82
+ name: '@deepseek-ai/dsh-tool-fs'
83
+
84
+ - id: tool-fs-search
85
+ name: '@deepseek-ai/dsh-tool-fs-search'
86
+ config:
87
+ sampleOverCapGlobResults: false
88
+
89
+ # ── background jobs ────────────────────────────────────────────────────────
90
+
91
+ # Only the model-facing controls. The task REGISTRY stays on the host plane:
92
+ # its producers sit outside any realm this file could put it in — `tool-bash`
93
+ # above resolves it with `ctx.get`, and an entry-local realm here is invisible
94
+ # to every sibling row, so `run_in_background` would answer "background jobs
95
+ # unavailable" while these controls sat in the catalog. The registry is keyed by
96
+ # owning agent anyway, so one host instance serves every session. What a preset
97
+ # chooses is whether its agent can collect and stop background work at all.
98
+ - id: tool-jobs
99
+ name: '@deepseek-ai/dsh-tool-jobs'
100
+
101
+ # ── skills ──────────────────────────────────────────────────────────────────
102
+
103
+ # The skill REGISTRY lives in the host composition and is layered per scope:
104
+ # these rows register into THIS preset's layer of it, so they need no realm.
105
+ # `skill-filesystem` contributes local-root discovery for agents on this preset, and
106
+ # `tool-skill` gives them the catalog and loader; the merged catalog also
107
+ # carries whatever the deployment registered globally (repository plugins).
108
+ - id: skill-filesystem
109
+ name: '@deepseek-ai/dsh-skill-filesystem'
110
+
111
+ - id: tool-skill
112
+ name: '@deepseek-ai/dsh-tool-skill'
113
+
114
+ # ── goals ───────────────────────────────────────────────────────────────────
115
+
116
+ # The goal service and session driver stay on the host plane, where the Gateway
117
+ # can resolve them. The human command and model-facing tool register into this
118
+ # preset's scoped layers.
119
+ - id: command-goal
120
+ name: '@deepseek-ai/dsh-command-goal'
121
+
122
+ - id: tool-goal
123
+ name: '@deepseek-ai/dsh-tool-goal'
124
+
125
+ # ── plan mode ───────────────────────────────────────────────────────────────
126
+
127
+ # Plan state is per-agent by nature, so an entry-local realm is not a
128
+ # workaround here — it is the correct lifetime.
129
+ - id: planning
130
+ name: cordis:group
131
+ group: true
132
+ isolate:
133
+ planMode: true
134
+ config:
135
+ - id: plan-mode
136
+ name: '@deepseek-ai/dsh-plan-mode'
137
+ config:
138
+ section: |
139
+ You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
140
+
141
+ Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
142
+
143
+ The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
144
+
145
+ Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
146
+
147
+ Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
148
+
149
+ When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
150
+
151
+ # ── compaction ──────────────────────────────────────────────────────────────
152
+
153
+ # `compaction-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
154
+ # share this realm rather than sit outside it.
155
+ #
156
+ # `tokenMeter` is deliberately NOT in this realm: the meter stays on the HOST
157
+ # plane, and the rows here resolve that one instance. It takes no configuration,
158
+ # keys every fold by Session, and owns the context-meter projection units the
159
+ # browser reads for every session — behind a realm those units would come and go
160
+ # with whichever presets happen to be mounted. What a preset chooses is whether
161
+ # its agent compacts at all, which is `compaction-basic` below.
162
+ - id: compaction
163
+ name: cordis:group
164
+ group: true
165
+ isolate:
166
+ compaction: true
167
+ toolResultPruner: true
168
+ config:
169
+ - id: compaction-basic
170
+ name: '@deepseek-ai/dsh-compaction-basic'
171
+
172
+ - id: command-compact
173
+ name: '@deepseek-ai/dsh-command-compact'
174
+
175
+ - id: tool-result-pruner
176
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
177
+ config:
178
+ thresholdChars: 8192
179
+ headChars: 4096
180
+ tailChars: 1024
181
+
182
+ # ── delegation and workflows ────────────────────────────────────────────────
183
+
184
+ # The `subagents` registry and its spawn/fork backends live in the HOST
185
+ # composition: the registry is a process singleton whose cross-session queries
186
+ # the api-proxy serves to the browser, and a provider name may only be
187
+ # registered once. This preset contributes the delegation TOOLS, which resolve
188
+ # that host registry.
189
+ #
190
+ # `workflows` is different — nothing outside an agent reads it — so every row
191
+ # that reaches it shares one entry-local realm here, and a consumer left
192
+ # outside would resolve a host registry this preset does not populate.
193
+ - id: delegation
194
+ name: cordis:group
195
+ group: true
196
+ isolate:
197
+ workflowEngine: true
198
+ config:
199
+ - id: tool-subagent-control
200
+ name: '@deepseek-ai/dsh-tool-subagent-control'
201
+
202
+ - id: tool-subagent-list-agents
203
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
204
+
205
+ - id: tool-subagent
206
+ name: '@deepseek-ai/dsh-tool-subagent'
207
+ config:
208
+ provider: spawn
209
+ toolName: subagent
210
+ modelSelectionSettings: true
211
+ backgroundMode: continuable
212
+
213
+ # Fork omits model selection so provider/model stay equal to the parent and
214
+ # the inherited history remains eligible for KV Cache reuse. This preset
215
+ # keeps fork continuable; parent and child inherit the same messaging tool,
216
+ # while the parent id and return guidance follow the inherited history.
217
+ - id: tool-subagent-fork
218
+ name: '@deepseek-ai/dsh-tool-subagent'
219
+ config:
220
+ provider: fork
221
+ toolName: subagent_fork
222
+ backgroundMode: continuable
223
+
224
+ # ── ПОЧЕМУ ЗДЕСЬ НЕТ ДЕЛЕГИРОВАНИЯ В CODEX И CLAUDE CODE ────────────
225
+ #
226
+ # Стояли две строки, дававшие агенту право отдавать задачу наружу — в
227
+ # Codex или Claude Code как в отдельные продукты. Убраны.
228
+ #
229
+ # ПЕРВОЕ И ГЛАВНОЕ: они ломали чистую установку. Провайдеры для них
230
+ # монтировались в профиле, а пакеты `@deepseek-ai/dsh-subagent-codex` и
231
+ # `-claude-code` в поставку dsh НЕ входят и установщиком не ставились —
232
+ # я добавил их себе руками и этого не заметил. Проверено: профиль
233
+ # объявлял три зависимости, установщик ставил одну. Первый же сотрудник
234
+ # получил бы профиль со ссылками на отсутствующие пакеты.
235
+ #
236
+ # ВТОРОЕ: они не окупались. Чистый опыт — одна и та же модель в Claude
237
+ # Code и в нашей обвязке, равный доступ, одна цель — дал совпадение 13
238
+ # находок из 14. Обвязка почти ничего не решает; разное находят разные
239
+ # МОДЕЛИ. А обе подписки, Anthropic и OpenAI, доступны прямо здесь, со
240
+ # своими списками моделей и без поштучной оплаты.
241
+ #
242
+ # Заменить ГЛАВНЫЙ цикл агента ими было нельзя в любом случае:
243
+ # `agent-loop` регистрирует одну фабрику и падает на второй. Речь шла
244
+ # только об одноразовом поручении.
245
+ #
246
+ # Кому эти продукты уже установлены — включает их в настройках обзора
247
+ # ниже; код запуска остался в пакете.
248
+
249
+ # ── ВТОРОЕ МНЕНИЕ ───────────────────────────────────────────────────
250
+ #
251
+ # Наш инструмент: одну работу смотрят несколько ревизоров сразу и
252
+ # возвращают список находок по строгому формату.
253
+ #
254
+ # По умолчанию ревизоры НАШИ — подагенты на нашем же маршруте, на двух
255
+ # разных семействах моделей из двух подписок. Внешние продукты можно
256
+ # включить, если они установлены, но требовать их не за что.
257
+ # СДЕЛАТЬ работу; здесь — ПРОВЕРИТЬ уже сделанную. Проверять дешевле,
258
+ # чем делать, а находит такой обзор то, чего автор не видит: тихие
259
+ # дефекты, которые проявляются лишь в определённой последовательности.
260
+ #
261
+ # Ревизоров двое не для надёжности, а потому что они находят РАЗНОЕ.
262
+ # Проверено на нашем же коде: восемь настоящих дефектов, и два самых
263
+ # опасных нашли разные исполнители, по одному у каждого.
264
+ #
265
+ # Строка ничего не публикует — только регистрирует инструмент, — поэтому
266
+ # своей области видимости ей не нужно. Реестр подагентов она берёт
267
+ # хостовый, тот же, что и соседние строки делегирования.
268
+ - id: tool-second-opinion
269
+ name: 'tensorgrid-ui/review'
270
+
271
+ - id: workflow-worker-thread
272
+ name: '@deepseek-ai/dsh-workflow-worker-thread'
273
+ config:
274
+ provider: spawn
275
+
276
+ - id: tool-workflow
277
+ name: '@deepseek-ai/dsh-tool-workflow'
278
+
279
+ - id: tool-ralph
280
+ name: '@deepseek-ai/dsh-tool-ralph'
281
+ config:
282
+ subagentProvider: spawn
283
+ maxRounds: 64
284
+
285
+ # ── remaining model-facing rows ─────────────────────────────────────────────
286
+
287
+ - id: tool-ask-user
288
+ name: '@deepseek-ai/dsh-tool-ask-user'
289
+
290
+ - id: tool-todo
291
+ name: '@deepseek-ai/dsh-tool-todo'
292
+ config:
293
+ allowParallelInProgress: true
294
+
295
+ # The `web` service and its search provider stay in the host composition; only
296
+ # the model-facing tool is per-session.
297
+ - id: tool-web
298
+ name: '@deepseek-ai/dsh-tool-web'
299
+ config:
300
+ fetch: true
301
+ searchTimeoutMs: 60000
302
+
303
+ - id: present
304
+ name: '@deepseek-ai/dsh-tool-present'
@@ -0,0 +1,5 @@
1
+ name: TENSOR GRID
2
+ description: >-
3
+ Рабочий агент компании: правка файлов, консоль, поиск по файлам и в вебе,
4
+ навыки, планирование, цели, подагенты и сценарии.
5
+ order: 1
@@ -0,0 +1,65 @@
1
+ # ─────────────────────────────────────────────────────────────────────────
2
+ # TENSOR GRID — фирменный профиль поверх поставочных бандлов dsh.
3
+ #
4
+ # Профиль и есть единица приложения: package.json задаёт, какие бандлы
5
+ # составляют основу, а этот файл добавляет поверх них своё. Поставочный
6
+ # профиль `web` остаётся нетронутым и рабочим — если здесь что-то
7
+ # сломается, `dsh web` поднимет стоковый интерфейс.
8
+ #
9
+ # Установка на новой машине:
10
+ # dsh --profile tensorgrid --from-default-profile web --dump-config
11
+ # dsh plugin --profile tensorgrid add tensorgrid-ui
12
+ # скопировать сюда этот файл
13
+ # dsh --profile tensorgrid
14
+ # ─────────────────────────────────────────────────────────────────────────
15
+
16
+ # TENSOR GRID — палитра, живая атмосфера, айдентика, русский язык-пакет и
17
+ # проверка обновлений одним клиентским плагином.
18
+ #
19
+ # Пакет монтируется ПО ИМЕНИ из реестра npm, а не по пути внутри профиля.
20
+ # Спецификатор разрешается штатным ESM-резолвом из `node_modules` профиля,
21
+ # куда его кладёт `dsh plugin add`. Манифест client-modules находится
22
+ # подъёмом до ближайшего package.json — то есть до самого пакета.
23
+ #
24
+ # Почему не путь: копирование файлов требовало git на машине сотрудника и
25
+ # доступа к приватному репозиторию. Реестр отдаёт пакет анонимно, а
26
+ # обновление сводится к смене версии зависимости.
27
+ - insert:
28
+ # Стойка входа. Ни один поставочный профиль её не монтирует, а без неё
29
+ # llm-pi-ai не регистрирует НИ ОДНОГО потока входа — поэтому в настройках
30
+ # остаются только ключи API, и вход по подписке выглядит отсутствующим.
31
+ #
32
+ # Со строкой регистрируются 39 потоков, шесть из них с подпиской:
33
+ # Anthropic (Claude Pro/Max), OpenAI Codex (ChatGPT Plus/Pro),
34
+ # GitHub Copilot, xAI, OpenRouter, Kimi. Учётные данные ложатся в
35
+ # ~/.dsh/.credentials.yaml — вне профилей, то есть вход работает во всех.
36
+ #
37
+ # Сама строка ничего не делает: она только даёт службу, в которую
38
+ # провайдеры кладут свои потоки. Проверено сквозным входом в ChatGPT.
39
+ - id: authorization
40
+ name: '@deepseek-ai/dsh-authorization'
41
+
42
+ # ── ПОЧЕМУ ЗДЕСЬ НЕТ CODEX И CLAUDE CODE ────────────────────────────
43
+ #
44
+ # Раньше стояли две строки, монтировавшие `@deepseek-ai/dsh-subagent-codex`
45
+ # и `-claude-code` — поручение задач настоящим чужим продуктам.
46
+ #
47
+ # Убраны по двум причинам, и первая — прямая поломка.
48
+ #
49
+ # ЭТИ ПАКЕТЫ НЕ ВХОДЯТ В ПОСТАВКУ dsh и не ставились установщиком.
50
+ # Проверено на чистой установке: в `node_modules` их нет. У меня они
51
+ # работали лишь потому, что я поставил их руками, а первый же сотрудник
52
+ # получил бы профиль, ссылающийся на отсутствующие пакеты.
53
+ #
54
+ # ОНИ НЕ НУЖНЫ. Чистый опыт: одна и та же модель в Claude Code и в нашей
55
+ # обвязке, равный доступ, одна цель — совпадение 13 находок из 14.
56
+ # Обвязка почти ничего не решает, разное находят разные МОДЕЛИ. А обе
57
+ # подписки — Anthropic и OpenAI — работают прямо здесь, со своими
58
+ # списками моделей и без поштучной оплаты. Мой прежний довод «внешние
59
+ # нужны ради безлимита» был ошибкой: безлимит и так наш.
60
+ #
61
+ # Код запуска этих продуктов оставлен в пакете, и тот, у кого они уже
62
+ # установлены, включает их в настройках обзора. Требовать от сотрудника
63
+ # установку двух лишних продуктов больше не за что.
64
+ - id: ui-tensorgrid
65
+ name: 'tensorgrid-ui'
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "dsh-profile-tensorgrid",
3
+ "private": true,
4
+ "dependencies": {},
5
+ "dsh": {
6
+ "profile": {
7
+ "bundles": [
8
+ "@deepseek-ai/dsh-base",
9
+ "@deepseek-ai/dsh-web-app"
10
+ ],
11
+ "patchReload": "live"
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Скругляет углы готового ICO, вырезая их по альфа-каналу.
3
+ *
4
+ * Зачем отдельный шаг, а не скругление в SVG: конвертеры SVG в ICO сплошь
5
+ * и рядом заливают прозрачность белым — мы на этом уже обожглись, иконка
6
+ * приехала с белыми треугольниками по углам. Поэтому SVG остаётся сплошным
7
+ * квадратом, который испортить невозможно, а скругление накладывается здесь,
8
+ * прямо по пикселям.
9
+ *
10
+ * Формат: внутри ICO лежит 32-битный BMP снизу вверх, по четыре байта на
11
+ * пиксель в порядке BGRA, а следом однобитная маска прозрачности. Windows
12
+ * для 32-битных иконок читает альфу, но маску тоже уважают некоторые
13
+ * отрисовщики, поэтому обновляются обе.
14
+ *
15
+ * Запуск: node tools/round-ico-corners.mjs <путь.ico> [радиус]
16
+ */
17
+ import { readFileSync, writeFileSync, existsSync } from 'node:fs'
18
+
19
+ const path = process.argv[2]
20
+ if (path === undefined || !existsSync(path)) {
21
+ console.error('укажите путь к .ico')
22
+ process.exit(1)
23
+ }
24
+
25
+ const bytes = readFileSync(path)
26
+ if (bytes.readUInt16LE(0) !== 0 || bytes.readUInt16LE(2) !== 1) {
27
+ console.error('это не ICO')
28
+ process.exit(1)
29
+ }
30
+
31
+ const count = bytes.readUInt16LE(4)
32
+ let rounded = 0
33
+
34
+ for (let index = 0; index < count; index += 1) {
35
+ const entry = 6 + index * 16
36
+ const width = bytes[entry] === 0 ? 256 : bytes[entry]
37
+ const height = bytes[entry + 1] === 0 ? 256 : bytes[entry + 1]
38
+ const bitCount = bytes.readUInt16LE(entry + 6)
39
+ const offset = bytes.readUInt32LE(entry + 12)
40
+
41
+ if (bytes[offset] === 0x89 && bytes[offset + 1] === 0x50) {
42
+ console.log(` [${index}] ${width}x${height}: PNG внутри ICO — пропущен`)
43
+ continue
44
+ }
45
+ if (bitCount !== 32) {
46
+ console.log(` [${index}] ${width}x${height}: ${bitCount} бит на пиксель — пропущен, нужна альфа`)
47
+ continue
48
+ }
49
+
50
+ const headerSize = bytes.readUInt32LE(offset)
51
+ const pixels = offset + headerSize
52
+ const stride = width * 4
53
+ const maskStride = Math.ceil(width / 32) * 4
54
+ const mask = pixels + stride * height
55
+
56
+ // Радиус по умолчанию — доля стороны, привычная для иконок приложений.
57
+ const radius = Number.parseFloat(process.argv[3] ?? '') || width * 0.22
58
+
59
+ /**
60
+ * Доля пикселя внутри скруглённого прямоугольника.
61
+ *
62
+ * Считается подвыборкой: край скругления проходит по диагонали, и без
63
+ * сглаживания он выглядел бы лестницей — ровно та дешевизна, от которой
64
+ * уходим.
65
+ */
66
+ function coverage(px, py) {
67
+ const steps = 4
68
+ let inside = 0
69
+ for (let sy = 0; sy < steps; sy += 1) {
70
+ for (let sx = 0; sx < steps; sx += 1) {
71
+ const x = px + (sx + 0.5) / steps
72
+ const y = py + (sy + 0.5) / steps
73
+ // Ближайший центр скругления по каждой оси.
74
+ const cx = x < radius ? radius : x > width - radius ? width - radius : x
75
+ const cy = y < radius ? radius : y > height - radius ? height - radius : y
76
+ const dx = x - cx
77
+ const dy = y - cy
78
+ if (dx * dx + dy * dy <= radius * radius) inside += 1
79
+ }
80
+ }
81
+ return inside / (steps * steps)
82
+ }
83
+
84
+ let cut = 0
85
+ for (let y = 0; y < height; y += 1) {
86
+ for (let x = 0; x < width; x += 1) {
87
+ const share = coverage(x, y)
88
+ if (share >= 1) continue
89
+
90
+ // BMP хранится снизу вверх.
91
+ const i = pixels + (height - 1 - y) * stride + x * 4
92
+ bytes[i + 3] = Math.round(share * 255)
93
+ cut += 1
94
+
95
+ if (share === 0) {
96
+ const bit = mask + (height - 1 - y) * maskStride + (x >> 3)
97
+ bytes[bit] |= 0x80 >> (x & 7)
98
+ }
99
+ }
100
+ }
101
+
102
+ console.log(` [${index}] ${width}x${height}: радиус ${Math.round(radius)}, изменено ${cut} пикселей`)
103
+ rounded += 1
104
+ }
105
+
106
+ if (rounded === 0) {
107
+ console.error('ни одно изображение не удалось скруглить')
108
+ process.exit(1)
109
+ }
110
+
111
+ writeFileSync(path, bytes)
112
+ console.log('')
113
+ console.log(`готово: ${path}`)