@eventmodelers/cli 0.0.11 → 0.0.12
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/package.json
CHANGED
|
@@ -260,6 +260,17 @@ Get a single node.
|
|
|
260
260
|
|
|
261
261
|
---
|
|
262
262
|
|
|
263
|
+
### POST `/api/org/:orgId/boards/:boardId/nodes/:nodeId/auto-connect`
|
|
264
|
+
Auto-connect a node to its timeline neighbors — mirrors the frontend's auto-connect-on-place behavior. Looks only at the node's own timeline column and the previous column (never ahead), and creates `edge:added` events to every type-compatible neighbor found there, using the same pairing rules as connections created via node events (COMMAND→EVENT, SCREEN→COMMAND, EVENT→READMODEL, READMODEL→SCREEN, READMODEL→AUTOMATION, AUTOMATION→COMMAND). A COMMAND is not wired to the previous column's SCREEN if its own column already has one.
|
|
265
|
+
|
|
266
|
+
Incompatible or already-connected neighbors are reported in `skipped`, not an error. Returns an empty result for nodes not placed on any timeline, or not a connectable element type (e.g. SCENARIO/spec nodes are never auto-connected).
|
|
267
|
+
|
|
268
|
+
**Response**:
|
|
269
|
+
- `200` — `{ connected: [{edgeId, source, target, created}], skipped: [{nodeId, reason}] }`
|
|
270
|
+
- `404` — node not found
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
263
274
|
## 4. Images
|
|
264
275
|
|
|
265
276
|
**File**: `src/slices/change/api-images/routes.ts`
|
|
@@ -614,6 +625,7 @@ All events support optional metadata: `user_id`, `correlation_id`, `causation_id
|
|
|
614
625
|
| `src/slices/change/api-boards/routes.ts` | Board CRUD + event persistence |
|
|
615
626
|
| `src/slices/change/api-chapters/routes.ts` | Chapters, columns, lanes, cell drops |
|
|
616
627
|
| `src/slices/change/api-nodes/routes.ts` | Node event sourcing |
|
|
628
|
+
| `src/slices/extensions/supabase/nodes/AutoConnectNode.ts` | Auto-connect logic (timeline neighbor wiring) |
|
|
617
629
|
| `src/slices/change/api-images/routes.ts` | Image upload + sketch rendering |
|
|
618
630
|
| `src/slices/change/api-.slices/routes.ts` | Slice creation + slice definitions (SLICE_BORDER) |
|
|
619
631
|
| `src/slices/extensions/supabase/slices/CreateSliceDefinition.ts` | Slice definition (SLICE_BORDER) creation logic |
|
|
@@ -21,12 +21,15 @@ From `$ARGUMENTS`, extract:
|
|
|
21
21
|
| `boardId` | a board UUID | from `connect` skill (`BOARD_ID`) |
|
|
22
22
|
| `timelineId` | the chapter/timeline UUID | auto-detect (see Step 2) |
|
|
23
23
|
| `position` | column index (0-based number), `"after <title>"`, or omitted | append at end |
|
|
24
|
+
| `cellName` | spreadsheet-style cell reference given directly in the prompt, e.g. `"A2"` | none |
|
|
24
25
|
| `baseUrl` | explicit URL override | from `connect` skill (`BASE_URL`) |
|
|
25
26
|
|
|
26
27
|
Normalise `elementType` to uppercase: `event` → `EVENT`, `command` → `COMMAND`, `readmodel` → `READMODEL`, `screen` → `SCREEN`, `automation` → `AUTOMATION`.
|
|
27
28
|
|
|
28
29
|
Use `BOARD_ID` and `BASE_URL` from the `connect` skill. If a `boardId` argument is explicitly passed, it overrides `BOARD_ID`.
|
|
29
30
|
|
|
31
|
+
**Fast path — spreadsheet-style cell reference given directly (e.g. "place a COMMAND in A2"):** don't try to interpret what "A2" means yourself. The `node:created` event accepts a `cellName` field (see `learn-eventmodelers-api`) and the backend resolves it to the actual row/column — the same shortcut `html-screen` already uses. Skip Steps 3–6 entirely: resolve only `timelineId` (Step 2, needed for `chapterId`), then go straight to Step 7 and pass `cellName` instead of `cellId` on the `node:created` payload. Do not fetch columns, do not compute a row/column index, and do not construct `cellId` yourself for this case.
|
|
32
|
+
|
|
30
33
|
---
|
|
31
34
|
|
|
32
35
|
## Step 2 — Resolve the timeline
|
|
@@ -203,7 +206,9 @@ If no matching row is found, stop and report the error — the timeline may be m
|
|
|
203
206
|
|
|
204
207
|
> **SCREEN nodes always require a sketch.** The server auto-generates a title-only placeholder when a SCREEN is created without one, but it will look empty. Always follow up a SCREEN node creation with a call to `POST /images/:nodeId/sketch` (or use `POST /image-nodes/:nodeId/sketch` to create and render in one call — see `learn-eventmodelers-api` for the sketch format).
|
|
205
208
|
|
|
206
|
-
Include `x-token`, `x-board-id`, and `x-user-id: agent` on every call to `/nodes/events
|
|
209
|
+
Include `x-token`, `x-board-id`, and `x-user-id: agent` on every call to `/nodes/events`.
|
|
210
|
+
|
|
211
|
+
**Normal path** (position/lane resolved manually in Steps 3–6) — use `cellId`:
|
|
207
212
|
|
|
208
213
|
```bash
|
|
209
214
|
curl -s -X POST "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/events" \
|
|
@@ -226,9 +231,32 @@ curl -s -X POST "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/events" \
|
|
|
226
231
|
}]'
|
|
227
232
|
```
|
|
228
233
|
|
|
234
|
+
**Fast path** (`cellName` given directly, e.g. `"A2"` — see the Step 1 shortcut) — pass `cellName` instead of `cellId` and let the backend resolve it; nothing else in the payload changes:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
curl -s -X POST "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/events" \
|
|
238
|
+
-H "x-token: $TOKEN" \
|
|
239
|
+
-H "x-board-id: $BOARD_ID" \
|
|
240
|
+
-H "x-user-id: agent" \
|
|
241
|
+
-H "Content-Type: application/json" \
|
|
242
|
+
-d '[{
|
|
243
|
+
"eventType": "node:created",
|
|
244
|
+
"nodeId": "<node-uuid>",
|
|
245
|
+
"boardId": "<BOARD_ID>",
|
|
246
|
+
"timestamp": <Date.now()>,
|
|
247
|
+
"chapterId": "<TIMELINE_ID>",
|
|
248
|
+
"cellName": "<CELL_NAME>",
|
|
249
|
+
"meta": {
|
|
250
|
+
"type": "<ELEMENT_TYPE>",
|
|
251
|
+
"title": "<title>"
|
|
252
|
+
},
|
|
253
|
+
"node": { "data": { "title": "<title>" } }
|
|
254
|
+
}]'
|
|
255
|
+
```
|
|
256
|
+
|
|
229
257
|
Response: `{ "hashes": { "<event-uuid>": "<hash>" } }`
|
|
230
258
|
|
|
231
|
-
> **`node:created` with `cellId` IS the placement** — do NOT also call the `drop` endpoint afterwards. The `drop` endpoint adds a second cell reference without removing the first, causing the node to appear in two columns simultaneously. Use `node:created
|
|
259
|
+
> **`node:created` with `cellId`/`cellName` IS the placement** — do NOT also call the `drop` endpoint afterwards. The `drop` endpoint adds a second cell reference without removing the first, causing the node to appear in two columns simultaneously. Use `node:created` with `cellId` or `cellName` for all initial placements.
|
|
232
260
|
|
|
233
261
|
---
|
|
234
262
|
|