@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.
Files changed (297) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +407 -0
  3. package/lib/AutoViewAgent.d.ts +109 -0
  4. package/lib/AutoViewAgent.js +123 -0
  5. package/lib/AutoViewAgent.js.map +1 -0
  6. package/lib/agent/emitMcpServer.d.ts +15 -0
  7. package/lib/agent/emitMcpServer.js +157 -0
  8. package/lib/agent/emitMcpServer.js.map +1 -0
  9. package/lib/agent/emitReport.d.ts +14 -0
  10. package/lib/agent/emitReport.js +85 -0
  11. package/lib/agent/emitReport.js.map +1 -0
  12. package/lib/agent/toolSurface.d.ts +130 -0
  13. package/lib/agent/toolSurface.js +342 -0
  14. package/lib/agent/toolSurface.js.map +1 -0
  15. package/lib/agent/verifyAgentTasks.d.ts +87 -0
  16. package/lib/agent/verifyAgentTasks.js +126 -0
  17. package/lib/agent/verifyAgentTasks.js.map +1 -0
  18. package/lib/cli/main.d.ts +2 -0
  19. package/lib/cli/main.js +295 -0
  20. package/lib/cli/main.js.map +1 -0
  21. package/lib/compiler/AutoViewInterfaceCompiler.d.ts +27 -0
  22. package/lib/compiler/AutoViewInterfaceCompiler.js +68 -0
  23. package/lib/compiler/AutoViewInterfaceCompiler.js.map +1 -0
  24. package/lib/constants/AutoViewFrontendTemplate.d.ts +1 -0
  25. package/lib/constants/AutoViewFrontendTemplate.js +46 -0
  26. package/lib/constants/AutoViewFrontendTemplate.js.map +1 -0
  27. package/lib/constants/AutoViewSystemPromptConstant.d.ts +5 -0
  28. package/lib/constants/AutoViewSystemPromptConstant.js +4 -0
  29. package/lib/constants/AutoViewSystemPromptConstant.js.map +1 -0
  30. package/lib/context/IAutoViewAgentContext.d.ts +60 -0
  31. package/lib/context/IAutoViewAgentContext.js +3 -0
  32. package/lib/context/IAutoViewAgentContext.js.map +1 -0
  33. package/lib/fromSwagger.d.ts +53 -0
  34. package/lib/fromSwagger.js +513 -0
  35. package/lib/fromSwagger.js.map +1 -0
  36. package/lib/generateDeterministic.d.ts +26 -0
  37. package/lib/generateDeterministic.js +75 -0
  38. package/lib/generateDeterministic.js.map +1 -0
  39. package/lib/index.d.ts +15 -0
  40. package/lib/index.js +41 -0
  41. package/lib/index.js.map +1 -0
  42. package/lib/orchestrate/orchestrateAutoView.d.ts +17 -0
  43. package/lib/orchestrate/orchestrateAutoView.js +491 -0
  44. package/lib/orchestrate/orchestrateAutoView.js.map +1 -0
  45. package/lib/orchestrate/orchestrateAutoViewProductPlan.d.ts +37 -0
  46. package/lib/orchestrate/orchestrateAutoViewProductPlan.js +109 -0
  47. package/lib/orchestrate/orchestrateAutoViewProductPlan.js.map +1 -0
  48. package/lib/orchestrate/orchestrateAutoViewRender.d.ts +133 -0
  49. package/lib/orchestrate/orchestrateAutoViewRender.js +943 -0
  50. package/lib/orchestrate/orchestrateAutoViewRender.js.map +1 -0
  51. package/lib/orchestrate/orchestrateAutoViewRenderDeterministic.d.ts +24 -0
  52. package/lib/orchestrate/orchestrateAutoViewRenderDeterministic.js +92 -0
  53. package/lib/orchestrate/orchestrateAutoViewRenderDeterministic.js.map +1 -0
  54. package/lib/orchestrate/orchestrateAutoViewReview.d.ts +48 -0
  55. package/lib/orchestrate/orchestrateAutoViewReview.js +328 -0
  56. package/lib/orchestrate/orchestrateAutoViewReview.js.map +1 -0
  57. package/lib/orchestrate/orchestrateAutoViewScaffold.d.ts +45 -0
  58. package/lib/orchestrate/orchestrateAutoViewScaffold.js +586 -0
  59. package/lib/orchestrate/orchestrateAutoViewScaffold.js.map +1 -0
  60. package/lib/orchestrate/orchestrateAutoViewSdkStudy.d.ts +26 -0
  61. package/lib/orchestrate/orchestrateAutoViewSdkStudy.js +85 -0
  62. package/lib/orchestrate/orchestrateAutoViewSdkStudy.js.map +1 -0
  63. package/lib/orchestrate/structures/IAutoViewProductPlan.d.ts +96 -0
  64. package/lib/orchestrate/structures/IAutoViewProductPlan.js +3 -0
  65. package/lib/orchestrate/structures/IAutoViewProductPlan.js.map +1 -0
  66. package/lib/orchestrate/structures/IAutoViewProductPlanApplication.d.ts +38 -0
  67. package/lib/orchestrate/structures/IAutoViewProductPlanApplication.js +3 -0
  68. package/lib/orchestrate/structures/IAutoViewProductPlanApplication.js.map +1 -0
  69. package/lib/orchestrate/structures/IAutoViewRenderApplication.d.ts +38 -0
  70. package/lib/orchestrate/structures/IAutoViewRenderApplication.js +3 -0
  71. package/lib/orchestrate/structures/IAutoViewRenderApplication.js.map +1 -0
  72. package/lib/orchestrate/structures/IAutoViewReviewApplication.d.ts +40 -0
  73. package/lib/orchestrate/structures/IAutoViewReviewApplication.js +3 -0
  74. package/lib/orchestrate/structures/IAutoViewReviewApplication.js.map +1 -0
  75. package/lib/orchestrate/structures/IAutoViewSdkMap.d.ts +63 -0
  76. package/lib/orchestrate/structures/IAutoViewSdkMap.js +3 -0
  77. package/lib/orchestrate/structures/IAutoViewSdkMap.js.map +1 -0
  78. package/lib/orchestrate/structures/IAutoViewSdkStudyApplication.d.ts +37 -0
  79. package/lib/orchestrate/structures/IAutoViewSdkStudyApplication.js +3 -0
  80. package/lib/orchestrate/structures/IAutoViewSdkStudyApplication.js.map +1 -0
  81. package/lib/orchestrate/utils/HistoryMessage.d.ts +10 -0
  82. package/lib/orchestrate/utils/HistoryMessage.js +25 -0
  83. package/lib/orchestrate/utils/HistoryMessage.js.map +1 -0
  84. package/lib/orchestrate/utils/auditFrontendRuntime.d.ts +53 -0
  85. package/lib/orchestrate/utils/auditFrontendRuntime.js +362 -0
  86. package/lib/orchestrate/utils/auditFrontendRuntime.js.map +1 -0
  87. package/lib/orchestrate/utils/buildDeterministicPlan.d.ts +4 -0
  88. package/lib/orchestrate/utils/buildDeterministicPlan.js +233 -0
  89. package/lib/orchestrate/utils/buildDeterministicPlan.js.map +1 -0
  90. package/lib/orchestrate/utils/buildDeterministicSdkMap.d.ts +22 -0
  91. package/lib/orchestrate/utils/buildDeterministicSdkMap.js +154 -0
  92. package/lib/orchestrate/utils/buildDeterministicSdkMap.js.map +1 -0
  93. package/lib/orchestrate/utils/cacheNodeModules.d.ts +31 -0
  94. package/lib/orchestrate/utils/cacheNodeModules.js +134 -0
  95. package/lib/orchestrate/utils/cacheNodeModules.js.map +1 -0
  96. package/lib/orchestrate/utils/describeEndpointPropsShape.d.ts +37 -0
  97. package/lib/orchestrate/utils/describeEndpointPropsShape.js +192 -0
  98. package/lib/orchestrate/utils/describeEndpointPropsShape.js.map +1 -0
  99. package/lib/orchestrate/utils/describeEndpointRequestBodyShape.d.ts +22 -0
  100. package/lib/orchestrate/utils/describeEndpointRequestBodyShape.js +29 -0
  101. package/lib/orchestrate/utils/describeEndpointRequestBodyShape.js.map +1 -0
  102. package/lib/orchestrate/utils/describeEndpointResponseShape.d.ts +19 -0
  103. package/lib/orchestrate/utils/describeEndpointResponseShape.js +30 -0
  104. package/lib/orchestrate/utils/describeEndpointResponseShape.js.map +1 -0
  105. package/lib/orchestrate/utils/executeCachedBatch.d.ts +22 -0
  106. package/lib/orchestrate/utils/executeCachedBatch.js +64 -0
  107. package/lib/orchestrate/utils/executeCachedBatch.js.map +1 -0
  108. package/lib/orchestrate/utils/loadShoppingFixture.d.ts +33 -0
  109. package/lib/orchestrate/utils/loadShoppingFixture.js +17 -0
  110. package/lib/orchestrate/utils/loadShoppingFixture.js.map +1 -0
  111. package/lib/orchestrate/utils/normalizeProductPlanPaths.d.ts +24 -0
  112. package/lib/orchestrate/utils/normalizeProductPlanPaths.js +77 -0
  113. package/lib/orchestrate/utils/normalizeProductPlanPaths.js.map +1 -0
  114. package/lib/orchestrate/utils/renderJsonSchema.d.ts +23 -0
  115. package/lib/orchestrate/utils/renderJsonSchema.js +122 -0
  116. package/lib/orchestrate/utils/renderJsonSchema.js.map +1 -0
  117. package/lib/orchestrate/utils/renderResourcePage.d.ts +36 -0
  118. package/lib/orchestrate/utils/renderResourcePage.js +1415 -0
  119. package/lib/orchestrate/utils/renderResourcePage.js.map +1 -0
  120. package/lib/orchestrate/utils/validateFrontendTypecheck.d.ts +109 -0
  121. package/lib/orchestrate/utils/validateFrontendTypecheck.js +274 -0
  122. package/lib/orchestrate/utils/validateFrontendTypecheck.js.map +1 -0
  123. package/lib/preview/renderPreview.d.ts +22 -0
  124. package/lib/preview/renderPreview.js +198 -0
  125. package/lib/preview/renderPreview.js.map +1 -0
  126. package/lib/typings/compiler.d.ts +39 -0
  127. package/lib/typings/compiler.js +3 -0
  128. package/lib/typings/compiler.js.map +1 -0
  129. package/lib/typings/events.d.ts +106 -0
  130. package/lib/typings/events.js +3 -0
  131. package/lib/typings/events.js.map +1 -0
  132. package/lib/typings/index.d.ts +10 -0
  133. package/lib/typings/index.js +27 -0
  134. package/lib/typings/index.js.map +1 -0
  135. package/lib/typings/misc.d.ts +78 -0
  136. package/lib/typings/misc.js +3 -0
  137. package/lib/typings/misc.js.map +1 -0
  138. package/lib/utils/ArrayUtil.d.ts +8 -0
  139. package/lib/utils/ArrayUtil.js +30 -0
  140. package/lib/utils/ArrayUtil.js.map +1 -0
  141. package/lib/utils/StringUtil.d.ts +11 -0
  142. package/lib/utils/StringUtil.js +28 -0
  143. package/lib/utils/StringUtil.js.map +1 -0
  144. package/lib/utils/classifyEndpoints.d.ts +62 -0
  145. package/lib/utils/classifyEndpoints.js +216 -0
  146. package/lib/utils/classifyEndpoints.js.map +1 -0
  147. package/lib/utils/endpointFilter.d.ts +26 -0
  148. package/lib/utils/endpointFilter.js +0 -0
  149. package/lib/utils/endpointFilter.js.map +1 -0
  150. package/lib/utils/extractFields.d.ts +85 -0
  151. package/lib/utils/extractFields.js +231 -0
  152. package/lib/utils/extractFields.js.map +1 -0
  153. package/lib/utils/index.d.ts +13 -0
  154. package/lib/utils/index.js +30 -0
  155. package/lib/utils/index.js.map +1 -0
  156. package/lib/utils/normalizeForNestia.d.ts +34 -0
  157. package/lib/utils/normalizeForNestia.js +133 -0
  158. package/lib/utils/normalizeForNestia.js.map +1 -0
  159. package/lib/utils/resourcePlan.d.ts +39 -0
  160. package/lib/utils/resourcePlan.js +95 -0
  161. package/lib/utils/resourcePlan.js.map +1 -0
  162. package/lib/utils/sliceDocument.d.ts +17 -0
  163. package/lib/utils/sliceDocument.js +114 -0
  164. package/lib/utils/sliceDocument.js.map +1 -0
  165. package/lib/utils/toEndpoints.d.ts +90 -0
  166. package/lib/utils/toEndpoints.js +227 -0
  167. package/lib/utils/toEndpoints.js.map +1 -0
  168. package/lib/verify/runWorkflows.d.ts +25 -0
  169. package/lib/verify/runWorkflows.js +366 -0
  170. package/lib/verify/runWorkflows.js.map +1 -0
  171. package/lib/verify/workflows.d.ts +53 -0
  172. package/lib/verify/workflows.js +107 -0
  173. package/lib/verify/workflows.js.map +1 -0
  174. package/package.json +82 -0
  175. package/prompts/AUTOVIEW_RENDER.md +398 -0
  176. package/prompts/AUTOVIEW_REVIEW.md +60 -0
  177. package/prompts/AUTOVIEW_SDK_STUDY.md +89 -0
  178. package/src/AutoViewAgent.ts +222 -0
  179. package/src/agent/emitMcpServer.integration.test.ts +168 -0
  180. package/src/agent/emitMcpServer.test.ts +51 -0
  181. package/src/agent/emitMcpServer.ts +178 -0
  182. package/src/agent/emitReport.ts +117 -0
  183. package/src/agent/toolSurface.test.ts +243 -0
  184. package/src/agent/toolSurface.ts +501 -0
  185. package/src/agent/verifyAgentTasks.test.ts +106 -0
  186. package/src/agent/verifyAgentTasks.ts +171 -0
  187. package/src/cli/main.ts +363 -0
  188. package/src/compiler/AutoViewInterfaceCompiler.ts +69 -0
  189. package/src/constants/AutoViewFrontendTemplate.ts +42 -0
  190. package/src/constants/AutoViewSystemPromptConstant.ts +6 -0
  191. package/src/context/IAutoViewAgentContext.ts +84 -0
  192. package/src/fromSwagger.test.ts +269 -0
  193. package/src/fromSwagger.ts +500 -0
  194. package/src/generateDeterministic.test.ts +39 -0
  195. package/src/generateDeterministic.ts +77 -0
  196. package/src/index.ts +30 -0
  197. package/src/orchestrate/orchestrateAutoView.ts +590 -0
  198. package/src/orchestrate/orchestrateAutoViewProductPlan.ts +121 -0
  199. package/src/orchestrate/orchestrateAutoViewRender.ts +1117 -0
  200. package/src/orchestrate/orchestrateAutoViewRenderDeterministic.ts +101 -0
  201. package/src/orchestrate/orchestrateAutoViewReview.ts +272 -0
  202. package/src/orchestrate/orchestrateAutoViewScaffold.ts +627 -0
  203. package/src/orchestrate/orchestrateAutoViewSdkStudy.ts +90 -0
  204. package/src/orchestrate/renderNavTs.test.ts +74 -0
  205. package/src/orchestrate/structures/IAutoViewProductPlan.ts +119 -0
  206. package/src/orchestrate/structures/IAutoViewProductPlanApplication.ts +41 -0
  207. package/src/orchestrate/structures/IAutoViewRenderApplication.ts +40 -0
  208. package/src/orchestrate/structures/IAutoViewReviewApplication.ts +42 -0
  209. package/src/orchestrate/structures/IAutoViewSdkMap.ts +72 -0
  210. package/src/orchestrate/structures/IAutoViewSdkStudyApplication.ts +40 -0
  211. package/src/orchestrate/utils/HistoryMessage.ts +41 -0
  212. package/src/orchestrate/utils/auditFrontendRuntime.test.ts +18 -0
  213. package/src/orchestrate/utils/auditFrontendRuntime.ts +454 -0
  214. package/src/orchestrate/utils/buildDeterministicPlan.test.ts +170 -0
  215. package/src/orchestrate/utils/buildDeterministicPlan.ts +289 -0
  216. package/src/orchestrate/utils/buildDeterministicSdkMap.test.ts +90 -0
  217. package/src/orchestrate/utils/buildDeterministicSdkMap.ts +169 -0
  218. package/src/orchestrate/utils/cacheNodeModules.ts +136 -0
  219. package/src/orchestrate/utils/describeEndpointPropsShape.test.ts +86 -0
  220. package/src/orchestrate/utils/describeEndpointPropsShape.ts +202 -0
  221. package/src/orchestrate/utils/describeEndpointRequestBodyShape.test.ts +87 -0
  222. package/src/orchestrate/utils/describeEndpointRequestBodyShape.ts +31 -0
  223. package/src/orchestrate/utils/describeEndpointResponseShape.test.ts +70 -0
  224. package/src/orchestrate/utils/describeEndpointResponseShape.ts +32 -0
  225. package/src/orchestrate/utils/executeCachedBatch.ts +59 -0
  226. package/src/orchestrate/utils/loadShoppingFixture.ts +52 -0
  227. package/src/orchestrate/utils/normalizeProductPlanPaths.ts +92 -0
  228. package/src/orchestrate/utils/renderJsonSchema.test.ts +162 -0
  229. package/src/orchestrate/utils/renderJsonSchema.ts +133 -0
  230. package/src/orchestrate/utils/renderResourcePage.test.ts +468 -0
  231. package/src/orchestrate/utils/renderResourcePage.ts +1624 -0
  232. package/src/orchestrate/utils/validateFrontendTypecheck.test.ts +32 -0
  233. package/src/orchestrate/utils/validateFrontendTypecheck.ts +335 -0
  234. package/src/preview/renderPreview.ts +273 -0
  235. package/src/typings/compiler.ts +47 -0
  236. package/src/typings/events.ts +155 -0
  237. package/src/typings/index.ts +10 -0
  238. package/src/typings/misc.ts +93 -0
  239. package/src/utils/ArrayUtil.ts +16 -0
  240. package/src/utils/StringUtil.ts +29 -0
  241. package/src/utils/classifyEndpoints.test.ts +86 -0
  242. package/src/utils/classifyEndpoints.ts +291 -0
  243. package/src/utils/endpointFilter.test.ts +50 -0
  244. package/src/utils/endpointFilter.ts +0 -0
  245. package/src/utils/extractFields.test.ts +82 -0
  246. package/src/utils/extractFields.ts +306 -0
  247. package/src/utils/index.ts +13 -0
  248. package/src/utils/normalizeForNestia.test.ts +93 -0
  249. package/src/utils/normalizeForNestia.ts +139 -0
  250. package/src/utils/resourcePlan.test.ts +104 -0
  251. package/src/utils/resourcePlan.ts +180 -0
  252. package/src/utils/sliceDocument.test.ts +85 -0
  253. package/src/utils/sliceDocument.ts +119 -0
  254. package/src/utils/toEndpoints.test.ts +251 -0
  255. package/src/utils/toEndpoints.ts +343 -0
  256. package/src/verify/runWorkflows.ts +403 -0
  257. package/src/verify/workflows.test.ts +117 -0
  258. package/src/verify/workflows.ts +154 -0
  259. package/template/CLAUDE.md +140 -0
  260. package/template/Dockerfile +31 -0
  261. package/template/PROMPT.md +80 -0
  262. package/template/SANDBOX.md +70 -0
  263. package/template/app/api/health/route.ts +10 -0
  264. package/template/app/globals.css +97 -0
  265. package/template/app/layout.tsx +30 -0
  266. package/template/app/page.tsx +19 -0
  267. package/template/components/AppShell.tsx +114 -0
  268. package/template/components/auto/CatalogGrid.tsx +159 -0
  269. package/template/components/auto/ConfirmButton.tsx +67 -0
  270. package/template/components/auto/EmbeddedCollection.tsx +144 -0
  271. package/template/components/auto/ResourceDashboard.tsx +104 -0
  272. package/template/components/auto/ResourceDetail.tsx +93 -0
  273. package/template/components/auto/ResourceForm.tsx +235 -0
  274. package/template/components/auto/ResourceIcon.tsx +88 -0
  275. package/template/components/auto/ResourceLanding.tsx +155 -0
  276. package/template/components/auto/ResourceTable.tsx +223 -0
  277. package/template/components/auto/formatValue.tsx +186 -0
  278. package/template/components/auto/types.ts +42 -0
  279. package/template/components/ui/badge.tsx +40 -0
  280. package/template/components/ui/button.tsx +57 -0
  281. package/template/components/ui/card.tsx +86 -0
  282. package/template/components/ui/dialog.tsx +119 -0
  283. package/template/components/ui/input.tsx +23 -0
  284. package/template/components/ui/label.tsx +24 -0
  285. package/template/components/ui/pagination.tsx +117 -0
  286. package/template/components/ui/select.tsx +92 -0
  287. package/template/components/ui/sheet.tsx +135 -0
  288. package/template/components/ui/skeleton.tsx +15 -0
  289. package/template/components/ui/table.tsx +120 -0
  290. package/template/components/ui/tabs.tsx +55 -0
  291. package/template/lib/utils.ts +35 -0
  292. package/template/next.config.mjs +52 -0
  293. package/template/package.json +46 -0
  294. package/template/postcss.config.js +6 -0
  295. package/template/scripts/start-shopping-backend.sh +56 -0
  296. package/template/tailwind.config.ts +96 -0
  297. package/template/tsconfig.json +29 -0
