@controllerai/cli 0.2.20 → 0.2.22

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 (79) hide show
  1. package/README.md +6 -3
  2. package/dist/api/client.js +5 -38
  3. package/dist/api/client.js.map +1 -1
  4. package/dist/commands/agent.js +169 -146
  5. package/dist/commands/agent.js.map +1 -1
  6. package/dist/commands/expr.js +10 -3
  7. package/dist/commands/expr.js.map +1 -1
  8. package/dist/commands/integration.js +30 -10
  9. package/dist/commands/integration.js.map +1 -1
  10. package/dist/commands/skills.js +1 -0
  11. package/dist/commands/skills.js.map +1 -1
  12. package/dist/commands/templateSetup.js +42 -0
  13. package/dist/commands/templateSetup.js.map +1 -0
  14. package/dist/commands/workflow.js +6 -7
  15. package/dist/commands/workflow.js.map +1 -1
  16. package/dist/errors.js +2 -5
  17. package/dist/errors.js.map +1 -1
  18. package/dist/index.js +2 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/permissionTool.js +1 -1
  21. package/dist/permissionTool.js.map +1 -1
  22. package/package.json +6 -4
  23. package/skills/controllerai-agents/SKILL.md +109 -26
  24. package/skills/controllerai-agents/references/instructions-and-versioning.md +32 -34
  25. package/skills/controllerai-ai-nodes/SKILL.md +83 -10
  26. package/skills/controllerai-ai-nodes/references/selection-and-testing.md +44 -26
  27. package/skills/controllerai-data/SKILL.md +106 -34
  28. package/skills/controllerai-data/references/data-rails.md +24 -26
  29. package/skills/controllerai-expressions/SKILL.md +82 -29
  30. package/skills/controllerai-expressions/references/dsl-and-recipes.md +42 -40
  31. package/skills/controllerai-flow-control/SKILL.md +104 -21
  32. package/skills/controllerai-flow-control/references/patterns.md +23 -60
  33. package/skills/controllerai-integration-actions/SKILL.md +89 -11
  34. package/skills/controllerai-node-config/SKILL.md +108 -18
  35. package/skills/controllerai-node-config/references/prop-and-readiness.md +28 -78
  36. package/skills/controllerai-runs/SKILL.md +82 -25
  37. package/skills/controllerai-runs/references/debugging.md +24 -22
  38. package/skills/controllerai-start/SKILL.md +63 -35
  39. package/skills/controllerai-start/references/mcp-tool-map.md +22 -21
  40. package/skills/controllerai-template-setup/SKILL.md +132 -0
  41. package/skills/controllerai-template-setup/agents/openai.yaml +4 -0
  42. package/skills/controllerai-triggers/SKILL.md +113 -16
  43. package/skills/controllerai-triggers/references/lifecycle.md +36 -48
  44. package/skills/controllerai-workflows/SKILL.md +105 -25
  45. package/skills/controllerai-workflows/references/command-map.md +20 -44
  46. package/skills/manifest.json +96 -136
  47. package/skills-mcp/controllerai-agents/SKILL.md +121 -0
  48. package/skills-mcp/controllerai-agents/references/instructions-and-versioning.md +76 -0
  49. package/skills-mcp/controllerai-ai-nodes/SKILL.md +91 -0
  50. package/skills-mcp/controllerai-ai-nodes/references/selection-and-testing.md +66 -0
  51. package/skills-mcp/controllerai-data/SKILL.md +116 -0
  52. package/skills-mcp/controllerai-data/references/data-rails.md +43 -0
  53. package/skills-mcp/controllerai-expressions/SKILL.md +97 -0
  54. package/skills-mcp/controllerai-expressions/references/dsl-and-recipes.md +136 -0
  55. package/skills-mcp/controllerai-flow-control/SKILL.md +112 -0
  56. package/skills-mcp/controllerai-flow-control/references/patterns.md +82 -0
  57. package/skills-mcp/controllerai-integration-actions/SKILL.md +90 -0
  58. package/skills-mcp/controllerai-node-config/SKILL.md +106 -0
  59. package/skills-mcp/controllerai-node-config/references/prop-and-readiness.md +49 -0
  60. package/skills-mcp/controllerai-runs/SKILL.md +87 -0
  61. package/skills-mcp/controllerai-runs/references/debugging.md +53 -0
  62. package/skills-mcp/controllerai-start/SKILL.md +82 -0
  63. package/skills-mcp/controllerai-start/references/mcp-tool-map.md +177 -0
  64. package/skills-mcp/controllerai-template-setup/SKILL.md +10 -0
  65. package/skills-mcp/controllerai-triggers/SKILL.md +109 -0
  66. package/skills-mcp/controllerai-triggers/references/lifecycle.md +59 -0
  67. package/skills-mcp/controllerai-workflows/SKILL.md +108 -0
  68. package/skills-mcp/controllerai-workflows/references/command-map.md +1 -0
  69. package/skills-mcp/manifest.json +200 -0
  70. package/skills/controllerai-agents/references/command-reference.md +0 -205
  71. package/skills/controllerai-ai-nodes/references/command-reference.md +0 -98
  72. package/skills/controllerai-data/references/command-reference.md +0 -177
  73. package/skills/controllerai-expressions/references/command-reference.md +0 -166
  74. package/skills/controllerai-flow-control/references/command-reference.md +0 -171
  75. package/skills/controllerai-integration-actions/references/command-reference.md +0 -118
  76. package/skills/controllerai-node-config/references/command-reference.md +0 -186
  77. package/skills/controllerai-runs/references/command-reference.md +0 -113
  78. package/skills/controllerai-triggers/references/command-reference.md +0 -215
  79. package/skills/controllerai-workflows/references/command-reference.md +0 -118
