docks-kit 0.15.2 → 0.15.4

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 (38) hide show
  1. package/AGENTS.md +21 -15
  2. package/README.md +33 -31
  3. package/cli/docs/flags.md +0 -1
  4. package/cli/docs/install.md +41 -30
  5. package/cli/docs/overview.md +2 -2
  6. package/cli/docs/platforms.md +5 -2
  7. package/cli/docs/sync-layers.md +3 -4
  8. package/cli/docs/toolchain.md +28 -34
  9. package/cli/src/commands/docs.ts +3 -3
  10. package/cli/src/commands/sync.ts +0 -5
  11. package/cli/src/commands/toolchain.ts +4 -7
  12. package/cli/src/commands/update.ts +77 -26
  13. package/cli/src/engine-native/DESIGN.md +31 -22
  14. package/cli/src/engine-native/bun.ts +10 -8
  15. package/cli/src/engine-native/claudeRuntime.ts +17 -9
  16. package/cli/src/engine-native/claudeSync.ts +52 -24
  17. package/cli/src/engine-native/codexSync.ts +10 -5
  18. package/cli/src/engine-native/deps.ts +27 -88
  19. package/cli/src/engine-native/exec.ts +41 -10
  20. package/cli/src/engine-native/index.ts +0 -2
  21. package/cli/src/engine-native/modes.ts +23 -14
  22. package/cli/src/engine-native/os/darwin.ts +62 -0
  23. package/cli/src/engine-native/os/index.ts +42 -0
  24. package/cli/src/engine-native/os/linux.ts +62 -0
  25. package/cli/src/engine-native/os/targets.ts +73 -0
  26. package/cli/src/engine-native/os/types.ts +75 -0
  27. package/cli/src/engine-native/os/windows.ts +176 -0
  28. package/cli/src/engine-native/parseArgs.ts +0 -4
  29. package/cli/src/engine-native/services.ts +0 -6
  30. package/cli/src/engine-native/skillsSync.ts +125 -77
  31. package/cli/src/engine-native/toolchain.ts +4 -150
  32. package/cli/src/engine.ts +8 -7
  33. package/cli/src/generated/sotPayload.ts +6 -6
  34. package/cli/src/manifests.ts +12 -2
  35. package/docks-kit +43 -2
  36. package/docks-kit.ps1 +153 -0
  37. package/package.json +11 -7
  38. package/cli/src/engine-native/os.ts +0 -16
