sdtk-ops-kit 0.2.2 → 0.2.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.
@@ -1,131 +1,168 @@
1
- param(
2
- [Parameter(Mandatory = $true)]
3
- [ValidateSet('codex', 'claude')]
4
- [string]$Runtime,
5
-
6
- [string]$ProjectPath,
7
-
8
- [ValidateSet('project', 'user', '')]
9
- [string]$Scope = '',
10
-
11
- [switch]$Force,
12
- [switch]$SkipRuntimeAssets,
13
- [switch]$SkipSkills,
14
- [switch]$Quiet
15
- )
16
-
17
- $ErrorActionPreference = 'Stop'
18
- Set-StrictMode -Version Latest
19
-
20
- function Copy-File {
21
- param(
22
- [Parameter(Mandatory = $true)][string]$SourcePath,
23
- [Parameter(Mandatory = $true)][string]$DestinationPath,
24
- [Parameter(Mandatory = $true)][bool]$Overwrite
25
- )
26
-
27
- if (-not (Test-Path -LiteralPath $SourcePath)) {
28
- throw "Missing source file: $SourcePath"
29
- }
30
-
31
- if ((Test-Path -LiteralPath $DestinationPath) -and -not $Overwrite) {
32
- if (-not $Quiet) {
33
- Write-Warning "Already exists (skipping). Use -Force to overwrite: $DestinationPath"
34
- }
35
- return
36
- }
37
-
38
- $parent = Split-Path -Parent $DestinationPath
39
- if ($parent -and -not (Test-Path -LiteralPath $parent)) {
40
- New-Item -ItemType Directory -Force -Path $parent | Out-Null
41
- }
42
-
43
- Copy-Item -LiteralPath $SourcePath -Destination $DestinationPath -Force
44
- }
45
-
46
- function Resolve-OrCreateDirectory {
47
- param(
48
- [Parameter(Mandatory = $true)][string]$Path
49
- )
50
-
51
- if (-not (Test-Path -LiteralPath $Path)) {
52
- New-Item -ItemType Directory -Force -Path $Path | Out-Null
53
- }
54
-
55
- return (Resolve-Path -LiteralPath $Path).Path
56
- }
57
-
58
- $toolkitRoot = (Resolve-Path -LiteralPath $PSScriptRoot).Path
59
- if (-not $ProjectPath) {
60
- $ProjectPath = (Get-Location).Path
61
- }
62
- $projectRoot = Resolve-OrCreateDirectory -Path $ProjectPath
63
-
64
- if (-not $Scope) {
65
- $Scope = if ($Runtime -eq 'claude') { 'project' } else { 'user' }
66
- }
67
-
68
- if ($SkipSkills) {
69
- if (-not $Quiet) {
70
- Write-Warning "-SkipSkills is deprecated. Use -SkipRuntimeAssets instead."
71
- }
72
- $SkipRuntimeAssets = $true
73
- }
74
-
75
- if (-not $Quiet) {
76
- Write-Host "SDTK-OPS installer"
77
- Write-Host " Runtime: $Runtime"
78
- Write-Host " Scope: $Scope"
79
- Write-Host " Project: $projectRoot"
80
- Write-Host ""
81
- }
82
-
83
- $sharedFiles = @(
84
- 'AGENTS.md',
85
- 'sdtk-spec.config.json',
86
- 'sdtk-spec.config.profiles.example.json'
87
- )
88
-
89
- foreach ($fileName in $sharedFiles) {
90
- Copy-File `
91
- -SourcePath (Join-Path $toolkitRoot $fileName) `
92
- -DestinationPath (Join-Path $projectRoot $fileName) `
93
- -Overwrite ([bool]$Force)
94
-
95
- if (-not $Quiet) {
96
- Write-Host " [OK] $fileName"
97
- }
98
- }
99
-
100
- if (-not $SkipRuntimeAssets) {
101
- $scriptPath = if ($Runtime -eq 'claude') {
102
- Join-Path $toolkitRoot 'scripts/install-claude-skills.ps1'
103
- } else {
104
- Join-Path $toolkitRoot 'scripts/install-codex-skills.ps1'
105
- }
106
-
107
- if (-not (Test-Path -LiteralPath $scriptPath)) {
108
- throw "Missing runtime installer: $scriptPath"
109
- }
110
-
111
- if (-not $Quiet) {
112
- Write-Host ""
113
- Write-Host "Installing $Runtime runtime assets..."
114
- }
115
-
116
- $params = @{
117
- Scope = $Scope
118
- ProjectPath = $projectRoot
119
- Quiet = [bool]$Quiet
120
- }
121
- if ($Force) {
122
- $params.Force = $true
123
- }
124
-
125
- & $scriptPath @params
126
- }
127
-
128
- if (-not $Quiet) {
129
- Write-Host ""
130
- Write-Host "SDTK-OPS installation complete."
131
- }
1
+ param(
2
+ [Parameter(Mandatory = $true)]
3
+ [ValidateSet('codex', 'claude')]
4
+ [string]$Runtime,
5
+
6
+ [string]$ProjectPath,
7
+
8
+ [ValidateSet('project', 'user', '')]
9
+ [string]$Scope = '',
10
+
11
+ [switch]$Force,
12
+ [switch]$SkipRuntimeAssets,
13
+ [switch]$SkipSkills,
14
+ [switch]$Quiet
15
+ )
16
+
17
+ $ErrorActionPreference = 'Stop'
18
+ Set-StrictMode -Version Latest
19
+
20
+ function Copy-File {
21
+ param(
22
+ [Parameter(Mandatory = $true)][string]$SourcePath,
23
+ [Parameter(Mandatory = $true)][string]$DestinationPath,
24
+ [Parameter(Mandatory = $true)][bool]$Overwrite
25
+ )
26
+
27
+ if (-not (Test-Path -LiteralPath $SourcePath)) {
28
+ throw "Missing source file: $SourcePath"
29
+ }
30
+
31
+ if ((Test-Path -LiteralPath $DestinationPath) -and -not $Overwrite) {
32
+ if (-not $Quiet) {
33
+ Write-Warning "Already exists (skipping). Use -Force to overwrite: $DestinationPath"
34
+ }
35
+ return
36
+ }
37
+
38
+ $parent = Split-Path -Parent $DestinationPath
39
+ if ($parent -and -not (Test-Path -LiteralPath $parent)) {
40
+ New-Item -ItemType Directory -Force -Path $parent | Out-Null
41
+ }
42
+
43
+ Copy-Item -LiteralPath $SourcePath -Destination $DestinationPath -Force
44
+ }
45
+
46
+ function Test-IsMaintainerRoot {
47
+ param(
48
+ [Parameter(Mandatory = $true)][string]$ProjectRoot,
49
+ [Parameter(Mandatory = $true)][string[]]$Markers
50
+ )
51
+
52
+ foreach ($marker in $Markers) {
53
+ if (-not (Test-Path -LiteralPath (Join-Path $ProjectRoot $marker))) {
54
+ return $false
55
+ }
56
+ }
57
+
58
+ return $true
59
+ }
60
+
61
+ function Get-MaintainerRootInstallMessage {
62
+ param(
63
+ [Parameter(Mandatory = $true)][string]$ProjectRoot
64
+ )
65
+
66
+ return @(
67
+ "Refusing to install managed project files into the SDTK maintainer repo root: $ProjectRoot"
68
+ "This install flow would overwrite repo-owned files such as AGENTS.md, CODEX.md, CLAUDE.md, sdtk-spec.config.json, sdtk-spec.config.profiles.example.json."
69
+ "Target a consumer project path instead of the SDTK maintainer monorepo root."
70
+ "If you only need runtime assets, install them into a separate consumer project path rather than the maintainer repo root."
71
+ ) -join "`n"
72
+ }
73
+
74
+ function Resolve-OrCreateDirectory {
75
+ param(
76
+ [Parameter(Mandatory = $true)][string]$Path
77
+ )
78
+
79
+ if (-not (Test-Path -LiteralPath $Path)) {
80
+ New-Item -ItemType Directory -Force -Path $Path | Out-Null
81
+ }
82
+
83
+ return (Resolve-Path -LiteralPath $Path).Path
84
+ }
85
+
86
+ $toolkitRoot = (Resolve-Path -LiteralPath $PSScriptRoot).Path
87
+ if (-not $ProjectPath) {
88
+ $ProjectPath = (Get-Location).Path
89
+ }
90
+ $projectRoot = Resolve-OrCreateDirectory -Path $ProjectPath
91
+
92
+ $maintainerRootMarkers = @(
93
+ 'governance/ai/core/IMPROVEMENT_BACKLOG.md',
94
+ 'products/sdtk-ops/toolkit/install.ps1'
95
+ )
96
+
97
+ if (Test-IsMaintainerRoot -ProjectRoot $projectRoot -Markers $maintainerRootMarkers) {
98
+ throw (Get-MaintainerRootInstallMessage -ProjectRoot $projectRoot)
99
+ }
100
+
101
+ if (-not $Scope) {
102
+ $Scope = if ($Runtime -eq 'claude') { 'project' } else { 'user' }
103
+ }
104
+
105
+ if ($SkipSkills) {
106
+ if (-not $Quiet) {
107
+ Write-Warning "-SkipSkills is deprecated. Use -SkipRuntimeAssets instead."
108
+ }
109
+ $SkipRuntimeAssets = $true
110
+ }
111
+
112
+ if (-not $Quiet) {
113
+ Write-Host "SDTK-OPS installer"
114
+ Write-Host " Runtime: $Runtime"
115
+ Write-Host " Scope: $Scope"
116
+ Write-Host " Project: $projectRoot"
117
+ Write-Host ""
118
+ }
119
+
120
+ $sharedFiles = @(
121
+ 'AGENTS.md',
122
+ 'sdtk-spec.config.json',
123
+ 'sdtk-spec.config.profiles.example.json'
124
+ )
125
+
126
+ foreach ($fileName in $sharedFiles) {
127
+ Copy-File `
128
+ -SourcePath (Join-Path $toolkitRoot $fileName) `
129
+ -DestinationPath (Join-Path $projectRoot $fileName) `
130
+ -Overwrite ([bool]$Force)
131
+
132
+ if (-not $Quiet) {
133
+ Write-Host " [OK] $fileName"
134
+ }
135
+ }
136
+
137
+ if (-not $SkipRuntimeAssets) {
138
+ $scriptPath = if ($Runtime -eq 'claude') {
139
+ Join-Path $toolkitRoot 'scripts/install-claude-skills.ps1'
140
+ } else {
141
+ Join-Path $toolkitRoot 'scripts/install-codex-skills.ps1'
142
+ }
143
+
144
+ if (-not (Test-Path -LiteralPath $scriptPath)) {
145
+ throw "Missing runtime installer: $scriptPath"
146
+ }
147
+
148
+ if (-not $Quiet) {
149
+ Write-Host ""
150
+ Write-Host "Installing $Runtime runtime assets..."
151
+ }
152
+
153
+ $params = @{
154
+ Scope = $Scope
155
+ ProjectPath = $projectRoot
156
+ Quiet = [bool]$Quiet
157
+ }
158
+ if ($Force) {
159
+ $params.Force = $true
160
+ }
161
+
162
+ & $scriptPath @params
163
+ }
164
+
165
+ if (-not $Quiet) {
166
+ Write-Host ""
167
+ Write-Host "SDTK-OPS installation complete."
168
+ }
package/package.json CHANGED
@@ -1,46 +1,46 @@
1
- {
2
- "name": "sdtk-ops-kit",
3
- "version": "0.2.2",
4
- "description": "Skill-driven operations toolkit for deployment, verification, monitoring, incident response, backup, security, compliance, and cost discipline.",
5
- "bin": {
6
- "sdtk-ops": "./bin/sdtk-ops.js"
7
- },
8
- "main": "src/index.js",
9
- "type": "commonjs",
10
- "repository": {
11
- "type": "git",
12
- "url": "https://github.com/codexsdtk/sdtk-toolkit.git",
13
- "directory": "products/sdtk-ops/distribution/sdtk-ops-kit"
14
- },
15
- "homepage": "https://github.com/codexsdtk/sdtk-toolkit/tree/main/products/sdtk-ops/distribution/sdtk-ops-kit",
16
- "bugs": {
17
- "url": "https://github.com/codexsdtk/sdtk-toolkit/issues"
18
- },
19
- "files": [
20
- "bin/",
21
- "src/",
22
- "assets/"
23
- ],
24
- "scripts": {
25
- "test": "powershell -ExecutionPolicy Bypass -Command \"$ErrorActionPreference = 'Stop'; Set-Location '..\\..\\..\\..'; python -m unittest -v tests.test_sdtk_ops_cli\"",
26
- "build:payload": "powershell -ExecutionPolicy Bypass -Command \"$ErrorActionPreference = 'Stop'; & 'scripts/sync-toolkit-assets.ps1'; & 'scripts/build-toolkit-manifest.ps1'\"",
27
- "verify:payload": "node -e \"require('./src/lib/toolkit-payload').verify()\"",
28
- "pack:smoke": "powershell -ExecutionPolicy Bypass -File scripts/pack-smoke.ps1",
29
- "prepublishOnly": "npm run build:payload && npm run verify:payload"
30
- },
31
- "engines": {
32
- "node": ">=18.13.0"
33
- },
34
- "keywords": [
35
- "sdtk-ops",
36
- "cli",
37
- "toolkit",
38
- "operations",
39
- "claude",
40
- "codex"
41
- ],
42
- "license": "MIT",
43
- "publishConfig": {
44
- "access": "public"
45
- }
46
- }
1
+ {
2
+ "name": "sdtk-ops-kit",
3
+ "version": "0.2.4",
4
+ "description": "Skill-driven operations toolkit for deployment, verification, monitoring, incident response, backup, security, compliance, and cost discipline.",
5
+ "bin": {
6
+ "sdtk-ops": "./bin/sdtk-ops.js"
7
+ },
8
+ "main": "src/index.js",
9
+ "type": "commonjs",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/codexsdtk/sdtk-toolkit.git",
13
+ "directory": "products/sdtk-ops/distribution/sdtk-ops-kit"
14
+ },
15
+ "homepage": "https://github.com/codexsdtk/sdtk-toolkit/tree/main/products/sdtk-ops/distribution/sdtk-ops-kit",
16
+ "bugs": {
17
+ "url": "https://github.com/codexsdtk/sdtk-toolkit/issues"
18
+ },
19
+ "files": [
20
+ "bin/",
21
+ "src/",
22
+ "assets/"
23
+ ],
24
+ "scripts": {
25
+ "test": "powershell -ExecutionPolicy Bypass -Command \"$ErrorActionPreference = 'Stop'; Set-Location '..\\..\\..\\..'; python -m unittest -v tests.test_sdtk_ops_cli\"",
26
+ "build:payload": "powershell -ExecutionPolicy Bypass -Command \"$ErrorActionPreference = 'Stop'; & 'scripts/sync-toolkit-assets.ps1'; & 'scripts/build-toolkit-manifest.ps1'\"",
27
+ "verify:payload": "node -e \"require('./src/lib/toolkit-payload').verify()\"",
28
+ "pack:smoke": "powershell -ExecutionPolicy Bypass -File scripts/pack-smoke.ps1",
29
+ "prepublishOnly": "npm run build:payload && npm run verify:payload"
30
+ },
31
+ "engines": {
32
+ "node": ">=18.13.0"
33
+ },
34
+ "keywords": [
35
+ "sdtk-ops",
36
+ "cli",
37
+ "toolkit",
38
+ "operations",
39
+ "claude",
40
+ "codex"
41
+ ],
42
+ "license": "MIT",
43
+ "publishConfig": {
44
+ "access": "public"
45
+ }
46
+ }
@@ -10,37 +10,50 @@ function cmdHelp() {
10
10
  "Commands:",
11
11
  " init Initialize SDTK-OPS files in a project",
12
12
  " runtime Manage runtime asset installation (install, uninstall, status)",
13
+ " update Refresh the npm package and optionally re-apply managed project/runtime assets",
13
14
  " help Show this help message",
14
15
  "",
15
- "Current supported surface:",
16
- " Supported now: help, init, runtime install|status|uninstall",
17
- " Not supported: generate",
18
- " Package scope: public npm package",
19
- "",
20
- "DEV-Run intake:",
21
- " Canonical intake artifact: docs/dev/OPS_HANDOFF_[FEATURE_KEY].json",
22
- " READY_FOR_SDTK_OPS: start from suggested_next_ops_path or confirm it with ops-discover.",
23
- " BLOCKED_FOR_SDTK_OPS: inspect blockers and evidence refs, but do not treat it as normal ready-path execution.",
24
- " SDTK-OPS consumes the frozen handoff contract and does not redefine the schema.",
25
- "",
26
- "Workflow entry:",
27
- " After init, choose a journey directly if the goal is clear.",
28
- " Canonical journeys: deployment, incident, monitoring, backup/recovery.",
29
- " If the correct path is unclear, start with the ops-discover skill.",
30
- " ops-parallel remains valid only for independent slices; if collab/subagent dispatch is unavailable in the active runtime, keep the same split but execute sequentially.",
31
- " Close every journey with ops-verify before declaring work complete.",
32
- "",
33
- "Runtime support:",
34
- " Claude: project + user scope",
35
- " Codex: default user scope plus bounded project scope via <project>/.codex",
36
- " Codex project scope requires the explicit local CODEX_HOME=<project>/.codex contract",
37
- " Native .codex/skills auto-discovery is not claimed",
16
+ "Current supported surface:",
17
+ " Supported now: help, init, runtime install|status|uninstall",
18
+ " Not supported: generate",
19
+ " Package scope: public npm package",
20
+ "",
21
+ "DEV-Run intake:",
22
+ " Canonical intake artifact: docs/dev/OPS_HANDOFF_[FEATURE_KEY].json",
23
+ " READY_FOR_SDTK_OPS: start from suggested_next_ops_path or confirm it with ops-discover.",
24
+ " BLOCKED_FOR_SDTK_OPS: inspect blockers and evidence refs, but do not treat it as normal ready-path execution.",
25
+ " SDTK-OPS consumes the frozen handoff contract and does not redefine the schema.",
26
+ "",
27
+ "Workflow entry:",
28
+ " After init, choose a journey directly if the goal is clear.",
29
+ " Canonical journeys: deployment, incident, monitoring, backup/recovery.",
30
+ " If the correct path is unclear, start with the ops-discover skill.",
31
+ " ops-parallel remains valid only for independent slices; if collab/subagent dispatch is unavailable in the active runtime, keep the same split but execute sequentially.",
32
+ " Close every journey with ops-verify before declaring work complete.",
33
+ "",
34
+ "Runtime support:",
35
+ " Claude: project + user scope",
36
+ " Codex: default user scope plus bounded project scope via <project>/.codex",
37
+ " Codex project scope requires the explicit local CODEX_HOME=<project>/.codex contract",
38
+ " Native .codex/skills auto-discovery is not claimed",
38
39
  "",
39
40
  "Runtime commands:",
40
41
  " sdtk-ops runtime install --runtime <codex|claude> [--scope <project|user>] [--project-path <path>]",
41
42
  " sdtk-ops runtime uninstall --runtime <codex|claude> [--scope <project|user>] [--all] [--project-path <path>]",
42
43
  " sdtk-ops runtime status --runtime <codex|claude> [--project-path <path>]",
43
44
  "",
45
+ "Update options:",
46
+ " --version <latest|x.y.z> Target published npm package version (default: latest)",
47
+ " --runtime <codex|claude> Optional runtime refresh target after npm update",
48
+ " --scope <project|user> Runtime asset scope when --runtime is provided",
49
+ " --project-path <path> Target project directory for managed file refresh (default: cwd)",
50
+ " --check-only Print the planned npm/init/runtime refresh steps without making changes",
51
+ " --skip-project-files Skip sdtk-ops init --force during update",
52
+ " --skip-runtime-assets Skip sdtk-ops runtime install --force during update",
53
+ " --verbose Show detailed command output",
54
+ " Maintainer-root guard: init/update refuse the SDTK maintainer monorepo root as a managed project target.",
55
+ " Use a consumer project path, or use --skip-project-files when update should avoid project-file refresh.",
56
+ "",
44
57
  "Uninstall behavior:",
45
58
  " runtime uninstall removes only SDTK-OPS-managed skill folders for the selected runtime/scope.",
46
59
  " It does not delete parent runtime roots such as .claude/, .claude/skills/, $CODEX_HOME/, or $CODEX_HOME/skills/.",
@@ -53,10 +66,13 @@ function cmdHelp() {
53
66
  "Examples:",
54
67
  " sdtk-ops --help",
55
68
  " sdtk-ops --version",
56
- " sdtk-ops init --runtime claude --project-path ./my-project",
57
- " sdtk-ops init --runtime codex --runtime-scope project --project-path ./my-project",
58
- " sdtk-ops runtime install --runtime claude --scope project --project-path ./my-project",
59
- " sdtk-ops runtime install --runtime codex --scope project --project-path ./my-project",
69
+ " sdtk-ops init --runtime claude --project-path ./my-project",
70
+ " sdtk-ops update --check-only",
71
+ " sdtk-ops update --runtime claude --project-path ./my-project",
72
+ " sdtk-ops update --version 1.2.3 --runtime codex --scope user --skip-project-files",
73
+ " sdtk-ops init --runtime codex --runtime-scope project --project-path ./my-project",
74
+ " sdtk-ops runtime install --runtime claude --scope project --project-path ./my-project",
75
+ " sdtk-ops runtime install --runtime codex --scope project --project-path ./my-project",
60
76
  " # Journey routing after init:",
61
77
  " # deployment -> ops-plan -> ops-infra-plan -> ops-container -> ops-ci-cd -> ops-deploy -> ops-monitor -> ops-verify",
62
78
  " # incident -> ops-incident -> ops-debug -> ops-monitor -> ops-verify",