dsh-desktop-kit 2.7.9 → 2.7.10

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.7.10 (2026-11-12)
4
+
5
+ - **Worktree hardening.** Managed worktrees всегда привязаны к главному worktree: запуск из вложенного worktree больше не создаёт nested `.dsh/worktrees`. Пути нормализуются, фильтрация идёт через `path.relative`.
6
+ - **Redaction фоновых запусков.** `task` и `result` в `.dsh/agents/runs.json` очищаются от `sk-*`, GitHub-токенов, Bearer и `password/token=...` до записи.
7
+ - **Корректные ошибки background.** Если старт фонового агента не удался, tool возвращает `ok:false`, а не успех с текстом ошибки.
8
+ - **Doctor.** Показывает real directory vs junction, stale `dsh-desktop-kit_tmp_*` (EPERM), отдельно `Dependency` и `Package`.
9
+ - **Тесты.** Worktree edge cases (bad slug/base, duplicate, linked worktree), redaction, cancel race.
10
+
3
11
  ## 2.7.9 (2026-11-12)
4
12
 
5
13
  - **Worktrees.** `project_worktree` (`list|create|remove`) создаёт `.dsh/worktrees/<slug>` на ветке `dsh/<slug>`, пишет путь в `.git/info/exclude`, отказывает в удалении грязного worktree без `force`.
package/README.md CHANGED
@@ -4,17 +4,17 @@
4
4
 
5
5
  Набор из **16 плагинов и 30 навыков** для DeepSeek Harness 0.2.x: русский интерфейс, автопилот навыков, токен-лаборатория, студия навыков, память проектов, обмен памятью между машинами (GitHub и USB), guardrails, карта репозитория, чекпоинты, plan mode, browser QA, GitHub review, Claude Code-подобные hooks/agents/commands, перенос чатов и резервные копии профиля.
6
6
 
