feat: add project-aware agent workspace
This commit is contained in:
@@ -4,7 +4,12 @@ import { resolve } from "node:path";
|
||||
import { zodToJsonSchema } from "zod-to-json-schema";
|
||||
import { answerUiCatalog, ANSWER_UI_VERSION } from "../src/features/agent/answer-ui/catalog.ts";
|
||||
|
||||
const target = resolve(process.argv[2] ?? "../next-tjwater-agent/src/chat/answer-ui-catalog.json");
|
||||
const targets = process.argv[2]
|
||||
? [resolve(process.argv[2])]
|
||||
: [
|
||||
resolve("../next-tjwater-agent/src/chat/answer-ui-catalog.json"),
|
||||
resolve("../next-tjwater-server/contracts/answer-ui-catalog.json")
|
||||
];
|
||||
const contract = {
|
||||
version: ANSWER_UI_VERSION,
|
||||
description:
|
||||
@@ -18,5 +23,7 @@ const contract = {
|
||||
])
|
||||
)
|
||||
};
|
||||
await writeFile(target, `${JSON.stringify(contract, null, 2)}\n`);
|
||||
process.stdout.write(`Exported ${contract.components.length} components to ${target}\n`);
|
||||
for (const target of targets) {
|
||||
await writeFile(target, `${JSON.stringify(contract, null, 2)}\n`);
|
||||
process.stdout.write(`Exported ${contract.components.length} components to ${target}\n`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user