@@ -1,71 +1,59 @@
1
+ <!-- generated from .claude/skills by cli/scripts/render-skills.mjs; edit the source -->
1
2
  # Trigger lifecycle
2
3
 
3
4
  ## State sequence
4
5
 
5
6
  ```text
6
- source decision
7
- -> exact node/event discovery
7
+ source decision (basis)
8
+ -> exact node and event
8
9
  -> connection
9
- -> dynamic prop resolution
10
- -> create source + canvas
11
- -> map payload into target flow
12
- -> capture representative event
13
- -> select typed sample
14
- -> test target flow on development
15
- -> replay captured event against development
16
- -> publish workflow
10
+ -> prop and option resolution (latest dynamicPropsId)
11
+ -> create source and canvas trigger (triggerId, backendTriggerId, triggerNodeId, runSubflowNodeId)
12
+ -> declare the flow inputs
13
+ -> capture a representative event, select it
14
+ -> bind one mapping prop per input on the run-subflow node
15
+ -> run the target flow on development
16
+ -> replay the captured event on development
17
+ -> audit every trigger, then authorized publish
17
18
  -> optional live replay
18
19
  ```
19
20
 
20
- Skipping capture/sample selection commonly leaves downstream output untyped. Skipping mapping commonly produces a green trigger execution with empty flow inputs.
21
+ Skipping capture or selection leaves the trigger output untyped. Skipping the mapping produces a green trigger execution with empty flow inputs. Leaving ambient dispatch allowed can produce double runs after publish.
21
22
 
22
23
  ## IDs
23
24
 
24
25
  | ID | Used by |
25
26
  | --- | --- |
26
- | Canvas `triggerId` | `trigger get`, `rename`, `set-enabled`, `delete`, `test-events` |
27
- | Numeric `backendTriggerId` | `trigger events`, `replay` |
28
- | `triggerNodeId` | `trigger select-event` |
29
- | Captured `eventId` | `trigger event`, `select-event`, `replay --event` |
27
+ | Canvas `triggerId` | get, rename, set-enabled, delete, test-events |
28
+ | Numeric `backendTriggerId` | captured events, replay (`--trigger`) |
29
+ | `triggerNodeId` | select-event |
30
+ | `runSubflowNodeId` | the mapping props, one per flow input |
31
+ | Captured `eventId` | event read, select-event, replay |
30
32
 
