@verentis/cli 0.2.33 → 1.0.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/README.md CHANGED
@@ -145,7 +145,7 @@ verentis validate samples/agent
145
145
  verentis validate samples/skill
146
146
  verentis validate samples/tool # external MCP fixture
147
147
  verentis validate samples/application-tools
148
- verentis pack samples/agent --publisher verentis --no-sign
148
+ verentis pack samples/agent --publisher verentis --no-sign # local test only: unsigned packages cannot be published
149
149
  ```
150
150
 
151
151
  The Application sample shows `spec.tools` bindings for an app backend and an app-owned MCP
@@ -165,8 +165,8 @@ verentis policy apply agent.policy.yaml --workspace <workspace-id> --expected-re
165
165
 
166
166
  If `--expected-revision` is omitted, the CLI exports the current revision first (missing policy
167
167
  = revision `0`) and sends that revision with the apply request. A `409` means the policy changed:
168
- export again, reapply your edits, and retry. Dry runs require `fabric.policy.read`; real applies
169
- require `fabric.policy.update`.
168
+ export again, reapply your edits, and retry. Dry runs require `governance.read`; real applies
169
+ require `governance.write`.
170
170
  ## Native collaboration declarations
171
171
 
172
172
  An Application may request the versioned native scene mode separately from WOPI:
@@ -176,7 +176,7 @@ spec:
176
176
  collaboration:
177
177
  mode: native-scene-v1
178
178
  capabilities: [file:read, file:write]
179
- permissions: [node.file.read, node.node.create]
179
+ permissions: [file.read, file.write]
180
180
  ```
181
181
 
182
182
  Development validation and packing reject unknown modes, extra declaration keys,
@@ -190,32 +190,49 @@ be delivered before installation can activate native editing.
190
190
  ## Sign in
191
191
 
192
192
  ```bash
193
- verentis login
193
+ verentis login --api-url https://api.localtest.me:6500 --insecure # local; production needs no flags
194
194
  ```
195
195
 
196
196
  The CLI targets **production** (`https://api.verentis.io`) by default — third-party developers need no
197
- extra configuration. With no credential flags this starts a **device sign-in**: open the printed URL in any
198
- browser (works over SSH), confirm the code, done. Non-interactive alternatives:
197
+ extra configuration. There is a **single endpoint and no region**: publishing (`login`, `keygen`, `key`,
198
+ `publish`, `yank`, `package deprecate|undeprecate|archive|visibility`) talks to the global registry under `<api>/v1/registry` and never calls a regional Security service.
199
+ With no credential flags `login` starts a **device sign-in** (`POST /v1/registry/device/authorize` and
200
+ `/device/token`): open the printed marketplace URL in any browser (works over SSH), confirm the code, done.
201
+ The publish access token (audience `verentis-registry`) and its **refresh token** are stored in
202
+ `~/.verentis/config.json` (mode `600`); the CLI silently renews the access token on the next command.
203
+ Re-run `verentis login` after the refresh token lapses (~30 days idle) or `verentis logout`.
204
+
205
+ Non-interactive publishing:
199
206
 
200
207
  ```bash
201
- verentis login --api-key vrt_xxx # scoped API scripts (not publisher CI publishing)
202
- verentis login --token <identity token>
203
- # VERENTIS_API_KEY / VERENTIS_TOKEN env vars also work
208
+ verentis login --api-key pub_xxx # publisher API key (or VERENTIS_PUBLISHER_API_KEY)
209
+ # GitHub Actions: VERENTIS_GITHUB_OIDC_AUDIENCE — see "Publisher publishing from GitHub Actions"
204
210
  ```
205
211
 
