clementine-agent 1.2.2 → 1.3.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.
Files changed (41) hide show
  1. package/dist/agent/assistant.js +12 -0
  2. package/dist/cli/dashboard.js +3034 -734
  3. package/dist/cli/static/LICENSE-NOTICES.md +12 -0
  4. package/dist/cli/static/drawflow.min.css +1 -0
  5. package/dist/cli/static/drawflow.min.js +1 -0
  6. package/dist/config.d.ts +11 -0
  7. package/dist/config.js +16 -0
  8. package/dist/dashboard/builder/dry-run.d.ts +31 -0
  9. package/dist/dashboard/builder/dry-run.js +138 -0
  10. package/dist/dashboard/builder/events.d.ts +23 -0
  11. package/dist/dashboard/builder/events.js +28 -0
  12. package/dist/dashboard/builder/mcp-invoke.d.ts +25 -0
  13. package/dist/dashboard/builder/mcp-invoke.js +143 -0
  14. package/dist/dashboard/builder/runner.d.ts +68 -0
  15. package/dist/dashboard/builder/runner.js +418 -0
  16. package/dist/dashboard/builder/serializer.d.ts +79 -0
  17. package/dist/dashboard/builder/serializer.js +547 -0
  18. package/dist/dashboard/builder/snapshots.d.ts +32 -0
  19. package/dist/dashboard/builder/snapshots.js +138 -0
  20. package/dist/dashboard/builder/validation.d.ts +26 -0
  21. package/dist/dashboard/builder/validation.js +183 -0
  22. package/dist/gateway/router.js +31 -2
  23. package/dist/index.js +38 -0
  24. package/dist/memory/chunker.js +13 -2
  25. package/dist/memory/hot-cache.d.ts +38 -0
  26. package/dist/memory/hot-cache.js +73 -0
  27. package/dist/memory/integrity.d.ts +28 -0
  28. package/dist/memory/integrity.js +119 -0
  29. package/dist/memory/maintenance.d.ts +23 -2
  30. package/dist/memory/maintenance.js +140 -3
  31. package/dist/memory/store.d.ts +259 -2
  32. package/dist/memory/store.js +751 -21
  33. package/dist/memory/write-queue.d.ts +96 -0
  34. package/dist/memory/write-queue.js +165 -0
  35. package/dist/tools/builder-tools.d.ts +13 -0
  36. package/dist/tools/builder-tools.js +437 -0
  37. package/dist/tools/mcp-server.js +2 -0
  38. package/dist/tools/memory-tools.js +38 -1
  39. package/dist/types.d.ts +56 -2
  40. package/package.json +2 -2
  41. package/vault/00-System/skills/builder-canvas.md +126 -0