31
- Always copy these from the transport output.
33
+ Copy them from the responses. A replaced trigger has new IDs and possibly a new webhook URL.
32
34
 
33
- Development replay is the normal pre-publish check:
35
+ ## Switches and acknowledgements
34
36
 
35
- ```bash
36
- cai trigger replay --trigger <backendTriggerId> --event <eventId> --target dev --json
37
- ```
38
-
39
- Use `--target live --confirm-live` only for an intentional post-publish live verification.
40
-
41
- ## Enable/disable
42
-
43
- `cai trigger set-enabled <triggerId> --enable|--disable` sets the requested state idempotently. Pass exactly one state flag.
37
+ | Switch | Flags | Meaning |
38
+ | --- | --- | --- |
39
+ | Definition state | `set-enabled --enable` / `--disable` | Whether the trigger starts its flow; development edit until published |
40
+ | Ambient development dispatch | `test-events --allow --acknowledge-dual-run` / `--disallow` | Real events also execute the development canvas; sticky permission bit, survives disable |
41
+ | Replay rail | `replay --target dev` / `--target live --confirm-live` | Which version one captured event executes |
42
+ | Publish while armed | `workflow publish --acknowledge-dual-dispatch` | User's informed acceptance of double runs and double billing |
44
43
 
45
- MCP: call `trigger_set_enabled` with `enabled: true` or `enabled: false`.
46
-
47
- ## Lifecycle flag families
48
-
49
- ```bash
50
- cai trigger set-enabled <triggerId> --enable|--disable --json
51
- cai trigger test-events <triggerId> --allow [--acknowledge-dual-run] --json
52
- cai trigger test-events <triggerId> --disallow --json
53
- cai trigger replay --trigger <backendTriggerId> --target dev --json
54
- cai trigger replay --trigger <backendTriggerId> --target live --confirm-live --json
55
- cai workflow publish --acknowledge-dual-dispatch --json
56
- ```
44
+ Each acknowledgement belongs to exactly one operation. Arming, publishing armed and live replay are three separate user decisions.
57
45
 
58
- Use enable/disable for the trigger definition, allow/disallow for ambient development capture, and target for replay rail. `--acknowledge-dual-run` applies only while arming. `--acknowledge-dual-dispatch` applies only when publishing an armed trigger. `--confirm-live` applies only to one Live replay. These acknowledgements are not interchangeable.
46
+ ## Lifecycle fields
59
47
 
60
- The allow flag is sticky even when the trigger is disabled. Always disallow after capture or an abandoned setup so later re-enablement cannot silently rearm development dispatch.
48
+ The list and get reads report `devCanvasEnabled` at the top level and, under `deployment`, `liveCanvasEnabled` (null when no live canvas exists: never published, or this trigger was added after the last publish), `inLiveVersion`, `devDispatchArmed` (enabled and allowed) and `dualDispatchLive`; get adds captured event counts and issues. The audit summarizes coverage and double-run risk before a publish and names the disarm step for each armed trigger.
61
49
 
62
- ## Debugging a missing run
50
+ ## Missing-run diagnosis
63
51
 
64
- 1. `cai trigger list --json`: enabled, correct flow, recoverable backend ID.
65
- 2. `cai workflow status --json`: published/active live state.
66
- 3. `cai trigger events --trigger <backendId>`: did ingestion capture the event?
67
- 4. `cai trigger event <eventId>`: does payload match the selected sample?
68
- 5. `cai exec list --json`: did execution start?
69
- 6. `cai exec tree <executionId> --json`: where did it stop?
52
+ 1. The trigger list: enabled, correct flow, recoverable backend ID?
53
+ 2. The workflow status: published, and is the live version active?
54
+ 3. The captured events for the backend trigger ID: did ingestion capture the event?
55
+ 4. The event read: does the payload match the selected sample?
56
+ 5. The execution list: did an execution start?
57
+ 6. The execution tree: where did it stop?
70
58
 
