dsh-desktop-kit 2.24.1 → 2.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +85 -10
- package/README.en.md +102 -0
- package/README.md +223 -256
- package/client.js +1 -1
- package/docs/ARCHITECTURE.md +9 -6
- package/docs/COMPATIBILITY.md +2 -1
- package/docs/LAPTOP-INSTALL.md +9 -5
- package/docs/MEASURED.md +25 -0
- package/docs/PROPOSAL-2.25-quality-pipeline.md +435 -0
- package/docs/PROPOSAL-NEXUM-FINDINGS.md +259 -0
- package/docs/TEST-2.30.0.md +83 -0
- package/docs/TEST-2.31.0.md +61 -0
- package/docs/UPGRADING.md +3 -1
- package/docs/images/capability-map-2.30.png +0 -0
- package/docs/images/hero-2.30.png +0 -0
- package/docs/images/hero-2.31.png +0 -0
- package/docs/images/quality-pipeline-2.30.png +0 -0
- package/docs/measured.json +30 -0
- package/docs/preview/capability-map-2.30.html +106 -0
- package/docs/preview/hero-2.30.html +133 -0
- package/docs/preview/hero-2.31.html +133 -0
- package/docs/preview/quality-pipeline-2.30.html +142 -0
- package/docs/preview/readme-visuals.css +111 -0
- package/doctor.ps1 +161 -142
- package/index.js +82 -5
- package/install.ps1 +178 -99
- package/lib/kit-diagnostics.js +780 -0
- package/package.json +15 -5
- package/plugins/dsh-agent-extensions/lib/routing.js +4 -0
- package/plugins/dsh-agent-extensions/lib/scaffold.js +152 -27
- package/plugins/dsh-agent-extensions/lib/settings.js +19 -0
- package/plugins/dsh-agent-extensions/lib/swarm.js +6 -2
- package/plugins/dsh-browser-qa/index.js +202 -9
- package/plugins/dsh-browser-qa/lib/design-more.js +688 -0
- package/plugins/dsh-browser-qa/lib/extras.js +1313 -0
- package/plugins/dsh-browser-qa/lib/pages.js +4 -3
- package/plugins/dsh-browser-qa/lib/png.js +190 -0
- package/plugins/dsh-browser-qa/lib/ui-gate.js +171 -31
- package/plugins/dsh-i18n/README.md +36 -0
- package/plugins/dsh-i18n/cordis.patch.yml +3 -0
- package/plugins/dsh-i18n/index.js +294 -0
- package/plugins/dsh-i18n/lib/lang.js +179 -0
- package/plugins/dsh-i18n/package.json +29 -0
- package/plugins/dsh-integrations/lib/job-sandbox.ps1 +1 -1
- package/plugins/dsh-profile-transfer/bootstrap/install-on-clean-machine.ps1 +1 -1
- package/plugins/dsh-quality-pipeline/README.md +53 -0
- package/plugins/dsh-quality-pipeline/cordis.patch.yml +3 -0
- package/plugins/dsh-quality-pipeline/index.js +647 -0
- package/plugins/dsh-quality-pipeline/lib/acceptance.js +132 -0
- package/plugins/dsh-quality-pipeline/lib/autostart.js +159 -0
- package/plugins/dsh-quality-pipeline/lib/design.js +123 -0
- package/plugins/dsh-quality-pipeline/lib/machine.js +312 -0
- package/plugins/dsh-quality-pipeline/lib/prework.js +215 -0
- package/plugins/dsh-quality-pipeline/lib/release.js +53 -0
- package/plugins/dsh-quality-pipeline/lib/schema.js +256 -0
- package/plugins/dsh-quality-pipeline/lib/store.js +114 -0
- package/plugins/dsh-quality-pipeline/lib/text.js +109 -0
- package/plugins/dsh-quality-pipeline/package.json +33 -0
- package/plugins/dsh-remote-ops/README.md +38 -0
- package/plugins/dsh-remote-ops/cordis.patch.yml +3 -0
- package/plugins/dsh-remote-ops/index.js +268 -0
- package/plugins/dsh-remote-ops/lib/hosts.js +118 -0
- package/plugins/dsh-remote-ops/lib/ssh.js +96 -0
- package/plugins/dsh-remote-ops/lib/state.js +66 -0
- package/plugins/dsh-remote-ops/package.json +31 -0
- package/plugins/dsh-skill-autopilot/index.js +204 -15
- package/skills/a11y-audit/SKILL.md +67 -0
- package/skills/cms-ops/SKILL.md +74 -0
- package/skills/design-system/SKILL.md +100 -0
- package/skills/legal-ru-web/SKILL.md +68 -0
- package/skills/manifest.json +38 -18
- package/skills/release-pipeline/SKILL.md +67 -0
- package/skills/ui-batch/SKILL.md +60 -0
- package/skills/web-build/SKILL.md +106 -0
- package/skills/web-build/recipes/form.md +16 -0
- package/skills/web-build/recipes/payment.md +16 -0
- package/skills/web-build/recipes/review.md +16 -0
- package/skills-baseline.json +201 -5
- package/uninstall.ps1 +1 -1
- package/skills/ui-design-system/references/accessibility-and-responsive.md +0 -50
- package/skills/ui-design-system/references/tokens-and-components.md +0 -67
- package/skills/ui-design-system/references/visual-qa.md +0 -44
- package/skills/visual-qa/references/commands.md +0 -32
- /package/skills/{ui-craft/SKILL.md → design-system/references/ui-craft.md} +0 -0
- /package/skills/{ui-design-system/SKILL.md → design-system/references/ui-design-system.md} +0 -0
- /package/skills/{visual-qa/SKILL.md → ui-batch/references/visual-qa.md} +0 -0
package/doctor.ps1
CHANGED
|
@@ -1,142 +1,161 @@
|
|
|
1
|
-
#requires -Version 5.1
|
|
2
|
-
<#
|
|
3
|
-
.SYNOPSIS
|
|
4
|
-
Report whether dsh-desktop-kit is installed and enabled.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
$
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
$
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
$
|
|
28
|
-
if (Test-Path $
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
$
|
|
32
|
-
|
|
33
|
-
} else {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
$
|
|
43
|
-
$
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if ($
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (
|
|
57
|
-
Write-Host "
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
Write-Host "
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
$
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if ($
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
} else {
|
|
132
|
-
Write-Host "
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
Write-Host ""
|
|
141
|
-
Write-Host "$
|
|
142
|
-
|
|
1
|
+
#requires -Version 5.1
|
|
2
|
+
<#
|
|
3
|
+
.SYNOPSIS
|
|
4
|
+
Report whether dsh-desktop-kit is installed and enabled.
|
|
5
|
+
|
|
6
|
+
.PARAMETER Json
|
|
7
|
+
Print the full environment probe and the install plan as JSON (exit 0 when
|
|
8
|
+
no blocking problem, 1 otherwise). Used by tools/onboarding-tests.mjs.
|
|
9
|
+
|
|
10
|
+
.PARAMETER SkipExternal
|
|
11
|
+
Do not probe dsh/gh/processes (tests).
|
|
12
|
+
#>
|
|
13
|
+
param(
|
|
14
|
+
[string]$Profile = "desktop",
|
|
15
|
+
[string]$DshHome = "",
|
|
16
|
+
[switch]$Json,
|
|
17
|
+
[switch]$SkipExternal
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
$ErrorActionPreference = "Continue"
|
|
21
|
+
|
|
22
|
+
if ([string]::IsNullOrWhiteSpace($DshHome)) {
|
|
23
|
+
if ($env:DSH_HOME) { $DshHome = $env:DSH_HOME } else { $DshHome = Join-Path $env:USERPROFILE ".dsh" }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if ($Json) {
|
|
27
|
+
$kitEnvScript = Join-Path $PSScriptRoot "tools\kit-env.ps1"
|
|
28
|
+
if (-not (Test-Path $kitEnvScript)) { throw "tools\kit-env.ps1 not found" }
|
|
29
|
+
. $kitEnvScript
|
|
30
|
+
$environment = Get-KitEnvironment -DshHome $DshHome -ProfileName $Profile -RepoPath $PSScriptRoot -SkipExternal:$SkipExternal
|
|
31
|
+
$plan = Get-KitPlan -Environment $environment
|
|
32
|
+
[pscustomobject]@{ environment = $environment; plan = $plan } | ConvertTo-Json -Depth 12
|
|
33
|
+
if ($environment.ok) { exit 0 } else { exit 1 }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
$profileDir = Join-Path $DshHome "profiles\$Profile"
|
|
37
|
+
$profileJson = Join-Path $profileDir "package.json"
|
|
38
|
+
|
|
39
|
+
Write-Host "DSH home: $DshHome"
|
|
40
|
+
Write-Host "Profile: $profileDir"
|
|
41
|
+
|
|
42
|
+
$dsh = $null
|
|
43
|
+
$command = Get-Command dsh -ErrorAction SilentlyContinue
|
|
44
|
+
if ($command) { $dsh = $command.Source }
|
|
45
|
+
if (-not $dsh) {
|
|
46
|
+
$fallback = Join-Path ${env:LOCALAPPDATA} "Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd"
|
|
47
|
+
if (Test-Path $fallback) { $dsh = $fallback }
|
|
48
|
+
}
|
|
49
|
+
if ($dsh) {
|
|
50
|
+
$version = & $dsh --version 2>$null
|
|
51
|
+
Write-Host "DSH CLI: $version"
|
|
52
|
+
} else {
|
|
53
|
+
Write-Host "DSH CLI: not found" -ForegroundColor Yellow
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (-not (Test-Path $profileJson)) {
|
|
57
|
+
Write-Host "Profile manifest not found." -ForegroundColor Red
|
|
58
|
+
exit 1
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
$profileData = Get-Content -Path $profileJson -Raw | ConvertFrom-Json
|
|
62
|
+
$issues = 0
|
|
63
|
+
|
|
64
|
+
$dependency = $null
|
|
65
|
+
if ($profileData.dependencies) { $dependency = $profileData.dependencies.'dsh-desktop-kit' }
|
|
66
|
+
if ($dependency) {
|
|
67
|
+
Write-Host "Dependency: $dependency" -ForegroundColor Green
|
|
68
|
+
} else {
|
|
69
|
+
Write-Host "Dependency: not installed" -ForegroundColor Red
|
|
70
|
+
$issues += 1
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
$bundles = @()
|
|
74
|
+
if ($profileData.dsh -and $profileData.dsh.profile -and $profileData.dsh.profile.bundles) { $bundles = @($profileData.dsh.profile.bundles) }
|
|
75
|
+
if ($bundles -contains "dsh-desktop-kit") {
|
|
76
|
+
Write-Host "Bundle: enabled" -ForegroundColor Green
|
|
77
|
+
} else {
|
|
78
|
+
Write-Host "Bundle: not enabled" -ForegroundColor Red
|
|
79
|
+
$issues += 1
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
$link = Join-Path $profileDir "node_modules\dsh-desktop-kit"
|
|
83
|
+
if (Test-Path $link) {
|
|
84
|
+
$item = Get-Item -Path $link -Force
|
|
85
|
+
if ($item.LinkType -eq "Junction" -or $item.LinkType -eq "SymbolicLink") {
|
|
86
|
+
Write-Host "Package: linked -> $($item.Target)" -ForegroundColor Yellow
|
|
87
|
+
Write-Host " development link; production installs use a real directory"
|
|
88
|
+
} else {
|
|
89
|
+
Write-Host "Package: real directory" -ForegroundColor Green
|
|
90
|
+
}
|
|
91
|
+
$kitPackage = Join-Path $link "package.json"
|
|
92
|
+
if (Test-Path $kitPackage) {
|
|
93
|
+
try {
|
|
94
|
+
$kit = Get-Content -Path $kitPackage -Raw | ConvertFrom-Json
|
|
95
|
+
Write-Host "Kit: $($kit.version)" -ForegroundColor Green
|
|
96
|
+
} catch {
|
|
97
|
+
Write-Host "Kit: package.json is unreadable" -ForegroundColor Red
|
|
98
|
+
$issues += 1
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
Write-Host "Kit: package.json missing" -ForegroundColor Red
|
|
102
|
+
$issues += 1
|
|
103
|
+
}
|
|
104
|
+
$tmp = @(Get-ChildItem -Path (Join-Path $profileDir "node_modules") -Directory -Filter "dsh-desktop-kit_tmp_*" -ErrorAction SilentlyContinue)
|
|
105
|
+
if ($tmp.Count -gt 0) {
|
|
106
|
+
Write-Host "Stale: $($tmp.Count) dsh-desktop-kit_tmp_* folder(s); pnpm may fail with EPERM" -ForegroundColor Yellow
|
|
107
|
+
Write-Host " remove them, then re-run the install"
|
|
108
|
+
$issues += 1
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
Write-Host "Package: missing (run install.ps1 again)" -ForegroundColor Red
|
|
112
|
+
$issues += 1
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
$statePath = Join-Path $DshHome "skills\.dsh-kit-skills.json"
|
|
116
|
+
if (Test-Path $statePath) {
|
|
117
|
+
try {
|
|
118
|
+
$state = Get-Content -Path $statePath -Raw | ConvertFrom-Json
|
|
119
|
+
$skillNames = @()
|
|
120
|
+
if ($state.skills) { $skillNames = @($state.skills.PSObject.Properties | ForEach-Object { $_.Name } | Where-Object { $_ }) }
|
|
121
|
+
$conflictNames = @()
|
|
122
|
+
if ($state.conflicts) { $conflictNames = @($state.conflicts.PSObject.Properties | ForEach-Object { $_.Name } | Where-Object { $_ }) }
|
|
123
|
+
Write-Host "Skill sync: $($skillNames.Count) packaged, $($conflictNames.Count) conflicts, updated $($state.updatedAt)" -ForegroundColor Green
|
|
124
|
+
if ($conflictNames.Count -gt 0) {
|
|
125
|
+
Write-Host "Skill conflicts (your edits were kept): $($conflictNames -join ', ')" -ForegroundColor Yellow
|
|
126
|
+
Write-Host " /kit conflicts - list; /kit sync - update without overwriting"
|
|
127
|
+
}
|
|
128
|
+
} catch {
|
|
129
|
+
Write-Host "Skill sync: state file is unreadable ($($_.Exception.Message))" -ForegroundColor Yellow
|
|
130
|
+
}
|
|
131
|
+
} else {
|
|
132
|
+
Write-Host "Skill sync: not written yet (start DSH once or run /kit sync)" -ForegroundColor Yellow
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
$pinned = @()
|
|
136
|
+
foreach ($name in @($profileData.dependencies.PSObject.Properties.Name)) {
|
|
137
|
+
if ($name -like "@deepseek-ai/*") { $pinned += $name }
|
|
138
|
+
}
|
|
139
|
+
if ($pinned.Count -gt 0) {
|
|
140
|
+
Write-Host "Pinned @deepseek-ai packages (possible 'incompatible plugins' after a DSH update):" -ForegroundColor Yellow
|
|
141
|
+
$pinned | ForEach-Object { Write-Host " $_" }
|
|
142
|
+
} else {
|
|
143
|
+
Write-Host "Pinned packages: none" -ForegroundColor Green
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
$skillsDir = Join-Path $DshHome "skills"
|
|
147
|
+
if (Test-Path $skillsDir) {
|
|
148
|
+
$count = (Get-ChildItem $skillsDir -Directory | Measure-Object).Count
|
|
149
|
+
Write-Host "Skills: $count" -ForegroundColor Green
|
|
150
|
+
} else {
|
|
151
|
+
Write-Host "Skills: folder missing (the kit creates it on first start)" -ForegroundColor Yellow
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if ($issues -eq 0) {
|
|
155
|
+
Write-Host ""
|
|
156
|
+
Write-Host "Everything is in place." -ForegroundColor Green
|
|
157
|
+
exit 0
|
|
158
|
+
}
|
|
159
|
+
Write-Host ""
|
|
160
|
+
Write-Host "$issues problem(s) found." -ForegroundColor Red
|
|
161
|
+
exit 1
|
package/index.js
CHANGED
|
@@ -22,6 +22,16 @@ import {
|
|
|
22
22
|
loadSkillState,
|
|
23
23
|
STATE_FILE,
|
|
24
24
|
} from "./lib/skills-sync.js";
|
|
25
|
+
import {
|
|
26
|
+
applyTune,
|
|
27
|
+
collectTuneMetrics,
|
|
28
|
+
detectEnvironment,
|
|
29
|
+
formatDoctor,
|
|
30
|
+
formatPlan,
|
|
31
|
+
formatTune,
|
|
32
|
+
planActions,
|
|
33
|
+
writeTuneReport,
|
|
34
|
+
} from "./lib/kit-diagnostics.js";
|
|
25
35
|
|
|
26
36
|
import * as gkbRuUi from "./plugins/dsh-gkb-ru-ui/lib/index.js";
|
|
27
37
|
import * as peakGuard from "./plugins/dsh-peak-guard/index.js";
|
|
@@ -34,6 +44,9 @@ import * as skillAutopilot from "./plugins/dsh-skill-autopilot/index.js";
|
|
|
34
44
|
import * as repoMap from "./plugins/dsh-repo-map/index.js";
|
|
35
45
|
import * as checkpoints from "./plugins/dsh-checkpoints/index.js";
|
|
36
46
|
import * as planMode from "./plugins/dsh-plan-mode/index.js";
|
|
47
|
+
import * as qualityPipeline from "./plugins/dsh-quality-pipeline/index.js";
|
|
48
|
+
import * as remoteOps from "./plugins/dsh-remote-ops/index.js";
|
|
49
|
+
import * as i18n from "./plugins/dsh-i18n/index.js";
|
|
37
50
|
import * as browserQa from "./plugins/dsh-browser-qa/index.js";
|
|
38
51
|
import * as githubReview from "./plugins/dsh-github-review/index.js";
|
|
39
52
|
import * as guardrails from "./plugins/dsh-guardrails/index.js";
|
|
@@ -63,6 +76,9 @@ const parts = [
|
|
|
63
76
|
["dsh-repo-map", repoMap],
|
|
64
77
|
["dsh-checkpoints", checkpoints],
|
|
65
78
|
["dsh-plan-mode", planMode],
|
|
79
|
+
["dsh-quality-pipeline", qualityPipeline],
|
|
80
|
+
["dsh-remote-ops", remoteOps],
|
|
81
|
+
["dsh-i18n", i18n],
|
|
66
82
|
["dsh-browser-qa", browserQa],
|
|
67
83
|
["dsh-github-review", githubReview],
|
|
68
84
|
["dsh-guardrails", guardrails],
|
|
@@ -133,10 +149,30 @@ function kitStatusText() {
|
|
|
133
149
|
for (const error of runtimeState.mountErrors.slice(0, 5)) lines.push(`Ошибка ${error.name}: ${error.message}`);
|
|
134
150
|
}
|
|
135
151
|
lines.push(`Состояние: ${path.join(home, "skills", STATE_FILE)}`);
|
|
136
|
-
lines.push("Команды: /kit status | sync | conflicts | force
|
|
152
|
+
lines.push("Команды: /kit status | doctor | plan | tune | sync | conflicts | force");
|
|
137
153
|
return lines.join("\n");
|
|
138
154
|
}
|
|
139
155
|
|
|
156
|
+
/** Split `/kit <command> [--flag value] [--json]` without a dependency. */
|
|
157
|
+
function parseKitArgs(rest) {
|
|
158
|
+
const flags = new Set();
|
|
159
|
+
const options = {};
|
|
160
|
+
for (let index = 0; index < rest.length; index += 1) {
|
|
161
|
+
const item = rest[index];
|
|
162
|
+
if (!item.startsWith("--")) continue;
|
|
163
|
+
const [key, inline] = item.slice(2).split("=", 2);
|
|
164
|
+
if (inline !== undefined) {
|
|
165
|
+
options[key] = inline;
|
|
166
|
+
} else if (rest[index + 1] && !rest[index + 1].startsWith("--")) {
|
|
167
|
+
options[key] = rest[index + 1];
|
|
168
|
+
index += 1;
|
|
169
|
+
} else {
|
|
170
|
+
flags.add(key);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return { flags, options };
|
|
174
|
+
}
|
|
175
|
+
|
|
140
176
|
export function apply(ctx) {
|
|
141
177
|
try {
|
|
142
178
|
installSkills(ctx.logger);
|
|
@@ -167,12 +203,53 @@ export function apply(ctx) {
|
|
|
167
203
|
try {
|
|
168
204
|
const dispose = commandCtx.commands.register({
|
|
169
205
|
name: "kit",
|
|
170
|
-
description: "DSH Desktop Kit:
|
|
171
|
-
input: { hint: "status | sync | conflicts | force" },
|
|
206
|
+
description: "DSH Desktop Kit: диагностика, план установки, замеры, синхронизация навыков",
|
|
207
|
+
input: { hint: "status | doctor | plan | tune | sync | conflicts | force (--json, --profile <имя>, --apply)" },
|
|
172
208
|
recordInput: false,
|
|
173
|
-
handler: ({ rawInput }) => {
|
|
174
|
-
const
|
|
209
|
+
handler: async ({ rawInput }) => {
|
|
210
|
+
const args = String(rawInput ?? "").trim().split(/\s+/u).filter(Boolean);
|
|
211
|
+
const command = (args[0] ?? "status").toLowerCase();
|
|
212
|
+
const { flags, options } = parseKitArgs(args.slice(1));
|
|
213
|
+
const profile = options.profile || process.env.DSH_PROFILE || "desktop";
|
|
214
|
+
const home = skillsHome();
|
|
175
215
|
try {
|
|
216
|
+
if (command === "doctor") {
|
|
217
|
+
const env = detectEnvironment({ home, profile, repoPath: here });
|
|
218
|
+
return { kind: env.ok ? "success" : "error", text: formatDoctor(env) };
|
|
219
|
+
}
|
|
220
|
+
if (command === "plan") {
|
|
221
|
+
const env = detectEnvironment({ home, profile, repoPath: here });
|
|
222
|
+
const plan = planActions(env);
|
|
223
|
+
if (flags.has("json")) {
|
|
224
|
+
return {
|
|
225
|
+
kind: "success",
|
|
226
|
+
text: JSON.stringify(
|
|
227
|
+
{
|
|
228
|
+
plan,
|
|
229
|
+
environment: {
|
|
230
|
+
profile: env.profile,
|
|
231
|
+
kit: env.kit,
|
|
232
|
+
dsh: env.dsh,
|
|
233
|
+
node: env.node,
|
|
234
|
+
problems: env.problems,
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
null,
|
|
238
|
+
2,
|
|
239
|
+
),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
return { kind: plan.blocked ? "error" : "success", text: formatPlan(plan, env) };
|
|
243
|
+
}
|
|
244
|
+
if (command === "tune") {
|
|
245
|
+
const report = collectTuneMetrics({ home, repoPath: here, profile });
|
|
246
|
+
const reportFile = writeTuneReport(home, report);
|
|
247
|
+
const applied = flags.has("apply") ? applyTune(home, report) : null;
|
|
248
|
+
if (flags.has("json")) {
|
|
249
|
+
return { kind: "success", text: JSON.stringify({ report, reportFile, applied }, null, 2) };
|
|
250
|
+
}
|
|
251
|
+
return { kind: "success", text: `${formatTune(report, applied)}\nОтчёт: ${reportFile}` };
|
|
252
|
+
}
|
|
176
253
|
if (command === "sync" || command === "force") {
|
|
177
254
|
const force = command === "force";
|
|
178
255
|
const result = installSkills(ctx.logger, { force });
|