eventmodeler 0.4.7 → 0.6.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 (204) hide show
  1. package/dist/api/client-config.js +10 -0
  2. package/dist/api/generated/client/client.gen.js +235 -0
  3. package/dist/api/generated/client/index.js +6 -0
  4. package/dist/api/generated/client/types.gen.js +2 -0
  5. package/dist/api/generated/client/utils.gen.js +228 -0
  6. package/dist/api/generated/client.gen.js +4 -0
  7. package/dist/api/generated/core/auth.gen.js +14 -0
  8. package/dist/api/generated/core/bodySerializer.gen.js +57 -0
  9. package/dist/api/generated/core/params.gen.js +100 -0
  10. package/dist/api/generated/core/pathSerializer.gen.js +106 -0
  11. package/dist/api/generated/core/queryKeySerializer.gen.js +92 -0
  12. package/dist/api/generated/core/serverSentEvents.gen.js +133 -0
  13. package/dist/api/generated/core/types.gen.js +2 -0
  14. package/dist/api/generated/core/utils.gen.js +87 -0
  15. package/dist/api/generated/index.js +2 -0
  16. package/dist/api/generated/sdk.gen.js +4222 -0
  17. package/dist/api/generated/types.gen.js +2 -0
  18. package/dist/api/generated/zod.gen.js +7217 -0
  19. package/dist/commands/add.js +315 -0
  20. package/dist/commands/auth.js +14 -0
  21. package/dist/commands/create.js +192 -0
  22. package/dist/commands/design.js +108 -0
  23. package/dist/commands/guide.js +15 -0
  24. package/dist/commands/init.js +21 -0
  25. package/dist/commands/list-schemas.js +177 -0
  26. package/dist/commands/list.js +39 -0
  27. package/dist/commands/loop.js +101 -0
  28. package/dist/commands/map.js +40 -0
  29. package/dist/commands/mark.js +27 -0
  30. package/dist/commands/move.js +35 -0
  31. package/dist/commands/remove.js +170 -0
  32. package/dist/commands/rename.js +53 -0
  33. package/dist/commands/resize.js +30 -0
  34. package/dist/commands/search.js +14 -0
  35. package/dist/commands/set.js +199 -0
  36. package/dist/commands/show-schemas.js +259 -0
  37. package/dist/commands/show.js +56 -0
  38. package/dist/commands/summary.js +13 -0
  39. package/dist/commands/update.js +240 -0
  40. package/dist/index.js +46 -2379
  41. package/dist/lib/auth.js +1 -1
  42. package/dist/lib/config.js +0 -15
  43. package/dist/lib/excalidraw-schema.js +66 -0
  44. package/dist/lib/globals.js +8 -0
  45. package/dist/lib/model.js +11 -0
  46. package/dist/lib/project-config.js +20 -0
  47. package/dist/lib/resolve.js +59 -0
  48. package/dist/lib/scenario.js +15 -0
  49. package/dist/slices/add-scenario/index.js +2 -206
  50. package/dist/slices/guide/guides/codegen.js +1 -1
  51. package/dist/slices/guide/guides/connect-slices.js +12 -37
  52. package/dist/slices/guide/guides/create-slices.js +110 -140
  53. package/dist/slices/guide/guides/explore.js +37 -26
  54. package/dist/slices/guide/guides/information-flow.js +70 -82
  55. package/dist/slices/guide/guides/scenarios.js +82 -137
  56. package/dist/slices/guide/index.js +6 -6
  57. package/dist/slices/help/index.js +96 -0
  58. package/dist/slices/help/topics/build-codegen.js +109 -0
  59. package/dist/slices/help/topics/build-slice.js +147 -0
  60. package/dist/slices/help/topics/check-completeness.js +57 -0
  61. package/dist/slices/help/topics/connect-slices.js +99 -0
  62. package/dist/slices/help/topics/explore-model.js +112 -0
  63. package/dist/slices/help/topics/json-reference.js +188 -0
  64. package/dist/slices/help/topics/linked-copies.js +89 -0
  65. package/dist/slices/help/topics/manipulate-canvas.js +150 -0
  66. package/dist/slices/help/topics/write-scenarios.js +162 -0
  67. package/dist/slices/init/index.js +10 -4
  68. package/dist/slices/init/loop.js +60 -0
  69. package/dist/slices/login/index.js +2 -2
  70. package/dist/slices/logout/index.js +2 -2
  71. package/dist/slices/whoami/index.js +11 -36
  72. package/package.json +8 -3
  73. package/dist/api/index.d.ts +0 -285
  74. package/dist/api/index.js +0 -323
  75. package/dist/cloud/slices/index.d.ts +0 -276
  76. package/dist/cloud/slices/index.js +0 -406
  77. package/dist/eventmodeler.js +0 -5646
  78. package/dist/formatters.d.ts +0 -17
  79. package/dist/formatters.js +0 -482
  80. package/dist/index.d.ts +0 -2
  81. package/dist/lib/auth.d.ts +0 -24
  82. package/dist/lib/backend.d.ts +0 -43
  83. package/dist/lib/backend.js +0 -73
  84. package/dist/lib/chapter-utils.d.ts +0 -13
  85. package/dist/lib/chapter-utils.js +0 -71
  86. package/dist/lib/cloud-client.d.ts +0 -69
  87. package/dist/lib/cloud-client.js +0 -364
  88. package/dist/lib/config.d.ts +0 -30
  89. package/dist/lib/diff/merge-rules.d.ts +0 -45
  90. package/dist/lib/diff/merge-rules.js +0 -210
  91. package/dist/lib/diff/model-differ.d.ts +0 -8
  92. package/dist/lib/diff/model-differ.js +0 -568
  93. package/dist/lib/diff/three-way-merge.d.ts +0 -7
  94. package/dist/lib/diff/three-way-merge.js +0 -390
  95. package/dist/lib/diff/types.d.ts +0 -75
  96. package/dist/lib/diff/types.js +0 -1
  97. package/dist/lib/element-lookup.d.ts +0 -58
  98. package/dist/lib/element-lookup.js +0 -126
  99. package/dist/lib/file-loader.d.ts +0 -8
  100. package/dist/lib/file-loader.js +0 -108
  101. package/dist/lib/flow-utils.d.ts +0 -53
  102. package/dist/lib/flow-utils.js +0 -348
  103. package/dist/lib/format.d.ts +0 -10
  104. package/dist/lib/format.js +0 -23
  105. package/dist/lib/project-config.d.ts +0 -27
  106. package/dist/lib/slice-utils.d.ts +0 -59
  107. package/dist/lib/slice-utils.js +0 -140
  108. package/dist/local/slices/index.d.ts +0 -11
  109. package/dist/local/slices/index.js +0 -13
  110. package/dist/projection.d.ts +0 -3
  111. package/dist/projection.js +0 -828
  112. package/dist/slices/add-field/index.d.ts +0 -8
  113. package/dist/slices/add-field/index.js +0 -211
  114. package/dist/slices/add-scenario/index.d.ts +0 -27
  115. package/dist/slices/codegen-chapter-events/index.d.ts +0 -2
  116. package/dist/slices/codegen-chapter-events/index.js +0 -145
  117. package/dist/slices/codegen-slice/index.d.ts +0 -2
  118. package/dist/slices/codegen-slice/index.js +0 -448
  119. package/dist/slices/create-automation-slice/index.d.ts +0 -2
  120. package/dist/slices/create-automation-slice/index.js +0 -304
  121. package/dist/slices/create-flow/index.d.ts +0 -2
  122. package/dist/slices/create-flow/index.js +0 -183
  123. package/dist/slices/create-state-change-slice/index.d.ts +0 -2
  124. package/dist/slices/create-state-change-slice/index.js +0 -263
  125. package/dist/slices/create-state-view-slice/index.d.ts +0 -2
  126. package/dist/slices/create-state-view-slice/index.js +0 -128
  127. package/dist/slices/diff/index.d.ts +0 -11
  128. package/dist/slices/diff/index.js +0 -293
  129. package/dist/slices/export-eventmodel-to-json/index.d.ts +0 -2
  130. package/dist/slices/export-eventmodel-to-json/index.js +0 -355
  131. package/dist/slices/git/index.d.ts +0 -2
  132. package/dist/slices/git/index.js +0 -125
  133. package/dist/slices/guide/guides/codegen.d.ts +0 -5
  134. package/dist/slices/guide/guides/connect-slices.d.ts +0 -5
  135. package/dist/slices/guide/guides/create-slices.d.ts +0 -5
  136. package/dist/slices/guide/guides/explore.d.ts +0 -5
  137. package/dist/slices/guide/guides/information-flow.d.ts +0 -5
  138. package/dist/slices/guide/guides/scenarios.d.ts +0 -5
  139. package/dist/slices/guide/index.d.ts +0 -1
  140. package/dist/slices/import/index.d.ts +0 -8
  141. package/dist/slices/import/index.js +0 -63
  142. package/dist/slices/init/index.d.ts +0 -5
  143. package/dist/slices/list-chapters/index.d.ts +0 -3
  144. package/dist/slices/list-chapters/index.js +0 -21
  145. package/dist/slices/list-commands/index.d.ts +0 -3
  146. package/dist/slices/list-commands/index.js +0 -20
  147. package/dist/slices/list-events/index.d.ts +0 -3
  148. package/dist/slices/list-events/index.js +0 -98
  149. package/dist/slices/list-processors/index.d.ts +0 -3
  150. package/dist/slices/list-processors/index.js +0 -20
  151. package/dist/slices/list-readmodels/index.d.ts +0 -3
  152. package/dist/slices/list-readmodels/index.js +0 -21
  153. package/dist/slices/list-scenarios/index.d.ts +0 -3
  154. package/dist/slices/list-scenarios/index.js +0 -35
  155. package/dist/slices/list-screens/index.d.ts +0 -3
  156. package/dist/slices/list-screens/index.js +0 -47
  157. package/dist/slices/list-slices/index.d.ts +0 -3
  158. package/dist/slices/list-slices/index.js +0 -35
  159. package/dist/slices/login/index.d.ts +0 -1
  160. package/dist/slices/logout/index.d.ts +0 -1
  161. package/dist/slices/map-fields/index.d.ts +0 -2
  162. package/dist/slices/map-fields/index.js +0 -269
  163. package/dist/slices/mark-slice-status/index.d.ts +0 -2
  164. package/dist/slices/mark-slice-status/index.js +0 -31
  165. package/dist/slices/merge/index.d.ts +0 -19
  166. package/dist/slices/merge/index.js +0 -147
  167. package/dist/slices/open-app/index.d.ts +0 -1
  168. package/dist/slices/remove-field/index.d.ts +0 -8
  169. package/dist/slices/remove-field/index.js +0 -167
  170. package/dist/slices/remove-scenario/index.d.ts +0 -2
  171. package/dist/slices/remove-scenario/index.js +0 -77
  172. package/dist/slices/search/index.d.ts +0 -3
  173. package/dist/slices/search/index.js +0 -302
  174. package/dist/slices/show-actor/index.d.ts +0 -4
  175. package/dist/slices/show-actor/index.js +0 -115
  176. package/dist/slices/show-aggregate/index.d.ts +0 -3
  177. package/dist/slices/show-aggregate/index.js +0 -108
  178. package/dist/slices/show-aggregate-completeness/index.d.ts +0 -4
  179. package/dist/slices/show-aggregate-completeness/index.js +0 -181
  180. package/dist/slices/show-chapter/index.d.ts +0 -3
  181. package/dist/slices/show-chapter/index.js +0 -195
  182. package/dist/slices/show-command/index.d.ts +0 -3
  183. package/dist/slices/show-command/index.js +0 -133
  184. package/dist/slices/show-completeness/index.d.ts +0 -4
  185. package/dist/slices/show-completeness/index.js +0 -731
  186. package/dist/slices/show-event/index.d.ts +0 -3
  187. package/dist/slices/show-event/index.js +0 -118
  188. package/dist/slices/show-model-summary/index.d.ts +0 -3
  189. package/dist/slices/show-model-summary/index.js +0 -31
  190. package/dist/slices/show-processor/index.d.ts +0 -3
  191. package/dist/slices/show-processor/index.js +0 -111
  192. package/dist/slices/show-readmodel/index.d.ts +0 -3
  193. package/dist/slices/show-readmodel/index.js +0 -158
  194. package/dist/slices/show-scenario/index.d.ts +0 -3
  195. package/dist/slices/show-scenario/index.js +0 -196
  196. package/dist/slices/show-screen/index.d.ts +0 -3
  197. package/dist/slices/show-screen/index.js +0 -139
  198. package/dist/slices/show-slice/index.d.ts +0 -3
  199. package/dist/slices/show-slice/index.js +0 -696
  200. package/dist/slices/update-field/index.d.ts +0 -15
  201. package/dist/slices/update-field/index.js +0 -208
  202. package/dist/slices/whoami/index.d.ts +0 -2
  203. package/dist/types.d.ts +0 -195
  204. package/dist/types.js +0 -1
