@auto-engineer/narrative 0.13.3 → 0.15.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/CHANGELOG.md +26 -0
- package/README.md +151 -99
- package/dist/scripts/convert-flow-exec.js +2 -2
- package/dist/scripts/convert-flow-exec.js.map +1 -1
- package/dist/scripts/convert-flow-helper.js +3 -4
- package/dist/scripts/convert-flow-helper.js.map +1 -1
- package/dist/scripts/convert-flow.js +4 -4
- package/dist/scripts/convert-flow.js.map +1 -1
- package/dist/scripts/print-schema.js +1 -1
- package/dist/scripts/print-schema.js.map +1 -1
- package/dist/src/commands/export-schema-helper.js +9 -9
- package/dist/src/commands/export-schema-helper.js.map +1 -1
- package/dist/src/commands/export-schema.d.ts.map +1 -1
- package/dist/src/commands/export-schema.js +49 -68
- package/dist/src/commands/export-schema.js.map +1 -1
- package/dist/src/data-narrative-builders.d.ts +1 -1
- package/dist/src/data-narrative-builders.d.ts.map +1 -1
- package/dist/src/data-narrative-builders.js +13 -19
- package/dist/src/data-narrative-builders.js.map +1 -1
- package/dist/src/fluent-builder.d.ts.map +1 -1
- package/dist/src/fluent-builder.js +2 -2
- package/dist/src/fluent-builder.js.map +1 -1
- package/dist/src/fluent-builder.specs.js +2 -2
- package/dist/src/fluent-builder.specs.js.map +1 -1
- package/dist/src/getNarratives.cache.specs.js +5 -5
- package/dist/src/getNarratives.cache.specs.js.map +1 -1
- package/dist/src/getNarratives.d.ts +1 -1
- package/dist/src/getNarratives.d.ts.map +1 -1
- package/dist/src/getNarratives.js +6 -3
- package/dist/src/getNarratives.js.map +1 -1
- package/dist/src/getNarratives.specs.js +6 -6
- package/dist/src/getNarratives.specs.js.map +1 -1
- package/dist/src/id/addAutoIds.d.ts +1 -1
- package/dist/src/id/addAutoIds.d.ts.map +1 -1
- package/dist/src/id/addAutoIds.js.map +1 -1
- package/dist/src/id/addAutoIds.specs.js +1 -1
- package/dist/src/id/addAutoIds.specs.js.map +1 -1
- package/dist/src/id/hasAllIds.d.ts +1 -1
- package/dist/src/id/hasAllIds.d.ts.map +1 -1
- package/dist/src/id/hasAllIds.specs.js +1 -1
- package/dist/src/id/hasAllIds.specs.js.map +1 -1
- package/dist/src/id/index.d.ts +1 -1
- package/dist/src/id/index.d.ts.map +1 -1
- package/dist/src/id/index.js +1 -1
- package/dist/src/id/index.js.map +1 -1
- package/dist/src/index.d.ts +14 -17
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -10
- package/dist/src/index.js.map +1 -1
- package/dist/src/integration-export-registry.d.ts +2 -2
- package/dist/src/integration-export-registry.d.ts.map +1 -1
- package/dist/src/integration-registry.d.ts +1 -1
- package/dist/src/integration-registry.d.ts.map +1 -1
- package/dist/src/integration-registry.js +1 -0
- package/dist/src/integration-registry.js.map +1 -1
- package/dist/src/loader/fs-path.js +2 -2
- package/dist/src/loader/fs-path.js.map +1 -1
- package/dist/src/loader/graph.d.ts +2 -2
- package/dist/src/loader/graph.d.ts.map +1 -1
- package/dist/src/loader/graph.js +2 -2
- package/dist/src/loader/graph.js.map +1 -1
- package/dist/src/loader/index.d.ts +1 -1
- package/dist/src/loader/index.d.ts.map +1 -1
- package/dist/src/loader/index.js +5 -5
- package/dist/src/loader/index.js.map +1 -1
- package/dist/src/loader/resolver.js +1 -1
- package/dist/src/loader/resolver.js.map +1 -1
- package/dist/src/loader/runtime-cjs.d.ts.map +1 -1
- package/dist/src/loader/runtime-cjs.js +2 -2
- package/dist/src/loader/runtime-cjs.js.map +1 -1
- package/dist/src/loader/ts-utils.js +5 -5
- package/dist/src/loader/ts-utils.js.map +1 -1
- package/dist/src/model-to-narrative.specs.js +73 -98
- package/dist/src/model-to-narrative.specs.js.map +1 -1
- package/dist/src/narrative-context.d.ts +4 -4
- package/dist/src/narrative-context.d.ts.map +1 -1
- package/dist/src/narrative-context.js +2 -2
- package/dist/src/narrative-context.js.map +1 -1
- package/dist/src/narrative-context.specs.js +118 -3
- package/dist/src/narrative-context.specs.js.map +1 -1
- package/dist/src/narrative-registry.d.ts +1 -1
- package/dist/src/narrative-registry.d.ts.map +1 -1
- package/dist/src/narrative-registry.js +1 -1
- package/dist/src/narrative-registry.js.map +1 -1
- package/dist/src/narrative.d.ts +3 -3
- package/dist/src/narrative.d.ts.map +1 -1
- package/dist/src/narrative.js +15 -17
- package/dist/src/narrative.js.map +1 -1
- package/dist/src/node.d.ts +1 -1
- package/dist/src/node.d.ts.map +1 -1
- package/dist/src/node.js +1 -1
- package/dist/src/node.js.map +1 -1
- package/dist/src/samples/items.narrative.js +2 -2
- package/dist/src/samples/items.narrative.js.map +1 -1
- package/dist/src/samples/mixed-given-types.narrative.js +1 -1
- package/dist/src/samples/mixed-given-types.narrative.js.map +1 -1
- package/dist/src/samples/place-order.narrative.js +1 -1
- package/dist/src/samples/place-order.narrative.js.map +1 -1
- package/dist/src/samples/questionnaires.narrative.js +1 -1
- package/dist/src/samples/questionnaires.narrative.js.map +1 -1
- package/dist/src/samples/test-with-ids.narrative.js +1 -1
- package/dist/src/samples/test-with-ids.narrative.js.map +1 -1
- package/dist/src/schema-test.js +1 -1
- package/dist/src/schema-test.js.map +1 -1
- package/dist/src/schema.d.ts +264 -264
- package/dist/src/slice-builder.d.ts.map +1 -1
- package/dist/src/slice-builder.js +1 -1
- package/dist/src/slice-builder.js.map +1 -1
- package/dist/src/transformers/model-to-narrative/ast/emit-helpers.d.ts +1 -1
- package/dist/src/transformers/model-to-narrative/ast/emit-helpers.d.ts.map +1 -1
- package/dist/src/transformers/model-to-narrative/formatting/sort-types.js +1 -1
- package/dist/src/transformers/model-to-narrative/formatting/sort-types.js.map +1 -1
- package/dist/src/transformers/model-to-narrative/generators/compose.d.ts +1 -1
- package/dist/src/transformers/model-to-narrative/generators/compose.d.ts.map +1 -1
- package/dist/src/transformers/model-to-narrative/generators/compose.js +4 -4
- package/dist/src/transformers/model-to-narrative/generators/compose.js.map +1 -1
- package/dist/src/transformers/model-to-narrative/generators/flow.d.ts +1 -1
- package/dist/src/transformers/model-to-narrative/generators/flow.d.ts.map +1 -1
- package/dist/src/transformers/model-to-narrative/generators/flow.js.map +1 -1
- package/dist/src/transformers/model-to-narrative/generators/gwt.d.ts +1 -1
- package/dist/src/transformers/model-to-narrative/generators/gwt.d.ts.map +1 -1
- package/dist/src/transformers/model-to-narrative/generators/gwt.js +47 -57
- package/dist/src/transformers/model-to-narrative/generators/gwt.js.map +1 -1
- package/dist/src/transformers/model-to-narrative/generators/gwt.specs.d.ts +2 -0
- package/dist/src/transformers/model-to-narrative/generators/gwt.specs.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/generators/gwt.specs.js +142 -0
- package/dist/src/transformers/model-to-narrative/generators/gwt.specs.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/generators/imports.d.ts +1 -1
- package/dist/src/transformers/model-to-narrative/generators/imports.d.ts.map +1 -1
- package/dist/src/transformers/model-to-narrative/generators/imports.js +0 -4
- package/dist/src/transformers/model-to-narrative/generators/imports.js.map +1 -1
- package/dist/src/transformers/model-to-narrative/generators/types.d.ts +1 -1
- package/dist/src/transformers/model-to-narrative/generators/types.d.ts.map +1 -1
- package/dist/src/transformers/model-to-narrative/index.d.ts +1 -1
- package/dist/src/transformers/model-to-narrative/index.d.ts.map +1 -1
- package/dist/src/transformers/model-to-narrative/index.js +1 -1
- package/dist/src/transformers/model-to-narrative/index.js.map +1 -1
- package/dist/src/transformers/narrative-to-model/assemble.d.ts +1 -1
- package/dist/src/transformers/narrative-to-model/assemble.d.ts.map +1 -1
- package/dist/src/transformers/narrative-to-model/example-shapes.d.ts +1 -1
- package/dist/src/transformers/narrative-to-model/example-shapes.d.ts.map +1 -1
- package/dist/src/transformers/narrative-to-model/index.d.ts +2 -2
- package/dist/src/transformers/narrative-to-model/index.d.ts.map +1 -1
- package/dist/src/transformers/narrative-to-model/index.js +5 -5
- package/dist/src/transformers/narrative-to-model/index.js.map +1 -1
- package/dist/src/transformers/narrative-to-model/inlining.d.ts +2 -2
- package/dist/src/transformers/narrative-to-model/inlining.d.ts.map +1 -1
- package/dist/src/transformers/narrative-to-model/integrations.d.ts +2 -2
- package/dist/src/transformers/narrative-to-model/integrations.d.ts.map +1 -1
- package/dist/src/transformers/narrative-to-model/integrations.js +3 -3
- package/dist/src/transformers/narrative-to-model/integrations.js.map +1 -1
- package/dist/src/transformers/narrative-to-model/messages.d.ts +2 -2
- package/dist/src/transformers/narrative-to-model/messages.d.ts.map +1 -1
- package/dist/src/transformers/narrative-to-model/messages.js +1 -1
- package/dist/src/transformers/narrative-to-model/messages.js.map +1 -1
- package/dist/src/transformers/narrative-to-model/normalize.d.ts +1 -1
- package/dist/src/transformers/narrative-to-model/normalize.d.ts.map +1 -1
- package/dist/src/transformers/narrative-to-model/spec-processors.d.ts +3 -3
- package/dist/src/transformers/narrative-to-model/spec-processors.d.ts.map +1 -1
- package/dist/src/transformers/narrative-to-model/spec-processors.js +2 -2
- package/dist/src/transformers/narrative-to-model/spec-processors.js.map +1 -1
- package/dist/src/transformers/narrative-to-model/type-inference.d.ts +1 -1
- package/dist/src/transformers/narrative-to-model/type-inference.d.ts.map +1 -1
- package/dist/src/transformers/narrative-to-model/type-inference.js +1 -1
- package/dist/src/transformers/narrative-to-model/type-inference.js.map +1 -1
- package/dist/src/transformers/narrative-to-model/type-inference.specs.js +1 -1
- package/dist/src/transformers/narrative-to-model/type-inference.specs.js.map +1 -1
- package/dist/src/transformers/narrative-to-model/zod-adapter.d.ts +2 -2
- package/dist/src/transformers/narrative-to-model/zod-adapter.d.ts.map +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -12
- package/scripts/convert-flow-exec.ts +2 -2
- package/scripts/convert-flow-helper.ts +3 -4
- package/scripts/convert-flow.ts +4 -4
- package/scripts/print-schema.ts +2 -2
- package/src/commands/export-schema-helper.ts +10 -12
- package/src/commands/export-schema.ts +50 -70
- package/src/data-narrative-builders.ts +8 -11
- package/src/fluent-builder.specs.ts +2 -2
- package/src/fluent-builder.ts +6 -6
- package/src/getNarratives.cache.specs.ts +6 -6
- package/src/getNarratives.specs.ts +6 -6
- package/src/getNarratives.ts +13 -5
- package/src/id/addAutoIds.specs.ts +2 -2
- package/src/id/addAutoIds.ts +1 -1
- package/src/id/hasAllIds.specs.ts +1 -1
- package/src/id/hasAllIds.ts +1 -1
- package/src/id/index.ts +1 -1
- package/src/index.ts +61 -54
- package/src/integration-export-registry.ts +2 -2
- package/src/integration-registry.ts +2 -1
- package/src/loader/fs-path.ts +2 -2
- package/src/loader/graph.ts +9 -9
- package/src/loader/index.ts +7 -7
- package/src/loader/resolver.ts +1 -1
- package/src/loader/runtime-cjs.ts +3 -3
- package/src/loader/ts-utils.ts +5 -5
- package/src/model-to-narrative.specs.ts +76 -99
- package/src/narrative-context.specs.ts +138 -4
- package/src/narrative-context.ts +6 -7
- package/src/narrative-registry.ts +2 -2
- package/src/narrative.ts +27 -33
- package/src/node.ts +1 -2
- package/src/samples/items.narrative.ts +3 -3
- package/src/samples/mixed-given-types.narrative.ts +2 -2
- package/src/samples/place-order.narrative.ts +1 -1
- package/src/samples/questionnaires.narrative.ts +10 -10
- package/src/samples/test-with-ids.narrative.ts +2 -2
- package/src/schema-test.ts +1 -1
- package/src/slice-builder.ts +2 -2
- package/src/transformers/model-to-narrative/ast/emit-helpers.ts +1 -1
- package/src/transformers/model-to-narrative/formatting/sort-types.ts +1 -1
- package/src/transformers/model-to-narrative/generators/compose.ts +5 -5
- package/src/transformers/model-to-narrative/generators/flow.ts +9 -9
- package/src/transformers/model-to-narrative/generators/gwt.specs.ts +157 -0
- package/src/transformers/model-to-narrative/generators/gwt.ts +80 -122
- package/src/transformers/model-to-narrative/generators/imports.ts +0 -4
- package/src/transformers/model-to-narrative/generators/types.ts +1 -1
- package/src/transformers/model-to-narrative/index.ts +2 -2
- package/src/transformers/narrative-to-model/assemble.ts +1 -1
- package/src/transformers/narrative-to-model/example-shapes.ts +1 -1
- package/src/transformers/narrative-to-model/index.ts +7 -7
- package/src/transformers/narrative-to-model/inlining.ts +2 -2
- package/src/transformers/narrative-to-model/integrations.ts +5 -5
- package/src/transformers/narrative-to-model/messages.ts +3 -3
- package/src/transformers/narrative-to-model/normalize.ts +1 -1
- package/src/transformers/narrative-to-model/spec-processors.ts +4 -4
- package/src/transformers/narrative-to-model/type-inference.specs.ts +2 -2
- package/src/transformers/narrative-to-model/type-inference.ts +2 -2
- package/src/transformers/narrative-to-model/zod-adapter.ts +2 -2
- package/src/types.ts +1 -1
- package/dist/src/commands/export-schema-runner.d.ts +0 -3
- package/dist/src/commands/export-schema-runner.d.ts.map +0 -1
- package/dist/src/commands/export-schema-runner.js +0 -53
- package/dist/src/commands/export-schema-runner.js.map +0 -1
- package/eslint.config.ts +0 -12
- package/src/commands/export-schema-runner.ts +0 -74
package/package.json
CHANGED
|
@@ -23,31 +23,24 @@
|
|
|
23
23
|
"typescript": "^5.9.2",
|
|
24
24
|
"zod": "^3.22.4",
|
|
25
25
|
"zod-to-json-schema": "^3.22.3",
|
|
26
|
-
"@auto-engineer/file-store": "0.
|
|
27
|
-
"@auto-engineer/
|
|
28
|
-
"@auto-engineer/
|
|
26
|
+
"@auto-engineer/file-store": "0.15.0",
|
|
27
|
+
"@auto-engineer/message-bus": "0.15.0",
|
|
28
|
+
"@auto-engineer/id": "0.15.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^20.0.0",
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
33
|
-
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
34
32
|
"fake-indexeddb": "^6.0.0",
|
|
35
|
-
"tsx": "^4.20.3"
|
|
36
|
-
"@auto-engineer/cli": "0.13.3"
|
|
33
|
+
"tsx": "^4.20.3"
|
|
37
34
|
},
|
|
38
35
|
"publishConfig": {
|
|
39
36
|
"access": "public"
|
|
40
37
|
},
|
|
41
|
-
"version": "0.
|
|
38
|
+
"version": "0.15.0",
|
|
42
39
|
"scripts": {
|
|
43
40
|
"build": "tsx scripts/build.ts",
|
|
44
41
|
"test": "vitest run --reporter=dot",
|
|
45
|
-
"lint": "eslint '{src,scripts}/**/*.ts' --max-warnings 0 --config ./eslint.config.ts",
|
|
46
42
|
"type-check": "tsc --noEmit",
|
|
47
|
-
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn",
|
|
48
43
|
"convert-narrative": "tsx scripts/convert-narrative.ts",
|
|
49
|
-
"lint:fix": "eslint '{src,scripts}/**/*.ts' --fix --config ./eslint.config.ts",
|
|
50
|
-
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn",
|
|
51
44
|
"link:dev": "pnpm build && pnpm link --global",
|
|
52
45
|
"unlink:dev": "pnpm unlink --global"
|
|
53
46
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import path from 'node:path';
|
|
3
3
|
import { NodeFileStore } from '@auto-engineer/file-store/node';
|
|
4
|
-
import
|
|
4
|
+
import { getNarratives } from '../src';
|
|
5
5
|
|
|
6
6
|
const main = async () => {
|
|
7
7
|
try {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { spawn } from 'child_process';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { join } from 'path';
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import { unlinkSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, join, resolve } from 'node:path';
|
|
6
5
|
|
|
7
6
|
const main = async () => {
|
|
8
7
|
const flowPath = process.argv[2];
|
package/scripts/convert-flow.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { existsSync,
|
|
4
|
-
import {
|
|
5
|
-
import { fileURLToPath } from 'url';
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import { existsSync, statSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, join, relative, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
6
|
|
|
7
7
|
const runInContext = (flowPath: string, projectRoot: string): Promise<string> => {
|
|
8
8
|
return new Promise((resolve, reject) => {
|
package/scripts/print-schema.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
1
2
|
import {
|
|
2
3
|
CommandSliceSchema,
|
|
3
|
-
NarrativeSchema,
|
|
4
4
|
IntegrationSchema,
|
|
5
5
|
MessageSchema,
|
|
6
|
+
NarrativeSchema,
|
|
6
7
|
QuerySliceSchema,
|
|
7
8
|
ReactSliceSchema,
|
|
8
9
|
} from '../src';
|
|
9
10
|
|
|
10
|
-
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
11
11
|
const schemas = Object.fromEntries(
|
|
12
12
|
Object.entries({
|
|
13
13
|
narrative: NarrativeSchema,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { type IExtendedFileStore, NodeFileStore } from '@auto-engineer/file-store/node';
|
|
1
2
|
import createDebug from 'debug';
|
|
2
3
|
import { getFs } from './filestore.node';
|
|
3
|
-
import { IExtendedFileStore, NodeFileStore } from '@auto-engineer/file-store/node';
|
|
4
4
|
|
|
5
5
|
const debug = createDebug('auto:narrative:export-schema-helper');
|
|
6
6
|
if ('color' in debug && typeof debug === 'object') {
|
|
@@ -25,7 +25,7 @@ const main = async () => {
|
|
|
25
25
|
);
|
|
26
26
|
debug('Importing getNarratives from: %s', projectNarrativePath);
|
|
27
27
|
|
|
28
|
-
const { pathToFileURL } = await import('url');
|
|
28
|
+
const { pathToFileURL } = await import('node:url');
|
|
29
29
|
const narrativeModule = (await import(pathToFileURL(projectNarrativePath).href)) as {
|
|
30
30
|
getNarratives: typeof import('../getNarratives').getNarratives;
|
|
31
31
|
};
|
|
@@ -51,18 +51,16 @@ const main = async () => {
|
|
|
51
51
|
await fs.writeText(outPath, json);
|
|
52
52
|
debug('Schema written to: %s', outPath);
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
JSON.stringify({
|
|
57
|
-
success: true,
|
|
58
|
-
outputPath: outPath,
|
|
59
|
-
}),
|
|
60
|
-
);
|
|
54
|
+
const resultPath = fs.join(contextDir, '.export-result.json');
|
|
55
|
+
await fs.writeText(resultPath, JSON.stringify({ success: true, outputPath: outPath }));
|
|
61
56
|
} catch (error) {
|
|
62
57
|
debug('Error occurred: %o', error);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
const getFileStore = getFs as () => Promise<IExtendedFileStore>;
|
|
59
|
+
const fss: IExtendedFileStore = await getFileStore();
|
|
60
|
+
const resultPath = fss.join(process.argv[2] || process.cwd(), '.context', '.export-result.json');
|
|
61
|
+
await fss.ensureDir(fss.dirname(resultPath));
|
|
62
|
+
await fss.writeText(
|
|
63
|
+
resultPath,
|
|
66
64
|
JSON.stringify({
|
|
67
65
|
success: false,
|
|
68
66
|
error: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Command, type Event
|
|
1
|
+
import { type Command, defineCommandHandler, type Event } from '@auto-engineer/message-bus';
|
|
2
2
|
import createDebug from 'debug';
|
|
3
3
|
|
|
4
4
|
const debug = createDebug('auto:narrative:export-schema');
|
|
@@ -33,14 +33,18 @@ export type ExportSchemaEvents = SchemaExportedEvent | SchemaExportFailedEvent;
|
|
|
33
33
|
|
|
34
34
|
export const commandHandler = defineCommandHandler({
|
|
35
35
|
name: 'ExportSchema',
|
|
36
|
+
displayName: 'Export Schema',
|
|
36
37
|
alias: 'export:schema',
|
|
37
38
|
description: 'Export flow schemas to context directory',
|
|
38
39
|
category: 'export',
|
|
39
40
|
icon: 'download',
|
|
40
|
-
events: [
|
|
41
|
+
events: [
|
|
42
|
+
{ name: 'SchemaExported', displayName: 'Schema Exported' },
|
|
43
|
+
{ name: 'SchemaExportFailed', displayName: 'Schema Export Failed' },
|
|
44
|
+
],
|
|
41
45
|
fields: {
|
|
42
46
|
directory: {
|
|
43
|
-
description: 'Context directory path',
|
|
47
|
+
description: 'Context directory path (defaults to current working directory)',
|
|
44
48
|
required: true,
|
|
45
49
|
},
|
|
46
50
|
},
|
|
@@ -60,7 +64,7 @@ export const commandHandler = defineCommandHandler({
|
|
|
60
64
|
export async function handleExportSchemaCommand(
|
|
61
65
|
command: ExportSchemaCommand,
|
|
62
66
|
): Promise<SchemaExportedEvent | SchemaExportFailedEvent> {
|
|
63
|
-
const
|
|
67
|
+
const directory = command.data.directory ?? process.cwd();
|
|
64
68
|
|
|
65
69
|
try {
|
|
66
70
|
// Run the helper script with tsx
|
|
@@ -68,76 +72,52 @@ export async function handleExportSchemaCommand(
|
|
|
68
72
|
const fs = await getFs();
|
|
69
73
|
const __dirname = fs.dirname(new URL(import.meta.url).href);
|
|
70
74
|
const helperScript = fs.join(__dirname, 'export-schema-helper.js');
|
|
71
|
-
const { spawn } = await import('child_process');
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
const child = spawn('npx', ['tsx', helperScript, directory], {
|
|
75
|
-
cwd: directory,
|
|
76
|
-
stdio: ['inherit', 'pipe', 'inherit'], // Let stderr go directly to parent process
|
|
77
|
-
env: {
|
|
78
|
-
...process.env,
|
|
79
|
-
NODE_ENV: process.env.NODE_ENV ?? 'development',
|
|
80
|
-
DEBUG: process.env.DEBUG, // Explicitly pass DEBUG env var
|
|
81
|
-
DEBUG_COLORS: process.env.DEBUG_COLORS, // Pass color settings
|
|
82
|
-
DEBUG_HIDE_DATE: 'true', // Always hide timestamps in child process to match parent
|
|
83
|
-
},
|
|
84
|
-
shell: true,
|
|
85
|
-
});
|
|
76
|
+
const resultPath = fs.join(directory, '.context', '.export-result.json');
|
|
86
77
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
78
|
+
const { spawnSync } = await import('node:child_process');
|
|
79
|
+
spawnSync('node', [helperScript, directory], {
|
|
80
|
+
cwd: directory,
|
|
81
|
+
encoding: 'utf-8',
|
|
82
|
+
stdio: 'ignore',
|
|
83
|
+
env: {
|
|
84
|
+
...process.env,
|
|
85
|
+
NODE_ENV: process.env.NODE_ENV ?? 'development',
|
|
86
|
+
DEBUG: process.env.DEBUG,
|
|
87
|
+
DEBUG_COLORS: process.env.DEBUG_COLORS,
|
|
88
|
+
DEBUG_HIDE_DATE: 'true',
|
|
89
|
+
},
|
|
90
|
+
});
|
|
98
91
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
92
|
+
const resultJson = await fs.readText(resultPath);
|
|
93
|
+
if (resultJson == null) {
|
|
94
|
+
return {
|
|
95
|
+
type: 'SchemaExportFailed',
|
|
96
|
+
data: { directory, error: 'No result file found' },
|
|
97
|
+
timestamp: new Date(),
|
|
98
|
+
requestId: command.requestId,
|
|
99
|
+
correlationId: command.correlationId,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
timestamp: new Date(),
|
|
123
|
-
requestId: command.requestId,
|
|
124
|
-
correlationId: command.correlationId,
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
} catch {
|
|
128
|
-
resolve({
|
|
129
|
-
type: 'SchemaExportFailed',
|
|
130
|
-
data: {
|
|
131
|
-
directory,
|
|
132
|
-
error: code === 0 ? 'Failed to parse result' : `Process failed with code ${code}`,
|
|
133
|
-
},
|
|
134
|
-
timestamp: new Date(),
|
|
135
|
-
requestId: command.requestId,
|
|
136
|
-
correlationId: command.correlationId,
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
});
|
|
103
|
+
const parsed = JSON.parse(resultJson) as { success?: boolean; outputPath?: string; error?: string };
|
|
104
|
+
if (parsed.success === true) {
|
|
105
|
+
return {
|
|
106
|
+
type: 'SchemaExported',
|
|
107
|
+
data: { directory, outputPath: parsed.outputPath ?? '' },
|
|
108
|
+
timestamp: new Date(),
|
|
109
|
+
requestId: command.requestId,
|
|
110
|
+
correlationId: command.correlationId,
|
|
111
|
+
};
|
|
112
|
+
} else {
|
|
113
|
+
return {
|
|
114
|
+
type: 'SchemaExportFailed',
|
|
115
|
+
data: { directory, error: parsed.error ?? 'Unknown error' },
|
|
116
|
+
timestamp: new Date(),
|
|
117
|
+
requestId: command.requestId,
|
|
118
|
+
correlationId: command.correlationId,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
141
121
|
} catch (error: unknown) {
|
|
142
122
|
const message = error instanceof Error ? error.message : String(error);
|
|
143
123
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { DataSinkItem, DataSourceItem, MessageTarget, Integration, DefaultRecord } from './types';
|
|
2
|
-
import { createIntegrationOrigin } from './types';
|
|
3
1
|
import { integrationExportRegistry } from './integration-export-registry';
|
|
2
|
+
import type { DataSinkItem, DataSourceItem, DefaultRecord, Integration, MessageTarget } from './types';
|
|
3
|
+
import { createIntegrationOrigin } from './types';
|
|
4
4
|
|
|
5
5
|
// Extended interfaces that add chainable methods
|
|
6
6
|
export interface ChainableSinkMethods {
|
|
@@ -19,19 +19,17 @@ export type ChainableSource = DataSourceItem & ChainableSourceMethods;
|
|
|
19
19
|
function createChainableSink(sinkItem: DataSinkItem): ChainableSink {
|
|
20
20
|
const chainable = sinkItem as ChainableSink;
|
|
21
21
|
|
|
22
|
-
(chainable as ChainableSinkMethods).additionalInstructions =
|
|
23
|
-
|
|
22
|
+
(chainable as ChainableSinkMethods).additionalInstructions = (instructions: string): ChainableSink =>
|
|
23
|
+
createChainableSink({
|
|
24
24
|
...sinkItem,
|
|
25
25
|
_additionalInstructions: instructions,
|
|
26
26
|
});
|
|
27
|
-
};
|
|
28
27
|
|
|
29
|
-
(chainable as ChainableSinkMethods).withState =
|
|
30
|
-
|
|
28
|
+
(chainable as ChainableSinkMethods).withState = (source: DataSourceItem | ChainableSource): ChainableSink =>
|
|
29
|
+
createChainableSink({
|
|
31
30
|
...sinkItem,
|
|
32
31
|
_withState: source,
|
|
33
32
|
});
|
|
34
|
-
};
|
|
35
33
|
|
|
36
34
|
return chainable;
|
|
37
35
|
}
|
|
@@ -39,12 +37,11 @@ function createChainableSink(sinkItem: DataSinkItem): ChainableSink {
|
|
|
39
37
|
function createChainableSource(sourceItem: DataSourceItem): ChainableSource {
|
|
40
38
|
const chainable = sourceItem as ChainableSource;
|
|
41
39
|
|
|
42
|
-
(chainable as ChainableSourceMethods).additionalInstructions =
|
|
43
|
-
|
|
40
|
+
(chainable as ChainableSourceMethods).additionalInstructions = (instructions: string): ChainableSource =>
|
|
41
|
+
createChainableSource({
|
|
44
42
|
...sourceItem,
|
|
45
43
|
_additionalInstructions: instructions,
|
|
46
44
|
});
|
|
47
|
-
};
|
|
48
45
|
|
|
49
46
|
return chainable;
|
|
50
47
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
2
2
|
import { command, react } from './fluent-builder';
|
|
3
|
+
import { clearCurrentNarrative, startNarrative } from './narrative-context';
|
|
3
4
|
import { createIntegration } from './types';
|
|
4
|
-
import { startNarrative, clearCurrentNarrative } from './narrative-context';
|
|
5
5
|
|
|
6
6
|
// Test integrations
|
|
7
7
|
const MailChimp = createIntegration('mailchimp', 'MailChimp');
|
package/src/fluent-builder.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import createDebug from 'debug';
|
|
2
|
+
import { type ASTNode, print } from 'graphql';
|
|
3
|
+
import type { CommandSlice, ExperienceSlice, QuerySlice, ReactSlice } from './index';
|
|
2
4
|
import {
|
|
3
5
|
addSlice,
|
|
4
|
-
startClientBlock,
|
|
5
6
|
endClientBlock,
|
|
6
|
-
startServerBlock,
|
|
7
7
|
endServerBlock,
|
|
8
8
|
getCurrentSlice,
|
|
9
|
+
startClientBlock,
|
|
10
|
+
startServerBlock,
|
|
9
11
|
} from './narrative-context';
|
|
10
|
-
import {
|
|
11
|
-
import { print, ASTNode } from 'graphql';
|
|
12
|
-
import createDebug from 'debug';
|
|
12
|
+
import type { Integration } from './types';
|
|
13
13
|
|
|
14
14
|
const debug = createDebug('auto:narrative:fluent-builder');
|
|
15
15
|
if ('color' in debug && typeof debug === 'object') {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import * as flowApi from './narrative';
|
|
5
|
-
import * as fluent from './fluent-builder';
|
|
1
|
+
import { type IFileStore, InMemoryFileStore } from '@auto-engineer/file-store';
|
|
2
|
+
import gql from 'graphql-tag';
|
|
3
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
6
4
|
import * as dataBuilders from './data-narrative-builders';
|
|
5
|
+
import * as fluent from './fluent-builder';
|
|
6
|
+
import { clearGetNarrativesCache, getNarratives } from './getNarratives';
|
|
7
|
+
import * as flowApi from './narrative';
|
|
7
8
|
import * as typesApi from './types';
|
|
8
|
-
import gql from 'graphql-tag';
|
|
9
9
|
|
|
10
10
|
const importMap = {
|
|
11
11
|
'../flow': flowApi,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { DataSource, Example, Narrative, Model, modelToNarrative, QuerySlice } from './index';
|
|
4
|
-
import { fileURLToPath } from 'url';
|
|
5
|
-
import path from 'path';
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
6
3
|
import { InMemoryFileStore } from '@auto-engineer/file-store';
|
|
7
4
|
import { NodeFileStore } from '@auto-engineer/file-store/node';
|
|
5
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
8
6
|
import { getNarratives } from './getNarratives';
|
|
7
|
+
import { type DataSource, type Example, type Model, modelToNarrative, type Narrative, type QuerySlice } from './index';
|
|
8
|
+
import { modelSchema } from './schema';
|
|
9
9
|
|
|
10
10
|
const __filename = fileURLToPath(import.meta.url);
|
|
11
11
|
const __dirname = path.dirname(__filename);
|
|
@@ -688,7 +688,7 @@ flow('questionnaires-test', () => {
|
|
|
688
688
|
validateQuestionnaireBugFix(model);
|
|
689
689
|
});
|
|
690
690
|
|
|
691
|
-
it('should convert all given events to eventRef', async
|
|
691
|
+
it('should convert all given events to eventRef', async (): Promise<void> => {
|
|
692
692
|
const memoryVfs = new InMemoryFileStore();
|
|
693
693
|
const todoSummaryFlowContent = `
|
|
694
694
|
import { flow, query, specs, rule, example, type Event, type State } from '@auto-engineer/narrative';
|
package/src/getNarratives.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { IFileStore } from '@auto-engineer/file-store';
|
|
1
2
|
import createDebug from 'debug';
|
|
3
|
+
import { sha256 } from 'js-sha256';
|
|
4
|
+
import type { Model, Narrative } from './index';
|
|
5
|
+
import { executeAST } from './loader';
|
|
2
6
|
import { registry } from './narrative-registry';
|
|
3
|
-
import type { Narrative, Model } from './index';
|
|
4
7
|
import { narrativesToModel } from './transformers/narrative-to-model';
|
|
5
|
-
import type { IFileStore } from '@auto-engineer/file-store';
|
|
6
|
-
import { executeAST } from './loader';
|
|
7
|
-
import { sha256 } from 'js-sha256';
|
|
8
8
|
|
|
9
9
|
const dirnamePosix = (p: string) => {
|
|
10
10
|
const s = p.replace(/\/+$/, '');
|
|
@@ -22,7 +22,15 @@ const CACHE_VERSION = 'v1';
|
|
|
22
22
|
|
|
23
23
|
function stableStringify(obj: Record<string, unknown>) {
|
|
24
24
|
const keys = Object.keys(obj).sort();
|
|
25
|
-
return JSON.stringify(
|
|
25
|
+
return JSON.stringify(
|
|
26
|
+
keys.reduce(
|
|
27
|
+
(acc, key) => {
|
|
28
|
+
acc[key] = obj[key];
|
|
29
|
+
return acc;
|
|
30
|
+
},
|
|
31
|
+
{} as Record<string, unknown>,
|
|
32
|
+
),
|
|
33
|
+
);
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
function toUint8(view: ArrayBuffer | Uint8Array): Uint8Array {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import type { Model } from '../index';
|
|
2
3
|
import { addAutoIds } from './';
|
|
3
|
-
import { Model } from '../index';
|
|
4
4
|
|
|
5
5
|
describe('addAutoIds', () => {
|
|
6
6
|
const flows: Model = {
|
package/src/id/addAutoIds.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { ClientSpecNode, Example, Model, Rule, Slice, Spec, Step } from '../index';
|
|
1
2
|
import { generateAutoId } from './generators';
|
|
2
|
-
import { Model, Slice, Spec, Rule, Example, Step, ClientSpecNode } from '../index';
|
|
3
3
|
|
|
4
4
|
function ensureId(item: { id?: string }): void {
|
|
5
5
|
if (item.id === undefined || item.id === '') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { hasAllIds, addAutoIds } from './index';
|
|
3
2
|
import type { Model } from '../index';
|
|
3
|
+
import { addAutoIds, hasAllIds } from './index';
|
|
4
4
|
|
|
5
5
|
describe('hasAllIds', () => {
|
|
6
6
|
const createModelWithoutIds = (): Model => ({
|
package/src/id/hasAllIds.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ClientSpecNode, Example, Model, Rule, Slice, Spec, Step } from '../index';
|
|
2
2
|
|
|
3
3
|
function hasValidId(item: { id?: string }): boolean {
|
|
4
4
|
return item.id !== undefined && item.id !== '';
|
package/src/id/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import type { z } from 'zod';
|
|
2
2
|
|
|
3
|
+
// Apollo GraphQL
|
|
4
|
+
export { gql } from 'graphql-tag';
|
|
5
|
+
export { DataSinkSchema, DataSourceSchema, MessageTargetSchema } from './schema';
|
|
3
6
|
// Core types and utilities
|
|
4
7
|
export type {
|
|
5
|
-
|
|
8
|
+
Command,
|
|
9
|
+
DataItem,
|
|
6
10
|
DataSink,
|
|
7
|
-
DataSource,
|
|
8
11
|
DataSinkItem,
|
|
12
|
+
DataSource,
|
|
9
13
|
DataSourceItem,
|
|
10
|
-
DataItem,
|
|
11
|
-
MessageTarget,
|
|
12
14
|
Destination,
|
|
15
|
+
Event,
|
|
16
|
+
Integration,
|
|
17
|
+
MessageTarget,
|
|
13
18
|
Origin,
|
|
14
19
|
State,
|
|
15
|
-
Command,
|
|
16
|
-
Event,
|
|
17
20
|
} from './types';
|
|
18
|
-
export { MessageTargetSchema, DataSinkSchema, DataSourceSchema } from './schema';
|
|
19
21
|
export { createIntegration } from './types';
|
|
20
22
|
|
|
21
|
-
// Apollo GraphQL
|
|
22
|
-
export { gql } from 'graphql-tag';
|
|
23
|
-
|
|
24
23
|
// HTTP GET template literal function
|
|
25
24
|
export const get = (strings: TemplateStringsArray, ...values: unknown[]) => {
|
|
26
25
|
return strings.reduce((result, str, i) => {
|
|
@@ -29,75 +28,83 @@ export const get = (strings: TemplateStringsArray, ...values: unknown[]) => {
|
|
|
29
28
|
}, '');
|
|
30
29
|
};
|
|
31
30
|
|
|
31
|
+
export type { ExportSchemaEvents } from './commands/export-schema';
|
|
32
|
+
export type { FieldSelector } from './data-narrative-builders';
|
|
33
|
+
|
|
34
|
+
// Data narrative builders
|
|
35
|
+
export { sink, source } from './data-narrative-builders';
|
|
32
36
|
// Fluent API
|
|
33
37
|
export type {
|
|
34
38
|
FluentCommandSliceBuilder,
|
|
39
|
+
FluentExperienceSliceBuilder,
|
|
35
40
|
FluentQuerySliceBuilder,
|
|
36
41
|
FluentReactionSliceBuilder,
|
|
37
|
-
FluentExperienceSliceBuilder,
|
|
38
42
|
} from './fluent-builder';
|
|
39
|
-
export { command,
|
|
40
|
-
|
|
41
|
-
// Data narrative builders
|
|
42
|
-
export { sink, source } from './data-narrative-builders';
|
|
43
|
-
export type { FieldSelector } from './data-narrative-builders';
|
|
44
|
-
|
|
45
|
-
// Narrative language functions
|
|
46
|
-
export { narrative, narrative as flow } from './narrative';
|
|
47
|
-
export { client, server, specs, describe, it, should, request, data, rule, example, thenError } from './narrative';
|
|
48
|
-
export type { ExampleBuilder, GivenBuilder, WhenBuilder, ThenBuilder } from './narrative';
|
|
49
|
-
export type { SliceTypeValueInterface } from './narrative';
|
|
50
|
-
export { SliceType } from './narrative';
|
|
51
|
-
|
|
43
|
+
export { command, decide, evolve, experience, query, react } from './fluent-builder';
|
|
52
44
|
// Narrative conversion utilities
|
|
53
45
|
export { getNarratives } from './getNarratives';
|
|
54
|
-
export {
|
|
55
|
-
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
export type { ExampleBuilder, GivenBuilder, SliceTypeValueInterface, ThenBuilder, WhenBuilder } from './narrative';
|
|
47
|
+
// Narrative language functions
|
|
48
|
+
export {
|
|
49
|
+
client,
|
|
50
|
+
data,
|
|
51
|
+
describe,
|
|
52
|
+
example,
|
|
53
|
+
it,
|
|
54
|
+
narrative,
|
|
55
|
+
narrative as flow,
|
|
56
|
+
request,
|
|
57
|
+
rule,
|
|
58
|
+
SliceType,
|
|
59
|
+
server,
|
|
60
|
+
should,
|
|
61
|
+
specs,
|
|
62
|
+
thenError,
|
|
63
|
+
} from './narrative';
|
|
61
64
|
// Schema definitions for progressive narrative creation
|
|
62
65
|
export {
|
|
63
|
-
NarrativeNamesSchema as NarrativeNamesSystemSchema,
|
|
64
|
-
SliceNamesSchema as SliceNamesSystemSchema,
|
|
65
66
|
ClientServerNamesSchema as ClientServerNamesSystemSchema,
|
|
66
|
-
modelSchema as SpecsSystemSchema,
|
|
67
|
-
MessageFieldSchema,
|
|
68
|
-
MessageSchema,
|
|
69
67
|
CommandSchema,
|
|
68
|
+
CommandSliceSchema,
|
|
70
69
|
EventSchema,
|
|
71
|
-
|
|
70
|
+
ExampleSchema,
|
|
71
|
+
ExperienceSliceSchema,
|
|
72
72
|
IntegrationSchema,
|
|
73
|
-
|
|
73
|
+
MessageFieldSchema,
|
|
74
|
+
MessageSchema,
|
|
75
|
+
modelSchema as SpecsSystemSchema,
|
|
76
|
+
modelSchema,
|
|
77
|
+
NarrativeNamesSchema as NarrativeNamesSystemSchema,
|
|
78
|
+
NarrativeSchema,
|
|
74
79
|
QuerySliceSchema,
|
|
75
80
|
ReactSliceSchema,
|
|
76
|
-
ExperienceSliceSchema,
|
|
77
|
-
SliceSchema,
|
|
78
|
-
NarrativeSchema,
|
|
79
|
-
modelSchema,
|
|
80
|
-
ExampleSchema,
|
|
81
81
|
RuleSchema,
|
|
82
|
+
SliceNamesSchema as SliceNamesSystemSchema,
|
|
83
|
+
SliceSchema,
|
|
82
84
|
SpecSchema,
|
|
83
|
-
|
|
85
|
+
StateSchema,
|
|
84
86
|
StepErrorSchema,
|
|
87
|
+
StepSchema,
|
|
85
88
|
StepWithDocStringSchema,
|
|
86
89
|
StepWithErrorSchema,
|
|
87
90
|
} from './schema';
|
|
88
91
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
// Testing helpers
|
|
93
|
+
export { createNarrativeSpec, given as testGiven, when as testWhen } from './testing';
|
|
94
|
+
export { modelToNarrative } from './transformers/model-to-narrative';
|
|
95
|
+
|
|
96
|
+
import type {
|
|
97
|
+
CommandSliceSchema,
|
|
98
|
+
ExampleSchema,
|
|
99
|
+
ExperienceSliceSchema,
|
|
100
|
+
MessageFieldSchema,
|
|
101
|
+
MessageSchema,
|
|
92
102
|
modelSchema,
|
|
103
|
+
NarrativeSchema,
|
|
93
104
|
QuerySliceSchema,
|
|
94
105
|
ReactSliceSchema,
|
|
95
|
-
ExperienceSliceSchema,
|
|
96
|
-
MessageSchema,
|
|
97
|
-
MessageFieldSchema,
|
|
98
|
-
CommandSliceSchema,
|
|
99
|
-
ExampleSchema,
|
|
100
106
|
RuleSchema,
|
|
107
|
+
SliceSchema,
|
|
101
108
|
SpecSchema,
|
|
102
109
|
StepSchema,
|
|
103
110
|
} from './schema';
|
|
@@ -114,7 +121,7 @@ export type MessageField = z.infer<typeof MessageFieldSchema>;
|
|
|
114
121
|
export type Rule = z.infer<typeof RuleSchema>;
|
|
115
122
|
export type Spec = z.infer<typeof SpecSchema>;
|
|
116
123
|
export type Step = z.infer<typeof StepSchema>;
|
|
117
|
-
export type { ClientSpecNode } from './schema';
|
|
118
124
|
|
|
119
125
|
// ID assignment utilities
|
|
120
126
|
export { addAutoIds, hasAllIds } from './id';
|
|
127
|
+
export type { ClientSpecNode } from './schema';
|