206
- A device sign-in also stores a **refresh token**, so you stay signed in: when the 1-hour identity token
207
- expires the CLI silently renews it on the next command (refresh tokens rotate on every use with reuse
208
- detection). You only re-run `verentis login` after the refresh token lapses (~30 days idle) or `verentis
209
- logout`. Tokens live in `~/.verentis/config.json` (mode `600`). Env-provided `VERENTIS_TOKEN` and API keys
210
- are used as-is and never auto-refreshed.
212
+ Publisher API keys use the **`pub_` prefix**, distinct from regional API keys (`vrt_`), so a key is never sent
213
+ to the wrong plane. A `pub_` key is exchanged at `POST /v1/registry/token` (header `X-Verentis-Publisher-Key`)
214
+ for a short-lived publish access token.
215
+
216
+ **Publishing vs regional commands.** Everything else (files, exec, install, workspace/account/user admin,
217
+ node API keys, `search`, `download`, `package stats`) still uses the regional APIs and regional credentials:
218
+
219
+ ```bash
220
+ verentis login --regional # regional device sign-in (identity token + refresh token)
221
+ verentis login --api-key vrt_xxx # regional API key (scripts)
222
+ verentis login --token <identity token> # VERENTIS_API_KEY / VERENTIS_TOKEN env vars also work
223
+ ```
224
+
225
+ The two credential sets are stored independently and `verentis logout` removes both. A regional device
226
+ sign-in stores a refresh token that silently renews the 1-hour identity token (rotating, with reuse
227
+ detection). Env-provided `VERENTIS_TOKEN` and API keys are used as-is and never auto-refreshed.
211
228
 
212
229
  Set defaults once so you can stop repeating flags:
213
230
 
214
231
  ```bash
215
232
  verentis use workspace <workspaceId>
216
233
  verentis use account <accountId>
217
- verentis context # show current defaults
218
- verentis whoami # identity, account, publisher
234
+ verentis context # API/registry URL, publish + regional credential kinds, defaults
235
+ verentis whoami # regional identity/account and the global publishing session (publisher, scope, expiry)
219
236
  ```
220
237
 
221
238
  Workspace/account flags and defaults use Security's generalized `resourceId`
@@ -234,7 +251,7 @@ verentis workspace invite create <workspaceId> dev@example.com --role member
234
251
  verentis account invite list
235
252
  verentis user list --workspace <id>
236
253
  verentis user suspend <userId>
237
- verentis apikey create ci-key --grant node.file.read --grant execution.execution.run
254
+ verentis apikey create ci-key --grant file.read --grant execution.run
238
255
  verentis apikey revoke <apiKeyId>
239
256
  verentis settings set my.setting '{"enabled":true}' --workspace <id>
240
257
  ```
@@ -242,7 +259,7 @@ verentis settings set my.setting '{"enabled":true}' --workspace <id>
242
259
  Anything without a dedicated command is one escape hatch away (auth handled for you):
243
260
 
244
261
  ```bash
245
- verentis api GET /v1/roles --scope security.role.read-all
262
+ verentis api GET /v1/roles --scope role.read
246
263
  verentis api POST /v1/things --body @thing.json --workspace <id> --scope some.scope
247
264
  ```
248
265
 
@@ -314,7 +331,7 @@ Lower-level building blocks:
314
331
 
315
332
  ```bash
316
333
  verentis dev token --workspace <id> # scopes from ./engine.yaml spec.permissions
317
- verentis dev token --scopes node.file.read --boundary /scripts # node-bounded, like platform runs
334
+ verentis dev token --scopes file.read --boundary /scripts # node-bounded, like platform runs
318
335
  verentis dev context --file /scripts/transform.py --out .verentis/context.json
319
336
  export VERENTIS_CONTEXT_PATH=$PWD/.verentis/context.json
320
337
  python transform.py # SDK auto-loads the context
@@ -365,6 +382,23 @@ behavior.
365
382
  Offline local mode is a feature of the Python `verentis-engine-sdk`, not the TypeScript
366
383
  `@verentis/sdk`.
367
384
 
