dsh-desktop-kit 2.30.0 → 2.33.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.en.md +118 -0
  3. package/README.md +71 -11
  4. package/client.js +1 -1
  5. package/docs/COMPATIBILITY.md +2 -1
  6. package/docs/LAPTOP-INSTALL.md +9 -5
  7. package/docs/MEASURED.md +25 -0
  8. package/docs/TEST-2.31.0.md +61 -0
  9. package/docs/TEST-2.32.0.md +32 -0
  10. package/docs/TEST-2.33.0.md +33 -0
  11. package/docs/UPGRADING.md +3 -1
  12. package/docs/images/hero-2.31.png +0 -0
  13. package/docs/measured.json +30 -0
  14. package/docs/preview/hero-2.31.html +133 -0
  15. package/doctor.ps1 +161 -142
  16. package/index.js +76 -5
  17. package/install.ps1 +178 -99
  18. package/lib/kit-diagnostics.js +780 -0
  19. package/package.json +8 -4
  20. package/plugins/dsh-agent-extensions/lib/agents.js +20 -1
  21. package/plugins/dsh-agent-extensions/lib/checkpoints.js +109 -5
  22. package/plugins/dsh-agent-extensions/lib/commands.js +40 -3
  23. package/plugins/dsh-agent-extensions/lib/instructions.js +96 -1
  24. package/plugins/dsh-agent-extensions/lib/locks.js +114 -0
  25. package/plugins/dsh-agent-extensions/lib/policy.js +5 -0
  26. package/plugins/dsh-agent-extensions/lib/project.js +7 -1
  27. package/plugins/dsh-agent-extensions/lib/scaffold.js +14 -14
  28. package/plugins/dsh-browser-qa/lib/ui-gate.js +5 -1
  29. package/plugins/dsh-guardrails/index.js +31 -4
  30. package/plugins/dsh-guardrails/lib/hooks.js +22 -5
  31. package/plugins/dsh-guardrails/lib/runtime.js +122 -0
  32. package/plugins/dsh-integrations/lib/job-sandbox.ps1 +1 -1
  33. package/plugins/dsh-profile-transfer/bootstrap/install-on-clean-machine.ps1 +1 -1
  34. package/plugins/dsh-project-memory/index.js +28 -3
  35. package/plugins/dsh-quality-pipeline/index.js +14 -3
  36. package/plugins/dsh-quality-pipeline/lib/text.js +1 -1
  37. package/skills/manifest.json +2 -2
  38. package/skills-baseline.json +9 -5
  39. package/uninstall.ps1 +1 -1
