docks-kit 0.25.0 → 0.27.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 (46) hide show
  1. package/AGENTS.md +12 -10
  2. package/README.md +40 -30
  3. package/cli/dist/docks-kit.js +24701 -0
  4. package/cli/docs/command-guards.md +8 -5
  5. package/cli/docs/install.md +41 -32
  6. package/cli/docs/omp-context.md +1 -1
  7. package/cli/docs/omp-models.md +1 -1
  8. package/cli/docs/overview.md +3 -3
  9. package/cli/docs/platforms.md +8 -8
  10. package/cli/src/agentDocs/agentFirstCheck.ts +786 -0
  11. package/cli/src/agentDocs/bridgeCheck.ts +226 -0
  12. package/cli/src/agentDocs/commands.ts +63 -0
  13. package/cli/src/agentDocs/prTemplate.ts +211 -0
  14. package/cli/src/agentDocs/services.ts +202 -0
  15. package/cli/src/agentDocs/shared.ts +730 -0
  16. package/cli/src/agentDocs/verifySkill.ts +136 -0
  17. package/cli/src/argv.ts +25 -1
  18. package/cli/src/commands/agentDocs.ts +29 -0
  19. package/cli/src/commands/plan.ts +29 -0
  20. package/cli/src/commands/skill.ts +29 -0
  21. package/cli/src/commands/update.ts +90 -66
  22. package/cli/src/engine-native/DESIGN.md +10 -9
  23. package/cli/src/engine-native/os/targets.ts +6 -19
  24. package/cli/src/engine.ts +0 -6
  25. package/cli/src/generated/sotPayload.ts +51 -79
  26. package/cli/src/kitHome.ts +7 -10
  27. package/cli/src/main.ts +12 -4
  28. package/cli/src/plan/bytes.ts +110 -0
  29. package/cli/src/plan/checkout.ts +379 -0
  30. package/cli/src/plan/commands.ts +1192 -0
  31. package/cli/src/plan/github.ts +816 -0
  32. package/cli/src/plan/records.ts +623 -0
  33. package/cli/src/plan/repository.ts +53 -0
  34. package/cli/src/plan/reviews.ts +292 -0
  35. package/cli/src/plan/services.ts +256 -0
  36. package/cli/src/plan/types.ts +164 -0
  37. package/cli/src/skills/commands.ts +142 -0
  38. package/cli/src/skills/config.json +30 -0
  39. package/cli/src/skills/files.ts +74 -0
  40. package/cli/src/skills/frontmatter.ts +148 -0
  41. package/cli/src/skills/guard.ts +366 -0
  42. package/cli/src/skills/kitGate.ts +406 -0
  43. package/cli/src/skills/rubric.ts +143 -0
  44. package/docks-kit +9 -40
  45. package/docks-kit.ps1 +10 -61
  46. package/package.json +10 -8
package/docks-kit.ps1 CHANGED
@@ -1,20 +1,20 @@
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.
1
+ # docks-kit.ps1 - Windows checkout launcher. It runs cli\src\main.ts with Bun
2
+ # and installs Bun and node_modules when they are missing.
5
3
  Set-StrictMode -Version Latest
6
4
  $ErrorActionPreference = 'Stop'
7
5
 
8
6
  $RepoDir = Split-Path -Parent $MyInvocation.MyCommand.Path
9
7
 
10
8
  # BEGIN GENERATED BUN PIN
11
- $BunPin = "1.4.4"
9
+ $BunPin = "1.4.5"
12
10
  # END GENERATED BUN PIN
13
11
 
14
12
  # BEGIN GENERATED BUN FLOOR
15
- $BunFloor = "1.4.4"
13
+ $BunFloor = "1.4.5"
16
14
  # END GENERATED BUN FLOOR
17
15
 
