@auto-engineer/narrative 1.125.1 → 1.128.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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +3 -3
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +43 -0
- package/dist/src/loader/runtime-cjs.d.ts.map +1 -1
- package/dist/src/loader/runtime-cjs.js +0 -1
- package/dist/src/loader/runtime-cjs.js.map +1 -1
- package/dist/src/loader/ts-utils.d.ts.map +1 -1
- package/dist/src/loader/ts-utils.js +0 -1
- package/dist/src/loader/ts-utils.js.map +1 -1
- package/dist/src/narrative-context.d.ts.map +1 -1
- package/dist/src/narrative-context.js +1 -2
- package/dist/src/narrative-context.js.map +1 -1
- package/dist/src/schema.d.ts +1052 -0
- package/dist/src/schema.d.ts.map +1 -1
- package/dist/src/schema.js +16 -0
- package/dist/src/schema.js.map +1 -1
- package/dist/src/transformers/narrative-to-model/spec-processors.d.ts.map +1 -1
- package/dist/src/transformers/narrative-to-model/spec-processors.js +0 -2
- package/dist/src/transformers/narrative-to-model/spec-processors.js.map +1 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/getNarratives.specs.ts +0 -1
- package/src/loader/runtime-cjs.ts +0 -1
- package/src/loader/ts-utils.ts +0 -1
- package/src/narrative-context.ts +1 -2
- package/src/schema.ts +20 -0
- package/src/transformers/narrative-to-model/spec-processors.ts +0 -2
- package/src/types.ts +0 -1
package/package.json
CHANGED
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"typescript": "^5.9.2",
|
|
27
27
|
"zod": "^3.22.4",
|
|
28
28
|
"zod-to-json-schema": "^3.22.3",
|
|
29
|
-
"@auto-engineer/file-store": "1.
|
|
30
|
-
"@auto-engineer/id": "1.
|
|
31
|
-
"@auto-engineer/message-bus": "1.
|
|
29
|
+
"@auto-engineer/file-store": "1.128.0",
|
|
30
|
+
"@auto-engineer/id": "1.128.0",
|
|
31
|
+
"@auto-engineer/message-bus": "1.128.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "^20.0.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"version": "1.
|
|
41
|
+
"version": "1.128.0",
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "tsx scripts/build.ts",
|
|
44
44
|
"test": "vitest run --reporter=dot",
|
|
@@ -19,7 +19,6 @@ describe('getNarratives', (_mode) => {
|
|
|
19
19
|
vfs = new NodeFileStore();
|
|
20
20
|
root = path.resolve(__dirname);
|
|
21
21
|
});
|
|
22
|
-
// eslint-disable-next-line complexity
|
|
23
22
|
it('loads multiple narratives and generates correct models', async () => {
|
|
24
23
|
const flows = await getNarratives({ vfs, root: path.resolve(__dirname), pattern, fastFsScan: true });
|
|
25
24
|
const schemas = flows.toModel();
|
|
@@ -134,7 +134,6 @@ export function runGraph(entryFiles: string[], graph: Graph): void {
|
|
|
134
134
|
|
|
135
135
|
try {
|
|
136
136
|
const codeWithShim = `var r = require; var __require = require;\n${mod.js}`;
|
|
137
|
-
// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
138
137
|
const fn = new Function('require', 'module', 'exports', '__filename', '__dirname', codeWithShim) as (
|
|
139
138
|
req: (s: string) => unknown,
|
|
140
139
|
module: { exports: Record<string, unknown> },
|
package/src/loader/ts-utils.ts
CHANGED
|
@@ -205,7 +205,6 @@ function extractTypeLiteralProperties(
|
|
|
205
205
|
return `{ ${properties.join('; ')} }`;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
// eslint-disable-next-line complexity
|
|
209
208
|
function extractTypeFromNode(ts: typeof import('typescript'), typeNode?: import('typescript').TypeNode): string {
|
|
210
209
|
if (!typeNode) return 'unknown';
|
|
211
210
|
|
package/src/narrative-context.ts
CHANGED
|
@@ -304,8 +304,7 @@ export function setSliceData(data: Data): void {
|
|
|
304
304
|
function stripTypeDiscriminator(items: (DataSink | DataSource | DataTarget)[]): (DataSink | DataSource | DataTarget)[] {
|
|
305
305
|
return items.map((item) => {
|
|
306
306
|
if ('__type' in item) {
|
|
307
|
-
|
|
308
|
-
const { __type, ...rest } = item;
|
|
307
|
+
const { __type: _, ...rest } = item;
|
|
309
308
|
return rest;
|
|
310
309
|
}
|
|
311
310
|
return item;
|
package/src/schema.ts
CHANGED
|
@@ -210,6 +210,20 @@ export const MappingEntrySchema = z
|
|
|
210
210
|
})
|
|
211
211
|
.describe('Mapping entry linking a source field to a target field');
|
|
212
212
|
|
|
213
|
+
export const ImageAssetSchema = z
|
|
214
|
+
.object({
|
|
215
|
+
url: z.string().optional().describe('URL of the image asset'),
|
|
216
|
+
originatingPrompt: z.string().optional().describe('Prompt used to generate the image'),
|
|
217
|
+
})
|
|
218
|
+
.describe('Image asset with optional generation metadata');
|
|
219
|
+
|
|
220
|
+
export const DesignSchema = z
|
|
221
|
+
.object({
|
|
222
|
+
imageAsset: ImageAssetSchema.optional().describe('Primary image asset for this entity'),
|
|
223
|
+
metadata: z.record(z.unknown()).optional().describe('Flexible design metadata'),
|
|
224
|
+
})
|
|
225
|
+
.describe('Design fields for visual representation');
|
|
226
|
+
|
|
213
227
|
const BaseSliceSchema = z
|
|
214
228
|
.object({
|
|
215
229
|
name: z.string(),
|
|
@@ -218,6 +232,7 @@ const BaseSliceSchema = z
|
|
|
218
232
|
stream: z.string().optional().describe('Event stream pattern for this slice'),
|
|
219
233
|
via: z.array(z.string()).optional().describe('Integration names used by this slice'),
|
|
220
234
|
additionalInstructions: z.string().optional().describe('Additional instructions'),
|
|
235
|
+
design: DesignSchema.optional().describe('Design fields for visual representation'),
|
|
221
236
|
})
|
|
222
237
|
.describe('Base properties shared by all slice types');
|
|
223
238
|
|
|
@@ -384,6 +399,7 @@ export const JourneySchema = z
|
|
|
384
399
|
description: z.string().optional(),
|
|
385
400
|
actors: z.array(z.string()).optional(),
|
|
386
401
|
narrativeIds: z.array(z.string()).describe('Ordered narrative IDs composing this journey'),
|
|
402
|
+
design: DesignSchema.optional().describe('Design fields for visual representation'),
|
|
387
403
|
})
|
|
388
404
|
.describe('User journey grouping narratives into an ordered flow');
|
|
389
405
|
|
|
@@ -395,6 +411,7 @@ const NarrativeSchema = z
|
|
|
395
411
|
slices: z.array(SliceSchema),
|
|
396
412
|
sourceFile: z.string().optional(),
|
|
397
413
|
scene: SceneClassificationSchema.optional(),
|
|
414
|
+
design: DesignSchema.optional().describe('Design fields for visual representation'),
|
|
398
415
|
})
|
|
399
416
|
.describe('Business narrative containing related slices');
|
|
400
417
|
|
|
@@ -503,6 +520,7 @@ export const modelSchema = z
|
|
|
503
520
|
integrations: z.array(IntegrationSchema).optional(),
|
|
504
521
|
modules: z.array(ModuleSchema).describe('Modules for type ownership and file grouping'),
|
|
505
522
|
journeys: z.array(JourneySchema).optional(),
|
|
523
|
+
design: DesignSchema.optional().describe('Design fields for visual representation'),
|
|
506
524
|
})
|
|
507
525
|
.describe('Complete system specification with all implementation details');
|
|
508
526
|
|
|
@@ -556,3 +574,5 @@ export type DataTarget = z.infer<typeof DataTargetSchema>;
|
|
|
556
574
|
export type SceneClassification = z.infer<typeof SceneClassificationSchema>;
|
|
557
575
|
export type SceneRoute = z.infer<typeof SceneRouteSchema>;
|
|
558
576
|
export type JourneyPlanning = z.infer<typeof JourneyPlanningSchema>;
|
|
577
|
+
export type ImageAsset = z.infer<typeof ImageAssetSchema>;
|
|
578
|
+
export type Design = z.infer<typeof DesignSchema>;
|
|
@@ -273,7 +273,6 @@ function tryAlternativeResolutionsForEvent(
|
|
|
273
273
|
return false;
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
// eslint-disable-next-line complexity
|
|
277
276
|
function processEventRefInGiven(
|
|
278
277
|
g: {
|
|
279
278
|
eventRef?: string;
|
|
@@ -361,7 +360,6 @@ export function processGiven(
|
|
|
361
360
|
});
|
|
362
361
|
}
|
|
363
362
|
|
|
364
|
-
// eslint-disable-next-line complexity
|
|
365
363
|
function processSingleWhen(
|
|
366
364
|
when: {
|
|
367
365
|
commandRef?: string;
|