aimeat 1.2.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 (1366) hide show
  1. package/dist/.env.example +300 -0
  2. package/dist/bin/aimeat.d.ts +3 -0
  3. package/dist/bin/aimeat.d.ts.map +1 -0
  4. package/dist/bin/aimeat.js +22 -0
  5. package/dist/bin/aimeat.js.map +1 -0
  6. package/dist/locales/en.json +4566 -0
  7. package/dist/locales/fi.json +4566 -0
  8. package/dist/public/BingSiteAuth.xml +4 -0
  9. package/dist/public/agent-consent.html +521 -0
  10. package/dist/public/aimeat-developers.html +679 -0
  11. package/dist/public/assets/mcp_1_add_custom_connector.png +0 -0
  12. package/dist/public/assets/mcp_2_connect_disconnect_connector.png +0 -0
  13. package/dist/public/components/Alert.js +18 -0
  14. package/dist/public/components/Card.js +19 -0
  15. package/dist/public/components/CopyButton.js +24 -0
  16. package/dist/public/components/FormField.js +16 -0
  17. package/dist/public/components/Modal.js +121 -0
  18. package/dist/public/components/Spinner.js +11 -0
  19. package/dist/public/components/Toast.js +26 -0
  20. package/dist/public/components/index.js +8 -0
  21. package/dist/public/components/useViewCSS.js +12 -0
  22. package/dist/public/cortex-bundled/aimeat-canvas.js +1408 -0
  23. package/dist/public/cortex-bundled/aimeat-canvas.yaml +241 -0
  24. package/dist/public/cortex-bundled/aimeat-charts.js +455 -0
  25. package/dist/public/cortex-bundled/aimeat-charts.yaml +178 -0
  26. package/dist/public/cortex-bundled/aimeat-ui-dialogs.js +667 -0
  27. package/dist/public/cortex-bundled/aimeat-ui-dialogs.yaml +66 -0
  28. package/dist/public/cortex-bundled/aimeat-ui-forms.js +1106 -0
  29. package/dist/public/cortex-bundled/aimeat-ui-forms.yaml +90 -0
  30. package/dist/public/cortex-bundled/aimeat-ui-layout.js +436 -0
  31. package/dist/public/cortex-bundled/aimeat-ui-layout.yaml +87 -0
  32. package/dist/public/cortex-bundled/aimeat-ui-nav.js +722 -0
  33. package/dist/public/cortex-bundled/aimeat-ui-nav.yaml +73 -0
  34. package/dist/public/cortex-bundled/aimeat-ui-viewers.js +602 -0
  35. package/dist/public/cortex-bundled/aimeat-ui-viewers.yaml +73 -0
  36. package/dist/public/css/components/tags.css +67 -0
  37. package/dist/public/css/theme.css +716 -0
  38. package/dist/public/css/views/admin.css +576 -0
  39. package/dist/public/css/views/aimeat-os.css +153 -0
  40. package/dist/public/css/views/calibrator.css +480 -0
  41. package/dist/public/css/views/foundry.css +1334 -0
  42. package/dist/public/css/views/help.css +136 -0
  43. package/dist/public/css/views/hobbies.css +73 -0
  44. package/dist/public/css/views/marketplace.css +134 -0
  45. package/dist/public/css/views/openclaw.css +33 -0
  46. package/dist/public/css/views/portal-classic.css +484 -0
  47. package/dist/public/css/views/portal-dev.css +139 -0
  48. package/dist/public/css/views/portal.css +365 -0
  49. package/dist/public/css/views/portfolio.css +322 -0
  50. package/dist/public/css/views/profile.css +1799 -0
  51. package/dist/public/echat.html +442 -0
  52. package/dist/public/img/genesis-001-badge.png +0 -0
  53. package/dist/public/img/platforms/chatgpt.png +0 -0
  54. package/dist/public/img/platforms/claude.png +0 -0
  55. package/dist/public/img/platforms/copilot.png +0 -0
  56. package/dist/public/img/platforms/deepseek.png +0 -0
  57. package/dist/public/img/platforms/gemini.png +0 -0
  58. package/dist/public/img/platforms/grok.png +0 -0
  59. package/dist/public/img/platforms/lmstudio.png +0 -0
  60. package/dist/public/img/platforms/m365copilot.png +0 -0
  61. package/dist/public/img/platforms/openclaw.png +0 -0
  62. package/dist/public/img/platforms/other.png +0 -0
  63. package/dist/public/js/api.js +123 -0
  64. package/dist/public/js/components/auth-image.js +59 -0
  65. package/dist/public/js/components/tag-cloud.js +31 -0
  66. package/dist/public/js/components/tag-editor.js +46 -0
  67. package/dist/public/js/hooks.js +63 -0
  68. package/dist/public/js/i18n.js +76 -0
  69. package/dist/public/js/services/admin.js +239 -0
  70. package/dist/public/js/services/agents.js +57 -0
  71. package/dist/public/js/services/apps.js +35 -0
  72. package/dist/public/js/services/auth.js +40 -0
  73. package/dist/public/js/services/boards.js +79 -0
  74. package/dist/public/js/services/calibrator.js +97 -0
  75. package/dist/public/js/services/catalogue.js +39 -0
  76. package/dist/public/js/services/consent.js +57 -0
  77. package/dist/public/js/services/cortex.js +95 -0
  78. package/dist/public/js/services/extensions.js +61 -0
  79. package/dist/public/js/services/federation.js +11 -0
  80. package/dist/public/js/services/foundry-context-bundle.js +128 -0
  81. package/dist/public/js/services/foundry-contract.js +117 -0
  82. package/dist/public/js/services/foundry-packaging.js +762 -0
  83. package/dist/public/js/services/foundry-probe-reconcile.js +52 -0
  84. package/dist/public/js/services/foundry-prompts-base.js +1886 -0
  85. package/dist/public/js/services/foundry-prompts-build.js +2187 -0
  86. package/dist/public/js/services/foundry-prompts-cortex-app.js +154 -0
  87. package/dist/public/js/services/foundry-prompts-cortex-data.js +241 -0
  88. package/dist/public/js/services/foundry-prompts-cortex-feature.js +281 -0
  89. package/dist/public/js/services/foundry-prompts-fix.js +408 -0
  90. package/dist/public/js/services/foundry-prompts-test.js +520 -0
  91. package/dist/public/js/services/foundry-prompts.js +31 -0
  92. package/dist/public/js/services/foundry-smoke.js +65 -0
  93. package/dist/public/js/services/foundry-testing.js +64 -0
  94. package/dist/public/js/services/foundry-validate.js +1082 -0
  95. package/dist/public/js/services/foundry.js +1194 -0
  96. package/dist/public/js/services/generator-context-bundle.js +134 -0
  97. package/dist/public/js/services/generator-contract.js +117 -0
  98. package/dist/public/js/services/generator-packaging.js +762 -0
  99. package/dist/public/js/services/generator-probe-reconcile.js +52 -0
  100. package/dist/public/js/services/generator-prompts-base.js +1890 -0
  101. package/dist/public/js/services/generator-prompts-build.js +1126 -0
  102. package/dist/public/js/services/generator-prompts-cortex-app.js +155 -0
  103. package/dist/public/js/services/generator-prompts-cortex-data.js +199 -0
  104. package/dist/public/js/services/generator-prompts-cortex-feature.js +276 -0
  105. package/dist/public/js/services/generator-prompts-fix.js +316 -0
  106. package/dist/public/js/services/generator-prompts-test.js +402 -0
  107. package/dist/public/js/services/generator-prompts.js +31 -0
  108. package/dist/public/js/services/generator-smoke.js +65 -0
  109. package/dist/public/js/services/generator-spec-tests.js +280 -0
  110. package/dist/public/js/services/generator-spec-validate.js +192 -0
  111. package/dist/public/js/services/generator-specs.js +369 -0
  112. package/dist/public/js/services/generator-testing.js +64 -0
  113. package/dist/public/js/services/generator-validate.js +916 -0
  114. package/dist/public/js/services/generator.js +952 -0
  115. package/dist/public/js/services/knowledge.js +120 -0
  116. package/dist/public/js/services/memory.js +112 -0
  117. package/dist/public/js/services/nodes.js +55 -0
  118. package/dist/public/js/services/organisms.js +74 -0
  119. package/dist/public/js/services/packages.js +97 -0
  120. package/dist/public/js/services/security.js +67 -0
  121. package/dist/public/js/services/stats.js +11 -0
  122. package/dist/public/js/services/wallet.js +24 -0
  123. package/dist/public/js/services/work.js +51 -0
  124. package/dist/public/js/utils.js +184 -0
  125. package/dist/public/lib/htm.mjs +4 -0
  126. package/dist/public/lib/live-updates.js +89 -0
  127. package/dist/public/lib/minidenticons.min.js +1 -0
  128. package/dist/public/lib/preact-hooks.mjs +3 -0
  129. package/dist/public/lib/preact.mjs +3 -0
  130. package/dist/public/lib/realtime.js +549 -0
  131. package/dist/public/lib/three.min.js +6 -0
  132. package/dist/public/lib/yaml.mjs +141 -0
  133. package/dist/public/llms-template.txt +1043 -0
  134. package/dist/public/oauth-consent.html +388 -0
  135. package/dist/public/og-image.png +0 -0
  136. package/dist/public/robots.txt +52 -0
  137. package/dist/public/spa.html +533 -0
  138. package/dist/public/sw.js +34 -0
  139. package/dist/public/tmp-paste.txt +223 -0
  140. package/dist/public/views/_template.js +85 -0
  141. package/dist/public/views/admin/actions-tab.js +41 -0
  142. package/dist/public/views/admin/agents-tab.js +84 -0
  143. package/dist/public/views/admin/boards-tab.js +154 -0
  144. package/dist/public/views/admin/chat-instances-tab.js +207 -0
  145. package/dist/public/views/admin/config-tab.js +151 -0
  146. package/dist/public/views/admin/consul-tab.js +77 -0
  147. package/dist/public/views/admin/cors-tab.js +240 -0
  148. package/dist/public/views/admin/cortex-tab.js +171 -0
  149. package/dist/public/views/admin/csm-tab.js +261 -0
  150. package/dist/public/views/admin/directory-tab.js +44 -0
  151. package/dist/public/views/admin/economy-tab.js +80 -0
  152. package/dist/public/views/admin/email-tab.js +460 -0
  153. package/dist/public/views/admin/federation-tab.js +412 -0
  154. package/dist/public/views/admin/generator-debug-tab.js +238 -0
  155. package/dist/public/views/admin/genesis-tab.js +70 -0
  156. package/dist/public/views/admin/ghii-tab.js +101 -0
  157. package/dist/public/views/admin/hooks-tab.js +69 -0
  158. package/dist/public/views/admin/knowledge-tab.js +297 -0
  159. package/dist/public/views/admin/maintenance-tab.js +98 -0
  160. package/dist/public/views/admin/matching-tab.js +44 -0
  161. package/dist/public/views/admin/memory-tab.js +222 -0
  162. package/dist/public/views/admin/msm-tab.js +342 -0
  163. package/dist/public/views/admin/overview-tab.js +90 -0
  164. package/dist/public/views/admin/owners-tab.js +55 -0
  165. package/dist/public/views/admin/packages-tab.js +510 -0
  166. package/dist/public/views/admin/portal-tab.js +211 -0
  167. package/dist/public/views/admin/prompts-tab.js +287 -0
  168. package/dist/public/views/admin/push-tab.js +291 -0
  169. package/dist/public/views/admin/realtime-tab.js +68 -0
  170. package/dist/public/views/admin/scheduler-tab.js +156 -0
  171. package/dist/public/views/admin/services-tab.js +981 -0
  172. package/dist/public/views/admin/shared.js +148 -0
  173. package/dist/public/views/admin/stats-tab.js +187 -0
  174. package/dist/public/views/admin/work-tab.js +45 -0
  175. package/dist/public/views/admin.js +400 -0
  176. package/dist/public/views/aimeat-os.js +259 -0
  177. package/dist/public/views/guides.js +402 -0
  178. package/dist/public/views/help.js +79 -0
  179. package/dist/public/views/hobbies.js +697 -0
  180. package/dist/public/views/marketplace.js +647 -0
  181. package/dist/public/views/openclaw.js +223 -0
  182. package/dist/public/views/portal-classic.js +519 -0
  183. package/dist/public/views/portal-dev.js +816 -0
  184. package/dist/public/views/portal.js +1354 -0
  185. package/dist/public/views/portfolio.js +795 -0
  186. package/dist/public/views/profile/access-tab.js +58 -0
  187. package/dist/public/views/profile/agents-tab.js +689 -0
  188. package/dist/public/views/profile/apps-tab.js +197 -0
  189. package/dist/public/views/profile/boards-tab.js +323 -0
  190. package/dist/public/views/profile/calibrator-batch.js +926 -0
  191. package/dist/public/views/profile/calibrator-chart.js +135 -0
  192. package/dist/public/views/profile/calibrator-llm-editor.js +205 -0
  193. package/dist/public/views/profile/calibrator-tab.js +535 -0
  194. package/dist/public/views/profile/chat-sessions-tab.js +184 -0
  195. package/dist/public/views/profile/data-wallet-tab.js +313 -0
  196. package/dist/public/views/profile/email-tab.js +157 -0
  197. package/dist/public/views/profile/extensions-tab.js +711 -0
  198. package/dist/public/views/profile/federation-tab.js +63 -0
  199. package/dist/public/views/profile/foundry-dashboard/DebugPanel.js +193 -0
  200. package/dist/public/views/profile/foundry-dashboard/DiagnosticsPanel.js +69 -0
  201. package/dist/public/views/profile/foundry-dashboard/EditModePanel.js +141 -0
  202. package/dist/public/views/profile/foundry-dashboard/PackageDialog.js +96 -0
  203. package/dist/public/views/profile/foundry-dashboard/RemovePanel.js +53 -0
  204. package/dist/public/views/profile/foundry-dashboard/use-autopilot-state.js +53 -0
  205. package/dist/public/views/profile/foundry-dashboard/use-autopilot.js +1016 -0
  206. package/dist/public/views/profile/foundry-dashboard/use-dashboard-core.js +154 -0
  207. package/dist/public/views/profile/foundry-dashboard/use-edit-mode.js +294 -0
  208. package/dist/public/views/profile/foundry-dashboard/use-lifecycle.js +101 -0
  209. package/dist/public/views/profile/foundry-dashboard/use-packaging.js +97 -0
  210. package/dist/public/views/profile/foundry-dashboard/use-test-execution.js +275 -0
  211. package/dist/public/views/profile/foundry-dashboard.js +395 -0
  212. package/dist/public/views/profile/foundry-detail.js +1178 -0
  213. package/dist/public/views/profile/foundry-settings.js +377 -0
  214. package/dist/public/views/profile/foundry-tab.js +546 -0
  215. package/dist/public/views/profile/generator-dashboard/DebugPanel.js +193 -0
  216. package/dist/public/views/profile/generator-dashboard/DiagnosticsPanel.js +69 -0
  217. package/dist/public/views/profile/generator-dashboard/EditModePanel.js +141 -0
  218. package/dist/public/views/profile/generator-dashboard/PackageDialog.js +96 -0
  219. package/dist/public/views/profile/generator-dashboard/RemovePanel.js +53 -0
  220. package/dist/public/views/profile/generator-dashboard/use-autopilot-state.js +53 -0
  221. package/dist/public/views/profile/generator-dashboard/use-autopilot.js +136 -0
  222. package/dist/public/views/profile/generator-dashboard/use-dashboard-core.js +143 -0
  223. package/dist/public/views/profile/generator-dashboard/use-edit-mode.js +296 -0
  224. package/dist/public/views/profile/generator-dashboard/use-lifecycle.js +101 -0
  225. package/dist/public/views/profile/generator-dashboard/use-packaging.js +97 -0
  226. package/dist/public/views/profile/generator-dashboard/use-test-execution.js +275 -0
  227. package/dist/public/views/profile/generator-dashboard.js +377 -0
  228. package/dist/public/views/profile/generator-detail.js +1007 -0
  229. package/dist/public/views/profile/generator-settings.js +417 -0
  230. package/dist/public/views/profile/generator-tab.js +544 -0
  231. package/dist/public/views/profile/inline-panels.js +277 -0
  232. package/dist/public/views/profile/knowledge-tab.js +735 -0
  233. package/dist/public/views/profile/landing-page.js +539 -0
  234. package/dist/public/views/profile/mcp-tab.js +140 -0
  235. package/dist/public/views/profile/memory-tab.js +599 -0
  236. package/dist/public/views/profile/node-stats-tab.js +132 -0
  237. package/dist/public/views/profile/nodes-tab.js +195 -0
  238. package/dist/public/views/profile/notifications-tab.js +274 -0
  239. package/dist/public/views/profile/organisms-tab.js +402 -0
  240. package/dist/public/views/profile/packages-tab.js +393 -0
  241. package/dist/public/views/profile/portfolio-tab.js +31 -0
  242. package/dist/public/views/profile/security-tab.js +219 -0
  243. package/dist/public/views/profile/services-tab.js +281 -0
  244. package/dist/public/views/profile/shared.js +58 -0
  245. package/dist/public/views/profile/wallet-tab.js +272 -0
  246. package/dist/public/views/profile/work-tab.js +220 -0
  247. package/dist/public/views/profile.js +271 -0
  248. package/dist/public/wizard.html +1320 -0
  249. package/dist/scripts/db-init.d.ts +19 -0
  250. package/dist/scripts/db-init.d.ts.map +1 -0
  251. package/dist/scripts/db-init.js +168 -0
  252. package/dist/scripts/db-init.js.map +1 -0
  253. package/dist/scripts/db-reset.d.ts +15 -0
  254. package/dist/scripts/db-reset.d.ts.map +1 -0
  255. package/dist/scripts/db-reset.js +162 -0
  256. package/dist/scripts/db-reset.js.map +1 -0
  257. package/dist/scripts/indexnow.d.ts +18 -0
  258. package/dist/scripts/indexnow.d.ts.map +1 -0
  259. package/dist/scripts/indexnow.js +104 -0
  260. package/dist/scripts/indexnow.js.map +1 -0
  261. package/dist/scripts/kill-port.d.ts +3 -0
  262. package/dist/scripts/kill-port.d.ts.map +1 -0
  263. package/dist/scripts/kill-port.js +89 -0
  264. package/dist/scripts/kill-port.js.map +1 -0
  265. package/dist/scripts/seed-digital-signage.d.ts +13 -0
  266. package/dist/scripts/seed-digital-signage.d.ts.map +1 -0
  267. package/dist/scripts/seed-digital-signage.js +85 -0
  268. package/dist/scripts/seed-digital-signage.js.map +1 -0
  269. package/dist/src/auth/jwt.d.ts +40 -0
  270. package/dist/src/auth/jwt.d.ts.map +1 -0
  271. package/dist/src/auth/jwt.js +139 -0
  272. package/dist/src/auth/jwt.js.map +1 -0
  273. package/dist/src/auth/keypair.d.ts +8 -0
  274. package/dist/src/auth/keypair.d.ts.map +1 -0
  275. package/dist/src/auth/keypair.js +35 -0
  276. package/dist/src/auth/keypair.js.map +1 -0
  277. package/dist/src/auth/middleware.d.ts +50 -0
  278. package/dist/src/auth/middleware.d.ts.map +1 -0
  279. package/dist/src/auth/middleware.js +241 -0
  280. package/dist/src/auth/middleware.js.map +1 -0
  281. package/dist/src/auth/node-keys.d.ts +7 -0
  282. package/dist/src/auth/node-keys.d.ts.map +1 -0
  283. package/dist/src/auth/node-keys.js +116 -0
  284. package/dist/src/auth/node-keys.js.map +1 -0
  285. package/dist/src/cli/config-export.d.ts +9 -0
  286. package/dist/src/cli/config-export.d.ts.map +1 -0
  287. package/dist/src/cli/config-export.js +90 -0
  288. package/dist/src/cli/config-export.js.map +1 -0
  289. package/dist/src/cli/config-import.d.ts +10 -0
  290. package/dist/src/cli/config-import.d.ts.map +1 -0
  291. package/dist/src/cli/config-import.js +124 -0
  292. package/dist/src/cli/config-import.js.map +1 -0
  293. package/dist/src/cli/federation-join.d.ts +13 -0
  294. package/dist/src/cli/federation-join.d.ts.map +1 -0
  295. package/dist/src/cli/federation-join.js +395 -0
  296. package/dist/src/cli/federation-join.js.map +1 -0
  297. package/dist/src/cli/init-wizard.d.ts +8 -0
  298. package/dist/src/cli/init-wizard.d.ts.map +1 -0
  299. package/dist/src/cli/init-wizard.js +1489 -0
  300. package/dist/src/cli/init-wizard.js.map +1 -0
  301. package/dist/src/cli/scaffold.d.ts +33 -0
  302. package/dist/src/cli/scaffold.d.ts.map +1 -0
  303. package/dist/src/cli/scaffold.js +142 -0
  304. package/dist/src/cli/scaffold.js.map +1 -0
  305. package/dist/src/config.d.ts +272 -0
  306. package/dist/src/config.d.ts.map +1 -0
  307. package/dist/src/config.js +362 -0
  308. package/dist/src/config.js.map +1 -0
  309. package/dist/src/data/example-packages.d.ts +49 -0
  310. package/dist/src/data/example-packages.d.ts.map +1 -0
  311. package/dist/src/data/example-packages.js +814 -0
  312. package/dist/src/data/example-packages.js.map +1 -0
  313. package/dist/src/i18n.d.ts +19 -0
  314. package/dist/src/i18n.d.ts.map +1 -0
  315. package/dist/src/i18n.js +126 -0
  316. package/dist/src/i18n.js.map +1 -0
  317. package/dist/src/index.d.ts +3 -0
  318. package/dist/src/index.d.ts.map +1 -0
  319. package/dist/src/index.js +608 -0
  320. package/dist/src/index.js.map +1 -0
  321. package/dist/src/mcp/boards.d.ts +18 -0
  322. package/dist/src/mcp/boards.d.ts.map +1 -0
  323. package/dist/src/mcp/boards.js +279 -0
  324. package/dist/src/mcp/boards.js.map +1 -0
  325. package/dist/src/mcp/catalogue.d.ts +17 -0
  326. package/dist/src/mcp/catalogue.d.ts.map +1 -0
  327. package/dist/src/mcp/catalogue.js +114 -0
  328. package/dist/src/mcp/catalogue.js.map +1 -0
  329. package/dist/src/mcp/chat-instances.d.ts +18 -0
  330. package/dist/src/mcp/chat-instances.d.ts.map +1 -0
  331. package/dist/src/mcp/chat-instances.js +161 -0
  332. package/dist/src/mcp/chat-instances.js.map +1 -0
  333. package/dist/src/mcp/consent.d.ts +18 -0
  334. package/dist/src/mcp/consent.d.ts.map +1 -0
  335. package/dist/src/mcp/consent.js +158 -0
  336. package/dist/src/mcp/consent.js.map +1 -0
  337. package/dist/src/mcp/core.d.ts +18 -0
  338. package/dist/src/mcp/core.d.ts.map +1 -0
  339. package/dist/src/mcp/core.js +489 -0
  340. package/dist/src/mcp/core.js.map +1 -0
  341. package/dist/src/mcp/extensions.d.ts +18 -0
  342. package/dist/src/mcp/extensions.d.ts.map +1 -0
  343. package/dist/src/mcp/extensions.js +299 -0
  344. package/dist/src/mcp/extensions.js.map +1 -0
  345. package/dist/src/mcp/flags.d.ts +18 -0
  346. package/dist/src/mcp/flags.d.ts.map +1 -0
  347. package/dist/src/mcp/flags.js +59 -0
  348. package/dist/src/mcp/flags.js.map +1 -0
  349. package/dist/src/mcp/index.d.ts +31 -0
  350. package/dist/src/mcp/index.d.ts.map +1 -0
  351. package/dist/src/mcp/index.js +694 -0
  352. package/dist/src/mcp/index.js.map +1 -0
  353. package/dist/src/mcp/knowledge.d.ts +18 -0
  354. package/dist/src/mcp/knowledge.d.ts.map +1 -0
  355. package/dist/src/mcp/knowledge.js +214 -0
  356. package/dist/src/mcp/knowledge.js.map +1 -0
  357. package/dist/src/mcp/memory-extended.d.ts +18 -0
  358. package/dist/src/mcp/memory-extended.d.ts.map +1 -0
  359. package/dist/src/mcp/memory-extended.js +73 -0
  360. package/dist/src/mcp/memory-extended.js.map +1 -0
  361. package/dist/src/mcp/organisms.d.ts +18 -0
  362. package/dist/src/mcp/organisms.d.ts.map +1 -0
  363. package/dist/src/mcp/organisms.js +291 -0
  364. package/dist/src/mcp/organisms.js.map +1 -0
  365. package/dist/src/mcp/prompts.d.ts +17 -0
  366. package/dist/src/mcp/prompts.d.ts.map +1 -0
  367. package/dist/src/mcp/prompts.js +65 -0
  368. package/dist/src/mcp/prompts.js.map +1 -0
  369. package/dist/src/mcp/wallet-extended.d.ts +17 -0
  370. package/dist/src/mcp/wallet-extended.d.ts.map +1 -0
  371. package/dist/src/mcp/wallet-extended.js +42 -0
  372. package/dist/src/mcp/wallet-extended.js.map +1 -0
  373. package/dist/src/middleware/__tests__/cookie-consent.test.d.ts +2 -0
  374. package/dist/src/middleware/__tests__/cookie-consent.test.d.ts.map +1 -0
  375. package/dist/src/middleware/__tests__/cookie-consent.test.js +432 -0
  376. package/dist/src/middleware/__tests__/cookie-consent.test.js.map +1 -0
  377. package/dist/src/middleware/cookie-consent.d.ts +19 -0
  378. package/dist/src/middleware/cookie-consent.d.ts.map +1 -0
  379. package/dist/src/middleware/cookie-consent.js +127 -0
  380. package/dist/src/middleware/cookie-consent.js.map +1 -0
  381. package/dist/src/middleware/cors.d.ts +12 -0
  382. package/dist/src/middleware/cors.d.ts.map +1 -0
  383. package/dist/src/middleware/cors.js +112 -0
  384. package/dist/src/middleware/cors.js.map +1 -0
  385. package/dist/src/middleware/envelope.d.ts +33 -0
  386. package/dist/src/middleware/envelope.d.ts.map +1 -0
  387. package/dist/src/middleware/envelope.js +32 -0
  388. package/dist/src/middleware/envelope.js.map +1 -0
  389. package/dist/src/middleware/idempotency.d.ts +3 -0
  390. package/dist/src/middleware/idempotency.d.ts.map +1 -0
  391. package/dist/src/middleware/idempotency.js +64 -0
  392. package/dist/src/middleware/idempotency.js.map +1 -0
  393. package/dist/src/middleware/metrics.d.ts +8 -0
  394. package/dist/src/middleware/metrics.d.ts.map +1 -0
  395. package/dist/src/middleware/metrics.js +25 -0
  396. package/dist/src/middleware/metrics.js.map +1 -0
  397. package/dist/src/middleware/rate-limit.d.ts +4 -0
  398. package/dist/src/middleware/rate-limit.d.ts.map +1 -0
  399. package/dist/src/middleware/rate-limit.js +73 -0
  400. package/dist/src/middleware/rate-limit.js.map +1 -0
  401. package/dist/src/middleware/request-id.d.ts +18 -0
  402. package/dist/src/middleware/request-id.d.ts.map +1 -0
  403. package/dist/src/middleware/request-id.js +23 -0
  404. package/dist/src/middleware/request-id.js.map +1 -0
  405. package/dist/src/middleware/stats.d.ts +4 -0
  406. package/dist/src/middleware/stats.d.ts.map +1 -0
  407. package/dist/src/middleware/stats.js +11 -0
  408. package/dist/src/middleware/stats.js.map +1 -0
  409. package/dist/src/middleware/workspace-access.d.ts +16 -0
  410. package/dist/src/middleware/workspace-access.d.ts.map +1 -0
  411. package/dist/src/middleware/workspace-access.js +115 -0
  412. package/dist/src/middleware/workspace-access.js.map +1 -0
  413. package/dist/src/models/schemas.d.ts +311 -0
  414. package/dist/src/models/schemas.d.ts.map +1 -0
  415. package/dist/src/models/schemas.js +281 -0
  416. package/dist/src/models/schemas.js.map +1 -0
  417. package/dist/src/routes/actions.d.ts +5 -0
  418. package/dist/src/routes/actions.d.ts.map +1 -0
  419. package/dist/src/routes/actions.js +199 -0
  420. package/dist/src/routes/actions.js.map +1 -0
  421. package/dist/src/routes/admin-agents.d.ts +5 -0
  422. package/dist/src/routes/admin-agents.d.ts.map +1 -0
  423. package/dist/src/routes/admin-agents.js +60 -0
  424. package/dist/src/routes/admin-agents.js.map +1 -0
  425. package/dist/src/routes/admin-config.d.ts +7 -0
  426. package/dist/src/routes/admin-config.d.ts.map +1 -0
  427. package/dist/src/routes/admin-config.js +209 -0
  428. package/dist/src/routes/admin-config.js.map +1 -0
  429. package/dist/src/routes/admin-economy.d.ts +5 -0
  430. package/dist/src/routes/admin-economy.d.ts.map +1 -0
  431. package/dist/src/routes/admin-economy.js +57 -0
  432. package/dist/src/routes/admin-economy.js.map +1 -0
  433. package/dist/src/routes/admin-extensions.d.ts +6 -0
  434. package/dist/src/routes/admin-extensions.d.ts.map +1 -0
  435. package/dist/src/routes/admin-extensions.js +619 -0
  436. package/dist/src/routes/admin-extensions.js.map +1 -0
  437. package/dist/src/routes/admin-features.d.ts +16 -0
  438. package/dist/src/routes/admin-features.d.ts.map +1 -0
  439. package/dist/src/routes/admin-features.js +672 -0
  440. package/dist/src/routes/admin-features.js.map +1 -0
  441. package/dist/src/routes/admin-maintenance.d.ts +8 -0
  442. package/dist/src/routes/admin-maintenance.d.ts.map +1 -0
  443. package/dist/src/routes/admin-maintenance.js +86 -0
  444. package/dist/src/routes/admin-maintenance.js.map +1 -0
  445. package/dist/src/routes/admin-memory.d.ts +12 -0
  446. package/dist/src/routes/admin-memory.d.ts.map +1 -0
  447. package/dist/src/routes/admin-memory.js +64 -0
  448. package/dist/src/routes/admin-memory.js.map +1 -0
  449. package/dist/src/routes/admin-monitoring.d.ts +5 -0
  450. package/dist/src/routes/admin-monitoring.d.ts.map +1 -0
  451. package/dist/src/routes/admin-monitoring.js +343 -0
  452. package/dist/src/routes/admin-monitoring.js.map +1 -0
  453. package/dist/src/routes/admin-prompts.d.ts +5 -0
  454. package/dist/src/routes/admin-prompts.d.ts.map +1 -0
  455. package/dist/src/routes/admin-prompts.js +198 -0
  456. package/dist/src/routes/admin-prompts.js.map +1 -0
  457. package/dist/src/routes/admin-scheduler.d.ts +6 -0
  458. package/dist/src/routes/admin-scheduler.d.ts.map +1 -0
  459. package/dist/src/routes/admin-scheduler.js +153 -0
  460. package/dist/src/routes/admin-scheduler.js.map +1 -0
  461. package/dist/src/routes/admin.d.ts +10 -0
  462. package/dist/src/routes/admin.d.ts.map +1 -0
  463. package/dist/src/routes/admin.js +847 -0
  464. package/dist/src/routes/admin.js.map +1 -0
  465. package/dist/src/routes/agents.d.ts +5 -0
  466. package/dist/src/routes/agents.d.ts.map +1 -0
  467. package/dist/src/routes/agents.js +946 -0
  468. package/dist/src/routes/agents.js.map +1 -0
  469. package/dist/src/routes/app-store.d.ts +25 -0
  470. package/dist/src/routes/app-store.d.ts.map +1 -0
  471. package/dist/src/routes/app-store.js +269 -0
  472. package/dist/src/routes/app-store.js.map +1 -0
  473. package/dist/src/routes/appeals.d.ts +5 -0
  474. package/dist/src/routes/appeals.d.ts.map +1 -0
  475. package/dist/src/routes/appeals.js +241 -0
  476. package/dist/src/routes/appeals.js.map +1 -0
  477. package/dist/src/routes/apps.d.ts +14 -0
  478. package/dist/src/routes/apps.d.ts.map +1 -0
  479. package/dist/src/routes/apps.js +395 -0
  480. package/dist/src/routes/apps.js.map +1 -0
  481. package/dist/src/routes/auth.d.ts +13 -0
  482. package/dist/src/routes/auth.d.ts.map +1 -0
  483. package/dist/src/routes/auth.js +517 -0
  484. package/dist/src/routes/auth.js.map +1 -0
  485. package/dist/src/routes/boards.d.ts +5 -0
  486. package/dist/src/routes/boards.d.ts.map +1 -0
  487. package/dist/src/routes/boards.js +614 -0
  488. package/dist/src/routes/boards.js.map +1 -0
  489. package/dist/src/routes/bootstrap.d.ts +6 -0
  490. package/dist/src/routes/bootstrap.d.ts.map +1 -0
  491. package/dist/src/routes/bootstrap.js +360 -0
  492. package/dist/src/routes/bootstrap.js.map +1 -0
  493. package/dist/src/routes/calibrator.d.ts +28 -0
  494. package/dist/src/routes/calibrator.d.ts.map +1 -0
  495. package/dist/src/routes/calibrator.js +556 -0
  496. package/dist/src/routes/calibrator.js.map +1 -0
  497. package/dist/src/routes/catalogue.d.ts +7 -0
  498. package/dist/src/routes/catalogue.d.ts.map +1 -0
  499. package/dist/src/routes/catalogue.js +377 -0
  500. package/dist/src/routes/catalogue.js.map +1 -0
  501. package/dist/src/routes/chat-instances.d.ts +5 -0
  502. package/dist/src/routes/chat-instances.d.ts.map +1 -0
  503. package/dist/src/routes/chat-instances.js +131 -0
  504. package/dist/src/routes/chat-instances.js.map +1 -0
  505. package/dist/src/routes/consent.d.ts +6 -0
  506. package/dist/src/routes/consent.d.ts.map +1 -0
  507. package/dist/src/routes/consent.js +188 -0
  508. package/dist/src/routes/consent.js.map +1 -0
  509. package/dist/src/routes/cortex.d.ts +5 -0
  510. package/dist/src/routes/cortex.d.ts.map +1 -0
  511. package/dist/src/routes/cortex.js +617 -0
  512. package/dist/src/routes/cortex.js.map +1 -0
  513. package/dist/src/routes/csm.d.ts +5 -0
  514. package/dist/src/routes/csm.d.ts.map +1 -0
  515. package/dist/src/routes/csm.js +258 -0
  516. package/dist/src/routes/csm.js.map +1 -0
  517. package/dist/src/routes/disputes.d.ts +5 -0
  518. package/dist/src/routes/disputes.d.ts.map +1 -0
  519. package/dist/src/routes/disputes.js +528 -0
  520. package/dist/src/routes/disputes.js.map +1 -0
  521. package/dist/src/routes/extensions.d.ts +6 -0
  522. package/dist/src/routes/extensions.d.ts.map +1 -0
  523. package/dist/src/routes/extensions.js +1149 -0
  524. package/dist/src/routes/extensions.js.map +1 -0
  525. package/dist/src/routes/federation-genesis.d.ts +11 -0
  526. package/dist/src/routes/federation-genesis.d.ts.map +1 -0
  527. package/dist/src/routes/federation-genesis.js +638 -0
  528. package/dist/src/routes/federation-genesis.js.map +1 -0
  529. package/dist/src/routes/federation-peer.d.ts +10 -0
  530. package/dist/src/routes/federation-peer.d.ts.map +1 -0
  531. package/dist/src/routes/federation-peer.js +613 -0
  532. package/dist/src/routes/federation-peer.js.map +1 -0
  533. package/dist/src/routes/federation-settlements.d.ts +10 -0
  534. package/dist/src/routes/federation-settlements.d.ts.map +1 -0
  535. package/dist/src/routes/federation-settlements.js +231 -0
  536. package/dist/src/routes/federation-settlements.js.map +1 -0
  537. package/dist/src/routes/federation-sync.d.ts +15 -0
  538. package/dist/src/routes/federation-sync.d.ts.map +1 -0
  539. package/dist/src/routes/federation-sync.js +629 -0
  540. package/dist/src/routes/federation-sync.js.map +1 -0
  541. package/dist/src/routes/federation.d.ts +15 -0
  542. package/dist/src/routes/federation.d.ts.map +1 -0
  543. package/dist/src/routes/federation.js +23 -0
  544. package/dist/src/routes/federation.js.map +1 -0
  545. package/dist/src/routes/flags.d.ts +5 -0
  546. package/dist/src/routes/flags.d.ts.map +1 -0
  547. package/dist/src/routes/flags.js +194 -0
  548. package/dist/src/routes/flags.js.map +1 -0
  549. package/dist/src/routes/foundry.d.ts +5 -0
  550. package/dist/src/routes/foundry.d.ts.map +1 -0
  551. package/dist/src/routes/foundry.js +955 -0
  552. package/dist/src/routes/foundry.js.map +1 -0
  553. package/dist/src/routes/generator-autopilot.d.ts +12 -0
  554. package/dist/src/routes/generator-autopilot.d.ts.map +1 -0
  555. package/dist/src/routes/generator-autopilot.js +71 -0
  556. package/dist/src/routes/generator-autopilot.js.map +1 -0
  557. package/dist/src/routes/generator.d.ts +5 -0
  558. package/dist/src/routes/generator.d.ts.map +1 -0
  559. package/dist/src/routes/generator.js +1313 -0
  560. package/dist/src/routes/generator.js.map +1 -0
  561. package/dist/src/routes/ghii.d.ts +16 -0
  562. package/dist/src/routes/ghii.d.ts.map +1 -0
  563. package/dist/src/routes/ghii.js +1115 -0
  564. package/dist/src/routes/ghii.js.map +1 -0
  565. package/dist/src/routes/instances.d.ts +31 -0
  566. package/dist/src/routes/instances.d.ts.map +1 -0
  567. package/dist/src/routes/instances.js +722 -0
  568. package/dist/src/routes/instances.js.map +1 -0
  569. package/dist/src/routes/knowledge.d.ts +33 -0
  570. package/dist/src/routes/knowledge.d.ts.map +1 -0
  571. package/dist/src/routes/knowledge.js +1108 -0
  572. package/dist/src/routes/knowledge.js.map +1 -0
  573. package/dist/src/routes/lib-data.d.ts +7 -0
  574. package/dist/src/routes/lib-data.d.ts.map +1 -0
  575. package/dist/src/routes/lib-data.js +189 -0
  576. package/dist/src/routes/lib-data.js.map +1 -0
  577. package/dist/src/routes/lib-social.d.ts +7 -0
  578. package/dist/src/routes/lib-social.d.ts.map +1 -0
  579. package/dist/src/routes/lib-social.js +159 -0
  580. package/dist/src/routes/lib-social.js.map +1 -0
  581. package/dist/src/routes/lib-storage.d.ts +7 -0
  582. package/dist/src/routes/lib-storage.d.ts.map +1 -0
  583. package/dist/src/routes/lib-storage.js +202 -0
  584. package/dist/src/routes/lib-storage.js.map +1 -0
  585. package/dist/src/routes/lib-tunnel.d.ts +8 -0
  586. package/dist/src/routes/lib-tunnel.d.ts.map +1 -0
  587. package/dist/src/routes/lib-tunnel.js +442 -0
  588. package/dist/src/routes/lib-tunnel.js.map +1 -0
  589. package/dist/src/routes/lib-wallet.d.ts +7 -0
  590. package/dist/src/routes/lib-wallet.d.ts.map +1 -0
  591. package/dist/src/routes/lib-wallet.js +129 -0
  592. package/dist/src/routes/lib-wallet.js.map +1 -0
  593. package/dist/src/routes/lib-work.d.ts +7 -0
  594. package/dist/src/routes/lib-work.d.ts.map +1 -0
  595. package/dist/src/routes/lib-work.js +210 -0
  596. package/dist/src/routes/lib-work.js.map +1 -0
  597. package/dist/src/routes/libs.d.ts +10 -0
  598. package/dist/src/routes/libs.d.ts.map +1 -0
  599. package/dist/src/routes/libs.js +989 -0
  600. package/dist/src/routes/libs.js.map +1 -0
  601. package/dist/src/routes/matches.d.ts +10 -0
  602. package/dist/src/routes/matches.d.ts.map +1 -0
  603. package/dist/src/routes/matches.js +218 -0
  604. package/dist/src/routes/matches.js.map +1 -0
  605. package/dist/src/routes/memory.d.ts +6 -0
  606. package/dist/src/routes/memory.d.ts.map +1 -0
  607. package/dist/src/routes/memory.js +796 -0
  608. package/dist/src/routes/memory.js.map +1 -0
  609. package/dist/src/routes/micro-memory.d.ts +5 -0
  610. package/dist/src/routes/micro-memory.d.ts.map +1 -0
  611. package/dist/src/routes/micro-memory.js +488 -0
  612. package/dist/src/routes/micro-memory.js.map +1 -0
  613. package/dist/src/routes/msm.d.ts +5 -0
  614. package/dist/src/routes/msm.d.ts.map +1 -0
  615. package/dist/src/routes/msm.js +242 -0
  616. package/dist/src/routes/msm.js.map +1 -0
  617. package/dist/src/routes/openrouter.d.ts +23 -0
  618. package/dist/src/routes/openrouter.d.ts.map +1 -0
  619. package/dist/src/routes/openrouter.js +337 -0
  620. package/dist/src/routes/openrouter.js.map +1 -0
  621. package/dist/src/routes/organisms.d.ts +5 -0
  622. package/dist/src/routes/organisms.d.ts.map +1 -0
  623. package/dist/src/routes/organisms.js +415 -0
  624. package/dist/src/routes/organisms.js.map +1 -0
  625. package/dist/src/routes/owners.d.ts +5 -0
  626. package/dist/src/routes/owners.d.ts.map +1 -0
  627. package/dist/src/routes/owners.js +637 -0
  628. package/dist/src/routes/owners.js.map +1 -0
  629. package/dist/src/routes/packages.d.ts +35 -0
  630. package/dist/src/routes/packages.d.ts.map +1 -0
  631. package/dist/src/routes/packages.js +600 -0
  632. package/dist/src/routes/packages.js.map +1 -0
  633. package/dist/src/routes/permissions.d.ts +5 -0
  634. package/dist/src/routes/permissions.d.ts.map +1 -0
  635. package/dist/src/routes/permissions.js +85 -0
  636. package/dist/src/routes/permissions.js.map +1 -0
  637. package/dist/src/routes/personal.d.ts +7 -0
  638. package/dist/src/routes/personal.d.ts.map +1 -0
  639. package/dist/src/routes/personal.js +594 -0
  640. package/dist/src/routes/personal.js.map +1 -0
  641. package/dist/src/routes/portal-api.d.ts +9 -0
  642. package/dist/src/routes/portal-api.d.ts.map +1 -0
  643. package/dist/src/routes/portal-api.js +49 -0
  644. package/dist/src/routes/portal-api.js.map +1 -0
  645. package/dist/src/routes/portal-human.d.ts +12 -0
  646. package/dist/src/routes/portal-human.d.ts.map +1 -0
  647. package/dist/src/routes/portal-human.js +2652 -0
  648. package/dist/src/routes/portal-human.js.map +1 -0
  649. package/dist/src/routes/portal.d.ts +24 -0
  650. package/dist/src/routes/portal.d.ts.map +1 -0
  651. package/dist/src/routes/portal.js +372 -0
  652. package/dist/src/routes/portal.js.map +1 -0
  653. package/dist/src/routes/portfolio.d.ts +5 -0
  654. package/dist/src/routes/portfolio.d.ts.map +1 -0
  655. package/dist/src/routes/portfolio.js +231 -0
  656. package/dist/src/routes/portfolio.js.map +1 -0
  657. package/dist/src/routes/profile.d.ts +5 -0
  658. package/dist/src/routes/profile.d.ts.map +1 -0
  659. package/dist/src/routes/profile.js +2042 -0
  660. package/dist/src/routes/profile.js.map +1 -0
  661. package/dist/src/routes/prompts.d.ts +5 -0
  662. package/dist/src/routes/prompts.d.ts.map +1 -0
  663. package/dist/src/routes/prompts.js +318 -0
  664. package/dist/src/routes/prompts.js.map +1 -0
  665. package/dist/src/routes/push.d.ts +6 -0
  666. package/dist/src/routes/push.d.ts.map +1 -0
  667. package/dist/src/routes/push.js +75 -0
  668. package/dist/src/routes/push.js.map +1 -0
  669. package/dist/src/routes/realtime.d.ts +7 -0
  670. package/dist/src/routes/realtime.d.ts.map +1 -0
  671. package/dist/src/routes/realtime.js +289 -0
  672. package/dist/src/routes/realtime.js.map +1 -0
  673. package/dist/src/routes/schemas.d.ts +5 -0
  674. package/dist/src/routes/schemas.d.ts.map +1 -0
  675. package/dist/src/routes/schemas.js +130 -0
  676. package/dist/src/routes/schemas.js.map +1 -0
  677. package/dist/src/routes/setup.d.ts +7 -0
  678. package/dist/src/routes/setup.d.ts.map +1 -0
  679. package/dist/src/routes/setup.js +243 -0
  680. package/dist/src/routes/setup.js.map +1 -0
  681. package/dist/src/routes/site.d.ts +6 -0
  682. package/dist/src/routes/site.d.ts.map +1 -0
  683. package/dist/src/routes/site.js +201 -0
  684. package/dist/src/routes/site.js.map +1 -0
  685. package/dist/src/routes/spec.d.ts +3 -0
  686. package/dist/src/routes/spec.d.ts.map +1 -0
  687. package/dist/src/routes/spec.js +47 -0
  688. package/dist/src/routes/spec.js.map +1 -0
  689. package/dist/src/routes/sse.d.ts +5 -0
  690. package/dist/src/routes/sse.d.ts.map +1 -0
  691. package/dist/src/routes/sse.js +66 -0
  692. package/dist/src/routes/sse.js.map +1 -0
  693. package/dist/src/routes/stats.d.ts +7 -0
  694. package/dist/src/routes/stats.d.ts.map +1 -0
  695. package/dist/src/routes/stats.js +98 -0
  696. package/dist/src/routes/stats.js.map +1 -0
  697. package/dist/src/routes/storage-files.d.ts +5 -0
  698. package/dist/src/routes/storage-files.d.ts.map +1 -0
  699. package/dist/src/routes/storage-files.js +460 -0
  700. package/dist/src/routes/storage-files.js.map +1 -0
  701. package/dist/src/routes/templates.d.ts +30 -0
  702. package/dist/src/routes/templates.d.ts.map +1 -0
  703. package/dist/src/routes/templates.js +511 -0
  704. package/dist/src/routes/templates.js.map +1 -0
  705. package/dist/src/routes/totp.d.ts +5 -0
  706. package/dist/src/routes/totp.d.ts.map +1 -0
  707. package/dist/src/routes/totp.js +166 -0
  708. package/dist/src/routes/totp.js.map +1 -0
  709. package/dist/src/routes/validate.d.ts +4 -0
  710. package/dist/src/routes/validate.d.ts.map +1 -0
  711. package/dist/src/routes/validate.js +71 -0
  712. package/dist/src/routes/validate.js.map +1 -0
  713. package/dist/src/routes/verification.d.ts +8 -0
  714. package/dist/src/routes/verification.d.ts.map +1 -0
  715. package/dist/src/routes/verification.js +259 -0
  716. package/dist/src/routes/verification.js.map +1 -0
  717. package/dist/src/routes/wallet.d.ts +18 -0
  718. package/dist/src/routes/wallet.d.ts.map +1 -0
  719. package/dist/src/routes/wallet.js +164 -0
  720. package/dist/src/routes/wallet.js.map +1 -0
  721. package/dist/src/routes/wellknown.d.ts +5 -0
  722. package/dist/src/routes/wellknown.d.ts.map +1 -0
  723. package/dist/src/routes/wellknown.js +57 -0
  724. package/dist/src/routes/wellknown.js.map +1 -0
  725. package/dist/src/routes/work.d.ts +21 -0
  726. package/dist/src/routes/work.d.ts.map +1 -0
  727. package/dist/src/routes/work.js +654 -0
  728. package/dist/src/routes/work.js.map +1 -0
  729. package/dist/src/schemas/knowledge-package.d.ts +203 -0
  730. package/dist/src/schemas/knowledge-package.d.ts.map +1 -0
  731. package/dist/src/schemas/knowledge-package.js +233 -0
  732. package/dist/src/schemas/knowledge-package.js.map +1 -0
  733. package/dist/src/server-bootstrap/config-init.d.ts +16 -0
  734. package/dist/src/server-bootstrap/config-init.d.ts.map +1 -0
  735. package/dist/src/server-bootstrap/config-init.js +113 -0
  736. package/dist/src/server-bootstrap/config-init.js.map +1 -0
  737. package/dist/src/server-bootstrap/middleware-guards.d.ts +15 -0
  738. package/dist/src/server-bootstrap/middleware-guards.d.ts.map +1 -0
  739. package/dist/src/server-bootstrap/middleware-guards.js +244 -0
  740. package/dist/src/server-bootstrap/middleware-guards.js.map +1 -0
  741. package/dist/src/server-bootstrap/routes-loader.d.ts +35 -0
  742. package/dist/src/server-bootstrap/routes-loader.d.ts.map +1 -0
  743. package/dist/src/server-bootstrap/routes-loader.js +290 -0
  744. package/dist/src/server-bootstrap/routes-loader.js.map +1 -0
  745. package/dist/src/server-bootstrap/service-init.d.ts +24 -0
  746. package/dist/src/server-bootstrap/service-init.d.ts.map +1 -0
  747. package/dist/src/server-bootstrap/service-init.js +195 -0
  748. package/dist/src/server-bootstrap/service-init.js.map +1 -0
  749. package/dist/src/server-bootstrap/static-files.d.ts +7 -0
  750. package/dist/src/server-bootstrap/static-files.d.ts.map +1 -0
  751. package/dist/src/server-bootstrap/static-files.js +119 -0
  752. package/dist/src/server-bootstrap/static-files.js.map +1 -0
  753. package/dist/src/server.d.ts +22 -0
  754. package/dist/src/server.d.ts.map +1 -0
  755. package/dist/src/server.js +133 -0
  756. package/dist/src/server.js.map +1 -0
  757. package/dist/src/services/cache-cleanup.d.ts +31 -0
  758. package/dist/src/services/cache-cleanup.d.ts.map +1 -0
  759. package/dist/src/services/cache-cleanup.js +123 -0
  760. package/dist/src/services/cache-cleanup.js.map +1 -0
  761. package/dist/src/services/catalogue-sync.d.ts +45 -0
  762. package/dist/src/services/catalogue-sync.d.ts.map +1 -0
  763. package/dist/src/services/catalogue-sync.js +196 -0
  764. package/dist/src/services/catalogue-sync.js.map +1 -0
  765. package/dist/src/services/component-registrar.d.ts +46 -0
  766. package/dist/src/services/component-registrar.d.ts.map +1 -0
  767. package/dist/src/services/component-registrar.js +389 -0
  768. package/dist/src/services/component-registrar.js.map +1 -0
  769. package/dist/src/services/config-loader.d.ts +42 -0
  770. package/dist/src/services/config-loader.d.ts.map +1 -0
  771. package/dist/src/services/config-loader.js +187 -0
  772. package/dist/src/services/config-loader.js.map +1 -0
  773. package/dist/src/services/config-provenance.d.ts +32 -0
  774. package/dist/src/services/config-provenance.d.ts.map +1 -0
  775. package/dist/src/services/config-provenance.js +59 -0
  776. package/dist/src/services/config-provenance.js.map +1 -0
  777. package/dist/src/services/config-schema.d.ts +52 -0
  778. package/dist/src/services/config-schema.d.ts.map +1 -0
  779. package/dist/src/services/config-schema.js +288 -0
  780. package/dist/src/services/config-schema.js.map +1 -0
  781. package/dist/src/services/consent.d.ts +43 -0
  782. package/dist/src/services/consent.d.ts.map +1 -0
  783. package/dist/src/services/consent.js +137 -0
  784. package/dist/src/services/consent.js.map +1 -0
  785. package/dist/src/services/consul-config.d.ts +30 -0
  786. package/dist/src/services/consul-config.d.ts.map +1 -0
  787. package/dist/src/services/consul-config.js +110 -0
  788. package/dist/src/services/consul-config.js.map +1 -0
  789. package/dist/src/services/core-jobs.d.ts +8 -0
  790. package/dist/src/services/core-jobs.d.ts.map +1 -0
  791. package/dist/src/services/core-jobs.js +161 -0
  792. package/dist/src/services/core-jobs.js.map +1 -0
  793. package/dist/src/services/cortex-manifest.d.ts +17 -0
  794. package/dist/src/services/cortex-manifest.d.ts.map +1 -0
  795. package/dist/src/services/cortex-manifest.js +343 -0
  796. package/dist/src/services/cortex-manifest.js.map +1 -0
  797. package/dist/src/services/cortex-seeder.d.ts +18 -0
  798. package/dist/src/services/cortex-seeder.d.ts.map +1 -0
  799. package/dist/src/services/cortex-seeder.js +86 -0
  800. package/dist/src/services/cortex-seeder.js.map +1 -0
  801. package/dist/src/services/cross-node-matching.d.ts +23 -0
  802. package/dist/src/services/cross-node-matching.d.ts.map +1 -0
  803. package/dist/src/services/cross-node-matching.js +62 -0
  804. package/dist/src/services/cross-node-matching.js.map +1 -0
  805. package/dist/src/services/csm-parser.d.ts +57 -0
  806. package/dist/src/services/csm-parser.d.ts.map +1 -0
  807. package/dist/src/services/csm-parser.js +161 -0
  808. package/dist/src/services/csm-parser.js.map +1 -0
  809. package/dist/src/services/csm-seed.d.ts +15 -0
  810. package/dist/src/services/csm-seed.d.ts.map +1 -0
  811. package/dist/src/services/csm-seed.js +89 -0
  812. package/dist/src/services/csm-seed.js.map +1 -0
  813. package/dist/src/services/directory.d.ts +86 -0
  814. package/dist/src/services/directory.d.ts.map +1 -0
  815. package/dist/src/services/directory.js +307 -0
  816. package/dist/src/services/directory.js.map +1 -0
  817. package/dist/src/services/email-templates.d.ts +29 -0
  818. package/dist/src/services/email-templates.d.ts.map +1 -0
  819. package/dist/src/services/email-templates.js +204 -0
  820. package/dist/src/services/email-templates.js.map +1 -0
  821. package/dist/src/services/email.d.ts +18 -0
  822. package/dist/src/services/email.d.ts.map +1 -0
  823. package/dist/src/services/email.js +102 -0
  824. package/dist/src/services/email.js.map +1 -0
  825. package/dist/src/services/encryption.d.ts +31 -0
  826. package/dist/src/services/encryption.d.ts.map +1 -0
  827. package/dist/src/services/encryption.js +51 -0
  828. package/dist/src/services/encryption.js.map +1 -0
  829. package/dist/src/services/eudiw.d.ts +15 -0
  830. package/dist/src/services/eudiw.d.ts.map +1 -0
  831. package/dist/src/services/eudiw.js +89 -0
  832. package/dist/src/services/eudiw.js.map +1 -0
  833. package/dist/src/services/event-bus.d.ts +8 -0
  834. package/dist/src/services/event-bus.d.ts.map +1 -0
  835. package/dist/src/services/event-bus.js +13 -0
  836. package/dist/src/services/event-bus.js.map +1 -0
  837. package/dist/src/services/extension-runtime.d.ts +72 -0
  838. package/dist/src/services/extension-runtime.d.ts.map +1 -0
  839. package/dist/src/services/extension-runtime.js +282 -0
  840. package/dist/src/services/extension-runtime.js.map +1 -0
  841. package/dist/src/services/federation-helpers.d.ts +37 -0
  842. package/dist/src/services/federation-helpers.d.ts.map +1 -0
  843. package/dist/src/services/federation-helpers.js +100 -0
  844. package/dist/src/services/federation-helpers.js.map +1 -0
  845. package/dist/src/services/federation.d.ts +32 -0
  846. package/dist/src/services/federation.d.ts.map +1 -0
  847. package/dist/src/services/federation.js +201 -0
  848. package/dist/src/services/federation.js.map +1 -0
  849. package/dist/src/services/foundry-debug.d.ts +77 -0
  850. package/dist/src/services/foundry-debug.d.ts.map +1 -0
  851. package/dist/src/services/foundry-debug.js +214 -0
  852. package/dist/src/services/foundry-debug.js.map +1 -0
  853. package/dist/src/services/foundry-registration.d.ts +42 -0
  854. package/dist/src/services/foundry-registration.d.ts.map +1 -0
  855. package/dist/src/services/foundry-registration.js +330 -0
  856. package/dist/src/services/foundry-registration.js.map +1 -0
  857. package/dist/src/services/foundry-testing.d.ts +90 -0
  858. package/dist/src/services/foundry-testing.d.ts.map +1 -0
  859. package/dist/src/services/foundry-testing.js +253 -0
  860. package/dist/src/services/foundry-testing.js.map +1 -0
  861. package/dist/src/services/foundry-validate.d.ts +115 -0
  862. package/dist/src/services/foundry-validate.d.ts.map +1 -0
  863. package/dist/src/services/foundry-validate.js +781 -0
  864. package/dist/src/services/foundry-validate.js.map +1 -0
  865. package/dist/src/services/generator-autopilot.d.ts +37 -0
  866. package/dist/src/services/generator-autopilot.d.ts.map +1 -0
  867. package/dist/src/services/generator-autopilot.js +1076 -0
  868. package/dist/src/services/generator-autopilot.js.map +1 -0
  869. package/dist/src/services/generator-debug.d.ts +79 -0
  870. package/dist/src/services/generator-debug.d.ts.map +1 -0
  871. package/dist/src/services/generator-debug.js +218 -0
  872. package/dist/src/services/generator-debug.js.map +1 -0
  873. package/dist/src/services/generator-prompt-seeds.d.ts +13 -0
  874. package/dist/src/services/generator-prompt-seeds.d.ts.map +1 -0
  875. package/dist/src/services/generator-prompt-seeds.js +2694 -0
  876. package/dist/src/services/generator-prompt-seeds.js.map +1 -0
  877. package/dist/src/services/generator-prompts/bundle.d.ts +17 -0
  878. package/dist/src/services/generator-prompts/bundle.d.ts.map +1 -0
  879. package/dist/src/services/generator-prompts/bundle.js +95 -0
  880. package/dist/src/services/generator-prompts/bundle.js.map +1 -0
  881. package/dist/src/services/generator-prompts/index.d.ts +48 -0
  882. package/dist/src/services/generator-prompts/index.d.ts.map +1 -0
  883. package/dist/src/services/generator-prompts/index.js +97 -0
  884. package/dist/src/services/generator-prompts/index.js.map +1 -0
  885. package/dist/src/services/generator-prompts/resolvers.d.ts +21 -0
  886. package/dist/src/services/generator-prompts/resolvers.d.ts.map +1 -0
  887. package/dist/src/services/generator-prompts/resolvers.js +1553 -0
  888. package/dist/src/services/generator-prompts/resolvers.js.map +1 -0
  889. package/dist/src/services/generator-prompts/spec-validate.d.ts +29 -0
  890. package/dist/src/services/generator-prompts/spec-validate.d.ts.map +1 -0
  891. package/dist/src/services/generator-prompts/spec-validate.js +190 -0
  892. package/dist/src/services/generator-prompts/spec-validate.js.map +1 -0
  893. package/dist/src/services/generator-prompts/strip.d.ts +13 -0
  894. package/dist/src/services/generator-prompts/strip.d.ts.map +1 -0
  895. package/dist/src/services/generator-prompts/strip.js +60 -0
  896. package/dist/src/services/generator-prompts/strip.js.map +1 -0
  897. package/dist/src/services/generator-prompts/types.d.ts +229 -0
  898. package/dist/src/services/generator-prompts/types.d.ts.map +1 -0
  899. package/dist/src/services/generator-prompts/types.js +8 -0
  900. package/dist/src/services/generator-prompts/types.js.map +1 -0
  901. package/dist/src/services/generator-prompts/validate.d.ts +48 -0
  902. package/dist/src/services/generator-prompts/validate.d.ts.map +1 -0
  903. package/dist/src/services/generator-prompts/validate.js +927 -0
  904. package/dist/src/services/generator-prompts/validate.js.map +1 -0
  905. package/dist/src/services/generator-registration.d.ts +43 -0
  906. package/dist/src/services/generator-registration.d.ts.map +1 -0
  907. package/dist/src/services/generator-registration.js +343 -0
  908. package/dist/src/services/generator-registration.js.map +1 -0
  909. package/dist/src/services/generator-testing.d.ts +93 -0
  910. package/dist/src/services/generator-testing.d.ts.map +1 -0
  911. package/dist/src/services/generator-testing.js +300 -0
  912. package/dist/src/services/generator-testing.js.map +1 -0
  913. package/dist/src/services/generator-validate.d.ts +117 -0
  914. package/dist/src/services/generator-validate.d.ts.map +1 -0
  915. package/dist/src/services/generator-validate.js +790 -0
  916. package/dist/src/services/generator-validate.js.map +1 -0
  917. package/dist/src/services/genesis-peering.d.ts +12 -0
  918. package/dist/src/services/genesis-peering.d.ts.map +1 -0
  919. package/dist/src/services/genesis-peering.js +91 -0
  920. package/dist/src/services/genesis-peering.js.map +1 -0
  921. package/dist/src/services/genesis-sync.d.ts +29 -0
  922. package/dist/src/services/genesis-sync.d.ts.map +1 -0
  923. package/dist/src/services/genesis-sync.js +370 -0
  924. package/dist/src/services/genesis-sync.js.map +1 -0
  925. package/dist/src/services/hooks.d.ts +21 -0
  926. package/dist/src/services/hooks.d.ts.map +1 -0
  927. package/dist/src/services/hooks.js +85 -0
  928. package/dist/src/services/hooks.js.map +1 -0
  929. package/dist/src/services/job-seeding.d.ts +7 -0
  930. package/dist/src/services/job-seeding.d.ts.map +1 -0
  931. package/dist/src/services/job-seeding.js +39 -0
  932. package/dist/src/services/job-seeding.js.map +1 -0
  933. package/dist/src/services/knowledge.d.ts +13 -0
  934. package/dist/src/services/knowledge.d.ts.map +1 -0
  935. package/dist/src/services/knowledge.js +15 -0
  936. package/dist/src/services/knowledge.js.map +1 -0
  937. package/dist/src/services/mailbox-notification.d.ts +37 -0
  938. package/dist/src/services/mailbox-notification.d.ts.map +1 -0
  939. package/dist/src/services/mailbox-notification.js +249 -0
  940. package/dist/src/services/mailbox-notification.js.map +1 -0
  941. package/dist/src/services/mailbox.d.ts +16 -0
  942. package/dist/src/services/mailbox.d.ts.map +1 -0
  943. package/dist/src/services/mailbox.js +77 -0
  944. package/dist/src/services/mailbox.js.map +1 -0
  945. package/dist/src/services/match-notification.d.ts +12 -0
  946. package/dist/src/services/match-notification.d.ts.map +1 -0
  947. package/dist/src/services/match-notification.js +121 -0
  948. package/dist/src/services/match-notification.js.map +1 -0
  949. package/dist/src/services/matching.d.ts +54 -0
  950. package/dist/src/services/matching.d.ts.map +1 -0
  951. package/dist/src/services/matching.js +293 -0
  952. package/dist/src/services/matching.js.map +1 -0
  953. package/dist/src/services/memory-replication.d.ts +43 -0
  954. package/dist/src/services/memory-replication.d.ts.map +1 -0
  955. package/dist/src/services/memory-replication.js +213 -0
  956. package/dist/src/services/memory-replication.js.map +1 -0
  957. package/dist/src/services/morsel.d.ts +49 -0
  958. package/dist/src/services/morsel.d.ts.map +1 -0
  959. package/dist/src/services/morsel.js +174 -0
  960. package/dist/src/services/morsel.js.map +1 -0
  961. package/dist/src/services/msm-parser.d.ts +55 -0
  962. package/dist/src/services/msm-parser.d.ts.map +1 -0
  963. package/dist/src/services/msm-parser.js +186 -0
  964. package/dist/src/services/msm-parser.js.map +1 -0
  965. package/dist/src/services/mydata-receipt.d.ts +29 -0
  966. package/dist/src/services/mydata-receipt.d.ts.map +1 -0
  967. package/dist/src/services/mydata-receipt.js +31 -0
  968. package/dist/src/services/mydata-receipt.js.map +1 -0
  969. package/dist/src/services/notification-templates.d.ts +40 -0
  970. package/dist/src/services/notification-templates.d.ts.map +1 -0
  971. package/dist/src/services/notification-templates.js +109 -0
  972. package/dist/src/services/notification-templates.js.map +1 -0
  973. package/dist/src/services/openrouter.d.ts +30 -0
  974. package/dist/src/services/openrouter.d.ts.map +1 -0
  975. package/dist/src/services/openrouter.js +95 -0
  976. package/dist/src/services/openrouter.js.map +1 -0
  977. package/dist/src/services/organism-reputation.d.ts +7 -0
  978. package/dist/src/services/organism-reputation.d.ts.map +1 -0
  979. package/dist/src/services/organism-reputation.js +107 -0
  980. package/dist/src/services/organism-reputation.js.map +1 -0
  981. package/dist/src/services/package-hash.d.ts +19 -0
  982. package/dist/src/services/package-hash.d.ts.map +1 -0
  983. package/dist/src/services/package-hash.js +22 -0
  984. package/dist/src/services/package-hash.js.map +1 -0
  985. package/dist/src/services/package-zip.d.ts +60 -0
  986. package/dist/src/services/package-zip.d.ts.map +1 -0
  987. package/dist/src/services/package-zip.js +267 -0
  988. package/dist/src/services/package-zip.js.map +1 -0
  989. package/dist/src/services/password.d.ts +9 -0
  990. package/dist/src/services/password.d.ts.map +1 -0
  991. package/dist/src/services/password.js +32 -0
  992. package/dist/src/services/password.js.map +1 -0
  993. package/dist/src/services/personal-routing.d.ts +21 -0
  994. package/dist/src/services/personal-routing.d.ts.map +1 -0
  995. package/dist/src/services/personal-routing.js +77 -0
  996. package/dist/src/services/personal-routing.js.map +1 -0
  997. package/dist/src/services/personal-tunnel.d.ts +39 -0
  998. package/dist/src/services/personal-tunnel.d.ts.map +1 -0
  999. package/dist/src/services/personal-tunnel.js +371 -0
  1000. package/dist/src/services/personal-tunnel.js.map +1 -0
  1001. package/dist/src/services/profile-schemas.d.ts +12 -0
  1002. package/dist/src/services/profile-schemas.d.ts.map +1 -0
  1003. package/dist/src/services/profile-schemas.js +100 -0
  1004. package/dist/src/services/profile-schemas.js.map +1 -0
  1005. package/dist/src/services/prometheus.d.ts +32 -0
  1006. package/dist/src/services/prometheus.d.ts.map +1 -0
  1007. package/dist/src/services/prometheus.js +162 -0
  1008. package/dist/src/services/prometheus.js.map +1 -0
  1009. package/dist/src/services/prompt-defaults.d.ts +33 -0
  1010. package/dist/src/services/prompt-defaults.d.ts.map +1 -0
  1011. package/dist/src/services/prompt-defaults.js +1675 -0
  1012. package/dist/src/services/prompt-defaults.js.map +1 -0
  1013. package/dist/src/services/prompt-seeder.d.ts +8 -0
  1014. package/dist/src/services/prompt-seeder.d.ts.map +1 -0
  1015. package/dist/src/services/prompt-seeder.js +65 -0
  1016. package/dist/src/services/prompt-seeder.js.map +1 -0
  1017. package/dist/src/services/prompt-variables.d.ts +15 -0
  1018. package/dist/src/services/prompt-variables.d.ts.map +1 -0
  1019. package/dist/src/services/prompt-variables.js +34 -0
  1020. package/dist/src/services/prompt-variables.js.map +1 -0
  1021. package/dist/src/services/push.d.ts +26 -0
  1022. package/dist/src/services/push.d.ts.map +1 -0
  1023. package/dist/src/services/push.js +70 -0
  1024. package/dist/src/services/push.js.map +1 -0
  1025. package/dist/src/services/quota.d.ts +45 -0
  1026. package/dist/src/services/quota.d.ts.map +1 -0
  1027. package/dist/src/services/quota.js +129 -0
  1028. package/dist/src/services/quota.js.map +1 -0
  1029. package/dist/src/services/realtime-manager.d.ts +144 -0
  1030. package/dist/src/services/realtime-manager.d.ts.map +1 -0
  1031. package/dist/src/services/realtime-manager.js +640 -0
  1032. package/dist/src/services/realtime-manager.js.map +1 -0
  1033. package/dist/src/services/scheduler.d.ts +55 -0
  1034. package/dist/src/services/scheduler.d.ts.map +1 -0
  1035. package/dist/src/services/scheduler.js +420 -0
  1036. package/dist/src/services/scheduler.js.map +1 -0
  1037. package/dist/src/services/schema-validator.d.ts +20 -0
  1038. package/dist/src/services/schema-validator.d.ts.map +1 -0
  1039. package/dist/src/services/schema-validator.js +68 -0
  1040. package/dist/src/services/schema-validator.js.map +1 -0
  1041. package/dist/src/services/site-sync.d.ts +15 -0
  1042. package/dist/src/services/site-sync.d.ts.map +1 -0
  1043. package/dist/src/services/site-sync.js +99 -0
  1044. package/dist/src/services/site-sync.js.map +1 -0
  1045. package/dist/src/services/site.d.ts +65 -0
  1046. package/dist/src/services/site.d.ts.map +1 -0
  1047. package/dist/src/services/site.js +378 -0
  1048. package/dist/src/services/site.js.map +1 -0
  1049. package/dist/src/services/stats.d.ts +75 -0
  1050. package/dist/src/services/stats.d.ts.map +1 -0
  1051. package/dist/src/services/stats.js +124 -0
  1052. package/dist/src/services/stats.js.map +1 -0
  1053. package/dist/src/services/sync-health.d.ts +53 -0
  1054. package/dist/src/services/sync-health.d.ts.map +1 -0
  1055. package/dist/src/services/sync-health.js +122 -0
  1056. package/dist/src/services/sync-health.js.map +1 -0
  1057. package/dist/src/services/sync-scheduler.d.ts +25 -0
  1058. package/dist/src/services/sync-scheduler.d.ts.map +1 -0
  1059. package/dist/src/services/sync-scheduler.js +211 -0
  1060. package/dist/src/services/sync-scheduler.js.map +1 -0
  1061. package/dist/src/services/totp.d.ts +31 -0
  1062. package/dist/src/services/totp.d.ts.map +1 -0
  1063. package/dist/src/services/totp.js +96 -0
  1064. package/dist/src/services/totp.js.map +1 -0
  1065. package/dist/src/services/trust-broadcast.d.ts +37 -0
  1066. package/dist/src/services/trust-broadcast.d.ts.map +1 -0
  1067. package/dist/src/services/trust-broadcast.js +107 -0
  1068. package/dist/src/services/trust-broadcast.js.map +1 -0
  1069. package/dist/src/services/trust.d.ts +16 -0
  1070. package/dist/src/services/trust.d.ts.map +1 -0
  1071. package/dist/src/services/trust.js +109 -0
  1072. package/dist/src/services/trust.js.map +1 -0
  1073. package/dist/src/services/vc-issuer.d.ts +14 -0
  1074. package/dist/src/services/vc-issuer.d.ts.map +1 -0
  1075. package/dist/src/services/vc-issuer.js +24 -0
  1076. package/dist/src/services/vc-issuer.js.map +1 -0
  1077. package/dist/src/storage/interface.d.ts +1161 -0
  1078. package/dist/src/storage/interface.d.ts.map +1 -0
  1079. package/dist/src/storage/interface.js +2 -0
  1080. package/dist/src/storage/interface.js.map +1 -0
  1081. package/dist/src/storage/pattern-utils.d.ts +20 -0
  1082. package/dist/src/storage/pattern-utils.d.ts.map +1 -0
  1083. package/dist/src/storage/pattern-utils.js +57 -0
  1084. package/dist/src/storage/pattern-utils.js.map +1 -0
  1085. package/dist/src/storage/providers/mongodb/index.d.ts +608 -0
  1086. package/dist/src/storage/providers/mongodb/index.d.ts.map +1 -0
  1087. package/dist/src/storage/providers/mongodb/index.js +4931 -0
  1088. package/dist/src/storage/providers/mongodb/index.js.map +1 -0
  1089. package/dist/src/storage/providers/sqlite/index.d.ts +602 -0
  1090. package/dist/src/storage/providers/sqlite/index.d.ts.map +1 -0
  1091. package/dist/src/storage/providers/sqlite/index.js +4156 -0
  1092. package/dist/src/storage/providers/sqlite/index.js.map +1 -0
  1093. package/dist/src/storage/providers/sqlite/repos/action.d.ts +13 -0
  1094. package/dist/src/storage/providers/sqlite/repos/action.d.ts.map +1 -0
  1095. package/dist/src/storage/providers/sqlite/repos/action.js +79 -0
  1096. package/dist/src/storage/providers/sqlite/repos/action.js.map +1 -0
  1097. package/dist/src/storage/providers/sqlite/repos/agent.d.ts +13 -0
  1098. package/dist/src/storage/providers/sqlite/repos/agent.d.ts.map +1 -0
  1099. package/dist/src/storage/providers/sqlite/repos/agent.js +103 -0
  1100. package/dist/src/storage/providers/sqlite/repos/agent.js.map +1 -0
  1101. package/dist/src/storage/providers/sqlite/repos/auth.d.ts +56 -0
  1102. package/dist/src/storage/providers/sqlite/repos/auth.d.ts.map +1 -0
  1103. package/dist/src/storage/providers/sqlite/repos/auth.js +282 -0
  1104. package/dist/src/storage/providers/sqlite/repos/auth.js.map +1 -0
  1105. package/dist/src/storage/providers/sqlite/repos/board.d.ts +24 -0
  1106. package/dist/src/storage/providers/sqlite/repos/board.d.ts.map +1 -0
  1107. package/dist/src/storage/providers/sqlite/repos/board.js +154 -0
  1108. package/dist/src/storage/providers/sqlite/repos/board.js.map +1 -0
  1109. package/dist/src/storage/providers/sqlite/repos/community.d.ts +33 -0
  1110. package/dist/src/storage/providers/sqlite/repos/community.d.ts.map +1 -0
  1111. package/dist/src/storage/providers/sqlite/repos/community.js +202 -0
  1112. package/dist/src/storage/providers/sqlite/repos/community.js.map +1 -0
  1113. package/dist/src/storage/providers/sqlite/repos/consent.d.ts +23 -0
  1114. package/dist/src/storage/providers/sqlite/repos/consent.d.ts.map +1 -0
  1115. package/dist/src/storage/providers/sqlite/repos/consent.js +187 -0
  1116. package/dist/src/storage/providers/sqlite/repos/consent.js.map +1 -0
  1117. package/dist/src/storage/providers/sqlite/repos/dispute.d.ts +20 -0
  1118. package/dist/src/storage/providers/sqlite/repos/dispute.d.ts.map +1 -0
  1119. package/dist/src/storage/providers/sqlite/repos/dispute.js +118 -0
  1120. package/dist/src/storage/providers/sqlite/repos/dispute.js.map +1 -0
  1121. package/dist/src/storage/providers/sqlite/repos/flag.d.ts +26 -0
  1122. package/dist/src/storage/providers/sqlite/repos/flag.d.ts.map +1 -0
  1123. package/dist/src/storage/providers/sqlite/repos/flag.js +147 -0
  1124. package/dist/src/storage/providers/sqlite/repos/flag.js.map +1 -0
  1125. package/dist/src/storage/providers/sqlite/repos/identity.d.ts +36 -0
  1126. package/dist/src/storage/providers/sqlite/repos/identity.d.ts.map +1 -0
  1127. package/dist/src/storage/providers/sqlite/repos/identity.js +297 -0
  1128. package/dist/src/storage/providers/sqlite/repos/identity.js.map +1 -0
  1129. package/dist/src/storage/providers/sqlite/repos/mailbox.d.ts +18 -0
  1130. package/dist/src/storage/providers/sqlite/repos/mailbox.d.ts.map +1 -0
  1131. package/dist/src/storage/providers/sqlite/repos/mailbox.js +91 -0
  1132. package/dist/src/storage/providers/sqlite/repos/mailbox.js.map +1 -0
  1133. package/dist/src/storage/providers/sqlite/repos/memory.d.ts +28 -0
  1134. package/dist/src/storage/providers/sqlite/repos/memory.d.ts.map +1 -0
  1135. package/dist/src/storage/providers/sqlite/repos/memory.js +152 -0
  1136. package/dist/src/storage/providers/sqlite/repos/memory.js.map +1 -0
  1137. package/dist/src/storage/providers/sqlite/repos/owner.d.ts +14 -0
  1138. package/dist/src/storage/providers/sqlite/repos/owner.d.ts.map +1 -0
  1139. package/dist/src/storage/providers/sqlite/repos/owner.js +124 -0
  1140. package/dist/src/storage/providers/sqlite/repos/owner.js.map +1 -0
  1141. package/dist/src/storage/providers/sqlite/repos/service-manifest.d.ts +17 -0
  1142. package/dist/src/storage/providers/sqlite/repos/service-manifest.d.ts.map +1 -0
  1143. package/dist/src/storage/providers/sqlite/repos/service-manifest.js +114 -0
  1144. package/dist/src/storage/providers/sqlite/repos/service-manifest.js.map +1 -0
  1145. package/dist/src/storage/providers/sqlite/repos/storage-file.d.ts +19 -0
  1146. package/dist/src/storage/providers/sqlite/repos/storage-file.d.ts.map +1 -0
  1147. package/dist/src/storage/providers/sqlite/repos/storage-file.js +128 -0
  1148. package/dist/src/storage/providers/sqlite/repos/storage-file.js.map +1 -0
  1149. package/dist/src/storage/providers/sqlite/repos/work.d.ts +13 -0
  1150. package/dist/src/storage/providers/sqlite/repos/work.d.ts.map +1 -0
  1151. package/dist/src/storage/providers/sqlite/repos/work.js +86 -0
  1152. package/dist/src/storage/providers/sqlite/repos/work.js.map +1 -0
  1153. package/dist/src/storage/providers/sqlite/schema.d.ts +7 -0
  1154. package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -0
  1155. package/dist/src/storage/providers/sqlite/schema.js +1090 -0
  1156. package/dist/src/storage/providers/sqlite/schema.js.map +1 -0
  1157. package/dist/src/storage/repositories/action.repository.d.ts +14 -0
  1158. package/dist/src/storage/repositories/action.repository.d.ts.map +1 -0
  1159. package/dist/src/storage/repositories/action.repository.js +2 -0
  1160. package/dist/src/storage/repositories/action.repository.js.map +1 -0
  1161. package/dist/src/storage/repositories/agent.repository.d.ts +18 -0
  1162. package/dist/src/storage/repositories/agent.repository.d.ts.map +1 -0
  1163. package/dist/src/storage/repositories/agent.repository.js +2 -0
  1164. package/dist/src/storage/repositories/agent.repository.js.map +1 -0
  1165. package/dist/src/storage/repositories/app-marketplace.repository.d.ts +9 -0
  1166. package/dist/src/storage/repositories/app-marketplace.repository.d.ts.map +1 -0
  1167. package/dist/src/storage/repositories/app-marketplace.repository.js +2 -0
  1168. package/dist/src/storage/repositories/app-marketplace.repository.js.map +1 -0
  1169. package/dist/src/storage/repositories/app.repository.d.ts +17 -0
  1170. package/dist/src/storage/repositories/app.repository.d.ts.map +1 -0
  1171. package/dist/src/storage/repositories/app.repository.js +2 -0
  1172. package/dist/src/storage/repositories/app.repository.js.map +1 -0
  1173. package/dist/src/storage/repositories/auth.repository.d.ts +6 -0
  1174. package/dist/src/storage/repositories/auth.repository.d.ts.map +1 -0
  1175. package/dist/src/storage/repositories/auth.repository.js +2 -0
  1176. package/dist/src/storage/repositories/auth.repository.js.map +1 -0
  1177. package/dist/src/storage/repositories/board.repository.d.ts +27 -0
  1178. package/dist/src/storage/repositories/board.repository.d.ts.map +1 -0
  1179. package/dist/src/storage/repositories/board.repository.js +2 -0
  1180. package/dist/src/storage/repositories/board.repository.js.map +1 -0
  1181. package/dist/src/storage/repositories/catalogue.repository.d.ts +18 -0
  1182. package/dist/src/storage/repositories/catalogue.repository.d.ts.map +1 -0
  1183. package/dist/src/storage/repositories/catalogue.repository.js +2 -0
  1184. package/dist/src/storage/repositories/catalogue.repository.js.map +1 -0
  1185. package/dist/src/storage/repositories/config.repository.d.ts +17 -0
  1186. package/dist/src/storage/repositories/config.repository.d.ts.map +1 -0
  1187. package/dist/src/storage/repositories/config.repository.js +2 -0
  1188. package/dist/src/storage/repositories/config.repository.js.map +1 -0
  1189. package/dist/src/storage/repositories/consent.repository.d.ts +19 -0
  1190. package/dist/src/storage/repositories/consent.repository.d.ts.map +1 -0
  1191. package/dist/src/storage/repositories/consent.repository.js +2 -0
  1192. package/dist/src/storage/repositories/consent.repository.js.map +1 -0
  1193. package/dist/src/storage/repositories/device-auth.repository.d.ts +11 -0
  1194. package/dist/src/storage/repositories/device-auth.repository.d.ts.map +1 -0
  1195. package/dist/src/storage/repositories/device-auth.repository.js +2 -0
  1196. package/dist/src/storage/repositories/device-auth.repository.js.map +1 -0
  1197. package/dist/src/storage/repositories/dispute.repository.d.ts +12 -0
  1198. package/dist/src/storage/repositories/dispute.repository.d.ts.map +1 -0
  1199. package/dist/src/storage/repositories/dispute.repository.js +2 -0
  1200. package/dist/src/storage/repositories/dispute.repository.js.map +1 -0
  1201. package/dist/src/storage/repositories/extension-instance.repository.d.ts +9 -0
  1202. package/dist/src/storage/repositories/extension-instance.repository.d.ts.map +1 -0
  1203. package/dist/src/storage/repositories/extension-instance.repository.js +2 -0
  1204. package/dist/src/storage/repositories/extension-instance.repository.js.map +1 -0
  1205. package/dist/src/storage/repositories/federation.repository.d.ts +37 -0
  1206. package/dist/src/storage/repositories/federation.repository.d.ts.map +1 -0
  1207. package/dist/src/storage/repositories/federation.repository.js +2 -0
  1208. package/dist/src/storage/repositories/federation.repository.js.map +1 -0
  1209. package/dist/src/storage/repositories/file.repository.d.ts +14 -0
  1210. package/dist/src/storage/repositories/file.repository.d.ts.map +1 -0
  1211. package/dist/src/storage/repositories/file.repository.js +2 -0
  1212. package/dist/src/storage/repositories/file.repository.js.map +1 -0
  1213. package/dist/src/storage/repositories/identity.repository.d.ts +29 -0
  1214. package/dist/src/storage/repositories/identity.repository.d.ts.map +1 -0
  1215. package/dist/src/storage/repositories/identity.repository.js +2 -0
  1216. package/dist/src/storage/repositories/identity.repository.js.map +1 -0
  1217. package/dist/src/storage/repositories/index.d.ts +34 -0
  1218. package/dist/src/storage/repositories/index.d.ts.map +1 -0
  1219. package/dist/src/storage/repositories/index.js +2 -0
  1220. package/dist/src/storage/repositories/index.js.map +1 -0
  1221. package/dist/src/storage/repositories/knowledge.repository.d.ts +18 -0
  1222. package/dist/src/storage/repositories/knowledge.repository.d.ts.map +1 -0
  1223. package/dist/src/storage/repositories/knowledge.repository.js +2 -0
  1224. package/dist/src/storage/repositories/knowledge.repository.js.map +1 -0
  1225. package/dist/src/storage/repositories/marketplace.repository.d.ts +23 -0
  1226. package/dist/src/storage/repositories/marketplace.repository.d.ts.map +1 -0
  1227. package/dist/src/storage/repositories/marketplace.repository.js +2 -0
  1228. package/dist/src/storage/repositories/marketplace.repository.js.map +1 -0
  1229. package/dist/src/storage/repositories/memory.repository.d.ts +32 -0
  1230. package/dist/src/storage/repositories/memory.repository.d.ts.map +1 -0
  1231. package/dist/src/storage/repositories/memory.repository.js +2 -0
  1232. package/dist/src/storage/repositories/memory.repository.js.map +1 -0
  1233. package/dist/src/storage/repositories/micro-memory.repository.d.ts +10 -0
  1234. package/dist/src/storage/repositories/micro-memory.repository.d.ts.map +1 -0
  1235. package/dist/src/storage/repositories/micro-memory.repository.js +2 -0
  1236. package/dist/src/storage/repositories/micro-memory.repository.js.map +1 -0
  1237. package/dist/src/storage/repositories/moderation.repository.d.ts +36 -0
  1238. package/dist/src/storage/repositories/moderation.repository.d.ts.map +1 -0
  1239. package/dist/src/storage/repositories/moderation.repository.js +2 -0
  1240. package/dist/src/storage/repositories/moderation.repository.js.map +1 -0
  1241. package/dist/src/storage/repositories/node.repository.d.ts +59 -0
  1242. package/dist/src/storage/repositories/node.repository.d.ts.map +1 -0
  1243. package/dist/src/storage/repositories/node.repository.js +2 -0
  1244. package/dist/src/storage/repositories/node.repository.js.map +1 -0
  1245. package/dist/src/storage/repositories/notification-template.repository.d.ts +8 -0
  1246. package/dist/src/storage/repositories/notification-template.repository.d.ts.map +1 -0
  1247. package/dist/src/storage/repositories/notification-template.repository.js +2 -0
  1248. package/dist/src/storage/repositories/notification-template.repository.js.map +1 -0
  1249. package/dist/src/storage/repositories/notification.repository.d.ts +14 -0
  1250. package/dist/src/storage/repositories/notification.repository.d.ts.map +1 -0
  1251. package/dist/src/storage/repositories/notification.repository.js +2 -0
  1252. package/dist/src/storage/repositories/notification.repository.js.map +1 -0
  1253. package/dist/src/storage/repositories/oauth.repository.d.ts +19 -0
  1254. package/dist/src/storage/repositories/oauth.repository.d.ts.map +1 -0
  1255. package/dist/src/storage/repositories/oauth.repository.js +2 -0
  1256. package/dist/src/storage/repositories/oauth.repository.js.map +1 -0
  1257. package/dist/src/storage/repositories/organism.repository.d.ts +34 -0
  1258. package/dist/src/storage/repositories/organism.repository.d.ts.map +1 -0
  1259. package/dist/src/storage/repositories/organism.repository.js +2 -0
  1260. package/dist/src/storage/repositories/organism.repository.js.map +1 -0
  1261. package/dist/src/storage/repositories/otk.repository.d.ts +9 -0
  1262. package/dist/src/storage/repositories/otk.repository.d.ts.map +1 -0
  1263. package/dist/src/storage/repositories/otk.repository.js +2 -0
  1264. package/dist/src/storage/repositories/otk.repository.js.map +1 -0
  1265. package/dist/src/storage/repositories/owner.repository.d.ts +9 -0
  1266. package/dist/src/storage/repositories/owner.repository.d.ts.map +1 -0
  1267. package/dist/src/storage/repositories/owner.repository.js +2 -0
  1268. package/dist/src/storage/repositories/owner.repository.js.map +1 -0
  1269. package/dist/src/storage/repositories/package-instance.repository.d.ts +26 -0
  1270. package/dist/src/storage/repositories/package-instance.repository.d.ts.map +1 -0
  1271. package/dist/src/storage/repositories/package-instance.repository.js +12 -0
  1272. package/dist/src/storage/repositories/package-instance.repository.js.map +1 -0
  1273. package/dist/src/storage/repositories/package.repository.d.ts +28 -0
  1274. package/dist/src/storage/repositories/package.repository.d.ts.map +1 -0
  1275. package/dist/src/storage/repositories/package.repository.js +12 -0
  1276. package/dist/src/storage/repositories/package.repository.js.map +1 -0
  1277. package/dist/src/storage/repositories/replication-queue.repository.d.ts +10 -0
  1278. package/dist/src/storage/repositories/replication-queue.repository.d.ts.map +1 -0
  1279. package/dist/src/storage/repositories/replication-queue.repository.js +2 -0
  1280. package/dist/src/storage/repositories/replication-queue.repository.js.map +1 -0
  1281. package/dist/src/storage/repositories/scheduler.repository.d.ts +30 -0
  1282. package/dist/src/storage/repositories/scheduler.repository.d.ts.map +1 -0
  1283. package/dist/src/storage/repositories/scheduler.repository.js +2 -0
  1284. package/dist/src/storage/repositories/scheduler.repository.js.map +1 -0
  1285. package/dist/src/storage/repositories/schema.repository.d.ts +9 -0
  1286. package/dist/src/storage/repositories/schema.repository.d.ts.map +1 -0
  1287. package/dist/src/storage/repositories/schema.repository.js +2 -0
  1288. package/dist/src/storage/repositories/schema.repository.js.map +1 -0
  1289. package/dist/src/storage/repositories/session.repository.d.ts +22 -0
  1290. package/dist/src/storage/repositories/session.repository.d.ts.map +1 -0
  1291. package/dist/src/storage/repositories/session.repository.js +2 -0
  1292. package/dist/src/storage/repositories/session.repository.js.map +1 -0
  1293. package/dist/src/storage/repositories/system-prompt.repository.d.ts +14 -0
  1294. package/dist/src/storage/repositories/system-prompt.repository.d.ts.map +1 -0
  1295. package/dist/src/storage/repositories/system-prompt.repository.js +2 -0
  1296. package/dist/src/storage/repositories/system-prompt.repository.js.map +1 -0
  1297. package/dist/src/storage/repositories/template-listing.repository.d.ts +44 -0
  1298. package/dist/src/storage/repositories/template-listing.repository.d.ts.map +1 -0
  1299. package/dist/src/storage/repositories/template-listing.repository.js +13 -0
  1300. package/dist/src/storage/repositories/template-listing.repository.js.map +1 -0
  1301. package/dist/src/storage/repositories/wallet.repository.d.ts +8 -0
  1302. package/dist/src/storage/repositories/wallet.repository.d.ts.map +1 -0
  1303. package/dist/src/storage/repositories/wallet.repository.js +2 -0
  1304. package/dist/src/storage/repositories/wallet.repository.js.map +1 -0
  1305. package/dist/src/storage/repositories/work.repository.d.ts +10 -0
  1306. package/dist/src/storage/repositories/work.repository.d.ts.map +1 -0
  1307. package/dist/src/storage/repositories/work.repository.js +2 -0
  1308. package/dist/src/storage/repositories/work.repository.js.map +1 -0
  1309. package/dist/src/storage/storage-factory.d.ts +9 -0
  1310. package/dist/src/storage/storage-factory.d.ts.map +1 -0
  1311. package/dist/src/storage/storage-factory.js +20 -0
  1312. package/dist/src/storage/storage-factory.js.map +1 -0
  1313. package/dist/src/types/route-manifest.d.ts +53 -0
  1314. package/dist/src/types/route-manifest.d.ts.map +1 -0
  1315. package/dist/src/types/route-manifest.js +44 -0
  1316. package/dist/src/types/route-manifest.js.map +1 -0
  1317. package/dist/src/utils/catalogue-hash.d.ts +10 -0
  1318. package/dist/src/utils/catalogue-hash.d.ts.map +1 -0
  1319. package/dist/src/utils/catalogue-hash.js +23 -0
  1320. package/dist/src/utils/catalogue-hash.js.map +1 -0
  1321. package/dist/src/utils/env-config.d.ts +8 -0
  1322. package/dist/src/utils/env-config.d.ts.map +1 -0
  1323. package/dist/src/utils/env-config.js +1264 -0
  1324. package/dist/src/utils/env-config.js.map +1 -0
  1325. package/dist/src/utils/env-validator.d.ts +14 -0
  1326. package/dist/src/utils/env-validator.d.ts.map +1 -0
  1327. package/dist/src/utils/env-validator.js +338 -0
  1328. package/dist/src/utils/env-validator.js.map +1 -0
  1329. package/dist/src/utils/fire-hook.d.ts +9 -0
  1330. package/dist/src/utils/fire-hook.d.ts.map +1 -0
  1331. package/dist/src/utils/fire-hook.js +12 -0
  1332. package/dist/src/utils/fire-hook.js.map +1 -0
  1333. package/dist/src/utils/gaii.d.ts +57 -0
  1334. package/dist/src/utils/gaii.d.ts.map +1 -0
  1335. package/dist/src/utils/gaii.js +148 -0
  1336. package/dist/src/utils/gaii.js.map +1 -0
  1337. package/dist/src/utils/ghii-resolver.d.ts +14 -0
  1338. package/dist/src/utils/ghii-resolver.d.ts.map +1 -0
  1339. package/dist/src/utils/ghii-resolver.js +21 -0
  1340. package/dist/src/utils/ghii-resolver.js.map +1 -0
  1341. package/dist/src/utils/logger.d.ts +9 -0
  1342. package/dist/src/utils/logger.d.ts.map +1 -0
  1343. package/dist/src/utils/logger.js +36 -0
  1344. package/dist/src/utils/logger.js.map +1 -0
  1345. package/dist/src/utils/otk.d.ts +2 -0
  1346. package/dist/src/utils/otk.d.ts.map +1 -0
  1347. package/dist/src/utils/otk.js +5 -0
  1348. package/dist/src/utils/otk.js.map +1 -0
  1349. package/dist/src/utils/tracking-code.d.ts +9 -0
  1350. package/dist/src/utils/tracking-code.d.ts.map +1 -0
  1351. package/dist/src/utils/tracking-code.js +16 -0
  1352. package/dist/src/utils/tracking-code.js.map +1 -0
  1353. package/dist/src/utils/url-validator.d.ts +5 -0
  1354. package/dist/src/utils/url-validator.d.ts.map +1 -0
  1355. package/dist/src/utils/url-validator.js +56 -0
  1356. package/dist/src/utils/url-validator.js.map +1 -0
  1357. package/dist/static/app-catalog.html +4401 -0
  1358. package/dist/static/cookieconsent.css +1 -0
  1359. package/dist/static/cookieconsent.umd.js +7 -0
  1360. package/dist/static/icons/icon-maskable.svg +27 -0
  1361. package/dist/static/icons/icon.svg +27 -0
  1362. package/dist/static/manifest.json +17 -0
  1363. package/dist/static/offline.html +167 -0
  1364. package/dist/static/sw.js +260 -0
  1365. package/package.json +182 -0
  1366. package/prisma/schema.prisma +1086 -0
