dsh-desktop-kit 2.18.0 → 2.19.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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.19.0 (2026-11-12)
4
+
5
+ - **Deprecated MCP не предлагаются.** Вместо `@modelcontextprotocol/server-github` и archived `server-postgres` создаётся `mcp.suggestions.json` только с поддерживаемыми ссылками, причиной и заметкой; команды и trust не автоматизируются.
6
+ - **Opt-out.** `.dsh/kit.json` → `{ "provision": false }` полностью отключает авто-настройку.
7
+ - **Cache.** Повторный `ensureProjectScaffold` в течение 30 с не трогает диск.
8
+ - **Swarm budget.** `swarm.json.maxAgents` (2–6), лимит применяется к preset и списку участников.
9
+ - **Tests.** suggestions/opt-out/cache/budget.
10
+
11
+ ## 2.18.1 (2026-11-12)
12
+
13
+ - **Existing sessions provision too.** `ensureProjectScaffold(cwd)` вызывается из system-prompt контекста, поэтому проект получает роли/team/swarm/MCP-предложения даже без создания нового агента.
14
+ - **Tests.** Полный набор; повторная идемпотентность сохранена.
15
+
3
16
  ## 2.18.0 (2026-11-12)
4
17
 
5
18
  - **Zero-config project provisioning.** При первом открытии проекта создаются 4 роли (reviewer/researcher/tester/coordinator), team-presets review/research, `swarm.json enabled:true threshold:3`.
package/README.md CHANGED
@@ -1,20 +1,20 @@
1
- # DSH Desktop Kit 2.18
1
+ # DSH Desktop Kit 2.19
2
2
 
3
3
  **MCP с OAuth, sampling и elicitation. Агенты, worktrees и рой с общей доской. Интерфейс, который не мешает.**
4
4
 
5
5
  Набор из **17 плагинов и 30 навыков** для DeepSeek Harness 0.2.x: MCP tools/resources/prompts + OAuth 2.1, sampling, elicitation; проектные агенты, worktrees, фон и read-only рой с общей доской; русский интерфейс, автопилот навыков, токен-лаборатория, студия навыков, память проектов, guardrails, карта репозитория, чекпоинты, plan mode, browser QA, GitHub review, hooks/commands и резервные копии профиля.
6
6
 
