dsh-desktop-kit 2.15.11 → 2.16.1

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,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.16.1 (2026-11-12)
4
+
5
+ - **Fix `/api/dsh-integrations/*` 404.** Host plugin now registers routes directly through `connection`, with `ctx.inject` only as fallback; removed the optional `/integrations` command that could abort the injection.
6
+ - **Tests.** Fake host mount asserts all four routes are registered.
7
+ - **UI.** No visual changes; 2.16.0 screenshot remains valid.
8
+
9
+ ## 2.16.0 (2026-11-12)
10
+
11
+ - **`dsh-integrations`.** 17-й плагин: Marketplace, IDE bridge, sandbox audit.
12
+ - **Marketplace MVP.** Локальный каталог, SHA-256 `SKILL.md`, backup существующего навыка, установка только из локальной папки.
13
+ - **IDE bridge.** Localhost HTTP `/health` и `/context`, bearer-токен на запуск, запуск/остановка из Settings.
14
+ - **Sandbox audit.** Явно `enforcement:false`: политика DSH + kit guardrails, не OS-sandbox; документировано, что нужно для AppContainer/Job Objects.
15
+ - **UI.** Новый экран «Интеграции», скриншоты 1440/390, аудит без overflow.
16
+ - **Тесты.** `integrations-tests`: checksum, backup, mismatch, bridge auth/context.
17
+
3
18
  ## 2.15.11 (2026-11-12)
4
19
 
5
20
  - **Auto-swarm.** `project_agent action=auto` оценивает задачу (broad/security/architecture/audit/research, длина, несколько направлений) и сам запускает read-only рой или отказывается.
package/README.md CHANGED
@@ -2,19 +2,19 @@
2
2
 
3
3
  **MCP с OAuth, sampling и elicitation. Агенты, worktrees и рой с общей доской. Интерфейс, который не мешает.**
4
4
 
5
- Набор из **16 плагинов и 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 и резервные копии профиля.
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.15.11/docs/images/hero.png)
7
+ ![DSH Desktop Kit 2.7](https://unpkg.com/dsh-desktop-kit@2.16.1/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.15.11/plugins/dsh-mcp-manager/screenshots/settings-1440.png)
13
+ ![MCP Settings](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-mcp-manager/screenshots/settings-1440.png)
14
14
 
15
- ![MCP на 390px](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-mcp-manager/screenshots/settings-390.png)
15
+ ![MCP на 390px](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-mcp-manager/screenshots/settings-390.png)
16
16
 
17
- ![Добавление MCP-сервера](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-mcp-manager/screenshots/modal-390.png)
17
+ ![Добавление MCP-сервера](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-mcp-manager/screenshots/modal-390.png)
18
18
 
19
19
  ## Агенты, worktrees и рой
20
20
 
@@ -26,17 +26,29 @@
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.15.11/plugins/dsh-agent-extensions/screenshots/board-1440.png)
29
+ ![Доска команды](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-agent-extensions/screenshots/board-1440.png)
30
30
 
31
- ![Доска команды на 390px](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-agent-extensions/screenshots/board-390.png)
31
+ ![Доска команды на 390px](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-agent-extensions/screenshots/board-390.png)
32
32
 
