@runveric/cli 0.4.0 → 0.5.1

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  production runner image — without pushing anything or signing in.**
5
5
 
6
6
  ```sh
7
- npx @runveric/cli@0.4.0 init --id yourteam/restart-web-tier
7
+ npx @runveric/cli@0.5.1 init --id yourteam/restart-web-tier
8
8
  ```
9
9
 
10
10
  ---
@@ -32,14 +32,15 @@ script outside the platform. Nothing in the product offered that. This does.
32
32
 
33
33
  ## Requirements
34
34
 
35
- - **Node.js 22 or newer** — for `init`, `check` and `publish`.
36
- - **Docker** — for `test` only.
35
+ - **Node.js 22 or newer** — for `init`, `check`, `publish`, and `action init` / `action test`.
36
+ - **Docker** — for `test` only (an action package's phase runs in the runner image). `action test` runs
37
+ an engine action's phase in-process, with no Docker.
37
38
  - An **Runveric account** — for `publish` only.
38
39
 
39
40
  ## Install
40
41
 
41
42
  ```sh
42
- npx @runveric/cli@0.4.0 <command> # no install
43
+ npx @runveric/cli@0.5.1 <command> # no install
43
44
  npm install -g @runveric/cli # or install the `runveric` bin
44
45
  ```
45
46
 
@@ -62,7 +63,7 @@ Pin the version your Runveric deployment shows you on its Author page rather tha
62
63
  Scaffold a PowerShell action, look at what you got, validate it, and run it locally:
63
64
 
64
65
  ```sh
65
- $ npx @runveric/cli@0.4.0 init restart-web-tier \
66
+ $ npx @runveric/cli@0.5.1 init restart-web-tier \
66
67
  --id acme/restart-web-tier \
67
68
  --interpreter powershell \
68
69
  --yes
@@ -164,6 +165,67 @@ Publishing does not adopt. Nobody can run it until somebody chooses to.
164
165
 
165
166
  ---
166
167
 
168
+ ## Engine actions (`runveric action`)
169
+
170
+ The four verbs above author an action **package** — a script an interpreter runs. An **engine
171
+ action** is the other kind: TypeScript built into its own image, run by the engine one phase at a
172
+ time through the action protocol, with handlers written against
173
+ [`@runveric/action-sdk`](https://www.npmjs.com/package/@runveric/action-sdk). It has its own two
174
+ commands, so the four verbs keep meaning what they mean.
175
+
176
+ ```sh
177
+ npx @runveric/cli@0.5.1 action init action-azure-disk-snapshot --key azure.disk.snapshot --name "Snapshot Disk"
178
+ cd action-azure-disk-snapshot
179
+ npm install # writes package-lock.json — commit it; the publish workflow runs `npm ci --ignore-scripts`
180
+ npm test # type-checks src/, builds dist/index.js, then validate, execute and rollback through `action test`
181
+ ```
182
+
183
+ `action init` writes a repository that builds, tests and publishes with no hand step: `package.json`
184
+ (the SDK pinned exactly to the version this CLI was built against; a `typecheck` that `npm test` runs
185
+ first — esbuild strips types, so without it a type error would build and publish; a build that bundles
186
+ `src/index.ts` and the SDK into the one file the runtime loads, `dist/index.js`), `tsconfig.json`
187
+ (strict, against the installed SDK's types), `src/index.ts`
188
+ (`defineAction({ validate, execute, rollback })`, whose `execute` makes a restore point durable
189
+ before it acts), `catalog.yaml` (an engine `execution`, a beta version, an `azure/arm` target that
190
+ depends on its resource group), a test, `README.md`, `.gitignore`, and the catalog's publish workflow
191
+ — rendered from the same template, by the same function, as the catalog's own tooling plants it.
192
+ The directory defaults to the repository name the key maps to. It never overwrites a file.
193
+
194
+ `action test` runs ONE phase of the built `dist/index.js` through the real action runtime and a
195
+ **local engine**:
196
+
197
+ ```sh
198
+ runveric action test --phase validate --param resourceGroup=rg-example --param resource=example
199
+ runveric action test --phase execute --params-file test/params.json [--dry-run]
200
+ runveric action test --phase rollback --params-file test/params.json --prior-result test/prior-result.json
201
+ runveric action test --phase execute --params-file test/params.json --azure-token-from-az
202
+ ```
203
+
204
+ The invocation is built from `catalog.yaml` and the parameters, with the platform's own functions for
205
+ the parameter schema and the one target a run names. Every message the action sends is checked by the
206
+ protocol's own parsers, every checkpoint is acknowledged, and an execute's success is held to the
207
+ engine's rule that a destructive action records a restore point first. It prints the events, the
208
+ checks and the outcome, and exits 1 on a protocol violation or a failed outcome. `--prior-result` is
209
+ the record an execute prints: the restore point it made and its outcome.
210
+
211
+ **Credentials:** none by default — the action's `ctx.azure` refuses with a sentence saying how to give
212
+ one. `--azure-token-from-az` hands it ONE token for Azure Resource Manager from your own
213
+ `az account get-access-token`, held in memory for that run: never an environment variable, an
214
+ argument, a file or a line of output. It is **your** access, not the platform's minted, per-audience
215
+ tokens.
216
+
217
+ **This is a development loop, not the gate.** When the action runs in the platform, the engine judges
218
+ every message again, and the catalog's release workflow verifies and signs the image before anything
219
+ can run it. Neither happens here, and a local pass does not claim them.
220
+
221
+ Publishing is a tag equal to `catalog.yaml`'s `version`, in two jobs. `build`, which can write nothing,
222
+ installs with `npm ci --ignore-scripts` (no dependency's install script runs), type-checks and builds
223
+ `dist/index.js`. `publish`, which holds the package write, installs nothing: it builds the image from the
224
+ action runtime by digest, pushes it by digest and publishes the catalog artifact. The catalog's release
225
+ workflow then verifies and signs it.
226
+
227
+ ---
228
+
167
229
  ## Publishing first-party catalog artifacts (`runveric catalog`)
168
230
 
169
231
  Not part of authoring, and not something an author needs. The product's own catalog is pinned
@@ -172,21 +234,21 @@ publish and verify with these commands:
172
234
 
173
235
  ```sh
174
236
  # one action's manifest, verbatim — stdout: <key>=<repository>@<digest>
175
- npx @runveric/cli@0.4.0 catalog publish-action --manifest catalog.yaml \
237
+ npx @runveric/cli@0.5.1 catalog publish-action --manifest catalog.yaml \
176
238
  --to ghcr.io/<org>/action-azure-vm-stop
177
239
 
178
240
  # an ENGINE action: its manifest and the image its workflow pushed, by digest, to the same package
179
- npx @runveric/cli@0.4.0 catalog publish-action --manifest catalog.yaml \
241
+ npx @runveric/cli@0.5.1 catalog publish-action --manifest catalog.yaml \
180
242
  --to ghcr.io/<org>/action-azure-publicip-delete-unattached \
181
243
  --image ghcr.io/<org>/action-azure-publicip-delete-unattached@sha256:<digest>
182
244
 
183
245
  # a release naming each action artifact by digest — stdout: <repository>@<digest>
184
- npx @runveric/cli@0.4.0 catalog publish-release --from release.yaml --to ghcr.io/<org>/catalog
246
+ npx @runveric/cli@0.5.1 catalog publish-release --from release.yaml --to ghcr.io/<org>/catalog
185
247
 
186
248
  # what the release workflow may sign: each engine action's image, judged by the server's rule
187
249
  # — stdout: one <repository>@<digest> per image that passed
188
- npx @runveric/cli@0.4.0 catalog verify-image --from release.yaml
189
- npx @runveric/cli@0.4.0 catalog verify-image <repository>@<digest> --key <action key> --commit <sha>
250
+ npx @runveric/cli@0.5.1 catalog verify-image --from release.yaml
251
+ npx @runveric/cli@0.5.1 catalog verify-image <repository>@<digest> --key <action key> --commit <sha>
190
252
  ```
191
253
 
192
254
  An action's package must be named after its key (`azure.vm.stop` → `action-azure-vm-stop`); the