16
+ # Reject an unsupported host before the Bun install, so that the user gets
17
+ # one clear message instead of a failed download or a failed source run.
18
18
  $ProcessorArchitecture = if (-not [string]::IsNullOrWhiteSpace($env:PROCESSOR_ARCHITEW6432)) {
19
19
  $env:PROCESSOR_ARCHITEW6432
20
20
  } else {
@@ -23,8 +23,8 @@ $ProcessorArchitecture = if (-not [string]::IsNullOrWhiteSpace($env:PROCESSOR_AR
23
23
  if ([string]::IsNullOrWhiteSpace($ProcessorArchitecture)) {
24
24
  $ProcessorArchitecture = '<unknown>'
25
25
  }
26
- $KitBin = switch ($ProcessorArchitecture) {
27
- 'AMD64' { 'docks-kit-windows-x64.exe' }
26
+ switch ($ProcessorArchitecture) {
27
+ 'AMD64' { }
28
28
  default {
29
29
  $HostName = "Windows-$ProcessorArchitecture"
30
30
  [Console]::Error.WriteLine("[docks-kit] unsupported host $HostName; docks-kit supports Linux on x64 and arm64, macOS on arm64, and Windows on x64.")
@@ -32,57 +32,6 @@ $KitBin = switch ($ProcessorArchitecture) {
32
32
  }
33
33
  }
34
34
 
35
- $KitPath = Join-Path (Join-Path $RepoDir 'cli\dist') $KitBin
36
- if (Test-Path -LiteralPath $KitPath -PathType Leaf) {
37
- $CheckoutVersion = ''
38
- try {
39
- $Manifest = Get-Content -LiteralPath (Join-Path $RepoDir 'package.json') -Raw | ConvertFrom-Json
40
- if ($Manifest.version -is [string]) {
41
- $CheckoutVersion = $Manifest.version
42
- }
43
- } catch {
44
- $CheckoutVersion = ''
45
- }
46
-
47
- $BinVersion = ''
48
- try {
49
- $BinOutput = & $KitPath --version 2>$null
50
- if ($LASTEXITCODE -eq 0) {
51
- $BinVersion = ([string]($BinOutput -join "`n")).TrimEnd("`r")
52
- }
53
- } catch {
54
- $BinVersion = ''
55
- }
56
-
57
- if (-not [string]::IsNullOrEmpty($CheckoutVersion) -and $BinVersion -eq $CheckoutVersion) {
58
- # A matching version does not prove matching content. Unreleased work does
59
- # not move package.json, so a binary compiled before it still reports the
60
- # checkout version and would silently shadow the source it predates.
61
- # The binary also embeds the cli/docs topics, so scan both trees.
62
- $NewerSource = $null
63
- $ScanDirs = @(
64
- @((Join-Path $RepoDir 'cli\src'), (Join-Path $RepoDir 'cli\docs')) |
65
- Where-Object { Test-Path -LiteralPath $_ -PathType Container }
66
- )
67
- if ($ScanDirs.Count -gt 0) {
68
- $BinWritten = (Get-Item -LiteralPath $KitPath).LastWriteTimeUtc
69
- $NewerSource = Get-ChildItem -LiteralPath $ScanDirs -Recurse -File -ErrorAction SilentlyContinue |
70
- Where-Object { $_.LastWriteTimeUtc -gt $BinWritten } |
71
- Select-Object -First 1
72
- }
73
- if ($null -eq $NewerSource) {
74
- & $KitPath @args
75
- exit $LASTEXITCODE
76
- }
77
- $NewerRelative = $NewerSource.FullName.Substring($RepoDir.Length).TrimStart('\', '/')
78
- [Console]::Error.WriteLine("[docks-kit] ignoring cli/dist/$KitBin; $NewerRelative is newer than the binary - running from source; run 'bun run build:binaries' to refresh it or delete it")
79
- } else {
80
- $DisplayedBinVersion = if ([string]::IsNullOrEmpty($BinVersion)) { '<unknown>' } else { $BinVersion }
81
- $DisplayedCheckoutVersion = if ([string]::IsNullOrEmpty($CheckoutVersion)) { '<unknown>' } else { $CheckoutVersion }
82
- [Console]::Error.WriteLine("[docks-kit] ignoring stale cli/dist/$KitBin $DisplayedBinVersion; checkout is $DisplayedCheckoutVersion - running from source; run 'bun run build:binaries' to refresh it or delete it")
83
- }
84
- }
85
-
86
35
  function Find-Bun {
87
36
  $Command = Get-Command bun -CommandType Application -ErrorAction SilentlyContinue | Select-Object -First 1
88
37
  if ($null -ne $Command) {
@@ -115,13 +64,13 @@ if ($null -eq $Bun) {
115
64
  # upstream documents, matching os/windows.ts bunInstaller.
116
65
  & powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File $TempInstaller -Version $BunPin *> $null
117
66
  } catch {
118
- # The recovery guidance below is shared by download and installer failures.
67
+ # The install guidance below is shared by download and installer failures.
119
68
  } finally {
120
69
  Remove-Item -LiteralPath $TempInstaller -Force -ErrorAction SilentlyContinue
121
70
  }
122
71
  $Bun = Find-Bun
123
72
  if ($null -eq $Bun) {
124
- [Console]::Error.WriteLine('[docks-kit] Bun install failed. Download a docks-kit release binary for a no-Bun recovery path.')
73
+ [Console]::Error.WriteLine('[docks-kit] Bun install failed. Install Bun manually from https://bun.sh, then run docks-kit again.')
125
74
  exit 1
126
75
  }
127
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docks-kit",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "Portable AI coding agent config kit — SoT sync engine + typed CLI for Oh My Pi",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -11,13 +11,14 @@
11
11
  ],
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "git+https://github.com/DocksDocks/public.git"
14
+ "url": "git+https://github.com/DocksDocks/docks-kit.git"
15
15
  },
16
16
  "bin": {
17
- "docks-kit": "cli/src/main.ts"
17
+ "docks-kit": "cli/dist/docks-kit.js"
18
18
  },
19
19
  "files": [
20
20
  "cli/src",
21
+ "cli/dist/docks-kit.js",
21
22
  "cli/docs",
22
23
  "cli/tsconfig.json",
23
24
  "docks-kit",
@@ -27,15 +28,15 @@
27
28
  ],
28
29
  "scripts": {
29
30
  "typecheck": "bun check --no-script -b -p cli",
30
- "build:binaries": "bash cli/build-binaries.sh",
31
- "smoke:native": "bun cli/scripts/native-smoke.ts",
31
+ "build:bundle": "bun cli/scripts/build-bundle.ts",
32
32
  "smoke:package": "bun cli/scripts/package-smoke.ts",
33
33
  "check:generated": "bun cli/scripts/generate-sot-payload.ts --check",
34
- "prepack": "bun run check:generated",
34
+ "prepack": "bun run check:generated && bun run build:bundle",
35
35
  "golden:dryrun": "bun cli/test/golden-dryrun.ts",
36
36
  "golden:mutation": "bun cli/test/golden-mutation.ts",
37
37
  "test:unit": "vitest run",
38
- "test:ci": "bun run check:generated && bun run --parallel typecheck test:unit golden:dryrun golden:mutation format:check",
38
+ "test:unit:portable": "vitest run --project unit --project backstop",
39
+ "test:ci": "bun run check:generated && bun run --parallel typecheck test:unit:portable golden:dryrun golden:mutation format:check",
39
40
  "test:integration": "bun run --parallel golden:dryrun golden:mutation",
40
41
  "test": "bun run --parallel test:unit test:integration",
41
42
  "lint": "oxlint",
@@ -52,7 +53,8 @@
52
53
  },
53
54
  "devDependencies": {
54
55
  "@effect/tsgo": "0.64.1",
55
- "@types/bun": "1.4.4",
56
+ "@types/bun": "1.4.5",
57
+ "fast-check": "4.10.2",
56
58
  "oxlint": "1.91.0",
57
59
  "typescript": "7.0.2",
58
60
  "vitest": "5.1.0"