33
- ![Транскрипт фонового агента](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-agent-extensions/screenshots/transcript-1440.png)
33
+ ![Транскрипт фонового агента](https://unpkg.com/dsh-desktop-kit@2.16.1/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.15.11/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.16.1/plugins/dsh-agent-extensions/screenshots/transcript-390.png)
36
36
 
37
- ![MCP sampling](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-mcp-manager/screenshots/sampling-1440.png)
37
+ ![MCP sampling](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-mcp-manager/screenshots/sampling-1440.png)
38
38
 
39
- ![MCP elicitation](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-mcp-manager/screenshots/elicitation-1440.png)
39
+ ![MCP elicitation](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-mcp-manager/screenshots/elicitation-1440.png)
40
+
41
+ ## Интеграции
42
+
43
+ Marketplace, IDE bridge и sandbox-аудит — в одном экране **Настройки → Интеграции**:
44
+
45
+ - **Marketplace** — локальный каталог навыков с SHA-256 и backup; без загрузки по URL.
46
+ - **IDE bridge** — localhost JSON API (`/health`, `/context`) с bearer-токеном; расширение редактора — отдельный проект.
47
+ - **Sandbox** — честный аудит: DSH preset + kit guardrails — это политика, не OS sandbox.
48
+
49
+ ![Интеграции](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-integrations/screenshots/integrations-1440.png)
50
+
51
+ ![Интеграции на 390px](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-integrations/screenshots/integrations-390.png)
40
52
 
41
53
  ## Права и субагенты
42
54
 
@@ -47,11 +59,11 @@
47
59
  - **Worktrees и фоновые агенты.** `project_worktree` создаёт ветку `dsh/<slug>` и отдельную папку `.dsh/worktrees/<slug>`; `project_agent ... worktree=auto background=true` запускает агента в изоляции, а страница **Агенты** показывает worktrees и очередь запусков с кнопкой «Остановить».
48
60
  - **Инструкции проекта.** `AGENTS.md` и `CLAUDE.md` читаются иерархически (root → вложенные папки → `.dsh`) с `@import`; MCP roots сообщает серверу корень проекта.
49
61
 
50
- ![Агенты проекта](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-agent-extensions/screenshots/agents-1440.png)
62
+ ![Агенты проекта](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-agent-extensions/screenshots/agents-1440.png)
51
63
 
52
- ![Права и ограничения](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-guardrails/screenshots/permissions-1440.png)
64
+ ![Права и ограничения](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-guardrails/screenshots/permissions-1440.png)
53
65
 
54
- **v2.15.11** · MIT · проверено на DSH `0.2.1-rc.5` и `0.2.2-rc.1` (Windows 11) · без внешних зависимостей и телеметрии
66
+ **v2.16.1** · MIT · проверено на DSH `0.2.1-rc.5` и `0.2.2-rc.1` (Windows 11) · без внешних зависимостей и телеметрии
55
67
 
56
68
  **План развития:** [docs/ROADMAP-3.0.md](docs/ROADMAP-3.0.md) — Memory Fabric, семантическое
57
69
  слияние, локальный индекс памяти, шифрованные переносы, Memory Hub и npm trusted publishing.
@@ -146,27 +158,27 @@
146
158
  - перед каждой синхронизацией проверяется, что репозиторий всё ещё приватный;
147
159
  - секреты и PII вычищаются, домашние пути заменяются токеном `%DSH_HOME%`; LLM не вызывается — **0 токенов**.
148
160
 
149
- ![Настройки памяти проектов](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-memory-bridge/docs/images/settings-light.png)
161
+ ![Настройки памяти проектов](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-memory-bridge/docs/images/settings-light.png)
150
162
 
151
- ![Конфликты досье](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-memory-bridge/docs/images/conflicts.png)
163
+ ![Конфликты досье](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-memory-bridge/docs/images/conflicts.png)
152
164
 
153
165
  ## Скриншоты
154
166
 
155
167
  ### Skills Studio: каталог, стоимость и редактор
156
168
 
157
- ![Каталог навыков](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-gkb-ru-ui/screenshots/02-skills-1440-light.png)
169
+ ![Каталог навыков](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-gkb-ru-ui/screenshots/02-skills-1440-light.png)
158
170
 
159
- ![Редактор навыка](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-gkb-ru-ui/screenshots/03-skills-editor-1440-light.png)
171
+ ![Редактор навыка](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-gkb-ru-ui/screenshots/03-skills-editor-1440-light.png)
160
172
 
161
173
  ### Token Lab: куда уходит контекст
162
174
 
163
- ![Токен-лаборатория](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-token-lab/screenshots/01-token-lab-1440-light.png)
175
+ ![Токен-лаборатория](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-token-lab/screenshots/01-token-lab-1440-light.png)
164
176
 
165
177
  ### Тёмная тема и мобильный
166
178
 
167
- ![Тёмная тема](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-gkb-ru-ui/screenshots/04-skills-1440-dark.png)
179
+ ![Тёмная тема](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-gkb-ru-ui/screenshots/04-skills-1440-dark.png)
168
180
 
169
- ![Каталог навыков на 390 px](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-gkb-ru-ui/screenshots/05-skills-390-light.png)
181
+ ![Каталог навыков на 390 px](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-gkb-ru-ui/screenshots/05-skills-390-light.png)
170
182
 
171
183
  ## Окно-напоминание: пиковый тариф
172
184
 
@@ -176,11 +188,11 @@ DeepSeek включает двойной тариф в пиковые часы (
176
188
  - **в окне** — красная карточка: причина, границы окна в местном времени и UTC, живой отсчёт до конца и рекомендация, когда вернуться;
177
189
  - **после окна** — карточка исчезает; состояние всегда доступно через `window.__DSH_PEAK_GUARD__.state()`.
178
190
 
179
- ![Окно-напоминание: светлая тема](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-peak-guard/screenshots/03-peak-card-1440-light.png)
191
+ ![Окно-напоминание: светлая тема](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-peak-guard/screenshots/03-peak-card-1440-light.png)
180
192
 
181
- ![Окно-напоминание: тёмная тема](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-peak-guard/screenshots/04-peak-card-1440-dark.png)
193
+ ![Окно-напоминание: тёмная тема](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-peak-guard/screenshots/04-peak-card-1440-dark.png)
182
194
 
183
- ![Окно-напоминание на 390 px](https://unpkg.com/dsh-desktop-kit@2.15.11/plugins/dsh-peak-guard/screenshots/05-peak-card-390-light.png)
195
+ ![Окно-напоминание на 390 px](https://unpkg.com/dsh-desktop-kit@2.16.1/plugins/dsh-peak-guard/screenshots/05-peak-card-390-light.png)
184
196
 
185
197
  Подробности и настройки — [plugins/dsh-peak-guard/README.md](plugins/dsh-peak-guard/README.md).
186
198
 
package/client.js CHANGED
@@ -8078,7 +8078,174 @@ var(--dsw-alias-bg-layer-1,#fff);box-shadow:inset 0 1px 0 color-mix(in srgb,#fff
8078
8078
  return module.exports;
8079
8079
  })());
8080
8080
 
8081
- const __partNames = ["dsh-gkb-ru-ui","dsh-token-lab","dsh-peak-guard","dsh-session-move","dsh-profile-transfer","dsh-memory-bridge","dsh-mcp-manager","dsh-agent-extensions","dsh-guardrails"];
8081
+ /* ---- dsh-integrations ---- */
8082
+ __parts.push((function () {
8083
+ var module = { exports: {} };
8084
+ var exports = module.exports;
8085
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
8086
+ const React = require("react");
8087
+ const h = React.createElement;
8088
+ const { useEffect, useState } = React;
8089
+
8090
+ const CSS = `
8091
+ .int-root{--in-line:var(--dsw-alias-border-l1,rgba(20,40,36,.13));--in-soft:var(--dsw-alias-bg-layer-1,#f4f7f5);--in-panel:var(--dsw-alias-bg-layer-2,#fff);--in-text:var(--dsw-alias-label-primary,#17231f);--in-muted:var(--dsw-alias-label-secondary,#61706b);--in-accent:var(--dsw-alias-brand-primary,#0f766e);display:flex;flex-direction:column;gap:20px;max-width:1040px;min-width:0;color:var(--in-text)}
8092
+ .int-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;flex-wrap:wrap}
8093
+ .int-eyebrow{margin:0 0 6px;font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--in-accent)}
8094
+ .int-title{margin:0;font-size:clamp(24px,2.6vw,32px);line-height:1.12;letter-spacing:-.025em;font-weight:680}
8095
+ .int-sub{margin:8px 0 0;max-width:68ch;color:var(--in-muted);font-size:14px;line-height:1.5}
8096
+ .int-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
8097
+ .int-stat{padding:14px 16px;border:1px solid var(--in-line);border-radius:14px;background:linear-gradient(150deg,var(--in-panel),var(--in-soft));min-width:0}
8098
+ .int-stat b{display:block;font-size:24px;line-height:1.1;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
8099
+ .int-stat span{display:block;margin-top:5px;color:var(--in-muted);font-size:11px;font-weight:650;letter-spacing:.08em;text-transform:uppercase}
8100
+ .int-section{display:flex;flex-direction:column;gap:10px;min-width:0}
8101
+ .int-section h3{margin:0;font-size:15px;letter-spacing:-.01em}
8102
+ .int-hint{margin:0;color:var(--in-muted);font-size:12px;line-height:1.5}
8103
+ .int-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-width:0}
8104
+ .int-item{border:1px solid var(--in-line);border-radius:12px;background:var(--in-panel);padding:12px;min-width:0;display:flex;flex-direction:column;gap:6px}
8105
+ .int-item-top{display:flex;justify-content:space-between;gap:8px;align-items:baseline;min-width:0}
8106
+ .int-item-top code{font:inherit;font-weight:650;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
8107
+ .int-item-top span{flex:none;font-size:9.5px;font-weight:750;letter-spacing:.06em;text-transform:uppercase;color:var(--in-muted)}
8108
+ .int-item p{margin:0;color:var(--in-muted);font-size:11.5px;line-height:1.45;overflow-wrap:anywhere}
8109
+ .int-ok{color:#0f766e}.int-bad{color:#9f1239}
8110
+ .int-btn{font:inherit;font-size:11px;font-weight:650;border:1px solid var(--in-line);background:var(--in-panel);color:var(--in-text);border-radius:8px;padding:6px 9px;cursor:pointer;min-height:30px}
8111
+ .int-btn:hover{border-color:rgba(15,118,110,.35);background:rgba(15,118,110,.05)}
8112
+ .int-btn:focus-visible{outline:2px solid var(--in-accent);outline-offset:2px}
8113
+ .int-btn.primary{background:var(--in-accent);border-color:var(--in-accent);color:#fff}
8114
+ .int-btn:disabled{opacity:.55;cursor:default}
8115
+ .int-box{padding:14px;border:1px solid var(--in-line);border-radius:14px;background:linear-gradient(160deg,var(--in-panel),var(--in-soft));display:flex;flex-direction:column;gap:8px;min-width:0}
8116
+ .int-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
8117
+ .int-dot{width:8px;height:8px;border-radius:999px;background:#9f1239;display:inline-block;margin-right:6px}
8118
+ .int-dot.on{background:#0f766e}
8119
+ .int-code{font:11px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;color:var(--in-muted);word-break:break-all;background:var(--in-panel);border:1px solid var(--in-line);border-radius:8px;padding:8px}
8120
+ .int-error{padding:8px 10px;border:1px solid rgba(159,18,57,.16);border-radius:9px;background:rgba(159,18,57,.06);color:#9f1239;font-size:12px;line-height:1.4}
8121
+ .int-empty{padding:18px;border:1px dashed var(--in-line);border-radius:12px;color:var(--in-muted);font-size:12px;line-height:1.5}
8122
+ @media(max-width:860px){.int-items{grid-template-columns:1fr}}
8123
+ @media(max-width:520px){.int-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.int-stat{padding:10px 12px}.int-stat b{font-size:20px}.int-stat span{font-size:9px;letter-spacing:.04em}}
8124
+ `;
8125
+
8126
+ async function call(operation, payload) {
8127
+ let signal;
8128
+ try { signal = AbortSignal.timeout(30000); } catch { signal = undefined; }
8129
+ const result = await window.__DSH_INTEGRATIONS_CTX__.connection.rpc.call("/api", `dsh-integrations/${operation}`, payload ?? {}, signal);
8130
+ if (!result || result.ok !== true) throw new Error(result?.error?.message || "Ошибка RPC");
8131
+ return result.value;
8132
+ }
8133
+
8134
+ function IntegrationsSection(props) {
8135
+ const [state, setState] = useState({ loading: true, error: "", data: null });
8136
+ const [busy, setBusy] = useState("");
8137
+ const [notice, setNotice] = useState("");
8138
+ const useSessions = props && props.useSessions;
8139
+ const useWorkspaces = props && props.useWorkspaces;
8140
+ const workspaces = useWorkspaces ? useWorkspaces((snapshot) => snapshot) : undefined;
8141
+ const items = Array.isArray(workspaces?.items) ? workspaces.items : [];
8142
+ const cwd = typeof items[0]?.path === "string" ? items[0].path : undefined;
8143
+
8144
+ const load = async () => {
8145
+ try {
8146
+ const data = await call("status", { cwd });
8147
+ setState({ loading: false, error: "", data });
8148
+ } catch (error) {
8149
+ setState({ loading: false, error: error instanceof Error ? error.message : String(error), data: null });
8150
+ }
8151
+ };
8152
+
8153
+ useEffect(() => { void load(); }, [cwd]);
8154
+
8155
+ const act = async (name, payload, okText) => {
8156
+ setBusy(name);
8157
+ setNotice("");
8158
+ try {
8159
+ await call(name, { ...payload, cwd });
8160
+ setNotice(okText);
8161
+ await load();
8162
+ } catch (error) {
8163
+ setState((current) => ({ ...current, error: error instanceof Error ? error.message : String(error) }));
8164
+ } finally {
8165
+ setBusy("");
8166
+ }
8167
+ };
8168
+
8169
+ const catalog = state.data?.catalog ?? [];
8170
+ const bridge = state.data?.bridge ?? { running: false };
8171
+ const sandbox = state.data?.sandbox ?? { enforcement: false };
8172
+ const installed = catalog.filter((entry) => entry.installed).length;
8173
+ return h("section", { className: "int-root", "aria-label": "Интеграции" },
8174
+ h("div", { className: "int-head" },
8175
+ h("div", null,
8176
+ h("p", { className: "int-eyebrow" }, "Integrations · marketplace, IDE, sandbox"),
8177
+ h("h2", { className: "int-title" }, "Интеграции"),
8178
+ h("p", { className: "int-sub" }, "Локальный marketplace с checksum и backup, localhost IDE bridge и честный sandbox-аудит. Marketplace не тянет произвольный URL: только локальный каталог."),
8179
+ ),
8180
+ h("button", { className: "int-btn", type: "button", onClick: () => void load(), disabled: state.loading }, "Обновить"),
8181
+ ),
8182
+ state.error ? h("div", { className: "int-error", role: "alert" }, state.error) : null,
8183
+ notice ? h("div", { className: "int-hint", role: "status" }, notice) : null,
8184
+ h("div", { className: "int-stats" },
8185
+ h("div", { className: "int-stat" }, h("b", null, catalog.length), h("span", null, "в каталоге")),
8186
+ h("div", { className: "int-stat" }, h("b", null, installed), h("span", null, "установлено")),
8187
+ h("div", { className: "int-stat" }, h("b", null, bridge.running ? "on" : "off"), h("span", null, "IDE bridge")),
8188
+ ),
8189
+ h("div", { className: "int-section" },
8190
+ h("h3", null, "Marketplace"),
8191
+ h("p", { className: "int-hint" }, "Каталог: ~/.dsh/marketplace/catalog.json или .dsh/marketplace.json. Поле sha256 проверяется; существующий навык уходит в backup."),
8192
+ catalog.length > 0 ? h("div", { className: "int-items" }, catalog.map((entry) => h("article", { className: "int-item", key: entry.id },
8193
+ h("div", { className: "int-item-top" }, h("code", { title: entry.id }, entry.name), h("span", null, entry.installed ? "installed" : entry.version)),
8194
+ h("p", null, entry.description || entry.id),
8195
+ h("div", { className: "int-row" },
8196
+ h("span", { className: "int-hint" }, entry.scope),
8197
+ h("button", { className: "int-btn", type: "button", disabled: busy === `install:${entry.id}` || entry.installed, onClick: () => void act("install", { id: entry.id }, `Установлен ${entry.id}`) }, entry.installed ? "Уже установлен" : busy === `install:${entry.id}` ? "Устанавливаем…" : "Установить"),
8198
+ ),
8199
+ ))) : h("div", { className: "int-empty" }, "Каталог пуст. Добавьте записи в ~/.dsh/marketplace/catalog.json: id, source (локальная папка), sha256, version."),
8200
+ ),
8201
+ h("div", { className: "int-section" },
8202
+ h("h3", null, "IDE bridge"),
8203
+ h("p", { className: "int-hint" }, "Localhost JSON API для будущего расширения редактора. Это протокол, не само расширение."),
8204
+ h("div", { className: "int-box" },
8205
+ h("div", { className: "int-row" },
8206
+ h("span", null, h("i", { className: `int-dot${bridge.running ? " on" : ""}` }), bridge.running ? "Работает" : "Остановлен"),
8207
+ h("div", { className: "int-row" },
8208
+ bridge.running ? h("button", { className: "int-btn", type: "button", onClick: () => void act("bridge-stop", {}, "Bridge остановлен") }, "Остановить") : h("button", { className: "int-btn primary", type: "button", disabled: busy === "bridge-start", onClick: () => void act("bridge-start", {}, "Bridge запущен") }, busy === "bridge-start" ? "Запускаем…" : "Запустить"),
8209
+ ),
8210
+ ),
8211
+ bridge.running ? h(React.Fragment, null,
8212
+ h("div", { className: "int-code" }, `${bridge.url}/health?token=${bridge.token}`),
8213
+ h("p", { className: "int-hint" }, "Токен живёт до остановки. Эндпоинты: /health, /context."),
8214
+ ) : h("p", { className: "int-hint" }, "Слушает только 127.0.0.1 и требует bearer-токен."),
8215
+ ),
8216
+ ),
8217
+ h("div", { className: "int-section" },
8218
+ h("h3", null, "Sandbox"),
8219
+ h("p", { className: "int-hint" }, sandbox.note || "Политика DSH и kit guardrails; OS-level enforcement требует DSH core."),
8220
+ h("div", { className: "int-box" }, h("div", { className: "int-row" }, h("span", null, sandbox.enforcement ? "OS enforcement" : "Policy audit"), h("span", { className: "int-ok" }, "без иллюзий"))),
8221
+ ),
8222
+ h("p", { className: "int-hint" }, state.data?.project ? `Проект: ${state.data.project}` : "Проект определяется по рабочей папке."),
8223
+ );
8224
+ }
8225
+
8226
+ function apply(ctx) {
8227
+ window.__DSH_INTEGRATIONS_CTX__ = ctx;
8228
+ ctx.effect(() => {
8229
+ const style = document.createElement("style");
8230
+ style.id = "dsh-integrations";
8231
+ style.textContent = CSS;
8232
+ document.head.appendChild(style);
8233
+ return () => style.remove();
8234
+ }, "integrations: styles");
8235
+ ctx.effect(() => ctx.slots.inject("settings.section", () => ctx.slots.register({
8236
+ name: "settings.section",
8237
+ id: "dsh-integrations",
8238
+ order: 36,
8239
+ label: () => "Интеграции",
8240
+ }, IntegrationsSection)), "integrations: settings");
8241
+ }
8242
+
8243
+ exports.apply = apply;
8244
+ exports.inject = ["slots", "connection"];
8245
+ return module.exports;
8246
+ })());
8247
+
8248
+ const __partNames = ["dsh-gkb-ru-ui","dsh-token-lab","dsh-peak-guard","dsh-session-move","dsh-profile-transfer","dsh-memory-bridge","dsh-mcp-manager","dsh-agent-extensions","dsh-guardrails","dsh-integrations"];
8082
8249
  const __kitErrors = [];
8083
8250
  const __pushKitError = (label, error) => {
8084
8251
  const message = String(error && error.message ? error.message : error);
@@ -8086,7 +8253,7 @@ var(--dsw-alias-bg-layer-1,#fff);box-shadow:inset 0 1px 0 color-mix(in srgb,#fff
8086
8253
  if (__kitErrors.length <= 5) console.error("[dsh-desktop-kit] registration failed:", label, message);
8087
8254
  };
8088
8255
  try {
8089
- window.__DSH_DESKTOP_KIT__ = { version: "2.15.11", parts: __partNames, errors: __kitErrors, ready: false };
8256
+ window.__DSH_DESKTOP_KIT__ = { version: "2.16.1", parts: __partNames, errors: __kitErrors, ready: false };
8090
8257
  } catch {}
8091
8258
  const __inject = [];
8092
8259
  for (const __part of __parts) {
@@ -0,0 +1,50 @@
1
+ # Интеграции: marketplace, IDE bridge, sandbox
2
+
3
+ ## Marketplace
4
+
5
+ Локальный каталог:
6
+
7
+ ```json
8
+ // ~/.dsh/marketplace/catalog.json
9
+ {
10
+ "entries": [
11
+ {
12
+ "id": "security-review",
13
+ "name": "Security Review",
14
+ "version": "1.2.0",
15
+ "description": "OWASP-минимум и проверка секретов",
16
+ "source": "C:/skills/security-review",
17
+ "sha256": "<sha256 SKILL.md>"
18
+ }
19
+ ]
20
+ }
21
+ ```
22
+
23
+ Установка:
24
+
25
+ 1. проверяется `sha256` файла `SKILL.md`;
26
+ 2. существующий `~/.dsh/skills/<id>` копируется в backup;
27
+ 3. папка копируется в `~/.dsh/skills/<id>`.
28
+
29
+ Нет загрузки по URL, нет исполнения install-скриптов.
30
+
31
+ ## IDE bridge
32
+
33
+ Запуск: Settings → Интеграции → **Запустить**.
34
+
35
+ ```text
36
+ GET http://127.0.0.1:<port>/health?token=<token>
37
+ GET http://127.0.0.1:<port>/context?token=<token>
38
+ ```
39
+
40
+ Токен одноразовый на запуск, живёт до остановки. Расширение редактора — отдельный deliverable.
41
+
42
+ ## Sandbox
43
+
44
+ `integration_status` возвращает:
45
+
46
+ - `sandbox.enforcement: false`;
47
+ - причину: policy ≠ OS sandbox;
48
+ - какие механизмы реально есть: DSH permission presets + kit guardrails.
49
+
50
+ OS-level sandbox требует изменений в DSH core (Windows Job Objects/AppContainer) или нативного helper. Пакет этого не имитирует.
@@ -0,0 +1,21 @@
1
+ # DSH Desktop Kit 2.16.0 — тест
2
+
3
+ Дата: 2026-11-12.
4
+
5
+ ## dsh-integrations
6
+
7
+ - Marketplace: локальный каталог, SHA-256, backup, установка навыка.
8
+ - IDE bridge: localhost HTTP, bearer, `/health`, `/context`.
9
+ - Sandbox: `enforcement:false` + объяснение.
10
+
11
+ ## UI
12
+
13
+ - Экран «Интеграции».
14
+ - 390/768/1440: overflow 0, console 0, markup 0.
15
+
16
+ ## Проверки
17
+
18
+ - `integrations-tests` — OK.
19
+ - `npm test` — exit 0.
20
+ - `build:client` / `check:client` — OK.
21
+ - Tarball включает `plugins/dsh-integrations` и скриншоты.
@@ -0,0 +1,16 @@
1
+ # DSH Desktop Kit 2.16.1 — тест
2
+
3
+ Дата: 2026-11-12.
4
+
5
+ ## Fix
6
+
7
+ - `/api/dsh-integrations/status|install|bridge-start|bridge-stop` 404.
8
+ - Причина: API регистрировался только через `ctx.inject(["connection"])`; хост-плагин мог не дойти до колбэка.
9
+ - Теперь: прямой `ctx.get("connection")` + fallback `inject`.
10
+ - Удалена необязательная `/integrations` команда, которая могла прервать inject.
11
+
12
+ ## Проверки
13
+
14
+ - `integrations-tests` — marketplace, bridge, fake mount routes — OK.
15
+ - `npm test` — exit 0.
16
+ - build/check — OK.
package/index.js CHANGED
@@ -39,6 +39,7 @@ import * as githubReview from "./plugins/dsh-github-review/index.js";
39
39
  import * as guardrails from "./plugins/dsh-guardrails/index.js";
40
40
  import * as agentExtensions from "./plugins/dsh-agent-extensions/index.js";
41
41
  import * as mcpManager from "./plugins/dsh-mcp-manager/index.js";
42
+ import * as integrations from "./plugins/dsh-integrations/index.js";
42
43
 
43
44
  const here = path.dirname(fileURLToPath(import.meta.url));
44
45
  const KIT_VERSION = (() => {
@@ -66,6 +67,7 @@ const parts = [
66
67
  ["dsh-guardrails", guardrails],
67
68
  ["dsh-agent-extensions", agentExtensions],
68
69
  ["dsh-mcp-manager", mcpManager],
70
+ ["dsh-integrations", integrations],
69
71
  ];
70
72
 
71
73
  /** The kit itself needs no service; each child declares its own. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-desktop-kit",
3
- "version": "2.15.11",
4
- "description": "DeepSeek Harness desktop kit 2.15.11: 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.",
3
+ "version": "2.16.1",
4
+ "description": "DeepSeek Harness desktop kit 2.16.1: 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",
@@ -82,7 +82,7 @@
82
82
  "build:client": "node tools/build-client.mjs",
83
83
  "build:skills": "node tools/build-skill-manifest.mjs",
84
84
  "check:client": "node tools/check-client.mjs client.js",
85
- "test": "node tools/smoke-tests.mjs && node tools/memory-tests.mjs && node tools/skills-sync-tests.mjs && node tools/kit-upgrade-tests.mjs && node plugins/dsh-profile-transfer/test/transfer.test.mjs && node --test plugins/dsh-memory-bridge/test/bridge.test.mjs plugins/dsh-memory-bridge/test/github.test.mjs plugins/dsh-memory-bridge/test/merge.test.mjs plugins/dsh-memory-bridge/test/user-specific.test.mjs && node tools/repo-map-tests.mjs && node tools/checkpoints-tests.mjs && node tools/plan-mode-tests.mjs && node tools/browser-qa-tests.mjs && node tools/ui-gate-tests.mjs && node tools/agent-extensions-tests.mjs && node tools/mcp-manager-tests.mjs && node tools/github-review-tests.mjs && node tools/instructions-tests.mjs && node tools/mcp-elicitation-tests.mjs && node tools/mcp-sampling-tests.mjs && node tools/mcp-oauth-tests.mjs && node tools/worktrees-tests.mjs && node tools/transcripts-tests.mjs && node tools/team-messages-tests.mjs && node tools/swarm-tests.mjs && node tools/team-presets-tests.mjs && node tools/team-board-tests.mjs && node tools/team-agents-tests.mjs && node tools/background-agents-tests.mjs && node tools/permissions-ui-tests.mjs && node plugins/dsh-guardrails/tools/guardrails-tests.mjs",
85
+ "test": "node tools/integrations-tests.mjs && node tools/smoke-tests.mjs && node tools/memory-tests.mjs && node tools/skills-sync-tests.mjs && node tools/kit-upgrade-tests.mjs && node plugins/dsh-profile-transfer/test/transfer.test.mjs && node --test plugins/dsh-memory-bridge/test/bridge.test.mjs plugins/dsh-memory-bridge/test/github.test.mjs plugins/dsh-memory-bridge/test/merge.test.mjs plugins/dsh-memory-bridge/test/user-specific.test.mjs && node tools/repo-map-tests.mjs && node tools/checkpoints-tests.mjs && node tools/plan-mode-tests.mjs && node tools/browser-qa-tests.mjs && node tools/ui-gate-tests.mjs && node tools/agent-extensions-tests.mjs && node tools/mcp-manager-tests.mjs && node tools/github-review-tests.mjs && node tools/instructions-tests.mjs && node tools/mcp-elicitation-tests.mjs && node tools/mcp-sampling-tests.mjs && node tools/mcp-oauth-tests.mjs && node tools/worktrees-tests.mjs && node tools/transcripts-tests.mjs && node tools/team-messages-tests.mjs && node tools/swarm-tests.mjs && node tools/team-presets-tests.mjs && node tools/team-board-tests.mjs && node tools/team-agents-tests.mjs && node tools/background-agents-tests.mjs && node tools/permissions-ui-tests.mjs && node plugins/dsh-guardrails/tools/guardrails-tests.mjs",
86
86
  "skills:cost": "node tools/skill-cost.mjs",
87
87
  "skills:check": "node tools/skill-cost.mjs --check",
88
88
  "release": "node tools/release.mjs"
@@ -0,0 +1,33 @@
1
+ # dsh-integrations
2
+
3
+ Три интеграционных слоя в одном плагине:
4
+
5
+ ## Marketplace (локальный)
6
+
7
+ - Каталог: `~/.dsh/marketplace/catalog.json` или `.dsh/marketplace.json`.
8
+ - Запись: `{ id, name, version, description, source, sha256 }`.
9
+ - `source` — **локальная папка** с `SKILL.md`.
10
+ - `sha256` проверяется до установки.
11
+ - Существующий навык уходит в `~/.dsh/.dsh-kit-backups/marketplace/`.
12
+ - Сеть не используется.
13
+
14
+ Это **не** удалённый реестр. Для публичного marketplace нужны подписи, trust и сервер — отдельный проект.
15
+
16
+ ## IDE bridge
17
+
18
+ - Локальный HTTP JSON API на `127.0.0.1`, случайный порт.
19
+ - Bearer-токен на каждый запуск.
20
+ - `/health` — живость.
21
+ - `/context` — проект, pid, время.
22
+ - Запуск/остановка из Settings → **Интеграции**.
23
+
24
+ Это протокол для будущего расширения VS Code/JetBrains; самого расширения в пакете нет.
25
+
26
+ ## Sandbox audit
27
+
28
+ Плагин **не** делает OS sandbox. Он показывает:
29
+
30
+ - DSH permission presets и kit guardrails — это политика;
31
+ - AppContainer/Job Objects требуют DSH core или нативного helper.
32
+
33
+ Честная маркировка важнее ложной кнопки «Sandbox».
@@ -0,0 +1,168 @@
1
+ window.__ModuleLoader__.load({
2
+ id: "dsh-integrations",
3
+ factory: (require) => {
4
+ var module = { exports: {} };
5
+ var exports = module.exports;
6
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
+ const React = require("react");
8
+ const h = React.createElement;
9
+ const { useEffect, useState } = React;
10
+
11
+ const CSS = `
12
+ .int-root{--in-line:var(--dsw-alias-border-l1,rgba(20,40,36,.13));--in-soft:var(--dsw-alias-bg-layer-1,#f4f7f5);--in-panel:var(--dsw-alias-bg-layer-2,#fff);--in-text:var(--dsw-alias-label-primary,#17231f);--in-muted:var(--dsw-alias-label-secondary,#61706b);--in-accent:var(--dsw-alias-brand-primary,#0f766e);display:flex;flex-direction:column;gap:20px;max-width:1040px;min-width:0;color:var(--in-text)}
13
+ .int-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;flex-wrap:wrap}
14
+ .int-eyebrow{margin:0 0 6px;font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--in-accent)}
15
+ .int-title{margin:0;font-size:clamp(24px,2.6vw,32px);line-height:1.12;letter-spacing:-.025em;font-weight:680}
16
+ .int-sub{margin:8px 0 0;max-width:68ch;color:var(--in-muted);font-size:14px;line-height:1.5}
17
+ .int-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
18
+ .int-stat{padding:14px 16px;border:1px solid var(--in-line);border-radius:14px;background:linear-gradient(150deg,var(--in-panel),var(--in-soft));min-width:0}
19
+ .int-stat b{display:block;font-size:24px;line-height:1.1;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
20
+ .int-stat span{display:block;margin-top:5px;color:var(--in-muted);font-size:11px;font-weight:650;letter-spacing:.08em;text-transform:uppercase}
21
+ .int-section{display:flex;flex-direction:column;gap:10px;min-width:0}
22
+ .int-section h3{margin:0;font-size:15px;letter-spacing:-.01em}
23
+ .int-hint{margin:0;color:var(--in-muted);font-size:12px;line-height:1.5}
24
+ .int-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-width:0}
25
+ .int-item{border:1px solid var(--in-line);border-radius:12px;background:var(--in-panel);padding:12px;min-width:0;display:flex;flex-direction:column;gap:6px}
26
+ .int-item-top{display:flex;justify-content:space-between;gap:8px;align-items:baseline;min-width:0}
27
+ .int-item-top code{font:inherit;font-weight:650;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
28
+ .int-item-top span{flex:none;font-size:9.5px;font-weight:750;letter-spacing:.06em;text-transform:uppercase;color:var(--in-muted)}
29
+ .int-item p{margin:0;color:var(--in-muted);font-size:11.5px;line-height:1.45;overflow-wrap:anywhere}
30
+ .int-ok{color:#0f766e}.int-bad{color:#9f1239}
31
+ .int-btn{font:inherit;font-size:11px;font-weight:650;border:1px solid var(--in-line);background:var(--in-panel);color:var(--in-text);border-radius:8px;padding:6px 9px;cursor:pointer;min-height:30px}
32
+ .int-btn:hover{border-color:rgba(15,118,110,.35);background:rgba(15,118,110,.05)}
33
+ .int-btn:focus-visible{outline:2px solid var(--in-accent);outline-offset:2px}
34
+ .int-btn.primary{background:var(--in-accent);border-color:var(--in-accent);color:#fff}
35
+ .int-btn:disabled{opacity:.55;cursor:default}
36
+ .int-box{padding:14px;border:1px solid var(--in-line);border-radius:14px;background:linear-gradient(160deg,var(--in-panel),var(--in-soft));display:flex;flex-direction:column;gap:8px;min-width:0}
37
+ .int-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
38
+ .int-dot{width:8px;height:8px;border-radius:999px;background:#9f1239;display:inline-block;margin-right:6px}
39
+ .int-dot.on{background:#0f766e}
40
+ .int-code{font:11px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;color:var(--in-muted);word-break:break-all;background:var(--in-panel);border:1px solid var(--in-line);border-radius:8px;padding:8px}
41
+ .int-error{padding:8px 10px;border:1px solid rgba(159,18,57,.16);border-radius:9px;background:rgba(159,18,57,.06);color:#9f1239;font-size:12px;line-height:1.4}
42
+ .int-empty{padding:18px;border:1px dashed var(--in-line);border-radius:12px;color:var(--in-muted);font-size:12px;line-height:1.5}
43
+ @media(max-width:860px){.int-items{grid-template-columns:1fr}}
44
+ @media(max-width:520px){.int-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.int-stat{padding:10px 12px}.int-stat b{font-size:20px}.int-stat span{font-size:9px;letter-spacing:.04em}}
45
+ `;
46
+
47
+ async function call(operation, payload) {
48
+ let signal;
49
+ try { signal = AbortSignal.timeout(30000); } catch { signal = undefined; }
50
+ const result = await window.__DSH_INTEGRATIONS_CTX__.connection.rpc.call("/api", `dsh-integrations/${operation}`, payload ?? {}, signal);
51
+ if (!result || result.ok !== true) throw new Error(result?.error?.message || "Ошибка RPC");
52
+ return result.value;
53
+ }
54
+
55
+ function IntegrationsSection(props) {
56
+ const [state, setState] = useState({ loading: true, error: "", data: null });
57
+ const [busy, setBusy] = useState("");
58
+ const [notice, setNotice] = useState("");
59
+ const useSessions = props && props.useSessions;
60
+ const useWorkspaces = props && props.useWorkspaces;
61
+ const workspaces = useWorkspaces ? useWorkspaces((snapshot) => snapshot) : undefined;
62
+ const items = Array.isArray(workspaces?.items) ? workspaces.items : [];
63
+ const cwd = typeof items[0]?.path === "string" ? items[0].path : undefined;
64
+
65
+ const load = async () => {
66
+ try {
67
+ const data = await call("status", { cwd });
68
+ setState({ loading: false, error: "", data });
69
+ } catch (error) {
70
+ setState({ loading: false, error: error instanceof Error ? error.message : String(error), data: null });
71
+ }
72
+ };
73
+
74
+ useEffect(() => { void load(); }, [cwd]);
75
+
76
+ const act = async (name, payload, okText) => {
77
+ setBusy(name);
78
+ setNotice("");
79
+ try {
80
+ await call(name, { ...payload, cwd });
81
+ setNotice(okText);
82
+ await load();
83
+ } catch (error) {
84
+ setState((current) => ({ ...current, error: error instanceof Error ? error.message : String(error) }));
85
+ } finally {
86
+ setBusy("");
87
+ }
88
+ };
89
+
90
+ const catalog = state.data?.catalog ?? [];
91
+ const bridge = state.data?.bridge ?? { running: false };
92
+ const sandbox = state.data?.sandbox ?? { enforcement: false };
93
+ const installed = catalog.filter((entry) => entry.installed).length;
94
+ return h("section", { className: "int-root", "aria-label": "Интеграции" },
95
+ h("div", { className: "int-head" },
96
+ h("div", null,
97
+ h("p", { className: "int-eyebrow" }, "Integrations · marketplace, IDE, sandbox"),
98
+ h("h2", { className: "int-title" }, "Интеграции"),
99
+ h("p", { className: "int-sub" }, "Локальный marketplace с checksum и backup, localhost IDE bridge и честный sandbox-аудит. Marketplace не тянет произвольный URL: только локальный каталог."),
100
+ ),
101
+ h("button", { className: "int-btn", type: "button", onClick: () => void load(), disabled: state.loading }, "Обновить"),
102
+ ),
103
+ state.error ? h("div", { className: "int-error", role: "alert" }, state.error) : null,
104
+ notice ? h("div", { className: "int-hint", role: "status" }, notice) : null,
105
+ h("div", { className: "int-stats" },
106
+ h("div", { className: "int-stat" }, h("b", null, catalog.length), h("span", null, "в каталоге")),
107
+ h("div", { className: "int-stat" }, h("b", null, installed), h("span", null, "установлено")),
108
+ h("div", { className: "int-stat" }, h("b", null, bridge.running ? "on" : "off"), h("span", null, "IDE bridge")),
109
+ ),
110
+ h("div", { className: "int-section" },
111
+ h("h3", null, "Marketplace"),
112
+ h("p", { className: "int-hint" }, "Каталог: ~/.dsh/marketplace/catalog.json или .dsh/marketplace.json. Поле sha256 проверяется; существующий навык уходит в backup."),
113
+ catalog.length > 0 ? h("div", { className: "int-items" }, catalog.map((entry) => h("article", { className: "int-item", key: entry.id },
114
+ h("div", { className: "int-item-top" }, h("code", { title: entry.id }, entry.name), h("span", null, entry.installed ? "installed" : entry.version)),
115
+ h("p", null, entry.description || entry.id),
116
+ h("div", { className: "int-row" },
117
+ h("span", { className: "int-hint" }, entry.scope),
118
+ h("button", { className: "int-btn", type: "button", disabled: busy === `install:${entry.id}` || entry.installed, onClick: () => void act("install", { id: entry.id }, `Установлен ${entry.id}`) }, entry.installed ? "Уже установлен" : busy === `install:${entry.id}` ? "Устанавливаем…" : "Установить"),
119
+ ),
120
+ ))) : h("div", { className: "int-empty" }, "Каталог пуст. Добавьте записи в ~/.dsh/marketplace/catalog.json: id, source (локальная папка), sha256, version."),
121
+ ),
122
+ h("div", { className: "int-section" },
123
+ h("h3", null, "IDE bridge"),
124
+ h("p", { className: "int-hint" }, "Localhost JSON API для будущего расширения редактора. Это протокол, не само расширение."),
125
+ h("div", { className: "int-box" },
126
+ h("div", { className: "int-row" },
127
+ h("span", null, h("i", { className: `int-dot${bridge.running ? " on" : ""}` }), bridge.running ? "Работает" : "Остановлен"),
128
+ h("div", { className: "int-row" },
129
+ bridge.running ? h("button", { className: "int-btn", type: "button", onClick: () => void act("bridge-stop", {}, "Bridge остановлен") }, "Остановить") : h("button", { className: "int-btn primary", type: "button", disabled: busy === "bridge-start", onClick: () => void act("bridge-start", {}, "Bridge запущен") }, busy === "bridge-start" ? "Запускаем…" : "Запустить"),
130
+ ),
131
+ ),
132
+ bridge.running ? h(React.Fragment, null,
133
+ h("div", { className: "int-code" }, `${bridge.url}/health?token=${bridge.token}`),
134
+ h("p", { className: "int-hint" }, "Токен живёт до остановки. Эндпоинты: /health, /context."),
135
+ ) : h("p", { className: "int-hint" }, "Слушает только 127.0.0.1 и требует bearer-токен."),
136
+ ),
137
+ ),
138
+ h("div", { className: "int-section" },
139
+ h("h3", null, "Sandbox"),
140
+ h("p", { className: "int-hint" }, sandbox.note || "Политика DSH и kit guardrails; OS-level enforcement требует DSH core."),
141
+ h("div", { className: "int-box" }, h("div", { className: "int-row" }, h("span", null, sandbox.enforcement ? "OS enforcement" : "Policy audit"), h("span", { className: "int-ok" }, "без иллюзий"))),
142
+ ),
143
+ h("p", { className: "int-hint" }, state.data?.project ? `Проект: ${state.data.project}` : "Проект определяется по рабочей папке."),
144
+ );
145
+ }
146
+
147
+ function apply(ctx) {
148
+ window.__DSH_INTEGRATIONS_CTX__ = ctx;
149
+ ctx.effect(() => {
150
+ const style = document.createElement("style");
151
+ style.id = "dsh-integrations";
152
+ style.textContent = CSS;
153
+ document.head.appendChild(style);
154
+ return () => style.remove();
155
+ }, "integrations: styles");
156
+ ctx.effect(() => ctx.slots.inject("settings.section", () => ctx.slots.register({
157
+ name: "settings.section",
158
+ id: "dsh-integrations",
159
+ order: 36,
160
+ label: () => "Интеграции",
161
+ }, IntegrationsSection)), "integrations: settings");
162
+ }
163
+
164
+ exports.apply = apply;
165
+ exports.inject = ["slots", "connection"];
166
+ return module.exports;
167
+ }
168
+ });
@@ -0,0 +1,63 @@
1
+ /**
2
+ * dsh-integrations: marketplace, IDE bridge, sandbox audit.
3
+ *
4
+ * Honest scope: the marketplace installs only local, checksummed skill
5
+ * directories; the bridge is a localhost protocol endpoint (an editor extension
6
+ * is a separate deliverable); sandbox is an audit of DSH policy, not OS-level
7
+ * enforcement.
8
+ */
9
+ import { inspectCatalog, installFromCatalog } from "./lib/catalog.js";
10
+ import { IdeBridge } from "./lib/bridge.js";
11
+ import { registerIntegrationApi } from "./lib/api.js";
12
+
13
+ export const inject = ["tools"];
14
+
15
+ function projectFrom(agent) {
16
+ return agent?.session?.header?.cwd ?? process.cwd();
17
+ }
18
+
19
+ function toolDefinition(ctx, bridge) {
20
+ return {
21
+ name: "integration_status",
22
+ description:
23
+ "Reports the local marketplace catalog, IDE bridge status, and sandbox policy audit. The marketplace installs only local checksummed skills; sandbox is policy audit, not OS enforcement.",
24
+ parameters: { type: "object", additionalProperties: false, properties: {} },
25
+ async execute(_input, exec) {
26
+ const root = projectFrom(exec?.agent);
27
+ const status = bridge.status();
28
+ return {
29
+ ok: true,
30
+ text: `integrations:\n- marketplace: ${inspectCatalog(root).length} entries\n- ide bridge: ${status.running ? status.url : "stopped"}\n- sandbox: policy audit only (no OS enforcement)`,
31
+ marketplace: inspectCatalog(root),
32
+ bridge: { running: status.running, url: status.url },
33
+ sandbox: { enforcement: false, note: "DSH permission presets + kit guardrails; OS sandbox requires DSH core/native helper" },
34
+ };
35
+ },
36
+ };
37
+ }
38
+
39
+ export function apply(ctx) {
40
+ const bridge = new IdeBridge();
41
+ ctx.effect(() => () => { void bridge.stop(); }, "integrations: cleanup");
42
+ try {
43
+ ctx.effect(() => ctx.tools.register(toolDefinition(ctx, bridge)), "integrations: status tool");
44
+ } catch (error) {
45
+ ctx.logger?.warn?.(`[integrations] tool registration failed: ${error instanceof Error ? error.message : String(error)}`);
46
+ }
47
+ try {
48
+ registerIntegrationApi(ctx, bridge);
49
+ } catch (error) {
50
+ ctx.logger?.warn?.(`[integrations] direct api registration failed, retrying with connection injection: ${error instanceof Error ? error.message : String(error)}`);
51
+ try {
52
+ ctx.inject(["connection"], (child) => {
53
+ try {
54
+ registerIntegrationApi(child, bridge);
55
+ } catch (cause) {
56
+ child.logger?.warn?.(`[integrations] api registration failed: ${cause instanceof Error ? cause.message : String(cause)}`);
57
+ }
58
+ });
59
+ } catch (cause) {
60
+ ctx.logger?.warn?.(`[integrations] api skipped: ${cause instanceof Error ? cause.message : String(cause)}`);
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,53 @@
1
+ import { inspectCatalog, installFromCatalog } from "./catalog.js";
2
+
3
+ export const RPC_NAMESPACE = "dsh-integrations";
4
+ const ROUTE_BASE = "/api/dsh-integrations";
5
+
6
+ function ok(rpcId, value) {
7
+ return Response.json({ type: "server-response", rpcId, result: { ok: true, value } });
8
+ }
9
+
10
+ function fail(rpcId, message) {
11
+ return Response.json({ type: "server-response", rpcId, result: { ok: false, error: { code: "integrations/bad-request", message, details: {} } } });
12
+ }
13
+
14
+ async function envelope(request) {
15
+ const body = await request.json();
16
+ if (!body || body.type !== "client-request" || typeof body.rpcId !== "string" || typeof body.method !== "string") throw new Error("bad Connection envelope");
17
+ return { rpcId: body.rpcId, method: body.method, payload: body.payload ?? {} };
18
+ }
19
+
20
+ export function registerIntegrationApi(ctx, bridge) {
21
+ const connection = ctx.connection ?? ctx.get?.("connection");
22
+ if (!connection?.rpc?.register) throw new Error("connection service is unavailable");
23
+ const projectRoot = (payload) => payload?.cwd || ctx.get?.("sessions")?.list?.().at(-1)?.header?.cwd || process.cwd();
24
+ const sandbox = () => ({
25
+ enforcement: false,
26
+ note: "DSH permission presets and kit guardrails are policy, not an OS sandbox. AppContainer/Job Objects require DSH core or a native helper.",
27
+ });
28
+
29
+ const operation = (name, handler) => ({
30
+ path: `${ROUTE_BASE}/${name}`,
31
+ methods: ["POST"],
32
+ requestBody: "buffered",
33
+ fetch: async (request) => {
34
+ let rpcId = "invalid-request";
35
+ try {
36
+ const value = await envelope(request);
37
+ rpcId = value.rpcId;
38
+ if (value.method !== `${RPC_NAMESPACE}/${name}`) throw new Error("endpoint/method mismatch");
39
+ return ok(rpcId, await handler(value.payload ?? {}, projectRoot(value.payload)));
40
+ } catch (error) {
41
+ return fail(rpcId, error instanceof Error ? error.message : String(error));
42
+ }
43
+ },
44
+ });
45
+
46
+ const routes = [
47
+ operation("status", (payload, root) => ({ catalog: inspectCatalog(root), bridge: bridge.status(), sandbox: sandbox(), project: root })),
48
+ operation("install", (payload, root) => installFromCatalog(root, payload.id)),
49
+ operation("bridge-start", async (payload, root) => bridge.start(async () => ({ project: root, pid: process.pid, time: new Date().toISOString() }))),
50
+ operation("bridge-stop", () => bridge.stop()),
51
+ ];
52
+ return routes.map((route) => connection.rpc.register(route));
53
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * IDE bridge: a localhost-only JSON endpoint an editor extension can poll.
3
+ *
4
+ * It is deliberately a protocol bridge, not an editor extension. The token is
5
+ * generated per start, never logged, and every request must present it.
6
+ */
7
+ import crypto from "node:crypto";
8
+ import http from "node:http";
9
+
10
+ export class IdeBridge {
11
+ constructor() {
12
+ this.server = null;
13
+ this.token = "";
14
+ this.port = 0;
15
+ this.startedAt = null;
16
+ }
17
+
18
+ async start(handler) {
19
+ if (this.server) return this.status();
20
+ this.token = crypto.randomBytes(24).toString("hex");
21
+ this.server = http.createServer(async (request, response) => {
22
+ const url = new URL(request.url ?? "/", "http://127.0.0.1");
23
+ if (url.searchParams.get("token") !== this.token && request.headers.authorization !== `Bearer ${this.token}`) {
24
+ response.writeHead(401, { "content-type": "application/json" });
25
+ response.end(JSON.stringify({ error: "unauthorized" }));
26
+ return;
27
+ }
28
+ try {
29
+ if (request.method !== "GET") throw Object.assign(new Error("method not allowed"), { status: 405 });
30
+ if (url.pathname === "/health") {
31
+ response.writeHead(200, { "content-type": "application/json" });
32
+ response.end(JSON.stringify({ ok: true, service: "dsh-ide-bridge", version: "1.0.0" }));
33
+ return;
34
+ }
35
+ if (url.pathname === "/context") {
36
+ const value = await handler?.();
37
+ response.writeHead(200, { "content-type": "application/json" });
38
+ response.end(JSON.stringify(value ?? {}));
39
+ return;
40
+ }
41
+ response.writeHead(404, { "content-type": "application/json" });
42
+ response.end(JSON.stringify({ error: "not found" }));
43
+ } catch (error) {
44
+ response.writeHead(error?.status ?? 500, { "content-type": "application/json" });
45
+ response.end(JSON.stringify({ error: error instanceof Error ? error.message : String(error) }));
46
+ }
47
+ });
48
+ await new Promise((resolve, reject) => {
49
+ this.server.once("error", reject);
50
+ this.server.listen(0, "127.0.0.1", resolve);
51
+ });
52
+ this.port = this.server.address().port;
53
+ this.startedAt = new Date().toISOString();
54
+ return this.status();
55
+ }
56
+
57
+ status() {
58
+ return {
59
+ running: Boolean(this.server),
60
+ port: this.port,
61
+ url: this.server ? `http://127.0.0.1:${this.port}` : "",
62
+ token: this.server ? this.token : "",
63
+ startedAt: this.startedAt,
64
+ };
65
+ }
66
+
67
+ async stop() {
68
+ if (!this.server) return { running: false };
69
+ await new Promise((resolve) => this.server.close(resolve));
70
+ this.server = null;
71
+ this.port = 0;
72
+ this.token = "";
73
+ this.startedAt = null;
74
+ return { running: false };
75
+ }
76
+ }
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Local marketplace catalog.
3
+ *
4
+ * This is intentionally not a remote registry: entries point at a local skill
5
+ * directory and carry an optional SHA-256 of SKILL.md. Install verifies the
6
+ * digest, backs up an existing skill, then copies the directory. No network.
7
+ */
8
+ import crypto from "node:crypto";
9
+ import fs from "node:fs";
10
+ import os from "node:os";
11
+ import path from "node:path";
12
+
13
+ export function marketplaceHome() {
14
+ return path.join(dshHome(), "marketplace");
15
+ }
16
+
17
+ function dshHome() {
18
+ return process.env.DSH_HOME ? path.resolve(process.env.DSH_HOME) : path.join(os.homedir(), ".dsh");
19
+ }
20
+
21
+ export function catalogPath(scope = "global", projectRoot = "") {
22
+ return scope === "project" && projectRoot
23
+ ? path.join(projectRoot, ".dsh", "marketplace.json")
24
+ : path.join(marketplaceHome(), "catalog.json");
25
+ }
26
+
27
+ function readEntries(file, scope) {
28
+ try {
29
+ const parsed = JSON.parse(fs.readFileSync(file, "utf8"));
30
+ const entries = Array.isArray(parsed) ? parsed : parsed.entries;
31
+ return (Array.isArray(entries) ? entries : [])
32
+ .filter((entry) => entry && typeof entry.id === "string" && typeof entry.source === "string")
33
+ .map((entry) => ({ ...entry, scope }));
34
+ } catch {
35
+ return [];
36
+ }
37
+ }
38
+
39
+ export function loadCatalog(projectRoot = "") {
40
+ const entries = [
41
+ ...readEntries(catalogPath("global"), "global"),
42
+ ...(projectRoot ? readEntries(catalogPath("project", projectRoot), "project") : []),
43
+ ];
44
+ const seen = new Set();
45
+ return entries.filter((entry) => (seen.has(entry.id) ? false : (seen.add(entry.id), true)));
46
+ }
47
+
48
+ function sha256(file) {
49
+ return crypto.createHash("sha256").update(fs.readFileSync(file)).digest("hex");
50
+ }
51
+
52
+ export function inspectCatalog(projectRoot = "") {
53
+ return loadCatalog(projectRoot).map((entry) => {
54
+ const target = path.join(dshHome(), "skills", entry.id);
55
+ return {
56
+ id: entry.id,
57
+ name: entry.name || entry.id,
58
+ version: entry.version || "0.0.0",
59
+ description: entry.description || "",
60
+ scope: entry.scope,
61
+ source: entry.source,
62
+ installed: fs.existsSync(path.join(target, "SKILL.md")),
63
+ };
64
+ });
65
+ }
66
+
67
+ export function installFromCatalog(projectRoot, id) {
68
+ const entry = loadCatalog(projectRoot).find((item) => item.id === String(id));
69
+ if (!entry) throw new Error(`marketplace: entry not found: ${id}`);
70
+ const source = path.resolve(entry.source);
71
+ const skillFile = path.join(source, "SKILL.md");
72
+ if (!fs.existsSync(skillFile)) throw new Error(`marketplace: source has no SKILL.md: ${source}`);
73
+ if (entry.sha256) {
74
+ const actual = sha256(skillFile);
75
+ if (actual !== String(entry.sha256).toLowerCase()) throw new Error("marketplace: SHA-256 mismatch; refusing to install");
76
+ }
77
+ const target = path.join(dshHome(), "skills", entry.id);
78
+ let backup = "";
79
+ if (fs.existsSync(target)) {
80
+ backup = path.join(dshHome(), ".dsh-kit-backups", "marketplace", `${entry.id}-${Date.now()}`);
81
+ fs.mkdirSync(path.dirname(backup), { recursive: true });
82
+ fs.cpSync(target, backup, { recursive: true });
83
+ }
84
+ fs.mkdirSync(path.dirname(target), { recursive: true });
85
+ fs.cpSync(source, target, { recursive: true });
86
+ return { id: entry.id, target, backup, version: entry.version || "0.0.0" };
87
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "dsh-integrations",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "description": "Marketplace, IDE bridge and sandbox audit for DSH Desktop Kit",
7
+ "exports": {
8
+ ".": "./index.js",
9
+ "./client": "./client.js"
10
+ }
11
+ }
@@ -121,6 +121,77 @@ class HttpTransport {
121
121
  this.config = config;
122
122
  this.sessionId = "";
123
123
  this.pending = new Map();
124
+ this.requestHandler = null;
125
+ }
126
+
127
+ setRequestHandler(handler) {
128
+ this.requestHandler = handler;
129
+ }
130
+
131
+ async respond(id, payload) {
132
+ const token = typeof this.config.tokenProvider === "function" ? await this.config.tokenProvider() : "";
133
+ await fetch(this.config.url, {
134
+ method: "POST",
135
+ headers: {
136
+ "content-type": "application/json",
137
+ accept: "application/json, text/event-stream",
138
+ ...(this.sessionId ? { "mcp-session-id": this.sessionId } : {}),
139
+ ...(token ? { authorization: `Bearer ${token}` } : {}),
140
+ ...this.config.headers,
141
+ },
142
+ body: JSON.stringify({ jsonrpc: "2.0", id, ...payload }),
143
+ }).catch(() => {});
144
+ }
145
+
146
+ async handleServerRequest(message) {
147
+ try {
148
+ const handler = this.requestHandler;
149
+ const result = handler ? await handler(message) : await Promise.reject(Object.assign(new Error("method not supported"), { code: -32601 }));
150
+ await this.respond(message.id, { result: result ?? {} });
151
+ } catch (error) {
152
+ await this.respond(message.id, { error: { code: error?.code ?? -32603, message: error instanceof Error ? error.message : String(error) } });
153
+ }
154
+ }
155
+
156
+ async readSse(response) {
157
+ const reader = response.body.getReader();
158
+ const decoder = new TextDecoder();
159
+ let buffer = "";
160
+ const consume = async (event) => {
161
+ for (const line of event.split(/\r?\n/u)) {
162
+ if (!line.startsWith("data:")) continue;
163
+ const message = parseJsonRpc(line.slice(5).trim());
164
+ if (!message) continue;
165
+ if (message.method !== undefined && message.id !== undefined) {
166
+ void this.handleServerRequest(message);
167
+ continue;
168
+ }
169
+ if (message.id === undefined) continue;
170
+ if (message.error) throw new Error(message.error.message || "MCP error");
171
+ if (message.result !== undefined) return { found: true, value: message.result };
172
+ }
173
+ return { found: false };
174
+ };
175
+ while (true) {
176
+ const { done, value } = await reader.read();
177
+ if (done) break;
178
+ buffer += decoder.decode(value, { stream: true });
179
+ let boundary;
180
+ while ((boundary = buffer.search(/\r?\n\r?\n/u)) >= 0) {
181
+ const event = buffer.slice(0, boundary);
182
+ buffer = buffer.slice(boundary).replace(/^\r?\n\r?\n/u, "");
183
+ const result = await consume(event);
184
+ if (result.found) {
185
+ try { await reader.cancel(); } catch { /* best effort */ }
186
+ return result.value;
187
+ }
188
+ }
189
+ }
190
+ if (buffer.trim()) {
191
+ const result = await consume(buffer);
192
+ if (result.found) return result.value;
193
+ }
194
+ throw new Error("MCP HTTP: no JSON-RPC response in event stream");
124
195
  }
125
196
 
126
197
  async request(method, params, timeoutMs) {
@@ -143,21 +214,16 @@ class HttpTransport {
143
214
  const sessionId = response.headers.get("mcp-session-id");
144
215
  if (sessionId) this.sessionId = sessionId;
145
216
  if (!response.ok) throw new Error(`MCP HTTP ${response.status}: ${(await response.text()).slice(0, 500)}`);
217
+ const contentType = response.headers.get("content-type") || "";
218
+ if (contentType.includes("text/event-stream")) return await this.readSse(response);
146
219
  const text = await response.text();
147
220
  if (text.trim() === "") return undefined;
148
- const contentType = response.headers.get("content-type") || "";
149
- if (contentType.includes("text/event-stream")) {
150
- for (const line of text.split(/\r?\n/u)) {
151
- if (!line.startsWith("data:")) continue;
152
- const message = parseJsonRpc(line.slice(5).trim());
153
- if (!message || message.id === undefined) continue;
154
- if (message.error) throw new Error(message.error.message || "MCP error");
155
- if (message.result !== undefined) return message.result;
156
- }
157
- throw new Error("MCP HTTP: no JSON-RPC response in event stream");
158
- }
159
221
  const message = parseJsonRpc(text);
160
222
  if (!message) throw new Error("MCP HTTP: invalid JSON response");
223
+ if (message.method !== undefined && message.id !== undefined) {
224
+ void this.handleServerRequest(message);
225
+ throw new Error("MCP HTTP: server request without a tool result");
226
+ }
161
227
  if (message.error) throw new Error(message.error.message || "MCP error");
162
228
  return message.result;
163
229
  } finally {