create-auto-app 1.138.0 → 1.140.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-auto-app",
3
- "version": "1.138.0",
3
+ "version": "1.140.0",
4
4
  "description": "Create Auto Engineer apps with no configuration",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,7 +33,7 @@
33
33
  "fs-extra": "^11.2.0",
34
34
  "inquirer": "^9.2.15",
35
35
  "ora": "^8.0.1",
36
- "@auto-engineer/id": "1.138.0"
36
+ "@auto-engineer/id": "1.140.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/fs-extra": "^11.0.4",
@@ -3,7 +3,7 @@ import type { ConcurrencyConfig } from "@auto-engineer/pipeline";
3
3
  import { define } from "@auto-engineer/pipeline";
4
4
  import type { AllCheckFailedEvents } from "@auto-engineer/checks";
5
5
  import type { ServerGenerationFailedEvent } from "@auto-engineer/server-generator-apollo-emmett";
6
- import type { SliceImplementedEvent } from "@auto-engineer/server-implementer";
6
+ import type { MomentImplementedEvent } from "@auto-engineer/server-implementer";
7
7
  import type { ReactAppGeneratedEvent } from "@auto-engineer/react-gen";
8
8
 
9
9
  export const fileId = "typical-example-1";
@@ -31,44 +31,44 @@ export const pipeline = define("typical-example")
31
31
  serverDirectory: resolvePath("./server"),
32
32
  }))
33
33
 
