@almadar/std 2.1.0 → 2.4.1

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 (86) hide show
  1. package/dist/behaviors/async.d.ts +12 -7
  2. package/dist/behaviors/async.js +1085 -312
  3. package/dist/behaviors/async.js.map +1 -1
  4. package/dist/behaviors/data-management.d.ts +27 -13
  5. package/dist/behaviors/data-management.js +600 -244
  6. package/dist/behaviors/data-management.js.map +1 -1
  7. package/dist/behaviors/domain/commerce.d.ts +51 -0
  8. package/dist/behaviors/domain/commerce.js +1093 -0
  9. package/dist/behaviors/domain/commerce.js.map +1 -0
  10. package/dist/behaviors/domain/content.d.ts +51 -0
  11. package/dist/behaviors/domain/content.js +1294 -0
  12. package/dist/behaviors/domain/content.js.map +1 -0
  13. package/dist/behaviors/domain/dashboard.d.ts +45 -0
  14. package/dist/behaviors/domain/dashboard.js +783 -0
  15. package/dist/behaviors/domain/dashboard.js.map +1 -0
  16. package/dist/behaviors/domain/education.d.ts +41 -0
  17. package/dist/behaviors/domain/education.js +738 -0
  18. package/dist/behaviors/domain/education.js.map +1 -0
  19. package/dist/behaviors/domain/finance.d.ts +49 -0
  20. package/dist/behaviors/domain/finance.js +660 -0
  21. package/dist/behaviors/domain/finance.js.map +1 -0
  22. package/dist/behaviors/domain/game-2d-platformer.d.ts +50 -0
  23. package/dist/behaviors/domain/game-2d-platformer.js +810 -0
  24. package/dist/behaviors/domain/game-2d-platformer.js.map +1 -0
  25. package/dist/behaviors/domain/game-2d-puzzle.d.ts +42 -0
  26. package/dist/behaviors/domain/game-2d-puzzle.js +622 -0
  27. package/dist/behaviors/domain/game-2d-puzzle.js.map +1 -0
  28. package/dist/behaviors/domain/game-2d-rpg.d.ts +48 -0
  29. package/dist/behaviors/domain/game-2d-rpg.js +860 -0
  30. package/dist/behaviors/domain/game-2d-rpg.js.map +1 -0
  31. package/dist/behaviors/domain/game-2d-strategy.d.ts +48 -0
  32. package/dist/behaviors/domain/game-2d-strategy.js +692 -0
  33. package/dist/behaviors/domain/game-2d-strategy.js.map +1 -0
  34. package/dist/behaviors/domain/geospatial.d.ts +35 -0
  35. package/dist/behaviors/domain/geospatial.js +634 -0
  36. package/dist/behaviors/domain/geospatial.js.map +1 -0
  37. package/dist/behaviors/domain/healthcare.d.ts +36 -0
  38. package/dist/behaviors/domain/healthcare.js +1068 -0
  39. package/dist/behaviors/domain/healthcare.js.map +1 -0
  40. package/dist/behaviors/domain/iot.d.ts +45 -0
  41. package/dist/behaviors/domain/iot.js +589 -0
  42. package/dist/behaviors/domain/iot.js.map +1 -0
  43. package/dist/behaviors/domain/media.d.ts +41 -0
  44. package/dist/behaviors/domain/media.js +771 -0
  45. package/dist/behaviors/domain/media.js.map +1 -0
  46. package/dist/behaviors/domain/scheduling.d.ts +41 -0
  47. package/dist/behaviors/domain/scheduling.js +930 -0
  48. package/dist/behaviors/domain/scheduling.js.map +1 -0
  49. package/dist/behaviors/domain/simulation.d.ts +36 -0
  50. package/dist/behaviors/domain/simulation.js +706 -0
  51. package/dist/behaviors/domain/simulation.js.map +1 -0
  52. package/dist/behaviors/domain/social.d.ts +41 -0
  53. package/dist/behaviors/domain/social.js +840 -0
  54. package/dist/behaviors/domain/social.js.map +1 -0
  55. package/dist/behaviors/domain/workflow.d.ts +41 -0
  56. package/dist/behaviors/domain/workflow.js +879 -0
  57. package/dist/behaviors/domain/workflow.js.map +1 -0
  58. package/dist/behaviors/feedback.d.ts +10 -5
  59. package/dist/behaviors/feedback.js +279 -194
  60. package/dist/behaviors/feedback.js.map +1 -1
  61. package/dist/behaviors/game-core.d.ts +15 -8
  62. package/dist/behaviors/game-core.js +412 -80
  63. package/dist/behaviors/game-core.js.map +1 -1
  64. package/dist/behaviors/game-entity.d.ts +17 -10
  65. package/dist/behaviors/game-entity.js +544 -237
  66. package/dist/behaviors/game-entity.js.map +1 -1
  67. package/dist/behaviors/game-ui.d.ts +16 -8
  68. package/dist/behaviors/game-ui.js +451 -316
  69. package/dist/behaviors/game-ui.js.map +1 -1
  70. package/dist/behaviors/index.d.ts +18 -1
  71. package/dist/behaviors/index.js +18905 -2140
  72. package/dist/behaviors/index.js.map +1 -1
  73. package/dist/behaviors/infrastructure.d.ts +9 -8
  74. package/dist/behaviors/infrastructure.js +597 -169
  75. package/dist/behaviors/infrastructure.js.map +1 -1
  76. package/dist/behaviors/registry.d.ts +11 -11
  77. package/dist/behaviors/registry.js +18904 -2139
  78. package/dist/behaviors/registry.js.map +1 -1
  79. package/dist/behaviors/types.d.ts +19 -2
  80. package/dist/behaviors/types.js.map +1 -1
  81. package/dist/behaviors/ui-interaction.d.ts +20 -14
  82. package/dist/behaviors/ui-interaction.js +928 -518
  83. package/dist/behaviors/ui-interaction.js.map +1 -1
  84. package/dist/index.js +18906 -2141
  85. package/dist/index.js.map +1 -1
  86. package/package.json +4 -1
