@auto-engineer/information-architect 0.6.5 → 0.7.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 +12 -14
- package/.turbo/turbo-type-check.log +4 -5
- package/CHANGELOG.md +12 -0
- package/dist/commands/generate-ia.d.ts +12 -45
- package/dist/commands/generate-ia.d.ts.map +1 -1
- package/dist/commands/generate-ia.js +29 -23
- package/dist/commands/generate-ia.js.map +1 -1
- package/dist/ia-agent.d.ts +22 -0
- package/dist/ia-agent.d.ts.map +1 -0
- package/dist/ia-agent.js +131 -0
- package/dist/ia-agent.js.map +1 -0
- package/dist/index.d.ts +13 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -132
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/commands/generate-ia.ts +30 -26
- package/src/ia-agent.ts +152 -0
- package/src/index.ts +6 -154
- package/tsconfig.tsbuildinfo +1 -1
- package/.env +0 -7
- package/.turbo/turbo-format.log +0 -16
- package/.turbo/turbo-lint.log +0 -5
- package/dist/cli-manifest.d.ts +0 -3
- package/dist/cli-manifest.d.ts.map +0 -1
- package/dist/cli-manifest.js +0 -35
- package/dist/cli-manifest.js.map +0 -1
- package/src/cli-manifest.ts +0 -37
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @auto-engineer/information-architect@0.
|
|
2
|
+
> @auto-engineer/information-architect@0.7.0 build /home/runner/work/auto-engineer/auto-engineer/packages/information-architect
|
|
3
3
|
> tsc && tsx ../../scripts/fix-esm-imports.ts && cp src/auto-ux-schema.json dist/
|
|
4
4
|
|
|
5
5
|
Fixed ESM imports in dist/
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
[
|
|
12
|
-
|
|
13
|
-
[31m[39m
|
|
14
|
-
[?25h
|
|
1
|
+
|
|
2
|
+
> @auto-engineer/information-architect@0.7.0 test /home/runner/work/auto-engineer/auto-engineer/packages/information-architect
|
|
3
|
+
> vitest run
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[1m[46m RUN [49m[22m [36mv3.2.4 [39m[90m/home/runner/work/auto-engineer/auto-engineer/packages/information-architect[39m
|
|
7
|
+
|
|
8
|
+
No test files found, exiting with code 0
|
|
9
|
+
|
|
10
|
+
[2minclude: [22m[33m**/*.specs.{js,ts}[39m
|
|
11
|
+
[2mexclude: [22m[33m**/.tmp/**[2m, [22m**/node_modules/**[2m, [22m**/dist/**[39m
|
|
12
|
+
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
|
|
2
|
+
> @auto-engineer/information-architect@0.7.0 type-check /home/runner/work/auto-engineer/auto-engineer/packages/information-architect
|
|
3
|
+
> tsc --noEmit
|
|
4
|
+
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @auto-engineer/information-architect
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- add command details in dashboard
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @auto-engineer/ai-gateway@0.7.0
|
|
13
|
+
- @auto-engineer/message-bus@0.6.0
|
|
14
|
+
|
|
3
15
|
## 0.6.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,46 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare const generateIAManifest: {
|
|
3
|
-
handler: () => Promise<{
|
|
4
|
-
default: CommandHandler<Readonly<{
|
|
5
|
-
type: "GenerateIA";
|
|
6
|
-
data: Readonly<{
|
|
7
|
-
outputDir: string;
|
|
8
|
-
flowFiles: string[];
|
|
9
|
-
}>;
|
|
10
|
-
timestamp?: Date;
|
|
11
|
-
requestId?: string;
|
|
12
|
-
correlationId?: string;
|
|
13
|
-
}>, Readonly<{
|
|
14
|
-
type: "IAGenerated";
|
|
15
|
-
data: {
|
|
16
|
-
outputPath: string;
|
|
17
|
-
outputDir: string;
|
|
18
|
-
flowFiles: string[];
|
|
19
|
-
};
|
|
20
|
-
timestamp?: Date;
|
|
21
|
-
requestId?: string;
|
|
22
|
-
correlationId?: string;
|
|
23
|
-
}> | Readonly<{
|
|
24
|
-
type: "IAGenerationFailed";
|
|
25
|
-
data: {
|
|
26
|
-
error: string;
|
|
27
|
-
outputDir: string;
|
|
28
|
-
flowFiles: string[];
|
|
29
|
-
};
|
|
30
|
-
timestamp?: Date;
|
|
31
|
-
requestId?: string;
|
|
32
|
-
correlationId?: string;
|
|
33
|
-
}>>;
|
|
34
|
-
}>;
|
|
35
|
-
description: string;
|
|
36
|
-
usage: string;
|
|
37
|
-
examples: string[];
|
|
38
|
-
args: {
|
|
39
|
-
name: string;
|
|
40
|
-
description: string;
|
|
41
|
-
required: boolean;
|
|
42
|
-
}[];
|
|
43
|
-
};
|
|
1
|
+
import { type Command, type Event } from '@auto-engineer/message-bus';
|
|
44
2
|
export type GenerateIACommand = Command<'GenerateIA', {
|
|
45
3
|
outputDir: string;
|
|
46
4
|
flowFiles: string[];
|
|
@@ -55,6 +13,15 @@ export type IAGenerationFailedEvent = Event<'IAGenerationFailed', {
|
|
|
55
13
|
outputDir: string;
|
|
56
14
|
flowFiles: string[];
|
|
57
15
|
}>;
|
|
58
|
-
export declare const
|
|
59
|
-
|
|
16
|
+
export declare const commandHandler: import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
|
|
17
|
+
type: "GenerateIA";
|
|
18
|
+
data: Readonly<{
|
|
19
|
+
outputDir: string;
|
|
20
|
+
flowFiles: string[];
|
|
21
|
+
}>;
|
|
22
|
+
timestamp?: Date;
|
|
23
|
+
requestId?: string;
|
|
24
|
+
correlationId?: string;
|
|
25
|
+
}>>;
|
|
26
|
+
export default commandHandler;
|
|
60
27
|
//# sourceMappingURL=generate-ia.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-ia.d.ts","sourceRoot":"","sources":["../../src/commands/generate-ia.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"generate-ia.d.ts","sourceRoot":"","sources":["../../src/commands/generate-ia.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAwB,MAAM,4BAA4B,CAAC;AAiB5F,MAAM,MAAM,iBAAiB,GAAG,OAAO,CACrC,YAAY,EACZ;IACE,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CACF,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAClC,aAAa,EACb;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CACF,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,KAAK,CACzC,oBAAoB,EACpB;IACE,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CACF,CAAC;AAEF,eAAO,MAAM,cAAc;;;mBAvBZ,MAAM;mBACN,MAAM,EAAE;;;;;GAgDrB,CAAC;AA2JH,eAAe,cAAc,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineCommandHandler } from '@auto-engineer/message-bus';
|
|
1
2
|
import { promises as fs } from 'fs';
|
|
2
3
|
import * as path from 'path';
|
|
3
4
|
import { fileURLToPath } from 'url';
|
|
@@ -10,16 +11,34 @@ const debugAtoms = createDebug('ia:generate-command:atoms');
|
|
|
10
11
|
const debugResult = createDebug('ia:generate-command:result');
|
|
11
12
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
13
|
const __dirname = path.dirname(__filename);
|
|
13
|
-
export const
|
|
14
|
-
|
|
14
|
+
export const commandHandler = defineCommandHandler({
|
|
15
|
+
name: 'GenerateIA',
|
|
16
|
+
alias: 'generate:ia',
|
|
15
17
|
description: 'Generate Information Architecture',
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
category: 'generate',
|
|
19
|
+
fields: {
|
|
20
|
+
outputDir: {
|
|
21
|
+
description: 'Context directory',
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
flowFiles: {
|
|
25
|
+
description: 'Flow files to analyze',
|
|
26
|
+
required: true,
|
|
27
|
+
// Note: flowFiles is an array, so it doesn't have a simple position
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
examples: ['$ auto generate:ia --output-dir=./.context --flow-files=./flows/*.flow.ts'],
|
|
31
|
+
handle: async (command) => {
|
|
32
|
+
const result = await handleGenerateIACommandInternal(command);
|
|
33
|
+
if (result.type === 'IAGenerated') {
|
|
34
|
+
debug('IA schema generated successfully');
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
debug('Failed: %s', result.data.error);
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
},
|
|
41
|
+
});
|
|
23
42
|
async function getAtomsFromMarkdown(designSystemDir) {
|
|
24
43
|
const mdPath = path.join(designSystemDir, 'design-system.md');
|
|
25
44
|
debugAtoms('Looking for design-system.md at: %s', mdPath);
|
|
@@ -145,19 +164,6 @@ async function handleGenerateIACommandInternal(command) {
|
|
|
145
164
|
return failureEvent;
|
|
146
165
|
}
|
|
147
166
|
}
|
|
148
|
-
export const generateIACommandHandler = {
|
|
149
|
-
name: 'GenerateIA',
|
|
150
|
-
handle: async (command) => {
|
|
151
|
-
const result = await handleGenerateIACommandInternal(command);
|
|
152
|
-
if (result.type === 'IAGenerated') {
|
|
153
|
-
debug('IA schema generated successfully');
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
debug('Failed: %s', result.data.error);
|
|
157
|
-
}
|
|
158
|
-
return result;
|
|
159
|
-
},
|
|
160
|
-
};
|
|
161
167
|
// Default export is the command handler
|
|
162
|
-
export default
|
|
168
|
+
export default commandHandler;
|
|
163
169
|
//# sourceMappingURL=generate-ia.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-ia.js","sourceRoot":"","sources":["../../src/commands/generate-ia.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-ia.js","sourceRoot":"","sources":["../../src/commands/generate-ia.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAAC;AAC9D,MAAM,UAAU,GAAG,WAAW,CAAC,2BAA2B,CAAC,CAAC;AAC5D,MAAM,UAAU,GAAG,WAAW,CAAC,2BAA2B,CAAC,CAAC;AAC5D,MAAM,WAAW,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAAC;AAE9D,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAA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;AACH,CAAC;AAED,wCAAwC;AACxC,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AIProvider } from '@auto-engineer/ai-gateway';
|
|
2
|
+
import { type UXSchema, type AIAgentOutput } from './types.js';
|
|
3
|
+
export declare class InformationArchitectAgent {
|
|
4
|
+
private provider;
|
|
5
|
+
constructor(provider?: AIProvider);
|
|
6
|
+
generateUXComponents(flows: string[], uxSchema: UXSchema, existingSchema?: object, atoms?: {
|
|
7
|
+
name: string;
|
|
8
|
+
props: {
|
|
9
|
+
name: string;
|
|
10
|
+
type: string;
|
|
11
|
+
}[];
|
|
12
|
+
}[]): Promise<AIAgentOutput>;
|
|
13
|
+
private constructPrompt;
|
|
14
|
+
}
|
|
15
|
+
export declare function processFlowsWithAI(flows: string[], uxSchema: UXSchema, existingSchema?: object, atoms?: {
|
|
16
|
+
name: string;
|
|
17
|
+
props: {
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
}[];
|
|
21
|
+
}[]): Promise<AIAgentOutput>;
|
|
22
|
+
//# sourceMappingURL=ia-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ia-agent.d.ts","sourceRoot":"","sources":["../src/ia-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAe/D,qBAAa,yBAAyB;IACpC,OAAO,CAAC,QAAQ,CAAa;gBAEjB,QAAQ,GAAE,UAAiC;IAIjD,oBAAoB,CACxB,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,EAAE,QAAQ,EAClB,cAAc,CAAC,EAAE,MAAM,EACvB,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,EAAE,GAClE,OAAO,CAAC,aAAa,CAAC;IAkBzB,OAAO,CAAC,eAAe;CA+FxB;AAED,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,EAAE,QAAQ,EAClB,cAAc,CAAC,EAAE,MAAM,EACvB,KAAK,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,EAAE,GAClE,OAAO,CAAC,aAAa,CAAC,CAGxB"}
|
package/dist/ia-agent.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { generateTextWithAI, AIProvider } from '@auto-engineer/ai-gateway';
|
|
2
|
+
function extractJsonFromMarkdown(text) {
|
|
3
|
+
return text.replace(/```(?:json)?\s*([\s\S]*?)\s*```/, '$1').trim();
|
|
4
|
+
}
|
|
5
|
+
function isJsonString(str) {
|
|
6
|
+
try {
|
|
7
|
+
JSON.parse(str);
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class InformationArchitectAgent {
|
|
15
|
+
constructor(provider = AIProvider.Anthropic) {
|
|
16
|
+
this.provider = provider;
|
|
17
|
+
}
|
|
18
|
+
async generateUXComponents(flows, uxSchema, existingSchema, atoms) {
|
|
19
|
+
const prompt = this.constructPrompt(flows, uxSchema, existingSchema, atoms);
|
|
20
|
+
try {
|
|
21
|
+
const response = await generateTextWithAI(prompt, this.provider, { temperature: 0.7, maxTokens: 4096 });
|
|
22
|
+
if (!response) {
|
|
23
|
+
throw new Error('No response from AI agent');
|
|
24
|
+
}
|
|
25
|
+
const clean = extractJsonFromMarkdown(response);
|
|
26
|
+
if (!isJsonString(clean)) {
|
|
27
|
+
throw new Error('AI did not return valid JSON. Got: ' + clean.slice(0, 100));
|
|
28
|
+
}
|
|
29
|
+
return JSON.parse(clean);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
console.error('Error calling AI integration:', error);
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
constructPrompt(flows, uxSchema, existingSchema, atoms) {
|
|
37
|
+
return `
|
|
38
|
+
You are an expert UI architect and product designer. Given the following flows and UX schema, generate a detailed JSON specification for the application's UI components and pages.
|
|
39
|
+
|
|
40
|
+
IMPORTANT: Only generate pages and components that are directly referenced in the provided flows. Do NOT add any extra pages or components, and do NOT make assumptions outside the flows. If something is not mentioned in the flows, it should NOT appear in the output.
|
|
41
|
+
IMPORTANT: try your best to reuse the existing atoms, and try not to generate atoms with context: like Submit Button, because the submit part is mainly irrelevant, instead just use the Button atom if provided.
|
|
42
|
+
|
|
43
|
+
$${atoms ? `Here is a list of available atomic components (atoms) from the design system. Use these atoms and their props as much as possible. Only create new atoms if absolutely necessary. And only put the new atoms created into the schema. \n\nAtoms:\n${JSON.stringify(atoms, null, 2)}\n` : ''}
|
|
44
|
+
Flows:
|
|
45
|
+
${JSON.stringify(flows, null, 2)}
|
|
46
|
+
|
|
47
|
+
UX Schema:
|
|
48
|
+
${JSON.stringify(uxSchema, null, 2)}
|
|
49
|
+
|
|
50
|
+
${existingSchema ? `Here is the current IA schema. Only add, update, or remove what is necessary based on the new flows and UX schema. Preserve what is still relevant and do not make unnecessary changes.\n\nCurrent IA Schema:\n${JSON.stringify(existingSchema, null, 2)}\n` : ''}
|
|
51
|
+
Instructions:
|
|
52
|
+
|
|
53
|
+
- Respond ONLY with a JSON object, no explanation, no markdown, no text before or after.
|
|
54
|
+
- The JSON should have two main sections: "components" and "pages".
|
|
55
|
+
- In "components", define composite UI elements (atoms, molecules, organisms) with:
|
|
56
|
+
- A description
|
|
57
|
+
- A "composition" field listing the building blocks used, grouped by type:
|
|
58
|
+
- "atoms": for atomic UI primitives (e.g., Button, Text, InputField)
|
|
59
|
+
- "molecules": for reusable, mid-level components (composed of atoms)
|
|
60
|
+
- "organisms": for larger, smart UI components (composed of molecules)
|
|
61
|
+
- Example:
|
|
62
|
+
"composition": {
|
|
63
|
+
"atoms": ["Button", "Text"],
|
|
64
|
+
"molecules": ["SearchBar"],
|
|
65
|
+
"organisms": ["TopNavBar"]
|
|
66
|
+
}
|
|
67
|
+
- In "pages", define each page as a key, with:
|
|
68
|
+
- route (URL path)
|
|
69
|
+
- description
|
|
70
|
+
- layout (listing the organisms used)
|
|
71
|
+
- navigation (array of navigation actions, e.g., { "on": "Click Listing Card", "to": "ListingDetailPage" })
|
|
72
|
+
- data_requirements (array, as above, for page-level data fetching)
|
|
73
|
+
- For each component or page, if there are any specs defined in the flows using specs('ComponentOrPageName', ...), extract all should(...) statements from .client(() => { ... }) blocks and assign them as an array of strings to a 'specs' field for the corrosponding component/page.
|
|
74
|
+
- Only include specs from .client(() => { ... }) blocks, not from server() or other blocks.
|
|
75
|
+
- If no specs are found for a component/page, omit the 'specs' field.
|
|
76
|
+
|
|
77
|
+
Use the following structure as a template for your response:
|
|
78
|
+
----
|
|
79
|
+
{
|
|
80
|
+
"atoms": {
|
|
81
|
+
"items": {
|
|
82
|
+
"AtomName": {
|
|
83
|
+
....
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"molecules": {
|
|
88
|
+
"items": {
|
|
89
|
+
"ComponentName": {
|
|
90
|
+
"description": "What this component does.",
|
|
91
|
+
"composition": { "primitives": ["Primitive1", "Primitive2"] },
|
|
92
|
+
"data_requirements": [
|
|
93
|
+
{
|
|
94
|
+
"type": "query",
|
|
95
|
+
"description": "What data is fetched.",
|
|
96
|
+
"trigger": "When the query runs.",
|
|
97
|
+
"details": {
|
|
98
|
+
"source": "Where the data comes from.",
|
|
99
|
+
"gql": "GraphQL query or subscription"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// ... more components
|
|
106
|
+
},
|
|
107
|
+
"pages": {
|
|
108
|
+
"PageName": {
|
|
109
|
+
"route": "/route",
|
|
110
|
+
"description": "What this page does.",
|
|
111
|
+
"layout": { "organisms": ["Organism1", "Organism2"] },
|
|
112
|
+
"navigation": [{ "on": "Event", "to": "TargetPage" }],
|
|
113
|
+
"data_requirements": [
|
|
114
|
+
// ... as above
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
// ... more pages
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
----
|
|
121
|
+
|
|
122
|
+
Be concise but thorough. Use the flows and UX schema to infer the necessary components, their composition, and data requirements.
|
|
123
|
+
Do not include any text, explanation, or markdown—only the JSON object as described.
|
|
124
|
+
`;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export async function processFlowsWithAI(flows, uxSchema, existingSchema, atoms) {
|
|
128
|
+
const agent = new InformationArchitectAgent();
|
|
129
|
+
return agent.generateUXComponents(flows, uxSchema, existingSchema, atoms);
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=ia-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ia-agent.js","sourceRoot":"","sources":["../src/ia-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG3E,SAAS,uBAAuB,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,iCAAiC,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;AACtE,CAAC;AAED,SAAS,YAAY,CAAC,GAAW;IAC/B,IAAI,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,OAAO,yBAAyB;IAGpC,YAA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E,CAAC,CAAC;;;EAG9B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;;EAEjC,cAAc,CAAC,CAAC,CAAC,kNAAkN,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0EpR,CAAC;IACA,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,KAAe,EACf,QAAkB,EAClB,cAAuB,EACvB,KAAmE;IAEnE,MAAM,KAAK,GAAG,IAAI,yBAAyB,EAAE,CAAC;IAC9C,OAAO,KAAK,CAAC,oBAAoB,CAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;AAC5E,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
export declare function processFlowsWithAI(flows: string[], uxSchema: UXSchema, existingSchema?: object, atoms?: {
|
|
16
|
-
name: string;
|
|
17
|
-
props: {
|
|
18
|
-
name: string;
|
|
19
|
-
type: string;
|
|
20
|
-
}[];
|
|
21
|
-
}[]): Promise<AIAgentOutput>;
|
|
22
|
-
export * from './commands/generate-ia';
|
|
23
|
-
export { CLI_MANIFEST } from './cli-manifest';
|
|
1
|
+
export { InformationArchitectAgent, processFlowsWithAI } from './ia-agent.js';
|
|
2
|
+
export type { UXSchema, AIAgentOutput } from './types.js';
|
|
3
|
+
export declare const COMMANDS: import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
|
|
4
|
+
type: "GenerateIA";
|
|
5
|
+
data: Readonly<{
|
|
6
|
+
outputDir: string;
|
|
7
|
+
flowFiles: string[];
|
|
8
|
+
}>;
|
|
9
|
+
timestamp?: Date;
|
|
10
|
+
requestId?: string;
|
|
11
|
+
correlationId?: string;
|
|
12
|
+
}>>[];
|
|
13
|
+
export { type GenerateIACommand, type IAGeneratedEvent, type IAGenerationFailedEvent } from './commands/generate-ia';
|
|
24
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC9E,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG1D,eAAO,MAAM,QAAQ;;;;;;;;;KAAsB,CAAC;AAC5C,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,133 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function isJsonString(str) {
|
|
6
|
-
try {
|
|
7
|
-
JSON.parse(str);
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
catch {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export class InformationArchitectAgent {
|
|
15
|
-
constructor(provider = AIProvider.Anthropic) {
|
|
16
|
-
this.provider = provider;
|
|
17
|
-
}
|
|
18
|
-
async generateUXComponents(flows, uxSchema, existingSchema, atoms) {
|
|
19
|
-
const prompt = this.constructPrompt(flows, uxSchema, existingSchema, atoms);
|
|
20
|
-
try {
|
|
21
|
-
const response = await generateTextWithAI(prompt, this.provider, { temperature: 0.7, maxTokens: 4096 });
|
|
22
|
-
if (!response) {
|
|
23
|
-
throw new Error('No response from AI agent');
|
|
24
|
-
}
|
|
25
|
-
const clean = extractJsonFromMarkdown(response);
|
|
26
|
-
if (!isJsonString(clean)) {
|
|
27
|
-
throw new Error('AI did not return valid JSON. Got: ' + clean.slice(0, 100));
|
|
28
|
-
}
|
|
29
|
-
return JSON.parse(clean);
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
console.error('Error calling AI integration:', error);
|
|
33
|
-
throw error;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
constructPrompt(flows, uxSchema, existingSchema, atoms) {
|
|
37
|
-
return `
|
|
38
|
-
You are an expert UI architect and product designer. Given the following flows and UX schema, generate a detailed JSON specification for the application's UI components and pages.
|
|
39
|
-
|
|
40
|
-
IMPORTANT: Only generate pages and components that are directly referenced in the provided flows. Do NOT add any extra pages or components, and do NOT make assumptions outside the flows. If something is not mentioned in the flows, it should NOT appear in the output.
|
|
41
|
-
IMPORTANT: try your best to reuse the existing atoms, and try not to generate atoms with context: like Submit Button, because the submit part is mainly irrelevant, instead just use the Button atom if provided.
|
|
42
|
-
|
|
43
|
-
$${atoms ? `Here is a list of available atomic components (atoms) from the design system. Use these atoms and their props as much as possible. Only create new atoms if absolutely necessary. And only put the new atoms created into the schema. \n\nAtoms:\n${JSON.stringify(atoms, null, 2)}\n` : ''}
|
|
44
|
-
Flows:
|
|
45
|
-
${JSON.stringify(flows, null, 2)}
|
|
46
|
-
|
|
47
|
-
UX Schema:
|
|
48
|
-
${JSON.stringify(uxSchema, null, 2)}
|
|
49
|
-
|
|
50
|
-
${existingSchema ? `Here is the current IA schema. Only add, update, or remove what is necessary based on the new flows and UX schema. Preserve what is still relevant and do not make unnecessary changes.\n\nCurrent IA Schema:\n${JSON.stringify(existingSchema, null, 2)}\n` : ''}
|
|
51
|
-
Instructions:
|
|
52
|
-
|
|
53
|
-
- Respond ONLY with a JSON object, no explanation, no markdown, no text before or after.
|
|
54
|
-
- The JSON should have two main sections: "components" and "pages".
|
|
55
|
-
- In "components", define composite UI elements (atoms, molecules, organisms) with:
|
|
56
|
-
- A description
|
|
57
|
-
- A "composition" field listing the building blocks used, grouped by type:
|
|
58
|
-
- "atoms": for atomic UI primitives (e.g., Button, Text, InputField)
|
|
59
|
-
- "molecules": for reusable, mid-level components (composed of atoms)
|
|
60
|
-
- "organisms": for larger, smart UI components (composed of molecules)
|
|
61
|
-
- Example:
|
|
62
|
-
"composition": {
|
|
63
|
-
"atoms": ["Button", "Text"],
|
|
64
|
-
"molecules": ["SearchBar"],
|
|
65
|
-
"organisms": ["TopNavBar"]
|
|
66
|
-
}
|
|
67
|
-
- In "pages", define each page as a key, with:
|
|
68
|
-
- route (URL path)
|
|
69
|
-
- description
|
|
70
|
-
- layout (listing the organisms used)
|
|
71
|
-
- navigation (array of navigation actions, e.g., { "on": "Click Listing Card", "to": "ListingDetailPage" })
|
|
72
|
-
- data_requirements (array, as above, for page-level data fetching)
|
|
73
|
-
- For each component or page, if there are any specs defined in the flows using specs('ComponentOrPageName', ...), extract all should(...) statements from .client(() => { ... }) blocks and assign them as an array of strings to a 'specs' field for the corrosponding component/page.
|
|
74
|
-
- Only include specs from .client(() => { ... }) blocks, not from server() or other blocks.
|
|
75
|
-
- If no specs are found for a component/page, omit the 'specs' field.
|
|
76
|
-
|
|
77
|
-
Use the following structure as a template for your response:
|
|
78
|
-
----
|
|
79
|
-
{
|
|
80
|
-
"atoms": {
|
|
81
|
-
"items": {
|
|
82
|
-
"AtomName": {
|
|
83
|
-
....
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
"molecules": {
|
|
88
|
-
"items": {
|
|
89
|
-
"ComponentName": {
|
|
90
|
-
"description": "What this component does.",
|
|
91
|
-
"composition": { "primitives": ["Primitive1", "Primitive2"] },
|
|
92
|
-
"data_requirements": [
|
|
93
|
-
{
|
|
94
|
-
"type": "query",
|
|
95
|
-
"description": "What data is fetched.",
|
|
96
|
-
"trigger": "When the query runs.",
|
|
97
|
-
"details": {
|
|
98
|
-
"source": "Where the data comes from.",
|
|
99
|
-
"gql": "GraphQL query or subscription"
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
]
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
// ... more components
|
|
106
|
-
},
|
|
107
|
-
"pages": {
|
|
108
|
-
"PageName": {
|
|
109
|
-
"route": "/route",
|
|
110
|
-
"description": "What this page does.",
|
|
111
|
-
"layout": { "organisms": ["Organism1", "Organism2"] },
|
|
112
|
-
"navigation": [{ "on": "Event", "to": "TargetPage" }],
|
|
113
|
-
"data_requirements": [
|
|
114
|
-
// ... as above
|
|
115
|
-
]
|
|
116
|
-
}
|
|
117
|
-
// ... more pages
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
----
|
|
121
|
-
|
|
122
|
-
Be concise but thorough. Use the flows and UX schema to infer the necessary components, their composition, and data requirements.
|
|
123
|
-
Do not include any text, explanation, or markdown—only the JSON object as described.
|
|
124
|
-
`;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
export async function processFlowsWithAI(flows, uxSchema, existingSchema, atoms) {
|
|
128
|
-
const agent = new InformationArchitectAgent();
|
|
129
|
-
return agent.generateUXComponents(flows, uxSchema, existingSchema, atoms);
|
|
130
|
-
}
|
|
131
|
-
export * from './commands/generate-ia.js';
|
|
132
|
-
export { CLI_MANIFEST } from './cli-manifest.js';
|
|
1
|
+
// Barrel exports
|
|
2
|
+
export { InformationArchitectAgent, processFlowsWithAI } from './ia-agent.js';
|
|
3
|
+
import { commandHandler as generateIAHandler } from './commands/generate-ia.js';
|
|
4
|
+
export const COMMANDS = [generateIAHandler];
|
|
133
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAG9E,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC7E,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,iBAAiB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auto-engineer/information-architect",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@auto-engineer/ai-gateway": "^0.
|
|
18
|
-
"@auto-engineer/message-bus": "^0.
|
|
17
|
+
"@auto-engineer/ai-gateway": "^0.7.0",
|
|
18
|
+
"@auto-engineer/message-bus": "^0.6.0",
|
|
19
19
|
"fast-glob": "^3.3.2"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@auto-engineer/cli": "^0.
|
|
22
|
+
"@auto-engineer/cli": "^0.8.0"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "tsc && tsx ../../scripts/fix-esm-imports.ts && cp src/auto-ux-schema.json dist/",
|