385
+ ### Script arguments
386
+
387
+ Scripts that declare their command-line arguments with the engine SDK (`verentis.arguments` in Python,
388
+ `@verentis/engine-sdk` `defineArguments` in Node.js) export a `<script>.arguments.json` descriptor next
389
+ to the script. The workspace reads it to prompt for missing required arguments on **Run** and to offer
390
+ **Configure run**; the platform rejects runs whose arguments do not match.
391
+
392
+ ```bash
393
+ python -m verentis.arguments export scripts/export.py # imports build_parser → writes scripts/export.py.arguments.json
394
+ npx verentis-engine-arguments export main.ts # reads main.args.ts → writes main.ts.arguments.json
395
+ ```
396
+
397
+ `verentis validate` and `verentis pack` check descriptors without running your code: each must sit next
398
+ to a packaged script, match its packaged bytes (`sourceSha256`), and be included in `packaging.files`.
399
+ Re-run the export after changing a script. `verentis dev run` sets `VERENTIS_LOCAL_RUN=1`, so the SDK
400
+ prompts in your terminal for missing required arguments; set `VERENTIS_NO_PROMPT=1` to fail instead.
401
+
368
402
  ### Standalone application launch
369
403
 
370
404
  Applications that can open without a selected file opt in through their manifest:
@@ -412,57 +446,109 @@ template, `--version` to pin it, and `--registry` for a private npm registry.
412
446
  Templates are installed with `npm pack --ignore-scripts` and support
413
447
  `{{name}}` and `{{type}}` substitutions.
414
448
 
415
- Package manifests must declare both `metadata.package-id` (the immutable
416
- Marketplace coordinate) and `metadata.name` (the runtime/install identity).
417
- Commands that accept `publisher/package` references use the package ID.
449
+ Every Verentis document — package manifests and the documents they ship
450
+ (ScriptRun, ExecutionTrigger, ExecutionSchedule, WebhookReceiver, Policy and
451
+ canvas documents) — is identified by `metadata.id`, which is required. For a
452
+ package it is the Marketplace coordinate and the runtime/install identity.
453
+ `metadata.name` is an optional human-friendly label (displays fall back to the
454
+ id). The legacy keys are rejected by `verentis pack`, `verentis validate` and
455
+ the dev loop: `metadata.package-id is no longer supported; use metadata.id` and
456
+ `metadata.display-name is no longer supported; use metadata.name`. File-access
457
+ grants stamped from a ScriptRun or a document carry `origin: { kind, id }`.
458
+ Every ScriptRun shipped through `spec.scripts` must also declare
459
+ `resources.size` (`xsmall`, `small`, `medium`, `large`, `xlarge`, `xxlarge` or
460
+ `gpu`); `verentis pack` and `verentis validate` reject a missing or unknown size.
461
+ Commands that accept `publisher/<id>` references use the package ID.
462
+
463
+ Publishers belong to an account and are created in the account app
464
+ (`https://account.verentis.io/marketplace/publisher`), which also manages
465
+ API keys and GitHub publishing trusts; then run `verentis login` again.
466
+ Profile, logo and signing-key commands write to the global registry
467
+ (`/v1/registry/publishers/...`).
418
468
 