71
- No captured event means source/delivery/configuration. Captured event with no execution means enable/live/ingestion routing. An execution with empty inputs means mapping.
59
+ No captured event points to the source, delivery or configuration. A captured event with no execution points to enablement, publish state or ingestion routing. An execution with empty inputs points to the mapping. Development works but live does not: compare the enabled state and the published configuration, and remember that live runs read the live data store.
@@ -1,46 +1,126 @@
1
1
  ---
2
2
  name: controllerai-workflows
3
- description: Build, inspect, repair, test and publish Controller AI workflows: typed callable flows, deterministic actions, branching, durable workflow data and triggers. Use for automations or an agent-callable application backend.
3
+ description: Build, inspect, edit, recover, and publish Controller AI workflows and their flows. Use when a user asks to create or change an automation, a flow, or a workflow release, and for the lifecycle rules every other workflow skill relies on.
4
4
  ---
5
+ <!-- generated from .claude/skills by cli/scripts/render-skills.mjs; edit the source -->
5
6
 
6
- # Controller AI workflows
7
+ # Workflows
7
8
 
8
- A workflow groups **flows**, **custom schemas**, **data collections** and **triggers**. A flow is one callable function with typed inputs and outputs; its connected nodes implement the function. Several flows can share the workflow's data store and call one another.
9
+ ## Use this when
9
10
 
10
- Flows are useful as API-like tools for agents. For example one “Investor CRM” workflow can expose create/get/update/delete/search flows for contacts, companies, deals and activities, plus a contact history view. An agent chooses a tool; the flow enforces its contract and performs the work.
11
+ - Creating a workflow, adding or repairing flows, orienting inside an existing graph, validating, checkpointing, restoring, publishing, or deleting.
12
+ - Another skill needs the shared lifecycle rules: which rail an edit lands on, how contracts and IDs behave, what validation and publishing require.
11
13
 
12
- ## Start with the contract
14
+ Load the narrow skill when the work reaches it: nodes, connections, props and wiring → `controllerai-node-config`; computed values and conditions → `controllerai-expressions`; Router, If/Else, loops, joins, subflows → `controllerai-flow-control`; runs and debugging → `controllerai-runs`; schedules, webhooks, app events → `controllerai-triggers`; schemas and records → `controllerai-data`; Ask AI and agent nodes → `controllerai-ai-nodes`; user-facing agents → `controllerai-agents`.
13
15
 
14
- Define each flow's inputs, outputs and failure behavior. Keep one operation per agent tool when that makes selection clearer than a giant operation dispatcher. Choose useful names and descriptions: “Search contacts by name, owner, tags and status” tells an agent when to call it.
16
+ ## How it works
15
17
 
16
- Create the workflow, then explicitly create the first flow. `workflow_outline` provides a compact inventory; `flow_get` provides a flow's contracts, graph and configured values. Workflow IDs, flow IDs and node IDs are different identities.
18
+ A **workflow** groups flows, custom schemas, data collections and triggers, and its flows share one data store per environment. A **flow** is one canvas and one callable contract: typed inputs, connected nodes, typed outputs. A Return node maps values into the declared outputs; declaring an output does not fill it. Workflow, flow, node, input and output IDs are distinct identities; never swap one for another.
17
19
 
18
- Before changing an existing workflow, read its outline and the affected flow. Repair the existing IDs instead of creating replacements. For a substantial rewrite, save a named checkpoint. Restore rolls back the definition, not record changes or external effects.
20
+ Every graph edit lands on the **development** version. Publishing creates the **live** release; a live agent that uses the workflow as a tool follows its latest live release without an agent publish, while the owner's Test conversations run the development version. Publishing never copies development records into the live store, and every environment keeps its own data.
19
21
 