34
- .on("SliceGenerated")
35
- .emit("ImplementSlice", (e: SliceImplementedEvent) => ({
36
- slicePath: resolvePath(e.data.slicePath),
34
+ .on("MomentGenerated")
35
+ .emit("ImplementMoment", (e: MomentImplementedEvent) => ({
36
+ momentPath: resolvePath(e.data.momentPath),
37
37
  context: { previousOutputs: "", attemptNumber: 0 },
38
38
  // aiOptions: { maxTokens: 2000 },
39
39
  }))
40
40
 
41
- .on("SliceImplemented")
42
- .emit("CheckTests", (e: SliceImplementedEvent) => ({
43
- targetDirectory: e.data.slicePath,
41
+ .on("MomentImplemented")
42
+ .emit("CheckTests", (e: MomentImplementedEvent) => ({
43
+ targetDirectory: e.data.momentPath,
44
44
  scope: "slice",
45
45
  }))
46
- .emit("CheckTypes", (e: SliceImplementedEvent) => ({
47
- targetDirectory: e.data.slicePath,
46
+ .emit("CheckTypes", (e: MomentImplementedEvent) => ({
47
+ targetDirectory: e.data.momentPath,
48
48
  scope: "slice",
49
49
  }))
50
- .emit("CheckLint", (e: SliceImplementedEvent) => ({
51
- targetDirectory: e.data.slicePath,
50
+ .emit("CheckLint", (e: MomentImplementedEvent) => ({
51
+ targetDirectory: e.data.momentPath,
52
52
  scope: "slice",
53
53
  fix: true,
54
54
  }))
55
55
 
56
- .settled(["CheckTests", "CheckTypes", "CheckLint"], "Slice Checks Settle")
57
- .dispatch({ dispatches: ["ImplementSlice"] }, (events, send) => {
56
+ .settled(["CheckTests", "CheckTypes", "CheckLint"], "Moment Checks Settle")
57
+ .dispatch({ dispatches: ["ImplementMoment"] }, (events, send) => {
58
58
  const allEvents = gatherAllCheckEvents(events);
59
59
 
60
60
  if (!hasAnyFailures(allEvents)) {
61
- const slicePath = extractSlicePath(events);
62
- sliceRetryState.delete(slicePath);
61
+ const momentPath = extractMomentPath(events);
62
+ sliceRetryState.delete(momentPath);
63
63
  return { persist: true };
64
64
  }
65
65
 
66
- const slicePath = extractSlicePath(events);
66
+ const momentPath = extractMomentPath(events);
67
67
 
68
- if (!shouldRetry(slicePath)) {
68
+ if (!shouldRetry(momentPath)) {
69
69
  const errors = collectErrors(allEvents);
70
70
  console.error(
71
- `Slice implementation failed after ${MAX_RETRIES} retries: ${slicePath}`,
71
+ `Moment implementation failed after ${MAX_RETRIES} retries: ${momentPath}`,
72
72
  );
73
73
  if (errors) {
74
74
  console.error(` Last errors:\n${errors}`);
@@ -76,9 +76,9 @@ export const pipeline = define("typical-example")
76
76
  return;
77
77
  }
78
78
 
79
- const retryAttempt = incrementRetryCount(slicePath);
80
- send("ImplementSlice", {
81
- slicePath,
79
+ const retryAttempt = incrementRetryCount(momentPath);
80
+ send("ImplementMoment", {
81
+ momentPath,
82
82
  context: {
83
83
  previousOutputs: collectErrors(allEvents),
84
84
  attemptNumber: retryAttempt,
@@ -102,17 +102,17 @@ export const pipeline = define("typical-example")
102
102
  data: {
103
103
  error: e.data.error,
104
104
  model: e.data.model,
105
- flowName: e.data.flowName,
106
- sliceName: e.data.sliceName,
107
- sliceType: e.data.sliceType,
105
+ sceneName: e.data.sceneName,
106
+ momentName: e.data.momentName,
107
+ momentType: e.data.momentType,
108
108
  },
109
109
  },
110
110
  }))
111
111
 
112
- .on("SliceGenerationFailed")
112
+ .on("MomentGenerationFailed")
113
113
  .when((e: { data: { error: string } }) => {
114
- if (reportedSliceErrors.has(e.data.error)) return false;
115
- reportedSliceErrors.add(e.data.error);
114
+ if (reportedMomentErrors.has(e.data.error)) return false;
115
+ reportedMomentErrors.add(e.data.error);
116
116
  return true;
117
117
  })
118
118
  .emit(
@@ -122,9 +122,9 @@ export const pipeline = define("typical-example")
122
122
  data: {
123
123
  error: string;
124
124
  model: unknown;
125
- flowName: string;
126
- sliceName: string;
127
- sliceType: string;
125
+ sceneName: string;
126
+ momentName: string;
127
+ momentType: string;
128
128
  };
129
129
  }) => ({
130
130
  payload: {
@@ -132,9 +132,9 @@ export const pipeline = define("typical-example")
132
132
  data: {
133
133
  error: e.data.error,
134
134
  model: e.data.model,
135
- flowName: e.data.flowName,
136
- sliceName: e.data.sliceName,
137
- sliceType: e.data.sliceType,
135
+ sceneName: e.data.sceneName,
136
+ momentName: e.data.momentName,
137
+ momentType: e.data.momentType,
138
138
  },
139
139
  },
140
140
  }),
@@ -144,7 +144,7 @@ export const pipeline = define("typical-example")
144
144
 
145
145
  export function resetState(): void {
146
146
  sliceRetryState.clear();
147
- reportedSliceErrors.clear();
147
+ reportedMomentErrors.clear();
148
148
  projectRoot = "";
149
149
  }
150
150
 
@@ -179,7 +179,7 @@ function collectErrors(events: Event[]): string {
179
179
  .join("\n");
180
180
  }
181
181
 
182
- function extractSlicePath(events: Record<string, Event[]>): string {
182
+ function extractMomentPath(events: Record<string, Event[]>): string {
183
183
  const firstEvent =
184
184
  events.CheckTests?.[0] ?? events.CheckTypes?.[0] ?? events.CheckLint?.[0];
185
185
  const data = firstEvent?.data as AllCheckFailedEvents["data"] | undefined;
@@ -194,20 +194,20 @@ function gatherAllCheckEvents(events: Record<string, Event[]>): Event[] {
194
194
  ];
195
195
  }
196
196
 
197
- function shouldRetry(slicePath: string): boolean {
198
- const attempts = sliceRetryState.get(slicePath) ?? 0;
197
+ function shouldRetry(momentPath: string): boolean {
198
+ const attempts = sliceRetryState.get(momentPath) ?? 0;
199
199
  return attempts < MAX_RETRIES;
200
200
  }
201
201
 
202
- function incrementRetryCount(slicePath: string): number {
203
- const attempts = sliceRetryState.get(slicePath) ?? 0;
204
- sliceRetryState.set(slicePath, attempts + 1);
202
+ function incrementRetryCount(momentPath: string): number {
203
+ const attempts = sliceRetryState.get(momentPath) ?? 0;
204
+ sliceRetryState.set(momentPath, attempts + 1);
205
205
  return attempts + 1;
206
206
  }
207
207
 
208
208
  const MAX_RETRIES = 3;
209
209
  const sliceRetryState = new Map<string, number>();
210
- const reportedSliceErrors = new Set<string>();
210
+ const reportedMomentErrors = new Set<string>();
211
211
  let projectRoot = "";
212
212
 
213
213
  function resolvePath(relativePath: string): string {