package/docks-kit.ps1 ADDED
@@ -0,0 +1,153 @@
1
+ # docks-kit.ps1 — Windows launcher. Resolution order:
2
+ # 1. version-matching compiled binary in cli/dist/ (bun build --compile output)
3
+ # 2. Bun from source (auto-installs Bun + node_modules when missing)
4
+ # No-Bun recovery path: download a release binary for your platform.
5
+ Set-StrictMode -Version Latest
6
+ $ErrorActionPreference = 'Stop'
7
+
8
+ $RepoDir = Split-Path -Parent $MyInvocation.MyCommand.Path
9
+
10
+ # BEGIN GENERATED BUN PIN
11
+ $BunPin = "1.4.0"
12
+ # END GENERATED BUN PIN
13
+
14
+ # BEGIN GENERATED BUN FLOOR
15
+ $BunFloor = "1.4.0"
16
+ # END GENERATED BUN FLOOR
17
+
18
+ $ProcessorArchitecture = if (-not [string]::IsNullOrWhiteSpace($env:PROCESSOR_ARCHITEW6432)) {
19
+ $env:PROCESSOR_ARCHITEW6432
20
+ } else {
21
+ $env:PROCESSOR_ARCHITECTURE
22
+ }
23
+ if ([string]::IsNullOrWhiteSpace($ProcessorArchitecture)) {
24
+ $ProcessorArchitecture = '<unknown>'
25
+ }
26
+ $KitBin = switch ($ProcessorArchitecture) {
27
+ 'AMD64' { 'docks-kit-windows-x64.exe' }
28
+ 'ARM64' { 'docks-kit-windows-arm64.exe' }
29
+ default {
30
+ $HostName = "Windows-$ProcessorArchitecture"
31
+ [Console]::Error.WriteLine("[docks-kit] unsupported host $HostName; docks-kit supports Linux, macOS, and Windows on x64 or arm64.")
32
+ exit 1
33
+ }
34
+ }
35
+
36
+ $KitPath = Join-Path (Join-Path $RepoDir 'cli\dist') $KitBin
37
+ if (Test-Path -LiteralPath $KitPath -PathType Leaf) {
38
+ $CheckoutVersion = ''
39
+ try {
40
+ $Manifest = Get-Content -LiteralPath (Join-Path $RepoDir 'package.json') -Raw | ConvertFrom-Json
41
+ if ($Manifest.version -is [string]) {
42
+ $CheckoutVersion = $Manifest.version
43
+ }
44
+ } catch {
45
+ $CheckoutVersion = ''
46
+ }
47
+
48
+ $BinVersion = ''
49
+ try {
50
+ $BinOutput = & $KitPath --version 2>$null
51
+ if ($LASTEXITCODE -eq 0) {
52
+ $BinVersion = ([string]($BinOutput -join "`n")).TrimEnd("`r")
53
+ }
54
+ } catch {
55
+ $BinVersion = ''
56
+ }
57
+
58
+ if (-not [string]::IsNullOrEmpty($CheckoutVersion) -and $BinVersion -eq $CheckoutVersion) {
59
+ & $KitPath @args
60
+ exit $LASTEXITCODE
61
+ }
62
+
63
+ $DisplayedBinVersion = if ([string]::IsNullOrEmpty($BinVersion)) { '<unknown>' } else { $BinVersion }
64
+ $DisplayedCheckoutVersion = if ([string]::IsNullOrEmpty($CheckoutVersion)) { '<unknown>' } else { $CheckoutVersion }
65
+ [Console]::Error.WriteLine("[docks-kit] ignoring stale cli/dist/$KitBin $DisplayedBinVersion; checkout is $DisplayedCheckoutVersion — running from source")
66
+ }
67
+
68
+ function Find-Bun {
69
+ $Command = Get-Command bun -CommandType Application -ErrorAction SilentlyContinue | Select-Object -First 1
70
+ if ($null -ne $Command) {
71
+ return $Command.Source
72
+ }
73
+
74
+ $Candidates = @()
75
+ if (-not [string]::IsNullOrWhiteSpace($env:BUN_INSTALL)) {
76
+ $Candidates += Join-Path $env:BUN_INSTALL 'bin\bun.exe'
77
+ }
78
+ if (-not [string]::IsNullOrWhiteSpace($env:USERPROFILE)) {
79
+ $Candidates += Join-Path $env:USERPROFILE '.bun\bin\bun.exe'
80
+ }
81
+ foreach ($Candidate in $Candidates) {
82
+ if (Test-Path -LiteralPath $Candidate -PathType Leaf) {
83
+ return $Candidate
84
+ }
85
+ }
86
+ return $null
87
+ }
88
+
89
+ $Bun = Find-Bun
90
+ if ($null -eq $Bun) {
91
+ [Console]::Error.WriteLine('[docks-kit] Bun not found — installing (download-then-run)...')
92
+ $TempInstaller = Join-Path ([IO.Path]::GetTempPath()) "bun-install-$([Guid]::NewGuid().ToString('N')).ps1"
93
+ try {
94
+ Invoke-WebRequest -Uri 'https://bun.sh/install.ps1' -OutFile $TempInstaller -UseBasicParsing
95
+ # A downloaded .ps1 carries a Mark-of-the-Web, so calling it directly is
96
+ # blocked under the default RemoteSigned policy. Use the invocation form
97
+ # upstream documents, matching os/windows.ts bunInstaller.
98
+ & powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File $TempInstaller -Version $BunPin *> $null
99
+ } catch {
100
+ # The recovery guidance below is shared by download and installer failures.
101
+ } finally {
102
+ Remove-Item -LiteralPath $TempInstaller -Force -ErrorAction SilentlyContinue
103
+ }
104
+ $Bun = Find-Bun
105
+ if ($null -eq $Bun) {
106
+ [Console]::Error.WriteLine('[docks-kit] Bun install failed. Download a docks-kit release binary for a no-Bun recovery path.')
107
+ exit 1
108
+ }
109
+ }
110
+
111
+ # Sentinel is a real dependency dir, not bare node_modules\ — a failed or
112
+ # partial install leaves node_modules\ present and would suppress the repair.
113
+ if (-not (Test-Path -LiteralPath (Join-Path $RepoDir 'node_modules\effect') -PathType Container)) {
114
+ $DetectedBunVersion = ''
115
+ try {
116
+ $BunOutput = & $Bun --version 2>$null
117
+ if ($LASTEXITCODE -eq 0) {
118
+ $DetectedBunVersion = ([string]($BunOutput -join "`n")).TrimEnd("`r")
119
+ }
120
+ } catch {
121
+ $DetectedBunVersion = ''
122
+ }
123
+
124
+ $NormalizedBunVersion = $DetectedBunVersion -replace '[-+].*$', ''
125
+ $InstalledBunVersion = $null
126
+ $RequiredBunVersion = $null
127
+ if ($NormalizedBunVersion -match '^\d+\.\d+\.\d+$' -and $BunFloor -match '^\d+\.\d+\.\d+$') {
128
+ try {
129
+ $InstalledBunVersion = [version]::Parse($NormalizedBunVersion)
130
+ $RequiredBunVersion = [version]::Parse($BunFloor)
131
+ } catch {
132
+ $InstalledBunVersion = $null
133
+ $RequiredBunVersion = $null
134
+ }
135
+ }
136
+ if ($null -ne $InstalledBunVersion -and $null -ne $RequiredBunVersion -and $InstalledBunVersion -lt $RequiredBunVersion) {
137
+ [Console]::Error.WriteLine("[docks-kit] Bun $DetectedBunVersion is below the required floor $BunFloor; this checkout's lockfile requires Bun $BunFloor or newer. Run: bun upgrade")
138
+ exit 1
139
+ }
140
+ [Console]::Error.WriteLine('[docks-kit] Installing CLI dependencies (bun install --frozen-lockfile)...')
141
+ Push-Location $RepoDir
142
+ try {
143
+ & $Bun install --frozen-lockfile *> $null
144
+ if ($LASTEXITCODE -ne 0) {
145
+ exit $LASTEXITCODE
146
+ }
147
+ } finally {
148
+ Pop-Location
149
+ }
150
+ }
151
+
152
+ & $Bun (Join-Path $RepoDir 'cli\src\main.ts') @args
153
+ exit $LASTEXITCODE
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "docks-kit",
3
- "version": "0.15.2",
3
+ "version": "0.15.4",
4
4
  "description": "Portable AI coding agent config kit — SoT sync engine + typed CLI for Claude Code, Codex, and universal agent skills",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "os": [
8
8
  "linux",
9
- "darwin"
9
+ "darwin",
10
+ "win32"
10
11
  ],
