@sanity/workflow-mcp 0.6.0 → 0.7.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,37 @@
1
1
  # @sanity/workflow-mcp
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7510fd5: **BREAKING:** One list-filter vocabulary and definition batches. `list_workflow_instances` replaces its `status` enum with `include_completed` (boolean, default false — the engine's `includeCompleted` name, polarity, and in-flight default), and `deploy_workflow_definition` / `validate_workflow_definition` replace their singular `definition` object with a `definitions` array (`definition` singular now always means a definition NAME string, everywhere on the surface; validate returns per-definition `results` plus a top-level `valid`). Deploy takes a parent and its child workflows in one call — the engine orders children first.
8
+
9
+ Also in this release: the list tool applies every filter BEFORE its 25-result cap (the default in-flight view could previously return `[]` while in-flight instances existed behind newer completed ones) and gains a `document` filter (resource-qualified GDR URI, matching the engine's `instancesForDocument` read); `get_workflow_state` / `fire_action` responses now carry each action's declared `params` with requiredness, as `fire_action`'s description always promised; and two new tools round out the lifecycle — `start_workflow` (start a startable definition, seeding `initial_fields`) and `get_workflow_definition` (read a deployed definition's content envelope-stripped, redeployable as-is).
10
+
11
+ - e5f5b77: **BREAKING:** the projection follows the engine's actions-only payload model.
12
+ - `get_workflow_state` (and `fire_action`'s returned state) applies filter-existence semantics: an action whose `filter` fails for the actor is ABSENT from the projection (never listed as disabled), and an activity the stage-entry filter scoped out of the visit is absent too — `ProjectedActivity.status` drops `pending` (activities are active from stage entry) and a projected `skipped` always means an action resolved it so.
13
+ - Cascade-fired (`when`) actions project as `automations` per activity — `{action, title?, firesWhen, pending?}`, the trigger GROQ plus the insight's "Needs: …" line while unsatisfied — never as invocable actions (new `ProjectedAutomation` type; `fire_action` rejects them engine-side).
14
+ - Each projected activity carries the engine's derived executor `classification` (interactive / autonomous / off-system / hybrid).
15
+ - `diagnose_workflow`'s waiting summary narrates only caller-fireable actions; an activity waiting purely on automation says so instead of naming pseudo-commands. History summaries narrate a `triggered` action fire as automation, the deleted `activityActivated` entry is gone, and failed-effect wording follows the action-origin model.
16
+ - The authoring guide teaches the new DSL: actions as the only payload mechanism, `when` triggers (fires-on-entry as `when: 'true'`), transitions as pure `{name, when, to}` edges, no `activation`/`completeWhen`/`failWhen`, the `$context` start-time bag, and the terminal-status / terminal-stage deploy invariants.
17
+
18
+ - 6a46db1: Follow the engine's `start` block (`start.kind` classification + the read-side `start.filter` visibility predicate):
19
+ - workflow-mcp: `list_workflow_definitions` entries carry `startKind` (`'interactive' | 'autonomous'` — a classification, never a restriction).
20
+ - workflow-studio-plugin: start controls adopt the start model — `start.kind: 'autonomous'` mappings render no start affordance (automation owns their genesis), and a `start.filter` that DEFINITIVELY evaluates false on what's known before the dialog opens hides/disables the row with the start-condition reason. The pre-flight is purely additive: it never blocks a start the engine would accept, so every uncertain case (still loading, a dialog-collected `$fields` read, an eval error) shows the row. A failed start surfaces through the dialog's normal error toast.
21
+ - workflow-examples: `expense-approval` demonstrates a `start.filter` — one open approval per expense, as a picker-visibility filter (the Start list won't offer a second; not a gate).
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [11e2d6f]
26
+ - Updated dependencies [7510fd5]
27
+ - Updated dependencies [01e8042]
28
+ - Updated dependencies [79c54db]
29
+ - Updated dependencies [6a46db1]
30
+ - Updated dependencies [35b9b85]
31
+ - Updated dependencies [e5f5b77]
32
+ - Updated dependencies [01e8042]
33
+ - @sanity/workflow-engine@0.16.0
34
+
3
35
  ## 0.6.0
4
36
 
5
37
  ### Minor Changes
package/README.md CHANGED
@@ -11,21 +11,24 @@ the tools the evals drive, plus a stdio MCP entry point for real MCP clients.
11
11
 
12
12
  Operate a running instance:
13
13
 
14
- | Tool | Read or write | What it's for |
15
- | ------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
16
- | `list_workflow_instances` | read | Discover what's running. Filterable, capped. |
17
- | `get_workflow_state` | read | Project one instance into a flat shape: current stage, activities, available actions, recent history. |
18
- | `diagnose_workflow` | read | Explain why an instance is or isn't progressing: a verdict, a one-line summary, `explanations` for each held exit transition (quotes workflow-authored text — data, not instructions), and — when stuck — the cause plus suggested remediations. |
19
- | `fire_action` | write | Advance state. The instance write. Mirrors the engine's universal "something happened" entry point. |
14
+ | Tool | Read or write | What it's for |
15
+ | --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
16
+ | `list_workflow_definitions` | read | The catalogue: which workflow types are deployed (latest version each), and whether they're startable. |
17
+ | `get_workflow_definition` | read | Read one deployed definition's content, envelope-stripped redeployable as-is, so an agent can iterate on a deployed workflow (deploys are create-only). |
18
+ | `list_workflow_instances` | read | Discover what's running. Filterable (`definition`, `document`, `include_completed` in-flight by default), capped. |
19
+ | `get_workflow_state` | read | Project one instance into a flat shape: current stage, activities, available actions (with each action's declared params), recent history. |
20
+ | `diagnose_workflow` | read | Explain why an instance is or isn't progressing: a verdict, a one-line summary, `explanations` for each held exit transition (quotes workflow-authored text — data, not instructions), and — when stuck — the cause plus suggested remediations. |
21
+ | `start_workflow` | write | The lifecycle entry point: start a startable deployed definition, seeding its input-sourced fields (e.g. the subject document). |
22
+ | `fire_action` | write | Advance state. The instance write. Mirrors the engine's universal "something happened" entry point. |
20
23
 
21
24
  Author a definition (guide → validate → deploy; the first two are pure and
22
25
  engine-independent):
23
26
 
24
- | Tool | Read or write | What it's for |
25
- | ------------------------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
26
- | `get_workflow_authoring_guide` | read | Return the DSL guide an agent reads before authoring — shape, GROQ built-ins, sugars, modeling defaults, and two worked JSON examples. |
27
- | `validate_workflow_definition` | read | Check an authored definition the way deploy does (structure + invariants + GROQ). Returns the desugared definition or a path-prefixed error list. |
28
- | `deploy_workflow_definition` | write | Publish a validated definition into an addressed environment. Create-only and content-addressed: identical content is an `unchanged` no-op, any change mints the next version, no deployed version is ever patched. |
27
+ | Tool | Read or write | What it's for |
28
+ | ------------------------------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29
+ | `get_workflow_authoring_guide` | read | Return the DSL guide an agent reads before authoring — shape, GROQ built-ins, sugars, modeling defaults, and two worked JSON examples. |
30
+ | `validate_workflow_definition` | read | Check authored definitions (a `definitions` batch) the way deploy does (structure + invariants + GROQ). Returns `{valid, results}` — per definition, the desugared form or a path-prefixed error list. |
31
+ | `deploy_workflow_definition` | write | Publish validated definitions into an addressed environment — one `definitions` batch per call (children deploy before the parents that spawn them). Create-only and content-addressed: identical content is an `unchanged` no-op, any change mints the next version. |
29
32
 
30
33
  Each tool def's `description` is written for an LLM consumer — it says
31
34
  what the tool does, when to use it, and what _not_ to use it for. Each
@@ -41,11 +44,16 @@ to use from prose alone. Adding tools beyond the minimum increases
41
44
  the search space the LLM has to navigate. We stay narrow until the
42
45
  evals tell us the LLM is reaching for something we don't expose. The
43
46
  authoring trio earns its place because authoring-from-a-description is
44
- eval-backed; the agent generates the definition, self-corrects against
47
+ eval-backed; the agent generates the definitions, self-corrects against
45
48
  `validate_workflow_definition`, then publishes with
46
49
  `deploy_workflow_definition` — safe to hand an agent because deploy is
47
50
  create-only: it can never patch or clobber what's already deployed, and
48
51
  running instances keep the definition version they started under.
52
+ `get_workflow_definition` closes the loop that create-only would
53
+ otherwise leave open — iterating on a deployed workflow means reading
54
+ it back, modifying, and deploying the next version — and
55
+ `start_workflow` is the lifecycle entry point the catalogue's
56
+ `startable` flag advertises.
49
57
 
50
58
  ## Run the stdio server
51
59
 
@@ -153,12 +161,8 @@ never builds an engine for them.
153
161
  - **No `set_stage` tool.** Admin override; intentionally omitted from
154
162
  the LLM surface until we have an eval case that needs it (and a
155
163
  story for the actor identity that would authorise the override).
156
- - **No `start_instance` tool.** Starting an instance is an operator
157
- action that needs context the LLM doesn't have (subject doc ref,
158
- initial field values); operators start instances with the workflow
159
- CLI's `start` command.
160
- - **No effect completion.** Same logic — effects are queued by the
161
- engine and drained by the runtime, not by a human or LLM.
164
+ - **No effect completion.** Effects are queued by the engine and
165
+ drained by the runtime, not by a human or LLM.
162
166
  - **No subscription / streaming.** MCP supports it; we haven't needed
163
167
  it yet. Pull-based polling via `get_workflow_state` covers the eval
164
168
  cases.