@almadar/std 16.181.0 → 16.182.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 (75) hide show
  1. package/behaviors/lolo/infra/atoms/std-calendar-sync.lolo +290 -0
  2. package/behaviors/lolo/infra/atoms/std-notification-center.lolo +290 -0
  3. package/behaviors/lolo/infra/atoms/std-notify-on-event.lolo +238 -40
  4. package/behaviors/lolo/ui/core/atoms/std-esign-flow.lolo +180 -3
  5. package/behaviors/lolo/ui/core/molecules/ui-calendar-grid.lolo +6 -0
  6. package/behaviors/lolo/ui/core/organisms/ui-detail-panel.lolo +4 -4
  7. package/behaviors/lolo/ui/game/.hand-authored.json +1 -1
  8. package/behaviors/lolo/ui/game/atoms/ui-control-grid.lolo +5 -0
  9. package/behaviors/lolo/ui/game/atoms/ui-game-hud.lolo +5 -0
  10. package/behaviors/lolo/ui/game/templates/ui-game-shell.lolo +5 -5
  11. package/behaviors/registry/infra/atoms/std-calendar-sync.orb +1643 -0
  12. package/behaviors/registry/infra/atoms/std-notification-center.orb +1621 -0
  13. package/behaviors/registry/infra/atoms/std-notify-on-event.orb +1734 -169
  14. package/behaviors/registry/ui/core/atoms/std-esign-flow.orb +846 -2
  15. package/behaviors/registry/ui/core/molecules/ui-calendar-grid.orb +9 -0
  16. package/behaviors/registry/ui/core/organisms/ui-detail-panel.orb +4 -2
  17. package/behaviors/registry/ui/game/atoms/ui-control-grid.orb +13 -1
  18. package/behaviors/registry/ui/game/atoms/ui-game-hud.orb +13 -1
  19. package/behaviors/registry/ui/game/templates/ui-game-shell.orb +5 -5
  20. package/canonical-operators.json +21 -1
  21. package/dist/behaviors/exports-reader.js +8303 -3043
  22. package/dist/behaviors/functions/index.d.ts +468 -10
  23. package/dist/behaviors/functions/index.js +18352 -13109
  24. package/dist/behaviors/index.d.ts +1 -1
  25. package/dist/behaviors/index.js +8304 -3044
  26. package/dist/behaviors/query.js +8303 -3043
  27. package/dist/behaviors-embeddings.hash.json +3 -3
  28. package/dist/behaviors-embeddings.json +449 -441
  29. package/dist/behaviors-registry.json +1164 -9
  30. package/dist/index.d.ts +3 -3
  31. package/dist/index.js +8275 -2978
  32. package/dist/knob-embeddings.hash.json +3 -3
  33. package/dist/knob-embeddings.json +1 -1
  34. package/dist/modules/anim.d.ts +1 -1
  35. package/dist/modules/array.d.ts +1 -1
  36. package/dist/modules/async.d.ts +1 -1
  37. package/dist/modules/behavior.d.ts +1 -1
  38. package/dist/modules/browser.d.ts +1 -1
  39. package/dist/modules/browser.js +21 -0
  40. package/dist/modules/composition.d.ts +1 -1
  41. package/dist/modules/contract.d.ts +1 -1
  42. package/dist/modules/core.d.ts +1 -1
  43. package/dist/modules/core.js +18 -2
  44. package/dist/modules/data.d.ts +1 -1
  45. package/dist/modules/ease.d.ts +1 -1
  46. package/dist/modules/format.d.ts +1 -1
  47. package/dist/modules/geo.d.ts +1 -1
  48. package/dist/modules/graph.d.ts +1 -1
  49. package/dist/modules/grid.d.ts +1 -1
  50. package/dist/modules/index.d.ts +1 -1
  51. package/dist/modules/index.js +39 -2
  52. package/dist/modules/integration.d.ts +1 -1
  53. package/dist/modules/llm.d.ts +1 -1
  54. package/dist/modules/math.d.ts +1 -1
  55. package/dist/modules/memory.d.ts +1 -1
  56. package/dist/modules/nn.d.ts +1 -1
  57. package/dist/modules/noise.d.ts +1 -1
  58. package/dist/modules/object.d.ts +1 -1
  59. package/dist/modules/os.d.ts +1 -1
  60. package/dist/modules/path.d.ts +1 -1
  61. package/dist/modules/prob.d.ts +1 -1
  62. package/dist/modules/session.d.ts +1 -1
  63. package/dist/modules/str.d.ts +1 -1
  64. package/dist/modules/tensor.d.ts +1 -1
  65. package/dist/modules/time.d.ts +1 -1
  66. package/dist/modules/trace.d.ts +1 -1
  67. package/dist/modules/train.d.ts +1 -1
  68. package/dist/modules/validate.d.ts +1 -1
  69. package/dist/modules/vector.d.ts +1 -1
  70. package/dist/modules/workspace.d.ts +1 -1
  71. package/dist/registry/factory-signatures.json +1 -1
  72. package/dist/registry.d.ts +1 -1
  73. package/dist/registry.js +39 -2
  74. package/dist/{types-DGJ6Y6nW.d.ts → types-BXWzEjFm.d.ts} +1 -1
  75. package/package.json +3 -3