@@ -0,0 +1,879 @@
1
+ // behaviors/domain/workflow.ts
2
+ var WORKFLOW_THEME = {
3
+ name: "workflow-orange",
4
+ tokens: {
5
+ colors: {
6
+ primary: "#ea580c",
7
+ "primary-hover": "#c2410c",
8
+ "primary-foreground": "#ffffff",
9
+ accent: "#fb923c",
10
+ "accent-foreground": "#000000",
11
+ success: "#22c55e",
12
+ warning: "#f59e0b",
13
+ error: "#ef4444"
14
+ }
15
+ }
16
+ };
17
+ var approvalMainEffects = [
18
+ ["fetch", "ApprovalRequest"],
19
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
20
+ // Header: icon + title
21
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
22
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
23
+ { type: "icon", name: "check-square", size: "lg" },
24
+ { type: "typography", variant: "h2", content: "Approvals" }
25
+ ] },
26
+ { type: "badge", label: "Pending Review", variant: "warning", icon: "flag" }
27
+ ] },
28
+ { type: "divider" },
29
+ // Stats row: pending count + approved count + rejected count
30
+ { type: "stack", direction: "horizontal", gap: "md", children: [
31
+ { type: "stats", label: "Pending", icon: "flag", entity: "ApprovalRequest" },
32
+ { type: "stats", label: "Approved", icon: "check-square", entity: "ApprovalRequest" },
33
+ { type: "stats", label: "Rejected", icon: "x-circle", entity: "ApprovalRequest" }
34
+ ] },
35
+ // Progress bar showing approval throughput
36
+ { type: "progress-bar", value: 0, label: "Approval Throughput" },
37
+ { type: "divider" },
38
+ // Data: approval request list with status badges
39
+ {
40
+ type: "data-list",
41
+ entity: "ApprovalRequest",
42
+ variant: "card",
43
+ fields: [
44
+ { name: "title", label: "Request", icon: "file-text", variant: "h4" },
45
+ { name: "requester", label: "Requester", icon: "user", variant: "body" },
46
+ { name: "status", label: "Status", icon: "circle-dot", variant: "badge" },
47
+ { name: "approver", label: "Approver", icon: "user-check", variant: "caption" }
48
+ ],
49
+ itemActions: [
50
+ { label: "Review", event: "REVIEW", icon: "eye" }
51
+ ]
52
+ }
53
+ ] }]
54
+ ];
55
+ var pipelineMainEffects = [
56
+ ["fetch", "PipelineItem"],
57
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
58
+ // Header: git-branch icon + title
59
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
60
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
61
+ { type: "icon", name: "git-branch", size: "lg" },
62
+ { type: "typography", variant: "h2", content: "Pipeline" }
63
+ ] },
64
+ { type: "badge", label: "Active", variant: "primary", icon: "play" }
65
+ ] },
66
+ { type: "divider" },
67
+ // Stats row: stage counts
68
+ { type: "stack", direction: "horizontal", gap: "md", children: [
69
+ { type: "stats", label: "Backlog", icon: "inbox", entity: "PipelineItem" },
70
+ { type: "stats", label: "In Progress", icon: "play", entity: "PipelineItem" },
71
+ { type: "stats", label: "Done", icon: "check-square", entity: "PipelineItem" }
72
+ ] },
73
+ // Progress meter
74
+ { type: "meter", value: 0, label: "Pipeline Progress", icon: "arrow-right" },
75
+ { type: "divider" },
76
+ // Data: pipeline items as a grid
77
+ {
78
+ type: "data-grid",
79
+ entity: "PipelineItem",
80
+ columns: [
81
+ { name: "name", label: "Item", icon: "file-text" },
82
+ { name: "stage", label: "Stage", icon: "git-branch" },
83
+ { name: "assignee", label: "Assignee", icon: "user" },
84
+ { name: "priority", label: "Priority", icon: "flag" }
85
+ ],
86
+ itemActions: [
87
+ { label: "View", event: "VIEW", icon: "eye" }
88
+ ]
89
+ }
90
+ ] }]
91
+ ];
92
+ var kanbanMainEffects = [
93
+ ["fetch", "KanbanCard"],
94
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
95
+ // Header: workflow icon + title + create button
96
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
97
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
98
+ { type: "icon", name: "list-checks", size: "lg" },
99
+ { type: "typography", variant: "h2", content: "Kanban Board" }
100
+ ] },
101
+ { type: "button", label: "New Card", icon: "plus", variant: "primary", action: "CREATE" }
102
+ ] },
103
+ { type: "divider" },
104
+ // Stats row: column counts
105
+ { type: "stack", direction: "horizontal", gap: "md", children: [
106
+ { type: "stats", label: "To Do", icon: "circle", entity: "KanbanCard" },
107
+ { type: "stats", label: "In Progress", icon: "play", entity: "KanbanCard" },
108
+ { type: "stats", label: "Done", icon: "check-square", entity: "KanbanCard" }
109
+ ] },
110
+ // Search bar
111
+ { type: "search-input", placeholder: "Search cards...", entity: "KanbanCard" },
112
+ { type: "divider" },
113
+ // Column swim lanes via tabs grouped by column field
114
+ { type: "tabs", entity: "KanbanCard", groupBy: "column", tabs: [
115
+ { label: "To Do", value: "todo", icon: "circle" },
116
+ { label: "In Progress", value: "in-progress", icon: "play" },
117
+ { label: "Done", value: "done", icon: "check-square" },
118
+ { label: "Review", value: "review", icon: "eye" }
119
+ ], children: [
120
+ {
121
+ type: "data-list",
122
+ entity: "KanbanCard",
123
+ variant: "card",
124
+ fields: [
125
+ { name: "title", label: "Title", icon: "file-text", variant: "h4" },
126
+ { name: "assignee", label: "Assignee", icon: "user", variant: "caption" },
127
+ { name: "dueDate", label: "Due", icon: "calendar", variant: "caption", format: "date" }
128
+ ],
129
+ itemActions: [
130
+ { label: "View", event: "VIEW", icon: "eye" }
131
+ ]
132
+ }
133
+ ] }
134
+ ] }]
135
+ ];
136
+ var reviewMainEffects = [
137
+ ["fetch", "ReviewItem"],
138
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
139
+ // Header: star icon + title
140
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
141
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
142
+ { type: "icon", name: "workflow", size: "lg" },
143
+ { type: "typography", variant: "h2", content: "Reviews" }
144
+ ] },
145
+ { type: "badge", label: "Review Queue", variant: "accent", icon: "list-checks" }
146
+ ] },
147
+ { type: "divider" },
148
+ // Stats row: total reviews, average score, pending
149
+ { type: "stack", direction: "horizontal", gap: "md", children: [
150
+ { type: "stats", label: "Total Items", icon: "hash", entity: "ReviewItem" },
151
+ { type: "stats", label: "Avg Score", icon: "bar-chart-2", entity: "ReviewItem" },
152
+ { type: "stats", label: "Pending", icon: "flag", entity: "ReviewItem" }
153
+ ] },
154
+ // Score distribution chart
155
+ { type: "line-chart", entity: "ReviewItem" },
156
+ { type: "divider" },
157
+ // Data: review items as cards with score badges
158
+ {
159
+ type: "data-list",
160
+ entity: "ReviewItem",
161
+ variant: "card",
162
+ fields: [
163
+ { name: "title", label: "Title", icon: "file-text", variant: "h4" },
164
+ { name: "content", label: "Content", icon: "align-left", variant: "body" },
165
+ { name: "reviewer", label: "Reviewer", icon: "user", variant: "caption" },
166
+ { name: "score", label: "Score", icon: "bar-chart-2", variant: "badge" },
167
+ { name: "feedback", label: "Feedback", icon: "message-circle", variant: "body" }
168
+ ],
169
+ itemActions: [
170
+ { label: "Review", event: "REVIEW", icon: "edit" }
171
+ ]
172
+ }
173
+ ] }]
174
+ ];
175
+ var APPROVAL_BEHAVIOR = {
176
+ name: "std-approval",
177
+ version: "1.0.0",
178
+ description: "Approval workflow with review and decision flow",
179
+ theme: WORKFLOW_THEME,
180
+ orbitals: [
181
+ {
182
+ name: "ApprovalOrbital",
183
+ entity: {
184
+ name: "ApprovalRequest",
185
+ persistence: "persistent",
186
+ collection: "approval_requests",
187
+ fields: [
188
+ { name: "id", type: "string", required: true },
189
+ { name: "title", type: "string", default: "" },
190
+ { name: "requester", type: "string", default: "" },
191
+ { name: "status", type: "string", default: "pending" },
192
+ { name: "approver", type: "string", default: "" },
193
+ { name: "notes", type: "string", default: "" }
194
+ ]
195
+ },
196
+ traits: [
197
+ {
198
+ name: "ApprovalFlow",
199
+ linkedEntity: "ApprovalRequest",
200
+ category: "interaction",
201
+ stateMachine: {
202
+ states: [
203
+ { name: "browsing", isInitial: true },
204
+ { name: "reviewing" },
205
+ { name: "approved" },
206
+ { name: "rejected" }
207
+ ],
208
+ events: [
209
+ { key: "INIT", name: "Initialize" },
210
+ { key: "REVIEW", name: "Review Request", payloadSchema: [{ name: "id", type: "string", required: true }] },
211
+ { key: "APPROVE", name: "Approve", payloadSchema: [{ name: "notes", type: "string", required: true }] },
212
+ { key: "REJECT", name: "Reject", payloadSchema: [{ name: "notes", type: "string", required: true }] },
213
+ { key: "CANCEL", name: "Cancel" },
214
+ { key: "CLOSE", name: "Close" }
215
+ ],
216
+ transitions: [
217
+ {
218
+ from: "browsing",
219
+ to: "browsing",
220
+ event: "INIT",
221
+ effects: [
222
+ ...approvalMainEffects
223
+ ]
224
+ },
225
+ {
226
+ from: "browsing",
227
+ to: "reviewing",
228
+ event: "REVIEW",
229
+ effects: [
230
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
231
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
232
+ { type: "icon", name: "eye", size: "md" },
233
+ { type: "typography", variant: "h3", content: "Review Request" }
234
+ ] },
235
+ { type: "divider" },
236
+ { type: "stack", direction: "vertical", gap: "sm", children: [
237
+ { type: "typography", variant: "body", content: "@entity.title" },
238
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
239
+ { type: "typography", variant: "caption", content: "Requester:" },
240
+ { type: "badge", label: "@entity.requester", variant: "default" }
241
+ ] },
242
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
243
+ { type: "typography", variant: "caption", content: "Status:" },
244
+ { type: "badge", label: "@entity.status", variant: "warning", icon: "flag" }
245
+ ] }
246
+ ] },
247
+ { type: "divider" },
248
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
249
+ { type: "button", label: "Approve", icon: "check-square", variant: "primary", action: "APPROVE" },
250
+ { type: "button", label: "Reject", icon: "x-circle", variant: "danger", action: "REJECT" },
251
+ { type: "button", label: "Close", icon: "x", variant: "ghost", action: "CLOSE" }
252
+ ] }
253
+ ] }]
254
+ ]
255
+ },
256
+ {
257
+ from: "reviewing",
258
+ to: "approved",
259
+ event: "APPROVE",
260
+ effects: [
261
+ ["set", "@entity.status", "approved"],
262
+ ["set", "@entity.notes", "@payload.notes"],
263
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
264
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
265
+ { type: "icon", name: "check-square", size: "md" },
266
+ { type: "typography", variant: "h3", content: "Request Approved" }
267
+ ] },
268
+ { type: "divider" },
269
+ { type: "badge", label: "Approved", variant: "success", icon: "check-square" },
270
+ { type: "typography", variant: "body", content: "@entity.notes" },
271
+ { type: "divider" },
272
+ { type: "button", label: "Close", icon: "x", variant: "ghost", action: "CLOSE" }
273
+ ] }]
274
+ ]
275
+ },
276
+ {
277
+ from: "reviewing",
278
+ to: "rejected",
279
+ event: "REJECT",
280
+ effects: [
281
+ ["set", "@entity.status", "rejected"],
282
+ ["set", "@entity.notes", "@payload.notes"],
283
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
284
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
285
+ { type: "icon", name: "x-circle", size: "md" },
286
+ { type: "typography", variant: "h3", content: "Request Rejected" }
287
+ ] },
288
+ { type: "divider" },
289
+ { type: "badge", label: "Rejected", variant: "error", icon: "x-circle" },
290
+ { type: "typography", variant: "body", content: "@entity.notes" },
291
+ { type: "divider" },
292
+ { type: "button", label: "Close", icon: "x", variant: "ghost", action: "CLOSE" }
293
+ ] }]
294
+ ]
295
+ },
296
+ {
297
+ from: "reviewing",
298
+ to: "browsing",
299
+ event: "CANCEL",
300
+ effects: [
301
+ ["render-ui", "modal", null]
302
+ ]
303
+ },
304
+ {
305
+ from: "reviewing",
306
+ to: "browsing",
307
+ event: "CLOSE",
308
+ effects: [
309
+ ["render-ui", "modal", null]
310
+ ]
311
+ },
312
+ {
313
+ from: "approved",
314
+ to: "browsing",
315
+ event: "CLOSE",
316
+ effects: [
317
+ ["render-ui", "modal", null],
318
+ ...approvalMainEffects
319
+ ]
320
+ },
321
+ {
322
+ from: "approved",
323
+ to: "browsing",
324
+ event: "CANCEL",
325
+ effects: [
326
+ ["render-ui", "modal", null],
327
+ ...approvalMainEffects
328
+ ]
329
+ },
330
+ {
331
+ from: "rejected",
332
+ to: "browsing",
333
+ event: "CLOSE",
334
+ effects: [
335
+ ["render-ui", "modal", null],
336
+ ...approvalMainEffects
337
+ ]
338
+ },
339
+ {
340
+ from: "rejected",
341
+ to: "browsing",
342
+ event: "CANCEL",
343
+ effects: [
344
+ ["render-ui", "modal", null],
345
+ ...approvalMainEffects
346
+ ]
347
+ }
348
+ ]
349
+ }
350
+ }
351
+ ],
352
+ pages: [
353
+ {
354
+ name: "ApprovalsPage",
355
+ path: "/approvals",
356
+ isInitial: true,
357
+ traits: [{ ref: "ApprovalFlow" }]
358
+ }
359
+ ]
360
+ }
361
+ ]
362
+ };
363
+ var PIPELINE_BEHAVIOR = {
364
+ name: "std-pipeline",
365
+ version: "1.0.0",
366
+ description: "Pipeline stage management with item progression",
367
+ theme: WORKFLOW_THEME,
368
+ orbitals: [
369
+ {
370
+ name: "PipelineOrbital",
371
+ entity: {
372
+ name: "PipelineItem",
373
+ persistence: "persistent",
374
+ collection: "pipeline_items",
375
+ fields: [
376
+ { name: "id", type: "string", required: true },
377
+ { name: "name", type: "string", default: "" },
378
+ { name: "stage", type: "string", default: "backlog" },
379
+ { name: "assignee", type: "string", default: "" },
380
+ { name: "priority", type: "string", default: "medium" }
381
+ ]
382
+ },
383
+ traits: [
384
+ {
385
+ name: "PipelineManager",
386
+ linkedEntity: "PipelineItem",
387
+ category: "interaction",
388
+ stateMachine: {
389
+ states: [
390
+ { name: "browsing", isInitial: true },
391
+ { name: "viewing" },
392
+ { name: "moving" }
393
+ ],
394
+ events: [
395
+ { key: "INIT", name: "Initialize" },
396
+ { key: "VIEW", name: "View Item", payloadSchema: [{ name: "id", type: "string", required: true }] },
397
+ { key: "MOVE", name: "Move Item" },
398
+ { key: "SET_STAGE", name: "Set Stage", payloadSchema: [{ name: "stage", type: "string", required: true }] },
399
+ { key: "CANCEL", name: "Cancel" },
400
+ { key: "CLOSE", name: "Close" }
401
+ ],
402
+ transitions: [
403
+ {
404
+ from: "browsing",
405
+ to: "browsing",
406
+ event: "INIT",
407
+ effects: [
408
+ ...pipelineMainEffects
409
+ ]
410
+ },
411
+ {
412
+ from: "browsing",
413
+ to: "viewing",
414
+ event: "VIEW",
415
+ effects: [
416
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
417
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
418
+ { type: "icon", name: "git-branch", size: "md" },
419
+ { type: "typography", variant: "h3", content: "@entity.name" }
420
+ ] },
421
+ { type: "divider" },
422
+ { type: "stack", direction: "vertical", gap: "sm", children: [
423
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
424
+ { type: "typography", variant: "caption", content: "Stage:" },
425
+ { type: "badge", label: "@entity.stage", variant: "primary", icon: "arrow-right" }
426
+ ] },
427
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
428
+ { type: "typography", variant: "caption", content: "Assignee:" },
429
+ { type: "typography", variant: "body", content: "@entity.assignee" }
430
+ ] },
431
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
432
+ { type: "typography", variant: "caption", content: "Priority:" },
433
+ { type: "badge", label: "@entity.priority", variant: "warning", icon: "flag" }
434
+ ] }
435
+ ] },
436
+ { type: "divider" },
437
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
438
+ { type: "button", label: "Move Stage", icon: "arrow-right", variant: "primary", action: "MOVE" },
439
+ { type: "button", label: "Close", icon: "x", variant: "ghost", action: "CLOSE" }
440
+ ] }
441
+ ] }]
442
+ ]
443
+ },
444
+ {
445
+ from: "viewing",
446
+ to: "moving",
447
+ event: "MOVE",
448
+ effects: [
449
+ ["fetch", "PipelineItem"],
450
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
451
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
452
+ { type: "icon", name: "arrow-right", size: "md" },
453
+ { type: "typography", variant: "h3", content: "Move to Stage" }
454
+ ] },
455
+ { type: "divider" },
456
+ {
457
+ type: "form-section",
458
+ entity: "PipelineItem",
459
+ title: "Select Stage",
460
+ submitEvent: "SET_STAGE",
461
+ cancelEvent: "CANCEL"
462
+ }
463
+ ] }]
464
+ ]
465
+ },
466
+ {
467
+ from: "moving",
468
+ to: "browsing",
469
+ event: "SET_STAGE",
470
+ effects: [
471
+ ["set", "@entity.stage", "@payload.stage"],
472
+ ["render-ui", "modal", null],
473
+ ...pipelineMainEffects
474
+ ]
475
+ },
476
+ {
477
+ from: "moving",
478
+ to: "browsing",
479
+ event: "CANCEL",
480
+ effects: [
481
+ ["render-ui", "modal", null]
482
+ ]
483
+ },
484
+ {
485
+ from: "viewing",
486
+ to: "browsing",
487
+ event: "CLOSE",
488
+ effects: [
489
+ ["render-ui", "modal", null]
490
+ ]
491
+ },
492
+ {
493
+ from: "viewing",
494
+ to: "browsing",
495
+ event: "CANCEL",
496
+ effects: [
497
+ ["render-ui", "modal", null]
498
+ ]
499
+ }
500
+ ]
501
+ }
502
+ }
503
+ ],
504
+ pages: [
505
+ {
506
+ name: "PipelinePage",
507
+ path: "/pipeline",
508
+ isInitial: true,
509
+ traits: [{ ref: "PipelineManager" }]
510
+ }
511
+ ]
512
+ }
513
+ ]
514
+ };
515
+ var KANBAN_BEHAVIOR = {
516
+ name: "std-kanban",
517
+ version: "1.0.0",
518
+ description: "Kanban board card management",
519
+ theme: WORKFLOW_THEME,
520
+ orbitals: [
521
+ {
522
+ name: "KanbanOrbital",
523
+ entity: {
524
+ name: "KanbanCard",
525
+ persistence: "persistent",
526
+ collection: "kanban_cards",
527
+ fields: [
528
+ { name: "id", type: "string", required: true },
529
+ { name: "title", type: "string", default: "" },
530
+ { name: "column", type: "string", default: "todo" },
531
+ { name: "assignee", type: "string", default: "" },
532
+ { name: "dueDate", type: "string", default: "" }
533
+ ]
534
+ },
535
+ traits: [
536
+ {
537
+ name: "KanbanManager",
538
+ linkedEntity: "KanbanCard",
539
+ category: "interaction",
540
+ stateMachine: {
541
+ states: [
542
+ { name: "browsing", isInitial: true },
543
+ { name: "creating" },
544
+ { name: "viewing" },
545
+ { name: "editing" }
546
+ ],
547
+ events: [
548
+ { key: "INIT", name: "Initialize" },
549
+ { key: "CREATE", name: "Create Card" },
550
+ { key: "SUBMIT", name: "Submit Card", payloadSchema: [
551
+ { name: "title", type: "string", required: true },
552
+ { name: "column", type: "string", required: true },
553
+ { name: "assignee", type: "string", required: true },
554
+ { name: "dueDate", type: "string", required: true }
555
+ ] },
556
+ { key: "VIEW", name: "View Card", payloadSchema: [{ name: "id", type: "string", required: true }] },
557
+ { key: "EDIT", name: "Edit Card" },
558
+ { key: "UPDATE", name: "Update Card", payloadSchema: [
559
+ { name: "title", type: "string", required: true },
560
+ { name: "column", type: "string", required: true },
561
+ { name: "assignee", type: "string", required: true },
562
+ { name: "dueDate", type: "string", required: true }
563
+ ] },
564
+ { key: "CANCEL", name: "Cancel" },
565
+ { key: "CLOSE", name: "Close" }
566
+ ],
567
+ transitions: [
568
+ {
569
+ from: "browsing",
570
+ to: "browsing",
571
+ event: "INIT",
572
+ effects: [
573
+ ...kanbanMainEffects
574
+ ]
575
+ },
576
+ {
577
+ from: "browsing",
578
+ to: "creating",
579
+ event: "CREATE",
580
+ effects: [
581
+ ["fetch", "KanbanCard"],
582
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
583
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
584
+ { type: "icon", name: "plus", size: "md" },
585
+ { type: "typography", variant: "h3", content: "New Card" }
586
+ ] },
587
+ { type: "divider" },
588
+ {
589
+ type: "form-section",
590
+ entity: "KanbanCard",
591
+ title: "Card Details",
592
+ submitEvent: "SUBMIT",
593
+ cancelEvent: "CANCEL"
594
+ }
595
+ ] }]
596
+ ]
597
+ },
598
+ {
599
+ from: "creating",
600
+ to: "browsing",
601
+ event: "SUBMIT",
602
+ effects: [
603
+ ["set", "@entity.title", "@payload.title"],
604
+ ["set", "@entity.column", "@payload.column"],
605
+ ["set", "@entity.assignee", "@payload.assignee"],
606
+ ["set", "@entity.dueDate", "@payload.dueDate"],
607
+ ["render-ui", "modal", null],
608
+ ...kanbanMainEffects
609
+ ]
610
+ },
611
+ {
612
+ from: "creating",
613
+ to: "browsing",
614
+ event: "CANCEL",
615
+ effects: [
616
+ ["render-ui", "modal", null]
617
+ ]
618
+ },
619
+ {
620
+ from: "browsing",
621
+ to: "viewing",
622
+ event: "VIEW",
623
+ effects: [
624
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
625
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
626
+ { type: "icon", name: "list-checks", size: "md" },
627
+ { type: "typography", variant: "h3", content: "@entity.title" }
628
+ ] },
629
+ { type: "divider" },
630
+ { type: "stack", direction: "vertical", gap: "sm", children: [
631
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
632
+ { type: "typography", variant: "caption", content: "Column:" },
633
+ { type: "badge", label: "@entity.column", variant: "primary", icon: "list-checks" }
634
+ ] },
635
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
636
+ { type: "typography", variant: "caption", content: "Assignee:" },
637
+ { type: "typography", variant: "body", content: "@entity.assignee" }
638
+ ] },
639
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
640
+ { type: "typography", variant: "caption", content: "Due Date:" },
641
+ { type: "typography", variant: "body", content: "@entity.dueDate" }
642
+ ] }
643
+ ] },
644
+ { type: "divider" },
645
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
646
+ { type: "button", label: "Edit", icon: "edit", variant: "primary", action: "EDIT" },
647
+ { type: "button", label: "Close", icon: "x", variant: "ghost", action: "CLOSE" }
648
+ ] }
649
+ ] }]
650
+ ]
651
+ },
652
+ {
653
+ from: "viewing",
654
+ to: "editing",
655
+ event: "EDIT",
656
+ effects: [
657
+ ["fetch", "KanbanCard"],
658
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
659
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
660
+ { type: "icon", name: "edit", size: "md" },
661
+ { type: "typography", variant: "h3", content: "Edit Card" }
662
+ ] },
663
+ { type: "divider" },
664
+ {
665
+ type: "form-section",
666
+ entity: "KanbanCard",
667
+ title: "Update Card",
668
+ submitEvent: "UPDATE",
669
+ cancelEvent: "CANCEL"
670
+ }
671
+ ] }]
672
+ ]
673
+ },
674
+ {
675
+ from: "editing",
676
+ to: "browsing",
677
+ event: "UPDATE",
678
+ effects: [
679
+ ["set", "@entity.title", "@payload.title"],
680
+ ["set", "@entity.column", "@payload.column"],
681
+ ["set", "@entity.assignee", "@payload.assignee"],
682
+ ["set", "@entity.dueDate", "@payload.dueDate"],
683
+ ["render-ui", "modal", null],
684
+ ...kanbanMainEffects
685
+ ]
686
+ },
687
+ {
688
+ from: "editing",
689
+ to: "browsing",
690
+ event: "CANCEL",
691
+ effects: [
692
+ ["render-ui", "modal", null]
693
+ ]
694
+ },
695
+ {
696
+ from: "viewing",
697
+ to: "browsing",
698
+ event: "CLOSE",
699
+ effects: [
700
+ ["render-ui", "modal", null]
701
+ ]
702
+ },
703
+ {
704
+ from: "viewing",
705
+ to: "browsing",
706
+ event: "CANCEL",
707
+ effects: [
708
+ ["render-ui", "modal", null]
709
+ ]
710
+ }
711
+ ]
712
+ }
713
+ }
714
+ ],
715
+ pages: [
716
+ {
717
+ name: "KanbanPage",
718
+ path: "/kanban",
719
+ isInitial: true,
720
+ traits: [{ ref: "KanbanManager" }]
721
+ }
722
+ ]
723
+ }
724
+ ]
725
+ };
726
+ var REVIEW_BEHAVIOR = {
727
+ name: "std-review",
728
+ version: "1.0.0",
729
+ description: "Review process with scoring and feedback",
730
+ theme: WORKFLOW_THEME,
731
+ orbitals: [
732
+ {
733
+ name: "ReviewOrbital",
734
+ entity: {
735
+ name: "ReviewItem",
736
+ persistence: "persistent",
737
+ collection: "review_items",
738
+ fields: [
739
+ { name: "id", type: "string", required: true },
740
+ { name: "title", type: "string", default: "" },
741
+ { name: "content", type: "string", default: "" },
742
+ { name: "reviewer", type: "string", default: "" },
743
+ { name: "score", type: "number", default: 0 },
744
+ { name: "feedback", type: "string", default: "" }
745
+ ]
746
+ },
747
+ traits: [
748
+ {
749
+ name: "ReviewProcess",
750
+ linkedEntity: "ReviewItem",
751
+ category: "interaction",
752
+ stateMachine: {
753
+ states: [
754
+ { name: "browsing", isInitial: true },
755
+ { name: "reviewing" },
756
+ { name: "scored" }
757
+ ],
758
+ events: [
759
+ { key: "INIT", name: "Initialize" },
760
+ { key: "REVIEW", name: "Review Item", payloadSchema: [{ name: "id", type: "string", required: true }] },
761
+ { key: "SUBMIT_REVIEW", name: "Submit Review", payloadSchema: [
762
+ { name: "score", type: "number", required: true },
763
+ { name: "feedback", type: "string", required: true },
764
+ { name: "reviewer", type: "string", required: true }
765
+ ] },
766
+ { key: "CANCEL", name: "Cancel" },
767
+ { key: "CLOSE", name: "Close" }
768
+ ],
769
+ transitions: [
770
+ {
771
+ from: "browsing",
772
+ to: "browsing",
773
+ event: "INIT",
774
+ effects: [
775
+ ...reviewMainEffects
776
+ ]
777
+ },
778
+ {
779
+ from: "browsing",
780
+ to: "reviewing",
781
+ event: "REVIEW",
782
+ effects: [
783
+ ["fetch", "ReviewItem"],
784
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
785
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
786
+ { type: "icon", name: "edit", size: "md" },
787
+ { type: "typography", variant: "h3", content: "Submit Review" }
788
+ ] },
789
+ { type: "divider" },
790
+ { type: "stack", direction: "vertical", gap: "sm", children: [
791
+ { type: "typography", variant: "h4", content: "@entity.title" },
792
+ { type: "typography", variant: "body", content: "@entity.content" }
793
+ ] },
794
+ { type: "divider" },
795
+ {
796
+ type: "form-section",
797
+ entity: "ReviewItem",
798
+ title: "Your Review",
799
+ submitEvent: "SUBMIT_REVIEW",
800
+ cancelEvent: "CANCEL"
801
+ }
802
+ ] }]
803
+ ]
804
+ },
805
+ {
806
+ from: "reviewing",
807
+ to: "scored",
808
+ event: "SUBMIT_REVIEW",
809
+ effects: [
810
+ ["set", "@entity.score", "@payload.score"],
811
+ ["set", "@entity.feedback", "@payload.feedback"],
812
+ ["set", "@entity.reviewer", "@payload.reviewer"],
813
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
814
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
815
+ { type: "icon", name: "check-square", size: "md" },
816
+ { type: "typography", variant: "h3", content: "Review Submitted" }
817
+ ] },
818
+ { type: "divider" },
819
+ { type: "stack", direction: "horizontal", gap: "md", children: [
820
+ { type: "badge", label: "Scored", variant: "success", icon: "bar-chart-2" },
821
+ { type: "stats", label: "Score", value: "@entity.score", icon: "bar-chart-2" }
822
+ ] },
823
+ { type: "typography", variant: "body", content: "@entity.feedback" },
824
+ { type: "divider" },
825
+ { type: "button", label: "Close", icon: "x", variant: "ghost", action: "CLOSE" }
826
+ ] }]
827
+ ]
828
+ },
829
+ {
830
+ from: "reviewing",
831
+ to: "browsing",
832
+ event: "CANCEL",
833
+ effects: [
834
+ ["render-ui", "modal", null]
835
+ ]
836
+ },
837
+ {
838
+ from: "scored",
839
+ to: "browsing",
840
+ event: "CLOSE",
841
+ effects: [
842
+ ["render-ui", "modal", null],
843
+ ...reviewMainEffects
844
+ ]
845
+ },
846
+ {
847
+ from: "scored",
848
+ to: "browsing",
849
+ event: "CANCEL",
850
+ effects: [
851
+ ["render-ui", "modal", null],
852
+ ...reviewMainEffects
853
+ ]
854
+ }
855
+ ]
856
+ }
857
+ }
858
+ ],
859
+ pages: [
860
+ {
861
+ name: "ReviewsPage",
862
+ path: "/reviews",
863
+ isInitial: true,
864
+ traits: [{ ref: "ReviewProcess" }]
865
+ }
866
+ ]
867
+ }
868
+ ]
869
+ };
870
+ var WORKFLOW_BEHAVIORS = [
871
+ APPROVAL_BEHAVIOR,
872
+ PIPELINE_BEHAVIOR,
873
+ KANBAN_BEHAVIOR,
874
+ REVIEW_BEHAVIOR
875
+ ];
876
+
877
+ export { APPROVAL_BEHAVIOR, KANBAN_BEHAVIOR, PIPELINE_BEHAVIOR, REVIEW_BEHAVIOR, WORKFLOW_BEHAVIORS };
878
+ //# sourceMappingURL=workflow.js.map
879
+ //# sourceMappingURL=workflow.js.map