7
- ![DSH Desktop Kit 2.7](https://unpkg.com/dsh-desktop-kit@2.7.9/docs/images/hero.png)
7
+ ![DSH Desktop Kit 2.7](https://unpkg.com/dsh-desktop-kit@2.7.10/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**: аргументы, запуск и копирование результата.
12
12
 
13
- ![MCP Settings](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-mcp-manager/screenshots/settings-1440.png)
13
+ ![MCP Settings](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-mcp-manager/screenshots/settings-1440.png)
14
14
 
15
- ![MCP на 390px](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-mcp-manager/screenshots/settings-390.png)
15
+ ![MCP на 390px](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-mcp-manager/screenshots/settings-390.png)
16
16
 
17
- ![Добавление MCP-сервера](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-mcp-manager/screenshots/modal-390.png)
17
+ ![Добавление MCP-сервера](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-mcp-manager/screenshots/modal-390.png)
18
18
 
19
19
  ## Права и субагенты
20
20
 
@@ -24,11 +24,11 @@
24
24
  - **`.dsh/`** создаётся автоматически: agents, commands, rules, hooks, verify, mcp, PROJECT.md.
25
25
  - **Worktrees и фоновые агенты.** `project_worktree` создаёт ветку `dsh/<slug>` и отдельную папку `.dsh/worktrees/<slug>`; `project_agent ... worktree=auto background=true` запускает агента в изоляции, а страница **Агенты** показывает worktrees и очередь запусков с кнопкой «Остановить».
26
26
 
27
- ![Агенты проекта](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-agent-extensions/screenshots/agents-1440.png)
27
+ ![Агенты проекта](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-agent-extensions/screenshots/agents-1440.png)
28
28
 
29
- ![Права и ограничения](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-guardrails/screenshots/permissions-1440.png)
29
+ ![Права и ограничения](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-guardrails/screenshots/permissions-1440.png)
30
30
 
31
- **v2.7.9** · MIT · проверено на DSH `0.2.1-rc.5` и `0.2.2-rc.1` (Windows 11) · без внешних зависимостей и телеметрии
31
+ **v2.7.10** · MIT · проверено на DSH `0.2.1-rc.5` и `0.2.2-rc.1` (Windows 11) · без внешних зависимостей и телеметрии
32
32
 
33
33
  **План развития:** [docs/ROADMAP-3.0.md](docs/ROADMAP-3.0.md) — Memory Fabric, семантическое
34
34
  слияние, локальный индекс памяти, шифрованные переносы, Memory Hub и npm trusted publishing.
@@ -116,27 +116,27 @@
116
116
  - перед каждой синхронизацией проверяется, что репозиторий всё ещё приватный;
117
117
  - секреты и PII вычищаются, домашние пути заменяются токеном `%DSH_HOME%`; LLM не вызывается — **0 токенов**.
118
118
 
119
- ![Настройки памяти проектов](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-memory-bridge/docs/images/settings-light.png)
119
+ ![Настройки памяти проектов](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-memory-bridge/docs/images/settings-light.png)
120
120
 
121
- ![Конфликты досье](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-memory-bridge/docs/images/conflicts.png)
121
+ ![Конфликты досье](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-memory-bridge/docs/images/conflicts.png)
122
122
 
123
123
  ## Скриншоты
124
124
 
125
125
  ### Skills Studio: каталог, стоимость и редактор
126
126
 
127
- ![Каталог навыков](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-gkb-ru-ui/screenshots/02-skills-1440-light.png)
127
+ ![Каталог навыков](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-gkb-ru-ui/screenshots/02-skills-1440-light.png)
128
128
 
129
- ![Редактор навыка](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-gkb-ru-ui/screenshots/03-skills-editor-1440-light.png)
129
+ ![Редактор навыка](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-gkb-ru-ui/screenshots/03-skills-editor-1440-light.png)
130
130
 
131
131
  ### Token Lab: куда уходит контекст
132
132
 
133
- ![Токен-лаборатория](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-token-lab/screenshots/01-token-lab-1440-light.png)
133
+ ![Токен-лаборатория](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-token-lab/screenshots/01-token-lab-1440-light.png)
134
134
 
135
135
  ### Тёмная тема и мобильный
136
136
 
137
- ![Тёмная тема](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-gkb-ru-ui/screenshots/04-skills-1440-dark.png)
137
+ ![Тёмная тема](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-gkb-ru-ui/screenshots/04-skills-1440-dark.png)
138
138
 
139
- ![Каталог навыков на 390 px](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-gkb-ru-ui/screenshots/05-skills-390-light.png)
139
+ ![Каталог навыков на 390 px](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-gkb-ru-ui/screenshots/05-skills-390-light.png)
140
140
 
141
141
  ## Окно-напоминание: пиковый тариф
142
142
 
@@ -146,11 +146,11 @@ DeepSeek включает двойной тариф в пиковые часы (
146
146
  - **в окне** — красная карточка: причина, границы окна в местном времени и UTC, живой отсчёт до конца и рекомендация, когда вернуться;
147
147
  - **после окна** — карточка исчезает; состояние всегда доступно через `window.__DSH_PEAK_GUARD__.state()`.
148
148
 
149
- ![Окно-напоминание: светлая тема](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-peak-guard/screenshots/03-peak-card-1440-light.png)
149
+ ![Окно-напоминание: светлая тема](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-peak-guard/screenshots/03-peak-card-1440-light.png)
150
150
 
151
- ![Окно-напоминание: тёмная тема](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-peak-guard/screenshots/04-peak-card-1440-dark.png)
151
+ ![Окно-напоминание: тёмная тема](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-peak-guard/screenshots/04-peak-card-1440-dark.png)
152
152
 
153
- ![Окно-напоминание на 390 px](https://unpkg.com/dsh-desktop-kit@2.7.9/plugins/dsh-peak-guard/screenshots/05-peak-card-390-light.png)
153
+ ![Окно-напоминание на 390 px](https://unpkg.com/dsh-desktop-kit@2.7.10/plugins/dsh-peak-guard/screenshots/05-peak-card-390-light.png)
154
154
 
155
155
  Подробности и настройки — [plugins/dsh-peak-guard/README.md](plugins/dsh-peak-guard/README.md).
156
156
 
package/client.js CHANGED
@@ -7828,7 +7828,7 @@ var(--dsw-alias-bg-layer-1,#fff);box-shadow:inset 0 1px 0 color-mix(in srgb,#fff
7828
7828
  if (__kitErrors.length <= 5) console.error("[dsh-desktop-kit] registration failed:", label, message);
7829
7829
  };
7830
7830
  try {
7831
- window.__DSH_DESKTOP_KIT__ = { version: "2.7.9", parts: __partNames, errors: __kitErrors, ready: false };
7831
+ window.__DSH_DESKTOP_KIT__ = { version: "2.7.10", parts: __partNames, errors: __kitErrors, ready: false };
7832
7832
  } catch {}
7833
7833
  const __inject = [];
7834
7834
  for (const __part of __parts) {
@@ -0,0 +1,29 @@
1
+ # DSH Desktop Kit 2.7.10 — тест
2
+
3
+ Дата: 2026-11-12.
4
+
5
+ ## Hardening worktrees
6
+
7
+ - `repoRoot()` берёт главный worktree из `git worktree list --porcelain`; запуск из linked worktree создаёт worktree в главном repo.
8
+ - `gitRoot` и пути нормализуются через `path.resolve`; фильтрация — `path.relative`, без ложных prefix-совпадений.
9
+ - Тесты: bad slug, missing base, duplicate, linked-worktree anchor.
10
+
11
+ ## Redaction
12
+
13
+ - `runs.json` не хранит `sk-*`, GitHub-токены, Bearer и `password/token=...`; заменяются на `[redacted]` до clip.
14
+ - Тест: task с секретом не содержит исходного значения.
15
+
16
+ ## Background errors
17
+
18
+ - Старт с ошибкой возвращает `ok:false` (tool), запись run получает `failed`.
19
+
20
+ ## Doctor
21
+
22
+ - `Dependency` / `Package` разделены.
23
+ - Junction показывается как development link.
24
+ - Stale `dsh-desktop-kit_tmp_*` обнаруживается и увеличивает issue count.
25
+
26
+ ## Прогон
27
+
28
+ - `worktrees-tests`, `background-agents-tests`, `agent-extensions-tests`, `npm test` — OK.
29
+ - `build:client` / `check:client` — OK.
package/doctor.ps1 CHANGED
@@ -45,9 +45,9 @@ $issues = 0
45
45
  $dependency = $null
46
46
  if ($json.dependencies) { $dependency = $json.dependencies.'dsh-desktop-kit' }
47
47
  if ($dependency) {
48
- Write-Host "Package: $dependency" -ForegroundColor Green
48
+ Write-Host "Dependency: $dependency" -ForegroundColor Green
49
49
  } else {
50
- Write-Host "Package: not installed" -ForegroundColor Red
50
+ Write-Host "Dependency: not installed" -ForegroundColor Red
51
51
  $issues += 1
52
52
  }
53
53
 
@@ -62,14 +62,34 @@ if ($bundles -contains "dsh-desktop-kit") {
62
62
 
63
63
  $link = Join-Path $profileDir "node_modules\dsh-desktop-kit"
64
64
  if (Test-Path $link) {
65
- Write-Host "Link: $((Get-Item $link).Target)" -ForegroundColor Green
65
+ $item = Get-Item -Path $link -Force
66
+ if ($item.LinkType -eq "Junction" -or $item.LinkType -eq "SymbolicLink") {
67
+ Write-Host "Package: linked -> $($item.Target)" -ForegroundColor Yellow
68
+ Write-Host " development link; production installs use a real directory"
69
+ } else {
70
+ Write-Host "Package: real directory" -ForegroundColor Green
71
+ }
66
72
  $kitPackage = Join-Path $link "package.json"
67
73
  if (Test-Path $kitPackage) {
68
- $kit = Get-Content -Path $kitPackage -Raw | ConvertFrom-Json
69
- Write-Host "Kit: $($kit.version)" -ForegroundColor Green
74
+ try {
75
+ $kit = Get-Content -Path $kitPackage -Raw | ConvertFrom-Json
76
+ Write-Host "Kit: $($kit.version)" -ForegroundColor Green
77
+ } catch {
78
+ Write-Host "Kit: package.json is unreadable" -ForegroundColor Red
79
+ $issues += 1
80
+ }
81
+ } else {
82
+ Write-Host "Kit: package.json missing" -ForegroundColor Red
83
+ $issues += 1
84
+ }
85
+ $tmp = @(Get-ChildItem -Path (Join-Path $profileDir "node_modules") -Directory -Filter "dsh-desktop-kit_tmp_*" -ErrorAction SilentlyContinue)
86
+ if ($tmp.Count -gt 0) {
87
+ Write-Host "Stale: $($tmp.Count) dsh-desktop-kit_tmp_* folder(s); pnpm may fail with EPERM" -ForegroundColor Yellow
88
+ Write-Host " remove them, then re-run the install"
89
+ $issues += 1
70
90
  }
71
91
  } else {
72
- Write-Host "Link: missing (run install.ps1 again)" -ForegroundColor Red
92
+ Write-Host "Package: missing (run install.ps1 again)" -ForegroundColor Red
73
93
  $issues += 1
74
94
  }
75
95
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-desktop-kit",
3
- "version": "2.7.9",
3
+ "version": "2.7.10",
4
4
  "description": "DeepSeek Harness desktop kit 2.7: 16 plugins and 30 skills — self-applying skills, token lab, Skills Studio, project memory, GitHub and USB memory transfer, guardrails, repo map, checkpoints, plan mode, browser QA, GitHub review, Claude Code-like hooks/agents/commands, Russian UI, peak guard, chat move and profile transfer.",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -98,7 +98,10 @@ function toolDefinition(ctx) {
98
98
  worktree,
99
99
  cwd: worktree?.path,
100
100
  });
101
- if (result.background) return { ok: true, text: result.text, background: true, id: result.id, worktree };
101
+ if (result.background) {
102
+ if (result.error) return { ok: false, text: result.text, background: true, id: result.id };
103
+ return { ok: true, text: result.text, background: true, id: result.id, worktree };
104
+ }
102
105
  const suffix = worktree ? `\nworktree: ${worktree.branch} → ${worktree.path}` : "";
103
106
  return { ok: true, text: `project_agent ${name} (${result.stopReason}):\n${result.text}${suffix}`, worktree };
104
107
  } catch (error) {
@@ -9,13 +9,18 @@ import path from "node:path";
9
9
 
10
10
  const LIMIT = 100;
11
11
  const PREVIEW = 2_000;
12
+ const SECRET = /(?:sk-[A-Za-z0-9_-]{16,}|gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,}|Bearer\s+[A-Za-z0-9._~+/-]{10,}|(?:password|passwd|secret|token|api[_-]?key)\s*[:=]\s*[^\s,;]+)/giu;
13
+
14
+ export function redact(value) {
15
+ return String(value ?? "").replace(SECRET, "[redacted]");
16
+ }
12
17
 
13
18
  export function runsPath(projectRoot) {
14
19
  return path.join(projectRoot, ".dsh", "agents", "runs.json");
15
20
  }
16
21
 
17
22
  function clip(value, max = PREVIEW) {
18
- const text = String(value ?? "");
23
+ const text = redact(value);
19
24
  return text.length <= max ? text : `${text.slice(0, max - 1)}…`;
20
25
  }
21
26
 
@@ -29,7 +29,18 @@ export function gitRoot(cwd) {
29
29
  if (!cwd) throw new Error("worktree: cwd is required");
30
30
  const root = tryRun(cwd, ["rev-parse", "--show-toplevel"]);
31
31
  if (!root) throw new Error(`worktree: not a git repository (${cwd})`);
32
- return root;
32
+ return path.resolve(root);
33
+ }
34
+
35
+ /**
36
+ * Always anchor managed worktrees to the main worktree. Running from a linked
37
+ * worktree must not create nested `.dsh/worktrees` inside it.
38
+ */
39
+ export function repoRoot(cwd) {
40
+ const current = gitRoot(cwd);
41
+ const porcelain = tryRun(current, ["worktree", "list", "--porcelain"]) ?? "";
42
+ const first = porcelain.split(/\r?\n/u).find((line) => line.startsWith("worktree "));
43
+ return first ? path.resolve(first.slice("worktree ".length)) : current;
33
44
  }
34
45
 
35
46
  export function validateSlug(value) {
@@ -56,7 +67,7 @@ function ensureExcluded(repo) {
56
67
  }
57
68
 
58
69
  export function listWorktrees({ cwd }) {
59
- const repo = gitRoot(cwd);
70
+ const repo = repoRoot(cwd);
60
71
  const output = run(repo, ["worktree", "list", "--porcelain"]);
61
72
  const records = [];
62
73
  let current = {};
@@ -76,14 +87,19 @@ export function listWorktrees({ cwd }) {
76
87
  }
77
88
  if (current.path) records.push(current);
78
89
  const root = worktreesRoot(repo);
90
+ const insideManaged = (value) => {
91
+ const relative = path.relative(root, path.resolve(value));
92
+ return relative !== "" && !relative.startsWith("..") && !path.isAbsolute(relative);
93
+ };
79
94
  return records
80
- .filter((record) => record.path === repo || record.path.startsWith(`${root}${path.sep}`) || record.branch?.startsWith("dsh/"))
95
+ .filter((record) => path.resolve(record.path) === path.resolve(repo) || insideManaged(record.path) || record.branch?.startsWith("dsh/"))
81
96
  .map((record) => {
82
- const isMain = path.resolve(record.path) === path.resolve(repo);
83
- const dirty = isMain ? null : (tryRun(record.path, ["status", "--porcelain"]) ?? "").length > 0;
97
+ const recordPath = path.resolve(record.path);
98
+ const isMain = recordPath === path.resolve(repo);
99
+ const dirty = isMain ? null : (tryRun(recordPath, ["status", "--porcelain"]) ?? "").length > 0;
84
100
  return {
85
- id: path.basename(record.path),
86
- path: record.path,
101
+ id: path.basename(recordPath),
102
+ path: recordPath,
87
103
  branch: record.branch ?? null,
88
104
  head: record.head ?? null,
89
105
  detached: record.detached === true,
@@ -97,7 +113,7 @@ export function listWorktrees({ cwd }) {
97
113
  }
98
114
 
99
115
  export function createWorktree({ cwd, slug, base }) {
100
- const repo = gitRoot(cwd);
116
+ const repo = repoRoot(cwd);
101
117
  const name = validateSlug(slug);
102
118
  ensureExcluded(repo);
103
119
  const target = path.join(worktreesRoot(repo), name);
@@ -120,7 +136,7 @@ export function createWorktree({ cwd, slug, base }) {
120
136
  }
121
137
 
122
138
  export function removeWorktree({ cwd, id, force = false }) {
123
- const repo = gitRoot(cwd);
139
+ const repo = repoRoot(cwd);
124
140
  const name = validateSlug(id);
125
141
  const target = path.join(worktreesRoot(repo), name);
126
142
  const record = listWorktrees({ cwd: repo }).find((item) => path.resolve(item.path) === path.resolve(target));
@@ -133,10 +149,11 @@ export function removeWorktree({ cwd, id, force = false }) {
133
149
  }
134
150
 
135
151
  export function worktreeSummary({ cwd }) {
136
- const list = listWorktrees({ cwd });
152
+ const repo = repoRoot(cwd);
153
+ const list = listWorktrees({ cwd: repo });
137
154
  return {
138
- repo: gitRoot(cwd),
139
- root: worktreesRoot(gitRoot(cwd)),
155
+ repo,
156
+ root: worktreesRoot(repo),
140
157
  worktrees: list.filter((item) => !item.main),
141
158
  main: list.find((item) => item.main) ?? null,
142
159
  };