@@ -0,0 +1,1643 @@
1
+ {
2
+ "description": "std-calendar-sync — two-way Google Calendar synchronization engine. PUSH: a 15-minute cron scan (and the user-addressable SYNC_NOW) walks `targetEntity` rows whose `externalEventId` marker is blank and creates a remote event per row through calendar.createEvent, reading the summary/start/end via the configured field mapping (`titleField`/`startField`/`endField`/`durationMinutes` fallback/`locationField`/`descriptionField`) — so ANY event-shaped host entity pushes, provided it declares the two marker columns `externalEventId : string` and `syncedAt : number` (the remindedAt precedent). PULL: `CAL_REMOTE_CHANGED` (delivered by the shared /api/hooks/google-calendar ingress from a calendar.watch channel) or the same cycle after a clean push lists remote events (incremental via the in-memory sync token; a restart falls back to a full window list) and upserts each into the atom's own canonical `CalendarEvent` store, matched by `externalEventId` — pulls land in the canonical store, NOT the arbitrary target, because persist keys are static in the language; bind calendar UI to `CalendarEvent` to surface remote events. Conflict detection (local-newer-than-remote) needs a local-modified marker convention and is a recorded gap, not a decorative state. Composes with std-notify-on-event via CAL_SYNCED / CAL_SYNC_FAILED.",
3
+ "ledger": {
4
+ "entries": {
5
+ "ent_01M0M9E89Q1H8VNNH0J06PH7RH": {
6
+ "bakedName": "CalendarEvent",
7
+ "curName": "CalendarEvent",
8
+ "id": "ent_01M0M9E89Q1H8VNNH0J06PH7RH",
9
+ "kind": "entity",
10
+ "owner": "workspace",
11
+ "renames": []
12
+ },
13
+ "ent_01M0MAF1B71AH9M3J5ZYKAXFM3": {
14
+ "bakedName": "CalendarSyncRun",
15
+ "curName": "CalendarSyncRun",
16
+ "id": "ent_01M0MAF1B71AH9M3J5ZYKAXFM3",
17
+ "kind": "entity",
18
+ "owner": "workspace",
19
+ "renames": []
20
+ },
21
+ "evt_01M0M9E89Q006H33RM6WGB8QRJ": {
22
+ "bakedName": "CAL_REMOTE_LISTED",
23
+ "curName": "CAL_REMOTE_LISTED",
24
+ "id": "evt_01M0M9E89Q006H33RM6WGB8QRJ",
25
+ "kind": "event",
26
+ "owner": "workspace",
27
+ "parent": "trt_01M0M9E89QMEF62295H7XTZDND",
28
+ "renames": []
29
+ },
30
+ "evt_01M0M9E89Q7GVB4RTA9MQZKB90": {
31
+ "bakedName": "CAL_SYNCED",
32
+ "curName": "CAL_SYNCED",
33
+ "id": "evt_01M0M9E89Q7GVB4RTA9MQZKB90",
34
+ "kind": "event",
35
+ "owner": "workspace",
36
+ "parent": "trt_01M0M9E89QMEF62295H7XTZDND",
37
+ "renames": []
38
+ },
39
+ "evt_01M0M9E89Q7PTP9ZRG3M5VD1SY": {
40
+ "bakedName": "SYNC_NOW",
41
+ "curName": "SYNC_NOW",
42
+ "id": "evt_01M0M9E89Q7PTP9ZRG3M5VD1SY",
43
+ "kind": "event",
44
+ "owner": "workspace",
45
+ "parent": "trt_01M0M9E89QMEF62295H7XTZDND",
46
+ "renames": []
47
+ },
48
+ "evt_01M0M9E89Q9N7X13XMTK58JYY9": {
49
+ "bakedName": "CAL_EVENT_CREATED",
50
+ "curName": "CAL_EVENT_CREATED",
51
+ "id": "evt_01M0M9E89Q9N7X13XMTK58JYY9",
52
+ "kind": "event",
53
+ "owner": "workspace",
54
+ "parent": "trt_01M0M9E89QMEF62295H7XTZDND",
55
+ "renames": []
56
+ },
57
+ "evt_01M0M9E89QBVVRWENZKAMT0H2B": {
58
+ "bakedName": "CAL_REMOTE_CHANGED",
59
+ "curName": "CAL_REMOTE_CHANGED",
60
+ "id": "evt_01M0M9E89QBVVRWENZKAMT0H2B",
61
+ "kind": "event",
62
+ "owner": "workspace",
63
+ "parent": "trt_01M0M9E89QMEF62295H7XTZDND",
64
+ "renames": []
65
+ },
66
+ "evt_01M0M9E89QMRE2B1QZPM8HPXS5": {
67
+ "bakedName": "CAL_SYNC_FAILED",
68
+ "curName": "CAL_SYNC_FAILED",
69
+ "id": "evt_01M0M9E89QMRE2B1QZPM8HPXS5",
70
+ "kind": "event",
71
+ "owner": "workspace",
72
+ "parent": "trt_01M0M9E89QMEF62295H7XTZDND",
73
+ "renames": []
74
+ },
75
+ "evt_01M0M9E89QR7NR9G2343SA8BPM": {
76
+ "bakedName": "PULL_STEPPED",
77
+ "curName": "PULL_STEPPED",
78
+ "id": "evt_01M0M9E89QR7NR9G2343SA8BPM",
79
+ "kind": "event",
80
+ "owner": "workspace",
81
+ "parent": "trt_01M0M9E89QMEF62295H7XTZDND",
82
+ "renames": []
83
+ },
84
+ "evt_01M0M9E89QRFQJNXPGD4C8XFP0": {
85
+ "bakedName": "PUSH_STEPPED",
86
+ "curName": "PUSH_STEPPED",
87
+ "id": "evt_01M0M9E89QRFQJNXPGD4C8XFP0",
88
+ "kind": "event",
89
+ "owner": "workspace",
90
+ "parent": "trt_01M0M9E89QMEF62295H7XTZDND",
91
+ "renames": []
92
+ },
93
+ "evt_01M0M9E89QV7Q7Z4KV2FHA4QZC": {
94
+ "bakedName": "PULL_NEXT",
95
+ "curName": "PULL_NEXT",
96
+ "id": "evt_01M0M9E89QV7Q7Z4KV2FHA4QZC",
97
+ "kind": "event",
98
+ "owner": "workspace",
99
+ "parent": "trt_01M0M9E89QMEF62295H7XTZDND",
100
+ "renames": []
101
+ },
102
+ "evt_01M0M9E89QVRM9F7VRMWJ8NT71": {
103
+ "bakedName": "PUSH_ROWS_LOADED",
104
+ "curName": "PUSH_ROWS_LOADED",
105
+ "id": "evt_01M0M9E89QVRM9F7VRMWJ8NT71",
106
+ "kind": "event",
107
+ "owner": "workspace",
108
+ "parent": "trt_01M0M9E89QMEF62295H7XTZDND",
109
+ "renames": []
110
+ },
111
+ "evt_01M0M9E89QYTZJDGBZVC1BVZDY": {
112
+ "bakedName": "INIT",
113
+ "curName": "INIT",
114
+ "id": "evt_01M0M9E89QYTZJDGBZVC1BVZDY",
115
+ "kind": "event",
116
+ "owner": "workspace",
117
+ "parent": "trt_01M0M9E89QMEF62295H7XTZDND",
118
+ "renames": []
119
+ },
120
+ "evt_01M0M9E89QZS3J82D8V4N7GNTX": {
121
+ "bakedName": "PULL_TARGET_LOADED",
122
+ "curName": "PULL_TARGET_LOADED",
123
+ "id": "evt_01M0M9E89QZS3J82D8V4N7GNTX",
124
+ "kind": "event",
125
+ "owner": "workspace",
126
+ "parent": "trt_01M0M9E89QMEF62295H7XTZDND",
127
+ "renames": []
128
+ },
129
+ "orb_01M0M9E89QS0N7F1YWY99SQVH1": {
130
+ "bakedName": "CalendarSyncOrbital",
131
+ "curName": "CalendarSyncOrbital",
132
+ "id": "orb_01M0M9E89QS0N7F1YWY99SQVH1",
133
+ "kind": "orbital",
134
+ "owner": "workspace",
135
+ "renames": []
136
+ },
137
+ "pag_01M0M9E89Q5PSV0NJ8P9N6X0JZ": {
138
+ "bakedName": "CalendarSyncPage",
139
+ "curName": "CalendarSyncPage",
140
+ "id": "pag_01M0M9E89Q5PSV0NJ8P9N6X0JZ",
141
+ "kind": "page",
142
+ "owner": "workspace",
143
+ "renames": []
144
+ },
145
+ "trt_01M0M9E89QMEF62295H7XTZDND": {
146
+ "bakedName": "CalendarSync",
147
+ "curName": "CalendarSync",
148
+ "id": "trt_01M0M9E89QMEF62295H7XTZDND",
149
+ "kind": "trait",
150
+ "owner": "workspace",
151
+ "renames": []
152
+ }
153
+ },
154
+ "schemaVersion": 1
155
+ },
156
+ "name": "std-calendar-sync",
157
+ "orbitals": [
158
+ {
159
+ "auxiliaryEntities": [
160
+ {
161
+ "collection": "calendarEvents",
162
+ "fields": [
163
+ {
164
+ "name": "id",
165
+ "required": true,
166
+ "type": "string"
167
+ },
168
+ {
169
+ "default": "",
170
+ "description": "Event title/summary.",
171
+ "name": "title",
172
+ "synonyms": "summary, name, subject",
173
+ "type": "string"
174
+ },
175
+ {
176
+ "default": "",
177
+ "description": "ISO start (dateTime, or YYYY-MM-DD for all-day).",
178
+ "name": "startsAt",
179
+ "synonyms": "start, begins, from",
180
+ "type": "string"
181
+ },
182
+ {
183
+ "default": "",
184
+ "description": "ISO end (dateTime, or YYYY-MM-DD for all-day).",
185
+ "name": "endsAt",
186
+ "synonyms": "end, finishes, until",
187
+ "type": "string"
188
+ },
189
+ {
190
+ "default": "",
191
+ "description": "Event location.",
192
+ "name": "location",
193
+ "synonyms": "place, where, venue",
194
+ "type": "string"
195
+ },
196
+ {
197
+ "default": "",
198
+ "description": "Event description/notes.",
199
+ "name": "description",
200
+ "synonyms": "notes, details, body",
201
+ "type": "string"
202
+ },
203
+ {
204
+ "default": "",
205
+ "description": "Remote status (confirmed/tentative/cancelled).",
206
+ "name": "status",
207
+ "synonyms": "state, confirmation",
208
+ "type": "string"
209
+ },
210
+ {
211
+ "default": "",
212
+ "description": "Google Calendar event id this row mirrors; the pull-upsert match key.",
213
+ "name": "externalEventId",
214
+ "synonyms": "remote id, google id, calendar event id",
215
+ "type": "string"
216
+ },
217
+ {
218
+ "default": 0.0,
219
+ "description": "When this row last synced with the remote calendar; 0 = never.",
220
+ "name": "syncedAt",
221
+ "synonyms": "last sync, synced",
222
+ "type": "number"
223
+ }
224
+ ],
225
+ "id": "ent_01M0M9E89Q1H8VNNH0J06PH7RH",
226
+ "name": "CalendarEvent",
227
+ "persistence": "persistent"
228
+ }
229
+ ],
230
+ "entity": {
231
+ "collection": "calendarSyncState",
232
+ "fields": [
233
+ {
234
+ "name": "id",
235
+ "required": true,
236
+ "type": "string"
237
+ },
238
+ {
239
+ "default": "",
240
+ "description": "Scratch: Google incremental-sync token from the last listEvents; in-memory per instance — a restart falls back to a full list.",
241
+ "name": "syncToken",
242
+ "synonyms": "sync cursor, next token",
243
+ "type": "string"
244
+ },
245
+ {
246
+ "default": 0.0,
247
+ "description": "When the last full push+pull cycle completed; 0 = never.",
248
+ "name": "lastSyncedAt",
249
+ "synonyms": "last sync time",
250
+ "type": "number"
251
+ },
252
+ {
253
+ "default": "",
254
+ "description": "Scratch: id of the target row the push loop is currently exporting.",
255
+ "name": "headId",
256
+ "synonyms": "cursor, current row",
257
+ "type": "string"
258
+ },
259
+ {
260
+ "default": [],
261
+ "description": "Scratch: remote events remaining in the current pull-upsert loop.",
262
+ "items": {
263
+ "properties": {
264
+ "description": {
265
+ "name": "description",
266
+ "required": false,
267
+ "type": "string"
268
+ },
269
+ "end": {
270
+ "name": "end",
271
+ "required": false,
272
+ "type": "string"
273
+ },
274
+ "id": {
275
+ "name": "id",
276
+ "required": false,
277
+ "type": "string"
278
+ },
279
+ "location": {
280
+ "name": "location",
281
+ "required": false,
282
+ "type": "string"
283
+ },
284
+ "start": {
285
+ "name": "start",
286
+ "required": false,
287
+ "type": "string"
288
+ },
289
+ "status": {
290
+ "name": "status",
291
+ "required": false,
292
+ "type": "string"
293
+ },
294
+ "summary": {
295
+ "name": "summary",
296
+ "required": false,
297
+ "type": "string"
298
+ },
299
+ "updated": {
300
+ "name": "updated",
301
+ "required": false,
302
+ "type": "string"
303
+ }
304
+ },
305
+ "type": "object"
306
+ },
307
+ "name": "pending",
308
+ "synonyms": "pull queue, remaining events",
309
+ "type": "array"
310
+ },
311
+ {
312
+ "default": "",
313
+ "description": "Last sync failure detail; blank = none.",
314
+ "name": "lastError",
315
+ "synonyms": "sync error, failure",
316
+ "type": "string"
317
+ }
318
+ ],
319
+ "id": "ent_01M0MAF1B71AH9M3J5ZYKAXFM3",
320
+ "name": "CalendarSyncRun",
321
+ "persistence": "persistent"
322
+ },
323
+ "id": "orb_01M0M9E89QS0N7F1YWY99SQVH1",
324
+ "name": "CalendarSyncOrbital",
325
+ "pages": [
326
+ {
327
+ "id": "pag_01M0M9E89Q5PSV0NJ8P9N6X0JZ",
328
+ "name": "CalendarSyncPage",
329
+ "path": "/calendar-sync",
330
+ "traits": [
331
+ {
332
+ "ref": "CalendarSync",
333
+ "refId": "trt_01M0M9E89QMEF62295H7XTZDND"
334
+ }
335
+ ]
336
+ }
337
+ ],
338
+ "traits": [
339
+ {
340
+ "category": "lifecycle",
341
+ "config": {
342
+ "calendarId": {
343
+ "default": "",
344
+ "description": "Google calendar to sync with; blank = the service's default (GOOGLE_CALENDAR_ID env, else primary).",
345
+ "label": "Calendar id",
346
+ "synonyms": "google calendar id, target calendar",
347
+ "tier": "infra",
348
+ "type": "string"
349
+ },
350
+ "descriptionField": {
351
+ "default": "",
352
+ "description": "Target-entity field holding the description/notes; blank = none.",
353
+ "label": "Description field",
354
+ "synonyms": "notes field, details field",
355
+ "tier": "internal",
356
+ "type": "string"
357
+ },
358
+ "durationField": {
359
+ "default": "",
360
+ "description": "Target-entity field holding the per-row duration in minutes (e.g. ClassSession.durationMinutes). Takes precedence over the fixed `durationMinutes` when set; ignored when `endField` is set. Field precedence: endField > durationField > durationMinutes — the corpus carries all these event shapes.",
361
+ "label": "Duration field",
362
+ "synonyms": "minutes field, length field, per-row duration",
363
+ "tier": "internal",
364
+ "type": "string"
365
+ },
366
+ "durationMinutes": {
367
+ "default": 60.0,
368
+ "description": "Fixed event length used when both `endField` and `durationField` are blank; the calendar service computes the timezone-correct end.",
369
+ "label": "Duration (minutes)",
370
+ "synonyms": "length, event duration, minutes",
371
+ "tier": "internal",
372
+ "type": "number"
373
+ },
374
+ "enabled": {
375
+ "default": false,
376
+ "description": "Push local records to Google Calendar and pull remote events into the CalendarEvent store. Off by default; needs the calendar service credentials (GOOGLE_CALENDAR_SA_KEY).",
377
+ "label": "Sync with Google Calendar",
378
+ "synonyms": "enable, calendar sync, google calendar, two-way sync, sync events, connect calendar",
379
+ "tier": "infra",
380
+ "type": "boolean"
381
+ },
382
+ "endField": {
383
+ "default": "endsAt",
384
+ "description": "Target-entity field holding the ISO end. Blank = derive the end from `durationMinutes` instead (the corpus carries all four event shapes).",
385
+ "label": "End field",
386
+ "synonyms": "end date field, finishes field",
387
+ "tier": "internal",
388
+ "type": "string"
389
+ },
390
+ "locationField": {
391
+ "default": "",
392
+ "description": "Target-entity field holding the location; blank = none.",
393
+ "label": "Location field",
394
+ "synonyms": "place field, venue field",
395
+ "tier": "internal",
396
+ "type": "string"
397
+ },
398
+ "startField": {
399
+ "default": "startsAt",
400
+ "description": "Target-entity field holding the ISO start (dateTime, or YYYY-MM-DD for all-day).",
401
+ "label": "Start field",
402
+ "synonyms": "start date field, begins field, scheduledAt field",
403
+ "tier": "internal",
404
+ "type": "string"
405
+ },
406
+ "targetEntity": {
407
+ "default": "CalendarEvent",
408
+ "description": "Event-shaped entity whose rows export to Google Calendar. MUST declare the marker columns `externalEventId : string = \"\"` and `syncedAt : number = 0` (stamped by the push loop). Defaults to the atom's own CalendarEvent store so the standalone validates; rebind per composition.",
409
+ "label": "Entity to push",
410
+ "refId": "ent_01M0M9E89Q1H8VNNH0J06PH7RH",
411
+ "synonyms": "entity to sync, source entity, record type, appointments entity, sessions entity",
412
+ "tier": "internal",
413
+ "type": "entity"
414
+ },
415
+ "titleField": {
416
+ "default": "title",
417
+ "description": "Target-entity field holding the event title.",
418
+ "label": "Title field",
419
+ "synonyms": "summary field, name field",
420
+ "tier": "internal",
421
+ "type": "string"
422
+ }
423
+ },
424
+ "emits": [
425
+ {
426
+ "description": "A full push+pull cycle completed; wire to std-notify-on-event or a status surface.",
427
+ "event": "CAL_SYNCED",
428
+ "eventId": "evt_01M0M9E89Q7GVB4RTA9MQZKB90",
429
+ "payloadSchema": [
430
+ {
431
+ "name": "syncedAt",
432
+ "type": "number"
433
+ }
434
+ ],
435
+ "scope": "external"
436
+ },
437
+ {
438
+ "description": "A calendar service call / fetch / persist failed — lastError carries the detail and the cycle stops until the next trigger.",
439
+ "event": "CAL_SYNC_FAILED",
440
+ "eventId": "evt_01M0M9E89QMRE2B1QZPM8HPXS5",
441
+ "payloadSchema": [
442
+ {
443
+ "name": "error",
444
+ "required": true,
445
+ "type": "string"
446
+ }
447
+ ],
448
+ "tier": "secondary"
449
+ },
450
+ {
451
+ "description": "Target rows with a blank externalEventId marker — the remaining local→remote export queue.",
452
+ "event": "PUSH_ROWS_LOADED",
453
+ "eventId": "evt_01M0M9E89QVRM9F7VRMWJ8NT71",
454
+ "payloadSchema": [
455
+ {
456
+ "name": "data",
457
+ "type": "[TargetRow]"
458
+ }
459
+ ],
460
+ "tier": "secondary"
461
+ },
462
+ {
463
+ "description": "calendar.createEvent result, flattened onto the payload by the call-service effect executor.",
464
+ "event": "CAL_EVENT_CREATED",
465
+ "eventId": "evt_01M0M9E89Q9N7X13XMTK58JYY9",
466
+ "payloadSchema": [
467
+ {
468
+ "name": "id",
469
+ "required": true,
470
+ "type": "string"
471
+ },
472
+ {
473
+ "name": "status",
474
+ "required": true,
475
+ "type": "string"
476
+ },
477
+ {
478
+ "name": "htmlLink",
479
+ "required": true,
480
+ "type": "string"
481
+ }
482
+ ],
483
+ "tier": "secondary"
484
+ },
485
+ {
486
+ "description": "Target row stamped with its new externalEventId; drives the next push pass.",
487
+ "event": "PUSH_STEPPED",
488
+ "eventId": "evt_01M0M9E89QRFQJNXPGD4C8XFP0",
489
+ "payloadSchema": [
490
+ {
491
+ "name": "id",
492
+ "required": true,
493
+ "type": "string"
494
+ }
495
+ ],
496
+ "tier": "secondary"
497
+ },
498
+ {
499
+ "description": "calendar.listEvents result — the remote change set for the pull-upsert loop.",
500
+ "event": "CAL_REMOTE_LISTED",
501
+ "eventId": "evt_01M0M9E89Q006H33RM6WGB8QRJ",
502
+ "payloadSchema": [
503
+ {
504
+ "name": "events",
505
+ "type": "[RemoteEvent]"
506
+ },
507
+ {
508
+ "name": "nextSyncToken",
509
+ "type": "string"
510
+ }
511
+ ],
512
+ "tier": "secondary"
513
+ },
514
+ {
515
+ "description": "CalendarEvent rows loaded for externalEventId matching in the pull-upsert.",
516
+ "event": "PULL_TARGET_LOADED",
517
+ "eventId": "evt_01M0M9E89QZS3J82D8V4N7GNTX",
518
+ "payloadSchema": [
519
+ {
520
+ "name": "data",
521
+ "type": "[TargetRow]"
522
+ }
523
+ ],
524
+ "tier": "secondary"
525
+ },
526
+ {
527
+ "description": "One remote event upserted into the CalendarEvent store; drives the next pull pass.",
528
+ "event": "PULL_STEPPED",
529
+ "eventId": "evt_01M0M9E89QR7NR9G2343SA8BPM",
530
+ "payloadSchema": [
531
+ {
532
+ "name": "id",
533
+ "required": true,
534
+ "type": "string"
535
+ }
536
+ ],
537
+ "tier": "secondary"
538
+ },
539
+ {
540
+ "description": "Pull loop control: how many remote events remain in the queue.",
541
+ "event": "PULL_NEXT",
542
+ "eventId": "evt_01M0M9E89QV7Q7Z4KV2FHA4QZC",
543
+ "payloadSchema": [
544
+ {
545
+ "name": "remaining",
546
+ "type": "number"
547
+ }
548
+ ],
549
+ "tier": "secondary"
550
+ }
551
+ ],
552
+ "entityRefIds": {
553
+ "CalendarEvent": "ent_01M0M9E89Q1H8VNNH0J06PH7RH",
554
+ "CalendarSyncRun": "ent_01M0MAF1B71AH9M3J5ZYKAXFM3"
555
+ },
556
+ "id": "trt_01M0M9E89QMEF62295H7XTZDND",
557
+ "linkedEntity": "CalendarSyncRun",
558
+ "linkedEntityId": "ent_01M0MAF1B71AH9M3J5ZYKAXFM3",
559
+ "name": "CalendarSync",
560
+ "scope": "instance",
561
+ "stateMachine": {
562
+ "events": [
563
+ {
564
+ "id": "evt_01M0M9E89QYTZJDGBZVC1BVZDY",
565
+ "key": "INIT",
566
+ "name": "Initialize"
567
+ },
568
+ {
569
+ "id": "evt_01M0M9E89Q7PTP9ZRG3M5VD1SY",
570
+ "key": "SYNC_NOW",
571
+ "name": "Sync Now"
572
+ },
573
+ {
574
+ "id": "evt_01M0M9E89QBVVRWENZKAMT0H2B",
575
+ "key": "CAL_REMOTE_CHANGED",
576
+ "name": "Cal Remote Changed",
577
+ "payloadSchema": [
578
+ {
579
+ "name": "channelId",
580
+ "type": "string"
581
+ },
582
+ {
583
+ "name": "resourceId",
584
+ "type": "string"
585
+ },
586
+ {
587
+ "name": "resourceState",
588
+ "type": "string"
589
+ }
590
+ ]
591
+ },
592
+ {
593
+ "description": "Target rows with a blank externalEventId marker — the remaining local→remote export queue.",
594
+ "id": "evt_01M0M9E89QVRM9F7VRMWJ8NT71",
595
+ "key": "PUSH_ROWS_LOADED",
596
+ "name": "Push Rows Loaded",
597
+ "payloadSchema": [
598
+ {
599
+ "name": "data",
600
+ "properties": [
601
+ {
602
+ "name": "id",
603
+ "type": "string"
604
+ },
605
+ {
606
+ "name": "externalEventId",
607
+ "type": "string"
608
+ }
609
+ ],
610
+ "type": "[object]"
611
+ }
612
+ ],
613
+ "tier": "secondary"
614
+ },
615
+ {
616
+ "description": "calendar.listEvents result — the remote change set for the pull-upsert loop.",
617
+ "id": "evt_01M0M9E89Q006H33RM6WGB8QRJ",
618
+ "key": "CAL_REMOTE_LISTED",
619
+ "name": "Cal Remote Listed",
620
+ "payloadSchema": [
621
+ {
622
+ "name": "events",
623
+ "properties": [
624
+ {
625
+ "name": "id",
626
+ "type": "string"
627
+ },
628
+ {
629
+ "name": "summary",
630
+ "type": "string"
631
+ },
632
+ {
633
+ "name": "description",
634
+ "type": "string"
635
+ },
636
+ {
637
+ "name": "location",
638
+ "type": "string"
639
+ },
640
+ {
641
+ "name": "start",
642
+ "type": "string"
643
+ },
644
+ {
645
+ "name": "end",
646
+ "type": "string"
647
+ },
648
+ {
649
+ "name": "status",
650
+ "type": "string"
651
+ },
652
+ {
653
+ "name": "updated",
654
+ "type": "string"
655
+ }
656
+ ],
657
+ "type": "[object]"
658
+ },
659
+ {
660
+ "name": "nextSyncToken",
661
+ "type": "string"
662
+ }
663
+ ],
664
+ "tier": "secondary"
665
+ },
666
+ {
667
+ "description": "A calendar service call / fetch / persist failed — lastError carries the detail and the cycle stops until the next trigger.",
668
+ "id": "evt_01M0M9E89QMRE2B1QZPM8HPXS5",
669
+ "key": "CAL_SYNC_FAILED",
670
+ "name": "Cal Sync Failed",
671
+ "payloadSchema": [
672
+ {
673
+ "name": "error",
674
+ "required": true,
675
+ "type": "string"
676
+ }
677
+ ],
678
+ "tier": "secondary"
679
+ },
680
+ {
681
+ "description": "calendar.createEvent result, flattened onto the payload by the call-service effect executor.",
682
+ "id": "evt_01M0M9E89Q9N7X13XMTK58JYY9",
683
+ "key": "CAL_EVENT_CREATED",
684
+ "name": "Cal Event Created",
685
+ "payloadSchema": [
686
+ {
687
+ "name": "id",
688
+ "required": true,
689
+ "type": "string"
690
+ },
691
+ {
692
+ "name": "status",
693
+ "required": true,
694
+ "type": "string"
695
+ },
696
+ {
697
+ "name": "htmlLink",
698
+ "required": true,
699
+ "type": "string"
700
+ }
701
+ ],
702
+ "tier": "secondary"
703
+ },
704
+ {
705
+ "description": "Target row stamped with its new externalEventId; drives the next push pass.",
706
+ "id": "evt_01M0M9E89QRFQJNXPGD4C8XFP0",
707
+ "key": "PUSH_STEPPED",
708
+ "name": "Push Stepped",
709
+ "payloadSchema": [
710
+ {
711
+ "name": "id",
712
+ "required": true,
713
+ "type": "string"
714
+ }
715
+ ],
716
+ "tier": "secondary"
717
+ },
718
+ {
719
+ "description": "CalendarEvent rows loaded for externalEventId matching in the pull-upsert.",
720
+ "id": "evt_01M0M9E89QZS3J82D8V4N7GNTX",
721
+ "key": "PULL_TARGET_LOADED",
722
+ "name": "Pull Target Loaded",
723
+ "payloadSchema": [
724
+ {
725
+ "name": "data",
726
+ "properties": [
727
+ {
728
+ "name": "id",
729
+ "type": "string"
730
+ },
731
+ {
732
+ "name": "externalEventId",
733
+ "type": "string"
734
+ }
735
+ ],
736
+ "type": "[object]"
737
+ }
738
+ ],
739
+ "tier": "secondary"
740
+ },
741
+ {
742
+ "description": "One remote event upserted into the CalendarEvent store; drives the next pull pass.",
743
+ "id": "evt_01M0M9E89QR7NR9G2343SA8BPM",
744
+ "key": "PULL_STEPPED",
745
+ "name": "Pull Stepped",
746
+ "payloadSchema": [
747
+ {
748
+ "name": "id",
749
+ "required": true,
750
+ "type": "string"
751
+ }
752
+ ],
753
+ "tier": "secondary"
754
+ },
755
+ {
756
+ "description": "Pull loop control: how many remote events remain in the queue.",
757
+ "id": "evt_01M0M9E89QV7Q7Z4KV2FHA4QZC",
758
+ "key": "PULL_NEXT",
759
+ "name": "Pull Next",
760
+ "payloadSchema": [
761
+ {
762
+ "name": "remaining",
763
+ "type": "number"
764
+ }
765
+ ],
766
+ "tier": "secondary"
767
+ },
768
+ {
769
+ "description": "A full push+pull cycle completed; wire to std-notify-on-event or a status surface.",
770
+ "id": "evt_01M0M9E89Q7GVB4RTA9MQZKB90",
771
+ "key": "CAL_SYNCED",
772
+ "name": "Cal Synced",
773
+ "payloadSchema": [
774
+ {
775
+ "name": "syncedAt",
776
+ "type": "number"
777
+ }
778
+ ]
779
+ }
780
+ ],
781
+ "states": [
782
+ {
783
+ "isInitial": true,
784
+ "name": "idle"
785
+ },
786
+ {
787
+ "name": "pushing"
788
+ },
789
+ {
790
+ "name": "pulling"
791
+ }
792
+ ],
793
+ "transitions": [
794
+ {
795
+ "event": "INIT",
796
+ "eventId": "evt_01M0M9E89QYTZJDGBZVC1BVZDY",
797
+ "from": "idle",
798
+ "to": "idle"
799
+ },
800
+ {
801
+ "effects": [
802
+ [
803
+ "fetch",
804
+ "@config.targetEntity",
805
+ {
806
+ "emit": {
807
+ "failure": "CAL_SYNC_FAILED",
808
+ "success": "PUSH_ROWS_LOADED"
809
+ },
810
+ "filter": [
811
+ "=",
812
+ [
813
+ "object/get",
814
+ "@entity",
815
+ "externalEventId"
816
+ ],
817
+ ""
818
+ ]
819
+ }
820
+ ]
821
+ ],
822
+ "event": "SYNC_NOW",
823
+ "eventId": "evt_01M0M9E89Q7PTP9ZRG3M5VD1SY",
824
+ "from": "idle",
825
+ "guard": "@config.enabled",
826
+ "to": "idle"
827
+ },
828
+ {
829
+ "effects": [
830
+ [
831
+ "call-service",
832
+ "calendar",
833
+ "listEvents",
834
+ {
835
+ "calendarId": "@config.calendarId",
836
+ "syncToken": "@entity.syncToken"
837
+ },
838
+ {
839
+ "emit": {
840
+ "failure": "CAL_SYNC_FAILED",
841
+ "success": "CAL_REMOTE_LISTED"
842
+ }
843
+ }
844
+ ]
845
+ ],
846
+ "event": "CAL_REMOTE_CHANGED",
847
+ "eventId": "evt_01M0M9E89QBVVRWENZKAMT0H2B",
848
+ "from": "idle",
849
+ "guard": "@config.enabled",
850
+ "to": "idle"
851
+ },
852
+ {
853
+ "effects": [
854
+ [
855
+ "set",
856
+ "@entity.headId",
857
+ [
858
+ "object/get",
859
+ [
860
+ "array/first",
861
+ "@payload.data"
862
+ ],
863
+ "id"
864
+ ]
865
+ ],
866
+ [
867
+ "call-service",
868
+ "calendar",
869
+ "createEvent",
870
+ {
871
+ "calendarId": "@config.calendarId",
872
+ "description": [
873
+ "if",
874
+ [
875
+ "=",
876
+ "@config.descriptionField",
877
+ ""
878
+ ],
879
+ "",
880
+ [
881
+ "object/get",
882
+ [
883
+ "array/first",
884
+ "@payload.data"
885
+ ],
886
+ "@config.descriptionField"
887
+ ]
888
+ ],
889
+ "durationMinutes": [
890
+ "if",
891
+ [
892
+ "=",
893
+ "@config.durationField",
894
+ ""
895
+ ],
896
+ "@config.durationMinutes",
897
+ [
898
+ "object/get",
899
+ [
900
+ "array/first",
901
+ "@payload.data"
902
+ ],
903
+ "@config.durationField"
904
+ ]
905
+ ],
906
+ "end": [
907
+ "if",
908
+ [
909
+ "=",
910
+ "@config.endField",
911
+ ""
912
+ ],
913
+ "",
914
+ [
915
+ "object/get",
916
+ [
917
+ "array/first",
918
+ "@payload.data"
919
+ ],
920
+ "@config.endField"
921
+ ]
922
+ ],
923
+ "location": [
924
+ "if",
925
+ [
926
+ "=",
927
+ "@config.locationField",
928
+ ""
929
+ ],
930
+ "",
931
+ [
932
+ "object/get",
933
+ [
934
+ "array/first",
935
+ "@payload.data"
936
+ ],
937
+ "@config.locationField"
938
+ ]
939
+ ],
940
+ "start": [
941
+ "object/get",
942
+ [
943
+ "array/first",
944
+ "@payload.data"
945
+ ],
946
+ "@config.startField"
947
+ ],
948
+ "summary": [
949
+ "object/get",
950
+ [
951
+ "array/first",
952
+ "@payload.data"
953
+ ],
954
+ "@config.titleField"
955
+ ]
956
+ },
957
+ {
958
+ "emit": {
959
+ "failure": "CAL_SYNC_FAILED",
960
+ "success": "CAL_EVENT_CREATED"
961
+ }
962
+ }
963
+ ]
964
+ ],
965
+ "event": "PUSH_ROWS_LOADED",
966
+ "eventId": "evt_01M0M9E89QVRM9F7VRMWJ8NT71",
967
+ "from": "idle",
968
+ "guard": [
969
+ "and",
970
+ "@config.enabled",
971
+ [
972
+ ">",
973
+ [
974
+ "array/len",
975
+ "@payload.data"
976
+ ],
977
+ 0.0
978
+ ]
979
+ ],
980
+ "to": "pushing"
981
+ },
982
+ {
983
+ "effects": [
984
+ [
985
+ "call-service",
986
+ "calendar",
987
+ "listEvents",
988
+ {
989
+ "calendarId": "@config.calendarId",
990
+ "syncToken": "@entity.syncToken"
991
+ },
992
+ {
993
+ "emit": {
994
+ "failure": "CAL_SYNC_FAILED",
995
+ "success": "CAL_REMOTE_LISTED"
996
+ }
997
+ }
998
+ ]
999
+ ],
1000
+ "event": "PUSH_ROWS_LOADED",
1001
+ "eventId": "evt_01M0M9E89QVRM9F7VRMWJ8NT71",
1002
+ "from": "idle",
1003
+ "guard": [
1004
+ "=",
1005
+ [
1006
+ "array/len",
1007
+ "@payload.data"
1008
+ ],
1009
+ 0.0
1010
+ ],
1011
+ "to": "idle"
1012
+ },
1013
+ {
1014
+ "effects": [
1015
+ [
1016
+ "set",
1017
+ "@entity.pending",
1018
+ "@payload.events"
1019
+ ],
1020
+ [
1021
+ "set",
1022
+ "@entity.syncToken",
1023
+ [
1024
+ "str/default",
1025
+ "@payload.nextSyncToken",
1026
+ ""
1027
+ ]
1028
+ ],
1029
+ [
1030
+ "fetch",
1031
+ "CalendarEvent",
1032
+ {
1033
+ "emit": {
1034
+ "failure": "CAL_SYNC_FAILED",
1035
+ "success": "PULL_TARGET_LOADED"
1036
+ }
1037
+ }
1038
+ ]
1039
+ ],
1040
+ "event": "CAL_REMOTE_LISTED",
1041
+ "eventId": "evt_01M0M9E89Q006H33RM6WGB8QRJ",
1042
+ "from": "idle",
1043
+ "guard": [
1044
+ ">",
1045
+ [
1046
+ "array/len",
1047
+ "@payload.events"
1048
+ ],
1049
+ 0.0
1050
+ ],
1051
+ "to": "pulling"
1052
+ },
1053
+ {
1054
+ "effects": [
1055
+ [
1056
+ "set",
1057
+ "@entity.syncToken",
1058
+ [
1059
+ "str/default",
1060
+ "@payload.nextSyncToken",
1061
+ ""
1062
+ ]
1063
+ ],
1064
+ [
1065
+ "set",
1066
+ "@entity.lastSyncedAt",
1067
+ "@now"
1068
+ ],
1069
+ [
1070
+ "emit",
1071
+ "CAL_SYNCED",
1072
+ {
1073
+ "syncedAt": "@entity.lastSyncedAt"
1074
+ }
1075
+ ]
1076
+ ],
1077
+ "event": "CAL_REMOTE_LISTED",
1078
+ "eventId": "evt_01M0M9E89Q006H33RM6WGB8QRJ",
1079
+ "from": "idle",
1080
+ "guard": [
1081
+ "=",
1082
+ [
1083
+ "array/len",
1084
+ "@payload.events"
1085
+ ],
1086
+ 0.0
1087
+ ],
1088
+ "to": "idle"
1089
+ },
1090
+ {
1091
+ "effects": [
1092
+ [
1093
+ "set",
1094
+ "@entity.lastError",
1095
+ "@payload.error"
1096
+ ]
1097
+ ],
1098
+ "event": "CAL_SYNC_FAILED",
1099
+ "eventId": "evt_01M0M9E89QMRE2B1QZPM8HPXS5",
1100
+ "from": "idle",
1101
+ "to": "idle"
1102
+ },
1103
+ {
1104
+ "effects": [
1105
+ [
1106
+ "persist",
1107
+ "update",
1108
+ "@config.targetEntity",
1109
+ {
1110
+ "externalEventId": "@payload.id",
1111
+ "id": "@entity.headId",
1112
+ "syncedAt": "@now"
1113
+ },
1114
+ {
1115
+ "emit": {
1116
+ "failure": "CAL_SYNC_FAILED",
1117
+ "success": "PUSH_STEPPED"
1118
+ }
1119
+ }
1120
+ ]
1121
+ ],
1122
+ "event": "CAL_EVENT_CREATED",
1123
+ "eventId": "evt_01M0M9E89Q9N7X13XMTK58JYY9",
1124
+ "from": "pushing",
1125
+ "to": "pushing"
1126
+ },
1127
+ {
1128
+ "effects": [
1129
+ [
1130
+ "fetch",
1131
+ "@config.targetEntity",
1132
+ {
1133
+ "emit": {
1134
+ "failure": "CAL_SYNC_FAILED",
1135
+ "success": "PUSH_ROWS_LOADED"
1136
+ },
1137
+ "filter": [
1138
+ "=",
1139
+ [
1140
+ "object/get",
1141
+ "@entity",
1142
+ "externalEventId"
1143
+ ],
1144
+ ""
1145
+ ]
1146
+ }
1147
+ ]
1148
+ ],
1149
+ "event": "PUSH_STEPPED",
1150
+ "eventId": "evt_01M0M9E89QRFQJNXPGD4C8XFP0",
1151
+ "from": "pushing",
1152
+ "to": "pushing"
1153
+ },
1154
+ {
1155
+ "effects": [
1156
+ [
1157
+ "set",
1158
+ "@entity.headId",
1159
+ [
1160
+ "object/get",
1161
+ [
1162
+ "array/first",
1163
+ "@payload.data"
1164
+ ],
1165
+ "id"
1166
+ ]
1167
+ ],
1168
+ [
1169
+ "call-service",
1170
+ "calendar",
1171
+ "createEvent",
1172
+ {
1173
+ "calendarId": "@config.calendarId",
1174
+ "description": [
1175
+ "if",
1176
+ [
1177
+ "=",
1178
+ "@config.descriptionField",
1179
+ ""
1180
+ ],
1181
+ "",
1182
+ [
1183
+ "object/get",
1184
+ [
1185
+ "array/first",
1186
+ "@payload.data"
1187
+ ],
1188
+ "@config.descriptionField"
1189
+ ]
1190
+ ],
1191
+ "durationMinutes": [
1192
+ "if",
1193
+ [
1194
+ "=",
1195
+ "@config.durationField",
1196
+ ""
1197
+ ],
1198
+ "@config.durationMinutes",
1199
+ [
1200
+ "object/get",
1201
+ [
1202
+ "array/first",
1203
+ "@payload.data"
1204
+ ],
1205
+ "@config.durationField"
1206
+ ]
1207
+ ],
1208
+ "end": [
1209
+ "if",
1210
+ [
1211
+ "=",
1212
+ "@config.endField",
1213
+ ""
1214
+ ],
1215
+ "",
1216
+ [
1217
+ "object/get",
1218
+ [
1219
+ "array/first",
1220
+ "@payload.data"
1221
+ ],
1222
+ "@config.endField"
1223
+ ]
1224
+ ],
1225
+ "location": [
1226
+ "if",
1227
+ [
1228
+ "=",
1229
+ "@config.locationField",
1230
+ ""
1231
+ ],
1232
+ "",
1233
+ [
1234
+ "object/get",
1235
+ [
1236
+ "array/first",
1237
+ "@payload.data"
1238
+ ],
1239
+ "@config.locationField"
1240
+ ]
1241
+ ],
1242
+ "start": [
1243
+ "object/get",
1244
+ [
1245
+ "array/first",
1246
+ "@payload.data"
1247
+ ],
1248
+ "@config.startField"
1249
+ ],
1250
+ "summary": [
1251
+ "object/get",
1252
+ [
1253
+ "array/first",
1254
+ "@payload.data"
1255
+ ],
1256
+ "@config.titleField"
1257
+ ]
1258
+ },
1259
+ {
1260
+ "emit": {
1261
+ "failure": "CAL_SYNC_FAILED",
1262
+ "success": "CAL_EVENT_CREATED"
1263
+ }
1264
+ }
1265
+ ]
1266
+ ],
1267
+ "event": "PUSH_ROWS_LOADED",
1268
+ "eventId": "evt_01M0M9E89QVRM9F7VRMWJ8NT71",
1269
+ "from": "pushing",
1270
+ "guard": [
1271
+ ">",
1272
+ [
1273
+ "array/len",
1274
+ "@payload.data"
1275
+ ],
1276
+ 0.0
1277
+ ],
1278
+ "to": "pushing"
1279
+ },
1280
+ {
1281
+ "effects": [
1282
+ [
1283
+ "call-service",
1284
+ "calendar",
1285
+ "listEvents",
1286
+ {
1287
+ "calendarId": "@config.calendarId",
1288
+ "syncToken": "@entity.syncToken"
1289
+ },
1290
+ {
1291
+ "emit": {
1292
+ "failure": "CAL_SYNC_FAILED",
1293
+ "success": "CAL_REMOTE_LISTED"
1294
+ }
1295
+ }
1296
+ ]
1297
+ ],
1298
+ "event": "PUSH_ROWS_LOADED",
1299
+ "eventId": "evt_01M0M9E89QVRM9F7VRMWJ8NT71",
1300
+ "from": "pushing",
1301
+ "guard": [
1302
+ "=",
1303
+ [
1304
+ "array/len",
1305
+ "@payload.data"
1306
+ ],
1307
+ 0.0
1308
+ ],
1309
+ "to": "idle"
1310
+ },
1311
+ {
1312
+ "effects": [
1313
+ [
1314
+ "set",
1315
+ "@entity.lastError",
1316
+ "@payload.error"
1317
+ ]
1318
+ ],
1319
+ "event": "CAL_SYNC_FAILED",
1320
+ "eventId": "evt_01M0M9E89QMRE2B1QZPM8HPXS5",
1321
+ "from": "pushing",
1322
+ "to": "idle"
1323
+ },
1324
+ {
1325
+ "effects": [
1326
+ [
1327
+ "set",
1328
+ "@entity.headId",
1329
+ [
1330
+ "object/get",
1331
+ [
1332
+ "array/first",
1333
+ "@entity.pending"
1334
+ ],
1335
+ "id"
1336
+ ]
1337
+ ],
1338
+ [
1339
+ "if",
1340
+ [
1341
+ "=",
1342
+ [
1343
+ "array/len",
1344
+ [
1345
+ "array/filter",
1346
+ "@payload.data",
1347
+ [
1348
+ "fn",
1349
+ "r",
1350
+ [
1351
+ "=",
1352
+ [
1353
+ "object/get",
1354
+ "@r",
1355
+ "externalEventId"
1356
+ ],
1357
+ "@entity.headId"
1358
+ ]
1359
+ ]
1360
+ ]
1361
+ ],
1362
+ 0.0
1363
+ ],
1364
+ [
1365
+ "persist",
1366
+ "create",
1367
+ "CalendarEvent",
1368
+ {
1369
+ "description": [
1370
+ "object/get",
1371
+ [
1372
+ "array/first",
1373
+ "@entity.pending"
1374
+ ],
1375
+ "description"
1376
+ ],
1377
+ "endsAt": [
1378
+ "object/get",
1379
+ [
1380
+ "array/first",
1381
+ "@entity.pending"
1382
+ ],
1383
+ "end"
1384
+ ],
1385
+ "externalEventId": "@entity.headId",
1386
+ "location": [
1387
+ "object/get",
1388
+ [
1389
+ "array/first",
1390
+ "@entity.pending"
1391
+ ],
1392
+ "location"
1393
+ ],
1394
+ "startsAt": [
1395
+ "object/get",
1396
+ [
1397
+ "array/first",
1398
+ "@entity.pending"
1399
+ ],
1400
+ "start"
1401
+ ],
1402
+ "status": [
1403
+ "object/get",
1404
+ [
1405
+ "array/first",
1406
+ "@entity.pending"
1407
+ ],
1408
+ "status"
1409
+ ],
1410
+ "syncedAt": "@now",
1411
+ "title": [
1412
+ "object/get",
1413
+ [
1414
+ "array/first",
1415
+ "@entity.pending"
1416
+ ],
1417
+ "summary"
1418
+ ]
1419
+ },
1420
+ {
1421
+ "emit": {
1422
+ "failure": "CAL_SYNC_FAILED",
1423
+ "success": "PULL_STEPPED"
1424
+ }
1425
+ }
1426
+ ],
1427
+ [
1428
+ "persist",
1429
+ "update",
1430
+ "CalendarEvent",
1431
+ {
1432
+ "description": [
1433
+ "object/get",
1434
+ [
1435
+ "array/first",
1436
+ "@entity.pending"
1437
+ ],
1438
+ "description"
1439
+ ],
1440
+ "endsAt": [
1441
+ "object/get",
1442
+ [
1443
+ "array/first",
1444
+ "@entity.pending"
1445
+ ],
1446
+ "end"
1447
+ ],
1448
+ "id": [
1449
+ "object/get",
1450
+ [
1451
+ "array/first",
1452
+ [
1453
+ "array/filter",
1454
+ "@payload.data",
1455
+ [
1456
+ "fn",
1457
+ "r",
1458
+ [
1459
+ "=",
1460
+ [
1461
+ "object/get",
1462
+ "@r",
1463
+ "externalEventId"
1464
+ ],
1465
+ "@entity.headId"
1466
+ ]
1467
+ ]
1468
+ ]
1469
+ ],
1470
+ "id"
1471
+ ],
1472
+ "location": [
1473
+ "object/get",
1474
+ [
1475
+ "array/first",
1476
+ "@entity.pending"
1477
+ ],
1478
+ "location"
1479
+ ],
1480
+ "startsAt": [
1481
+ "object/get",
1482
+ [
1483
+ "array/first",
1484
+ "@entity.pending"
1485
+ ],
1486
+ "start"
1487
+ ],
1488
+ "status": [
1489
+ "object/get",
1490
+ [
1491
+ "array/first",
1492
+ "@entity.pending"
1493
+ ],
1494
+ "status"
1495
+ ],
1496
+ "syncedAt": "@now",
1497
+ "title": [
1498
+ "object/get",
1499
+ [
1500
+ "array/first",
1501
+ "@entity.pending"
1502
+ ],
1503
+ "summary"
1504
+ ]
1505
+ },
1506
+ {
1507
+ "emit": {
1508
+ "failure": "CAL_SYNC_FAILED",
1509
+ "success": "PULL_STEPPED"
1510
+ }
1511
+ }
1512
+ ]
1513
+ ]
1514
+ ],
1515
+ "event": "PULL_TARGET_LOADED",
1516
+ "eventId": "evt_01M0M9E89QZS3J82D8V4N7GNTX",
1517
+ "from": "pulling",
1518
+ "to": "pulling"
1519
+ },
1520
+ {
1521
+ "effects": [
1522
+ [
1523
+ "set",
1524
+ "@entity.pending",
1525
+ [
1526
+ "array/drop",
1527
+ "@entity.pending",
1528
+ 1.0
1529
+ ]
1530
+ ],
1531
+ [
1532
+ "emit",
1533
+ "PULL_NEXT",
1534
+ {
1535
+ "remaining": [
1536
+ "array/len",
1537
+ "@entity.pending"
1538
+ ]
1539
+ }
1540
+ ]
1541
+ ],
1542
+ "event": "PULL_STEPPED",
1543
+ "eventId": "evt_01M0M9E89QR7NR9G2343SA8BPM",
1544
+ "from": "pulling",
1545
+ "to": "pulling"
1546
+ },
1547
+ {
1548
+ "effects": [
1549
+ [
1550
+ "fetch",
1551
+ "CalendarEvent",
1552
+ {
1553
+ "emit": {
1554
+ "failure": "CAL_SYNC_FAILED",
1555
+ "success": "PULL_TARGET_LOADED"
1556
+ }
1557
+ }
1558
+ ]
1559
+ ],
1560
+ "event": "PULL_NEXT",
1561
+ "eventId": "evt_01M0M9E89QV7Q7Z4KV2FHA4QZC",
1562
+ "from": "pulling",
1563
+ "guard": [
1564
+ ">",
1565
+ "@payload.remaining",
1566
+ 0.0
1567
+ ],
1568
+ "to": "pulling"
1569
+ },
1570
+ {
1571
+ "effects": [
1572
+ [
1573
+ "set",
1574
+ "@entity.lastSyncedAt",
1575
+ "@now"
1576
+ ],
1577
+ [
1578
+ "emit",
1579
+ "CAL_SYNCED",
1580
+ {
1581
+ "syncedAt": "@entity.lastSyncedAt"
1582
+ }
1583
+ ]
1584
+ ],
1585
+ "event": "PULL_NEXT",
1586
+ "eventId": "evt_01M0M9E89QV7Q7Z4KV2FHA4QZC",
1587
+ "from": "pulling",
1588
+ "guard": [
1589
+ "=",
1590
+ "@payload.remaining",
1591
+ 0.0
1592
+ ],
1593
+ "to": "idle"
1594
+ },
1595
+ {
1596
+ "effects": [
1597
+ [
1598
+ "set",
1599
+ "@entity.lastError",
1600
+ "@payload.error"
1601
+ ]
1602
+ ],
1603
+ "event": "CAL_SYNC_FAILED",
1604
+ "eventId": "evt_01M0M9E89QMRE2B1QZPM8HPXS5",
1605
+ "from": "pulling",
1606
+ "to": "idle"
1607
+ }
1608
+ ]
1609
+ },
1610
+ "ticks": [
1611
+ {
1612
+ "effects": [
1613
+ [
1614
+ "fetch",
1615
+ "@config.targetEntity",
1616
+ {
1617
+ "emit": {
1618
+ "failure": "CAL_SYNC_FAILED",
1619
+ "success": "PUSH_ROWS_LOADED"
1620
+ },
1621
+ "filter": [
1622
+ "=",
1623
+ [
1624
+ "object/get",
1625
+ "@entity",
1626
+ "externalEventId"
1627
+ ],
1628
+ ""
1629
+ ]
1630
+ }
1631
+ ]
1632
+ ],
1633
+ "interval": "*/15 * * * *",
1634
+ "name": "syncCycle"
1635
+ }
1636
+ ]
1637
+ }
1638
+ ]
1639
+ }
1640
+ ],
1641
+ "schemaVersion": 1,
1642
+ "version": "1.0.0"
1643
+ }