419
469
  ```bash
420
- verentis publisher create --name acme --display-name "Acme Inc."
421
- verentis publisher create --name acme --display-name "Acme Inc." --logo ./brand/logo.png
422
470
  verentis publisher update --description "Tools for data teams" --website https://acme.example
423
471
  verentis publisher logo set ./brand/logo.svg
424
472
  verentis publisher logo remove
425
473
  verentis keygen # Ed25519 signing key + register public half
426
474
  verentis init my-app --type application # or --type engine | bundle | theme
427
- verentis pack # signed .vpkg (--encrypt seals the payload)
475
+ verentis pack # signed .vpkg (--encrypt seals the payload); fails without a key unless --no-sign
428
476
  verentis pack . --env production # writes my-app-production-<version>.vpkg
429
477
  verentis pack . --bump-version # increments metadata.version.patch in the manifest
430
- verentis publish # publishes the highest-version .vpkg in the current directory
431
- verentis package list # your packages
432
- verentis package versions acme/my-app
433
- verentis package deprecate my-app --message "use my-app-2"
478
+ verentis publish # POST /v1/registry/packages/<publisher>/<package>/versions (highest-version .vpkg)
479
+ export VERENTIS_NOTIFICATIONS_API_KEY
480
+ verentis publish --notifications.provider sendgrid \
481
+ --notifications.from notifications@acme.example --notifications.region global
482
+ verentis notifications sender show my-app
483
+ verentis notifications sender revoke my-app
484
+ verentis package list # your packages in the registry
485
+ verentis package versions acme/my-app # every registry version, incl. pending, rejected and yanked
486
+ verentis package deprecate my-app --message "use my-app-2" # registry; add a version to deprecate one version
487
+ verentis package undeprecate my-app
488
+ verentis package archive my-app # hidden from the catalog, no new installs
434
489
  verentis package visibility set my-app Private
435
- verentis package visibility grant my-app <workspaceId>
490
+ verentis package visibility grant my-app <workspaceId> # --type Account for an account grant
491
+ verentis package visibility grants my-app
492
+ verentis package visibility revoke my-app <grantId>
436
493
  verentis package stats my-app
437
494
  verentis search "image viewer" --type Application
438
495
  verentis install acme/my-app --workspace <id>
439
496
  verentis installs --workspace <id>
440
497
  verentis uninstall <installationId> --workspace <id>
441
- verentis yank my-app 1.0.3
498
+ verentis yank my-app 1.0.3 --reason "data loss bug" # registry; existing installs keep working
442
499
  ```
443
500
 
444
501
  Published versions are `Submitted` for moderation; once approved the marketplace countersigns them and they become installable.
502
+ Versions are immutable. Publishing a version that already exists succeeds without uploading when the registry's tree
503
+ digest equals the package's (a retried CI job), and fails when the content differs.
504
+
505
+ Notification sender settings are sticky per `publisher/package` in `~/.verentis/config.json`; the provider API key is
506
+ never saved or returned. In CI, supply the key through `VERENTIS_NOTIFICATIONS_API_KEY` rather than a command-line
507
+ argument; `--notifications.api-key` is available for interactive use. Provider settings can also be supplied through
508
+ `VERENTIS_NOTIFICATIONS_PROVIDER`, `_FROM`, `_REPLY_TO`,
509
+ `_DOMAIN` and `_REGION`. Mailgun requires `--notifications.domain`; SendGrid and Mailgun use their provider's supported
510
+ region values. `notifications sender show` displays only sender metadata and the key fingerprint/last four characters.
511
+
512
+ Mailgun also requires its separate webhook signing key for delivery events. Supply
513
+ `VERENTIS_NOTIFICATIONS_WEBHOOK_SIGNING_KEY` alongside the provider API key, or use
514
+ `--notifications.webhook-signing-key`. Neither secret is saved in local configuration.
515
+ `notifications sender show` includes webhook status, setup guidance and the endpoint URL;
516
+ `ManualSetupRequired` means sending is configured but provider callbacks still need attention.
517
+
518
+ **Packages must be signed.** `verentis pack` refuses to build without a signing key (run `verentis keygen` first, or
519
+ pass `--key <name>`); `--no-sign` builds an unsigned package for local testing only. `verentis publish` refuses unsigned
520
+ packages locally, and the registry rejects them with `422 Packages must be signed…`, which the CLI prints as
521
+ `Publish rejected: <detail>`.
522
+
523
+ Lifecycle commands (`yank`, `package deprecate|undeprecate|archive|visibility …`) call the global registry
524
+ (`/v1/registry/packages/<publisher>/<package>/…`) with your publish credential, like `publish`. `<ref>` is
525
+ `name` (resolved against your publisher) or `publisher/name`. Package metadata (display name, description, icon,
526
+ categories) lives in the signed manifest — change it and publish a new version; `package update` was removed.
445
527
 