@@ -0,0 +1,126 @@
1
+ ---
2
+ title: Visual Builder canvas — workflow + cron editing
3
+ description: >-
4
+ When the user is on the dashboard's Builder page with a workflow or cron
5
+ open in the visual canvas, use the workflow_* MCP tools to read, edit,
6
+ validate, and dry-run the workflow. Edits land live on the user's canvas
7
+ via SSE.
8
+ triggers:
9
+ - edit this workflow
10
+ - add a step
11
+ - add a node
12
+ - remove a step
13
+ - connect these steps
14
+ - change the schedule
15
+ - disable this cron
16
+ - validate the workflow
17
+ - dry run this workflow
18
+ - dry-run
19
+ - show what would happen
20
+ - test the workflow safely
21
+ - rename this workflow
22
+ - duplicate this workflow
23
+ - turn this on
24
+ - turn this off
25
+ source: manual
26
+ loaded: auto
27
+ placement: system
28
+ ---
29
+
30
+ # Visual Builder canvas — workflow + cron editing
31
+
32
+ ## When this applies
33
+
34
+ The user is working in the dashboard's **Builder** page with a workflow
35
+ or cron open in the visual canvas. Their chat messages are about editing
36
+ that workflow: adding/removing steps, changing the schedule, validating,
37
+ etc. The canvas updates live via Server-Sent Events as you make edits, so
38
+ the user *sees your changes appear* on screen.
39
+
40
+ ## Tools you have
41
+
42
+ Discovery and read:
43
+ - `workflow_list` — list all workflows + crons (one per line, terse)
44
+ - `workflow_read` — read full workflow as JSON before editing
45
+ - `workflow_search` — find by name or step content
46
+ - `workflow_list_mcp_tools` — discover available MCP servers/tools (use to fill in `mcp` step config)
47
+ - `workflow_list_channels` — discover channel kinds for `channel` step config
48
+
49
+ Validation (cheap, no execution):
50
+ - `workflow_validate` — static checks: cycles, missing deps, missing fields per kind
51
+ - `workflow_dry_run` — describe what each step would do, in topological order, with rough token estimate. **Use this for long-running jobs to preview safely before scheduling.**
52
+
53
+ Mutations (always emit a live update to the canvas):
54
+ - `workflow_add_node` — append a new step
55
+ - `workflow_update_node` — change an existing step's fields (partial patch)
56
+ - `workflow_remove_node` — delete a step + edges referencing it
57
+ - `workflow_connect` — add edge `from → to` (sets `to.dependsOn += [from]`)
58
+ - `workflow_disconnect` — remove edge
59
+ - `workflow_set_enabled` — toggle on/off
60
+ - `workflow_set_schedule` — change cron schedule (or pass `null` for manual-only)
61
+ - `workflow_rename`, `workflow_duplicate`, `workflow_delete`
62
+ - `workflow_save` — full replace (use for atomic multi-field changes; otherwise prefer the targeted tools)
63
+ - `workflow_create` — new workflow file
64
+
65
+ ## Workflow shape
66
+
67
+ Every workflow is a step DAG. A step has:
68
+ - `id` (unique within workflow)
69
+ - `prompt` (string — required for `kind: prompt`, descriptive for others)
70
+ - `dependsOn[]` (step ids this step depends on)
71
+ - `tier`, `maxTurns`, `model`, `workDir`
72
+ - `kind` — one of: `prompt` (default), `mcp`, `channel`, `transform`, `conditional`, `loop`
73
+ - Plus a kind-specific config (`mcp`, `channel`, `transform`, `conditional`, `loop`)
74
+
75
+ A **cron** is a single-step workflow with a cron schedule trigger. You
76
+ **cannot** add a second step to a cron — cron entries must remain
77
+ single-step. To make a multi-step automation that runs on a schedule,
78
+ use `workflow_create` with a schedule.
79
+
80
+ ## How to work
81
+
82
+ **Always read first.** Before editing, call `workflow_read` to get the
83
+ current step ids and structure. Patches reference step ids by exact
84
+ match.
85
+
86
+ **Validate after edits.** Save tools auto-validate and reject errors;
87
+ warnings still pass through. Run `workflow_validate` if the user asks
88
+ "is this right?" or before recommending they enable a workflow.
89
+
90
+ **Dry-run before scheduling.** When the user is about to enable a
91
+ long-running workflow (multi-hour job, batch outreach, large ingest),
92
+ offer `workflow_dry_run` first. It walks the DAG and describes what each
93
+ step *would* do — no execution, no side effects.
94
+
95
+ **One mutation per turn for big changes.** The canvas updates live, so
96
+ small targeted edits (`workflow_add_node`, `workflow_connect`) feel
97
+ better than wholesale `workflow_save` rewrites. The user can see
98
+ intermediate states.
99
+
100
+ **Step ids should be short and descriptive.** `s1`, `s2` is fine;
101
+ `fetch_emails`, `summarize`, `send_to_slack` is better. Don't change
102
+ existing step ids unless the user explicitly asks — other steps depend
103
+ on them.
104
+
105
+ **Channel and MCP steps need real config.** Use `workflow_list_mcp_tools`
106
+ to find a real `server.tool` pair before adding an MCP step. Use
107
+ `workflow_list_channels` to confirm a channel kind is wired up before
108
+ adding a channel step.
109
+
110
+ ## Common patterns
111
+
112
+ User: "Add a slack send step at the end."
113
+ 1. `workflow_read` to get current step ids
114
+ 2. Identify the leaf step(s) (no other step depends on them)
115
+ 3. `workflow_add_node` with `kind: 'channel'`, `channel: { channel: 'slack', target: '#me', content: '{{<leaf>.output}}' }`, `dependsOn: ['<leaf>']`
116
+
117
+ User: "Make this run every weekday at 9am."
118
+ 1. `workflow_set_schedule` with `'0 9 * * 1-5'`
119
+
120
+ User: "Will this work? Don't run it yet."
121
+ 1. `workflow_validate` for static checks
122
+ 2. `workflow_dry_run` to walk through what it would do
123
+
124
+ User: "Skip if there are no unread emails."
125
+ 1. `workflow_add_node` with `kind: 'conditional'`, condition referencing the email-list step's output count
126
+ 2. `workflow_connect` to wire it