@@ -0,0 +1,198 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.renderPreviewHtml = renderPreviewHtml;
4
+ const renderJsonSchema_1 = require("../orchestrate/utils/renderJsonSchema");
5
+ const utils_1 = require("../utils");
6
+ function renderPreviewHtml(document, meta, filter = {}) {
7
+ const endpoints = (0, utils_1.filterEndpoints)((0, utils_1.toEndpoints)(document), filter);
8
+ const unsupported = (0, utils_1.unsupportedOperations)(document);
9
+ const groups = (0, utils_1.classifyEndpoints)(endpoints, document);
10
+ const stats = computeStats(endpoints);
11
+ const sections = groups
12
+ .map((group) => renderResource(group, document))
13
+ .join("\n");
14
+ const droppedSection = unsupported.length === 0
15
+ ? ""
16
+ : `<section class="resource">
17
+ <h2 class="warn">dropped <small>${unsupported.length}</small></h2>
18
+ <p class="note">Operations HttpMigration could not parse (unsupported content type — raw binary upload/download). Listed so they are not lost silently; they need a hand-written page.</p>
19
+ ${unsupported
20
+ .map((u) => `<div class="endpoint"><div class="body" style="padding:.6rem">
21
+ <span class="method method-${u.method.toLowerCase()}">${esc(u.method)}</span>
22
+ <code class="path">${esc(u.path)}</code>
23
+ <span class="badge badge-warn">dropped</span>
24
+ <div class="detail muted" style="margin-top:.4rem">${esc(u.reason)}</div>
25
+ </div></div>`)
26
+ .join("\n")}
27
+ </section>`;
28
+ return `<!doctype html>
29
+ <html lang="en">
30
+ <head>
31
+ <meta charset="utf-8" />
32
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
33
+ <title>${esc(meta.title)} — AutoView preview</title>
34
+ <style>${STYLE}</style>
35
+ </head>
36
+ <body>
37
+ <header>
38
+ <h1>${esc(meta.title)} <small>v${esc(meta.version)}</small></h1>
39
+ <p class="server">${meta.serverUrl
40
+ ? `backend: <code>${esc(meta.serverUrl)}</code>`
41
+ : `<span class="warn">no <code>servers[]</code> — frontend would boot in simulator mode</span>`}</p>
42
+ </header>
43
+ <section class="report">
44
+ <h2>READ report</h2>
45
+ <div class="cards">
46
+ <div class="card"><b>${stats.total}</b><span>endpoints</span></div>
47
+ <div class="card"><b>${groups.length}</b><span>resources</span></div>
48
+ <div class="card"><b>${stats.withQuery}</b><span>query endpoints</span></div>
49
+ <div class="card"><b>${stats.reqBody}</b><span>request bodies</span></div>
50
+ <div class="card"><b>${stats.resBody}</b><span>response bodies</span></div>
51
+ <div class="card ${stats.unresolvedBody > 0 ? "card-warn" : ""}"><b>${stats.unresolvedBody}</b><span>unresolved body*</span></div>
52
+ <div class="card ${unsupported.length > 0 ? "card-warn" : ""}"><b>${unsupported.length}</b><span>dropped**</span></div>
53
+ </div>
54
+ <p class="note">* write operations whose request body the READ layer could not resolve (typically multipart). Marked <span class="badge badge-warn">no-body</span> below.<br/>** operations HttpMigration could not parse at all (unsupported content type). Listed in the <b>dropped</b> section so nothing is lost silently.</p>
55
+ </section>
56
+ ${sections}
57
+ ${droppedSection}
58
+ <footer>Generated by AutoView <code>--preview</code> — READ layer only, no LLM. Run the full command (without <code>--preview</code>) to generate the frontend.</footer>
59
+ </body>
60
+ </html>`;
61
+ }
62
+ function computeStats(endpoints) {
63
+ let withQuery = 0;
64
+ let reqBody = 0;
65
+ let resBody = 0;
66
+ let unresolvedBody = 0;
67
+ const bodyMethods = new Set(["post", "put", "patch"]);
68
+ for (const ep of endpoints) {
69
+ if (ep.query !== null)
70
+ withQuery++;
71
+ if (ep.requestBody !== null)
72
+ reqBody++;
73
+ if (ep.responseBody !== null)
74
+ resBody++;
75
+ // A write operation with no resolvable request body is a candidate for a
76
+ // silently-dropped non-JSON / multipart payload.
77
+ if (bodyMethods.has(ep.method.toLowerCase()) && ep.requestBody === null) {
78
+ unresolvedBody++;
79
+ }
80
+ }
81
+ return { total: endpoints.length, withQuery, reqBody, resBody, unresolvedBody };
82
+ }
83
+ function renderResource(group, document) {
84
+ const rows = group.endpoints
85
+ .map((c) => renderEndpoint(c, document))
86
+ .join("\n");
87
+ // Deterministic screen set this resource produces — actual Next.js paths.
88
+ const screens = (0, utils_1.planResource)(group);
89
+ const plannedHtml = screens
90
+ .map((s) => `<span class="screen screen-${s.kind}"><code>${esc(s.path)}</code> <i>${s.kind}</i></span>`)
91
+ .join("");
92
+ return `<section class="resource">
93
+ <h2>${esc(group.resource)} <small>${group.endpoints.length}</small></h2>
94
+ <div class="planned">screens: ${plannedHtml || "<i class='muted'>none (no list/detail/create/update)</i>"}</div>
95
+ ${rows}
96
+ </section>`;
97
+ }
98
+ function renderEndpoint(classified, document) {
99
+ const ep = classified.endpoint;
100
+ const method = ep.method.toLowerCase();
101
+ const bodyMethods = new Set(["post", "put", "patch"]);
102
+ const unresolved = bodyMethods.has(method) && ep.requestBody === null
103
+ ? `<span class="badge badge-warn">no-body</span>`
104
+ : "";
105
+ const queryBadge = ep.query !== null ? `<span class="badge badge-q">query</span>` : "";
106
+ const details = [];
107
+ if (ep.parameters.length > 0) {
108
+ details.push(`<div class="detail"><b>path</b> ${ep.parameters
109
+ .map((p) => `<code>${esc(p.name)}</code>`)
110
+ .join(" ")}</div>`);
111
+ }
112
+ if (ep.query !== null) {
113
+ details.push(`<div class="detail"><b>query</b><pre>${esc(renderSchemaInline(ep.query, document))}</pre></div>`);
114
+ }
115
+ if (ep.requestBody !== null) {
116
+ details.push(`<div class="detail"><b>request</b> <code>${esc(ep.requestBody.typeName)}</code><pre>${esc((0, renderJsonSchema_1.renderNamedSchema)(ep.requestBody.typeName, document))}</pre></div>`);
117
+ }
118
+ if (ep.responseBody !== null) {
119
+ details.push(`<div class="detail"><b>response</b> <code>${esc(ep.responseBody.typeName)}</code><pre>${esc((0, renderJsonSchema_1.renderNamedSchema)(ep.responseBody.typeName, document))}</pre></div>`);
120
+ }
121
+ return `<details class="endpoint">
122
+ <summary>
123
+ <span class="badge role role-${classified.role}">${classified.role}</span>
124
+ <span class="method method-${method}">${esc(ep.method.toUpperCase())}</span>
125
+ <code class="path">${esc(ep.path)}</code>
126
+ ${queryBadge}${unresolved}
127
+ <span class="accessor">${esc(ep.accessor.join("."))}</span>
128
+ </summary>
129
+ <div class="body">
130
+ ${ep.description ? `<p class="desc">${esc(ep.description)}</p>` : ""}
131
+ ${details.join("\n ") || '<div class="detail muted">no params / body</div>'}
132
+ </div>
133
+ </details>`;
134
+ }
135
+ // The query schema is an inline object (not a $ref), so render it directly via
136
+ // renderNamedSchema's sibling path — but renderNamedSchema only takes a type
137
+ // name. For inline query schemas we stringify the JSON shape compactly.
138
+ function renderSchemaInline(schema, _document) {
139
+ var _a;
140
+ if ("properties" in schema && schema.properties) {
141
+ const required = new Set((_a = schema.required) !== null && _a !== void 0 ? _a : []);
142
+ return Object.entries(schema.properties)
143
+ .map(([name, prop]) => {
144
+ const opt = required.has(name) ? "" : "?";
145
+ const t = "type" in prop ? String(prop.type) : "unknown";
146
+ return `${name}${opt}: ${t}`;
147
+ })
148
+ .join("\n");
149
+ }
150
+ return "type" in schema ? String(schema.type) : "unknown";
151
+ }
152
+ function esc(s) {
153
+ return s
154
+ .replace(/&/g, "&amp;")
155
+ .replace(/</g, "&lt;")
156
+ .replace(/>/g, "&gt;");
157
+ }
158
+ const STYLE = `
159
+ :root { color-scheme: light dark; }
160
+ * { box-sizing: border-box; }
161
+ body { font: 14px/1.5 ui-sans-serif, system-ui, sans-serif; margin: 0; padding: 0 0 4rem; max-width: 900px; margin-inline: auto; }
162
+ header { padding: 2rem 1.5rem 1rem; border-bottom: 1px solid #8883; }
163
+ h1 { margin: 0; font-size: 1.6rem; } h1 small { font-weight: 400; opacity: .55; font-size: .9rem; }
164
+ .server { margin: .4rem 0 0; opacity: .8; } .warn { color: #c80; }
165
+ code { font-family: ui-monospace, monospace; background: #8881; padding: .05em .35em; border-radius: 4px; }
166
+ .report { padding: 1rem 1.5rem; }
167
+ .report h2, .resource h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; opacity: .6; }
168
+ .cards { display: flex; flex-wrap: wrap; gap: .6rem; }
169
+ .card { background: #8881; border-radius: 8px; padding: .6rem .9rem; min-width: 90px; }
170
+ .card b { display: block; font-size: 1.5rem; } .card span { opacity: .65; font-size: .8rem; }
171
+ .card-warn { background: #c8001a; color: #fff; } .card-warn span { opacity: .85; }
172
+ .note { font-size: .8rem; opacity: .6; }
173
+ .resource { padding: .3rem 1.5rem; }
174
+ .endpoint { border: 1px solid #8883; border-radius: 8px; margin: .35rem 0; padding: .1rem .2rem; }
175
+ .endpoint summary { cursor: pointer; padding: .5rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
176
+ .method { font-weight: 700; font-size: .72rem; padding: .15em .5em; border-radius: 4px; color: #fff; }
177
+ .method-get { background: #2563eb; } .method-post { background: #16a34a; }
178
+ .method-put, .method-patch { background: #d97706; } .method-delete { background: #dc2626; }
179
+ .path { font-size: .95rem; } .accessor { margin-left: auto; opacity: .45; font-size: .8rem; font-family: ui-monospace, monospace; }
180
+ .badge { font-size: .68rem; padding: .1em .45em; border-radius: 4px; }
181
+ .badge-q { background: #7c3aed; color: #fff; } .badge-warn { background: #c8001a; color: #fff; }
182
+ .roles, .planned { padding: .1rem 0 .5rem; opacity: .9; font-size: .8rem; }
183
+ .planned .screen { display: inline-block; margin: .15rem .3rem .15rem 0; padding: .1rem .4rem; border-radius: 5px; background: #8881; }
184
+ .planned .screen i { opacity: .55; font-style: normal; font-size: .72rem; text-transform: uppercase; }
185
+ .screen-list { border-left: 3px solid #2563eb; } .screen-detail { border-left: 3px solid #0891b2; }
186
+ .screen-create { border-left: 3px solid #16a34a; } .screen-edit { border-left: 3px solid #d97706; }
187
+ .role { font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
188
+ .role-list { background: #2563eb; color: #fff; } .role-search { background: #7c3aed; color: #fff; }
189
+ .role-detail { background: #0891b2; color: #fff; } .role-create { background: #16a34a; color: #fff; }
190
+ .role-update { background: #d97706; color: #fff; } .role-delete { background: #dc2626; color: #fff; }
191
+ .role-action { background: #64748b; color: #fff; }
192
+ .body { padding: 0 .6rem .6rem; } .desc { opacity: .75; margin: .2rem 0 .6rem; }
193
+ .detail { margin: .3rem 0; } .detail b { display: inline-block; min-width: 4.5rem; opacity: .55; font-size: .8rem; text-transform: uppercase; }
194
+ .detail pre { margin: .2rem 0 0; background: #8881; padding: .5rem .7rem; border-radius: 6px; overflow-x: auto; font-size: .82rem; }
195
+ .muted { opacity: .5; }
196
+ footer { padding: 2rem 1.5rem; opacity: .5; font-size: .8rem; border-top: 1px solid #8883; margin-top: 1rem; }
197
+ `;
198
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AAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5D,CAAC;AAED,SAAS,GAAG,CAAC,CAAS;IACpB,OAAO,CAAC;SACL,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCb,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { OpenApi } from "@typia/interface";
2
+ /**
3
+ * Narrow self-defined view of the AutoBE compiler. AutoView only calls
4
+ * `compiler.interface.write(document, exclude)` to materialize the SDK source
5
+ * it shows the LLM, so only that surface is reproduced here.
6
+ *
7
+ * Step 3 of the standalone track replaces the underlying `@autobe/compiler`
8
+ * runtime with a standard-OpenAPI SDK generator; this interface is the seam
9
+ * that change happens behind.
10
+ */
11
+ export interface IAutoBeCompiler {
12
+ interface: IAutoBeInterfaceCompiler;
13
+ }
14
+ export interface IAutoBeInterfaceCompiler {
15
+ /**
16
+ * Generate the SDK / NestJS project source for an OpenAPI document.
17
+ *
18
+ * @param document AutoBE OpenAPI AST document
19
+ * @param options Either an exclude list, or a `{ language, exclude }` object
20
+ * @returns `path → content` map of the generated project
21
+ */
22
+ write(document: OpenApi.IDocument, options: string[] | {
23
+ language: "typescript" | "java";
24
+ exclude: string[];
25
+ }): Promise<Record<string, string>>;
26
+ }
27
+ /**
28
+ * Compiler event listener. AutoView hands the compiler a no-op sink (no UI to
29
+ * forward realize-test events to), so only the nested shape the sink fills is
30
+ * modeled. Loosely typed because the standalone path never reads the args.
31
+ */
32
+ export interface IAutoBeCompilerListener {
33
+ realize: {
34
+ test: {
35
+ onOperation: (...args: unknown[]) => Promise<void>;
36
+ onReset: (...args: unknown[]) => Promise<void>;
37
+ };
38
+ };
39
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=compiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../src/typings/compiler.ts"],"names":[],"mappings":""}
@@ -0,0 +1,106 @@
1
+ import { tags } from "typia";
2
+ import { AutoBeFunctionCallingMetric } from "./misc";
3
+ import { IAutoBeTokenUsageJson } from "./misc";
4
+ /**
5
+ * Base shape shared by every AutoView event.
6
+ *
7
+ * Self-defined (formerly `AutoBeEventBase` from `@autobe/interface`) so this
8
+ * package carries no AutoBE dependency. The standalone AutoView agent only
9
+ * emits the seven events below, so the base is reproduced here verbatim rather
10
+ * than importing the full AutoBE event hierarchy.
11
+ */
12
+ export interface AutoBeEventBase<Type extends string> {
13
+ /** A unique identifier for the event. */
14
+ id: string;
15
+ /** Literal discriminator for the event type. */
16
+ type: Type;
17
+ /** ISO-8601 timestamp of when the event was emitted. */
18
+ created_at: string & tags.Format<"date-time">;
19
+ }
20
+ /**
21
+ * Event sources surfaced by the agent's `conversate` calls — only the phases
22
+ * that actually invoke the LLM are represented (scaffold / start / complete
23
+ * are deterministic and never appear as a source).
24
+ */
25
+ export type AutoBeEventSource = "autoViewSdkStudy" | "autoViewProductPlan" | "autoViewRenderPage" | "autoViewReview";
26
+ /** Fired once when an AutoView run begins. */
27
+ export interface AutoBeAutoViewStartEvent extends AutoBeEventBase<"autoViewStart"> {
28
+ /** SDK source the run is built against. */
29
+ source: "interface" | "shopping";
30
+ /** Step counter of the interface phase this run is based on (`0` for shopping). */
31
+ step: number;
32
+ /** Optional design-theme instruction forwarded to plan + render phases. */
33
+ designTheme: string;
34
+ /** Human-readable reason the run was triggered. */
35
+ reason: string;
36
+ }
37
+ /** Fired when Phase 1 (SDK Study) produces the domain map. */
38
+ export interface AutoBeAutoViewSdkStudyEvent extends AutoBeEventBase<"autoViewSdkStudy"> {
39
+ step: number;
40
+ /** Number of resources surfaced in the SDK map. */
41
+ resources: number;
42
+ /** Number of actors surfaced in the SDK map. */
43
+ actors: number;
44
+ /** Rendered SDK domain-map markdown. */
45
+ sdkMap: string;
46
+ }
47
+ /** Fired when Phase 2 (Product Plan) produces the screen IA. */
48
+ export interface AutoBeAutoViewProductPlanEvent extends AutoBeEventBase<"autoViewProductPlan"> {
49
+ step: number;
50
+ /** Number of planned screens. */
51
+ pages: number;
52
+ /** Number of intentionally omitted screens. */
53
+ intentionalOmissions: number;
54
+ /** Rendered product-plan markdown. */
55
+ productPlan: string;
56
+ }
57
+ /** Fired when Phase 3 (Scaffold) finishes writing the deterministic skeleton. */
58
+ export interface AutoBeAutoViewScaffoldEvent extends AutoBeEventBase<"autoViewScaffold"> {
59
+ step: number;
60
+ /** Number of scaffolded files. */
61
+ files: number;
62
+ }
63
+ /** Fired once per page during Phase 4 (Render). */
64
+ export interface AutoBeAutoViewRenderPageEvent extends AutoBeEventBase<"autoViewRenderPage"> {
65
+ step: number;
66
+ /** Total number of pages to render. */
67
+ total: number;
68
+ /** Number of pages completed so far (this one inclusive). */
69
+ completed: number;
70
+ /** Route path of the rendered page. */
71
+ pagePath: string;
72
+ /** UI pattern the planner assigned to this screen. */
73
+ uiPattern: string;
74
+ /** Number of render attempts spent on this page. */
75
+ attempts: number;
76
+ /** Whether the page rendered + parsed successfully. */
77
+ ok: boolean;
78
+ /** Token usage spent rendering this page. */
79
+ tokenUsage: IAutoBeTokenUsageJson.IComponent;
80
+ /** Function-calling metric for this page's render. */
81
+ metric: AutoBeFunctionCallingMetric;
82
+ }
83
+ /** Fired when Phase 5 (UI Review) finishes the code-and-spec audit. */
84
+ export interface AutoBeAutoViewReviewEvent extends AutoBeEventBase<"autoViewReview"> {
85
+ step: number;
86
+ /** Number of screenshots taken (`0` in the standalone code-review path). */
87
+ screenshots: number;
88
+ /** Number of pages flagged broken. */
89
+ broken: number;
90
+ /** Number of broken pages recovered by re-render. */
91
+ recovered: number;
92
+ /** Rendered SDK-feedback markdown. */
93
+ sdkFeedback: string;
94
+ }
95
+ /** Fired once when an AutoView run completes; carries the assembled files. */
96
+ export interface AutoBeAutoViewCompleteEvent extends AutoBeEventBase<"autoViewComplete"> {
97
+ step: number;
98
+ /** SDK source the run was built against. */
99
+ source: "interface" | "shopping";
100
+ /** Wall-clock duration of the run in milliseconds. */
101
+ elapsed: number;
102
+ /** Number of pages in the finished project. */
103
+ pages: number;
104
+ /** Final `path → content` map of the generated frontend. */
105
+ files: Record<string, string>;
106
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/typings/events.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Self-contained type surface that replaces the `@autobe/interface` import in
3
+ * this package. Re-exports only what the AutoView agent uses, so the package
4
+ * carries no `@autobe/*` type dependency.
5
+ *
6
+ * Migrated 2026-06-01 as Step 1 of the AutoBE-independence track.
7
+ */
8
+ export * from "./events";
9
+ export * from "./misc";
10
+ export * from "./compiler";
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Self-contained type surface that replaces the `@autobe/interface` import in
19
+ * this package. Re-exports only what the AutoView agent uses, so the package
20
+ * carries no `@autobe/*` type dependency.
21
+ *
22
+ * Migrated 2026-06-01 as Step 1 of the AutoBE-independence track.
23
+ */
24
+ __exportStar(require("./events"), exports);
25
+ __exportStar(require("./misc"), exports);
26
+ __exportStar(require("./compiler"), exports);
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/typings/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,2CAAyB;AACzB,yCAAuB;AACvB,6CAA2B"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Minimal self-defined replacements for the handful of `@autobe/interface`
3
+ * support types the AutoView agent touches. Only the surface the agent
4
+ * actually reads is reproduced — the full AutoBE definitions carry deep
5
+ * dependency trees this standalone package has no reason to vendor.
6
+ */
7
+ /** Function-calling metric accumulated across one `conversate` call. */
8
+ export interface AutoBeFunctionCallingMetric {
9
+ /** Number of LLM call attempts. */
10
+ attempt: number;
11
+ /** Number of successful tool executions. */
12
+ success: number;
13
+ /** Number of consent (re-ask) rounds. */
14
+ consent: number;
15
+ /** Number of schema-validation failures. */
16
+ validationFailure: number;
17
+ /** Number of invalid-JSON parse failures. */
18
+ invalidJson: number;
19
+ }
20
+ /**
21
+ * Token-usage shapes. AutoView only ever constructs / forwards
22
+ * {@link IAutoBeTokenUsageJson.IComponent}, so only that member is defined.
23
+ */
24
+ export declare namespace IAutoBeTokenUsageJson {
25
+ /** Aggregate token usage for a single component. */
26
+ interface IComponent {
27
+ /** Total tokens (input + output). */
28
+ total: number;
29
+ /** Input-side token breakdown. */
30
+ input: IInput;
31
+ /** Output-side token breakdown. */
32
+ output: IOutput;
33
+ }
34
+ interface IInput {
35
+ total: number;
36
+ cached: number;
37
+ }
38
+ interface IOutput {
39
+ total: number;
40
+ reasoning: number;
41
+ accepted_prediction: number;
42
+ rejected_prediction: number;
43
+ }
44
+ }
45
+ /**
46
+ * Options accepted by `orchestrateAutoView`. All optional — the orchestrator
47
+ * fills sensible defaults (interface source, empty theme, simulator backend,
48
+ * no runtime audit).
49
+ */
50
+ export interface IAutoBeRunAutoViewOptions {
51
+ /** SDK source for the run. Defaults to `"interface"`. */
52
+ source?: "interface" | "shopping";
53
+ /** Design-theme instruction forwarded to plan + render phases. */
54
+ designTheme?: string;
55
+ /** Live backend host wired into `connection.ts`. `null` → simulator mode. */
56
+ backend?: {
57
+ host: string;
58
+ } | null;
59
+ /** Opt into Phase 6 Playwright runtime audit. Defaults to `false`. */
60
+ runtimeAudit?: boolean;
61
+ /**
62
+ * Opt into the workflow verification phase: after typecheck, boot the
63
+ * generated app in a real headless browser and walk the derived user
64
+ * workflows (list → detail, forms, landing) with positive assertions, writing
65
+ * `wiki/verification.md`. Proves the app actually works for a user, not just
66
+ * that it compiles. Heavy (installs Chromium, boots `next dev`); defaults to
67
+ * `false`.
68
+ */
69
+ verify?: boolean;
70
+ /**
71
+ * Path globs to KEEP — only endpoints whose path matches are turned into
72
+ * screens. Slices a large swagger to one actor surface, e.g.
73
+ * `["shoppings/customers/**"]`. Empty/absent means "all".
74
+ */
75
+ include?: string[];
76
+ /** Path globs to DROP after include, e.g. `["**​/monitors/**"]`. */
77
+ exclude?: string[];
78
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=misc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/typings/misc.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Minimal self-defined replacement for `@autobe/utils`'s `ArrayUtil`. The
3
+ * self-defined interface compiler only needs `asyncMap` (ordered, sequential
4
+ * async map), so only that is reproduced.
5
+ */
6
+ export declare namespace ArrayUtil {
7
+ function asyncMap<T, U>(array: T[], callback: (value: T, index: number, array: T[]) => Promise<U>): Promise<U[]>;
8
+ }
@@ -0,0 +1,30 @@
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.ArrayUtil = void 0;
13
+ /**
14
+ * Minimal self-defined replacement for `@autobe/utils`'s `ArrayUtil`. The
15
+ * self-defined interface compiler only needs `asyncMap` (ordered, sequential
16
+ * async map), so only that is reproduced.
17
+ */
18
+ var ArrayUtil;
19
+ (function (ArrayUtil) {
20
+ function asyncMap(array, callback) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ const result = new Array(array.length);
23
+ for (let i = 0; i < array.length; i++)
24
+ result[i] = yield callback(array[i], i, array);
25
+ return result;
26
+ });
27
+ }
28
+ ArrayUtil.asyncMap = asyncMap;
29
+ })(ArrayUtil || (exports.ArrayUtil = ArrayUtil = {}));
30
+ //# sourceMappingURL=ArrayUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrayUtil.js","sourceRoot":"","sources":["../../src/utils/ArrayUtil.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;GAIG;AACH,IAAiB,SAAS,CAUzB;AAVD,WAAiB,SAAS;IACxB,SAAsB,QAAQ,CAC5B,KAAU,EACV,QAA6D;;YAE7D,MAAM,MAAM,GAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE;gBACnC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;YACjD,OAAO,MAAM,CAAC;QAChB,CAAC;KAAA;IARqB,kBAAQ,WAQ7B,CAAA;AACH,CAAC,EAVgB,SAAS,yBAAT,SAAS,QAUzB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Minimal self-defined replacement for `@autobe/utils`'s `StringUtil`. The
3
+ * AutoView agent only uses `trim` (template-literal dedent), so only that is
4
+ * reproduced — `dedent` itself still comes from the typia ecosystem, which is
5
+ * not an AutoBE dependency.
6
+ */
7
+ export declare namespace StringUtil {
8
+ function trim(strings: TemplateStringsArray, ...values: any[]): string;
9
+ /** First sentence / first line of a description, whichever comes first. */
10
+ function summary(description: string): string;
11
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StringUtil = void 0;
4
+ const utils_1 = require("@typia/utils");
5
+ /**
6
+ * Minimal self-defined replacement for `@autobe/utils`'s `StringUtil`. The
7
+ * AutoView agent only uses `trim` (template-literal dedent), so only that is
8
+ * reproduced — `dedent` itself still comes from the typia ecosystem, which is
9
+ * not an AutoBE dependency.
10
+ */
11
+ var StringUtil;
12
+ (function (StringUtil) {
13
+ function trim(strings,
14
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
+ ...values) {
16
+ return (0, utils_1.dedent)(strings, ...values);
17
+ }
18
+ StringUtil.trim = trim;
19
+ /** First sentence / first line of a description, whichever comes first. */
20
+ function summary(description) {
21
+ const newLine = description.indexOf("\n");
22
+ const dot = description.indexOf(".");
23
+ const minimum = Math.min(newLine === -1 ? Number.MAX_SAFE_INTEGER : newLine, dot === -1 ? Number.MAX_SAFE_INTEGER : dot, description.length);
24
+ return description.substring(0, minimum);
25
+ }
26
+ StringUtil.summary = summary;
27
+ })(StringUtil || (exports.StringUtil = StringUtil = {}));
28
+ //# sourceMappingURL=StringUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StringUtil.js","sourceRoot":"","sources":["../../src/utils/StringUtil.ts"],"names":[],"mappings":";;;AAAA,wCAAsC;AAEtC;;;;;GAKG;AACH,IAAiB,UAAU,CAoB1B;AApBD,WAAiB,UAAU;IACzB,SAAgB,IAAI,CAClB,OAA6B;IAC7B,8DAA8D;IAC9D,GAAG,MAAa;QAEhB,OAAO,IAAA,cAAM,EAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;IACpC,CAAC;IANe,eAAI,OAMnB,CAAA;IAED,2EAA2E;IAC3E,SAAgB,OAAO,CAAC,WAAmB;QACzC,MAAM,OAAO,GAAW,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClD,MAAM,GAAG,GAAW,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7C,MAAM,OAAO,GAAW,IAAI,CAAC,GAAG,CAC9B,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,EAClD,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,EAC1C,WAAW,CAAC,MAAM,CACnB,CAAC;QACF,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IATe,kBAAO,UAStB,CAAA;AACH,CAAC,EApBgB,UAAU,0BAAV,UAAU,QAoB1B"}