446
528
  `verentis install` replaces an existing installation of the same package in the workspace branch in place, like the
447
529
  marketplace install dialog. This upgrades or reinstalls an installed package and retries a `Failed` installation.
448
530
 
449
531
  ### Publisher publishing from GitHub Actions
450
532
 
451
- Register a GitHub pipeline trust on your publisher in each target Verentis
452
- environment. Bind it to the repository and a protected GitHub environment; restrict
533
+ Register a GitHub pipeline trust on your publisher (`/v1/registry/publishers/{id}/github-trusts`). Bind it to the repository and a protected GitHub environment; restrict
453
534
  which branches may deploy with the environment's deployment branch rules. Configure the job with `permissions: { contents: read, id-token: write }`,
454
535
  the matching protected environment, and these environment variables:
455
536
 
456
537
  ```text
457
- VERENTIS_API_URL=https://<target-api>
458
- VERENTIS_GITHUB_OIDC_AUDIENCE=https://<target-api>
538
+ VERENTIS_API_URL=https://<api-host>
539
+ VERENTIS_GITHUB_OIDC_AUDIENCE=https://<api-host>
459
540
  ```
460
541
 
461
- The audience must equal the exact target API HTTPS origin (no trailing slash).
542
+ The audience is derived from the host: it must equal the exact API HTTPS origin (no trailing slash).
543
+
544
+ Internal Verentis environments (pull request and feature) sit behind Cloudflare Access. Set
545
+ `VERENTIS_CF_ACCESS_CLIENT_ID` and `VERENTIS_CF_ACCESS_CLIENT_SECRET` (a Cloudflare Access service token)
546
+ and every request to the `VERENTIS_API_URL` origin carries the `CF-Access-Client-Id` /
547
+ `CF-Access-Client-Secret` headers; other origins never receive them.
462
548
  When `VERENTIS_GITHUB_OIDC_AUDIENCE` is set, `verentis publish` requests a
463
- short-lived GitHub Actions OIDC assertion and presents it to `/connect/token`
464
- using the OAuth 2.0 JWT bearer grant (RFC 7523) for a publishing-scoped access
465
- token. The marketplace resolves the publisher from the trust bound to that client. It never stores the
549
+ short-lived GitHub Actions OIDC assertion and presents it to `POST /v1/registry/token`
550
+ using the OAuth 2.0 JWT bearer grant (RFC 7523) for a publish access token
551
+ (audience `verentis-registry`); regional requests are refused in this mode. The marketplace resolves the publisher from the trust bound to that client. It never stores the
466
552
  assertion or uses a configured human API key as a fallback. The job must also
467
553
  provide a **separate** Ed25519 package-signing key to `verentis pack --key <name>`;
468
554
  verify that the `.vpkg` is signed before publishing. Hosted-service client
@@ -578,6 +664,10 @@ Packing behaviour:
578
664
  overrides the packed manifest version, and `--bump-version` increments the authored patch version.
579
665
  `publish` without a file selects the highest-version `.vpkg` in the current directory. `validate`
580
666
  accepts the same overlay selectors.
667
+ - Overlays may contain `${param:name}` placeholders in string values, filled with repeatable
668
+ `--param name=value` on `pack` and `validate` (e.g. the per-pull-request host in
669
+ `environments/feature.yaml`: `verentis pack . --env feature --param app-host=my-app-pr-12.apps.feature.verentis.dev`).
670
+ A placeholder without a value fails; `$${param:name}` keeps a literal placeholder. Base manifests are never interpolated.
581
671
  - Icons are inlined into the packed `manifest.yaml`: the top-level `icons:` map holds the validated SVG
582
672
  markup keyed by the first 12 hex characters of its sha256, and every icon field becomes `"#<key>"`.
583
673
  Legacy Iconify ids are left as-is. Source files are not modified; digests and signatures cover the