@sanity/workflow-cli 0.24.0 → 0.25.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 CHANGED
@@ -1,5 +1,46 @@
1
1
  # @sanity/workflow-cli
2
2
 
3
+ ## 0.25.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 177d600: Deployed workflow environment tags are now discoverable.
8
+
9
+ The engine gains two cross-partition GROQ builders: `deployedTagsGroq()` lists
10
+ every tag holding a deployed definition in a resource, and
11
+ `definitionTagsGroq()` narrows that to one definition name via `$definition`.
12
+ Both deliberately span tag partitions — every other read is tag-scoped, and
13
+ `workflow.query` refuses GROQ that isn't — so they answer "which environments
14
+ exist here" for a caller holding a resource but no tag. They report what is
15
+ _observed_: a tag with nothing deployed does not appear.
16
+
17
+ The stdio MCP server adds a `list_workflow_tags` tool taking a
18
+ `workflow_resource` and no tag. It is registered by the host rather than exported
19
+ as a tool def, because a def is only ever handed an engine and an engine is
20
+ pinned to one tag. `LIST_WORKFLOW_TAGS_TOOL_NAME` and
21
+ `LIST_WORKFLOW_TAGS_DESCRIPTION` are exported so an embedding host registers the
22
+ same capability under the same name without re-authoring the model-facing
23
+ wording. The `tag` parameter's description now points an agent at that tool where
24
+ a server offers it and at the user otherwise, and requires confirmation either
25
+ way — having the list does not license picking from it.
26
+
27
+ Both registration paths share one outcome path, `withToolTelemetry`, so the
28
+ result envelope, error rendering, and the `Editorial Workflows MCP Tool Called`
29
+ event cannot diverge between a def-backed tool and a host-registered one. Tag
30
+ discovery reports its adoption event like every other tool, and because it names
31
+ a resource it can also initialize the stdio server's deferred telemetry shell —
32
+ which matters when discovery is an agent's first call.
33
+
34
+ The CLI's definition-tags probe runs the engine's builder instead of its own
35
+ copy of the query, so its `params` key is `definition` rather than `name`, and
36
+ the tag partitions it names in an ambiguity error arrive sorted from the lake.
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [177d600]
41
+ - Updated dependencies [fc12989]
42
+ - @sanity/workflow-engine@0.25.0
43
+
3
44
  ## 0.24.0
4
45
 
5
46
  ### Minor Changes
@@ -61,7 +61,7 @@ async function assertSingleTagPartition({ targets, name, }) {
61
61
  const tags = await target.client.fetch(groq, params, { tag: 'definition.show' });
62
62
  if (tags.length > 1) {
63
63
  fail(`Definition "${name}" exists in several tag partitions in ` +
64
- `${resourceLabel(target.resource)} — pass --tag to choose one.`, tags.toSorted().join('\n'));
64
+ `${resourceLabel(target.resource)} — pass --tag to choose one.`, tags.join('\n'));
65
65
  }
66
66
  }));
67
67
  }
@@ -10,10 +10,9 @@ export declare function buildDefinitionShowQuery(flags: DefinitionShowQueryArgs)
10
10
  params: Record<string, unknown>;
11
11
  };
12
12
  /**
13
- * The tag partitions holding any version of a definition name within one
14
- * dataset. An untagged lookup that would span several partitions must error
15
- * (the highest version ACROSS partitions is meaningless — it could show a
16
- * prod operator the dev definition), the same way a cross-dataset hit does.
13
+ * The engine's {@link definitionTagsGroq} in this package's `{groq, params}`
14
+ * calling shape. Refusing an untagged lookup that spans partitions mirrors the
15
+ * cross-dataset rule: ambiguity errors, never picks.
17
16
  */
18
17
  export declare function buildDefinitionTagsQuery(name: string): {
19
18
  groq: string;
@@ -1,4 +1,4 @@
1
- import { WORKFLOW_DEFINITION_TYPE, assertReadableModel, errorMessage, tagScopeFilter, validateDefinition, } from '@sanity/workflow-engine';
1
+ import { WORKFLOW_DEFINITION_TYPE, assertReadableModel, definitionTagsGroq, errorMessage, tagScopeFilter, validateDefinition, } from '@sanity/workflow-engine';
2
2
  import { fail } from "./fail.js";
3
3
  export function buildDefinitionShowQuery(flags) {
4
4
  const params = { name: flags.name };
@@ -16,8 +16,8 @@ export function buildDefinitionShowQuery(flags) {
16
16
  }
17
17
  export function buildDefinitionTagsQuery(name) {
18
18
  return {
19
- groq: `array::unique(*[_type == "${WORKFLOW_DEFINITION_TYPE}" && name == $name].tag)`,
20
- params: { name },
19
+ groq: definitionTagsGroq(),
20
+ params: { definition: name },
21
21
  };
22
22
  }
23
23
  export async function fetchDeployedDefinition({ client, name, tag, version, }) {
@@ -978,5 +978,5 @@
978
978
  ]
979
979
  }
980
980
  },
981
- "version": "0.24.0"
981
+ "version": "0.25.0"
982
982
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/workflow-cli",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "Command-line tool for deploying, inspecting, and administering Sanity workflow definitions and instances.",
5
5
  "keywords": [
6
6
  "cli",
@@ -62,12 +62,12 @@
62
62
  "@types/node": "^24.12.4",
63
63
  "oclif": "^4.23.16",
64
64
  "vitest": "^4.1.8",
65
- "@sanity/workflow-engine": "0.24.0",
66
- "@sanity/workflow-examples": "0.10.3",
67
- "@sanity/workflow-engine-test": "0.24.0"
65
+ "@sanity/workflow-engine": "0.25.0",
66
+ "@sanity/workflow-engine-test": "0.25.0",
67
+ "@sanity/workflow-examples": "0.10.4"
68
68
  },
69
69
  "peerDependencies": {
70
- "@sanity/workflow-engine": "0.24.0"
70
+ "@sanity/workflow-engine": "0.25.0"
71
71
  },
72
72
  "oclif": {
73
73
  "bin": "sanity-workflows",