20
- ## Assemble and test
22
+ Every save is a **state**. History lists states in groups and gives candidate state IDs; a restore rolls the definition back to one state and leaves records and external effects untouched. How far back history is listed and how far back a state can be restored are two separate plan limits, so a listed state is not always restorable.
21
23
 
22
- 1. Create any custom schemas and flow inputs/outputs first.
23
- 2. Discover actions and add nodes in execution order. Configure the type or action selector before dependent props; reload props if the selector changes.
24
- 3. Bind expressions using current `expr_context` names. Wire the source output to the destination so it appears in `inputs`.
25
- 4. Use a Return node to map promised flow outputs. Merely declaring an output does not populate it.
26
- 5. Test a complete development path with explicit representative input. Check the returned contract and same-environment data changes.
27
- 6. Apply the proven pattern to additional paths. Batch independent configuration when the available tool supports it; do not combine operations whose IDs depend on earlier responses.
28
- 7. Layout each changed flow, validate the saved workflow, and re-read its outline.
24
+ Deleting a workflow tears down its deployed triggers and soft-deletes it. It is refused while any draft or live agent depends on the workflow, and nothing undeletes. The dependency map shows a workflow's agent and workflow callers and the connections it uses. Deleting a flow removes its graph, its contract and the triggers targeting it, and breaks every caller bound to it.
29
25
 
30
- Use `controllerai-node-config` for action configuration, `controllerai-expressions` for computed values, `controllerai-flow-control` for routing/loops, `controllerai-data` for storage and `controllerai-runs` for execution evidence.
26
+ The account event feed records only supported events: connections created, workflows created, updated, deleted, published and run, agents created and published, members added. Settings changes, member removals and label edits are not in it, and a past change that is not recorded cannot be reconstructed from names or current state.
31
27
 
32
- ## Files and agents
28
+ ## Rules
33
29
 
34
- A chat attachment is handled by a user-facing agent. For CSV enrichment, make a per-row flow accepting `investorName` and optional `company`, returning normalized contact information and evidence. The agent reads and writes the CSV. The native Create File action can generate files; it does not imply a native CSV reader/upload trigger.
30
+ 1. **Before changing an existing workflow, read its outline and the affected flow**, then repair those IDs rather than creating a replacement workflow or flow. A repair that recreates loses history, triggers and callers.
31
+ 2. **Rename contracts in place.** Deleting and recreating an input or output breaks every expression, subflow mapping and agent tool bound to it. After a rename or deletion, re-read the flow and repair the affected dependents before validating or running; a stored input-ID binding survives a rename, so the readback may show nothing to repair.
32
+ 3. **"Store, save, log, record" without a named destination means a custom data type plus a create-record node.** A flow output alone persists nothing. When the user names a destination (a sheet, a CRM, an app, a file), write there through that integration; add a platform record only if they also want a copy kept here.
33
+ 4. **Validate after structural edits and before publishing.** Fix every listed prop, wire, expression, type, subflow, branch and trigger error, or report each one with what it breaks. Publish refuses errors; `--acknowledge-validation-errors` is for issues the user has seen and accepted, never a shortcut. If the user forbids a repair, report and stop.
34
+ 5. **Validation counts are status.** Do not write them into unrelated workflow properties unless the user asks for exactly that.
35
+ 6. **Deleting a workflow needs the user's explicit intent.** A confirmation flag is not authorization. Check dependencies first; detach draft tools with `cai agent remove-tool <agentId> --tool <toolId>`, and treat a live agent's republish as its own decision.
36
+ 7. **Layout once per changed flow.** After adds, deletes or rewires, run the flow layout as the last structural step; placement at add time only avoids overlap.
37
+ 8. **Never weaken the request to make a test pass.** Report an unsupported capability or ask the product question. Keep deliberately armed triggers and advisory-only nodes the user chose.
38
+ 9. **A conflict means re-read, then reapply the intent to the current graph.** Never replay a stale document or old IDs; the retried write uses the IDs the current state holds.
39
+ 10. **Say "not recorded" and change nothing** when asked to reconstruct history the feed does not hold.
35
40
 