7
- ![DSH Desktop Kit 2.7](https://unpkg.com/dsh-desktop-kit@2.18.0/docs/images/hero.png)
7
+ ![DSH Desktop Kit 2.7](https://unpkg.com/dsh-desktop-kit@2.19.0/docs/images/hero.png)
8
8
 
9
9
  ## MCP: подключения без JSON
10
10
 
11
11
  Настройки → **MCP**: пресеты GitHub, PostgreSQL и Filesystem, живые статусы, health, список tools и безопасное хранение токенов в `~/.dsh/mcp.secrets.json`. Промпты сервера открываются кнопкой **Prompts**: аргументы, запуск и копирование результата. HTTP-серверы подключаются через **OAuth 2.1 + PKCE**, **sampling** идёт через approval-карточку DSH, а **elicitation** — через глобальную форму с Accept/Decline.
12
12
 
13
- ![MCP Settings](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-mcp-manager/screenshots/settings-1440.png)
13
+ ![MCP Settings](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-mcp-manager/screenshots/settings-1440.png)
14
14
 
15
- ![MCP на 390px](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-mcp-manager/screenshots/settings-390.png)
15
+ ![MCP на 390px](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-mcp-manager/screenshots/settings-390.png)
16
16
 
17
- ![Добавление MCP-сервера](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-mcp-manager/screenshots/modal-390.png)
17
+ ![Добавление MCP-сервера](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-mcp-manager/screenshots/modal-390.png)
18
18
 
19
19
  ## Агенты, worktrees и рой
20
20
 
@@ -26,17 +26,17 @@
26
26
  - **Живые сообщения** — `team_message` отправляет текст лиду (`to="parent"`) или участнику по run id; копия каждого сообщения остаётся в board.
27
27
  - **Инструкции проекта** — `AGENTS.md`/`CLAUDE.md` иерархически (root → вложенные папки → `.dsh`) с `@import`; MCP roots сообщает корень проекта.
28
28
 
29
- ![Доска команды](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-agent-extensions/screenshots/board-1440.png)
29
+ ![Доска команды](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-agent-extensions/screenshots/board-1440.png)
30
30
 
31
- ![Доска команды на 390px](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-agent-extensions/screenshots/board-390.png)
31
+ ![Доска команды на 390px](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-agent-extensions/screenshots/board-390.png)
32
32
 
33
- ![Транскрипт фонового агента](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-agent-extensions/screenshots/transcript-1440.png)
33
+ ![Транскрипт фонового агента](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-agent-extensions/screenshots/transcript-1440.png)
34
34
 
35
- Транскрипт сохраняется в `.dsh/agents/transcripts/<run>.json` (0600) и доступен после restart.\n\n![Транскрипт на 390px](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-agent-extensions/screenshots/transcript-390.png)
35
+ Транскрипт сохраняется в `.dsh/agents/transcripts/<run>.json` (0600) и доступен после restart.\n\n![Транскрипт на 390px](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-agent-extensions/screenshots/transcript-390.png)
36
36
 
37
- ![MCP sampling](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-mcp-manager/screenshots/sampling-1440.png)
37
+ ![MCP sampling](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-mcp-manager/screenshots/sampling-1440.png)
38
38
 
39
- ![MCP elicitation](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-mcp-manager/screenshots/elicitation-1440.png)
39
+ ![MCP elicitation](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-mcp-manager/screenshots/elicitation-1440.png)
40
40
 
41
41
  ## Интеграции
42
42
 
@@ -46,9 +46,9 @@ Marketplace, IDE bridge и sandbox-аудит — в одном экране **
46
46
  - **IDE bridge** — localhost JSON API (`/health`, `/context`) с bearer-токеном; расширение редактора — отдельный проект.
47
47
  - **Sandbox** — честный аудит: DSH preset + kit guardrails — это политика, не OS sandbox.
48
48
 
49
- ![Интеграции](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-integrations/screenshots/integrations-1440.png)
49
+ ![Интеграции](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-integrations/screenshots/integrations-1440.png)
50
50
 
51
- ![Интеграции на 390px](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-integrations/screenshots/integrations-390.png)
51
+ ![Интеграции на 390px](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-integrations/screenshots/integrations-390.png)
52
52
 
53
53
  ## Ноль настройки
54
54
 
@@ -56,10 +56,10 @@ Marketplace, IDE bridge и sandbox-аудит — в одном экране **
56
56
 
57
57
  - роли **reviewer / researcher / tester / coordinator**;
58
58
  - team-presets **review** и **research**;
59
- - `swarm.json` с `enabled: true`, `threshold: 3`;
60
- - MCP-предложения по стеку: **GitHub** при `github.com` в git remote, **PostgreSQL** при `pg`/`postgres` или `DATABASE_URL` в `.env.example`.
59
+ - `swarm.json` с `enabled: true`, `threshold: 3`, `maxAgents: 4`;
60
+ - `mcp.suggestions.json`: **GitHub** при `github.com` в git remote, **PostgreSQL** при `pg`/`postgres` или `DATABASE_URL` в `.env.example`.
61
61
 
62
- MCP-предложения создаются **выключенными** (`enabled:false`, `trusted:false`): команда запускается только после явного trust. Существующие `.dsh/agents/*.md` не перезаписываются.
62
+ MCP-предложения — это только **ссылки на поддерживаемые серверы** и причина, без готовой команды и без автозапуска. Устаревшие `@modelcontextprotocol/server-github` и `server-postgres` не предлагаются. Настройка и trust — вручную. Отключить авто-настройку: `.dsh/kit.json` → `{ "provision": false }`. Существующие `.dsh/agents/*.md` не перезаписываются.
63
63
 
64
64
  ## Права и субагенты
65
65
 
@@ -70,11 +70,11 @@ MCP-предложения создаются **выключенными** (`ena
70
70
  - **Worktrees и фоновые агенты.** `project_worktree` создаёт ветку `dsh/<slug>` и отдельную папку `.dsh/worktrees/<slug>`; `project_agent ... worktree=auto background=true` запускает агента в изоляции, а страница **Агенты** показывает worktrees и очередь запусков с кнопкой «Остановить».
71
71
  - **Инструкции проекта.** `AGENTS.md` и `CLAUDE.md` читаются иерархически (root → вложенные папки → `.dsh`) с `@import`; MCP roots сообщает серверу корень проекта.
72
72
 
73
- ![Агенты проекта](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-agent-extensions/screenshots/agents-1440.png)
73
+ ![Агенты проекта](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-agent-extensions/screenshots/agents-1440.png)
74
74
 
75
- ![Права и ограничения](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-guardrails/screenshots/permissions-1440.png)
75
+ ![Права и ограничения](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-guardrails/screenshots/permissions-1440.png)
76
76
 
77
- **v2.18.0** · MIT · проверено на DSH `0.2.1-rc.5` и `0.2.2-rc.1` (Windows 11) · без внешних зависимостей и телеметрии
77
+ **v2.19.0** · MIT · проверено на DSH `0.2.1-rc.5` и `0.2.2-rc.1` (Windows 11) · без внешних зависимостей и телеметрии
78
78
 
79
79
  **План развития:** [docs/ROADMAP-3.0.md](docs/ROADMAP-3.0.md) — Memory Fabric, семантическое
80
80
  слияние, локальный индекс памяти, шифрованные переносы, Memory Hub и npm trusted publishing.
@@ -169,27 +169,27 @@ MCP-предложения создаются **выключенными** (`ena
169
169
  - перед каждой синхронизацией проверяется, что репозиторий всё ещё приватный;
170
170
  - секреты и PII вычищаются, домашние пути заменяются токеном `%DSH_HOME%`; LLM не вызывается — **0 токенов**.
171
171
 
172
- ![Настройки памяти проектов](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-memory-bridge/docs/images/settings-light.png)
172
+ ![Настройки памяти проектов](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-memory-bridge/docs/images/settings-light.png)
173
173
 
174
- ![Конфликты досье](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-memory-bridge/docs/images/conflicts.png)
174
+ ![Конфликты досье](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-memory-bridge/docs/images/conflicts.png)
175
175
 
176
176
  ## Скриншоты
177
177
 
178
178
  ### Skills Studio: каталог, стоимость и редактор
179
179
 
180
- ![Каталог навыков](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-gkb-ru-ui/screenshots/02-skills-1440-light.png)
180
+ ![Каталог навыков](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-gkb-ru-ui/screenshots/02-skills-1440-light.png)
181
181
 
182
- ![Редактор навыка](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-gkb-ru-ui/screenshots/03-skills-editor-1440-light.png)
182
+ ![Редактор навыка](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-gkb-ru-ui/screenshots/03-skills-editor-1440-light.png)
183
183
 
184
184
  ### Token Lab: куда уходит контекст
185
185
 
186
- ![Токен-лаборатория](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-token-lab/screenshots/01-token-lab-1440-light.png)
186
+ ![Токен-лаборатория](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-token-lab/screenshots/01-token-lab-1440-light.png)
187
187
 
188
188
  ### Тёмная тема и мобильный
189
189
 
190
- ![Тёмная тема](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-gkb-ru-ui/screenshots/04-skills-1440-dark.png)
190
+ ![Тёмная тема](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-gkb-ru-ui/screenshots/04-skills-1440-dark.png)
191
191
 
192
- ![Каталог навыков на 390 px](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-gkb-ru-ui/screenshots/05-skills-390-light.png)
192
+ ![Каталог навыков на 390 px](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-gkb-ru-ui/screenshots/05-skills-390-light.png)
193
193
 
194
194
  ## Окно-напоминание: пиковый тариф
195
195
 
@@ -199,11 +199,11 @@ DeepSeek включает двойной тариф в пиковые часы (
199
199
  - **в окне** — красная карточка: причина, границы окна в местном времени и UTC, живой отсчёт до конца и рекомендация, когда вернуться;
200
200
  - **после окна** — карточка исчезает; состояние всегда доступно через `window.__DSH_PEAK_GUARD__.state()`.
201
201
 
202
- ![Окно-напоминание: светлая тема](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-peak-guard/screenshots/03-peak-card-1440-light.png)
202
+ ![Окно-напоминание: светлая тема](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-peak-guard/screenshots/03-peak-card-1440-light.png)
203
203
 
204
- ![Окно-напоминание: тёмная тема](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-peak-guard/screenshots/04-peak-card-1440-dark.png)
204
+ ![Окно-напоминание: тёмная тема](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-peak-guard/screenshots/04-peak-card-1440-dark.png)
205
205
 
206
- ![Окно-напоминание на 390 px](https://unpkg.com/dsh-desktop-kit@2.18.0/plugins/dsh-peak-guard/screenshots/05-peak-card-390-light.png)
206
+ ![Окно-напоминание на 390 px](https://unpkg.com/dsh-desktop-kit@2.19.0/plugins/dsh-peak-guard/screenshots/05-peak-card-390-light.png)
207
207
 
208
208
  Подробности и настройки — [plugins/dsh-peak-guard/README.md](plugins/dsh-peak-guard/README.md).
209
209
 
package/client.js CHANGED
@@ -8253,7 +8253,7 @@ var(--dsw-alias-bg-layer-1,#fff);box-shadow:inset 0 1px 0 color-mix(in srgb,#fff
8253
8253
  if (__kitErrors.length <= 5) console.error("[dsh-desktop-kit] registration failed:", label, message);
8254
8254
  };
8255
8255
  try {
8256
- window.__DSH_DESKTOP_KIT__ = { version: "2.18.0", parts: __partNames, errors: __kitErrors, ready: false };
8256
+ window.__DSH_DESKTOP_KIT__ = { version: "2.19.0", parts: __partNames, errors: __kitErrors, ready: false };
8257
8257
  } catch {}
8258
8258
  const __inject = [];
8259
8259
  for (const __part of __parts) {
@@ -0,0 +1,15 @@
1
+ # DSH Desktop Kit 2.18.1 — тест
2
+
3
+ Дата: 2026-11-12.
4
+
5
+ ## Existing project
6
+
7
+ - При каждом system-prompt вызывается `ensureProjectScaffold(cwd)`.
8
+ - Уже открытая сессия получает auto roles/team/swarm/MCP suggestions без нового агента.
9
+ - Идемпотентно: второй вызов `created.length=0`.
10
+
11
+ ## Проверки
12
+
13
+ - `agent-extensions-tests` — OK.
14
+ - `npm test` — exit 0.
15
+ - build/check — OK.
@@ -0,0 +1,26 @@
1
+ # DSH Desktop Kit 2.19.0 — тест
2
+
3
+ Дата: 2026-11-12.
4
+
5
+ ## MCP
6
+
7
+ - `mcp.json` остаётся пустым; deprecated команды не пишутся.
8
+ - `mcp.suggestions.json` содержит github/postgres с `docs` и `note`.
9
+ - Trust не автоматизируется.
10
+
11
+ ## Auto provisioning
12
+
13
+ - `.dsh/kit.json` `provision:false` → skipped.
14
+ - Cache 30 с.
15
+ - 4 роли, 2 preset, swarm maxAgents.
16
+
17
+ ## Swarm
18
+
19
+ - `maxAgents` 2–6; preset members slice.
20
+ - 2 участника при лимите 2.
21
+
22
+ ## Проверки
23
+
24
+ - `agent-extensions-tests` — OK.
25
+ - `swarm-tests` — OK, включая budget.
26
+ - `npm test` — exit 0.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-desktop-kit",
3
- "version": "2.18.0",
4
- "description": "DeepSeek Harness desktop kit 2.18.0: 16 plugins and 30 skills — MCP tools/resources/prompts with OAuth 2.1, sampling and elicitation, project agents, git worktrees, background runs and a read-only/writer swarm with a shared board, plus self-applying skills, token lab, Skills Studio, project memory, guardrails, repo map, checkpoints, plan mode, browser QA, GitHub review, hooks/commands, Russian UI and profile transfer. Includes local marketplace, localhost IDE bridge and an honest sandbox audit.",
3
+ "version": "2.19.0",
4
+ "description": "DeepSeek Harness desktop kit 2.19.0: 16 plugins and 30 skills — MCP tools/resources/prompts with OAuth 2.1, sampling and elicitation, project agents, git worktrees, background runs and a read-only/writer swarm with a shared board, plus self-applying skills, token lab, Skills Studio, project memory, guardrails, repo map, checkpoints, plan mode, browser QA, GitHub review, hooks/commands, Russian UI and profile transfer. Includes local marketplace, localhost IDE bridge and an honest sandbox audit.",
5
5
  "keywords": [
6
6
  "deepseek-harness",
7
7
  "dsh",
@@ -398,7 +398,9 @@ export function apply(ctx) {
398
398
  required: false,
399
399
  text: (assemblyContext) => {
400
400
  try {
401
- return renderProjectInstructions(assemblyContext?.agent?.session?.header?.cwd);
401
+ const cwd = assemblyContext?.agent?.session?.header?.cwd;
402
+ if (cwd) ensureProjectScaffold(cwd);
403
+ return renderProjectInstructions(cwd);
402
404
  } catch {
403
405
  return "";
404
406
  }
@@ -13,6 +13,8 @@ import os from "node:os";
13
13
  import path from "node:path";
14
14
 
15
15
  const SCAFFOLD_VERSION = 1;
16
+ const PROVISION_CACHE = new Map();
17
+ const PROVISION_TTL = 30_000;
16
18
 
17
19
  function writeIfMissing(file, content) {
18
20
  if (fs.existsSync(file)) return false;
@@ -91,37 +93,29 @@ function hasPostgres(cwd) {
91
93
  }
92
94
 
93
95
  function suggestMcp(cwd, dsh) {
94
- const file = path.join(dsh, "mcp.json");
95
- if (!fs.existsSync(file)) return false;
96
- let parsed;
97
- try { parsed = JSON.parse(fs.readFileSync(file, "utf8")); } catch { return false; }
98
- const servers = parsed && typeof parsed === "object" ? (parsed.mcpServers ??= {}) : null;
99
- if (!servers) return false;
100
- let changed = false;
101
- const add = (id, value) => {
102
- if (servers[id]) return;
103
- servers[id] = value;
104
- changed = true;
105
- };
96
+ const suggestions = [];
106
97
  if (hasGitHub(cwd)) {
107
- add("github", {
108
- command: "npx",
109
- args: ["-y", "@modelcontextprotocol/server-github"],
110
- env: { GITHUB_TOKEN: "${GITHUB_TOKEN}" },
111
- trusted: false,
112
- enabled: false,
98
+ suggestions.push({
99
+ id: "github",
100
+ reason: "git remote указывает на github.com",
101
+ docs: "https://github.com/github/github-mcp-server",
102
+ note: "Официальный GitHub MCP требует Docker/remote и токен; команда не создаётся автоматически.",
113
103
  });
114
104
  }
115
105
  if (hasPostgres(cwd)) {
116
- add("postgres", {
117
- command: "npx",
118
- args: ["-y", "@modelcontextprotocol/server-postgres", "${DATABASE_URL}"],
119
- trusted: false,
120
- enabled: false,
106
+ suggestions.push({
107
+ id: "postgres",
108
+ reason: "в проекте есть pg/postgres или DATABASE_URL",
109
+ docs: "https://github.com/ai-kaiva/postgres-mcp",
110
+ note: "Используйте поддерживаемый postgres-mcp; archived server-postgres не предлагается.",
121
111
  });
122
112
  }
123
- if (changed) fs.writeFileSync(file, `${JSON.stringify(parsed, null, 2)}\n`, "utf8");
124
- return changed;
113
+ if (suggestions.length === 0) return false;
114
+ const file = path.join(dsh, "mcp.suggestions.json");
115
+ const next = `${JSON.stringify({ generatedAt: new Date().toISOString(), suggestions }, null, 2)}\n`;
116
+ if (fs.existsSync(file) && fs.readFileSync(file, "utf8") === next) return false;
117
+ fs.writeFileSync(file, next, "utf8");
118
+ return true;
125
119
  }
126
120
 
127
121
  export function ensureGlobalScaffold(home = process.env.DSH_HOME || path.join(os.homedir(), ".dsh")) {
@@ -176,6 +170,13 @@ export function shouldScaffold(cwd) {
176
170
  export function ensureProjectScaffold(cwd) {
177
171
  if (!shouldScaffold(cwd)) return { skipped: true, created: [] };
178
172
  const dsh = path.join(cwd, ".dsh");
173
+ const configFile = path.join(dsh, "kit.json");
174
+ try {
175
+ const config = JSON.parse(fs.readFileSync(configFile, "utf8"));
176
+ if (config?.provision === false) return { skipped: true, reason: "provision:false", created: [], dsh };
177
+ } catch { /* no opt-out config */ }
178
+ const cached = PROVISION_CACHE.get(cwd);
179
+ if (cached && Date.now() - cached < PROVISION_TTL) return { skipped: false, cached: true, created: [], dsh };
179
180
  const created = [];
180
181
  fs.mkdirSync(dsh, { recursive: true });
181
182
  for (const directory of ["agents", "commands", "rules", "teams"]) {
@@ -201,13 +202,13 @@ export function ensureProjectScaffold(cwd) {
201
202
  if (writeIfMissing(path.join(teamsDir, file), `${JSON.stringify(value, null, 2)}\n`)) created.push(path.join(teamsDir, file));
202
203
  }
203
204
  }
204
- if (writeIfMissing(path.join(dsh, "swarm.json"), `${JSON.stringify({ enabled: true, threshold: 3 }, null, 2)}\n`)) created.push(path.join(dsh, "swarm.json"));
205
+ if (writeIfMissing(path.join(dsh, "swarm.json"), `${JSON.stringify({ enabled: true, threshold: 3, maxAgents: 4 }, null, 2)}\n`)) created.push(path.join(dsh, "swarm.json"));
205
206
  if (writeIfMissing(path.join(dsh, "agents", ".gitkeep"), "")) created.push(path.join(dsh, "agents", ".gitkeep"));
206
207
  if (writeIfMissing(path.join(dsh, "commands", ".gitkeep"), "")) created.push(path.join(dsh, "commands", ".gitkeep"));
207
208
  if (writeIfMissing(path.join(dsh, "hooks.json"), `${JSON.stringify({ hooks: {} }, null, 2)}\n`)) created.push(path.join(dsh, "hooks.json"));
208
209
  if (writeIfMissing(path.join(dsh, "verify.json"), `${JSON.stringify({ commands: [] }, null, 2)}\n`)) created.push(path.join(dsh, "verify.json"));
209
210
  if (writeIfMissing(path.join(dsh, "mcp.json"), `${JSON.stringify({ mcpServers: {} }, null, 2)}\n`)) created.push(path.join(dsh, "mcp.json"));
210
- if (suggestMcp(cwd, dsh)) created.push(path.join(dsh, "mcp.json"));
211
+ if (suggestMcp(cwd, dsh)) created.push(path.join(dsh, "mcp.suggestions.json"));
211
212
  if (
212
213
  writeIfMissing(
213
214
  path.join(dsh, ".gitignore"),
@@ -268,5 +269,6 @@ export function ensureProjectScaffold(cwd) {
268
269
  fs.writeFileSync(marker, `${JSON.stringify({ version: SCAFFOLD_VERSION, createdAt: new Date().toISOString() }, null, 2)}\n`, "utf8");
269
270
  created.push(marker);
270
271
  }
272
+ PROVISION_CACHE.set(cwd, Date.now());
271
273
  return { skipped: false, created, dsh };
272
- }
274
+ }
@@ -21,9 +21,9 @@ const MULTI = [/\b(?:and|plus|also)\b/iu, /(?:^|\s)(?:и|плюс|также)(?:
21
21
  export function loadSwarmOptions(projectRoot) {
22
22
  try {
23
23
  const parsed = JSON.parse(fs.readFileSync(path.join(projectRoot, ".dsh", "swarm.json"), "utf8"));
24
- return { enabled: parsed.enabled !== false, threshold: Number(parsed.threshold) || 3 };
24
+ return { enabled: parsed.enabled !== false, threshold: Number(parsed.threshold) || 3, maxAgents: Math.max(2, Math.min(6, Number(parsed.maxAgents) || 4)) };
25
25
  } catch {
26
- return { enabled: true, threshold: 3 };
26
+ return { enabled: true, threshold: 3, maxAgents: 4 };
27
27
  }
28
28
  }
29
29
 
@@ -43,19 +43,20 @@ export function chooseSwarm(task, teams = [], agents = [], options = {}) {
43
43
  if (readOnly.length < 2) return { swarm: false, score, reasons, reason: "need at least two read-only agents" };
44
44
  if (score < threshold) return { swarm: false, score, reasons, reason: `score ${score} < ${threshold}` };
45
45
 
46
+ const maxAgents = Math.max(2, Math.min(6, Number(options.maxAgents) || 4));
46
47
  const research = EXTERNAL.some((pattern) => pattern.test(text));
47
48
  const preset = teams.find((team) => team.members.every((name) => agents.some((agent) => agent.name === name)))
48
49
  ?? teams[0]
49
50
  ?? null;
50
51
  if (preset && preset.members.length >= 2) {
51
- return { swarm: true, score, reasons, research, preset: preset.id, members: preset.members, lead: preset.lead || "" };
52
+ return { swarm: true, score, reasons, research, maxAgents, preset: preset.id, members: preset.members.slice(0, maxAgents), lead: preset.lead || "" };
52
53
  }
53
54
  const preferred = ["reviewer", "researcher", "tester"];
54
55
  const members = readOnly
55
56
  .slice()
56
57
  .sort((a, b) => (preferred.indexOf(a.name) + 1 || 99) - (preferred.indexOf(b.name) + 1 || 99))
57
- .slice(0, 4)
58
+ .slice(0, maxAgents)
58
59
  .map((agent) => agent.name);
59
60
  const lead = readOnly.find((agent) => /^(?:lead|coordinator|orchestrator)$/iu.test(agent.name))?.name ?? "";
60
- return { swarm: true, score, reasons, research, preset: "", members, lead };
61
+ return { swarm: true, score, reasons, research, maxAgents, preset: "", members, lead };
61
62
  }