@sanity/workflow-cli 0.33.0 → 0.34.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/CHANGELOG.md +8 -0
- package/README.md +118 -9
- package/oclif.manifest.json +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -373,16 +373,21 @@ needs.
|
|
|
373
373
|
|
|
374
374
|
## Telemetry
|
|
375
375
|
|
|
376
|
-
The CLI collects usage telemetry through Sanity's standard pipeline
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
the engine's adoption events from the operations it drives. Consent is the
|
|
380
|
-
account-wide status managed by `npx sanity telemetry enable|disable|status`;
|
|
381
|
-
CI and trueish `DO_NOT_TRACK` suppress everything (except a deploy that may share
|
|
376
|
+
The CLI collects usage telemetry through Sanity's standard pipeline. Consent
|
|
377
|
+
is the account-wide status managed by `npx sanity telemetry enable|disable|status`.
|
|
378
|
+
CI and trueish `DO_NOT_TRACK` suppress everything except a deploy that may share
|
|
382
379
|
new definitions, which forces that deploy's telemetry unless `--no-share-defs`
|
|
383
|
-
is passed — see [Definition sharing](#definition-sharing)
|
|
384
|
-
|
|
385
|
-
|
|
380
|
+
is passed — see [Definition sharing](#definition-sharing). A session that isn't
|
|
381
|
+
logged in sends nothing. A one-time notice on stderr discloses collection on
|
|
382
|
+
first use.
|
|
383
|
+
|
|
384
|
+
Payloads never include customer-authored strings: no flag values, argv
|
|
385
|
+
tokens, error text, definition names, stage names, GROQ, or document content.
|
|
386
|
+
The one instance-scoped exception the engine already ships is `instanceId`
|
|
387
|
+
(the instance document `_id`). Effect events also carry the author-chosen
|
|
388
|
+
effect name. Definition sharing sends the definition document to a first-party
|
|
389
|
+
feedback endpoint, not through this pipeline; telemetry only records the
|
|
390
|
+
content-free markers below.
|
|
386
391
|
|
|
387
392
|
Each event includes `context.surface: 'cli'` and its process execution mode
|
|
388
393
|
in `context.environment`. `NODE_ENV=production` reports `production`;
|
|
@@ -400,6 +405,110 @@ One extension point: supply your own logger as `telemetry` in
|
|
|
400
405
|
every event flows to your implementation unconditionally (CI included), and
|
|
401
406
|
consent, suppression, and destination become its business.
|
|
402
407
|
|
|
408
|
+
### Session properties
|
|
409
|
+
|
|
410
|
+
The built-in store attaches these user properties once per invocation (joined
|
|
411
|
+
to events by session id). User identity is not in the payload; the intake
|
|
412
|
+
service resolves the sender from the authenticated session.
|
|
413
|
+
|
|
414
|
+
| Property | What it is |
|
|
415
|
+
| ----------------- | ------------------------------------------------------------------------------------------------ |
|
|
416
|
+
| `surface` | Always `'cli'`. |
|
|
417
|
+
| `machinePlatform` | Node `process.platform` (for example `darwin`, `linux`). |
|
|
418
|
+
| `cpuArchitecture` | Node `process.arch`. |
|
|
419
|
+
| `runtime` | Always `'node'` for this CLI. |
|
|
420
|
+
| `runtimeVersion` | Node `process.version`. |
|
|
421
|
+
| `cliVersion` | The CLI package version, when oclif supplied it. |
|
|
422
|
+
| `projectId` | Project id of the first dataset-backed deployment in `sanity.workflow.ts`. |
|
|
423
|
+
| `dataset` | Dataset of that same deployment. |
|
|
424
|
+
| `orgId` | Organization id for that project, when the lookup succeeds before the command flushes. Optional. |
|
|
425
|
+
|
|
426
|
+
### CLI events
|
|
427
|
+
|
|
428
|
+
These events are defined by this package.
|
|
429
|
+
|
|
430
|
+
#### `Workflows CLI Command Executed` (version 1)
|
|
431
|
+
|
|
432
|
+
One trace per workflows command. The built-in store starts the trace in the
|
|
433
|
+
prerun hook with `groupOrCommand` set to the oclif command id (for example
|
|
434
|
+
`workflows:deploy`, `workflows:definition:list`, `workflows:fire-action`) and
|
|
435
|
+
completes it in the finally hook. A config-supplied logger receives the same
|
|
436
|
+
payload as a log, with no trace. Host commands outside the `workflows` topic
|
|
437
|
+
do not emit.
|
|
438
|
+
|
|
439
|
+
| Field | Type | What is collected |
|
|
440
|
+
| --------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
441
|
+
| `command` | `string` | The oclif command id (`workflows:…`). Never argv free-text. |
|
|
442
|
+
| `flags` | `string[]` | Names of **declared** flags present on the invocation, sorted. Long form, `--no-name`, and short chars. Never values, never undeclared tokens, never tokens after `--`. |
|
|
443
|
+
| `success` | `boolean` | `true` when the command finished without an oclif error. |
|
|
444
|
+
|
|
445
|
+
#### `Workflows Definition Shared` (version 1)
|
|
446
|
+
|
|
447
|
+
One content-free marker per newly created definition version that actually
|
|
448
|
+
reached Sanity's definition-feedback endpoint. Unchanged redeploys, dry runs,
|
|
449
|
+
and `--check` never emit it. The document itself is not in this event.
|
|
450
|
+
|
|
451
|
+
| Field | Type | What is collected |
|
|
452
|
+
| ------------------ | ---------- | ---------------------------------------------------------------------------------------------------- |
|
|
453
|
+
| `contentHash` | `string` | Content fingerprint of the donated definition. |
|
|
454
|
+
| `deployId` | `string` | Random run id shared with that invocation's `Workflows Definition Deployed` events. |
|
|
455
|
+
| `stageCount` | `number` | Declared stages. |
|
|
456
|
+
| `activityCount` | `number` | Activities across those stages. |
|
|
457
|
+
| `actionCount` | `number` | Actions across those activities. |
|
|
458
|
+
| `transitionCount` | `number` | Declared transitions. |
|
|
459
|
+
| `fieldCount` | `number` | Declared field entries at workflow, stage, and activity scope. |
|
|
460
|
+
| `activityKinds` | `string[]` | Distinct effective activity kinds, sorted: `user`, `service`, `script`, `manual`, `receive`. |
|
|
461
|
+
| `fieldKinds` | `string[]` | Distinct declared field kinds, sorted (engine field kinds such as `string`, `subject`, `assignees`). |
|
|
462
|
+
| `guardCount` | `number` | Guards declared on stages. |
|
|
463
|
+
| `effectCount` | `number` | Effects declared on actions. |
|
|
464
|
+
| `subworkflowCount` | `number` | Actions that carry a `spawn` block. |
|
|
465
|
+
| `lifecycle` | `string` | `'standalone'` or `'child'`. |
|
|
466
|
+
|
|
467
|
+
#### `Workflows Definition Sharing Decided` (version 2)
|
|
468
|
+
|
|
469
|
+
One event per `deploy` that created at least one new definition version,
|
|
470
|
+
whether or not anything was donated. Measures opt-out rate without carrying
|
|
471
|
+
the document.
|
|
472
|
+
|
|
473
|
+
| Field | Type | What is collected |
|
|
474
|
+
| ----------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
475
|
+
| `decision` | `string` | `'opt-in'` (`--share-defs`), `'opt-out'` (`--no-share-defs`), or `'default'` (neither flag). |
|
|
476
|
+
| `shared` | `boolean` | Whether a donation POST reached the endpoint. `false` for any non-sharing decision, and for a chosen share whose POST failed. |
|
|
477
|
+
| `definitionCount` | `number` | Newly created definition versions this invocation could have donated. |
|
|
478
|
+
|
|
479
|
+
### Engine events the CLI records
|
|
480
|
+
|
|
481
|
+
Write commands pass the CLI logger into the engine, so a successful operation
|
|
482
|
+
also records the engine's adoption events on the same session. Read commands
|
|
483
|
+
(`list`, `show`, `diagnose`, `tail`, `definition list` / `show` / `diff`) do
|
|
484
|
+
not emit engine events. `nuke` deletes engine-owned documents outside those
|
|
485
|
+
verbs and does not emit them either.
|
|
486
|
+
|
|
487
|
+
Every instance-scoped engine event includes:
|
|
488
|
+
|
|
489
|
+
| Field | Type | What is collected |
|
|
490
|
+
| ----------------------- | -------- | -------------------------------------------------------------------------------------------------- |
|
|
491
|
+
| `definitionContentHash` | `string` | Content fingerprint of the pinned definition. Omitted when the definition predates fingerprinting. |
|
|
492
|
+
| `instanceId` | `string` | Instance document `_id`. |
|
|
493
|
+
|
|
494
|
+
| Event | Version | When the CLI emits it | Additional payload |
|
|
495
|
+
| ------------------------------- | ------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
496
|
+
| `Workflows Definition Deployed` | 1 | `deploy` for each definition (created or unchanged) | Same structural counts as `Workflows Definition Shared`, plus `status`: `'created'` or `'unchanged'`. |
|
|
497
|
+
| `Workflows Instance Started` | 1 | `start`, and a `fire-action` that spawns a child | `initialFieldCount` (number of caller-supplied initial fields), `viaSpawn` (`true` only for a spawned child), `lifecycle`. |
|
|
498
|
+
| `Workflows Stage Transitioned` | 1 | A committed hop from `fire-action`, `start` cascade, or `set-stage` | `fromStageIndex`, `toStageIndex` (indexes into `stages[]`, never names), `toIsTerminal`, `isRevisit`, `dwellMs` (milliseconds in the exited stage, omitted if that entry is missing), `via`: `'transition'` or `'setStage'`. Unsampled. |
|
|
499
|
+
| `Workflows Action Fired` | 1 | `fire-action` | `activityKind` (optional; derived kind of the fired activity), `hasParams` (whether params were supplied — not the params), `cascaded` (auto-transitions in the post-action cascade). |
|
|
500
|
+
| `Workflows Instance Aborted` | 1 | `abort` | `changed`: `false` if the instance was already terminal. |
|
|
501
|
+
| `Workflows Stage Set` | 1 | `set-stage` | `changed`: `false` if already at the target stage. |
|
|
502
|
+
| `Workflows Activity Reset` | 1 | `reset-activity` | `changed`: `false` if already at the target status, or the instance was terminal. |
|
|
503
|
+
| `Workflows Definition Deleted` | 1 | `definition delete` | `deletedVersionCount`, `cascadeAbortedCount`, `deletedGuardCount` (guards only when the last version goes). |
|
|
504
|
+
| `Workflows Effect Completed` | 1 | `abort` cancelling a pending effect | `effect` (author-chosen name), `status` (`'done'`, `'failed'`, or `'cancelled'`), `origin` (`'action'`), `cascaded`. |
|
|
505
|
+
|
|
506
|
+
The engine also defines `Workflows Field Edited`, `Workflows Instance Ticked`,
|
|
507
|
+
`Workflows Effects Drained`, and `Workflows Effect State Reported`. This CLI
|
|
508
|
+
does not call those verbs, so it does not record those events. Field-edit and
|
|
509
|
+
tick events are sampled at most once per 60 seconds when some other shell
|
|
510
|
+
does emit them.
|
|
511
|
+
|
|
403
512
|
## Definition sharing
|
|
404
513
|
|
|
405
514
|
Separate from telemetry, a `deploy` that creates new definition versions
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/workflow-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "Command-line tool for deploying, inspecting, and administering Sanity workflow definitions and instances.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -64,16 +64,16 @@
|
|
|
64
64
|
"@types/node": "^24.12.4",
|
|
65
65
|
"oclif": "^4.23.16",
|
|
66
66
|
"vitest": "^4.1.8",
|
|
67
|
-
"@sanity/workflow-blueprint": "0.
|
|
68
|
-
"@sanity/workflow-engine": "0.
|
|
69
|
-
"@sanity/workflow-engine-test": "0.
|
|
70
|
-
"@sanity/workflow-examples": "0.12.
|
|
67
|
+
"@sanity/workflow-blueprint": "0.34.0",
|
|
68
|
+
"@sanity/workflow-engine": "0.34.0",
|
|
69
|
+
"@sanity/workflow-engine-test": "0.34.0",
|
|
70
|
+
"@sanity/workflow-examples": "0.12.2",
|
|
71
71
|
"@sanity/workflow-test-fixtures": "0.0.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
74
|
"@sanity/cli-core": "^3.6.0",
|
|
75
|
-
"@sanity/workflow-blueprint": "0.
|
|
76
|
-
"@sanity/workflow-engine": "0.
|
|
75
|
+
"@sanity/workflow-blueprint": "0.34.0",
|
|
76
|
+
"@sanity/workflow-engine": "0.34.0"
|
|
77
77
|
},
|
|
78
78
|
"oclif": {
|
|
79
79
|
"bin": "sanity-workflows",
|