create-auto-app 0.3.0 → 0.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +197 -0
- package/package.json +2 -3
- package/templates/shopping-app/.context/schema.json +426 -215
- package/templates/shopping-app/.context/server/.context/auto-ia-scheme.json +79 -0
- package/templates/shopping-app/.context/server/server/package.json +1 -1
- package/templates/shopping-app/.context/server/server/scripts/generate-schema.ts +1 -1
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/decide.specs.ts +1 -1
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session/react.specs.ts +51 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session/react.ts +43 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session/register.ts +24 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session-/react.specs.ts +1 -1
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/decide.specs.ts +1 -1
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/commands.ts +8 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/decide.specs.ts +101 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/decide.ts +42 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/events.ts +9 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/evolve.ts +28 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/handle.ts +52 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/mutation.resolver.ts +25 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/register.ts +7 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/state.ts +47 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/decide.specs.ts +41 -1
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/decide.ts +9 -1
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/handle.ts +4 -1
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/views-suggested-items/projection.specs.ts +3 -41
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/views-suggested-items/projection.ts +2 -15
- package/templates/shopping-app/auto.config.ts +20 -20
- package/templates/shopping-app/client/package.json +4 -4
- package/templates/shopping-app/example-integrations/ai-chat-completion/package.json +5 -6
- package/templates/shopping-app/example-integrations/ai-chat-completion/src/ai-integration.ts +2 -2
- package/templates/shopping-app/example-integrations/cart/package.json +5 -6
- package/templates/shopping-app/example-integrations/cart-api/package.json +3 -3
- package/templates/shopping-app/example-integrations/product-catalogue/package.json +5 -5
- package/templates/shopping-app/example-integrations/product-catalogue/src/product-catalogue-integration.ts +0 -132
- package/templates/shopping-app/example-integrations/product-catalogue-api/package.json +3 -3
- package/templates/shopping-app/flows/shopping-assistant.flow.ts +195 -195
- package/templates/shopping-app/package.json +6 -2
- package/templates/shopping-app/server/package.json +5 -4
- package/templates/shopping-app/server/src/integrations/ai-integration.ts +2 -2
- package/templates/shopping-app/server/src/integrations/index.ts +1 -1
- package/templates/shopping-app/server/src/integrations/product-catalogue/generated/product-catalog/client/client.gen.ts +199 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue/generated/product-catalog/client/index.ts +25 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue/generated/product-catalog/client/types.gen.ts +232 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue/generated/product-catalog/client/utils.gen.ts +419 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue/generated/product-catalog/client.gen.ts +18 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue/generated/product-catalog/core/auth.gen.ts +42 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue/generated/product-catalog/core/bodySerializer.gen.ts +92 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue/generated/product-catalog/core/params.gen.ts +153 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue/generated/product-catalog/core/pathSerializer.gen.ts +181 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue/generated/product-catalog/core/types.gen.ts +120 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue/generated/product-catalog/index.ts +2 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue/generated/product-catalog/types.gen.ts +133 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue/generated/product-catalog/zod.gen.ts +62 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue/index.ts +1 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue/product-catalogue-integration.ts +232 -0
- package/templates/shopping-app/tsconfig.json +2 -2
- package/templates/shopping-app/server/src/integrations/product-catalogue-integration.ts +0 -363
|
@@ -34,60 +34,78 @@
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
],
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
37
|
+
"specs": {
|
|
38
|
+
"name": "When shopper submits criteria, a shopping session is started",
|
|
39
|
+
"rules": [
|
|
40
|
+
{
|
|
41
|
+
"description": "Valid criteria should start a shopping session",
|
|
42
|
+
"examples": [
|
|
43
|
+
{
|
|
44
|
+
"description": "User submits shopping criteria for children",
|
|
45
|
+
"when": {
|
|
46
|
+
"commandRef": "EnterShoppingCriteria",
|
|
47
|
+
"exampleData": {
|
|
48
|
+
"sessionId": "shopper-123",
|
|
49
|
+
"criteria": "I need back-to-school items for my 7-year-old daughter who loves soccer and crafts, and my 12-year-old son who is into computers and Magic the Gathering."
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"then": [
|
|
53
|
+
{
|
|
54
|
+
"eventRef": "ShoppingCriteriaEntered",
|
|
55
|
+
"exampleData": {
|
|
56
|
+
"sessionId": "shopper-123",
|
|
57
|
+
"criteria": "I need back-to-school items for my 7-year-old daughter who loves soccer and crafts, and my 12-year-old son who is into computers and Magic the Gathering.",
|
|
58
|
+
"timestamp": "2025-09-04T21:20:20.309Z"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
]
|
|
53
62
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
58
67
|
}
|
|
59
68
|
},
|
|
60
69
|
{
|
|
61
|
-
"name": "creates a chat session
|
|
70
|
+
"name": "creates a chat session",
|
|
62
71
|
"type": "react",
|
|
63
72
|
"server": {
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
"specs": {
|
|
74
|
+
"name": "When shopping criteria are entered, request wishlist creation",
|
|
75
|
+
"rules": [
|
|
76
|
+
{
|
|
77
|
+
"description": "Shopping criteria should trigger item suggestion",
|
|
78
|
+
"examples": [
|
|
79
|
+
{
|
|
80
|
+
"description": "Criteria entered triggers wishlist creation",
|
|
81
|
+
"when": [
|
|
82
|
+
{
|
|
83
|
+
"eventRef": "ShoppingCriteriaEntered",
|
|
84
|
+
"exampleData": {
|
|
85
|
+
"sessionId": "session-abc",
|
|
86
|
+
"criteria": "I need back-to-school items for my 7-year-old daughter who loves soccer and crafts, and my 12-year-old son who is into computers and Magic the Gathering.",
|
|
87
|
+
"timestamp": "2025-09-04T21:20:20.309Z"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"then": [
|
|
92
|
+
{
|
|
93
|
+
"commandRef": "SuggestShoppingItems",
|
|
94
|
+
"exampleData": {
|
|
95
|
+
"sessionId": "session-abc",
|
|
96
|
+
"prompt": "I need back-to-school items for my 7-year-old daughter who loves soccer and crafts, and my 12-year-old son who is into computers and Magic the Gathering."
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
]
|
|
82
100
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
87
105
|
}
|
|
88
106
|
},
|
|
89
107
|
{
|
|
90
|
-
"name": "selects items relevant to the shopping criteria
|
|
108
|
+
"name": "selects items relevant to the shopping criteria",
|
|
91
109
|
"type": "command",
|
|
92
110
|
"client": {
|
|
93
111
|
"description": "",
|
|
@@ -132,51 +150,101 @@
|
|
|
132
150
|
}
|
|
133
151
|
}
|
|
134
152
|
],
|
|
135
|
-
"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
"then": [
|
|
145
|
-
{
|
|
146
|
-
"eventRef": "ShoppingItemsSuggested",
|
|
147
|
-
"exampleData": {
|
|
148
|
-
"sessionId": "session-abc",
|
|
149
|
-
"suggestedItems": [
|
|
150
|
-
{
|
|
151
|
-
"productId": "prod-soccer-ball",
|
|
152
|
-
"name": "Super Soccer Ball",
|
|
153
|
-
"quantity": 1,
|
|
154
|
-
"reason": "Perfect for your daughter who loves soccer"
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
"productId": "prod-craft-kit",
|
|
158
|
-
"name": "Deluxe Craft Kit",
|
|
159
|
-
"quantity": 1,
|
|
160
|
-
"reason": "Great for creative activities and crafts"
|
|
161
|
-
},
|
|
153
|
+
"specs": {
|
|
154
|
+
"name": "When chat is triggered, AI suggests items based on product catalog",
|
|
155
|
+
"rules": [
|
|
156
|
+
{
|
|
157
|
+
"description": "AI should suggest relevant items from available products",
|
|
158
|
+
"examples": [
|
|
159
|
+
{
|
|
160
|
+
"description": "Product catalog with matching items generates suggestions",
|
|
161
|
+
"given": [
|
|
162
162
|
{
|
|
163
|
-
"
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
"exampleData": {
|
|
164
|
+
"products": [
|
|
165
|
+
{
|
|
166
|
+
"productId": "prod-soccer-ball",
|
|
167
|
+
"name": "Super Soccer Ball",
|
|
168
|
+
"category": "Sports",
|
|
169
|
+
"price": 10,
|
|
170
|
+
"tags": ["soccer", "sports"],
|
|
171
|
+
"imageUrl": "https://example.com/soccer-ball.jpg"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"productId": "prod-craft-kit",
|
|
175
|
+
"name": "Deluxe Craft Kit",
|
|
176
|
+
"category": "Arts & Crafts",
|
|
177
|
+
"price": 25,
|
|
178
|
+
"tags": ["crafts", "art", "creative"],
|
|
179
|
+
"imageUrl": "https://example.com/craft-kit.jpg"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"productId": "prod-laptop-bag",
|
|
183
|
+
"name": "Tech Laptop Backpack",
|
|
184
|
+
"category": "School Supplies",
|
|
185
|
+
"price": 45,
|
|
186
|
+
"tags": ["computers", "tech", "school"],
|
|
187
|
+
"imageUrl": "https://example.com/laptop-bag.jpg"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"productId": "prod-mtg-starter",
|
|
191
|
+
"name": "Magic the Gathering Starter Set",
|
|
192
|
+
"category": "Games",
|
|
193
|
+
"price": 30,
|
|
194
|
+
"tags": ["magic", "tcg", "games"],
|
|
195
|
+
"imageUrl": "https://example.com/mtg-starter.jpg"
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
"stateRef": "Products"
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
"when": {
|
|
203
|
+
"commandRef": "SuggestShoppingItems",
|
|
204
|
+
"exampleData": {
|
|
205
|
+
"sessionId": "session-abc",
|
|
206
|
+
"prompt": "I need back-to-school items for my 7-year-old daughter who loves soccer and crafts, and my 12-year-old son who is into computers and Magic the Gathering."
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"then": [
|
|
168
210
|
{
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
|
|
172
|
-
|
|
211
|
+
"eventRef": "ShoppingItemsSuggested",
|
|
212
|
+
"exampleData": {
|
|
213
|
+
"sessionId": "session-abc",
|
|
214
|
+
"suggestedItems": [
|
|
215
|
+
{
|
|
216
|
+
"productId": "prod-soccer-ball",
|
|
217
|
+
"name": "Super Soccer Ball",
|
|
218
|
+
"quantity": 1,
|
|
219
|
+
"reason": "Perfect for your daughter who loves soccer"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"productId": "prod-craft-kit",
|
|
223
|
+
"name": "Deluxe Craft Kit",
|
|
224
|
+
"quantity": 1,
|
|
225
|
+
"reason": "Great for creative activities and crafts"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"productId": "prod-laptop-bag",
|
|
229
|
+
"name": "Tech Laptop Backpack",
|
|
230
|
+
"quantity": 1,
|
|
231
|
+
"reason": "Essential for your son's school computer needs"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"productId": "prod-mtg-starter",
|
|
235
|
+
"name": "Magic the Gathering Starter Set",
|
|
236
|
+
"quantity": 1,
|
|
237
|
+
"reason": "Ideal starter set for Magic the Gathering enthusiasts"
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
}
|
|
173
241
|
}
|
|
174
242
|
]
|
|
175
243
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
}
|
|
180
248
|
}
|
|
181
249
|
},
|
|
182
250
|
{
|
|
@@ -208,78 +276,85 @@
|
|
|
208
276
|
}
|
|
209
277
|
}
|
|
210
278
|
],
|
|
211
|
-
"
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
"
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
"
|
|
222
|
-
"
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
{
|
|
249
|
-
"stateRef": "SuggestedItems",
|
|
250
|
-
"exampleData": {
|
|
251
|
-
"sessionId": "session-abc",
|
|
252
|
-
"items": [
|
|
253
|
-
{
|
|
254
|
-
"productId": "prod-soccer-ball",
|
|
255
|
-
"name": "Super Soccer Ball",
|
|
256
|
-
"quantity": 1,
|
|
257
|
-
"reason": "Perfect for your daughter who loves soccer"
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
"productId": "prod-craft-kit",
|
|
261
|
-
"name": "Deluxe Craft Kit",
|
|
262
|
-
"quantity": 1,
|
|
263
|
-
"reason": "Great for creative activities and crafts"
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
"productId": "prod-laptop-bag",
|
|
267
|
-
"name": "Tech Laptop Backpack",
|
|
268
|
-
"quantity": 1,
|
|
269
|
-
"reason": "Essential for your son's school computer needs"
|
|
279
|
+
"specs": {
|
|
280
|
+
"name": "Suggested items are available for viewing",
|
|
281
|
+
"rules": [
|
|
282
|
+
{
|
|
283
|
+
"description": "Items should be available for viewing after suggestion",
|
|
284
|
+
"examples": [
|
|
285
|
+
{
|
|
286
|
+
"description": "Item becomes available after AI suggestion event",
|
|
287
|
+
"when": {
|
|
288
|
+
"exampleData": {
|
|
289
|
+
"sessionId": "session-abc",
|
|
290
|
+
"suggestedItems": [
|
|
291
|
+
{
|
|
292
|
+
"productId": "prod-soccer-ball",
|
|
293
|
+
"name": "Super Soccer Ball",
|
|
294
|
+
"quantity": 1,
|
|
295
|
+
"reason": "Perfect for your daughter who loves soccer"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"productId": "prod-craft-kit",
|
|
299
|
+
"name": "Deluxe Craft Kit",
|
|
300
|
+
"quantity": 1,
|
|
301
|
+
"reason": "Great for creative activities and crafts"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"productId": "prod-laptop-bag",
|
|
305
|
+
"name": "Tech Laptop Backpack",
|
|
306
|
+
"quantity": 1,
|
|
307
|
+
"reason": "Essential for your son's school computer needs"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"productId": "prod-mtg-starter",
|
|
311
|
+
"name": "Magic the Gathering Starter Set",
|
|
312
|
+
"quantity": 1,
|
|
313
|
+
"reason": "Ideal starter set for Magic the Gathering enthusiasts"
|
|
314
|
+
}
|
|
315
|
+
]
|
|
270
316
|
},
|
|
317
|
+
"eventRef": "ShoppingItemsSuggested"
|
|
318
|
+
},
|
|
319
|
+
"then": [
|
|
271
320
|
{
|
|
272
|
-
"
|
|
273
|
-
"
|
|
274
|
-
|
|
275
|
-
|
|
321
|
+
"stateRef": "SuggestedItems",
|
|
322
|
+
"exampleData": {
|
|
323
|
+
"sessionId": "session-abc",
|
|
324
|
+
"items": [
|
|
325
|
+
{
|
|
326
|
+
"productId": "prod-soccer-ball",
|
|
327
|
+
"name": "Super Soccer Ball",
|
|
328
|
+
"quantity": 1,
|
|
329
|
+
"reason": "Perfect for your daughter who loves soccer"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"productId": "prod-craft-kit",
|
|
333
|
+
"name": "Deluxe Craft Kit",
|
|
334
|
+
"quantity": 1,
|
|
335
|
+
"reason": "Great for creative activities and crafts"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"productId": "prod-laptop-bag",
|
|
339
|
+
"name": "Tech Laptop Backpack",
|
|
340
|
+
"quantity": 1,
|
|
341
|
+
"reason": "Essential for your son's school computer needs"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"productId": "prod-mtg-starter",
|
|
345
|
+
"name": "Magic the Gathering Starter Set",
|
|
346
|
+
"quantity": 1,
|
|
347
|
+
"reason": "Ideal starter set for Magic the Gathering enthusiasts"
|
|
348
|
+
}
|
|
349
|
+
]
|
|
350
|
+
}
|
|
276
351
|
}
|
|
277
352
|
]
|
|
278
353
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
354
|
+
]
|
|
355
|
+
}
|
|
356
|
+
]
|
|
357
|
+
}
|
|
283
358
|
}
|
|
284
359
|
},
|
|
285
360
|
{
|
|
@@ -308,67 +383,206 @@
|
|
|
308
383
|
}
|
|
309
384
|
}
|
|
310
385
|
],
|
|
311
|
-
"
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
"
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
"
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
386
|
+
"specs": {
|
|
387
|
+
"name": "When shopper accepts items, they are added to cart",
|
|
388
|
+
"rules": [
|
|
389
|
+
{
|
|
390
|
+
"description": "Accepted items should be added to the shopping cart",
|
|
391
|
+
"examples": [
|
|
392
|
+
{
|
|
393
|
+
"description": "User selects all suggested items for cart",
|
|
394
|
+
"when": {
|
|
395
|
+
"commandRef": "AddItemsToCart",
|
|
396
|
+
"exampleData": {
|
|
397
|
+
"sessionId": "session-abc",
|
|
398
|
+
"items": [
|
|
399
|
+
{
|
|
400
|
+
"productId": "prod-soccer-ball",
|
|
401
|
+
"quantity": 1
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"productId": "prod-craft-kit",
|
|
405
|
+
"quantity": 1
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"productId": "prod-laptop-bag",
|
|
409
|
+
"quantity": 1
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"productId": "prod-mtg-starter",
|
|
413
|
+
"quantity": 1
|
|
414
|
+
}
|
|
415
|
+
]
|
|
416
|
+
}
|
|
329
417
|
},
|
|
330
|
-
|
|
331
|
-
"productId": "prod-mtg-starter",
|
|
332
|
-
"quantity": 1
|
|
333
|
-
}
|
|
334
|
-
]
|
|
335
|
-
}
|
|
336
|
-
},
|
|
337
|
-
"then": [
|
|
338
|
-
{
|
|
339
|
-
"eventRef": "ItemsAddedToCart",
|
|
340
|
-
"exampleData": {
|
|
341
|
-
"sessionId": "session-abc",
|
|
342
|
-
"items": [
|
|
343
|
-
{
|
|
344
|
-
"productId": "prod-soccer-ball",
|
|
345
|
-
"quantity": 1
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
"productId": "prod-craft-kit",
|
|
349
|
-
"quantity": 1
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
"productId": "prod-laptop-bag",
|
|
353
|
-
"quantity": 1
|
|
354
|
-
},
|
|
418
|
+
"then": [
|
|
355
419
|
{
|
|
356
|
-
"
|
|
357
|
-
"
|
|
420
|
+
"eventRef": "ItemsAddedToCart",
|
|
421
|
+
"exampleData": {
|
|
422
|
+
"sessionId": "session-abc",
|
|
423
|
+
"items": [
|
|
424
|
+
{
|
|
425
|
+
"productId": "prod-soccer-ball",
|
|
426
|
+
"quantity": 1
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"productId": "prod-craft-kit",
|
|
430
|
+
"quantity": 1
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"productId": "prod-laptop-bag",
|
|
434
|
+
"quantity": 1
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"productId": "prod-mtg-starter",
|
|
438
|
+
"quantity": 1
|
|
439
|
+
}
|
|
440
|
+
],
|
|
441
|
+
"timestamp": "2025-09-04T21:20:20.310Z"
|
|
442
|
+
}
|
|
358
443
|
}
|
|
359
|
-
]
|
|
360
|
-
"timestamp": "2025-09-02T01:16:53.988Z"
|
|
444
|
+
]
|
|
361
445
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
446
|
+
]
|
|
447
|
+
}
|
|
448
|
+
]
|
|
449
|
+
}
|
|
366
450
|
}
|
|
367
451
|
}
|
|
368
|
-
]
|
|
452
|
+
],
|
|
453
|
+
"sourceFile": "/Users/ramihatoum/WebstormProjects/xolvio/auto-engineer/examples/shopping-app/flows/shopping-assistant.flow.ts"
|
|
369
454
|
}
|
|
370
455
|
],
|
|
371
456
|
"messages": [
|
|
457
|
+
{
|
|
458
|
+
"type": "command",
|
|
459
|
+
"name": "DoChat",
|
|
460
|
+
"fields": [
|
|
461
|
+
{
|
|
462
|
+
"name": "sessionId",
|
|
463
|
+
"type": "string",
|
|
464
|
+
"required": true
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
"name": "prompt",
|
|
468
|
+
"type": "string",
|
|
469
|
+
"required": true
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"name": "systemPrompt",
|
|
473
|
+
"type": "string",
|
|
474
|
+
"required": false
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"name": "schemaName",
|
|
478
|
+
"type": "string",
|
|
479
|
+
"required": true
|
|
480
|
+
}
|
|
481
|
+
],
|
|
482
|
+
"metadata": {
|
|
483
|
+
"version": 1
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"type": "command",
|
|
488
|
+
"name": "AddToCart",
|
|
489
|
+
"fields": [
|
|
490
|
+
{
|
|
491
|
+
"name": "sessionId",
|
|
492
|
+
"type": "string",
|
|
493
|
+
"required": true
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"name": "productId",
|
|
497
|
+
"type": "string",
|
|
498
|
+
"required": true
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
"name": "name",
|
|
502
|
+
"type": "string",
|
|
503
|
+
"required": true
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"name": "price",
|
|
507
|
+
"type": "number",
|
|
508
|
+
"required": true
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"name": "quantity",
|
|
512
|
+
"type": "number",
|
|
513
|
+
"required": true
|
|
514
|
+
}
|
|
515
|
+
],
|
|
516
|
+
"metadata": {
|
|
517
|
+
"version": 1
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"type": "command",
|
|
522
|
+
"name": "RemoveFromCart",
|
|
523
|
+
"fields": [
|
|
524
|
+
{
|
|
525
|
+
"name": "sessionId",
|
|
526
|
+
"type": "string",
|
|
527
|
+
"required": true
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"name": "productId",
|
|
531
|
+
"type": "string",
|
|
532
|
+
"required": true
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"name": "quantity",
|
|
536
|
+
"type": "number",
|
|
537
|
+
"required": false
|
|
538
|
+
}
|
|
539
|
+
],
|
|
540
|
+
"metadata": {
|
|
541
|
+
"version": 1
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"type": "command",
|
|
546
|
+
"name": "ClearCart",
|
|
547
|
+
"fields": [
|
|
548
|
+
{
|
|
549
|
+
"name": "sessionId",
|
|
550
|
+
"type": "string",
|
|
551
|
+
"required": true
|
|
552
|
+
}
|
|
553
|
+
],
|
|
554
|
+
"metadata": {
|
|
555
|
+
"version": 1
|
|
556
|
+
}
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
"type": "state",
|
|
560
|
+
"name": "Cart",
|
|
561
|
+
"fields": [
|
|
562
|
+
{
|
|
563
|
+
"name": "sessionId",
|
|
564
|
+
"type": "string",
|
|
565
|
+
"required": true
|
|
566
|
+
}
|
|
567
|
+
],
|
|
568
|
+
"metadata": {
|
|
569
|
+
"version": 1
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"type": "state",
|
|
574
|
+
"name": "Products",
|
|
575
|
+
"fields": [
|
|
576
|
+
{
|
|
577
|
+
"name": "products",
|
|
578
|
+
"type": "Array<{ productId: string; name: string; category: string; price: number; tags: Array<string>; imageUrl: string }>",
|
|
579
|
+
"required": true
|
|
580
|
+
}
|
|
581
|
+
],
|
|
582
|
+
"metadata": {
|
|
583
|
+
"version": 1
|
|
584
|
+
}
|
|
585
|
+
},
|
|
372
586
|
{
|
|
373
587
|
"type": "command",
|
|
374
588
|
"name": "EnterShoppingCriteria",
|
|
@@ -443,7 +657,7 @@
|
|
|
443
657
|
},
|
|
444
658
|
{
|
|
445
659
|
"name": "suggestedItems",
|
|
446
|
-
"type": "Array<{productId: string
|
|
660
|
+
"type": "Array<{ productId: string; name: string; quantity: number; reason: string }>",
|
|
447
661
|
"required": true
|
|
448
662
|
}
|
|
449
663
|
],
|
|
@@ -452,14 +666,6 @@
|
|
|
452
666
|
"version": 1
|
|
453
667
|
}
|
|
454
668
|
},
|
|
455
|
-
{
|
|
456
|
-
"type": "command",
|
|
457
|
-
"name": "DoChat",
|
|
458
|
-
"fields": [],
|
|
459
|
-
"metadata": {
|
|
460
|
-
"version": 1
|
|
461
|
-
}
|
|
462
|
-
},
|
|
463
669
|
{
|
|
464
670
|
"type": "state",
|
|
465
671
|
"name": "SuggestedItems",
|
|
@@ -471,7 +677,7 @@
|
|
|
471
677
|
},
|
|
472
678
|
{
|
|
473
679
|
"name": "items",
|
|
474
|
-
"type": "Array<{productId: string
|
|
680
|
+
"type": "Array<{ productId: string; name: string; quantity: number; reason: string }>",
|
|
475
681
|
"required": true
|
|
476
682
|
}
|
|
477
683
|
],
|
|
@@ -490,7 +696,7 @@
|
|
|
490
696
|
},
|
|
491
697
|
{
|
|
492
698
|
"name": "items",
|
|
493
|
-
"type": "Array<{productId: string
|
|
699
|
+
"type": "Array<{ productId: string; quantity: number }>",
|
|
494
700
|
"required": true
|
|
495
701
|
}
|
|
496
702
|
],
|
|
@@ -509,7 +715,7 @@
|
|
|
509
715
|
},
|
|
510
716
|
{
|
|
511
717
|
"name": "items",
|
|
512
|
-
"type": "Array<{productId: string
|
|
718
|
+
"type": "Array<{ productId: string; quantity: number }>",
|
|
513
719
|
"required": true
|
|
514
720
|
},
|
|
515
721
|
{
|
|
@@ -534,6 +740,11 @@
|
|
|
534
740
|
"name": "product-catalog",
|
|
535
741
|
"description": "product-catalog integration",
|
|
536
742
|
"source": "@auto-engineer/product-catalog-integration"
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
"name": "cart",
|
|
746
|
+
"description": "cart integration",
|
|
747
|
+
"source": "@auto-engineer/cart-integration"
|
|
537
748
|
}
|
|
538
749
|
]
|
|
539
750
|
}
|