@@ -1,9 +1,9 @@
1
1
  export const meta = {
2
2
  name: 'create-slices',
3
- description: 'Create state-change, automation, and state-view slices with fields and flows',
3
+ description: 'Understand slice types, fields, and how to build slices with flows',
4
4
  };
5
5
  export const content = `
6
- # Creating Slices
6
+ # Understanding Slices
7
7
 
8
8
  There are three slice types in an event model. Each represents a different pattern of data flow.
9
9
 
@@ -28,51 +28,47 @@ Use state-change slices when:
28
28
  - That action changes the state of an entity
29
29
  - Examples: "Place Order", "Cancel Subscription", "Update Profile", "Add Item to Cart"
30
30
 
31
- ### Command Syntax
31
+ ### Building a State-Change Slice
32
32
 
33
- \`\`\`bash
34
- eventmodeler create state-change-slice --xml '<state-change-slice name="Slice Name" [after="Other Slice"]>
35
- <screen name="Screen Name">
36
- <field name="fieldName" type="Type"/>
37
- </screen>
38
- <command name="CommandName">
39
- <field name="fieldName" type="Type"/>
40
- </command>
41
- <event name="EventName">
42
- <field name="fieldName" type="Type"/>
43
- </event>
44
- </state-change-slice>'
45
- \`\`\`
33
+ To build a state-change slice, you add the individual elements and connect them with flows:
34
+
35
+ 1. Add a screen, a command, and an event (using \`add field\` to define their fields)
36
+ 2. Create flows: Screen → Command, Command → Event
37
+ 3. Map the fields on each flow
46
38
 
47
39
  ### Example: Place Order Slice
48
40
 
41
+ First, add fields to each element:
49
42
  \`\`\`bash
50
- eventmodeler create state-change-slice --xml '<state-change-slice name="Place Order">
51
- <screen name="Checkout Screen">
52
- <field name="customerId" type="UUID"/>
53
- <field name="items" type="String" isUserInput="true"/>
54
- <field name="shippingAddress" type="String" isUserInput="true"/>
55
- </screen>
56
- <command name="PlaceOrder">
57
- <field name="customerId" type="UUID"/>
58
- <field name="items" type="String"/>
59
- <field name="shippingAddress" type="String"/>
60
- </command>
61
- <event name="OrderPlaced">
62
- <field name="orderId" type="UUID" isGenerated="true"/>
63
- <field name="customerId" type="UUID"/>
64
- <field name="items" type="String"/>
65
- <field name="shippingAddress" type="String"/>
66
- <field name="placedAt" type="DateTime" isGenerated="true"/>
67
- </event>
68
- </state-change-slice>'
43
+ eventmodeler add field "Checkout Screen" '{"name": "customerId", "type": "UUID"}'
44
+ eventmodeler add field "Checkout Screen" '{"name": "items", "type": "String", "isUserInput": true}'
45
+ eventmodeler add field "Checkout Screen" '{"name": "shippingAddress", "type": "String", "isUserInput": true}'
46
+
47
+ eventmodeler add field "PlaceOrder" '{"name": "customerId", "type": "UUID"}'
48
+ eventmodeler add field "PlaceOrder" '{"name": "items", "type": "String"}'
49
+ eventmodeler add field "PlaceOrder" '{"name": "shippingAddress", "type": "String"}'
50
+
51
+ eventmodeler add field "OrderPlaced" '{"name": "orderId", "type": "UUID", "isGenerated": true}'
52
+ eventmodeler add field "OrderPlaced" '{"name": "customerId", "type": "UUID"}'
53
+ eventmodeler add field "OrderPlaced" '{"name": "items", "type": "String"}'
54
+ eventmodeler add field "OrderPlaced" '{"name": "shippingAddress", "type": "String"}'
55
+ eventmodeler add field "OrderPlaced" '{"name": "placedAt", "type": "DateTime", "isGenerated": true}'
69
56
  \`\`\`
70
57
 
71
- ### Automatic Behavior
58
+ Then connect with flows:
59
+ \`\`\`bash
60
+ eventmodeler create flow --from "Checkout Screen" --to "PlaceOrder"
61
+ eventmodeler create flow --from "PlaceOrder" --to "OrderPlaced"
62
+ \`\`\`
72
63
 
73
- 1. **Positioning**: Places slice at end, or use \`after="Slice Name"\` or \`before="Slice Name"\`
74
- 2. **Field mappings**: Automatically inferred by matching field names between Screen → Command and Command → Event
75
- 3. **Flows**: Automatically creates Screen→Command and Command→Event flows
64
+ Then map fields on the flows:
65
+ \`\`\`bash
66
+ eventmodeler map fields --from "PlaceOrder" --to "OrderPlaced" '[
67
+ {"from": "customerId", "to": "customerId"},
68
+ {"from": "items", "to": "items"},
69
+ {"from": "shippingAddress", "to": "shippingAddress"}
70
+ ]'
71
+ \`\`\`
76
72
 
77
73
  ---
78
74
 
@@ -96,54 +92,37 @@ Use automation slices when:
96
92
  - No direct user interaction triggers the action
97
93
  - Examples: "Auto-assign Reviewer", "Send Reminder Email", "Calculate Shipping", "Process Payment"
98
94
 
99
- ### Command Syntax
95
+ ### Building an Automation Slice
100
96
 
101
- \`\`\`bash
102
- eventmodeler create automation-slice --xml '<automation-slice name="Slice Name" [after="Other Slice"]>
103
- <read-model name="ReadModelName">
104
- <field name="fieldName" type="Type"/>
105
- </read-model>
106
- <processor name="Processor Name"/>
107
- <command name="CommandName">
108
- <field name="fieldName" type="Type"/>
109
- </command>
110
- <event name="EventName">
111
- <field name="fieldName" type="Type"/>
112
- </event>
113
- </automation-slice>'
114
- \`\`\`
97
+ 1. Add a read model, processor, command, and event with their fields
98
+ 2. Create internal flows: ReadModel Processor, Processor → Command, Command → Event
99
+ 3. Connect external events to the read model with flows
115
100
 
116
101
  ### Example: Auto-Fulfill Order
117
102
 
118
103
  \`\`\`bash
119
- eventmodeler create automation-slice --xml '<automation-slice name="Auto Fulfill Order" after="Place Order">
120
- <read-model name="OrderReadyForFulfillment">
121
- <field name="orderId" type="UUID"/>
122
- <field name="isPaid" type="Boolean"/>
123
- <field name="shippingAddress" type="String"/>
124
- </read-model>
125
- <processor name="Order Fulfillment Processor"/>
126
- <command name="FulfillOrder">
127
- <field name="orderId" type="UUID"/>
128
- <field name="warehouseId" type="UUID" isGenerated="true"/>
129
- </command>
130
- <event name="OrderFulfilled">
131
- <field name="orderId" type="UUID"/>
132
- <field name="warehouseId" type="UUID"/>
133
- <field name="fulfilledAt" type="DateTime" isGenerated="true"/>
134
- </event>
135
- </automation-slice>'
136
- \`\`\`
104
+ eventmodeler add field "OrderReadyForFulfillment" '{"name": "orderId", "type": "UUID"}'
105
+ eventmodeler add field "OrderReadyForFulfillment" '{"name": "isPaid", "type": "Boolean"}'
106
+ eventmodeler add field "OrderReadyForFulfillment" '{"name": "shippingAddress", "type": "String"}'
137
107
 
138
- ### Automatic Behavior
108
+ eventmodeler add field "FulfillOrder" '{"name": "orderId", "type": "UUID"}'
109
+ eventmodeler add field "FulfillOrder" '{"name": "warehouseId", "type": "UUID", "isGenerated": true}'
110
+
111
+ eventmodeler add field "OrderFulfilled" '{"name": "orderId", "type": "UUID"}'
112
+ eventmodeler add field "OrderFulfilled" '{"name": "warehouseId", "type": "UUID"}'
113
+ eventmodeler add field "OrderFulfilled" '{"name": "fulfilledAt", "type": "DateTime", "isGenerated": true}'
114
+ \`\`\`
139
115
 
140
- 1. **Positioning**: Places slice at end, or use \`after="Slice Name"\` or \`before="Slice Name"\`
141
- 2. **Field mappings**: Automatically inferred by matching field names: ReadModel → Command, Command → Event
142
- 3. **Flows**: Automatically creates ReadModel Processor, Processor → Command, Command → Event
116
+ Connect internal flows:
117
+ \`\`\`bash
118
+ eventmodeler create flow --from "OrderReadyForFulfillment" --to "Order Fulfillment Processor"
119
+ eventmodeler create flow --from "Order Fulfillment Processor" --to "FulfillOrder"
120
+ eventmodeler create flow --from "FulfillOrder" --to "OrderFulfilled"
121
+ \`\`\`
143
122
 
144
123
  ### Connecting Trigger Events
145
124
 
146
- After creating the automation slice, connect external events to its read model:
125
+ Connect external events to the automation's read model:
147
126
 
148
127
  \`\`\`bash
149
128
  eventmodeler create flow --from "OrderPlaced" --to "OrderReadyForFulfillment"
@@ -157,7 +136,6 @@ eventmodeler create flow --from "PaymentReceived" --to "OrderReadyForFulfillment
157
136
  | Inside automation slice | Standalone slice |
158
137
  | Feeds a Processor | Feeds a Screen |
159
138
  | "What the processor needs" | "What the user sees" |
160
- | Created with automation-slice | Created with state-view-slice |
161
139
 
162
140
  ---
163
141
 
@@ -177,39 +155,31 @@ Use state-view slices when:
177
155
  - You want to aggregate data from multiple events
178
156
  - Examples: "Order Summary", "User Dashboard", "Inventory Levels", "Account Balance"
179
157
 
180
- ### Command Syntax
158
+ ### Building a State-View Slice
181
159
 
182
- \`\`\`bash
183
- eventmodeler create state-view-slice --xml '<state-view-slice name="Slice Name" [after="Other Slice"]>
184
- <read-model name="ReadModelName">
185
- <field name="fieldName" type="Type"/>
186
- </read-model>
187
- </state-view-slice>'
188
- \`\`\`
160
+ 1. Add the read model with its fields
161
+ 2. Create flows from events to the read model
162
+ 3. Map the fields on each flow
189
163
 
190
164
  ### Example: Order Summary View
191
165
 
192
166
  \`\`\`bash
193
- eventmodeler create state-view-slice --xml '<state-view-slice name="View Order Summary" after="Place Order">
194
- <read-model name="OrderSummary">
195
- <field name="orderId" type="UUID"/>
196
- <field name="customerId" type="UUID"/>
197
- <field name="customerName" type="String"/>
198
- <field name="status" type="String"/>
199
- <field name="totalAmount" type="Decimal"/>
200
- <field name="itemCount" type="Int"/>
201
- <field name="placedAt" type="DateTime"/>
202
- <field name="lastUpdatedAt" type="DateTime"/>
203
- </read-model>
204
- </state-view-slice>'
167
+ eventmodeler add field "OrderSummary" '{"name": "orderId", "type": "UUID"}'
168
+ eventmodeler add field "OrderSummary" '{"name": "customerId", "type": "UUID"}'
169
+ eventmodeler add field "OrderSummary" '{"name": "customerName", "type": "String"}'
170
+ eventmodeler add field "OrderSummary" '{"name": "status", "type": "String"}'
171
+ eventmodeler add field "OrderSummary" '{"name": "totalAmount", "type": "Decimal"}'
172
+ eventmodeler add field "OrderSummary" '{"name": "itemCount", "type": "Int"}'
173
+ eventmodeler add field "OrderSummary" '{"name": "placedAt", "type": "DateTime"}'
174
+ eventmodeler add field "OrderSummary" '{"name": "lastUpdatedAt", "type": "DateTime"}'
205
175
  \`\`\`
206
176
 
207
177
  ### Connecting Events After Creation
208
178
 
209
- The \`create state-view-slice\` command only creates the read model. To complete the picture:
179
+ To complete the picture:
210
180
 
211
181
  1. Create flows from events: \`eventmodeler create flow --from "EventName" --to "ReadModelName"\`
212
- 2. Map fields: \`eventmodeler map fields --flow "EventName→ReadModelName" --xml '...'\`
182
+ 2. Map fields: \`eventmodeler map fields --from "EventName" --to "ReadModelName" '[...]'\`
213
183
  3. Verify: \`eventmodeler show completeness "ReadModelName"\`
214
184
 
215
185
  ---
@@ -220,74 +190,74 @@ The \`create state-view-slice\` command only creates the read model. To complete
220
190
 
221
191
  ## Field Attributes
222
192
 
223
- - \`isOptional="true"\` - Field may not have a value
224
- - \`isGenerated="true"\` - System-generated (e.g., IDs, timestamps), not from user input
225
- - \`isUserInput="true"\` - Entered by the user on the screen
226
- - \`isList="true"\` - Field is a list/array of the specified type
193
+ - \`"isOptional": true\` - Field may not have a value
194
+ - \`"isGenerated": true\` - System-generated (e.g., IDs, timestamps), not from user input
195
+ - \`"isUserInput": true\` - Entered by the user on the screen
196
+ - \`"isList": true\` - Field is a list/array of the specified type
227
197
 
228
198
  ## Working with Lists and Custom Types
229
199
 
230
- **List of primitives** - use \`isList="true"\` with any valid type:
231
- \`\`\`xml
232
- <field name="tags" type="String" isList="true"/>
233
- <field name="quantities" type="Int" isList="true"/>
200
+ **List of primitives** - use \`"isList": true\` with any valid type:
201
+ \`\`\`json
202
+ {"name": "tags", "type": "String", "isList": true}
203
+ {"name": "quantities", "type": "Int", "isList": true}
234
204
  \`\`\`
235
205
 
236
206
  ### Custom Types (Nested Objects)
237
207
 
238
- **CRITICAL: Custom fields MUST contain subfields.** The \`type="Custom"\` indicates a nested object structure, and the nested \`<field>\` elements define its properties. A Custom field without subfields is invalid and creates an empty, useless type.
208
+ **CRITICAL: Custom fields MUST contain subfields.** The \`"type": "Custom"\` indicates a nested object structure, and the \`"subfields"\` array defines its properties. A Custom field without subfields is invalid and creates an empty, useless type.
239
209
 
240
210
  **Custom type with nested fields:**
241
- \`\`\`xml
242
- <field name="address" type="Custom">
243
- <field name="street" type="String"/>
244
- <field name="city" type="String"/>
245
- <field name="postalCode" type="String"/>
246
- </field>
211
+ \`\`\`json
212
+ {"name": "address", "type": "Custom", "subfields": [
213
+ {"name": "street", "type": "String"},
214
+ {"name": "city", "type": "String"},
215
+ {"name": "postalCode", "type": "String"}
216
+ ]}
247
217
  \`\`\`
248
218
 
249
- **List of custom objects** - combine \`type="Custom"\` with \`isList="true"\`:
250
- \`\`\`xml
251
- <field name="lineItems" type="Custom" isList="true">
252
- <field name="productId" type="UUID"/>
253
- <field name="quantity" type="Int"/>
254
- <field name="unitPrice" type="Decimal"/>
255
- </field>
219
+ **List of custom objects** - combine \`"type": "Custom"\` with \`"isList": true\`:
220
+ \`\`\`json
221
+ {"name": "lineItems", "type": "Custom", "isList": true, "subfields": [
222
+ {"name": "productId", "type": "UUID"},
223
+ {"name": "quantity", "type": "Int"},
224
+ {"name": "unitPrice", "type": "Decimal"}
225
+ ]}
256
226
  \`\`\`
257
227
 
258
228
  **Nested custom types** - subfields can themselves be Custom types:
259
- \`\`\`xml
260
- <field name="customer" type="Custom">
261
- <field name="customerId" type="UUID"/>
262
- <field name="name" type="String"/>
263
- <field name="billingAddress" type="Custom">
264
- <field name="street" type="String"/>
265
- <field name="city" type="String"/>
266
- <field name="country" type="String"/>
267
- </field>
268
- </field>
229
+ \`\`\`json
230
+ {"name": "customer", "type": "Custom", "subfields": [
231
+ {"name": "customerId", "type": "UUID"},
232
+ {"name": "name", "type": "String"},
233
+ {"name": "billingAddress", "type": "Custom", "subfields": [
234
+ {"name": "street", "type": "String"},
235
+ {"name": "city", "type": "String"},
236
+ {"name": "country", "type": "String"}
237
+ ]}
238
+ ]}
269
239
  \`\`\`
270
240
 
271
241
  ## Common Mistakes
272
242
 
273
243
  - **Creating empty Custom fields**: Custom fields MUST have subfields that define their structure.
274
- - Wrong: \`<field name="address" type="Custom"/>\`
275
- - Right: \`<field name="address" type="Custom"><field name="street" type="String"/>...</field>\`
244
+ - Wrong: \`{"name": "address", "type": "Custom"}\`
245
+ - Right: \`{"name": "address", "type": "Custom", "subfields": [{"name": "street", "type": "String"}, ...]}\`
276
246
 
277
- - **Using "List" as a field type**: "List" is not a valid type. Use \`isList="true"\` with a valid type instead.
278
- - Wrong: \`<field name="items" type="List"/>\`
279
- - Right: \`<field name="items" type="String" isList="true"/>\`
247
+ - **Using "List" as a field type**: "List" is not a valid type. Use \`"isList": true\` with a valid type instead.
248
+ - Wrong: \`{"name": "items", "type": "List"}\`
249
+ - Right: \`{"name": "items", "type": "String", "isList": true}\`
280
250
 
281
251
  - **Using wrong attribute names**: Always use camelCase attributes.
282
- - Wrong: \`optional="true"\`, \`generated="true"\`, \`list="true"\`, \`user-input="true"\`
283
- - Right: \`isOptional="true"\`, \`isGenerated="true"\`, \`isList="true"\`, \`isUserInput="true"\`
252
+ - Wrong: \`"optional": true\`, \`"generated": true\`, \`"list": true\`, \`"user-input": true\`
253
+ - Right: \`"isOptional": true\`, \`"isGenerated": true\`, \`"isList": true\`, \`"isUserInput": true\`
284
254
 
285
255
  ## Workflow
286
256
 
287
257
  1. **Understand the action** - What is the user/system trying to do?
288
258
  2. **Design the fields** - What information flows through this slice?
289
259
  3. **Propose before creating** - Get approval on the design first
290
- 4. **Create the slice** - Run the command
260
+ 4. **Create the elements and flows** - Add fields and connect with flows
291
261
  5. **Verify** - \`eventmodeler show slice "<name>"\`
292
262
  6. **Connect** - Create flows to/from other slices as needed
293
263
 
@@ -44,7 +44,7 @@ eventmodeler list aggregates # All aggregates (event groupings)
44
44
  eventmodeler list actors # All actors (user/system roles)
45
45
  \`\`\`
46
46
 
47
- All \`list\` commands support \`--format xml|json\`.
47
+ All \`list\` commands output JSON.
48
48
 
49
49
  ## Searching
50
50
 
@@ -59,9 +59,9 @@ Searches across all entity names: slices, events, commands, read models, aggrega
59
59
  \`\`\`bash
60
60
  eventmodeler show slice "<name>"
61
61
  \`\`\`
62
- Returns XML with:
62
+ Returns JSON with:
63
63
  - All components in the slice (screens, commands, events, read-models, processors)
64
- - **Inline flow annotations** on each component showing \`<flows-from>\` and \`<flows-to>\` connections
64
+ - **Flow annotations** on each component showing incoming and outgoing connections
65
65
  - Fields on each component with types and attributes
66
66
  - Information flow (which components connect to which)
67
67
  - **Inbound flows**: External elements flowing INTO this slice (with field mappings)
@@ -79,28 +79,39 @@ The inbound/outbound flows show cross-slice dependencies - crucial for understan
79
79
  - A read model assertion (expected state)
80
80
 
81
81
  Example scenario in slice output:
82
- \`\`\`xml
83
- <scenarios>
84
- <scenario name="Successfully place order">
85
- <given>
86
- <event type="CustomerRegistered">customerId: "123"</event>
87
- </given>
88
- <when>
89
- <command type="PlaceOrder">customerId: "123", items: [...]</command>
90
- </when>
91
- <then>
92
- <event type="OrderPlaced">orderId: "456", customerId: "123"</event>
93
- </then>
94
- </scenario>
95
- <scenario name="Cannot place order without items">
96
- <when>
97
- <command type="PlaceOrder">customerId: "123", items: []</command>
98
- </when>
99
- <then>
100
- <error type="ValidationError">Order must contain at least one item</error>
101
- </then>
102
- </scenario>
103
- </scenarios>
82
+ \`\`\`json
83
+ {
84
+ "scenarios": [
85
+ {
86
+ "name": "Successfully place order",
87
+ "given": [
88
+ { "event": "CustomerRegistered", "fieldValues": { "customerId": "123" } }
89
+ ],
90
+ "when": {
91
+ "command": "PlaceOrder",
92
+ "commandFieldValues": { "customerId": "123", "items": ["..."] }
93
+ },
94
+ "then": {
95
+ "type": "events",
96
+ "events": [
97
+ { "event": "OrderPlaced", "fieldValues": { "orderId": "456", "customerId": "123" } }
98
+ ]
99
+ }
100
+ },
101
+ {
102
+ "name": "Cannot place order without items",
103
+ "when": {
104
+ "command": "PlaceOrder",
105
+ "commandFieldValues": { "customerId": "123", "items": [] }
106
+ },
107
+ "then": {
108
+ "type": "error",
109
+ "errorType": "ValidationError",
110
+ "errorMessage": "Order must contain at least one item"
111
+ }
112
+ }
113
+ ]
114
+ }
104
115
  \`\`\`
105
116
 
106
117
  Reading scenarios helps understand:
@@ -114,7 +125,7 @@ Reading scenarios helps understand:
114
125
  eventmodeler show event "<name>"
115
126
  eventmodeler show command "<name>"
116
127
  \`\`\`
117
- Returns XML with the element's fields and connections.
128
+ Returns JSON with the element's fields and connections.
118
129
 
119
130
  ### Show Read Models, Screens, and Processors
120
131
  \`\`\`bash