draft -> wrapper

This commit is contained in:
lda
2026-05-19 06:59:25 +07:00 Verified
parent 6ad3d20975
commit 01897cc21b
10 changed files with 293 additions and 16 deletions
+6
View File
@@ -513,6 +513,8 @@ Concrete MCP sequence:
7. `wf.workflow.validate_draft_workspace` if capabilities changed or you want
to refresh diagnostics without editing the draft.
8. `wf.workflow.create_artifact_from_workspace` after validation is clean.
Use `wf.workflow.create_wrapper_from_workspace` instead when the workspace
is a reusable wrapper around a raw capability.
9. `wf.workflow.save_deployment`, then `validate_deployment`, then
`run_deployment`.
10. `wf.workflow.delete_draft_workspace` when the mutable authoring session is no
@@ -535,3 +537,7 @@ Concrete MCP sequence:
}
}
```
`create_wrapper_from_workspace` accepts the same request shape except there is
no `kind` field. It always saves `kind="wrapper"` and the result is discoverable
as a workflow capability named `workflow.<artifact_id>.v<version>`.
+6
View File
@@ -355,6 +355,7 @@ resending the full draft each turn.
| Refresh validation without changing revision | `wf.workflow.validate_draft_workspace` |
| Change common draft fields without JSON Patch | `wf.workflow.set_draft_name`, `wf.workflow.set_draft_route`, `wf.workflow.set_step_input_map`, `wf.workflow.set_step_output_map` |
| Save final workspace as artifact | `wf.workflow.create_artifact_from_workspace` |
| Save final workspace as callable wrapper | `wf.workflow.create_wrapper_from_workspace` |
| Clean up a draft workspace | `wf.workflow.delete_draft_workspace` |
Workspace patches are optimistic-concurrency guarded. Pass the current
@@ -365,6 +366,11 @@ Workspace mutation tools use a single `request` object in MCP Inspector. That
keeps the form grouped and lets the schema describe fields like
`input_schema`, `output_map`, and `error_message_source`.
Use `create_wrapper_from_workspace` when the draft is meant to normalize a raw
capability into a reusable workflow-facing wrapper. It is the same validation
path as `create_artifact_from_workspace`, but the saved artifact kind is fixed
to `wrapper`.
Minimal example:
```json
+7 -3
View File
@@ -262,6 +262,7 @@ authoring loop:
- `wf.workflow.list_capabilities`
- lists compact paged enabled planner-visible workflow-ready node spec
summaries, with optional query/source filtering
- also includes saved wrapper artifacts under source id `workflow`
- includes the owning `source_id`, outcomes, and top-level input/output field
names, but not full schemas
- `wf.workflow.inspect_capability`
@@ -298,9 +299,10 @@ prompts
resources
```
Possible later additions may include saved wrappers or workflow artifacts as
first-class projected capability kinds, but they should not erase the raw versus
workflow-facing distinction.
Possible later additions may include full workflow artifacts as first-class
projected capability kinds, but they should not erase the raw versus
workflow-facing distinction. Saved wrapper artifacts are already projected as
workflow capabilities because they have a node-like callable boundary today.
Examples:
@@ -325,6 +327,8 @@ Today:
- saved artifacts can be tagged with `kind="workflow"` or `kind="wrapper"`
- `wf.workflow.call_capability` can execute one planner-visible workflow
capability directly and return normalized `outcome` / `output`
- `wf.workflow.list_capabilities` and `wf.workflow.inspect_capability` project
saved wrapper artifacts as workflow capabilities under source id `workflow`
Not yet implemented:
+6 -1
View File
@@ -299,7 +299,8 @@ The workspace flow is:
2. `wf.workflow.get_draft_workspace`
3. `wf.workflow.patch_draft_workspace`
4. repeat get/patch until valid
5. `wf.workflow.create_artifact_from_workspace`
5. `wf.workflow.create_artifact_from_workspace` for a full workflow, or
`wf.workflow.create_wrapper_from_workspace` for a reusable callable wrapper
Workspaces are mutable and revisioned. Artifacts are immutable and versioned.
Patch calls must include the current `revision`; stale revisions return
@@ -314,6 +315,10 @@ In MCP Inspector, workspace mutation tools accept a single `request` object.
This is deliberate: the request object carries descriptions and validation for
the authoring envelope while raw JSON Schema fields remain plain JSON objects.
`create_wrapper_from_workspace` is intentionally just the wrapper-specific save
path. It validates and compiles the same draft workspace, but fixes the saved
artifact kind to `wrapper` so clients do not need to pass `kind` manually.
## Patching Drafts
`patch_draft` accepts JSON Patch operations.