create-auto-app 0.8.4 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/templates/shopping-app/.context/schema.graphql +4 -4
- package/templates/shopping-app/.context/schema.json +54 -62
- package/templates/shopping-app/.context/server/server/package.json +1 -2
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/decide.specs.ts +0 -1
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/events.ts +0 -1
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session/react.specs.ts +0 -1
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/decide.specs.ts +0 -1
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/events.ts +0 -1
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/decide.ts +1 -1
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/handle.ts +2 -2
- package/templates/shopping-app/auto.config.ts +19 -11
- package/templates/shopping-app/example-integrations/ai-chat-completion/package.json +1 -2
- package/templates/shopping-app/example-integrations/cart/package.json +1 -2
- package/templates/shopping-app/example-integrations/cart-api/package.json +1 -2
- package/templates/shopping-app/example-integrations/product-catalogue/package.json +1 -2
- package/templates/shopping-app/example-integrations/product-catalogue-api/package.json +1 -2
- package/templates/shopping-app/flows/shopping-assistant.flow.ts +80 -97
- package/templates/shopping-app/package.json +4 -2
- package/templates/shopping-app/server/package.json +2 -1
- package/templates/shopping-app/server/scripts/generate-schema.ts +1 -1
- 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 +211 -0
- package/templates/shopping-app/tsconfig.json +3 -1
- package/templates/shopping-app/turbo.json +19 -0
- package/templates/shopping-app/client/postcss.config.js +0 -6
- package/templates/shopping-app/server/src/integrations/product-catalogue-integration.ts +0 -363
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-auto-app",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.6",
|
|
4
4
|
"description": "Create Auto Engineer apps with no configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"node": ">=18.0.0"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
|
-
"copy-templates": "rm -rf templates/shopping-app && rsync -
|
|
42
|
+
"copy-templates": "rm -rf templates/shopping-app && rsync -a --exclude='node_modules' --exclude='.turbo' --exclude='dist' --exclude='build' --exclude='**/*.js' --exclude='**/*.js.map' ../../examples/shopping-app/ templates/shopping-app/",
|
|
43
43
|
"build": "npm run copy-templates && tsc && chmod +x dist/index.js",
|
|
44
44
|
"type-check": "tsc --noEmit",
|
|
45
45
|
"lint": "eslint 'src/**/*.ts' --max-warnings 0 --config ../../eslint.config.ts --ignore-pattern 'templates/**'",
|
|
@@ -30,9 +30,9 @@ type MutationError {
|
|
|
30
30
|
message: String
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
input
|
|
33
|
+
input AddItemsToCartInput {
|
|
34
34
|
sessionId: String!
|
|
35
|
-
|
|
35
|
+
items: String!
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
input EnterShoppingCriteriaInput {
|
|
@@ -40,7 +40,7 @@ input EnterShoppingCriteriaInput {
|
|
|
40
40
|
criteria: String!
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
input
|
|
43
|
+
input SuggestShoppingItemsInput {
|
|
44
44
|
sessionId: String!
|
|
45
|
-
|
|
45
|
+
prompt: String!
|
|
46
46
|
}
|
|
@@ -9,15 +9,17 @@
|
|
|
9
9
|
"type": "command",
|
|
10
10
|
"client": {
|
|
11
11
|
"description": "",
|
|
12
|
-
"specs":
|
|
13
|
-
"Assistant Chat Interface",
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
"specs": {
|
|
13
|
+
"name": "Assistant Chat Interface",
|
|
14
|
+
"rules": [
|
|
15
|
+
"allow shopper to describe their shopping needs in natural language",
|
|
16
|
+
"provide a text input for entering criteria",
|
|
17
|
+
"show examples of what to include (age, interests, budget)",
|
|
18
|
+
"show a button to submit the criteria",
|
|
19
|
+
"generate a persisted session id for a visit",
|
|
20
|
+
"show the header on top of the page"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
21
23
|
},
|
|
22
24
|
"request": "mutation EnterShoppingCriteria($input: EnterShoppingCriteriaInput!) {\n enterShoppingCriteria(input: $input) {\n success\n error {\n type\n message\n }\n }\n}",
|
|
23
25
|
"server": {
|
|
@@ -54,8 +56,7 @@
|
|
|
54
56
|
"eventRef": "ShoppingCriteriaEntered",
|
|
55
57
|
"exampleData": {
|
|
56
58
|
"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
|
+
"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."
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
]
|
|
@@ -83,8 +84,7 @@
|
|
|
83
84
|
"eventRef": "ShoppingCriteriaEntered",
|
|
84
85
|
"exampleData": {
|
|
85
86
|
"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"
|
|
87
|
+
"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."
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
],
|
|
@@ -108,8 +108,7 @@
|
|
|
108
108
|
"name": "selects items relevant to the shopping criteria",
|
|
109
109
|
"type": "command",
|
|
110
110
|
"client": {
|
|
111
|
-
"description": ""
|
|
112
|
-
"specs": []
|
|
111
|
+
"description": ""
|
|
113
112
|
},
|
|
114
113
|
"server": {
|
|
115
114
|
"description": "",
|
|
@@ -135,7 +134,7 @@
|
|
|
135
134
|
},
|
|
136
135
|
"origin": {
|
|
137
136
|
"type": "integration",
|
|
138
|
-
"systems": ["
|
|
137
|
+
"systems": ["ProductCatalog"]
|
|
139
138
|
}
|
|
140
139
|
}
|
|
141
140
|
},
|
|
@@ -160,6 +159,7 @@
|
|
|
160
159
|
"description": "Product catalog with matching items generates suggestions",
|
|
161
160
|
"given": [
|
|
162
161
|
{
|
|
162
|
+
"stateRef": "Products",
|
|
163
163
|
"exampleData": {
|
|
164
164
|
"products": [
|
|
165
165
|
{
|
|
@@ -195,8 +195,7 @@
|
|
|
195
195
|
"imageUrl": "https://example.com/mtg-starter.jpg"
|
|
196
196
|
}
|
|
197
197
|
]
|
|
198
|
-
}
|
|
199
|
-
"stateRef": "Products"
|
|
198
|
+
}
|
|
200
199
|
}
|
|
201
200
|
],
|
|
202
201
|
"when": {
|
|
@@ -252,13 +251,15 @@
|
|
|
252
251
|
"type": "query",
|
|
253
252
|
"client": {
|
|
254
253
|
"description": "",
|
|
255
|
-
"specs":
|
|
256
|
-
"Suggested Items Screen",
|
|
257
|
-
"
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
254
|
+
"specs": {
|
|
255
|
+
"name": "Suggested Items Screen",
|
|
256
|
+
"rules": [
|
|
257
|
+
"display all suggested items with names and reasons",
|
|
258
|
+
"show quantity selectors for each item",
|
|
259
|
+
"have an \"Add to Cart\" button for selected items",
|
|
260
|
+
"allow removing items from the suggestions"
|
|
261
|
+
]
|
|
262
|
+
}
|
|
262
263
|
},
|
|
263
264
|
"request": "query GetSuggestedItems($sessionId: ID!) {\n suggestedItems(sessionId: $sessionId) {\n items {\n productId\n name\n quantity\n reason\n }\n }\n}",
|
|
264
265
|
"server": {
|
|
@@ -362,12 +363,14 @@
|
|
|
362
363
|
"type": "command",
|
|
363
364
|
"client": {
|
|
364
365
|
"description": "",
|
|
365
|
-
"specs":
|
|
366
|
-
"Suggested Items Screen",
|
|
367
|
-
"
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
366
|
+
"specs": {
|
|
367
|
+
"name": "Suggested Items Screen",
|
|
368
|
+
"rules": [
|
|
369
|
+
"allow selecting specific items to add",
|
|
370
|
+
"update quantities before adding to cart",
|
|
371
|
+
"provide feedback when items are added"
|
|
372
|
+
]
|
|
373
|
+
}
|
|
371
374
|
},
|
|
372
375
|
"server": {
|
|
373
376
|
"description": "",
|
|
@@ -437,8 +440,7 @@
|
|
|
437
440
|
"productId": "prod-mtg-starter",
|
|
438
441
|
"quantity": 1
|
|
439
442
|
}
|
|
440
|
-
]
|
|
441
|
-
"timestamp": "2025-09-04T21:20:20.310Z"
|
|
443
|
+
]
|
|
442
444
|
}
|
|
443
445
|
}
|
|
444
446
|
]
|
|
@@ -569,20 +571,6 @@
|
|
|
569
571
|
"version": 1
|
|
570
572
|
}
|
|
571
573
|
},
|
|
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
|
-
},
|
|
586
574
|
{
|
|
587
575
|
"type": "command",
|
|
588
576
|
"name": "EnterShoppingCriteria",
|
|
@@ -615,11 +603,6 @@
|
|
|
615
603
|
"name": "criteria",
|
|
616
604
|
"type": "string",
|
|
617
605
|
"required": true
|
|
618
|
-
},
|
|
619
|
-
{
|
|
620
|
-
"name": "timestamp",
|
|
621
|
-
"type": "Date",
|
|
622
|
-
"required": true
|
|
623
606
|
}
|
|
624
607
|
],
|
|
625
608
|
"source": "internal",
|
|
@@ -646,6 +629,20 @@
|
|
|
646
629
|
"version": 1
|
|
647
630
|
}
|
|
648
631
|
},
|
|
632
|
+
{
|
|
633
|
+
"type": "state",
|
|
634
|
+
"name": "Products",
|
|
635
|
+
"fields": [
|
|
636
|
+
{
|
|
637
|
+
"name": "products",
|
|
638
|
+
"type": "Array<{ productId: string; name: string; category: string; price: number; tags: Array<string>; imageUrl: string }>",
|
|
639
|
+
"required": true
|
|
640
|
+
}
|
|
641
|
+
],
|
|
642
|
+
"metadata": {
|
|
643
|
+
"version": 1
|
|
644
|
+
}
|
|
645
|
+
},
|
|
649
646
|
{
|
|
650
647
|
"type": "event",
|
|
651
648
|
"name": "ShoppingItemsSuggested",
|
|
@@ -717,11 +714,6 @@
|
|
|
717
714
|
"name": "items",
|
|
718
715
|
"type": "Array<{ productId: string; quantity: number }>",
|
|
719
716
|
"required": true
|
|
720
|
-
},
|
|
721
|
-
{
|
|
722
|
-
"name": "timestamp",
|
|
723
|
-
"type": "Date",
|
|
724
|
-
"required": true
|
|
725
717
|
}
|
|
726
718
|
],
|
|
727
719
|
"source": "internal",
|
|
@@ -737,13 +729,13 @@
|
|
|
737
729
|
"source": "@auto-engineer/ai-integration"
|
|
738
730
|
},
|
|
739
731
|
{
|
|
740
|
-
"name": "
|
|
741
|
-
"description": "
|
|
742
|
-
"source": "@auto-engineer/
|
|
732
|
+
"name": "ProductCatalog",
|
|
733
|
+
"description": "ProductCatalog integration",
|
|
734
|
+
"source": "@auto-engineer/productcatalog-integration"
|
|
743
735
|
},
|
|
744
736
|
{
|
|
745
|
-
"name": "
|
|
746
|
-
"description": "
|
|
737
|
+
"name": "Cart",
|
|
738
|
+
"description": "Cart integration",
|
|
747
739
|
"source": "@auto-engineer/cart-integration"
|
|
748
740
|
}
|
|
749
741
|
]
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "tsx --no-deprecation src/server.ts",
|
|
8
8
|
"type-check": "tsc --noEmit",
|
|
9
|
-
"test": "vitest run
|
|
9
|
+
"test": "vitest run",
|
|
10
10
|
"dev": "tsx --no-deprecation src/server.ts"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"typescript": "~5.8.3",
|
|
23
|
-
"vitest": "^3.2.3",
|
|
24
23
|
"tsx": "^4.7.1"
|
|
25
24
|
}
|
|
26
25
|
}
|
|
@@ -34,7 +34,6 @@ describe('SeasonalAssistant | CreatesAChatSession', () => {
|
|
|
34
34
|
sessionId: 'session-abc',
|
|
35
35
|
criteria:
|
|
36
36
|
'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.',
|
|
37
|
-
timestamp: new Date('2025-09-04T21:20:20.309Z'),
|
|
38
37
|
},
|
|
39
38
|
})
|
|
40
39
|
|
|
@@ -30,7 +30,6 @@ describe('Seasonal Assistant | enters shopping criteria into assistant', () => {
|
|
|
30
30
|
sessionId: 'shopper-123',
|
|
31
31
|
criteria:
|
|
32
32
|
'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.',
|
|
33
|
-
timestamp: new Date('2025-09-04T21:20:20.309Z'),
|
|
34
33
|
},
|
|
35
34
|
},
|
|
36
35
|
]);
|
|
@@ -2,7 +2,7 @@ import { IllegalStateError } from '@event-driven-io/emmett';
|
|
|
2
2
|
import type { State } from './state';
|
|
3
3
|
import type { SuggestShoppingItems } from './commands';
|
|
4
4
|
import type { ShoppingItemsSuggested } from './events';
|
|
5
|
-
import type { Products } from '@auto-engineer/
|
|
5
|
+
import type { Products } from '@auto-engineer/productcatalog-integration';
|
|
6
6
|
|
|
7
7
|
export const decide = (command: SuggestShoppingItems, state: State, products?: Products): ShoppingItemsSuggested => {
|
|
8
8
|
switch (command.type) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import '@auto-engineer/
|
|
1
|
+
import '@auto-engineer/productcatalog-integration';
|
|
2
2
|
|
|
3
3
|
import { AI } from '@auto-engineer/ai-integration';
|
|
4
4
|
|
|
5
|
-
import { Products } from '@auto-engineer/
|
|
5
|
+
import { Products } from '@auto-engineer/productcatalog-integration';
|
|
6
6
|
|
|
7
7
|
import { CommandHandler, type EventStore, type MessageHandlerResult } from '@event-driven-io/emmett';
|
|
8
8
|
import { evolve } from './evolve';
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
type ClientImplementedEvent,
|
|
30
30
|
type ClientImplementationFailedEvent,
|
|
31
31
|
} from '@auto-engineer/frontend-implementer';
|
|
32
|
+
import { type GenerateClientCommand } from '@auto-engineer/frontend-generator-react-graphql';
|
|
32
33
|
|
|
33
34
|
// Plugin configuration
|
|
34
35
|
export default {
|
|
@@ -100,7 +101,10 @@ const completedOperations = fold<string[], Event>('*', (state = [], event) => {
|
|
|
100
101
|
on<SchemaExportedEvent>('SchemaExported', (event) =>
|
|
101
102
|
dispatch<GenerateServerCommand>({
|
|
102
103
|
type: 'GenerateServer',
|
|
103
|
-
data: {
|
|
104
|
+
data: {
|
|
105
|
+
schemaPath: event.data.outputPath,
|
|
106
|
+
destination: event.data.outputPath.replace('/.context/schema.json', '/server'),
|
|
107
|
+
},
|
|
104
108
|
}),
|
|
105
109
|
);
|
|
106
110
|
|
|
@@ -122,16 +126,20 @@ on<ServerGeneratedEvent>('ServerGenerated', (event) =>
|
|
|
122
126
|
// ]),
|
|
123
127
|
// );
|
|
124
128
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
on<SchemaExportedEvent>('SchemaExported', (event) =>
|
|
130
|
+
dispatch<GenerateClientCommand>({
|
|
131
|
+
type: 'GenerateClient',
|
|
132
|
+
data: {
|
|
133
|
+
starterDir:
|
|
134
|
+
'/Users/sam/WebstormProjects/top/auto-engineer/packages/frontend-generator-react-graphql/shadcn-starter',
|
|
135
|
+
targetDir: '/Users/sam/WebstormProjects/top/auto-engineer/examples/shopping-app/client',
|
|
136
|
+
iaSchemaPath: '/Users/sam/WebstormProjects/top/auto-engineer/examples/shopping-app/.context/auto-ia-scheme.json',
|
|
137
|
+
gqlSchemaPath: '/Users/sam/WebstormProjects/top/auto-engineer/examples/shopping-app/.context/schema.graphql',
|
|
138
|
+
figmaVariablesPath:
|
|
139
|
+
'/Users/sam/WebstormProjects/top/auto-engineer/examples/shopping-app/.context/figma-variables.json',
|
|
140
|
+
},
|
|
141
|
+
}),
|
|
142
|
+
);
|
|
135
143
|
|
|
136
144
|
// on<ClientImplementedEvent>('ClientImplemented', (event) =>
|
|
137
145
|
// dispatch<CheckClientCommand>({ type: 'CheckClient', data: { clientDirectory: './client', skipBrowserChecks: true } }),
|