36
- For an agent tool, attach the tested flow with `agent_tool_workflow_add`. Its flow inputs and outputs are the tool contract. For unattended operation, add a trigger and map its event into these same inputs.
41
+ ## Recipes
37
42
 
38
- ## Release and recovery
43
+ ### Establish context
39
44
 
40
- Graph edits affect development. Publishing creates the workflow's live release; attached live agents follow its latest release without another agent publish. The development/live record stores remain separate.
45
+ ```bash
46
+ cai auth status --json
47
+ cai workflow list --json
48
+ cai use <workflowId>
49
+ cai workflow status --json
50
+ ```
41
51
 
42
- Use the user's existing authorization when deciding whether to publish. If publication is authorized, fix validation errors, publish, then verify Live. For a draft-only request, deliver the tested draft and its link.
52
+ A create or `cai use` may not win the effective pin: read `selected`, `effectiveWorkflowId` and `pinSource`, and resolve as `pinSource` says (drop the command flag, use `cai use <id>`, or clear an inherited `CAI_WORKFLOW`). `cai config reset` clears stored pins only; `cai doctor` confirms the effective pin and development head.
43
53
 
44
- On a state conflict, re-read the current saved version and reapply the intended change. Do not overwrite a newer graph with an old document. Report validation issues by their practical effect and inspect empty results where data was expected.
54
+ ### Create
45
55
 
46
- Detailed CLI/MCP sequences and lifecycle operations: [command reference](references/command-reference.md). Multi-domain command lookup: [command map](references/command-map.md).
56
+ ```bash
57
+ cai workflow create --name "<clear outcome-oriented name>" --json
58
+ ```
59
+
60
+ Create with the final name. Read `flowCount` and `nextStep`: with 0 flows, create the first flow with `cai flow create --name "<name>" --json`; with one empty default flow, rename it and build in it; when either field is missing, list the flows before deciding. Add flows only for genuinely separate canvases, and stop at an empty workflow when that is what was asked. A missing projected field is not a failed create: read the full result or the exact inventory before retrying.
61
+
62
+ ### Orient
63
+
64
+ ```bash
65
+ cai workflow outline --json
66
+ cai workflow state --flow <flowId> --json
67
+ cai flow get <flowId> --json
68
+ ```
69
+
70
+ The outline shows flows, contracts, graph dependencies, triggers and data inventory in one call. State is a bounded projection; pass the flow ID for node and edge identities. The flow read exposes props and expressions.
71
+
72
+ ### Build
73
+
74
+ 1. Translate the request into inputs, steps, outputs, trigger, integrations, failure behavior and publish intent.
75
+ 2. Declare flow inputs and outputs before nodes whose props derive from them. Pass a human display label; use the current binding from `flow get` (`jsBinding`) or the outline (`binding`), never the diagnostic `legacyBinding`.
76
+ 3. Add nodes in execution order and name each after the data it produces; downstream bindings are seeded from that name when wired.
77
+ 4. Lay out each changed flow, validate, test on development, re-read status. Publish only when the user asked for a live change or authorized deployment.
78
+
79
+ ### Publish
80
+
81
+ ```bash
82
+ cai workflow status --json
83
+ cai trigger list --json
84
+ cai workflow publish --json
85
+ ```
86
+
87
+ Read status and every trigger first: publishing activates enabled triggers on the live release. The publish refuses validation errors and may return an approval that the user must grant.
88
+
89
+ When the publish returns an approval, the CLI polls it; if polling is interrupted, `cai approval resume <approvalId>` continues the same intent instead of publishing again.
90
+
91
+ ### Checkpoint and recover
92
+
93
+ ```bash
94
+ cai workflow save --name "<checkpoint>" --json
95
+ cai workflow history --json
96
+ cai workflow history --group <groupId> --json
97
+ cai workflow restore --state <stateId> --json
98
+ ```
99
+
100
+ Save before a risky rewrite. Expand a group to find the state ID; restore by state, not by group.
101
+
102
+ ### Delete
103
+
104
+ ```bash
105
+ cai deps --json
106
+ cai workflow delete <workflowId> --yes
107
+ ```
108
+ `cai deps --account` maps the whole account. The `--force` flag is deprecated and inert.
109
+
110
+ ## Verify
111
+
112
+ ```bash
113
+ cai workflow outline --json
114
+ cai workflow validate --json
115
+ cai workflow status --json
116
+ cai flow get <flowId> --json
117
+ cai run flow <flowId> --inputs <values.json> --json
118
+ ```
119
+
120
+ Evidence that a build works: validation reports zero errors, or each remaining error is reported with its effect; required connections and props are complete; expressions resolve to the expected values, with intentional empties explained; the expected branch and error paths ran where practical; the flow outputs contain the promised values; the development or live state matches the request; the final outline matches the request, with only your own abandoned scratch objects removed. A checkpoint or a rename needs its readback, not a run. Once the requested blockers are fixed and each changed path ran once, stop; warnings alone do not justify a redesign.
121
+
122
+ ## Report
123
+
124
+ What was built, what ran and what it returned, whether it is published, and any connection or product decision still pending. Share returned product links only; never guess one.
125
+
126
+ Read [references/command-map.md](references/command-map.md) for the command families by domain when a task spans several areas.
@@ -1,40 +1,28 @@
1
- # Workflow command map
1
+ <!-- generated from .claude/skills by cli/scripts/render-skills.mjs; edit the source -->
2
+ # Workflow command families
2
3
 