11
12
  "repository": {
12
13
  "type": "git",
@@ -20,27 +21,30 @@
20
21
  "cli/docs",
21
22
  "cli/tsconfig.json",
22
23
  "docks-kit",
24
+ "docks-kit.ps1",
23
25
  "AGENTS.md",
24
26
  "README.md"
25
27
  ],
26
28
  "scripts": {
27
29
  "typecheck": "tsc --noEmit -p cli",
28
30
  "build:binaries": "bash cli/build-binaries.sh",
31
+ "smoke:native": "bun cli/scripts/native-smoke.ts",
29
32
  "check:generated": "bun cli/scripts/generate-sot-payload.ts --check",
30
33
  "prepack": "bun run check:generated",
31
34
  "golden:dryrun": "bun cli/test/golden-dryrun.ts",
32
35
  "golden:mutation": "bun cli/test/golden-mutation.ts",
33
36
  "test:unit": "vitest run",
34
37
  "test:runtime:posix": "bun cli/test/statusline-runtime-smoke.mjs posix",
35
- "test:ci": "bun run check:generated && bun run typecheck && bun run test:unit && bun run test:runtime:posix && bun run golden:dryrun && bun run golden:mutation"
38
+ "test:runtime:windows": "bun cli/test/statusline-runtime-smoke.mjs windows",
39
+ "test:ci": "bun run check:generated && bun run --parallel typecheck test:unit golden:dryrun golden:mutation && bun run test:runtime:posix"
36
40
  },
37
41
  "dependencies": {
38
- "@effect/platform-bun": "4.0.0-beta.107",
39
- "effect": "4.0.0-beta.107"
42
+ "@effect/platform-bun": "4.0.0-rc.109",
43
+ "effect": "4.0.0-rc.109"
40
44
  },
41
45
  "devDependencies": {
42
- "@effect/vitest": "4.0.0-beta.107",
43
- "@types/bun": "^1.3.0",
46
+ "@effect/vitest": "4.0.0-rc.109",
47
+ "@types/bun": "^1.4.0",
44
48
  "typescript": "7.0.2",
45
49
  "vitest": "4.1.10"
46
50
  }
@@ -1,16 +0,0 @@
1
- /**
2
- * Platform capability seam (Output Policy in DESIGN.md). Per-tool package
3
- * identifiers stay in deps.ts; symlink handling stays try-then-fallback at
4
- * the call site (capability-driven, not predicted).
5
- */
6
-
7
- export type PlatformName = "linux" | "darwin" | "unknown"
8
-
9
- export function rawPlatform(): NodeJS.Platform {
10
- return process.platform
11
- }
12
-
13
- export function platformName(pf: NodeJS.Platform = rawPlatform()): PlatformName {
14
- return pf === "linux" ? "linux" : pf === "darwin" ? "darwin" : "unknown"
15
- }
16
-