@crewx/workflow 0.3.22-rc.12 → 0.3.22-rc.14

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.
Files changed (2) hide show
  1. package/SKILL.md +68 -1
  2. package/package.json +2 -2
package/SKILL.md CHANGED
@@ -38,6 +38,11 @@ crewx workflow validate
38
38
  # Start a workflow execution and auto-run until completion/pause
39
39
  crewx workflow run start standard-dev-core --set goal="implement feature X" --auto
40
40
 
41
+ # In the CrewX web chat, start a workflow as a signed ChatCard.
42
+ # Text after the workflow id becomes state.input.
43
+ /wf rc-publish prepare the next RC
44
+ /wf rc-publish --manual dry run only
45
+
41
46
  # Move to a node
42
47
  crewx workflow run node <exec-id> research
43
48
 
@@ -539,6 +544,68 @@ interface RunExecution {
539
544
  }
540
545
  ```
541
546
 
547
+ ## Web UI `/wf` ChatCard Integration
548
+
549
+ The CrewX web chat treats workflow runs as **conversation content**, not as a side panel. When a user sends a `/wf` command, the server creates a workflow run, stores the original user message in the thread transcript, and stores an assistant message containing a signed workflow ChatCard.
550
+
551
+ ### Syntax
552
+
553
+ ```text
554
+ /wf <workflow-id> [input...]
555
+ /wf <workflow-id> --manual [input...]
556
+ /wf <workflow-id> --auto [input...]
557
+ ```
558
+
559
+ Examples:
560
+
561
+ | Input | Run behavior |
562
+ |-------|--------------|
563
+ | `/wf rc-publish` | Starts `rc-publish` in auto mode |
564
+ | `/wf rc-publish 미리승인한다` | Starts `rc-publish` with `state.input = "미리승인한다"` |
565
+ | `/wf rc-publish --manual dry run` | Creates the run in manual mode with `state.input = "dry run"` |
566
+ | `/wf rc-publish --auto prepare RC notes` | Explicit auto mode; same as default |
567
+
568
+ `--manual` and `--auto` are parsed as options and are **not** included in `state.input`. All remaining text after the workflow id is copied to `state.input`.
569
+
570
+ ### `state.input`
571
+
572
+ `state.input` is the standard entry point for user instructions passed into a workflow run.
573
+
574
+ ```yaml
575
+ nodes:
576
+ - id: plan
577
+ type: agent_task
578
+ agent: "@core_dev"
579
+ prompt: |
580
+ User instruction:
581
+ {{input}}
582
+
583
+ Plan and execute the workflow step accordingly.
584
+ ```
585
+
586
+ Branches and templates may also read `state.input`:
587
+
588
+ ```yaml
589
+ condition: state.input.includes("dry run")
590
+ ```
591
+
592
+ Important security rule: `state.input` is **not authority**. It may influence prompts, branches, and templates, but it must never bypass an `approval` node. For example, `/wf rc-publish 미리승인한다` stores the text in `state.input`; it does not approve publishing. Approval still requires the signed ChatCard action button.
593
+
594
+ ### Stored ChatCard
595
+
596
+ The assistant message stores only a signed reference to the workflow run:
597
+
598
+ ```xml
599
+ <crewx_card type="workflow" version="1" run_id="wfr_xxx" workflow_id="rc-publish" mode="auto" proof="jwt..." />
600
+ ```
601
+
602
+ Rules:
603
+
604
+ - The `proof` is server-issued and expires after 7 days.
605
+ - Raw `<crewx_card>` text from users is rendered as plain text.
606
+ - Workflow actions such as resolve, auto resume, approve, reject, and cancel require a valid proof bound to the current workspace/thread/task.
607
+ - The mutable run state remains in `.crewx/workflow-runs/`; the ChatCard stores only a reference.
608
+
542
609
  ## Architecture
543
610
 
544
611
  ```
@@ -568,7 +635,7 @@ interface RunExecution {
568
635
  WorkflowService --> fs (YAML read) + WorkflowEngine + RunManager
569
636
  |
570
637
  +---> Thread transcript card:
571
- <crewx_card type="workflow" run_id="..." workflow_id="..." mode="auto" />
638
+ <crewx_card type="workflow" run_id="..." workflow_id="..." mode="auto" proof="jwt..." />
572
639
  ```
573
640
 
574
641
  > **Note:** The server uses `RunManager` for workflow runs and stores workflow UI references as ChatCard tags in thread messages. The mutable run status/state remains in `.crewx/workflow-runs/` and is fetched by `run_id`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewx/workflow",
3
- "version": "0.3.22-rc.12",
3
+ "version": "0.3.22-rc.14",
4
4
  "description": "Workflow engine for CrewX - list, show, validate workflows with Mermaid visualization",
5
5
  "type": "commonjs",
6
6
  "main": "dist/src/engine.js",
@@ -49,7 +49,7 @@
49
49
  "@hyperjump/json-schema": "^1.9.4",
50
50
  "js-yaml": "^4.1.0",
51
51
  "@crewx/knowledge-core": "0.1.17",
52
- "@crewx/sdk": "0.8.8-rc.32",
52
+ "@crewx/sdk": "0.8.8-rc.34",
53
53
  "@crewx/shared": "0.0.5"
54
54
  },
55
55
  "devDependencies": {