3
- Read only the sections relevant to the requested work. On the CLI, use `cai <domain> --help` for flags. On MCP, inspect the typed tool schema and [the generated map](../../controllerai-start/references/mcp-tool-map.md).
4
+ Read the family you need; `cai <domain> --help` lists flags, and the [generated tool map](../../controllerai-start/references/mcp-tool-map.md) gives the MCP tool and parameter names.
4
5
 
5
- ## Setup and workflow lifecycle
6
+ ## Lifecycle
6
7
 
7
8
  ```text
8
- cai connect
9
- cai doctor
10
- cai config reset [--local|--global]
11
- cai auth status
12
9
  cai workflow list|create|get|rename|set-description|duplicate|delete
13
- cai workflow document|state|status|versions|releases|history|save|restore|publish
14
- cai use <workflowId>
10
+ cai workflow outline|document|state|status|versions|releases|history|save|restore|publish
15
11
  ```
16
12
 
17
- MCP: `account_status` replaces `auth status` and `doctor`; `cai connect`, `config reset`, and `use` are local-only, so pass `workflowId` explicitly.
13
+ `outline` is the compact inventory; `state --flow <flowId>` adds node and edge identities; `document` is the complete JSON. `save` creates a named checkpoint, `restore --state <stateId>` rolls the definition back, `publish` creates the live release and refuses validation errors unless the user has accepted them explicitly. `delete --yes` undeploys triggers and soft-deletes; it is refused while a draft or live agent depends on the workflow.
18
14
 
19
- `workflow state` is a bounded projection; use `--flow <flowId>` for node and edge identities. `workflow document` returns the complete opaque JSON. `workflow save` creates a named development checkpoint. `workflow publish` promotes development to live. Version history may be plan-gated. `workflow delete --yes` undeploys triggers and soft-deletes the workflow row; it refuses while any draft or LIVE agent depends on the workflow. Detach draft tools with `agent remove-tool`, publish detached drafts that are still LIVE, then retry. `--force` is deprecated and inert. Deletion is not a permanent history purge, and deleted rows currently have no CLI restore command.
20
-
21
- ## Canvas and graph
15
+ ## Canvas
22
16
 