package/install.ps1 CHANGED
@@ -1,99 +1,178 @@
1
- #requires -Version 5.1
2
- <#
3
- .SYNOPSIS
4
- Install dsh-desktop-kit into a DeepSeek Harness profile.
5
-
6
- .DESCRIPTION
7
- Copies nothing into the profile outside pnpm's own dependency install:
8
- the kit is linked from this repository, the bundle is added to
9
- dsh.profile.bundles, and the DSH launcher is asked to run pnpm.
10
- Skills are copied by the kit itself on its first start.
11
-
12
- .PARAMETER Profile
13
- DSH profile name, default "desktop".
14
-
15
- .PARAMETER DshHome
16
- DSH home; defaults to $env:DSH_HOME or %USERPROFILE%\.dsh.
17
-
18
- .PARAMETER RepoPath
19
- Repository root; defaults to this script's folder.
20
- #>
21
- param(
22
- [string]$Profile = "desktop",
23
- [string]$DshHome = "",
24
- [string]$RepoPath = ""
25
- )
26
-
27
- $ErrorActionPreference = "Stop"
28
-
29
- function Write-Step([string]$Text) {
30
- Write-Host ""
31
- Write-Host "==> $Text" -ForegroundColor Cyan
32
- }
33
-
34
- if ([string]::IsNullOrWhiteSpace($RepoPath)) { $RepoPath = $PSScriptRoot }
35
- if (-not (Test-Path (Join-Path $RepoPath "package.json"))) {
36
- throw "package.json not found in $RepoPath"
37
- }
38
- if ([string]::IsNullOrWhiteSpace($DshHome)) {
39
- if ($env:DSH_HOME) { $DshHome = $env:DSH_HOME } else { $DshHome = Join-Path $env:USERPROFILE ".dsh" }
40
- }
41
-
42
- $profileDir = Join-Path $DshHome "profiles\$Profile"
43
- $profileJson = Join-Path $profileDir "package.json"
44
-
45
- Write-Step "Checking the DSH environment"
46
- $dsh = $null
47
- $command = Get-Command dsh -ErrorAction SilentlyContinue
48
- if ($command) { $dsh = $command.Source }
49
- if (-not $dsh) {
50
- $fallback = Join-Path ${env:LOCALAPPDATA} "Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd"
51
- if (Test-Path $fallback) { $dsh = $fallback }
52
- }
53
- if (-not $dsh) { throw "dsh CLI not found. Install DeepSeek Harness, run it once, then retry." }
54
- if (-not (Test-Path $profileJson)) {
55
- throw "Profile '$Profile' does not exist ($profileDir). Start DSH once, close it, then retry."
56
- }
57
-
58
- Write-Host "dsh: $dsh"
59
- Write-Host "DSH home: $DshHome"
60
- Write-Host "Profile: $Profile"
61
- Write-Host "Repository: $RepoPath"
62
-
63
- $running = Get-Process -Name "DeepSeek Harness" -ErrorAction SilentlyContinue
64
- if ($running) {
65
- Write-Host "DSH is running. Close it before installing so the profile is not written twice." -ForegroundColor Yellow
66
- }
67
-
68
- Write-Step "Backing up the profile manifest"
69
- $stamp = Get-Date -Format "yyyyMMdd-HHmmss"
70
- $backupDir = Join-Path $profileDir ("backup-kit-" + $stamp)
71
- New-Item -ItemType Directory -Path $backupDir -Force | Out-Null
72
- Copy-Item $profileJson (Join-Path $backupDir "package.json") -Force
73
- $patchFile = Join-Path $profileDir "cordis.patch.yml"
74
- if (Test-Path $patchFile) { Copy-Item $patchFile (Join-Path $backupDir "cordis.patch.yml") -Force }
75
- Write-Host "Backup: $backupDir"
76
-
77
- Write-Step "Installing the package through the DSH launcher (pnpm)"
78
- & $dsh plugin --profile $Profile add $RepoPath
79
- if ($LASTEXITCODE -ne 0) {
80
- throw "dsh plugin add exited with code $LASTEXITCODE. See the output above."
81
- }
82
-
83
- Write-Step "Enabling the bundle in the profile manifest"
84
- $json = Get-Content -Path $profileJson -Raw | ConvertFrom-Json
85
- if ($null -eq $json.dsh) { $json | Add-Member -NotePropertyName dsh -NotePropertyValue ([pscustomobject]@{}) }
86
- if ($null -eq $json.dsh.profile) { $json.dsh | Add-Member -NotePropertyName profile -NotePropertyValue ([pscustomobject]@{}) }
87
- $bundles = @()
88
- if ($json.dsh.profile.bundles) { $bundles = @($json.dsh.profile.bundles) }
89
- if ($bundles -notcontains "dsh-desktop-kit") { $bundles += "dsh-desktop-kit" }
90
- $json.dsh.profile | Add-Member -NotePropertyName bundles -NotePropertyValue $bundles -Force
91
- $jsonText = $json | ConvertTo-Json -Depth 20
92
- [System.IO.File]::WriteAllText($profileJson, $jsonText, (New-Object System.Text.UTF8Encoding($false)))
93
-
94
- Write-Step "Done"
95
- Write-Host "1. Start DeepSeek Harness (restart it if it was running)." -ForegroundColor Green
96
- Write-Host "2. Settings -> Plugins: 'dsh-desktop-kit' is enabled." -ForegroundColor Green
97
- Write-Host "3. The kit copies missing skills into $DshHome\skills on first start." -ForegroundColor Green
98
- Write-Host ""
99
- Write-Host "Rollback: run uninstall.ps1, or restore package.json from $backupDir." -ForegroundColor DarkGray
1
+ #requires -Version 5.1
2
+ <#
3
+ .SYNOPSIS
4
+ Install dsh-desktop-kit into a DeepSeek Harness profile.
5
+
6
+ .DESCRIPTION
7
+ Copies nothing into the profile outside pnpm's own dependency install:
8
+ the kit is linked from this repository, the bundle is added to
9
+ dsh.profile.bundles, and the DSH launcher is asked to run pnpm.
10
+ Skills are copied by the kit itself on its first start.
11
+
12
+ Two safe modes run before anything is written:
13
+ -Plan print the environment and the exact plan, change nothing
14
+ -Interactive one question after the plan, then the usual install
15
+
16
+ The legacy behaviour (no parameters) used to install silently. Now a bare
17
+ run is interactive; scripts and CI keep the old path with -Yes.
18
+
19
+ .PARAMETER Profile
20
+ DSH profile name, default "desktop".
21
+
22
+ .PARAMETER DshHome
23
+ DSH home; defaults to $env:DSH_HOME or %USERPROFILE%\.dsh.
24
+
25
+ .PARAMETER RepoPath
26
+ Repository root; defaults to this script's folder.
27
+
28
+ .PARAMETER Interactive
29
+ Print the plan and ask one confirmation question. Implied by a bare run.
30
+
31
+ .PARAMETER Plan
32
+ Print the plan and exit. Writes nothing.
33
+
34
+ .PARAMETER Json
35
+ With -Plan, print a machine-readable JSON (used by tools/onboarding-tests.mjs).
36
+
37
+ .PARAMETER Yes
38
+ Non-interactive install (the pre-2.31 behaviour) for scripts and CI.
39
+
40
+ .PARAMETER SkipExternal
41
+ Do not probe dsh/gh/processes; used by tests on machines without DSH.
42
+ #>
43
+ param(
44
+ [string]$Profile = "desktop",
45
+ [string]$DshHome = "",
46
+ [string]$RepoPath = "",
47
+ [switch]$Interactive,
48
+ [switch]$Plan,
49
+ [switch]$Json,
50
+ [switch]$Yes,
51
+ [switch]$SkipExternal
52
+ )
53
+
54
+ $ErrorActionPreference = "Stop"
55
+
56
+ function Write-Step([string]$Text) {
57
+ Write-Host ""
58
+ Write-Host "==> $Text" -ForegroundColor Cyan
59
+ }
60
+
61
+ if ([string]::IsNullOrWhiteSpace($RepoPath)) { $RepoPath = $PSScriptRoot }
62
+ if (-not (Test-Path (Join-Path $RepoPath "package.json"))) {
63
+ throw "package.json not found in $RepoPath"
64
+ }
65
+ if ([string]::IsNullOrWhiteSpace($DshHome)) {
66
+ if ($env:DSH_HOME) { $DshHome = $env:DSH_HOME } else { $DshHome = Join-Path $env:USERPROFILE ".dsh" }
67
+ }
68
+
69
+ # A bare double-click (01-INSTALL.cmd) should ask one question, not install silently.
70
+ $noArguments = ($PSBoundParameters.Count -eq 0)
71
+ if (-not $Plan -and -not $Yes -and -not $Interactive -and $noArguments) { $Interactive = $true }
72
+
73
+ $kitEnvScript = Join-Path $PSScriptRoot "tools\kit-env.ps1"
74
+ if (-not (Test-Path $kitEnvScript)) { throw "tools\kit-env.ps1 not found in $RepoPath" }
75
+ . $kitEnvScript
76
+
77
+ $environment = Get-KitEnvironment -DshHome $DshHome -ProfileName $Profile -RepoPath $RepoPath -SkipExternal:$SkipExternal
78
+ $kitPlan = Get-KitPlan -Environment $environment
79
+
80
+ if ($Plan) {
81
+ if ($Json) {
82
+ [pscustomobject]@{ environment = $environment; plan = $kitPlan } | ConvertTo-Json -Depth 12
83
+ } else {
84
+ Write-Host (Format-KitDoctor -Environment $environment)
85
+ Write-Host ""
86
+ Write-Host (Format-KitPlan -Plan $kitPlan -Environment $environment)
87
+ }
88
+ exit 0
89
+ }
90
+
91
+ if ($Interactive) {
92
+ Write-Host ""
93
+ Write-Host (Format-KitDoctor -Environment $environment)
94
+ Write-Host ""
95
+ Write-Host (Format-KitPlan -Plan $kitPlan -Environment $environment)
96
+ Write-Host ""
97
+ if ($kitPlan.blocked) {
98
+ Write-Host "Есть блокеры — исправьте их и запустите снова." -ForegroundColor Red
99
+ exit 1
100
+ }
101
+ if ([Console]::IsInputRedirected) {
102
+ Write-Host "Нет интерактивного ввода: запустите с -Yes (установить) или -Plan (только план)." -ForegroundColor Yellow
103
+ exit 1
104
+ }
105
+ $current = $environment.profile.installedKitVersion
106
+ if ($current -eq $environment.kit.version) {
107
+ $answer = Read-Host ("Kit {0} уже установлен. Переустановить из источника? [y/N]" -f $current)
108
+ $confirmed = ($answer -match "^(y|yes|д|да)$")
109
+ } else {
110
+ $answer = Read-Host ("Установить DSH Desktop Kit {0} в профиль '{1}'? [Y/n]" -f $environment.kit.version, $Profile)
111
+ $confirmed = -not ($answer -match "^(n|no|н|нет)$")
112
+ }
113
+ if (-not $confirmed) {
114
+ Write-Host "Отменено. Ничего не изменено." -ForegroundColor Yellow
115
+ exit 0
116
+ }
117
+ Write-Host ""
118
+ }
119
+
120
+ $profileDir = Join-Path $DshHome "profiles\$Profile"
121
+ $profileJson = Join-Path $profileDir "package.json"
122
+
123
+ Write-Step "Checking the DSH environment"
124
+ $dsh = $null
125
+ $command = Get-Command dsh -ErrorAction SilentlyContinue
126
+ if ($command) { $dsh = $command.Source }
127
+ if (-not $dsh) {
128
+ $fallback = Join-Path ${env:LOCALAPPDATA} "Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd"
129
+ if (Test-Path $fallback) { $dsh = $fallback }
130
+ }
131
+ if (-not $dsh) { throw "dsh CLI not found. Install DeepSeek Harness, run it once, then retry." }
132
+ if (-not (Test-Path $profileJson)) {
133
+ throw "Profile '$Profile' does not exist ($profileDir). Start DSH once, close it, then retry."
134
+ }
135
+
136
+ Write-Host "dsh: $dsh"
137
+ Write-Host "DSH home: $DshHome"
138
+ Write-Host "Profile: $Profile"
139
+ Write-Host "Repository: $RepoPath"
140
+
141
+ $running = Get-Process -Name "DeepSeek Harness" -ErrorAction SilentlyContinue
142
+ if ($running) {
143
+ Write-Host "DSH is running. Close it before installing so the profile is not written twice." -ForegroundColor Yellow
144
+ }
145
+
146
+ Write-Step "Backing up the profile manifest"
147
+ $stamp = Get-Date -Format "yyyyMMdd-HHmmss"
148
+ $backupDir = Join-Path $profileDir ("backup-kit-" + $stamp)
149
+ New-Item -ItemType Directory -Path $backupDir -Force | Out-Null
150
+ Copy-Item $profileJson (Join-Path $backupDir "package.json") -Force
151
+ $patchFile = Join-Path $profileDir "cordis.patch.yml"
152
+ if (Test-Path $patchFile) { Copy-Item $patchFile (Join-Path $backupDir "cordis.patch.yml") -Force }
153
+ Write-Host "Backup: $backupDir"
154
+
155
+ Write-Step "Installing the package through the DSH launcher (pnpm)"
156
+ & $dsh plugin --profile $Profile add $RepoPath
157
+ if ($LASTEXITCODE -ne 0) {
158
+ throw "dsh plugin add exited with code $LASTEXITCODE. See the output above."
159
+ }
160
+
161
+ Write-Step "Enabling the bundle in the profile manifest"
162
+ $profileData = Get-Content -Path $profileJson -Raw | ConvertFrom-Json
163
+ if ($null -eq $profileData.dsh) { $profileData | Add-Member -NotePropertyName dsh -NotePropertyValue ([pscustomobject]@{}) }
164
+ if ($null -eq $profileData.dsh.profile) { $profileData.dsh | Add-Member -NotePropertyName profile -NotePropertyValue ([pscustomobject]@{}) }
165
+ $bundles = @()
166
+ if ($profileData.dsh.profile.bundles) { $bundles = @($profileData.dsh.profile.bundles) }
167
+ if ($bundles -notcontains "dsh-desktop-kit") { $bundles += "dsh-desktop-kit" }
168
+ $profileData.dsh.profile | Add-Member -NotePropertyName bundles -NotePropertyValue $bundles -Force
169
+ $jsonText = $profileData | ConvertTo-Json -Depth 20
170
+ [System.IO.File]::WriteAllText($profileJson, $jsonText, (New-Object System.Text.UTF8Encoding($false)))
171
+
172
+ Write-Step "Done"
173
+ Write-Host "1. Start DeepSeek Harness (restart it if it was running)." -ForegroundColor Green
174
+ Write-Host "2. Settings -> Plugins: 'dsh-desktop-kit' is enabled." -ForegroundColor Green
175
+ Write-Host "3. The kit copies missing skills into $DshHome\skills on first start." -ForegroundColor Green
176
+ Write-Host "4. Check the result: /kit doctor (and /kit plan before the next update)." -ForegroundColor Green
177
+ Write-Host ""
178
+ Write-Host "Rollback: run uninstall.ps1, or restore package.json from $backupDir." -ForegroundColor DarkGray