@@ -0,0 +1,916 @@
1
+ /**
2
+ * @file generator-validate.js
3
+ * @description Validators for generator component results, blueprints, and interview specs.
4
+ * Each component type (csm, msm, extension, app, memory, translation, cortex) has a
5
+ * validator that checks structure and extracts usable content from AI output.
6
+ * Includes validateInterviewSpec for structured interview JSON and cortex validator
7
+ * for IIFE domain library manifest + lib extraction.
8
+ * @structure
9
+ * - extractCodeBlock(text, lang): pulls content from markdown code fences
10
+ * - validators[type](result): per-type validation returning { valid, errors, extracted }
11
+ * - validateInterviewSpec(result): validates interview spec JSON from AI interviews
12
+ * - validateBlueprint(result): validates + sanitizes blueprint JSON (strips extra fields)
13
+ * - validateComponent(type, result): dispatches to per-type validator
14
+ * @usage import { validateBlueprint, validateComponent, validateInterviewSpec } from '/js/services/generator-validate.js';
15
+ * @version-history
16
+ * v1.0.0 — 2026-03-10 — Initial validators
17
+ * v1.1.0 — 2026-03-14 — validateBlueprint now strips extra component fields
18
+ * (manifest, code, files, etc.) and returns warnings array
19
+ * v1.2.0 — 2026-03-14 — Add sanitizeJson() to fix AI markdown artifacts
20
+ * (\[ → [, trailing commas, zero-width chars) before JSON.parse
21
+ * v2.0.0 — 2026-03-14 — Use real yaml parser (yaml@2.8.2 via /lib/yaml.mjs)
22
+ * for CSM/MSM/Extension validation instead of regex heuristics
23
+ * v2.1.0 — 2026-03-14 — Fix MSM validator to check real structure
24
+ * (service.name/category, auth.type, actions[] with display_name/endpoint);
25
+ * fix Extension validator to check metadata.name/version/description/author
26
+ * and actions[].id/method/path/script
27
+ * v3.0.0 — 2026-03-14 — Replace regex sanitizeYaml with real yaml parse+stringify.
28
+ * YAML is now parsed by the yaml library, then re-serialized to clean output.
29
+ * No more regex hacks for block scalars, quoting, or multiline values.
30
+ * v3.1.0 — 2026-03-14 — Add validateInterviewSpec() for structured interview JSON,
31
+ * add cortex component validator, add 'cortex' to allowed blueprint types
32
+ * v4.0.0 — 2026-03-15 — Add validateAntiPatterns() for universal crash-prevention
33
+ * checks (JSON.parse on memory, require/import in sandbox, HTML entities,
34
+ * translation locale mismatch); integrate into extension/app/translation validators
35
+ * v4.1.0 — 2026-03-15 — Fix HTML entity false positives: strip string literals
36
+ * and regex patterns before checking for entities in code — prevents flagging
37
+ * legitimate entity-decoding code like .replace(/&/g, "&")
38
+ * v4.2.0 — 2026-03-15 — validateBlueprint now validates dataModel: checks
39
+ * producedBy/consumedBy reference valid component IDs, warns on missing schemas
40
+ * v4.3.0 — 2026-03-15 — Allow "schedules" field on extension components and "uses"
41
+ * field on cortex components in blueprint validation (not stripped as extra fields)
42
+ * v4.4.0 — 2026-03-15 — Cortex validator cross-checks YAML metadata.name against
43
+ * JS LIB_NAME (kebab→camelCase), verifies IIFE pattern and AIMEAT.register usage
44
+ * v4.5.0 — 2026-03-16 — Cortex validator supports single-block format (YAML + JS
45
+ * separated by // lib/ comment) in addition to legacy separate blocks. Accept
46
+ * var/let/const for LIB_NAME declaration.
47
+ */
48
+ import { parse as parseYaml, stringify as stringifyYaml } from '../../lib/yaml.mjs';
49
+
50
+ /* ── Helpers ─────────────────────────────────────────── */
51
+
52
+ function extractCodeBlock(text, lang) {
53
+ const regex = new RegExp('```' + (lang || '') + '\\s*\\n([\\s\\S]*?)```', 'i');
54
+ const match = text.match(regex);
55
+ return match ? match[1].trim() : text.trim();
56
+ }
57
+
58
+ /**
59
+ * Sanitize JSON string from common AI/markdown artifacts before parsing.
60
+ */
61
+ function sanitizeJson(text) {
62
+ let s = text;
63
+ // Strip markdown backslash escaping: \[ \] \{ \} \( \) \* \_ \` \| \~ \#
64
+ s = s.replace(/\\([[\]{}()*_`|~#])/g, '$1');
65
+ s = s.replace(/,\s*([}\]])/g, '$1');
66
+ s = s.replace(/[\u200B\u200C\u200D\uFEFF]/g, '');
67
+ return s;
68
+ }
69
+
70
+ /**
71
+ * Minimal text-level cleanup applied BEFORE YAML parsing.
72
+ * Only fixes characters that prevent the parser from running at all.
73
+ * No structural changes — the real yaml parser handles block scalars,
74
+ * multiline strings, etc. correctly on its own.
75
+ */
76
+ function preCleanYaml(text) {
77
+ if (typeof text !== 'string') return text;
78
+ let s = text;
79
+ // Remove markdown-escaped chars that aren't valid YAML
80
+ s = s.replace(/\\_/g, '_');
81
+ s = s.replace(/\\\[/g, '[').replace(/\\\]/g, ']');
82
+ s = s.replace(/\\\{/g, '{').replace(/\\\}/g, '}');
83
+ // Remove zero-width unicode
84
+ s = s.replace(/[\u200B\u200C\u200D\uFEFF]/g, '');
85
+ // Fix common AI mistake: action list items missing "id:" key
86
+ // e.g. " - refreshQuotes\n description:" → " - id: refreshQuotes\n description:"
87
+ // Only match lines under "actions:" where the list item is a bare word followed by description on next line
88
+ s = s.replace(/^(\s+- )([a-zA-Z][\w-]*)\n(\s+description:)/gm, '$1id: $2\n$3');
89
+ return s;
90
+ }
91
+
92
+ /* ── YAML Parse ──────────────────────────────────────── */
93
+
94
+ /**
95
+ * Parse YAML using the real yaml library with multiple fallback strategies.
96
+ * 1. Try parsing as-is (after minimal pre-clean)
97
+ * 2. If that fails, try with yaml library's more tolerant options
98
+ * 3. Return { parsed, errors, cleaned } where cleaned is the canonical YAML
99
+ * re-serialized by the yaml library (no regex hacks)
100
+ */
101
+ function tryParseYaml(text) {
102
+ const errors = [];
103
+ if (!text || typeof text !== 'string') {
104
+ errors.push('Result is empty');
105
+ return { errors, parsed: null, cleaned: text };
106
+ }
107
+
108
+ const preCleaned = preCleanYaml(text);
109
+
110
+ // Attempt 1: strict parse
111
+ try {
112
+ const parsed = parseYaml(preCleaned);
113
+ // Re-serialize through the real yaml library → guaranteed clean output
114
+ const cleaned = stringifyYaml(parsed, { lineWidth: 0 });
115
+ return { errors, parsed, cleaned };
116
+ } catch (_e1) {
117
+ // Attempt 2: try stripping markdown bullets `* ` → `- ` and retry
118
+ let fixed = preCleaned;
119
+ fixed = fixed.replace(/^(\s*)\*\s{2,}/gm, '$1- ');
120
+ fixed = fixed.replace(/^(\s*)\*\s+(?=\S)/gm, '$1- ');
121
+ try {
122
+ const parsed = parseYaml(fixed);
123
+ const cleaned = stringifyYaml(parsed, { lineWidth: 0 });
124
+ return { errors, parsed, cleaned };
125
+ } catch (_e2) {
126
+ // Both attempts failed — report the original error
127
+ errors.push(`YAML parse error: ${_e1.message}`);
128
+ return { errors, parsed: null, cleaned: preCleaned };
129
+ }
130
+ }
131
+ }
132
+
133
+ /* ── Anti-Pattern Validation ─────────────────────────── */
134
+
135
+ /**
136
+ * Scan generated code for universal anti-patterns that always indicate bugs.
137
+ * Returns { warnings: string[], errors: string[] }
138
+ * - errors: patterns that will definitely crash (block install)
139
+ * - warnings: patterns that are suspicious (show warning, allow install)
140
+ */
141
+ export function validateAntiPatterns(type, code) {
142
+ const errors = [];
143
+ const warnings = [];
144
+ if (!code || typeof code !== 'string') return { errors, warnings };
145
+
146
+ // === Extension-specific anti-patterns ===
147
+ if (type === 'extension') {
148
+ // JSON.parse on memory.get — always crashes with "undefined is not valid JSON"
149
+ if (/JSON\.parse\s*\(\s*(await\s+)?ctx\.memory\.get/i.test(code)) {
150
+ errors.push('CRASH: JSON.parse(ctx.memory.get(...)) — memory.get() already returns parsed values. Remove JSON.parse().');
151
+ }
152
+ // JSON.parse wrapping a variable that came from memory.get
153
+ if (/=\s*(await\s+)?ctx\.memory\.get\s*\([^)]+\)\s*;[\s\S]{0,100}JSON\.parse\s*\(\s*\w+\s*\)/m.test(code)) {
154
+ warnings.push('Suspicious: variable from ctx.memory.get() passed to JSON.parse() — memory values are already parsed.');
155
+ }
156
+ // require() — not available in V8 sandbox
157
+ if (/\brequire\s*\(/m.test(code)) {
158
+ errors.push('CRASH: require() is not available in the V8 sandbox. All code must be self-contained.');
159
+ }
160
+ // import ... from (but allow export default)
161
+ if (/\bimport\s+.+\s+from\s+/m.test(code)) {
162
+ errors.push('CRASH: import...from is not available in the V8 sandbox. Only "export default" is allowed.');
163
+ }
164
+ // global fetch() without ctx prefix
165
+ if (/(?<!ctx\.)fetch\s*\(/m.test(code) && !/function\s+fetch/m.test(code)) {
166
+ warnings.push('Suspicious: fetch() called without ctx prefix — use ctx.fetch() in the V8 sandbox. Global fetch is not available.');
167
+ }
168
+ // console.log — not available
169
+ if (/\bconsole\.(log|warn|error|info)\s*\(/m.test(code)) {
170
+ warnings.push('console.log is not available in the V8 sandbox. Use ctx.log.info/warn/error() instead.');
171
+ }
172
+ // setTimeout/setInterval — not available
173
+ if (/\b(setTimeout|setInterval|setImmediate)\s*\(/m.test(code)) {
174
+ errors.push('CRASH: setTimeout/setInterval/setImmediate are not available in the V8 sandbox.');
175
+ }
176
+ // Web APIs — not available in bare V8 isolate (not Node.js, not browser)
177
+ if (/\bnew\s+URLSearchParams\b/m.test(code)) {
178
+ errors.push('CRASH: URLSearchParams is not available in the V8 sandbox. Use string concatenation with encodeURIComponent() instead.');
179
+ }
180
+ if (/\bnew\s+URL\s*\(/m.test(code)) {
181
+ errors.push('CRASH: URL constructor is not available in the V8 sandbox. Use string concatenation instead.');
182
+ }
183
+ if (/\bnew\s+(TextEncoder|TextDecoder)\s*\(/m.test(code)) {
184
+ errors.push('CRASH: TextEncoder/TextDecoder are not available in the V8 sandbox.');
185
+ }
186
+ if (/\bnew\s+(Headers|Request|Response|FormData|Blob|AbortController)\s*\(/m.test(code)) {
187
+ errors.push('CRASH: Web API constructors (Headers, Request, Response, FormData, Blob, AbortController) are not available in the V8 sandbox.');
188
+ }
189
+ if (/\b(atob|btoa)\s*\(/m.test(code)) {
190
+ errors.push('CRASH: atob/btoa are not available in the V8 sandbox.');
191
+ }
192
+ if (/\bstructuredClone\s*\(/m.test(code)) {
193
+ errors.push('CRASH: structuredClone is not available in the V8 sandbox. Use JSON.parse(JSON.stringify(obj)) instead.');
194
+ }
195
+ }
196
+
197
+ // === HTML entity corruption (any type) ===
198
+ // These appear when AI retries render HTML entities in code
199
+ if (/&gt;|&lt;|&amp;(?!amp;)|&quot;/.test(code)) {
200
+ const codeLines = code.split('\n');
201
+ const entityLines = codeLines.filter(line => {
202
+ // Skip lines that are clearly HTML text content
203
+ if (/^\s*<[^>]+>[^<]*&/.test(line)) return false;
204
+ // Skip lines where entities appear only inside string literals (e.g., .replace(/&amp;/g, "&"))
205
+ // Strip quoted strings and regex literals before checking for entities
206
+ const stripped = line
207
+ .replace(/"(?:[^"\\]|\\.)*"/g, '""') // remove double-quoted strings
208
+ .replace(/'(?:[^'\\]|\\.)*'/g, "''") // remove single-quoted strings
209
+ .replace(/`(?:[^`\\]|\\.)*`/g, '``') // remove template literals
210
+ .replace(/\/(?:[^/\\]|\\.)+\/[gimsuy]*/g, '//'); // remove regex literals
211
+ if (!/&gt;|&lt;|&amp;[a-z]|&quot;/.test(stripped)) return false;
212
+ // Flag lines with entities in code context
213
+ return /[=(){}\[\];]/.test(line);
214
+ });
215
+ if (entityLines.length > 0) {
216
+ errors.push(`HTML entities found in code (${entityLines.length} lines) — use => not =&gt;, && not &amp;&amp;, etc. This crashes the V8 sandbox.`);
217
+ }
218
+ }
219
+
220
+ // === Translation anti-patterns ===
221
+ if (type === 'translation') {
222
+ try {
223
+ const parsed = JSON.parse(code);
224
+ if (parsed.en && !parsed.fi && Object.values(parsed.en).some(v => /[äöåÄÖÅ]/.test(String(v)))) {
225
+ warnings.push('Suspicious: "en" locale contains Finnish characters (ä, ö, å) — check if root key should be "fi".');
226
+ }
227
+ if (parsed.fi && Object.values(parsed.fi).every(v => !/[äöåÄÖÅ]/.test(String(v)))) {
228
+ warnings.push('Suspicious: "fi" locale has no Finnish characters (ä, ö, å) — may contain English text under wrong locale key.');
229
+ }
230
+ } catch { /* not valid JSON, other validators will catch this */ }
231
+ }
232
+
233
+ return { errors, warnings };
234
+ }
235
+
236
+ /* ── Validators ──────────────────────────────────────── */
237
+
238
+ const validators = {
239
+ csm(result) {
240
+ const errors = [];
241
+ const raw = extractCodeBlock(result, 'yaml');
242
+ const { parsed, errors: parseErrors, cleaned } = tryParseYaml(raw);
243
+ errors.push(...parseErrors);
244
+
245
+ if (parsed && typeof parsed === 'object') {
246
+ if (!parsed.service?.name) errors.push('Missing: service.name');
247
+ if (!parsed.service?.description) errors.push('Missing: service.description');
248
+ if (!parsed.data_schema?.required || Object.keys(parsed.data_schema.required).length === 0) {
249
+ errors.push('data_schema.required must have at least one field');
250
+ }
251
+ if (!parsed.consent_requirements) errors.push('Missing section: consent_requirements');
252
+ }
253
+
254
+ return { valid: errors.length === 0, errors, extracted: cleaned };
255
+ },
256
+
257
+ msm(result) {
258
+ const errors = [];
259
+ const raw = extractCodeBlock(result, 'yaml');
260
+ const { parsed, errors: parseErrors, cleaned } = tryParseYaml(raw);
261
+ errors.push(...parseErrors);
262
+
263
+ if (parsed && typeof parsed === 'object') {
264
+ if (!parsed.service?.name) errors.push('Missing: service.name');
265
+ if (!parsed.service?.description) errors.push('Missing: service.description');
266
+ if (!parsed.service?.category) errors.push('Missing: service.category');
267
+ if (!parsed.auth?.type) errors.push('Missing: auth.type');
268
+ if (!Array.isArray(parsed.actions) || parsed.actions.length === 0) {
269
+ errors.push('actions must be a non-empty array');
270
+ } else {
271
+ for (const action of parsed.actions) {
272
+ const pfx = `action "${action?.id || '?'}"`;
273
+ if (!action?.id) errors.push(`${pfx}: missing id`);
274
+ if (!action?.display_name) errors.push(`${pfx}: missing display_name`);
275
+ if (!action?.endpoint?.method) errors.push(`${pfx}: missing endpoint.method`);
276
+ if (!action?.endpoint?.url) errors.push(`${pfx}: missing endpoint.url`);
277
+ if (!action?.output || Object.keys(action.output).length === 0) {
278
+ errors.push(`${pfx}: must have at least one output field`);
279
+ }
280
+ }
281
+ }
282
+ }
283
+
284
+ return { valid: errors.length === 0, errors, extracted: cleaned };
285
+ },
286
+
287
+ extension(result, blueprint) {
288
+ const errors = [];
289
+
290
+ // ── Extract YAML manifest — supports three formats ──
291
+ // Format 1 (preferred): Single untagged code block with // actions/*.js separator
292
+ // Format 2: Fenced ```yaml block + JS markers
293
+ // Format 3: Raw text with JS markers
294
+ let raw = null;
295
+
296
+ // Format 1: single untagged code block — extract content, split at // actions/
297
+ const untaggedMatch = result.match(/```\s*\n([\s\S]*?)```/);
298
+ if (untaggedMatch) {
299
+ const content = untaggedMatch[1];
300
+ const actionSep = content.match(/^\/\/\s*actions\/\S+\.js\s*$/m);
301
+ if (actionSep) {
302
+ const sepIndex = content.indexOf(actionSep[0]);
303
+ raw = content.slice(0, sepIndex).trim();
304
+ }
305
+ }
306
+
307
+ // Format 2/3: fenced ```yaml block or raw text — cut at JS markers
308
+ if (!raw) {
309
+ raw = extractCodeBlock(result, 'yaml');
310
+ const jsMarkers = [
311
+ /^\/\/\s*actions\//m,
312
+ /^#\s*actions\//m,
313
+ /^export\s+default\s+/m,
314
+ ];
315
+ let jsStart = -1;
316
+ for (const rx of jsMarkers) {
317
+ const idx = raw.search(rx);
318
+ if (idx > 0 && (jsStart === -1 || idx < jsStart)) jsStart = idx;
319
+ }
320
+ if (jsStart > 0) raw = raw.slice(0, jsStart).trim();
321
+ }
322
+ const { parsed, errors: parseErrors } = tryParseYaml(raw);
323
+ errors.push(...parseErrors);
324
+
325
+ if (parsed && typeof parsed === 'object') {
326
+ if (!parsed.metadata?.name) errors.push('Missing: metadata.name');
327
+ else if (/\./.test(parsed.metadata.name)) errors.push('metadata.name must not contain dots (.) — dots cause namespace collisions in memory owner keys');
328
+ else if (!/^[a-z][a-z0-9-]*$/.test(parsed.metadata.name)) errors.push('metadata.name must be lowercase kebab-case (e.g., "my-collector")');
329
+ if (!parsed.metadata?.version) errors.push('Missing: metadata.version');
330
+ if (!parsed.metadata?.description) errors.push('Missing: metadata.description');
331
+ if (!parsed.metadata?.author) errors.push('Missing: metadata.author');
332
+ if (!Array.isArray(parsed.actions) || parsed.actions.length === 0) {
333
+ errors.push('actions array is required and must not be empty');
334
+ } else {
335
+ for (const action of parsed.actions) {
336
+ const pfx = `action "${action?.id || '?'}"`;
337
+ if (!action?.id) errors.push(`${pfx}: missing id`);
338
+ if (!action?.method) errors.push(`${pfx}: missing method`);
339
+ if (!action?.path) errors.push(`${pfx}: missing path`);
340
+ if (!action?.script) errors.push(`${pfx}: missing script`);
341
+ }
342
+ }
343
+ }
344
+
345
+ // Blueprint action ID cross-check — WARNING only, not an error.
346
+ // The spec is the authority. Blueprint has abstract action names
347
+ // that may not match the actual API structure.
348
+ if (blueprint?.testScenarios && Array.isArray(parsed?.actions)) {
349
+ const bpComp = blueprint.components?.find(c => c.type === 'extension');
350
+ if (bpComp) {
351
+ const testActions = (blueprint.testScenarios || [])
352
+ .filter(ts => ts.component === bpComp.id)
353
+ .flatMap(ts => (ts.scenarios || []).map(s => s.action));
354
+ const actualIds = new Set(parsed.actions.map(a => a.id));
355
+ for (const expected of testActions) {
356
+ if (!actualIds.has(expected)) {
357
+ console.warn(`[validator] Blueprint expects "${expected}" but extension has: ${[...actualIds].join(', ')}`);
358
+ }
359
+ }
360
+ }
361
+ }
362
+
363
+ // Check for action scripts — look for fenced JS blocks OR unfenced // actions/file.js comments
364
+ const fencedJs = result.match(/```javascript[\s\S]*?```/gi) || [];
365
+ const unfencedJs = result.match(/^\/\/\s*actions\/[\w-]+\.js\s*$/gm) || [];
366
+ const jsBlockCount = Math.max(fencedJs.length, unfencedJs.length);
367
+ const actionCount = Array.isArray(parsed?.actions) ? parsed.actions.length : 0;
368
+ if (actionCount > 0 && jsBlockCount === 0) {
369
+ errors.push(`Extension defines ${actionCount} action(s) but no JavaScript code blocks found`);
370
+ } else if (actionCount > 0 && jsBlockCount > 0 && jsBlockCount < actionCount) {
371
+ errors.push(`Extension defines ${actionCount} action(s) but only ${jsBlockCount} JavaScript code blocks found — each action needs its own script`);
372
+ }
373
+
374
+ // Anti-pattern scan
375
+ const ap = validateAntiPatterns('extension', result);
376
+ errors.push(...ap.errors);
377
+
378
+ return { valid: errors.length === 0, errors, extracted: result };
379
+ },
380
+
381
+ app(result) {
382
+ const errors = [];
383
+ const html = extractCodeBlock(result, 'html') || result;
384
+
385
+ if (!html.includes('<!DOCTYPE html') && !html.includes('<html')) {
386
+ errors.push('Not a valid HTML document — missing <!DOCTYPE html> or <html> tag');
387
+ }
388
+ if (!html.includes('<head')) errors.push('Missing <head> section');
389
+ if (!html.includes('<body')) errors.push('Missing <body> section');
390
+ if (!html.includes('AIMEAT App Manifest') && !html.match(/name:\s*.+/)) {
391
+ errors.push('Missing AIMEAT App Manifest comment');
392
+ }
393
+
394
+ // Anti-pattern scan
395
+ const ap = validateAntiPatterns('app', html);
396
+ errors.push(...ap.errors);
397
+
398
+ return { valid: errors.length === 0, errors, extracted: html };
399
+ },
400
+
401
+ memory(result) {
402
+ const errors = [];
403
+ const json = sanitizeJson(extractCodeBlock(result, 'json'));
404
+ try {
405
+ const parsed = JSON.parse(json);
406
+ if (typeof parsed !== 'object' || Array.isArray(parsed)) {
407
+ errors.push('Memory structure must be a JSON object with key-value pairs');
408
+ } else if (Object.keys(parsed).length === 0) {
409
+ errors.push('Memory structure is empty');
410
+ }
411
+ return { valid: errors.length === 0, errors, extracted: json };
412
+ } catch (e) {
413
+ errors.push(`Invalid JSON: ${e.message}`);
414
+ return { valid: false, errors, extracted: json };
415
+ }
416
+ },
417
+
418
+ translation(result) {
419
+ const errors = [];
420
+ const json = sanitizeJson(extractCodeBlock(result, 'json'));
421
+ try {
422
+ const parsed = JSON.parse(json);
423
+ // Each translation component produces ONE locale (e.g., { "fi": { ... } } or { "en": { ... } })
424
+ const locales = Object.keys(parsed).filter(k => typeof parsed[k] === 'object' && parsed[k] !== null);
425
+ if (locales.length === 0) {
426
+ errors.push('No locale object found — expected e.g. { "fi": { ... } } or { "en": { ... } }');
427
+ } else if (locales.length > 1) {
428
+ errors.push(`Multiple locales found (${locales.join(', ')}) — each translation component should contain only ONE locale`);
429
+ } else {
430
+ // Validate the single locale has content
431
+ const locale = locales[0];
432
+ const keys = Object.keys(parsed[locale]);
433
+ if (keys.length === 0) {
434
+ errors.push(`Locale "${locale}" is empty — no translation keys found`);
435
+ }
436
+ }
437
+ // Anti-pattern scan
438
+ const ap = validateAntiPatterns('translation', json);
439
+ // translation anti-patterns are warnings only, don't block validation
440
+
441
+ return { valid: errors.length === 0, errors, extracted: json };
442
+ } catch (e) {
443
+ errors.push(`Invalid JSON: ${e.message}`);
444
+ return { valid: false, errors, extracted: json };
445
+ }
446
+ },
447
+
448
+ cortex(result, blueprint) {
449
+ const errors = [];
450
+
451
+ // ── Extract YAML and JS — supports two formats ──
452
+ // Format 1 (preferred): Single untagged code block with YAML first, then // lib/*.js separator
453
+ // Format 2 (legacy): Separate ```yaml and ```javascript blocks
454
+ let yamlBlock = null;
455
+ const jsBlocks = [];
456
+
457
+ // Try Format 1: single block with // lib/ separator
458
+ const untaggedMatch = result.match(/```\s*\n([\s\S]*?)```/);
459
+ if (untaggedMatch) {
460
+ const content = untaggedMatch[1];
461
+ const libSeparator = content.match(/^\/\/\s*lib\/\S+\.js\s*$/m);
462
+ if (libSeparator) {
463
+ const sepIndex = content.indexOf(libSeparator[0]);
464
+ yamlBlock = content.slice(0, sepIndex).trim();
465
+ jsBlocks.push(content.slice(sepIndex).trim());
466
+ }
467
+ }
468
+
469
+ // Try Format 2: separate ```yaml and ```javascript blocks
470
+ if (!yamlBlock) {
471
+ yamlBlock = extractCodeBlock(result, 'yaml');
472
+ if (yamlBlock) {
473
+ const jsRegex = /```(?:javascript|js)\s*\n([\s\S]*?)```/gi;
474
+ let match;
475
+ const afterYaml = result.indexOf('```yaml') > -1
476
+ ? result.slice(result.indexOf('```', result.indexOf('```yaml') + 7) + 3)
477
+ : result;
478
+ while ((match = jsRegex.exec(afterYaml)) !== null) {
479
+ jsBlocks.push(match[1].trim());
480
+ }
481
+ }
482
+ }
483
+
484
+ if (!yamlBlock) {
485
+ errors.push('No YAML manifest found — cortex must include a manifest (either in a single code block with // lib/ separator, or in a ```yaml block)');
486
+ return { valid: false, errors, extracted: null };
487
+ }
488
+
489
+ const { parsed, errors: yamlErrors } = tryParseYaml(yamlBlock);
490
+ if (yamlErrors.length > 0) return { valid: false, errors: yamlErrors, extracted: null };
491
+
492
+ if (parsed.apiVersion !== 'cortex.aimeat.org/v1') {
493
+ errors.push('apiVersion must be "cortex.aimeat.org/v1"');
494
+ }
495
+ if (parsed.kind !== 'Extension') errors.push('kind must be "Extension"');
496
+ if (!parsed.metadata?.name) errors.push('metadata.name is required');
497
+ else if (/\./.test(parsed.metadata.name)) errors.push('metadata.name must not contain dots (.)');
498
+ else if (!/^[a-z][a-z0-9-]*$/.test(parsed.metadata.name)) errors.push('metadata.name must be lowercase kebab-case (e.g., "my-domain-lib")');
499
+ if (!parsed.spec?.components || !Array.isArray(parsed.spec.components)) {
500
+ errors.push('spec.components array is required');
501
+ }
502
+
503
+ const libComponents = (parsed.spec?.components || []).filter(c => c.type === 'lib');
504
+ if (libComponents.length > 0 && jsBlocks.length === 0) {
505
+ errors.push(`Manifest declares ${libComponents.length} lib component(s) but no JavaScript code blocks found`);
506
+ }
507
+
508
+ // ── Cross-check: YAML metadata.name ↔ JS LIB_NAME consistency ──
509
+ if (parsed.metadata?.name && jsBlocks.length > 0) {
510
+ const yamlName = parsed.metadata.name; // kebab-case e.g. "halytyskartta-cortex"
511
+ const expectedCamel = yamlName.replace(/-([a-z0-9])/g, (_, c) => c.toUpperCase()); // → "halytyskarttaCortex"
512
+ const jsCode = jsBlocks.join('\n');
513
+
514
+ // Check LIB_NAME matches expected camelCase
515
+ const libNameMatch = jsCode.match(/(?:const|let|var)\s+LIB_NAME\s*=\s*['"]([^'"]+)['"]/);
516
+ if (libNameMatch) {
517
+ const actualLibName = libNameMatch[1];
518
+ if (actualLibName !== expectedCamel) {
519
+ errors.push(`LIB_NAME mismatch: JS has "${actualLibName}" but YAML name "${yamlName}" expects "${expectedCamel}"`);
520
+ }
521
+ } else {
522
+ errors.push('No LIB_NAME constant found in JS code — cortex must declare const LIB_NAME = \'...\';');
523
+ }
524
+
525
+ // Check AIMEAT.register uses correct name
526
+ const registerMatch = jsCode.match(/AIMEAT\.register\s*\(\s*LIB_NAME/);
527
+ if (!registerMatch) {
528
+ const hardcodedRegister = jsCode.match(/AIMEAT\.register\s*\(\s*['"]([^'"]+)['"]/);
529
+ if (hardcodedRegister && hardcodedRegister[1] !== expectedCamel) {
530
+ errors.push(`AIMEAT.register uses "${hardcodedRegister[1]}" but expected "${expectedCamel}"`);
531
+ }
532
+ }
533
+
534
+ // Check IIFE pattern exists
535
+ if (!/\(function\s*\(\s*AIMEAT\s*\)/.test(jsCode)) {
536
+ errors.push('Cortex JS must use IIFE pattern: (function (AIMEAT) { ... })(window.AIMEAT || ...)');
537
+ }
538
+
539
+ // Check exports object includes all required methods from blueprint
540
+ // Accept "exports", "exportsObj", etc. — also handle multiline object literals
541
+ const exportsMatch = jsCode.match(/(?:const|let|var)\s+\w*[Ee]xport\w*\s*=\s*\{([\s\S]*?)\}/);
542
+ if (exportsMatch) {
543
+ const exportedMethods = exportsMatch[1].split(',').map(m => m.trim().split(':')[0].trim()).filter(Boolean);
544
+
545
+ // Cross-check with blueprint produces API methods if available
546
+ // Match the specific cortex component by metadata.name or subtype
547
+ if (blueprint?.components && parsed?.metadata?.name) {
548
+ const metaName = parsed.metadata.name;
549
+ // Find the blueprint component that matches this cortex by name similarity
550
+ const cortexComps = blueprint.components.filter(c => c.type === 'cortex');
551
+ const cortexComp = cortexComps.find(c =>
552
+ c.id === metaName || c.label?.toLowerCase().includes(metaName.replace(/-/g, ' ')) ||
553
+ metaName.includes(c.id?.replace('cortex-', ''))
554
+ ) || (cortexComps.length === 1 ? cortexComps[0] : null);
555
+ if (cortexComp?.produces) {
556
+ const requiredMethods = cortexComp.produces
557
+ .filter(p => p.startsWith('api:'))
558
+ .map(p => p.replace('api:', ''));
559
+ for (const method of requiredMethods) {
560
+ if (!exportedMethods.includes(method)) {
561
+ errors.push(`Blueprint requires method "${method}" but it's not in the exports object. Found: ${exportedMethods.join(', ')}`);
562
+ }
563
+ }
564
+ }
565
+ }
566
+ } else {
567
+ errors.push('No exports object found — cortex must have: const exports = { method1, method2, ... };');
568
+ }
569
+ }
570
+
571
+ if (errors.length > 0) return { valid: false, errors, extracted: null };
572
+
573
+ return {
574
+ valid: true,
575
+ errors: [],
576
+ extracted: {
577
+ manifest: stringifyYaml(parsed),
578
+ libs: libComponents.map((lib, i) => ({
579
+ filename: lib.filename || `${lib.name}.js`,
580
+ code: jsBlocks[i] || '',
581
+ })),
582
+ },
583
+ };
584
+ },
585
+ };
586
+
587
+ /* ── Interview Spec Validator ────────────────────────── */
588
+
589
+ /**
590
+ * Validate and extract an interview specification JSON from AI output.
591
+ * Expects a JSON code block with required fields.
592
+ */
593
+ export function validateInterviewSpec(result) {
594
+ const errors = [];
595
+ const warnings = [];
596
+
597
+ try {
598
+ const raw = extractCodeBlock(result, 'json');
599
+ const cleaned = sanitizeJson(raw);
600
+ const spec = JSON.parse(cleaned);
601
+
602
+ if (!spec.version) errors.push('Missing "version" field');
603
+ if (!spec.projectName) errors.push('Missing "projectName" field');
604
+ if (!spec.description) errors.push('Missing "description" field');
605
+ if (!Array.isArray(spec.useCases) || spec.useCases.length === 0) {
606
+ errors.push('Missing or empty "useCases" array');
607
+ }
608
+ if (!Array.isArray(spec.dataSources)) errors.push('Missing "dataSources" array');
609
+ if (!spec.dataModel) errors.push('Missing "dataModel" object');
610
+ if (!Array.isArray(spec.views) || spec.views.length === 0) {
611
+ errors.push('Missing or empty "views" array');
612
+ }
613
+
614
+ if (Array.isArray(spec.useCases)) {
615
+ spec.useCases.forEach((uc, i) => {
616
+ if (!uc.id) errors.push(`useCases[${i}] missing "id"`);
617
+ if (!uc.title) errors.push(`useCases[${i}] missing "title"`);
618
+ });
619
+ }
620
+
621
+ if (Array.isArray(spec.dataSources)) {
622
+ spec.dataSources.forEach((ds, i) => {
623
+ if (!ds.name) errors.push(`dataSources[${i}] missing "name"`);
624
+ if (!ds.type) errors.push(`dataSources[${i}] missing "type"`);
625
+ if (ds.url && !ds.verified) {
626
+ warnings.push(`dataSources[${i}] "${ds.name}" URL not verified — may need manual validation`);
627
+ }
628
+ });
629
+ }
630
+
631
+ if (Array.isArray(spec.views)) {
632
+ spec.views.forEach((v, i) => {
633
+ if (!v.type) errors.push(`views[${i}] missing "type"`);
634
+ if (!v.title) errors.push(`views[${i}] missing "title"`);
635
+ });
636
+ }
637
+
638
+ // Validate optional externalServices
639
+ if (spec.externalServices !== undefined) {
640
+ if (!Array.isArray(spec.externalServices)) {
641
+ errors.push('externalServices must be an array');
642
+ } else {
643
+ for (const svc of spec.externalServices) {
644
+ if (!svc.name || typeof svc.name !== 'string') errors.push('externalServices[].name required');
645
+ if (!Array.isArray(svc.requiredSettings)) errors.push(`externalServices[${svc.name}].requiredSettings must be array`);
646
+ if (!['shared', 'per-user'].includes(svc.sharingModel)) errors.push(`externalServices[${svc.name}].sharingModel invalid`);
647
+ }
648
+ }
649
+ }
650
+
651
+ // Validate optional userSettings
652
+ if (spec.userSettings !== undefined) {
653
+ if (!Array.isArray(spec.userSettings)) {
654
+ errors.push('userSettings must be an array');
655
+ }
656
+ }
657
+
658
+ if (errors.length > 0) return { valid: false, errors, warnings };
659
+ return { valid: true, errors: [], warnings, parsed: spec };
660
+ } catch (e) {
661
+ return { valid: false, errors: [`Failed to parse interview spec: ${e.message}`], warnings: [] };
662
+ }
663
+ }
664
+
665
+ /* ── Spec Quality Gate ──────────────────────────────── */
666
+
667
+ /**
668
+ * Check interview spec quality before proceeding to blueprint.
669
+ * No AI needed — just automated checks on the spec data.
670
+ */
671
+ export function validateSpecQuality(spec) {
672
+ const warnings = [];
673
+ const errors = [];
674
+
675
+ if (!spec) { errors.push('No specification provided'); return { valid: false, errors, warnings }; }
676
+
677
+ // Use cases
678
+ if (!Array.isArray(spec.useCases) || spec.useCases.length < 2) {
679
+ warnings.push('Less than 2 use cases defined — consider adding more to get a useful application');
680
+ }
681
+
682
+ // Data sources
683
+ if (Array.isArray(spec.dataSources)) {
684
+ for (const ds of spec.dataSources) {
685
+ if (!ds.url && ds.type !== 'user-input') {
686
+ warnings.push(`Data source "${ds.name || ds.id}" has no URL`);
687
+ }
688
+ if (!ds.sampleEntry && ds.type !== 'user-input' && ds.fallback !== 'defer') {
689
+ warnings.push(`Data source "${ds.name || ds.id}" has no sampleEntry — structures will be guessed, not verified`);
690
+ }
691
+ if (ds.verified === false && !ds.fallback) {
692
+ errors.push(`Data source "${ds.name || ds.id}" is unverified and has no fallback strategy`);
693
+ }
694
+ }
695
+ }
696
+
697
+ // Views
698
+ if (!Array.isArray(spec.views) || spec.views.length === 0) {
699
+ warnings.push('No views defined — the blueprint will guess the UI layout');
700
+ }
701
+
702
+ // Locale
703
+ if (!spec.locale) {
704
+ warnings.push('No locale set — defaulting to English');
705
+ }
706
+
707
+ // Style
708
+ if (!spec.style) {
709
+ warnings.push('No style preferences — the app will use default layout');
710
+ }
711
+
712
+ return { valid: errors.length === 0, errors, warnings };
713
+ }
714
+
715
+ /* ── Blueprint Validator ─────────────────────────────── */
716
+
717
+ export function validateBlueprint(result) {
718
+ const errors = [];
719
+ const warnings = [];
720
+ const raw = extractCodeBlock(result, 'json') || result;
721
+ const json = sanitizeJson(raw);
722
+ try {
723
+ const parsed = JSON.parse(json);
724
+ // service_slug is REQUIRED — it namespaces all memory keys, translations, and cortex naming
725
+ if (!parsed.service_slug || typeof parsed.service_slug !== 'string') {
726
+ errors.push('Missing "service_slug" field — required for memory key namespacing. Must be a kebab-case string (e.g., "company-registry").');
727
+ } else if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(parsed.service_slug)) {
728
+ errors.push(`Invalid "service_slug": "${parsed.service_slug}" — must be kebab-case (lowercase letters, numbers, hyphens only)`);
729
+ }
730
+
731
+ if (!Array.isArray(parsed.components)) errors.push('Missing "components" array');
732
+ else {
733
+ const allowedComponentKeys = new Set(['id', 'type', 'subtype', 'label', 'produces', 'consumes', 'schedules', 'uses', 'role']);
734
+ parsed.components = parsed.components.map(c => {
735
+ if (!c.id) errors.push(`Component missing "id" field`);
736
+ if (!c.type) errors.push(`Component "${c.id || '?'}" missing "type" field`);
737
+ if (!c.label) errors.push(`Component "${c.id || '?'}" missing "label" field`);
738
+ // Auto-fix common AI shorthand: "ext" → "extension"
739
+ if (c.type === 'ext') {
740
+ c.type = 'extension';
741
+ warnings.push(`Component "${c.id}": auto-corrected type "ext" → "extension"`);
742
+ }
743
+ if (c.type && !['csm', 'msm', 'extension', 'app', 'memory', 'translation', 'cortex'].includes(c.type)) {
744
+ errors.push(`Component "${c.id}" has unknown type "${c.type}"`);
745
+ }
746
+ // Validate produces/consumes are arrays of strings (if present)
747
+ if (c.produces && !Array.isArray(c.produces)) {
748
+ warnings.push(`Component "${c.id || '?'}": "produces" should be an array`);
749
+ }
750
+ if (c.consumes && !Array.isArray(c.consumes)) {
751
+ warnings.push(`Component "${c.id || '?'}": "consumes" should be an array`);
752
+ }
753
+ // Strip extra fields (manifest, code, files, etc.) — blueprint is lightweight
754
+ const extraKeys = Object.keys(c).filter(k => !allowedComponentKeys.has(k));
755
+ if (extraKeys.length > 0) {
756
+ warnings.push(`Component "${c.id || '?'}" had extra fields stripped: ${extraKeys.join(', ')}`);
757
+ }
758
+ const clean = { id: c.id, type: c.type, label: c.label };
759
+ if (typeof c.subtype === 'string' && c.type === 'cortex') clean.subtype = c.subtype;
760
+ if (typeof c.role === 'string') clean.role = c.role;
761
+ if (Array.isArray(c.produces)) clean.produces = c.produces;
762
+ if (Array.isArray(c.consumes)) clean.consumes = c.consumes;
763
+ if (Array.isArray(c.schedules) && c.type === 'extension') {
764
+ // Validate and auto-fix each schedule entry
765
+ for (const s of c.schedules) {
766
+ if (!s.action) errors.push(`Component "${c.id}": schedule missing "action" field`);
767
+ if (!s.cron) errors.push(`Component "${c.id}": schedule missing "cron" field`);
768
+ else if (s.cron !== '@activate') {
769
+ // Auto-fix: strip markdown backslash escaping (\* → *)
770
+ let cron = String(s.cron).trim().replace(/\\\*/g, '*');
771
+ if (cron !== String(s.cron).trim()) {
772
+ warnings.push(`Component "${c.id}": stripped backslash escaping from cron`);
773
+ s.cron = cron;
774
+ }
775
+ // Auto-fix: "/15" → "*/15" (AI commonly drops leading asterisk)
776
+ if (/^\/\d/.test(cron)) {
777
+ const fixed = '*' + cron;
778
+ warnings.push(`Component "${c.id}": auto-corrected cron "${cron}" → "${fixed}"`);
779
+ cron = fixed;
780
+ s.cron = fixed;
781
+ }
782
+ // Auto-fix: pad to 5 fields with * if fields are missing
783
+ const fields = cron.split(/\s+/);
784
+ if (fields.length < 5 && fields.length >= 3) {
785
+ while (fields.length < 5) fields.push('*');
786
+ const fixed = fields.join(' ');
787
+ warnings.push(`Component "${c.id}": auto-padded cron to 5 fields: "${fixed}"`);
788
+ s.cron = fixed;
789
+ } else if (fields.length !== 5) {
790
+ errors.push(`Component "${c.id}": cron "${s.cron}" must have exactly 5 fields (got ${fields.length}). Example: "*/15 * * * *"`);
791
+ }
792
+ }
793
+ }
794
+ clean.schedules = c.schedules;
795
+ }
796
+ if (Array.isArray(c.uses) && c.type === 'cortex') clean.uses = c.uses;
797
+ return clean;
798
+ });
799
+ }
800
+ // Cross-validate produces/consumes: warn if a consumed key has no producer
801
+ if (parsed.components) {
802
+ const allProduced = new Set(parsed.components.flatMap(c => c.produces || []));
803
+ for (const c of parsed.components) {
804
+ for (const consumed of (c.consumes || [])) {
805
+ if (!allProduced.has(consumed)) {
806
+ warnings.push(`Component "${c.id}" consumes "${consumed}" but no component produces it`);
807
+ }
808
+ }
809
+ }
810
+ }
811
+
812
+ if (!Array.isArray(parsed.phases)) errors.push('Missing "phases" array');
813
+ else {
814
+ parsed.phases = parsed.phases.map(p => {
815
+ if (!p.id) errors.push(`Phase missing "id"`);
816
+ if (!p.label) errors.push(`Phase "${p.id || '?'}" missing "label"`);
817
+ if (!Array.isArray(p.componentIds)) errors.push(`Phase "${p.id || '?'}" missing "componentIds" array`);
818
+ return { id: p.id, label: p.label, componentIds: p.componentIds };
819
+ });
820
+ }
821
+
822
+ // Validate dataModel if present — supports both old flat format and new structures/$ref format
823
+ if (parsed.dataModel && typeof parsed.dataModel === 'object') {
824
+ const componentIds = new Set((parsed.components || []).map(c => c.id));
825
+ const dm = parsed.dataModel;
826
+
827
+ // New format: has structures + memoryKeys + actions
828
+ if (dm.structures && typeof dm.structures === 'object') {
829
+ // Validate structures
830
+ for (const [name, struct] of Object.entries(dm.structures)) {
831
+ if (!struct.type) warnings.push(`structure "${name}" missing "type"`);
832
+ }
833
+ // Validate $ref references in memoryKeys
834
+ if (dm.memoryKeys && typeof dm.memoryKeys === 'object') {
835
+ for (const [key, schema] of Object.entries(dm.memoryKeys)) {
836
+ if (schema.$ref && !dm.structures[schema.$ref]) {
837
+ errors.push(`memoryKey "${key}" references unknown structure "${schema.$ref}"`);
838
+ }
839
+ if (schema.items?.$ref && !dm.structures[schema.items.$ref]) {
840
+ errors.push(`memoryKey "${key}" items references unknown structure "${schema.items.$ref}"`);
841
+ }
842
+ if (schema.producedBy && !componentIds.has(schema.producedBy)) {
843
+ errors.push(`memoryKey "${key}" producedBy "${schema.producedBy}" does not match any component`);
844
+ }
845
+ }
846
+ }
847
+ // Validate $ref references in actions
848
+ if (dm.actions && typeof dm.actions === 'object') {
849
+ for (const [name, action] of Object.entries(dm.actions)) {
850
+ if (action.output?.$ref && !dm.structures[action.output.$ref]) {
851
+ errors.push(`action "${name}" output references unknown structure "${action.output.$ref}"`);
852
+ }
853
+ }
854
+ }
855
+ } else {
856
+ // Old flat format — backward compatible
857
+ for (const [key, schema] of Object.entries(dm)) {
858
+ if (key === 'structures' || key === 'memoryKeys' || key === 'actions') continue;
859
+ if (!schema.type) warnings.push(`dataModel "${key}" missing "type"`);
860
+ if (!schema.source) warnings.push(`dataModel "${key}" missing "source"`);
861
+ if (!schema.producedBy) {
862
+ errors.push(`dataModel "${key}" missing "producedBy"`);
863
+ } else if (!componentIds.has(schema.producedBy)) {
864
+ errors.push(`dataModel "${key}" producedBy "${schema.producedBy}" does not match any component`);
865
+ }
866
+ if (!Array.isArray(schema.consumedBy) || schema.consumedBy.length === 0) {
867
+ warnings.push(`dataModel "${key}" has no consumers`);
868
+ } else {
869
+ for (const cid of schema.consumedBy) {
870
+ if (!componentIds.has(cid)) {
871
+ errors.push(`dataModel "${key}" consumedBy "${cid}" does not match any component`);
872
+ }
873
+ }
874
+ }
875
+ }
876
+ } // end old flat format else
877
+ } else {
878
+ warnings.push('Missing "dataModel" — downstream components will not have schema guidance');
879
+ }
880
+
881
+ // Validate optional settings
882
+ if (parsed.settings) {
883
+ const s = parsed.settings;
884
+ if (s.service && !Array.isArray(s.service)) errors.push('settings.service must be an array');
885
+ if (s.user && !Array.isArray(s.user)) errors.push('settings.user must be an array');
886
+ if (Array.isArray(s.service)) {
887
+ for (const entry of s.service) {
888
+ if (!entry.key || !entry.type || !entry.label) {
889
+ errors.push('settings.service entry missing key/type/label');
890
+ }
891
+ if (entry.type && !['secret', 'url', 'string', 'number', 'boolean'].includes(entry.type)) {
892
+ warnings.push(`settings.service[${entry.key}] has unknown type: ${entry.type}`);
893
+ }
894
+ }
895
+ }
896
+ }
897
+
898
+ // Preserve new top-level blueprint fields
899
+ if (parsed.settings) parsed.settings = parsed.settings;
900
+ if (parsed.testScenarios) parsed.testScenarios = parsed.testScenarios;
901
+ if (parsed.architecture) parsed.architecture = parsed.architecture;
902
+
903
+ return { valid: errors.length === 0, errors, warnings, parsed, extracted: json };
904
+ } catch (e) {
905
+ errors.push(`Invalid JSON: ${e.message}`);
906
+ return { valid: false, errors, warnings, parsed: null, extracted: json };
907
+ }
908
+ }
909
+
910
+ /* ── Main Validate Function ──────────────────────────── */
911
+
912
+ export function validateComponent(type, result, blueprint = null) {
913
+ const validator = validators[type];
914
+ if (!validator) return { valid: false, errors: [`No validator for type: ${type}`], extracted: result };
915
+ return validator(result, blueprint);
916
+ }