23
17
  ```text
24
18
  cai flow list|get|create|rename|duplicate|delete|reorder|layout
25
19
  cai flow input add|update|delete
26
20
  cai flow output add|update|delete
27
21
  cai integration search|actions|action
28
- cai node init|status|get|props|set|connect|disconnect|delete
22
+ cai node add|status|get|props|set|connect|disconnect|delete
29
23
  ```
30
24
 
31
- MCP: `node set` and `expr set` are merged into `node_prop_set`.
32
-
33
- Declare flow outputs before adding a Return response node. Its props are derived from those outputs.
34
-
35
- `cai flow input add <flowId> --display "<human label>" --type <type>` returns the compiler-current `jsBinding`. Use the latest value from `flow get` (`jsBinding`) or `workflow outline` (`binding`), re-read it after every input rename, and never cache its spelling across renames. `legacyBinding` is diagnostic-only.
36
-
37
- ## Conditions and composition
25
+ ## Composition
38
26
 
39
27
  ```text
40
28
  cai node only-when
@@ -43,38 +31,26 @@ cai flow for-each
43
31
  cai node set-flow
44
32
  ```
45
33
 
46
- MCP: use `flow_for_each_scaffold` for `flow for-each` and `node_subflow_set` for `node set-flow`; pass file-based loop source inline as `listJs` and branch condition source as `js`.
47
-
48
- Use branch-specific connection commands for Router and If/Else outputs. Generic `node connect` supports only `main` and `error` outputs.
34
+ Router and If/Else outputs connect through the branch commands; generic `node connect` handles only `main` and `error` outputs.
49
35
 
50
36
  ## Verification
51
37
 
52
38
  ```text
53
39
  cai run inputs|node|flow|discover
54
- cai exec list|get|flow|node|ports|tree
40
+ cai exec list|get|flow|node|tree
55
41
  ```
56
42
 
57
- MCP: `run_node` and `run_flow` take `waitSeconds` (default 60, maximum 120). `run_discover` never keeps its scratch graph.
43
+ `run discover` executes the real action in a scratch flow and can cause third-party effects or charges; do not use it casually on mutating actions.
58
44
 
59
- `run discover` executes the real integration action in a scratch flow and can incur third-party effects or usage. Do not use it casually for mutating actions.
60
-
61
- ## Product surfaces
45
+ ## Other domains
62
46
 
63
47
  ```text
64
- cai connection list|connect
65
- cai trigger list|get|search|props|options|create|events|event|select-event|replay|set-enabled|rename|delete
66
- cai schema list|get|resolve|create|update|delete
67
- cai data collections|fields|query|get|create|update|delete|delete-many|import|copy-to-live
68
- cai agent list|get|create|update|add-workflow|remove-tool|add-file|tools|publish-preflight|publish|versions|visibility
69
- cai agent conversation list|create|status|history|send|approve|deny
48
+ cai connection list|update|delete
49
+ cai trigger list|get|create|search|replay|test-events
50
+ cai schema list|create|update|delete
51
+ cai data collections|query|create|update|delete|import
52
+ cai agent create|get|list|update|add-workflow|add-action|add-file|remove-tool|publish|conversation
53
+ cai template-setup status|complete
70
54
  ```
71
55
 
72
- Connections are authorized in a browser. The CLI returns and may open the URL; MCP returns it from `connection_connect_url`.
73
-
74
- MCP: `trigger_set_enabled` takes the same explicit enabled state as the CLI setter.
75
-
76
- MCP: every data write requires explicit `env`; pass CSV text inline as `content` to `data_record_import`, and pass `env: "live"` to `data_copy_to_live`.
77
-
78
- MCP: `agent update` splits into `agent_update` and `agent_set_enabled`; `agent add-file` splits into `agent_knowledge_file_add` and `agent_workspace_file_add` with inline `content`. `agent_conversation_send` takes `waitSeconds`.
79
-
80
- Agent visibility supports only `private` and `organization`; organization is an explicit live access change after agent publish.
56
+ Each family has its own skill; the map above covers CLI-to-MCP names for all of them.