@autoview/cli 0.1.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/LICENSE +661 -0
- package/README.md +407 -0
- package/lib/AutoViewAgent.d.ts +109 -0
- package/lib/AutoViewAgent.js +123 -0
- package/lib/AutoViewAgent.js.map +1 -0
- package/lib/agent/emitMcpServer.d.ts +15 -0
- package/lib/agent/emitMcpServer.js +157 -0
- package/lib/agent/emitMcpServer.js.map +1 -0
- package/lib/agent/emitReport.d.ts +14 -0
- package/lib/agent/emitReport.js +85 -0
- package/lib/agent/emitReport.js.map +1 -0
- package/lib/agent/toolSurface.d.ts +130 -0
- package/lib/agent/toolSurface.js +342 -0
- package/lib/agent/toolSurface.js.map +1 -0
- package/lib/agent/verifyAgentTasks.d.ts +87 -0
- package/lib/agent/verifyAgentTasks.js +126 -0
- package/lib/agent/verifyAgentTasks.js.map +1 -0
- package/lib/cli/main.d.ts +2 -0
- package/lib/cli/main.js +295 -0
- package/lib/cli/main.js.map +1 -0
- package/lib/compiler/AutoViewInterfaceCompiler.d.ts +27 -0
- package/lib/compiler/AutoViewInterfaceCompiler.js +68 -0
- package/lib/compiler/AutoViewInterfaceCompiler.js.map +1 -0
- package/lib/constants/AutoViewFrontendTemplate.d.ts +1 -0
- package/lib/constants/AutoViewFrontendTemplate.js +46 -0
- package/lib/constants/AutoViewFrontendTemplate.js.map +1 -0
- package/lib/constants/AutoViewSystemPromptConstant.d.ts +5 -0
- package/lib/constants/AutoViewSystemPromptConstant.js +4 -0
- package/lib/constants/AutoViewSystemPromptConstant.js.map +1 -0
- package/lib/context/IAutoViewAgentContext.d.ts +60 -0
- package/lib/context/IAutoViewAgentContext.js +3 -0
- package/lib/context/IAutoViewAgentContext.js.map +1 -0
- package/lib/fromSwagger.d.ts +53 -0
- package/lib/fromSwagger.js +513 -0
- package/lib/fromSwagger.js.map +1 -0
- package/lib/generateDeterministic.d.ts +26 -0
- package/lib/generateDeterministic.js +75 -0
- package/lib/generateDeterministic.js.map +1 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.js +41 -0
- package/lib/index.js.map +1 -0
- package/lib/orchestrate/orchestrateAutoView.d.ts +17 -0
- package/lib/orchestrate/orchestrateAutoView.js +491 -0
- package/lib/orchestrate/orchestrateAutoView.js.map +1 -0
- package/lib/orchestrate/orchestrateAutoViewProductPlan.d.ts +37 -0
- package/lib/orchestrate/orchestrateAutoViewProductPlan.js +109 -0
- package/lib/orchestrate/orchestrateAutoViewProductPlan.js.map +1 -0
- package/lib/orchestrate/orchestrateAutoViewRender.d.ts +133 -0
- package/lib/orchestrate/orchestrateAutoViewRender.js +943 -0
- package/lib/orchestrate/orchestrateAutoViewRender.js.map +1 -0
- package/lib/orchestrate/orchestrateAutoViewRenderDeterministic.d.ts +24 -0
- package/lib/orchestrate/orchestrateAutoViewRenderDeterministic.js +92 -0
- package/lib/orchestrate/orchestrateAutoViewRenderDeterministic.js.map +1 -0
- package/lib/orchestrate/orchestrateAutoViewReview.d.ts +48 -0
- package/lib/orchestrate/orchestrateAutoViewReview.js +328 -0
- package/lib/orchestrate/orchestrateAutoViewReview.js.map +1 -0
- package/lib/orchestrate/orchestrateAutoViewScaffold.d.ts +45 -0
- package/lib/orchestrate/orchestrateAutoViewScaffold.js +586 -0
- package/lib/orchestrate/orchestrateAutoViewScaffold.js.map +1 -0
- package/lib/orchestrate/orchestrateAutoViewSdkStudy.d.ts +26 -0
- package/lib/orchestrate/orchestrateAutoViewSdkStudy.js +85 -0
- package/lib/orchestrate/orchestrateAutoViewSdkStudy.js.map +1 -0
- package/lib/orchestrate/structures/IAutoViewProductPlan.d.ts +96 -0
- package/lib/orchestrate/structures/IAutoViewProductPlan.js +3 -0
- package/lib/orchestrate/structures/IAutoViewProductPlan.js.map +1 -0
- package/lib/orchestrate/structures/IAutoViewProductPlanApplication.d.ts +38 -0
- package/lib/orchestrate/structures/IAutoViewProductPlanApplication.js +3 -0
- package/lib/orchestrate/structures/IAutoViewProductPlanApplication.js.map +1 -0
- package/lib/orchestrate/structures/IAutoViewRenderApplication.d.ts +38 -0
- package/lib/orchestrate/structures/IAutoViewRenderApplication.js +3 -0
- package/lib/orchestrate/structures/IAutoViewRenderApplication.js.map +1 -0
- package/lib/orchestrate/structures/IAutoViewReviewApplication.d.ts +40 -0
- package/lib/orchestrate/structures/IAutoViewReviewApplication.js +3 -0
- package/lib/orchestrate/structures/IAutoViewReviewApplication.js.map +1 -0
- package/lib/orchestrate/structures/IAutoViewSdkMap.d.ts +63 -0
- package/lib/orchestrate/structures/IAutoViewSdkMap.js +3 -0
- package/lib/orchestrate/structures/IAutoViewSdkMap.js.map +1 -0
- package/lib/orchestrate/structures/IAutoViewSdkStudyApplication.d.ts +37 -0
- package/lib/orchestrate/structures/IAutoViewSdkStudyApplication.js +3 -0
- package/lib/orchestrate/structures/IAutoViewSdkStudyApplication.js.map +1 -0
- package/lib/orchestrate/utils/HistoryMessage.d.ts +10 -0
- package/lib/orchestrate/utils/HistoryMessage.js +25 -0
- package/lib/orchestrate/utils/HistoryMessage.js.map +1 -0
- package/lib/orchestrate/utils/auditFrontendRuntime.d.ts +53 -0
- package/lib/orchestrate/utils/auditFrontendRuntime.js +362 -0
- package/lib/orchestrate/utils/auditFrontendRuntime.js.map +1 -0
- package/lib/orchestrate/utils/buildDeterministicPlan.d.ts +4 -0
- package/lib/orchestrate/utils/buildDeterministicPlan.js +233 -0
- package/lib/orchestrate/utils/buildDeterministicPlan.js.map +1 -0
- package/lib/orchestrate/utils/buildDeterministicSdkMap.d.ts +22 -0
- package/lib/orchestrate/utils/buildDeterministicSdkMap.js +154 -0
- package/lib/orchestrate/utils/buildDeterministicSdkMap.js.map +1 -0
- package/lib/orchestrate/utils/cacheNodeModules.d.ts +31 -0
- package/lib/orchestrate/utils/cacheNodeModules.js +134 -0
- package/lib/orchestrate/utils/cacheNodeModules.js.map +1 -0
- package/lib/orchestrate/utils/describeEndpointPropsShape.d.ts +37 -0
- package/lib/orchestrate/utils/describeEndpointPropsShape.js +192 -0
- package/lib/orchestrate/utils/describeEndpointPropsShape.js.map +1 -0
- package/lib/orchestrate/utils/describeEndpointRequestBodyShape.d.ts +22 -0
- package/lib/orchestrate/utils/describeEndpointRequestBodyShape.js +29 -0
- package/lib/orchestrate/utils/describeEndpointRequestBodyShape.js.map +1 -0
- package/lib/orchestrate/utils/describeEndpointResponseShape.d.ts +19 -0
- package/lib/orchestrate/utils/describeEndpointResponseShape.js +30 -0
- package/lib/orchestrate/utils/describeEndpointResponseShape.js.map +1 -0
- package/lib/orchestrate/utils/executeCachedBatch.d.ts +22 -0
- package/lib/orchestrate/utils/executeCachedBatch.js +64 -0
- package/lib/orchestrate/utils/executeCachedBatch.js.map +1 -0
- package/lib/orchestrate/utils/loadShoppingFixture.d.ts +33 -0
- package/lib/orchestrate/utils/loadShoppingFixture.js +17 -0
- package/lib/orchestrate/utils/loadShoppingFixture.js.map +1 -0
- package/lib/orchestrate/utils/normalizeProductPlanPaths.d.ts +24 -0
- package/lib/orchestrate/utils/normalizeProductPlanPaths.js +77 -0
- package/lib/orchestrate/utils/normalizeProductPlanPaths.js.map +1 -0
- package/lib/orchestrate/utils/renderJsonSchema.d.ts +23 -0
- package/lib/orchestrate/utils/renderJsonSchema.js +122 -0
- package/lib/orchestrate/utils/renderJsonSchema.js.map +1 -0
- package/lib/orchestrate/utils/renderResourcePage.d.ts +36 -0
- package/lib/orchestrate/utils/renderResourcePage.js +1415 -0
- package/lib/orchestrate/utils/renderResourcePage.js.map +1 -0
- package/lib/orchestrate/utils/validateFrontendTypecheck.d.ts +109 -0
- package/lib/orchestrate/utils/validateFrontendTypecheck.js +274 -0
- package/lib/orchestrate/utils/validateFrontendTypecheck.js.map +1 -0
- package/lib/preview/renderPreview.d.ts +22 -0
- package/lib/preview/renderPreview.js +198 -0
- package/lib/preview/renderPreview.js.map +1 -0
- package/lib/typings/compiler.d.ts +39 -0
- package/lib/typings/compiler.js +3 -0
- package/lib/typings/compiler.js.map +1 -0
- package/lib/typings/events.d.ts +106 -0
- package/lib/typings/events.js +3 -0
- package/lib/typings/events.js.map +1 -0
- package/lib/typings/index.d.ts +10 -0
- package/lib/typings/index.js +27 -0
- package/lib/typings/index.js.map +1 -0
- package/lib/typings/misc.d.ts +78 -0
- package/lib/typings/misc.js +3 -0
- package/lib/typings/misc.js.map +1 -0
- package/lib/utils/ArrayUtil.d.ts +8 -0
- package/lib/utils/ArrayUtil.js +30 -0
- package/lib/utils/ArrayUtil.js.map +1 -0
- package/lib/utils/StringUtil.d.ts +11 -0
- package/lib/utils/StringUtil.js +28 -0
- package/lib/utils/StringUtil.js.map +1 -0
- package/lib/utils/classifyEndpoints.d.ts +62 -0
- package/lib/utils/classifyEndpoints.js +216 -0
- package/lib/utils/classifyEndpoints.js.map +1 -0
- package/lib/utils/endpointFilter.d.ts +26 -0
- package/lib/utils/endpointFilter.js +0 -0
- package/lib/utils/endpointFilter.js.map +1 -0
- package/lib/utils/extractFields.d.ts +85 -0
- package/lib/utils/extractFields.js +231 -0
- package/lib/utils/extractFields.js.map +1 -0
- package/lib/utils/index.d.ts +13 -0
- package/lib/utils/index.js +30 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/normalizeForNestia.d.ts +34 -0
- package/lib/utils/normalizeForNestia.js +133 -0
- package/lib/utils/normalizeForNestia.js.map +1 -0
- package/lib/utils/resourcePlan.d.ts +39 -0
- package/lib/utils/resourcePlan.js +95 -0
- package/lib/utils/resourcePlan.js.map +1 -0
- package/lib/utils/sliceDocument.d.ts +17 -0
- package/lib/utils/sliceDocument.js +114 -0
- package/lib/utils/sliceDocument.js.map +1 -0
- package/lib/utils/toEndpoints.d.ts +90 -0
- package/lib/utils/toEndpoints.js +227 -0
- package/lib/utils/toEndpoints.js.map +1 -0
- package/lib/verify/runWorkflows.d.ts +25 -0
- package/lib/verify/runWorkflows.js +366 -0
- package/lib/verify/runWorkflows.js.map +1 -0
- package/lib/verify/workflows.d.ts +53 -0
- package/lib/verify/workflows.js +107 -0
- package/lib/verify/workflows.js.map +1 -0
- package/package.json +82 -0
- package/prompts/AUTOVIEW_RENDER.md +398 -0
- package/prompts/AUTOVIEW_REVIEW.md +60 -0
- package/prompts/AUTOVIEW_SDK_STUDY.md +89 -0
- package/src/AutoViewAgent.ts +222 -0
- package/src/agent/emitMcpServer.integration.test.ts +168 -0
- package/src/agent/emitMcpServer.test.ts +51 -0
- package/src/agent/emitMcpServer.ts +178 -0
- package/src/agent/emitReport.ts +117 -0
- package/src/agent/toolSurface.test.ts +243 -0
- package/src/agent/toolSurface.ts +501 -0
- package/src/agent/verifyAgentTasks.test.ts +106 -0
- package/src/agent/verifyAgentTasks.ts +171 -0
- package/src/cli/main.ts +363 -0
- package/src/compiler/AutoViewInterfaceCompiler.ts +69 -0
- package/src/constants/AutoViewFrontendTemplate.ts +42 -0
- package/src/constants/AutoViewSystemPromptConstant.ts +6 -0
- package/src/context/IAutoViewAgentContext.ts +84 -0
- package/src/fromSwagger.test.ts +269 -0
- package/src/fromSwagger.ts +500 -0
- package/src/generateDeterministic.test.ts +39 -0
- package/src/generateDeterministic.ts +77 -0
- package/src/index.ts +30 -0
- package/src/orchestrate/orchestrateAutoView.ts +590 -0
- package/src/orchestrate/orchestrateAutoViewProductPlan.ts +121 -0
- package/src/orchestrate/orchestrateAutoViewRender.ts +1117 -0
- package/src/orchestrate/orchestrateAutoViewRenderDeterministic.ts +101 -0
- package/src/orchestrate/orchestrateAutoViewReview.ts +272 -0
- package/src/orchestrate/orchestrateAutoViewScaffold.ts +627 -0
- package/src/orchestrate/orchestrateAutoViewSdkStudy.ts +90 -0
- package/src/orchestrate/renderNavTs.test.ts +74 -0
- package/src/orchestrate/structures/IAutoViewProductPlan.ts +119 -0
- package/src/orchestrate/structures/IAutoViewProductPlanApplication.ts +41 -0
- package/src/orchestrate/structures/IAutoViewRenderApplication.ts +40 -0
- package/src/orchestrate/structures/IAutoViewReviewApplication.ts +42 -0
- package/src/orchestrate/structures/IAutoViewSdkMap.ts +72 -0
- package/src/orchestrate/structures/IAutoViewSdkStudyApplication.ts +40 -0
- package/src/orchestrate/utils/HistoryMessage.ts +41 -0
- package/src/orchestrate/utils/auditFrontendRuntime.test.ts +18 -0
- package/src/orchestrate/utils/auditFrontendRuntime.ts +454 -0
- package/src/orchestrate/utils/buildDeterministicPlan.test.ts +170 -0
- package/src/orchestrate/utils/buildDeterministicPlan.ts +289 -0
- package/src/orchestrate/utils/buildDeterministicSdkMap.test.ts +90 -0
- package/src/orchestrate/utils/buildDeterministicSdkMap.ts +169 -0
- package/src/orchestrate/utils/cacheNodeModules.ts +136 -0
- package/src/orchestrate/utils/describeEndpointPropsShape.test.ts +86 -0
- package/src/orchestrate/utils/describeEndpointPropsShape.ts +202 -0
- package/src/orchestrate/utils/describeEndpointRequestBodyShape.test.ts +87 -0
- package/src/orchestrate/utils/describeEndpointRequestBodyShape.ts +31 -0
- package/src/orchestrate/utils/describeEndpointResponseShape.test.ts +70 -0
- package/src/orchestrate/utils/describeEndpointResponseShape.ts +32 -0
- package/src/orchestrate/utils/executeCachedBatch.ts +59 -0
- package/src/orchestrate/utils/loadShoppingFixture.ts +52 -0
- package/src/orchestrate/utils/normalizeProductPlanPaths.ts +92 -0
- package/src/orchestrate/utils/renderJsonSchema.test.ts +162 -0
- package/src/orchestrate/utils/renderJsonSchema.ts +133 -0
- package/src/orchestrate/utils/renderResourcePage.test.ts +468 -0
- package/src/orchestrate/utils/renderResourcePage.ts +1624 -0
- package/src/orchestrate/utils/validateFrontendTypecheck.test.ts +32 -0
- package/src/orchestrate/utils/validateFrontendTypecheck.ts +335 -0
- package/src/preview/renderPreview.ts +273 -0
- package/src/typings/compiler.ts +47 -0
- package/src/typings/events.ts +155 -0
- package/src/typings/index.ts +10 -0
- package/src/typings/misc.ts +93 -0
- package/src/utils/ArrayUtil.ts +16 -0
- package/src/utils/StringUtil.ts +29 -0
- package/src/utils/classifyEndpoints.test.ts +86 -0
- package/src/utils/classifyEndpoints.ts +291 -0
- package/src/utils/endpointFilter.test.ts +50 -0
- package/src/utils/endpointFilter.ts +0 -0
- package/src/utils/extractFields.test.ts +82 -0
- package/src/utils/extractFields.ts +306 -0
- package/src/utils/index.ts +13 -0
- package/src/utils/normalizeForNestia.test.ts +93 -0
- package/src/utils/normalizeForNestia.ts +139 -0
- package/src/utils/resourcePlan.test.ts +104 -0
- package/src/utils/resourcePlan.ts +180 -0
- package/src/utils/sliceDocument.test.ts +85 -0
- package/src/utils/sliceDocument.ts +119 -0
- package/src/utils/toEndpoints.test.ts +251 -0
- package/src/utils/toEndpoints.ts +343 -0
- package/src/verify/runWorkflows.ts +403 -0
- package/src/verify/workflows.test.ts +117 -0
- package/src/verify/workflows.ts +154 -0
- package/template/CLAUDE.md +140 -0
- package/template/Dockerfile +31 -0
- package/template/PROMPT.md +80 -0
- package/template/SANDBOX.md +70 -0
- package/template/app/api/health/route.ts +10 -0
- package/template/app/globals.css +97 -0
- package/template/app/layout.tsx +30 -0
- package/template/app/page.tsx +19 -0
- package/template/components/AppShell.tsx +114 -0
- package/template/components/auto/CatalogGrid.tsx +159 -0
- package/template/components/auto/ConfirmButton.tsx +67 -0
- package/template/components/auto/EmbeddedCollection.tsx +144 -0
- package/template/components/auto/ResourceDashboard.tsx +104 -0
- package/template/components/auto/ResourceDetail.tsx +93 -0
- package/template/components/auto/ResourceForm.tsx +235 -0
- package/template/components/auto/ResourceIcon.tsx +88 -0
- package/template/components/auto/ResourceLanding.tsx +155 -0
- package/template/components/auto/ResourceTable.tsx +223 -0
- package/template/components/auto/formatValue.tsx +186 -0
- package/template/components/auto/types.ts +42 -0
- package/template/components/ui/badge.tsx +40 -0
- package/template/components/ui/button.tsx +57 -0
- package/template/components/ui/card.tsx +86 -0
- package/template/components/ui/dialog.tsx +119 -0
- package/template/components/ui/input.tsx +23 -0
- package/template/components/ui/label.tsx +24 -0
- package/template/components/ui/pagination.tsx +117 -0
- package/template/components/ui/select.tsx +92 -0
- package/template/components/ui/sheet.tsx +135 -0
- package/template/components/ui/skeleton.tsx +15 -0
- package/template/components/ui/table.tsx +120 -0
- package/template/components/ui/tabs.tsx +55 -0
- package/template/lib/utils.ts +35 -0
- package/template/next.config.mjs +52 -0
- package/template/package.json +46 -0
- package/template/postcss.config.js +6 -0
- package/template/scripts/start-shopping-backend.sh +56 -0
- package/template/tailwind.config.ts +96 -0
- package/template/tsconfig.json +29 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.orchestrateAutoViewSdkStudy = orchestrateAutoViewSdkStudy;
|
|
13
|
+
exports.renderSdkMapMarkdown = renderSdkMapMarkdown;
|
|
14
|
+
const uuid_1 = require("uuid");
|
|
15
|
+
const buildDeterministicSdkMap_1 = require("./utils/buildDeterministicSdkMap");
|
|
16
|
+
/**
|
|
17
|
+
* Phase 1 of the AutoView agent — SDK Study (deterministic).
|
|
18
|
+
*
|
|
19
|
+
* Derives the SDK domain map (resources / actors / journeys) structurally from
|
|
20
|
+
* the OpenAPI document instead of asking an LLM to read the compiled SDK. This
|
|
21
|
+
* is what lets a large swagger run at all: the former LLM study put the WHOLE
|
|
22
|
+
* SDK source in one prompt (300k+ tokens on a ~200-type spec) and hit a hard
|
|
23
|
+
* context overflow before Product Plan even began. The downstream phases use
|
|
24
|
+
* only the map's structure (Product Plan reads `actors[0].name`; Render reads an
|
|
25
|
+
* actor's journeys on its rerender fallback; Scaffold/Review embed it as a wiki
|
|
26
|
+
* document), so deriving it deterministically changes nothing the user sees —
|
|
27
|
+
* except that it always works, costs no tokens, and is reproducible.
|
|
28
|
+
*
|
|
29
|
+
* Kept `async` to preserve the orchestrator's call shape.
|
|
30
|
+
*/
|
|
31
|
+
function orchestrateAutoViewSdkStudy(ctx, props) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const map = (0, buildDeterministicSdkMap_1.buildDeterministicSdkMap)(props.document);
|
|
34
|
+
const summary = `Deterministic SDK map — ${map.resources.length} resources, ${map.actors.length} actor(s), derived structurally from the OpenAPI document (no LLM).`;
|
|
35
|
+
const markdown = renderSdkMapMarkdown(summary, map);
|
|
36
|
+
ctx.dispatch({
|
|
37
|
+
type: "autoViewSdkStudy",
|
|
38
|
+
id: (0, uuid_1.v7)(),
|
|
39
|
+
created_at: new Date().toISOString(),
|
|
40
|
+
step: props.step,
|
|
41
|
+
resources: map.resources.length,
|
|
42
|
+
actors: map.actors.length,
|
|
43
|
+
sdkMap: markdown,
|
|
44
|
+
});
|
|
45
|
+
return { map, markdown };
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/* -------------------------------------------------------------------------- */
|
|
49
|
+
/* markdown rendering for the event payload */
|
|
50
|
+
/* -------------------------------------------------------------------------- */
|
|
51
|
+
function renderSdkMapMarkdown(summary, map) {
|
|
52
|
+
const lines = [
|
|
53
|
+
"# SDK Domain Map",
|
|
54
|
+
"",
|
|
55
|
+
summary.trim(),
|
|
56
|
+
"",
|
|
57
|
+
"## Actors",
|
|
58
|
+
"",
|
|
59
|
+
];
|
|
60
|
+
for (const actor of map.actors) {
|
|
61
|
+
lines.push(`### ${actor.name}`, "");
|
|
62
|
+
for (const journey of actor.journeys) {
|
|
63
|
+
lines.push(`- ${journey}`);
|
|
64
|
+
}
|
|
65
|
+
lines.push("");
|
|
66
|
+
}
|
|
67
|
+
lines.push("## Resources", "");
|
|
68
|
+
for (const resource of map.resources) {
|
|
69
|
+
lines.push(`### ${resource.name} \`${resource.namespace}\``, "");
|
|
70
|
+
lines.push(`- **Purpose**: ${resource.purpose}`);
|
|
71
|
+
lines.push(`- **Actors**: ${resource.actorsInvolved.join(", ") || "(none)"}`);
|
|
72
|
+
if (resource.notes.trim().length > 0) {
|
|
73
|
+
lines.push(`- **Notes**: ${resource.notes}`);
|
|
74
|
+
}
|
|
75
|
+
lines.push("");
|
|
76
|
+
}
|
|
77
|
+
if (map.notableConstraints.length > 0) {
|
|
78
|
+
lines.push("## Notable constraints", "");
|
|
79
|
+
for (const c of map.notableConstraints) {
|
|
80
|
+
lines.push(`- ${c}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return lines.join("\n");
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=orchestrateAutoViewSdkStudy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrateAutoViewSdkStudy.js","sourceRoot":"","sources":["../../src/orchestrate/orchestrateAutoViewSdkStudy.ts"],"names":[],"mappings":";;;;;;;;;;;AAuBA,kEAsBC;AAMD,oDAsCC;AAvFD,+BAA0B;AAG1B,+EAA4E;AAG5E;;;;;;;;;;;;;;GAcG;AACH,SAAsB,2BAA2B,CAC/C,GAA0B,EAC1B,KAGC;;QAED,MAAM,GAAG,GAAG,IAAA,mDAAwB,EAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACrD,MAAM,OAAO,GAAG,2BAA2B,GAAG,CAAC,SAAS,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,CAAC,MAAM,qEAAqE,CAAC;QACrK,MAAM,QAAQ,GAAG,oBAAoB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAEpD,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,kBAAkB;YACxB,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM;YAC/B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM;YACzB,MAAM,EAAE,QAAQ;SACqB,CAAC,CAAC;QAEzC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;IAC3B,CAAC;CAAA;AAED,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,SAAgB,oBAAoB,CAClC,OAAe,EACf,GAAoB;IAEpB,MAAM,KAAK,GAAa;QACtB,kBAAkB;QAClB,EAAE;QACF,OAAO,CAAC,IAAI,EAAE;QACd,EAAE;QACF,WAAW;QACX,EAAE;KACH,CAAC;IACF,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QACpC,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACrC,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;QAC7B,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IAC/B,KAAK,MAAM,QAAQ,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;QACrC,KAAK,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,IAAI,OAAO,QAAQ,CAAC,SAAS,IAAI,EAAE,EAAE,CAAC,CAAC;QAClE,KAAK,CAAC,IAAI,CAAC,kBAAkB,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;QACjD,KAAK,CAAC,IAAI,CACR,iBAAiB,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,QAAQ,EAAE,CAClE,CAAC;QACF,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrC,KAAK,CAAC,IAAI,CAAC,gBAAgB,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;QAC/C,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IACD,IAAI,GAAG,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,KAAK,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;QACzC,KAAK,MAAM,CAAC,IAAI,GAAG,CAAC,kBAAkB,EAAE,CAAC;YACvC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured output of the AutoView Product Plan phase.
|
|
3
|
+
*
|
|
4
|
+
* Encodes the information architecture of the frontend product the agent
|
|
5
|
+
* intends to build on top of the SDK: which screens exist, what each screen
|
|
6
|
+
* does, which navigation surfaces an actor sees, and which endpoints are
|
|
7
|
+
* intentionally left out.
|
|
8
|
+
*
|
|
9
|
+
* Consumed verbatim by the Scaffold (file layout) and Render (per-screen TSX)
|
|
10
|
+
* phases.
|
|
11
|
+
*
|
|
12
|
+
* @author Samchon
|
|
13
|
+
*/
|
|
14
|
+
export interface IAutoViewProductPlan {
|
|
15
|
+
/** All screens the product exposes. Ordered for downstream rendering. */
|
|
16
|
+
screens: IAutoViewProductPlan.IScreen[];
|
|
17
|
+
/**
|
|
18
|
+
* Top-level navigation entries grouped by actor. Each entry lists the screens
|
|
19
|
+
* reachable from the actor's primary nav.
|
|
20
|
+
*/
|
|
21
|
+
navigation: IAutoViewProductPlan.INavigation[];
|
|
22
|
+
/**
|
|
23
|
+
* SDK endpoints (or whole resources) the plan deliberately leaves out, with a
|
|
24
|
+
* reason. Allows downstream phases and the operator to audit "omitted, not
|
|
25
|
+
* broken".
|
|
26
|
+
*/
|
|
27
|
+
intentionalOmissions: IAutoViewProductPlan.IOmission[];
|
|
28
|
+
}
|
|
29
|
+
export declare namespace IAutoViewProductPlan {
|
|
30
|
+
type UiPattern = "landing" | "catalog" | "detail" | "form" | "table" | "wizard" | "dashboard";
|
|
31
|
+
interface IScreen {
|
|
32
|
+
/**
|
|
33
|
+
* Next.js App Router path, e.g. `/catalog`, `/orders/[id]`,
|
|
34
|
+
* `/seller/sales`. Dynamic segments use bracket syntax.
|
|
35
|
+
*/
|
|
36
|
+
path: string;
|
|
37
|
+
/** Human-readable nav label (e.g. `"Catalog"`, `"Order detail"`). */
|
|
38
|
+
title: string;
|
|
39
|
+
/** One sentence: what does the user accomplish on this screen? */
|
|
40
|
+
purpose: string;
|
|
41
|
+
/**
|
|
42
|
+
* Actor name from {@link IAutoViewSdkMap.IActor.name}. Exactly one actor per
|
|
43
|
+
* screen — split when multiple actors need distinct views of the same
|
|
44
|
+
* data.
|
|
45
|
+
*/
|
|
46
|
+
actor: string;
|
|
47
|
+
/**
|
|
48
|
+
* SDK accessor paths the screen will compose, e.g.
|
|
49
|
+
* `["shoppings.customers.sales.index",
|
|
50
|
+
* "shoppings.customers.channels.index"]`. Order is significant: the first
|
|
51
|
+
* entry is the primary data source.
|
|
52
|
+
*/
|
|
53
|
+
endpoints: string[];
|
|
54
|
+
/**
|
|
55
|
+
* Closest fit from {@link UiPattern}. The Render phase reads this to pick
|
|
56
|
+
* shadcn primitives.
|
|
57
|
+
*/
|
|
58
|
+
uiPattern: UiPattern;
|
|
59
|
+
/**
|
|
60
|
+
* Free-form notes for the Render phase: required filters, empty-state copy
|
|
61
|
+
* hints, multi-step flows, etc. Empty string is fine.
|
|
62
|
+
*/
|
|
63
|
+
notes: string;
|
|
64
|
+
/**
|
|
65
|
+
* Resource hierarchy depth: 1 = a top-level resource (a landing-hub card),
|
|
66
|
+
* ≥2 = a nested resource reached from its parent's detail. Absent on the
|
|
67
|
+
* synthetic landing screen. Decides what belongs on the home hub — a
|
|
68
|
+
* structural fact, not a path-string guess.
|
|
69
|
+
*/
|
|
70
|
+
depth?: number;
|
|
71
|
+
}
|
|
72
|
+
interface INavigation {
|
|
73
|
+
/** Actor whose nav this describes. */
|
|
74
|
+
actor: string;
|
|
75
|
+
/**
|
|
76
|
+
* Screen paths (subset of {@link IAutoViewProductPlan.screens}' `path`
|
|
77
|
+
* values) that appear on this actor's primary nav, in the order they should
|
|
78
|
+
* render.
|
|
79
|
+
*/
|
|
80
|
+
primary: string[];
|
|
81
|
+
/**
|
|
82
|
+
* Screen paths reachable through a secondary path (drawer, profile menu,
|
|
83
|
+
* etc.). May be empty.
|
|
84
|
+
*/
|
|
85
|
+
secondary: string[];
|
|
86
|
+
}
|
|
87
|
+
interface IOmission {
|
|
88
|
+
/**
|
|
89
|
+
* What is being omitted — a resource name, an accessor path, or a short
|
|
90
|
+
* descriptive label.
|
|
91
|
+
*/
|
|
92
|
+
target: string;
|
|
93
|
+
/** One sentence explaining why it is out of product scope. */
|
|
94
|
+
reason: string;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoViewProductPlan.js","sourceRoot":"","sources":["../../../src/orchestrate/structures/IAutoViewProductPlan.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IAutoViewProductPlan } from "./IAutoViewProductPlan";
|
|
2
|
+
/**
|
|
3
|
+
* LLM function-calling surface for the AutoView Product Plan phase.
|
|
4
|
+
*
|
|
5
|
+
* The agent calls `buildProductPlan` exactly once with a completed
|
|
6
|
+
* {@link IAutoViewProductPlan} after reading the SDK map produced by the SDK
|
|
7
|
+
* Study phase. The orchestrator validates the plan against the actual SDK shape
|
|
8
|
+
* (every screen references real accessors, every actor is declared) before
|
|
9
|
+
* handing it to the Scaffold phase.
|
|
10
|
+
*
|
|
11
|
+
* @author Samchon
|
|
12
|
+
*/
|
|
13
|
+
export interface IAutoViewProductPlanApplication {
|
|
14
|
+
/**
|
|
15
|
+
* Emit the structured information architecture of the frontend product.
|
|
16
|
+
*
|
|
17
|
+
* Call this exactly once. The plan must list every screen the product
|
|
18
|
+
* exposes, the per-actor navigation, and any deliberate omissions with a
|
|
19
|
+
* one-sentence reason.
|
|
20
|
+
*
|
|
21
|
+
* @param props The completed plan plus a short narrative summary.
|
|
22
|
+
*/
|
|
23
|
+
buildProductPlan(props: IAutoViewProductPlanApplication.IProps): void;
|
|
24
|
+
}
|
|
25
|
+
export declare namespace IAutoViewProductPlanApplication {
|
|
26
|
+
interface IProps {
|
|
27
|
+
/**
|
|
28
|
+
* 2–4 sentence narrative summary of the product in the operator's voice —
|
|
29
|
+
* what kind of application is being built, which actors it serves, and what
|
|
30
|
+
* intentional shape decisions were made. Surfaced verbatim in the
|
|
31
|
+
* `autoViewProductPlan` event so the operator can sanity-check before
|
|
32
|
+
* authorizing scaffold/render.
|
|
33
|
+
*/
|
|
34
|
+
summary: string;
|
|
35
|
+
/** The structured product plan. */
|
|
36
|
+
plan: IAutoViewProductPlan;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoViewProductPlanApplication.js","sourceRoot":"","sources":["../../../src/orchestrate/structures/IAutoViewProductPlanApplication.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM function-calling surface for the AutoView Render phase.
|
|
3
|
+
*
|
|
4
|
+
* Each screen from {@link IAutoViewProductPlan.screens} is rendered by an
|
|
5
|
+
* isolated LLM call. The model returns the complete TSX source as one string;
|
|
6
|
+
* the orchestrator parses it with TypeScript and re-invokes the model with the
|
|
7
|
+
* diagnostic when the source fails to parse.
|
|
8
|
+
*
|
|
9
|
+
* @author Samchon
|
|
10
|
+
*/
|
|
11
|
+
export interface IAutoViewRenderApplication {
|
|
12
|
+
/**
|
|
13
|
+
* Emit the complete TSX source for one Next.js page.
|
|
14
|
+
*
|
|
15
|
+
* Call this exactly once per screen. The returned source must include `"use
|
|
16
|
+
* client";`, a single default `Page` export, every import the file uses, and
|
|
17
|
+
* explicit handling of the four UI states (loading / error / empty / data).
|
|
18
|
+
*
|
|
19
|
+
* @param props The TSX source plus a short rationale.
|
|
20
|
+
*/
|
|
21
|
+
renderPage(props: IAutoViewRenderApplication.IProps): void;
|
|
22
|
+
}
|
|
23
|
+
export declare namespace IAutoViewRenderApplication {
|
|
24
|
+
interface IProps {
|
|
25
|
+
/**
|
|
26
|
+
* One-line rationale explaining the rendering choices for this screen —
|
|
27
|
+
* which shadcn primitives were composed, why pagination vs. infinite
|
|
28
|
+
* scroll, etc. Surfaced in the `autoViewRenderPage` event so the operator
|
|
29
|
+
* can audit decisions without reading every TSX file.
|
|
30
|
+
*/
|
|
31
|
+
rationale: string;
|
|
32
|
+
/**
|
|
33
|
+
* Complete TSX source for the page. Starts with `"use client";` and exports
|
|
34
|
+
* a single default `Page` function.
|
|
35
|
+
*/
|
|
36
|
+
tsx: string;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoViewRenderApplication.js","sourceRoot":"","sources":["../../../src/orchestrate/structures/IAutoViewRenderApplication.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM function-calling surface for the AutoView UI Review phase.
|
|
3
|
+
*
|
|
4
|
+
* The agent calls `writeSdkFeedback` exactly once after the Render phase
|
|
5
|
+
* finishes. The orchestrator drops the returned markdown into
|
|
6
|
+
* `frontend/wiki/sdk-feedback.md` verbatim and surfaces the narrative summary
|
|
7
|
+
* in the `autoViewReview` event.
|
|
8
|
+
*
|
|
9
|
+
* @author Samchon
|
|
10
|
+
*/
|
|
11
|
+
export interface IAutoViewReviewApplication {
|
|
12
|
+
/**
|
|
13
|
+
* Emit the operator-facing markdown audit of the SDK that the Render phase
|
|
14
|
+
* produced pages against.
|
|
15
|
+
*
|
|
16
|
+
* Call this exactly once. The markdown must follow the section layout
|
|
17
|
+
* dictated by the system prompt (Summary / What worked / What's awkward /
|
|
18
|
+
* What's missing / Pages that broke). The downstream operator reads it
|
|
19
|
+
* verbatim.
|
|
20
|
+
*
|
|
21
|
+
* @param props The completed feedback document plus a short narrative summary
|
|
22
|
+
* for the event payload.
|
|
23
|
+
*/
|
|
24
|
+
writeSdkFeedback(props: IAutoViewReviewApplication.IProps): void;
|
|
25
|
+
}
|
|
26
|
+
export declare namespace IAutoViewReviewApplication {
|
|
27
|
+
interface IProps {
|
|
28
|
+
/**
|
|
29
|
+
* One-sentence summary of the overall SDK quality assessment. Surfaced in
|
|
30
|
+
* the `autoViewReview` event so the operator can decide whether to read the
|
|
31
|
+
* full feedback document.
|
|
32
|
+
*/
|
|
33
|
+
summary: string;
|
|
34
|
+
/**
|
|
35
|
+
* Complete markdown body of `wiki/sdk-feedback.md`. The orchestrator
|
|
36
|
+
* persists this verbatim.
|
|
37
|
+
*/
|
|
38
|
+
markdown: string;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoViewReviewApplication.js","sourceRoot":"","sources":["../../../src/orchestrate/structures/IAutoViewReviewApplication.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured output of the AutoView SDK Study phase.
|
|
3
|
+
*
|
|
4
|
+
* The agent populates this object by reading every TypeScript file under
|
|
5
|
+
* `src/api/` (plus the SDK's JSDoc comments) and inferring the resources,
|
|
6
|
+
* actors, and end-to-end journeys the SDK actually supports. The downstream
|
|
7
|
+
* Product Plan phase consumes this map verbatim to decide which screens belong
|
|
8
|
+
* in the frontend and which endpoints to omit.
|
|
9
|
+
*
|
|
10
|
+
* @author Samchon
|
|
11
|
+
*/
|
|
12
|
+
export interface IAutoViewSdkMap {
|
|
13
|
+
/** Coherent groups of endpoints organized around the same noun. */
|
|
14
|
+
resources: IAutoViewSdkMap.IResource[];
|
|
15
|
+
/** Roles the SDK serves (`customer`, `seller`, `administrator`, …). */
|
|
16
|
+
actors: IAutoViewSdkMap.IActor[];
|
|
17
|
+
/**
|
|
18
|
+
* SDK-level constraints worth surfacing to the Product Plan phase —
|
|
19
|
+
* pagination conventions, soft-delete semantics, auth scopes, idempotency
|
|
20
|
+
* keys, etc. One short sentence per entry.
|
|
21
|
+
*/
|
|
22
|
+
notableConstraints: string[];
|
|
23
|
+
}
|
|
24
|
+
export declare namespace IAutoViewSdkMap {
|
|
25
|
+
interface IResource {
|
|
26
|
+
/** Short noun, e.g. `sales`, `orders`, `channels`, `categories`. */
|
|
27
|
+
name: string;
|
|
28
|
+
/**
|
|
29
|
+
* Dotted accessor path of the primary namespace, e.g.
|
|
30
|
+
* `shoppings.customers.sales`. When the resource is exposed under more than
|
|
31
|
+
* one actor namespace, list the customer-facing one here and call the
|
|
32
|
+
* others out in {@link notes}.
|
|
33
|
+
*/
|
|
34
|
+
namespace: string;
|
|
35
|
+
/**
|
|
36
|
+
* One sentence in the operator's voice explaining _why_ the resource exists
|
|
37
|
+
* in the product. Not "CRUD on Sale" — "Browse and buy products that
|
|
38
|
+
* sellers have published".
|
|
39
|
+
*/
|
|
40
|
+
purpose: string;
|
|
41
|
+
/**
|
|
42
|
+
* Subset of actor names from {@link IAutoViewSdkMap.actors} that interact
|
|
43
|
+
* with this resource.
|
|
44
|
+
*/
|
|
45
|
+
actorsInvolved: string[];
|
|
46
|
+
/**
|
|
47
|
+
* Free-form notes for the Product Plan phase. Multi-actor exposure,
|
|
48
|
+
* pagination shape, soft-delete semantics, anything subtle. Empty string is
|
|
49
|
+
* fine.
|
|
50
|
+
*/
|
|
51
|
+
notes: string;
|
|
52
|
+
}
|
|
53
|
+
interface IActor {
|
|
54
|
+
/** Lower-case role identifier (e.g. `customer`). */
|
|
55
|
+
name: string;
|
|
56
|
+
/**
|
|
57
|
+
* 1–5 end-to-end goals this actor accomplishes by composing several
|
|
58
|
+
* endpoints. Each entry is an arrow chain such as `sign up → browse catalog
|
|
59
|
+
* → add to cart → checkout`.
|
|
60
|
+
*/
|
|
61
|
+
journeys: string[];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoViewSdkMap.js","sourceRoot":"","sources":["../../../src/orchestrate/structures/IAutoViewSdkMap.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IAutoViewSdkMap } from "./IAutoViewSdkMap";
|
|
2
|
+
/**
|
|
3
|
+
* LLM function-calling surface for the AutoView SDK Study phase.
|
|
4
|
+
*
|
|
5
|
+
* The agent calls `buildSdkMap` exactly once with a completed
|
|
6
|
+
* {@link IAutoViewSdkMap} after analyzing the SDK source. The orchestrator then
|
|
7
|
+
* validates the map against the actual SDK shape before handing it to the
|
|
8
|
+
* Product Plan phase.
|
|
9
|
+
*
|
|
10
|
+
* @author Samchon
|
|
11
|
+
*/
|
|
12
|
+
export interface IAutoViewSdkStudyApplication {
|
|
13
|
+
/**
|
|
14
|
+
* Emit the structured domain map produced from reading the SDK.
|
|
15
|
+
*
|
|
16
|
+
* Call this exactly once. The map must list every coherent resource the SDK
|
|
17
|
+
* exposes (no silent drops), every actor the SDK actually serves (no invented
|
|
18
|
+
* roles), and any SDK-level constraints a frontend developer would need to
|
|
19
|
+
* know up-front.
|
|
20
|
+
*
|
|
21
|
+
* @param props The completed map plus a short narrative summary.
|
|
22
|
+
*/
|
|
23
|
+
buildSdkMap(props: IAutoViewSdkStudyApplication.IProps): void;
|
|
24
|
+
}
|
|
25
|
+
export declare namespace IAutoViewSdkStudyApplication {
|
|
26
|
+
interface IProps {
|
|
27
|
+
/**
|
|
28
|
+
* 2–4 sentence narrative summary of the SDK in the operator's voice — the
|
|
29
|
+
* kind of paragraph an architect would write at the top of a design doc.
|
|
30
|
+
* Surfaced verbatim in the `autoViewSdkStudy` event so the operator can
|
|
31
|
+
* sanity-check the scope before authorizing the Product Plan phase.
|
|
32
|
+
*/
|
|
33
|
+
summary: string;
|
|
34
|
+
/** The structured domain map. */
|
|
35
|
+
map: IAutoViewSdkMap;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoViewSdkStudyApplication.js","sourceRoot":"","sources":["../../../src/orchestrate/structures/IAutoViewSdkStudyApplication.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
+
type HistoryTextFactory<T> = {
|
|
3
|
+
(text: string): T;
|
|
4
|
+
(strings: TemplateStringsArray, ...values: unknown[]): T;
|
|
5
|
+
};
|
|
6
|
+
export declare const HistoryMessage: {
|
|
7
|
+
system: HistoryTextFactory<IAgenticaHistoryJson.ISystemMessage>;
|
|
8
|
+
assistant: HistoryTextFactory<IAgenticaHistoryJson.IAssistantMessage>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HistoryMessage = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
const uuid_1 = require("uuid");
|
|
6
|
+
const trim = (input, ...values) => typeof input === "string"
|
|
7
|
+
? utils_1.StringUtil.trim([input])
|
|
8
|
+
: utils_1.StringUtil.trim(input, ...values);
|
|
9
|
+
const system = (input, ...values) => ({
|
|
10
|
+
id: (0, uuid_1.v7)(),
|
|
11
|
+
created_at: new Date().toISOString(),
|
|
12
|
+
type: "systemMessage",
|
|
13
|
+
text: trim(input, ...values),
|
|
14
|
+
});
|
|
15
|
+
const assistant = (input, ...values) => ({
|
|
16
|
+
id: (0, uuid_1.v7)(),
|
|
17
|
+
created_at: new Date().toISOString(),
|
|
18
|
+
type: "assistantMessage",
|
|
19
|
+
text: trim(input, ...values),
|
|
20
|
+
});
|
|
21
|
+
exports.HistoryMessage = {
|
|
22
|
+
system,
|
|
23
|
+
assistant,
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=HistoryMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HistoryMessage.js","sourceRoot":"","sources":["../../../src/orchestrate/utils/HistoryMessage.ts"],"names":[],"mappings":";;;AACA,uCAAyC;AACzC,+BAA0B;AAO1B,MAAM,IAAI,GAAG,CACX,KAAoC,EACpC,GAAG,MAAiB,EACZ,EAAE,CACV,OAAO,KAAK,KAAK,QAAQ;IACvB,CAAC,CAAC,kBAAU,CAAC,IAAI,CAAC,CAAC,KAAK,CAAoC,CAAC;IAC7D,CAAC,CAAC,kBAAU,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,CAAC;AAExC,MAAM,MAAM,GAA4D,CACtE,KAAoC,EACpC,GAAG,MAAiB,EACpB,EAAE,CAAC,CAAC;IACJ,EAAE,EAAE,IAAA,SAAE,GAAE;IACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;IACpC,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC;CAC7B,CAAC,CAAC;AAEH,MAAM,SAAS,GAA+D,CAC5E,KAAoC,EACpC,GAAG,MAAiB,EACpB,EAAE,CAAC,CAAC;IACJ,EAAE,EAAE,IAAA,SAAE,GAAE;IACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;IACpC,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC;CAC7B,CAAC,CAAC;AAEU,QAAA,cAAc,GAAG;IAC5B,MAAM;IACN,SAAS;CACV,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-page runtime defect captured by the Playwright audit. `console` covers
|
|
3
|
+
* `console.error` calls the page made during boot; `pageerror` covers uncaught
|
|
4
|
+
* exceptions; `navigation` covers Playwright's own `page.goto` failure
|
|
5
|
+
* (timeout, net::ERR, etc.) so the orchestrator sees the page as broken even
|
|
6
|
+
* when the runtime did not get a chance to fire a console message.
|
|
7
|
+
*/
|
|
8
|
+
export interface IRuntimeAuditDiagnostic {
|
|
9
|
+
/** Screen path the agent emitted (e.g. `/cart`, `/sales/[id]`). */
|
|
10
|
+
pagePath: string;
|
|
11
|
+
/** Category of failure. */
|
|
12
|
+
type: "console" | "pageerror" | "navigation";
|
|
13
|
+
/** Human-readable message — kept short so the retry prompt stays focused. */
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IAuditFrontendRuntimeResult {
|
|
17
|
+
/** Flat list of every diagnostic captured across all visited pages. */
|
|
18
|
+
diagnostics: IRuntimeAuditDiagnostic[];
|
|
19
|
+
/**
|
|
20
|
+
* Convenience map keyed by screen path → diagnostics on that page. Pages that
|
|
21
|
+
* booted without any console / pageerror / navigation issue are absent from
|
|
22
|
+
* the map (use {@link visited} for the full visit list).
|
|
23
|
+
*/
|
|
24
|
+
byPage: Map<string, IRuntimeAuditDiagnostic[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Screen paths that the audit attempted (`length === pages.length` on
|
|
27
|
+
* success).
|
|
28
|
+
*/
|
|
29
|
+
visited: string[];
|
|
30
|
+
/** Markdown body for `wiki/runtime-audit.md`. */
|
|
31
|
+
markdown: string;
|
|
32
|
+
/** Wall-clock duration of the whole audit (install + boot + visits + cleanup). */
|
|
33
|
+
elapsedMs: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Boot the assembled frontend under `next dev`, launch a headless Chromium via
|
|
37
|
+
* Playwright, visit every screen the product plan declared, and return the
|
|
38
|
+
* per-page console / pageerror / navigation diagnostics. Used by the
|
|
39
|
+
* orchestrator as Phase 6 (runtime audit) — the layer above `tsc --noEmit` that
|
|
40
|
+
* catches errors typecheck cannot see (`obj?.array.method(...)`
|
|
41
|
+
* undefined-access patterns, missing client-only guards, react render
|
|
42
|
+
* crashes).
|
|
43
|
+
*
|
|
44
|
+
* Operates in `NEXT_PUBLIC_API_SIMULATE=true` so the audit does not require a
|
|
45
|
+
* live backend — the SDK serves typia-random fixture data and pages exercise
|
|
46
|
+
* their real render paths. Live-backend variants can be added later by
|
|
47
|
+
* threading the host through.
|
|
48
|
+
*
|
|
49
|
+
* Throws on infrastructure failure (`npm install` crashed, port allocation
|
|
50
|
+
* failed, Chromium download blocked). Runtime errors on the pages themselves
|
|
51
|
+
* are returned as data; the whole point of this gate is to surface them.
|
|
52
|
+
*/
|
|
53
|
+
export declare function auditFrontendRuntime(files: Record<string, string>, pages: string[]): Promise<IAuditFrontendRuntimeResult>;
|