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,2694 @@
1
+ /**
2
+ * @file generator-prompt-seeds.ts
3
+ * @description Generator prompt seeds — EXACT content from the original browser JS files.
4
+ * These templates are the SAME text that produced working output in V7/V8 pipeline tests.
5
+ * DO NOT summarize, rewrite, or "improve" these. They are calibrated.
6
+ * Variables use {{name}} syntax, resolved by resolvers.ts at runtime.
7
+ * @version-history
8
+ * v1.0.0 — 2026-04-01 — Initial seeds (summaries — BROKEN)
9
+ * v2.0.0 — 2026-04-01 — Replaced with EXACT original content from generator-prompts-base.js
10
+ */
11
+ export const GENERATOR_PROMPT_SEEDS = [
12
+ // ═══════════════════════════════════════════════════════════════════
13
+ // Shared Fragments — EXACT text from generator-prompts-base.js
14
+ // ═══════════════════════════════════════════════════════════════════
15
+ {
16
+ id: 'gen-context',
17
+ group: 'generator',
18
+ name: 'AIMEAT Context',
19
+ description: 'Shared preamble — building blocks, extension sandbox API, data standards. Injected into all prompts via {{context}}.',
20
+ content: `You are helping create an AIMEAT service. AIMEAT is an AI agent infrastructure protocol.
21
+
22
+ Available building blocks:
23
+ - CSM (Community Service Manifest): YAML defining data schemas, fields, consent rules, validation.
24
+ - MSM (Micro Service Manifest): YAML defining external API integrations, auth, endpoints.
25
+ - Extension: V8-sandboxed JavaScript logic with YAML manifest. Actions get ctx object with memory, wallet, consent, trust, fetch APIs.
26
+ - App: HTML/JS user interface published to the apps catalog.
27
+ - Memory: Key-value storage with namespace isolation.
28
+ - Translation: Per-locale i18n strings.
29
+ - Cortex: Client-side JS domain library (IIFE on AIMEAT namespace). Wraps extension APIs and memory reads into clean domain methods for apps.
30
+
31
+ Extensions run in an ISOLATED WASM sandbox with ONLY this API (no Node.js, no global fetch, no setTimeout, no require, no import):
32
+ ctx.memory.get(key) → value or null (ALWAYS null-check before using: \`|| []\` or \`|| {}\`)
33
+ ctx.memory.set(key, value) → void
34
+ ctx.memory.search(prefix) → Array<{ key, value }> (NOT plain strings!)
35
+ ctx.memory.delete(key) → boolean
36
+ ctx.memory.getPublic(namespace, key) → value or null (read data from a DIFFERENT namespace)
37
+ Use this to read: (a) another extension's public data, (b) the OWNER's shared data (memory components, translations, settings).
38
+ Example — read another extension's data: await ctx.memory.getPublic('ext:other-ext', 'some.key')
39
+ Example — read owner's shared data: await ctx.memory.getPublic(ctx.caller.gaii, 'lookup.data')
40
+ ╔═══════════════════════════════════════════════════════════════════════════════╗
41
+ ║ IMPORTANT: ctx.memory.get() ONLY reads from the extension's OWN namespace. ║
42
+ ║ Data stored by memory components (seed data, settings, translations) lives ║
43
+ ║ in the OWNER's namespace — use ctx.memory.getPublic(ctx.caller.gaii, key) ║
44
+ ║ to access it. ctx.caller.gaii is the caller's GHII identity ║
45
+ ║ (e.g. "testuser@node-id"). ║
46
+ ╚═══════════════════════════════════════════════════════════════════════════════╝
47
+ ctx.fetch(url, { method, headers, body }) → { status, ok, text, headers }
48
+ Use ctx.fetch for ALL HTTP requests. Global fetch() is NOT available.
49
+ Response body is always .text (string) — parse JSON with JSON.parse(resp.text).
50
+ Encoding is handled automatically — the runtime detects charset from: (1) Content-Type header,
51
+ (2) XML prolog encoding attribute, (3) HTML meta charset tag. Falls back to UTF-8.
52
+ You always get correct Unicode text — no manual decoding needed, even for ISO-8859-1 feeds.
53
+ ctx.wallet.consume(amount, reason), ctx.wallet.getBalance()
54
+ ctx.consent.check(gaii, scope), ctx.consent.require(gaii, scope)
55
+ ctx.trust.getScore(gaii)
56
+ ctx.caller = { gaii, owner, roles }
57
+ ctx.config = extension config object (from manifest config section)
58
+ ctx.instance = { id, config } (when called via instance endpoint)
59
+ ctx.log.info/warn/error(msg, data)
60
+
61
+ AIMEAT Data Standards (MUST follow in ALL components):
62
+ Dates/times: ISO 8601 ONLY — "2026-03-14T13:00:00.000Z". NEVER store RFC 2822 ("Sat, 14 Mar ..."), Unix timestamps, or locale-formatted dates. Convert all dates to ISO before storing.
63
+ Memory keys: lowercase dot-namespaced — "items.by-date.2026-03-14". Dates in keys MUST use YYYY-MM-DD.
64
+ Resource IDs: URL-safe strings (kebab-case or hex hashes). No spaces, no special characters.
65
+ Action IDs: camelCase — "getItems", "addToWatchlist", "checkChanges". NEVER kebab-case for actions.
66
+ Locale codes: BCP 47 — "fi", "en", "fi-FI", "en-US".
67
+ Coordinates: { latitude: number, longitude: number } — WGS84 decimal degrees.
68
+ Currency/amounts: integers (no floats) — morsels are whole numbers.`,
69
+ variables: [],
70
+ usedIn: ['generator-autopilot', 'generator-ui'],
71
+ },
72
+ {
73
+ id: 'gen-disclaimer',
74
+ group: 'generator',
75
+ name: 'Instruction Disclaimer',
76
+ description: 'Prefix for all generator prompts — instructs the AI to follow rules exactly.',
77
+ content: `IMPORTANT: These are detailed instructions that you MUST read carefully and follow exactly. Every rule, constraint, format requirement, and example below exists for a reason. Do NOT skip sections, do NOT invent your own conventions, and do NOT deviate from the specified output format. If a rule says "MUST" or "NEVER", treat it as absolute.`,
78
+ variables: [],
79
+ usedIn: ['generator-autopilot', 'generator-ui'],
80
+ },
81
+ {
82
+ id: 'gen-sandbox-constraints',
83
+ group: 'generator',
84
+ name: 'Sandbox Constraints',
85
+ description: 'EXACT sandbox rules from generator-prompts-base.js SANDBOX_CONSTRAINTS constant.',
86
+ content: `## Sandbox Environment
87
+
88
+ ╔══════════════════════════════════════════════════════════════════════════╗
89
+ ║ This is a BARE QuickJS engine — NOT Node.js, NOT a browser. ║
90
+ ║ Only ECMAScript built-in objects and the ctx API exist. ║
91
+ ║ The ONLY way to interact with the outside world is through ctx. ║
92
+ ╚══════════════════════════════════════════════════════════════════════════╝
93
+
94
+ ### What IS available (ECMAScript built-ins):
95
+ JSON, Math, Date, RegExp, Promise, async/await, String, Array, Object,
96
+ Map, Set, WeakMap, WeakSet, Symbol, Proxy, Reflect,
97
+ encodeURIComponent, decodeURIComponent, parseInt, parseFloat, isNaN, isFinite
98
+
99
+ ### What is NOT available:
100
+
101
+ **Node.js APIs** — no require, no import, no Buffer, no process, no fs, no path, no crypto
102
+ **Web APIs** — no URLSearchParams, no URL, no TextEncoder, no TextDecoder,
103
+ no Headers, no Request, no Response, no FormData, no Blob, no File,
104
+ no AbortController, no atob, no btoa, no structuredClone, no crypto (Web Crypto),
105
+ no queueMicrotask, no performance
106
+ **Browser APIs** — no document, no window, no fetch (use ctx.fetch), no navigator
107
+ **Timers** — no setTimeout, no setInterval, no setImmediate
108
+ **Console** — no console.log (use ctx.log.info/warn/error)
109
+ **Modules** — no require(), no import (except export default for action entry point)
110
+
111
+ ### URL construction (URLSearchParams is NOT available):
112
+ \`\`\`
113
+ WRONG: const params = new URLSearchParams(); params.set('name', query);
114
+ WRONG: const url = new URL(baseUrl); url.searchParams.set('name', query);
115
+ RIGHT: const url = baseUrl + '?name=' + encodeURIComponent(query);
116
+ RIGHT: const url = baseUrl + '?name=' + encodeURIComponent(query) + '&id=' + encodeURIComponent(id);
117
+ \`\`\`
118
+
119
+ ### The ctx API — ONLY these properties exist:
120
+
121
+ ╔══════════════════════════════════════════════════════════════════════════╗
122
+ ║ ctx.memory (get/set/search/delete/getPublic) ║
123
+ ║ ctx.fetch(url, opts) → { ok, status, text, headers } ║
124
+ ║ ctx.wallet (consume/getBalance) ║
125
+ ║ ctx.consent (check/require) ║
126
+ ║ ctx.trust (getScore) ║
127
+ ║ ctx.caller (gaii/owner/roles) ║
128
+ ║ ctx.config (extension config object) ║
129
+ ║ ctx.log (info/warn/error) ║
130
+ ║ ctx.notify(message, {title?, priority?, channel?}) → boolean ║
131
+ ║ ctx.email(to, subject, body) → boolean (requires SMTP configured) ║
132
+ ║ ctx.instance (id/config — only for instance-scoped actions) ║
133
+ ║ NOTHING ELSE. Do NOT invent methods that are not listed here. ║
134
+ ╚══════════════════════════════════════════════════════════════════════════╝
135
+
136
+ ### Actions are INDEPENDENT — CANNOT call each other
137
+
138
+ ╔══════════════════════════════════════════════════════════════════════════╗
139
+ ║ Each action is a SEPARATE function. Actions CANNOT call each other. ║
140
+ ║ There is NO ctx.otherAction() or ctx.callAction() method. ║
141
+ ║ Writing ctx.getData() or ctx.otherAction() will CRASH with: ║
142
+ ║ "ctx.getData is not a function" ║
143
+ ║ ║
144
+ ║ If multiple actions need the same logic, define a HELPER FUNCTION ║
145
+ ║ above the action exports and duplicate it in each script file. ║
146
+ ╚══════════════════════════════════════════════════════════════════════════╝
147
+
148
+ ### ctx.memory.get — returns PARSED value, NOT string
149
+
150
+ ╔══════════════════════════════════════════════════════════════════════════╗
151
+ ║ NEVER WRITE: JSON.parse(await ctx.memory.get(...)) ║
152
+ ║ The value is ALREADY PARSED. JSON.parse on it will CRASH. ║
153
+ ║ CORRECT: const data = await ctx.memory.get("key") || []; ║
154
+ ╚══════════════════════════════════════════════════════════════════════════╝
155
+
156
+ ### ctx.fetch — returns { ok, status, text, headers }
157
+ - text is a RAW string — parse JSON with JSON.parse(resp.text)
158
+ - Encoding auto-detected (Content-Type, XML prolog, HTML meta)
159
+ - You always get Unicode text — no manual decoding needed`,
160
+ variables: [],
161
+ usedIn: ['generator-autopilot'],
162
+ },
163
+ {
164
+ id: 'gen-namespace-rules',
165
+ group: 'generator',
166
+ name: 'Namespace Rules',
167
+ description: 'EXACT namespace rules from generator-prompts-base.js NAMESPACE_RULES constant.',
168
+ content: `## AIMEAT Namespace Rules
169
+
170
+ AIMEAT has TWO types of memory namespaces — understanding this is CRITICAL:
171
+
172
+ 1. **Owner namespace** — where the human user's data lives
173
+ - Memory components (seed data, lookup tables) store here
174
+ - Translation components store here (i18n.fi, i18n.en)
175
+ - Settings components store here (settings.config)
176
+ - Accessible via: ctx.memory.getPublic(ctx.caller.gaii, key) [from extension]
177
+ - Accessible via: /v1/memory/{key} [from HTTP with owner's JWT]
178
+
179
+ 2. **Extension namespace** (\`ext:{name}\`) — where extension runtime data lives
180
+ - Extension writes here via ctx.memory.set(key, value)
181
+ - Accessible to ALL users via: ctx.memory.getPublic('ext:{name}', key)
182
+ - Accessible via: readExtMemory(name, key) [from cortex/app]
183
+ - NOT accessible via /v1/memory/{key} (that reads owner namespace!)
184
+
185
+ ╔══════════════════════════════════════════════════════════════════════════╗
186
+ ║ Extension ctx.memory.get(key) ONLY reads from ext:{name} namespace. ║
187
+ ║ Seed data (memory components), settings, translations live in the ║
188
+ ║ OWNER's namespace — use ctx.memory.getPublic(ctx.caller.gaii, key). ║
189
+ ║ ║
190
+ ║ From OUTSIDE (cortex, app, tests): ║
191
+ ║ - Read extension data: getPublic('ext:{name}', key) or readExtMemory ║
192
+ ║ - Read owner data: /v1/memory/{key} or AIMEAT.data.get(key) ║
193
+ ║ - Write extension data: call an extension ACTION (callExt) ║
194
+ ║ - You CANNOT PUT to ext:{name} namespace from client — returns 404 ║
195
+ ╚══════════════════════════════════════════════════════════════════════════╝
196
+
197
+ ### Init Action
198
+ Extensions should initialize runtime data (empty watchlists, caches, logs) in their @activate init action.
199
+ Do NOT copy translations or settings — cortex reads those from the owner namespace directly.`,
200
+ variables: [],
201
+ usedIn: ['generator-autopilot'],
202
+ },
203
+ {
204
+ id: 'gen-html-entity-rules',
205
+ group: 'generator',
206
+ name: 'HTML Entity Rules',
207
+ description: 'EXACT HTML entity rules from generator-prompts-base.js HTML_ENTITY_RULES constant.',
208
+ content: `## No HTML Entities in Code
209
+
210
+ ╔════════════════════════════════════════════════════════════════════╗
211
+ ║ Your code MUST use real operators, NOT HTML entities. ║
212
+ ║ The sandbox executes raw JS — HTML entities are syntax errors. ║
213
+ ╚════════════════════════════════════════════════════════════════════╝
214
+
215
+ WRONG (crashes): const gt = a =&gt; a &gt; 0 &amp;&amp; b;
216
+ CORRECT: const gt = a => a > 0 && b;
217
+
218
+ Check your ENTIRE output. If you see &gt; &lt; &amp; &quot; &#39; anywhere
219
+ in code, replace them with > < & " ' respectively.`,
220
+ variables: [],
221
+ usedIn: ['generator-autopilot'],
222
+ },
223
+ {
224
+ id: 'gen-extension-consumption-rules',
225
+ group: 'generator',
226
+ name: 'Extension Consumption Rules',
227
+ description: 'EXACT extension consumption rules from generator-prompts-base.js EXTENSION_CONSUMPTION_RULES constant.',
228
+ content: `## How to Consume Extensions (callExt / readExtMemory pattern)
229
+
230
+ Extensions expose TWO interfaces to the outside world:
231
+
232
+ ### 1. Call actions via HTTP POST
233
+ POST /v1/ext/{extensionName}/{actionId}
234
+ Body: JSON input
235
+ Response: { ok: true, data: { ...action return value... } }
236
+
237
+ - ALL actions use POST (even if manifest says GET — the route is POST-only)
238
+ - The {actionId} is the action's "id" field from the YAML manifest
239
+ - r.body.ok is the AIMEAT envelope — ALWAYS true even when the action fails
240
+ - Check r.body.data for the ACTUAL result (success data OR error message)
241
+
242
+ ### 2. Read extension memory via getPublic
243
+ Extension data lives in ext:{name} namespace.
244
+ Read it: getPublic('ext:{name}', key) or readExtMemory(name, key)
245
+
246
+ NEVER read extension data via /v1/memory/{key} — that reads the OWNER's
247
+ namespace, not the extension's. You'll get null.
248
+
249
+ ### Testing extensions — use callExt and readExtMemory
250
+ The test sandbox provides callExt() and readExtMemory() — the SAME helpers
251
+ that cortex uses in production. Use these instead of raw testFetch:
252
+
253
+ callExt('ext-name', 'actionId', { input }) → action's return value (unwrapped)
254
+ readExtMemory('ext-name', 'key') → value from ext:{name} namespace
255
+
256
+ DO NOT use testFetch for extension actions — use callExt.
257
+ DO NOT use /v1/memory/ to read extension data — use readExtMemory.
258
+ DO NOT create custom getMemory/setMemory helpers.
259
+
260
+ ### Action types for testing
261
+ - [MEMORY] actions: use ONLY ctx.memory (no external API). Tests MUST assert specific return values.
262
+ - [EXTERNAL API] actions: call ctx.fetch to third-party URLs. Tests check response SHAPE only
263
+ (has data fields OR error message), because the external API may be down/rate-limited.
264
+ A single graceful error is OK (API may be rate-limited), but if ALL external API actions return errors, FAIL — the extension is broken.`,
265
+ variables: [],
266
+ usedIn: ['generator-autopilot'],
267
+ },
268
+ // ═══════════════════════════════════════════════════════════════════
269
+ // Component Templates — EXACT text from COMPONENT_TEMPLATES in generator-prompts-base.js
270
+ // The ${AIMEAT_CONTEXT} is replaced by {{context}}, ${label} by {{label}}, ${context} by {{component_context}}
271
+ // ═══════════════════════════════════════════════════════════════════
272
+ {
273
+ id: 'gen-csm',
274
+ group: 'generator',
275
+ name: 'CSM Generator',
276
+ description: 'EXACT CSM template from COMPONENT_TEMPLATES.csm in generator-prompts-base.js.',
277
+ content: `{{context}}
278
+
279
+ Create a CSM (Community Service Manifest) YAML for: {{label}}
280
+
281
+ {{component_context}}
282
+
283
+ ## YAML STRING RULES (read this FIRST — violations cause parse errors)
284
+
285
+ Every string value MUST be on ONE line wrapped in double quotes. No exceptions.
286
+ NEVER use > or | (block scalars). NEVER leave strings unquoted.
287
+
288
+ WRONG — will crash the parser:
289
+ description: > This is a multi-line folded string
290
+ description: This has (parens) and special: chars
291
+ description: |
292
+ This is a literal block
293
+
294
+ CORRECT — always do this:
295
+ description: "This has (parens) and special: chars all on one line"
296
+
297
+ ## Structure
298
+
299
+ Return ONLY valid YAML in a yaml code block. Copy this structure EXACTLY:
300
+ \`\`\`yaml
301
+ csm: "1.0"
302
+ service:
303
+ name: kebab-case-name
304
+ type: directory
305
+ description: "What this service does — keep on ONE line in double quotes"
306
+ version: "1.0"
307
+ schema_mode: open
308
+ data_schema:
309
+ required:
310
+ fieldName:
311
+ type: string
312
+ anotherField:
313
+ type: number
314
+ optional:
315
+ optionalField:
316
+ type: string
317
+ enum: [value1, value2]
318
+ consent_requirements:
319
+ visibility_default: public
320
+ requires_consent: false
321
+ consent_purpose: "Why consent is needed"
322
+ data_retention: "365_days"
323
+ moderation:
324
+ flags_enabled: true
325
+ auto_hide_threshold: 5
326
+ appeals_enabled: false
327
+ ui_hints:
328
+ list_view: [fieldName, anotherField]
329
+ detail_view: [fieldName, anotherField, optionalField]
330
+ search_fields: [fieldName]
331
+ \`\`\`
332
+
333
+ ## Additional rules
334
+ - data_schema.required and data_schema.optional are MAPS (fieldName: {type: ...}), NOT arrays (- name: ...)
335
+ - data_schema.required MUST have at least one field
336
+ - Field types: string, number, integer, boolean, array, object
337
+ - All date/time fields MUST be type: string with description mentioning ISO 8601 format
338
+ - service.name: concise kebab-case identifier, 1-3 words. Use the project's own name when it has one. Do NOT invent generic abbreviations or add redundant suffixes like "-service" or "-monitor".
339
+ - ONLY include fields that exist in the raw source data. Computed/derived values (aggregates, scores, trends, risk levels, statistics) are calculated by extensions and stored in separate memory keys — they do NOT belong in the CSM data_schema.
340
+ - Avoid redundant fields. If the source provides a unique identifier (e.g. guid), do not add a second id field. If a value is always the same (e.g. single data source), do not include it as a field.`,
341
+ variables: ['context', 'label', 'component_context'],
342
+ usedIn: ['generator-autopilot', 'generator-ui'],
343
+ },
344
+ {
345
+ id: 'gen-memory',
346
+ group: 'generator',
347
+ name: 'Memory Generator',
348
+ description: 'EXACT memory template from COMPONENT_TEMPLATES.memory in generator-prompts-base.js.',
349
+ content: `{{context}}
350
+
351
+ Define memory structure for: {{label}}
352
+
353
+ {{component_context}}
354
+
355
+ ## Memory Key Conventions
356
+
357
+ AIMEAT memory uses dot-namespaced keys with a standard metadata pattern:
358
+
359
+ - \`namespace.__meta\` — describes the namespace (version, key format, description)
360
+ - \`namespace.__index\` — lightweight index for fast lookups (list of dates, counts, rankings)
361
+ - \`namespace.__config\` — configuration for the namespace (TTLs, thresholds, weights)
362
+ - \`namespace.YYYY-MM-DD\` — date-bucketed data (one key per day)
363
+ - \`namespace.item-id\` — individual items
364
+
365
+ Values are JSON objects — a single value can hold arrays, nested objects, and large datasets (up to several MB). There is NO reason to split a dataset across multiple keys when it logically belongs together.
366
+
367
+ ## Rules
368
+ - All keys MUST be lowercase with dots as namespace separators
369
+ - Date-bucketed keys MUST use YYYY-MM-DD format: "items.by-date.2026-03-14"
370
+ - All date/time values inside objects MUST be ISO 8601: "2026-03-14T13:00:00.000Z"
371
+ - Include __meta with version and description for every namespace
372
+ - Include __index if consumers need to discover which keys exist (e.g., list of dates with data)
373
+ - Keep __index lightweight — just key names, counts, and pointers. NOT full data copies.
374
+ - Use arrays for ordered collections within a bucket (e.g., entries per day)
375
+ - Use meaningful field names that match the CSM data_schema where applicable
376
+ - PREFER fewer, larger keys over many small keys. A lookup table, reference dataset, or configuration object should be ONE key containing the full data structure (object or array), NOT split into one key per entry. For example, a list of 300 items should be ONE key "catalog.data" containing the full array — NOT 300 separate keys.
377
+
378
+ Return a JSON object where keys are memory key names and values are the initial/template data:
379
+ \`\`\`json
380
+ {
381
+ "namespace.__meta": {
382
+ "version": "1.0",
383
+ "description": "What this namespace stores",
384
+ "keyFormat": "namespace.YYYY-MM-DD"
385
+ },
386
+ "namespace.__index": {
387
+ "dates": [],
388
+ "totalItems": 0,
389
+ "lastUpdated": ""
390
+ },
391
+ "namespace.YYYY-MM-DD": {
392
+ "date": "YYYY-MM-DD",
393
+ "items": []
394
+ }
395
+ }
396
+ \`\`\``,
397
+ variables: ['context', 'label', 'component_context'],
398
+ usedIn: ['generator-autopilot', 'generator-ui'],
399
+ },
400
+ {
401
+ id: 'gen-translation',
402
+ group: 'generator',
403
+ name: 'Translation Generator',
404
+ description: 'EXACT translation template from COMPONENT_TEMPLATES.translation in generator-prompts-base.js.',
405
+ content: `{{context}}
406
+
407
+ Create translations for: {{label}}
408
+
409
+ {{component_context}}
410
+
411
+ ## Translation Key Conventions
412
+
413
+ - Keys use dot-namespaced paths matching the UI structure: "app.list.title", "app.filters.status"
414
+ - Group by UI section: "app.nav.*", "app.map.*", "app.filters.*", "app.stats.*"
415
+ - Include domain-specific terms: categories, statuses, types relevant to the project
416
+ - Use interpolation with \${variable} syntax for dynamic values: "Found \${count} items"
417
+
418
+ ## CRITICAL: Generate ONLY the locale indicated by the label
419
+
420
+ Each translation component covers ONE locale. The label tells you which one:
421
+ - "Finnish (fi) Strings" → generate ONLY Finnish translations under the "fi" root key
422
+ - "English (en) Strings" → generate ONLY English translations under the "en" root key
423
+
424
+ ╔══════════════════════════════════════════════════════════════════════════╗
425
+ ║ NEVER generate both locales in one component. ║
426
+ ║ If the label says "Finnish", output ONLY { "fi": { ... } }. ║
427
+ ║ If the label says "English", output ONLY { "en": { ... } }. ║
428
+ ║ The other locale is handled by a SEPARATE component in the blueprint. ║
429
+ ╚══════════════════════════════════════════════════════════════════════════╝
430
+
431
+ ## Rules
432
+ - The root key MUST match the locale in the label: "en" for English, "fi" for Finnish
433
+ - NEVER include the other locale — it will be generated in its own component
434
+ - Finnish translations must be natural Finnish with correct characters (ä, ö, å) — not machine-translated
435
+ - Include ALL text that appears in the UI — labels, buttons, tooltips, empty states, error messages
436
+ - Keep keys consistent with what the App component will reference
437
+ - Use plural-aware keys where needed: "item.one" / "item.many"
438
+ - Both locale components MUST use the SAME key structure — the app uses the same keys for both
439
+
440
+ Return JSON with translations for the SINGLE locale from the label:
441
+
442
+ Example — if label is "Finnish (fi) Strings":
443
+ \`\`\`json
444
+ {
445
+ "fi": {
446
+ "app.title": "Sovelluksen nimi",
447
+ "app.nav.home": "Etusivu",
448
+ "app.filters.status": "Tila",
449
+ "app.filters.all": "Kaikki",
450
+ "app.empty": "Tietoja ei löytynyt",
451
+ "app.error": "Jokin meni pieleen",
452
+ "domain.type.example_category": "Esimerkkikategoria",
453
+ "domain.status.active": "Aktiivinen"
454
+ }
455
+ }
456
+ \`\`\`
457
+
458
+ Example — if label is "English (en) Strings":
459
+ \`\`\`json
460
+ {
461
+ "en": {
462
+ "app.title": "App Title",
463
+ "app.nav.home": "Home",
464
+ "app.filters.status": "Status",
465
+ "app.filters.all": "All",
466
+ "app.empty": "No data found",
467
+ "app.error": "Something went wrong",
468
+ "domain.type.example_category": "Example Category",
469
+ "domain.status.active": "Active"
470
+ }
471
+ }
472
+ \`\`\`
473
+
474
+ {{matching_keys_section}}`,
475
+ variables: ['context', 'label', 'component_context', 'matching_keys_section'],
476
+ usedIn: ['generator-autopilot', 'generator-ui'],
477
+ },
478
+ // ═══════════════════════════════════════════════════════════════════
479
+ // Spec Generation Prompts — kept from v1 (these were already correct)
480
+ // ═══════════════════════════════════════════════════════════════════
481
+ {
482
+ id: 'gen-extension-spec',
483
+ group: 'generator',
484
+ name: 'Extension Spec Generator',
485
+ description: 'Generates formal JSON contract for an extension — actions, memory keys, schedules, config.',
486
+ content: `{{disclaimer}}
487
+
488
+ # Task: Generate Extension Spec
489
+
490
+ You are designing the PUBLIC CONTRACT for an AIMEAT platform extension. This spec defines what the extension provides — actions, memory keys, schedules, config — with exact types and real examples from the data source.
491
+
492
+ This is a SPEC, not code. No implementation, no function bodies, no ctx calls.
493
+ This extension is a PLATFORM CAPABILITY — it knows nothing about any app, cortex, or UI.
494
+
495
+ ## Data Sources
496
+ {{data_sources}}
497
+
498
+ ## Actions From Blueprint (MUST use these EXACT action IDs)
499
+
500
+ ╔══════════════════════════════════════════════════════════════════════════╗
501
+ ║ Your spec MUST include ALL actions listed below with the EXACT IDs. ║
502
+ ║ Do NOT rename them. Do NOT drop any. Do NOT merge them. ║
503
+ ║ The blueprint is the contract — every action must appear in your spec. ║
504
+ ╚══════════════════════════════════════════════════════════════════════════╝
505
+
506
+ {{blueprint_actions}}
507
+
508
+ ## Data Structures
509
+ {{structures}}
510
+
511
+ ## Memory Keys
512
+ {{memory_keys}}
513
+
514
+ ## Schedules
515
+ {{schedules}}
516
+
517
+ ## Config Keys
518
+ {{config_keys}}
519
+
520
+ ## Output Format
521
+
522
+ Return ONLY valid JSON. No markdown fences, no explanation text.
523
+
524
+ {
525
+ "name": "<kebab-case — describes the PLATFORM CAPABILITY>",
526
+ "description": "<one-line: what this extension provides>",
527
+ "actions": [
528
+ {
529
+ "id": "<actionId>",
530
+ "description": "<what this action does>",
531
+ "method": "POST",
532
+ "path": "/v1/ext/<name>/<actionId>",
533
+ "input": { "<param>": "<type and description>" },
534
+ "output": { "<field>": "<type>" },
535
+ "example": {
536
+ "input": { "<real example from data source>" },
537
+ "output": { "<real example — EXACT field names from sample data>" }
538
+ },
539
+ "errors": "<how errors are returned>"
540
+ }
541
+ ],
542
+ "memoryKeys": [
543
+ { "key": "<key>", "type": "<TypeScript type>", "description": "<what>", "example": "<value>" }
544
+ ],
545
+ "schedules": [
546
+ { "id": "<id>", "action": "<actionId>", "cron": "<expression>", "description": "<what>" }
547
+ ],
548
+ "config": { "<key>": "<type — description>" },
549
+ "dataSources": [
550
+ { "name": "<name>", "baseUrl": "<EXACT base URL from the data source above>", "notes": "<any important API details>" }
551
+ ],
552
+ "usage": {
553
+ "callPattern": "POST /v1/ext/<name>/<actionId> with JSON body",
554
+ "authRequired": true,
555
+ "memoryNamespace": "ext:<name>",
556
+ "readMemory": "GET /v1/memory/ext%3A<name>/<key> (public, no auth)"
557
+ }
558
+ }
559
+
560
+ ## CRITICAL RULES
561
+ 1. Use EXACT field names from data source sample entries. Copy character-for-character.
562
+ 2. Every action MUST have an "example" with real data from the interview's sample entries.
563
+ 3. Extension name describes the PLATFORM CAPABILITY: e.g. "weather-data", not "weather-monitor-extension".
564
+ 4. Do NOT mention any app, cortex, UI, or project.
565
+ 5. The "dataSources" section MUST include the EXACT base URLs from the Data Sources section above. The code generator needs these URLs to implement the extension. Copy them character-for-character.
566
+ 6. Action IDs MUST be camelCase: "getItems", NOT "get-items". This is the coding standard.
567
+ 7. The "output" field MUST list actual field names and types — NEVER use "$ref". Expand all references into concrete field descriptions. The test generator needs real field names to write assertions.`,
568
+ variables: ['disclaimer', 'data_sources', 'blueprint_actions', 'structures', 'memory_keys', 'schedules', 'config_keys'],
569
+ usedIn: ['generator-autopilot', 'generator-ui'],
570
+ },
571
+ {
572
+ id: 'gen-data-api-spec',
573
+ group: 'generator',
574
+ name: 'Data API Spec Generator',
575
+ description: 'Generates data cortex spec — method signatures wrapping extension actions.',
576
+ content: `{{disclaimer}}
577
+
578
+ # Task: Generate Data API Spec
579
+
580
+ Design the public API for a DATA CORTEX — a client-side JS library wrapping an AIMEAT extension.
581
+
582
+ ## Extension Spec
583
+ \`\`\`json
584
+ {{extension_spec}}
585
+ \`\`\`
586
+
587
+ {{structures}}
588
+
589
+ ## Output Format
590
+ Return ONLY valid JSON:
591
+ {
592
+ "name": "<kebab-case>",
593
+ "libName": "<camelCase — AIMEAT.<libName>>",
594
+ "description": "<one-line>",
595
+ "wrapsExtension": "<extension name>",
596
+ "methods": [
597
+ { "name": "<method>", "description": "<what>", "params": "<type>", "returns": "Promise<type>",
598
+ "example": "const r = await AIMEAT.<libName>.<name>(<args>);",
599
+ "returnsExample": "<from extension spec>",
600
+ "errorBehavior": "Returns null on failure" }
601
+ ],
602
+ "translationAccess": "getTranslations(locale) → Promise<object>",
603
+ "settingsAccess": "getSettings() → Promise<object>"
604
+ }
605
+
606
+ ## Required Methods (from blueprint — MUST use these EXACT names)
607
+
608
+ ╔══════════════════════════════════════════════════════════════════════════╗
609
+ ║ Your spec MUST include ALL methods listed below with the EXACT names. ║
610
+ ║ Do NOT rename them. Do NOT use the extension action names instead. ║
611
+ ║ The blueprint is the contract — every method must appear in your spec. ║
612
+ ╚══════════════════════════════════════════════════════════════════════════╝
613
+
614
+ {{blueprint_methods}}
615
+
616
+ Each method wraps one or more extension actions. Map them appropriately.
617
+ For example, if the blueprint requires "getItems" and the extension has "fetchAllItems",
618
+ create a method named "getItems" that internally calls the extension's "fetchAllItems".
619
+
620
+ ## Rules
621
+ 1. Method names MUST match the blueprint list above EXACTLY. Do NOT use extension action names as method names.
622
+ 2. Return types MUST match extension spec output exactly.
623
+ 3. Include getTranslations and getSettings — read from owner namespace.
624
+ 4. All methods return null on failure. No exceptions.
625
+ 5. params field MUST be an object type (e.g. "{ query: string, type: string }"), NEVER positional parameters.
626
+ 6. name and libName MUST be ASCII only (a-z, 0-9, hyphens for name, camelCase for libName). Transliterate non-ASCII: ä→a, ö→o, å→a, ü→u.`,
627
+ variables: ['disclaimer', 'extension_spec', 'structures', 'blueprint_methods'],
628
+ usedIn: ['generator-autopilot', 'generator-ui'],
629
+ },
630
+ {
631
+ id: 'gen-component-spec',
632
+ group: 'generator',
633
+ name: 'Component Spec Generator',
634
+ description: 'Generates reusable UI component spec — render signature, props, data access.',
635
+ content: `{{disclaimer}}
636
+
637
+ # Task: Generate Component Spec
638
+
639
+ Design a REUSABLE UI COMPONENT — renders one thing well, composed by app-domain cortex.
640
+
641
+ ## Component: {{component_label}}
642
+ {{view_context}}
643
+
644
+ ## Available Data API
645
+ \`\`\`json
646
+ {{data_api_spec}}
647
+ \`\`\`
648
+
649
+ ## Translation Keys
650
+ {{translation_keys}}
651
+
652
+ ## UI Components (daisyUI)
653
+
654
+ Choose daisyUI components for this feature's UI. The code generator uses your choices.
655
+
656
+ **Data display**: table, card, stat, carousel, timeline, chat, collapse
657
+ **Forms**: input, textarea, select, checkbox, radio, toggle, range, file-input
658
+ **Actions**: button (btn), dropdown, swap
659
+ **Feedback**: alert, badge, loading, progress, tooltip, toast
660
+ **Layout**: tabs, accordion, drawer, modal, hero, divider
661
+ **Navigation**: navbar, menu, breadcrumbs, pagination, steps
662
+
663
+ ## Output Format
664
+ Return ONLY valid JSON:
665
+ {
666
+ "name": "<kebab-case>",
667
+ "libName": "<camelCase>",
668
+ "purpose": "<one-line>",
669
+ "render": {
670
+ "signature": "AIMEAT.<libName>.render(container, props)",
671
+ "props": { "<name>": "<type — description>" },
672
+ "returns": "{ el: HTMLElement, destroy(): void, update(props): void }"
673
+ },
674
+ "dataAccess": ["<data API methods used>"],
675
+ "example": "<usage showing render() with realistic props>",
676
+ "ui": {
677
+ "layout": "<primary container: card | hero | none>",
678
+ "components": ["<daisyUI component names>"],
679
+ "navigation": "<tabs | menu | steps | breadcrumbs | none>"
680
+ }
681
+ }
682
+
683
+ ## Rules
684
+ 1. Props include callbacks for interactions (onSelect, onAdd) — component doesn't navigate.
685
+ 2. Component receives locale + translations as props.
686
+ 3. Keep props minimal.
687
+ 4. name and libName MUST be ASCII only (a-z, 0-9, hyphens for name, camelCase for libName). Transliterate non-ASCII: ä→a, ö→o, å→a, ü→u.
688
+ 5. The component loads translations internally via AIMEAT.data.get() — the translations prop is optional and can be omitted from the example.
689
+ 6. ui.components: list daisyUI component names this feature uses. Code generator includes class reference for ONLY these.`,
690
+ variables: ['disclaimer', 'component_label', 'view_context', 'data_api_spec', 'translation_keys'],
691
+ usedIn: ['generator-autopilot', 'generator-ui'],
692
+ },
693
+ {
694
+ id: 'gen-app-domain-spec',
695
+ group: 'generator',
696
+ name: 'App-Domain Spec Generator',
697
+ description: 'Generates app-domain cortex spec — composes components, manages navigation.',
698
+ content: `{{disclaimer}}
699
+
700
+ # Task: Generate App-Domain Cortex Spec
701
+
702
+ Design the top-level composition layer — composes components into views, manages auth, translations, business logic.
703
+
704
+ ## Available Components
705
+ {{component_specs}}
706
+
707
+ ## Available Data API
708
+ \`\`\`json
709
+ {{data_api_spec}}
710
+ \`\`\`
711
+
712
+ ## Use Cases
713
+ {{use_cases}}
714
+
715
+ ## Views
716
+ {{views}}
717
+
718
+ ## Translation Keys
719
+ {{translation_keys}}
720
+
721
+ ## App Shell (daisyUI)
722
+
723
+ Choose layout and navigation for the app shell.
724
+
725
+ **Layout**: drawer (sidebar+content), navbar+content, hero+sections
726
+ **Navigation**: tabs, menu, breadcrumbs, steps, bottom-navigation, navbar
727
+ **Feedback**: modal, toast, alert
728
+
729
+ ## Output Format
730
+ Return ONLY valid JSON:
731
+ {
732
+ "name": "<kebab-case>",
733
+ "libName": "<camelCase>",
734
+ "methods": {
735
+ "init": "async () → { session, translations, settings }",
736
+ "render": "(container) → void",
737
+ "t": "(key) → string",
738
+ "switchLocale": "(locale) → void"
739
+ },
740
+ "views": ["<view>"],
741
+ "navigation": "<sidebar | tabs>",
742
+ "viewComposition": { "<view>": ["<components>"] },
743
+ "scriptDependencies": ["<ordered script URLs>"],
744
+ "example": "await AIMEAT.<libName>.init(); AIMEAT.<libName>.render(el);",
745
+ "appShell": "<drawer | navbar | tabs>",
746
+ "navStyle": "<tabs | menu | breadcrumbs | steps>"
747
+ }
748
+
749
+ ## Rules
750
+ 1. name and libName MUST be ASCII only (a-z, 0-9, hyphens for name, camelCase for libName). Transliterate non-ASCII: ä→a, ö→o, å→a, ü→u.
751
+ 2. appShell and navStyle: choose daisyUI layout patterns from the list above.`,
752
+ variables: ['disclaimer', 'component_specs', 'data_api_spec', 'use_cases', 'views', 'translation_keys'],
753
+ usedIn: ['generator-autopilot', 'generator-ui'],
754
+ },
755
+ // ═══════════════════════════════════════════════════════════════════
756
+ // Code generation — extension code template uses {{context}}, {{label}}, {{spec_section}}
757
+ // ═══════════════════════════════════════════════════════════════════
758
+ {
759
+ id: 'gen-extension-code',
760
+ group: 'generator',
761
+ name: 'Extension Code Generator',
762
+ description: 'Full extension code template — YAML manifest + JS action files.',
763
+ content: `{{context}}
764
+
765
+ Create an AIMEAT Extension for: {{label}}
766
+
767
+ ## YAML STRING RULES (read this FIRST — violations cause parse errors)
768
+
769
+ Every string value MUST be on ONE line wrapped in double quotes. No exceptions.
770
+ NEVER use > or | (block scalars). NEVER leave strings unquoted.
771
+
772
+ WRONG: description: > This is a folded string
773
+ WRONG: description: This has (parens) and colons: here
774
+ CORRECT: description: "This has (parens) and colons: here — all on one line"
775
+
776
+ {{sandbox_constraints}}
777
+
778
+ ## ctx.memory API — CRITICAL details
779
+
780
+ ### ctx.memory.get(key) — WILL CRASH if you use JSON.parse()
781
+
782
+ ctx.memory.get() returns the VALUE directly (already a JS object/array/value), or null.
783
+ It is NOT a string. Calling JSON.parse() on it will CRASH with "null is not valid JSON".
784
+
785
+ ╔══════════════════════════════════════════════════════════════════════════╗
786
+ ║ NEVER WRITE: JSON.parse(await ctx.memory.get(...)) ║
787
+ ║ NEVER WRITE: JSON.parse(ctx.memory.get(...)) ║
788
+ ║ NEVER WRITE: const x = JSON.parse(someMemoryValue) ║
789
+ ║ These ALL crash. The value is ALREADY PARSED. ║
790
+ ╚══════════════════════════════════════════════════════════════════════════╝
791
+
792
+ WRONG (CRASHES EVERY TIME):
793
+ const data = JSON.parse(await ctx.memory.get("my.key")); // "undefined" is not valid JSON
794
+
795
+ CORRECT:
796
+ const data = await ctx.memory.get("my.key");
797
+ if (!data) return { error: "No data found" };
798
+ // data is already a JS object/array/value — use it directly
799
+
800
+ ### ctx.memory.get() returns null when key does not exist — ALWAYS null-check!
801
+
802
+ ╔══════════════════════════════════════════════════════════════════════════╗
803
+ ║ ALWAYS check the return value before using it. ║
804
+ ║ Arrays and objects from memory may be null on first run. ║
805
+ ╚══════════════════════════════════════════════════════════════════════════╝
806
+
807
+ WRONG (CRASHES on first run when no data exists yet):
808
+ const index = await ctx.memory.get("items.__index");
809
+ index.some(...) // Cannot read properties of null (reading 'some')
810
+ index.push(...) // Cannot read properties of null (reading 'push')
811
+ index.length // Cannot read properties of null (reading 'length')
812
+
813
+ CORRECT:
814
+ const index = await ctx.memory.get("items.__index") || [];
815
+ index.some(...) // works — falls back to empty array
816
+
817
+ CORRECT (for objects):
818
+ const stats = await ctx.memory.get("daily.stats") || {};
819
+ stats.count = (stats.count || 0) + 1;
820
+
821
+ ### ctx.memory.set(key, value) stores any JSON-serializable value
822
+ await ctx.memory.set("items.2026-03-14", { entries: [...], count: 5 });
823
+
824
+ ### ctx.memory.search(prefix) returns objects, NOT strings — returns ALL matching keys (no pagination)
825
+ WARNING: search() loads ALL matching keys into memory at once. If your prefix matches thousands of keys, the sandbox may run out of memory. Use specific prefixes (e.g., "items.by-date.2026-03-14" not "items.")
826
+
827
+ WRONG:
828
+ const keys = await ctx.memory.search("prefix.");
829
+ for (const key of keys) { await ctx.memory.get(key); } // ERROR: key is {key,value} not string
830
+
831
+ CORRECT:
832
+ const results = await ctx.memory.search("prefix.");
833
+ for (const entry of results) {
834
+ const key = entry.key; // string
835
+ const value = entry.value; // the stored value — already parsed, NOT a string
836
+ }
837
+
838
+ ## Output format — SINGLE block, copy-paste friendly
839
+
840
+ Return EVERYTHING in ONE code block. The YAML manifest first, then all JavaScript files separated by // actions/filename.js comments. The user will copy-paste the entire response at once.
841
+
842
+ \\\`\\\`\\\`
843
+ metadata:
844
+ name: kebab-case-name
845
+ version: "1.0.0"
846
+ description: "What this extension does — one line, double quoted"
847
+ author: generator
848
+ required_apis: [memory]
849
+ config: {}
850
+ limits:
851
+ memory_mb: 128
852
+ timeout_ms: 30000
853
+ max_api_calls: 500
854
+ actions:
855
+ - id: firstAction
856
+ description: "What this action does"
857
+ method: POST
858
+ path: /v1/ext/{name}/firstAction
859
+ auth: required
860
+ input: {}
861
+ output: {}
862
+ script: firstAction.js
863
+ - id: secondAction
864
+ description: "Another action"
865
+ method: POST
866
+ path: /v1/ext/{name}/secondAction
867
+ auth: required
868
+ input:
869
+ type: object
870
+ properties:
871
+ name:
872
+ type: string
873
+ required: [name]
874
+ output:
875
+ type: object
876
+ script: secondAction.js
877
+ schedules: []
878
+
879
+ YAML actions format — EVERY action MUST have "- id:" as the FIRST key:
880
+ CORRECT: - id: myAction (id: is explicit key)
881
+ WRONG: - myAction (bare value — causes YAML parse error)
882
+ WRONG: - myAction: (colon after name — causes YAML parse error)
883
+ NEVER omit "id:" from any action entry. This is the #1 cause of validation failures.
884
+ // actions/myAction.js
885
+ export default async function(ctx, input) {
886
+ // ── Reading from EXTERNAL APIs (ctx.fetch) ──
887
+ // ctx.fetch() returns { ok, status, text, headers } — text is a RAW string, parse it yourself
888
+ // Encoding is auto-detected (Content-Type header, XML prolog, HTML meta) — you get Unicode text
889
+ const resp = await ctx.fetch('https://example.com/api');
890
+ if (!resp.ok) {
891
+ ctx.log.error('API request failed', { status: resp.status });
892
+ return { error: 'Request failed with status ' + resp.status };
893
+ }
894
+ const data = JSON.parse(resp.text); // ← correct: resp.text IS a string (for JSON APIs)
895
+ // For XML/RSS: resp.text is already decoded Unicode — parse with regex or string methods
896
+
897
+ // ── IMPORTANT: API call patterns ──
898
+ // Use the EXACT base URL from the spec's dataSources section.
899
+ // Most open data APIs use QUERY PARAMETERS for all lookups:
900
+ // CORRECT: baseUrl + '?id=' + encodeURIComponent(id)
901
+ // WRONG: baseUrl + '/' + id ← path params often return 400/404
902
+ // Check the data source notes for the supported parameter names.
903
+ // If the data source URL ends with a collection name (e.g. /companies),
904
+ // it is a SEARCH endpoint — use query params, NOT path params.
905
+
906
+ // ── Reading from EXTENSION'S OWN MEMORY (ctx.memory.get) ──
907
+ // ctx.memory.get() returns a JS value directly — NEVER use JSON.parse
908
+ const stored = await ctx.memory.get("my.key");
909
+ if (!stored) return { items: [] }; // ← stored is already an object, or null
910
+
911
+ // ── Reading OWNER'S SHARED DATA (memory components, settings, translations) ──
912
+ // Data stored by memory-1, memory-2 etc. lives in the OWNER's namespace, NOT the extension's.
913
+ // Use getPublic(ctx.caller.gaii, key) to read it:
914
+ const lookup = await ctx.memory.getPublic(ctx.caller.gaii, "lookup.data") || [];
915
+ const settings = await ctx.memory.getPublic(ctx.caller.gaii, "settings.config") || {};
916
+
917
+ // ── Writing to EXTENSION'S OWN MEMORY ──
918
+ await ctx.memory.set("results.today", { items: data.results, fetchedAt: new Date().toISOString() });
919
+
920
+ return { result: stored };
921
+ }
922
+ \\\`\\\`\\\`
923
+
924
+ CRITICAL: Do NOT use separate code blocks. Put YAML manifest and ALL JavaScript files in ONE block.
925
+ Each JavaScript file MUST start with a comment line: // actions/{filename}.js
926
+
927
+ ## Action path — instance vs non-instance
928
+
929
+ ╔══════════════════════════════════════════════════════════════════════════╗
930
+ ║ Most extensions are SINGLE-INSTANCE (no :instanceId in path). ║
931
+ ║ Use: /v1/ext/{name}/actionId ║
932
+ ║ NEVER add :instanceId unless the blueprint explicitly requires ║
933
+ ║ multi-instance support (e.g., per-store, per-tenant separation). ║
934
+ ╚══════════════════════════════════════════════════════════════════════════╝
935
+
936
+ - Default (single-instance): \\\`path: /v1/ext/{name}/actionId\\\`
937
+ - Multi-instance (only if needed): \\\`path: /v1/ext/{name}/:instanceId/actionId\\\`
938
+
939
+ ## Scheduled Jobs (schedules section)
940
+
941
+ Extensions can declare recurring background jobs via \\\`schedules\\\` in the manifest.
942
+ AIMEAT's built-in scheduler runs these automatically — no browser needed.
943
+
944
+ ╔══════════════════════════════════════════════════════════════════════════╗
945
+ ║ If the blueprint has "schedules" for this extension, you MUST include ║
946
+ ║ a schedules section in the YAML manifest. This is the ONLY way to ║
947
+ ║ register recurring jobs — cortex and apps CANNOT schedule work. ║
948
+ ╚══════════════════════════════════════════════════════════════════════════╝
949
+
950
+ Format:
951
+ \\\`\\\`\\\`yaml
952
+ schedules:
953
+ - id: unique-job-id
954
+ action: actionId
955
+ cron: "*/15 * * * *"
956
+ description: "What this scheduled job does"
957
+ instance_scope: false
958
+ input: {}
959
+ \\\`\\\`\\\`
960
+
961
+ Rules:
962
+ - \\\`action\\\` MUST reference an existing action id from the \\\`actions\\\` array
963
+ - \\\`cron\\\` uses standard 5-field cron syntax (minute hour day-of-month month day-of-week) OR the special value \\\`@activate\\\`
964
+ - \\\`@activate\\\` trigger: runs when the extension is activated AND on every server restart. Use for init/bootstrap jobs.
965
+ - \\\`instance_scope: false\\\` for single-instance extensions (most cases)
966
+ - \\\`input\\\` is optional static input passed to the action on each run
967
+ - Common patterns: \\\`@activate\\\` (init/bootstrap), \\\`*/15 * * * *\\\` (every 15 min), \\\`0 2 * * *\\\` (daily at 02:00), \\\`0 */6 * * *\\\` (every 6 hours)
968
+ - If a nightly job depends on data from a periodic job (e.g., aggregation needs fresh data), schedule it AFTER the last periodic run (e.g., collection at */15, aggregation at 02:00)
969
+ - If the blueprint has no "schedules" for this extension, set \\\`schedules: []\\\`
970
+
971
+ ### @activate Init Pattern
972
+
973
+ If the extension collects or computes data, add an \\\`@activate\\\` scheduled job that:
974
+ 1. Checks if data exists and is fresh (not stale)
975
+ 2. If missing or stale, runs the init/collection logic
976
+ 3. If data is already fresh, does nothing (returns early)
977
+
978
+ This solves the cold-start problem: after first activation or a server restart, the extension's data is immediately populated instead of waiting for the next cron tick.
979
+
980
+ Example @activate action script pattern:
981
+ \\\`\\\`\\\`javascript
982
+ // Check if data already exists and is recent
983
+ const lastRun = await ctx.memory.get('last-ingest-timestamp');
984
+ if (lastRun) {
985
+ const age = Date.now() - new Date(lastRun).getTime();
986
+ if (age < 15 * 60 * 1000) return; // Data is fresh (< 15 min), skip
987
+ }
988
+ // Data is missing or stale — run the init/collection logic
989
+ // ... fetch data, store in memory ...
990
+ await ctx.memory.set('last-ingest-timestamp', new Date().toISOString());
991
+ \\\`\\\`\\\`
992
+
993
+ Schedule entry:
994
+ \\\`\\\`\\\`yaml
995
+ - id: init-data
996
+ action: init
997
+ cron: "@activate"
998
+ description: "Initialize/refresh data on activation and server restart"
999
+ instance_scope: false
1000
+ input: {}
1001
+ \\\`\\\`\\\`
1002
+
1003
+ IMPORTANT: @activate actions MUST be idempotent — they will run multiple times (every restart). Always check existing data before overwriting.
1004
+
1005
+ ### Init Action — Initialize Runtime Data Only
1006
+
1007
+ The init/@activate action should initialize extension-owned runtime data (watchlists, caches, logs).
1008
+ Do NOT copy translations or settings to the extension namespace — cortex reads those
1009
+ directly from the owner namespace via AIMEAT.data.get().
1010
+
1011
+ Pattern:
1012
+ \\\`\\\`\\\`javascript
1013
+ // Initialize extension runtime data if not already present
1014
+ const watchlist = await ctx.memory.get('watchlist.items');
1015
+ if (!watchlist) {
1016
+ await ctx.memory.set('watchlist.items', []);
1017
+ ctx.log.info('Initialized empty watchlist');
1018
+ }
1019
+ \\\`\\\`\\\`
1020
+
1021
+ Only initialize keys that the EXTENSION owns and writes to (runtime data).
1022
+ Translations and settings live in the OWNER namespace — the cortex reads them directly.
1023
+
1024
+ ## Additional rules
1025
+ - \\\`metadata\\\` section MUST have: name, version, description, author
1026
+ - \\\`actions\\\` array MUST NOT be empty — each action needs: id, method, path, script
1027
+ - Each action's \\\`script\\\` field value must match a \\\`// actions/{script}\\\` comment below the YAML
1028
+ - \\\`limits.timeout_ms\\\`: use 30000 for extensions that call external APIs, 5000 for memory-only
1029
+ - \\\`limits.max_api_calls\\\`: use 500 for data collectors (many memory writes per run), 100 for simple actions
1030
+ - Action IDs MUST be camelCase: \\\`getItems\\\`, NOT \\\`get-items\\\`. The ID appears in URLs and YAML — camelCase is the standard.
1031
+ - All helper functions must be defined INSIDE the same script file — no imports, no cross-file references
1032
+ - If two actions need the same helper (e.g., date parsing, data normalization), DUPLICATE the helper in BOTH script files — copy it exactly, do NOT refactor into a shared module
1033
+ - NEVER reference functions from another action's script — each script runs in its own ISOLATED sandbox scope
1034
+ - When duplicating helpers across actions, keep them IDENTICAL — if you fix a bug in one copy, fix it in all copies
1035
+ - NEVER call JSON.parse() on ctx.memory.get() results — they are already parsed JS values
1036
+ - Always check for undefined/null before using memory values — on first run, NOTHING exists yet
1037
+ - Always convert dates to ISO 8601 before storing in memory
1038
+ - OWNER DATA: seed data (memory components), settings, and translations are in the OWNER's namespace.
1039
+ Use \\\`ctx.memory.getPublic(ctx.caller.gaii, key)\\\` to read them — NOT \\\`ctx.memory.get(key)\\\`.
1040
+ \\\`ctx.memory.get()\\\` only reads from the extension's own \\\`ext:{name}\\\` namespace.
1041
+ Common pattern: \\\`const data = await ctx.memory.getPublic(ctx.caller.gaii, "lookup.data") || [];\\\`
1042
+
1043
+ {{html_entity_rules}}
1044
+
1045
+ ## NOW: Implement this spec
1046
+
1047
+ {{spec_section}}
1048
+
1049
+ {{completed_context}}`,
1050
+ variables: ['context', 'label', 'spec_section', 'sandbox_constraints', 'html_entity_rules', 'completed_context'],
1051
+ usedIn: ['generator-autopilot', 'generator-ui'],
1052
+ },
1053
+ // ═══════════════════════════════════════════════════════════════════
1054
+ // Reflection + Fresh generation — verbatim from generator-prompts-fix.js
1055
+ // ═══════════════════════════════════════════════════════════════════
1056
+ {
1057
+ id: 'gen-reflection',
1058
+ group: 'generator',
1059
+ name: 'Reflection Diagnosis',
1060
+ description: 'Diagnose failure without writing code — root cause analysis for fix prompts.',
1061
+ content: `You are debugging a failed component. Your job is to DIAGNOSE the problem — do NOT write code.
1062
+
1063
+ ## Failed Code
1064
+ {{failed_code}}
1065
+
1066
+ ## Spec Contract (the code was supposed to implement this)
1067
+ {{spec_contract}}
1068
+
1069
+ ## Errors
1070
+ {{errors}}
1071
+ {{test_context}}
1072
+
1073
+ ## Your Task
1074
+
1075
+ Analyze the errors and the ACTUAL API RESPONSES above. In 2-5 sentences, explain:
1076
+ 1. What is the ROOT CAUSE of each error?
1077
+ 2. What specific data shapes or field names does the code assume vs what the API actually returns?
1078
+ 3. What specific lines or patterns in the code need to change?
1079
+
1080
+ Be precise — reference exact field names from the API responses. Do NOT write code.`,
1081
+ variables: ['failed_code', 'errors', 'test_context'],
1082
+ usedIn: ['generator-autopilot'],
1083
+ },
1084
+ {
1085
+ id: 'gen-fresh-generation',
1086
+ group: 'generator',
1087
+ name: 'Fresh Generation (Final Round)',
1088
+ description: 'Regenerate from scratch with pitfalls from all previous rounds — no broken code shown.',
1089
+ content: `{{original_prompt}}
1090
+ {{pitfalls}}{{test_trace}}
1091
+ IMPORTANT: This is a fresh generation. Do NOT reference any previous code.
1092
+ Study the ACTUAL API RESPONSES above carefully and match those exact data shapes.`,
1093
+ variables: ['original_prompt', 'pitfalls', 'test_trace'],
1094
+ usedIn: ['generator-autopilot'],
1095
+ },
1096
+ {
1097
+ id: 'gen-fix',
1098
+ group: 'generator',
1099
+ name: 'Fix Prompt',
1100
+ description: 'Fix validation/test failures — type-specific constraints, previous attempts, test context.',
1101
+ content: `{{disclaimer}}The following result had validation errors. Fix ONLY the errors listed below.
1102
+
1103
+ {{html_entity_rules}}
1104
+ {{type_constraints}}
1105
+ ORIGINAL PROMPT:
1106
+ {{original_prompt}}
1107
+
1108
+ FAILED RESULT:
1109
+ {{code}}
1110
+
1111
+ ERRORS:
1112
+ {{errors}}
1113
+ {{test_context}}{{previous_attempts}}{{reflection_diagnosis}}
1114
+ Return the corrected result in the same format as the original.`,
1115
+ variables: ['disclaimer', 'original_prompt', 'code', 'errors', 'component_type', 'type_constraints', 'html_entity_rules', 'test_context', 'previous_attempts', 'reflection_diagnosis'],
1116
+ usedIn: ['generator-autopilot'],
1117
+ },
1118
+ {
1119
+ id: 'gen-test-extension-spec',
1120
+ group: 'generator',
1121
+ name: 'Extension Test (from Spec)',
1122
+ description: 'Test code from extension spec — asserts exact field names from spec examples.',
1123
+ content: `{{disclaimer}}You are generating TEST CODE for a component in an AIMEAT service.
1124
+
1125
+ ## Component Under Test
1126
+ - Type: extension
1127
+ - Label: {{extension_name}}
1128
+ - Registered as: {{extension_name}}
1129
+ {{golden_samples}}{{extension_spec}}
1130
+ {{test_scenarios}}
1131
+ ## Data Structures (from blueprint — test against THESE shapes)
1132
+ {{structures}}
1133
+
1134
+ ## Action Contracts (from blueprint — test THESE methods with THESE shapes)
1135
+ {{action_contracts}}
1136
+
1137
+ {{project_context}}
1138
+
1139
+ ## Test Environment: Server-side sandbox (new Function)
1140
+
1141
+ CRITICAL SANDBOX RULES — violating ANY will crash the test:
1142
+ - NO import/require/export statements
1143
+ - You are inside an async function body. Just write sequential code.
1144
+ - Available variables: testFetch, baseUrl, callExt, readExtMemory
1145
+ - No Node.js APIs, no fs, no path, no process
1146
+
1147
+ Available helpers:
1148
+
1149
+ // LOW-LEVEL: raw HTTP call (use only for memory/translation tests, NOT for extensions)
1150
+ const resp = await testFetch(url, { method, body, headers });
1151
+ // resp = { status, ok, body }. Auth token injected automatically.
1152
+
1153
+ // HIGH-LEVEL: call extension action (PREFERRED for extension tests)
1154
+ const result = await callExt('ext-name', 'actionId', { key: 'value' });
1155
+ // Returns action's return value directly (envelope unwrapped)
1156
+
1157
+ // HIGH-LEVEL: read extension memory
1158
+ const data = await readExtMemory('ext-name', 'memory.key');
1159
+ // Returns value from ext:{name} namespace, or null
1160
+
1161
+ Your code MUST end with: return { passed: boolean, errors: string[], details: string }
1162
+
1163
+ ## Test Idempotency
1164
+ Tests MUST work on every run — first run or re-run after previous failure.
1165
+ Before the first scenario, clean stale data using the extension's OWN actions:
1166
+ 1. Read lists with readExtMemory
1167
+ 2. Call remove/delete actions for each existing item
1168
+ 3. Call init
1169
+
1170
+ ## JavaScript Pitfalls
1171
+ - NEVER compare arrays/objects with === or !== (\\\`value !== []\\\` is ALWAYS true). Use \\\`Array.isArray(v) && v.length === 0\\\`.
1172
+ - Check null with \\\`=== null\\\`, not \\\`== null\\\`.
1173
+
1174
+ ## Example (server-side extension test)
1175
+ \\\`\\\`\\\`
1176
+ const errors = [];
1177
+
1178
+ // CLEANUP: remove stale data via extension actions
1179
+ const existing = await readExtMemory('{{extension_name}}', 'items.list');
1180
+ if (existing && Array.isArray(existing)) {
1181
+ for (const item of existing) {
1182
+ await callExt('{{extension_name}}', 'removeItem', { id: item.id });
1183
+ }
1184
+ }
1185
+
1186
+ // [MEMORY] init
1187
+ const r0 = await callExt('{{extension_name}}', 'init', {});
1188
+ if (!r0) errors.push('init: no response');
1189
+ else if (r0.error) errors.push('init: ' + r0.error);
1190
+
1191
+ // [EXTERNAL API] — check shape only
1192
+ const r1 = await callExt('{{extension_name}}', 'fetchData', { query: 'test' });
1193
+ if (r1 === null) errors.push('fetchData: no response at all');
1194
+
1195
+ // [MEMORY] error handling
1196
+ const r2 = await callExt('{{extension_name}}', 'addItem', {});
1197
+ if (r2 === null) errors.push('addItem(empty): no response');
1198
+ else if (!r2.error) errors.push('addItem(empty): no error for invalid input');
1199
+
1200
+ return { passed: errors.length === 0, errors, details: 'Tested N actions' };
1201
+ \\\`\\\`\\\`
1202
+
1203
+ ## Platform Rules
1204
+ {{sandbox_constraints}}
1205
+
1206
+ {{extension_consumption_rules}}
1207
+
1208
+ ## Output Rules
1209
+ 1. Return ONLY executable JavaScript code — NO markdown fences, NO explanation text
1210
+ 2. NO import/require/export — sandbox environment
1211
+ 3. Your code runs INSIDE an existing async function. Write sequential statements starting with variable declarations. The runtime already provides the async wrapper.
1212
+ 4. End with: return { passed, errors, details }`,
1213
+ variables: ['disclaimer', 'extension_name', 'golden_samples', 'test_scenarios', 'structures', 'action_contracts', 'project_context', 'sandbox_constraints', 'extension_consumption_rules'],
1214
+ usedIn: ['generator-autopilot'],
1215
+ },
1216
+ // ═══════════════════════════════════════════════════════════════════
1217
+ // Cortex code generation — data, component, app-domain subtypes
1218
+ // Verbatim copies from public/js/services/generator-prompts-cortex-*.js
1219
+ // and generator-prompts-base.js app template. ${var} → {{var}}.
1220
+ // ═══════════════════════════════════════════════════════════════════
1221
+ {
1222
+ id: 'gen-cortex-data',
1223
+ group: 'generator',
1224
+ name: 'Data Cortex Generator',
1225
+ description: 'Data cortex IIFE — wraps extension into clean data access methods.',
1226
+ content: `{{disclaimer}}
1227
+ Create a Data Cortex library for: {{label}}
1228
+
1229
+ Project: {{project_description}}
1230
+
1231
+ {{spec_section}}
1232
+
1233
+ ## Goal
1234
+
1235
+ Build a client-side JavaScript library (IIFE) that provides data access methods.
1236
+ This is the DATA LAYER — pure data access, no UI rendering.
1237
+ Other cortex components will use this library to get and modify data.
1238
+
1239
+ ## Structures (shared data types — use these exact shapes)
1240
+
1241
+ {{structures}}
1242
+
1243
+ ## Methods to Export
1244
+
1245
+ {{methods_to_export}}
1246
+
1247
+ {{extension_section}}
1248
+
1249
+ ## AIMEAT Platform Libraries Available
1250
+
1251
+ - **AIMEAT.data** — get(key), set(key, value), delete(key), list(opts), search(query), getPublic(gaii, key), getEntry(key), update(key, value, version)
1252
+ - **AIMEAT.storage** — upload(file), download(key), list(), delete(key)
1253
+ - **AIMEAT.social** — createBoard(name), post(boardId, content), boards(), posts(boardId)
1254
+ - **AIMEAT.wallet** — balance(), transactions()
1255
+ - **AIMEAT.auth** — login(), getSession(), mountLoginButton(container)
1256
+
1257
+ ## Data Access Rules (CRITICAL — follow precisely)
1258
+
1259
+ Two namespaces, two different methods:
1260
+
1261
+ 1. **Extension runtime data** (watchlist items, cached API results, change logs — data the EXTENSION wrote via ctx.memory.set):
1262
+ → Read with: \\\`AIMEAT.data.getPublic('ext:EXTENSION_NAME', key)\\\`
1263
+ → This reads from the extension's own namespace. Public, no auth needed.
1264
+
1265
+ 2. **Owner/user data** (translations, settings, seed data — data stored by memory/translation components):
1266
+ → Read with: \\\`AIMEAT.data.get(key)\\\`
1267
+ → This reads from the CURRENT USER's own namespace. Requires auth session.
1268
+
1269
+ NEVER read translations or settings from ext: namespace. They live in the owner namespace.
1270
+ NEVER read extension runtime data with data.get() — that reads the wrong namespace.
1271
+
1272
+ ## Output Format
1273
+
1274
+ Return TWO separate, properly tagged code blocks.
1275
+ The installer expects them separately — YAML defines the manifest, JS is the library file.
1276
+
1277
+ CRITICAL: Use \\\`\\\`\\\`yaml for the manifest and \\\`\\\`\\\`javascript for the library code.
1278
+ Do NOT combine them into a single block. Do NOT use an untagged block.
1279
+
1280
+ First block — YAML manifest:
1281
+ \\\`\\\`\\\`yaml
1282
+ apiVersion: cortex.aimeat.org/v1
1283
+ kind: Extension
1284
+ metadata:
1285
+ name: kebab-case-name
1286
+ namespace: community
1287
+ description: "What this data cortex does"
1288
+ author: generator
1289
+ tags: [data, domain-tag]
1290
+ labels:
1291
+ domain: specific-domain
1292
+ spec:
1293
+ version: "1.0.0"
1294
+ license: MIT
1295
+ components:
1296
+ - type: prompt
1297
+ name: domain-assistant
1298
+ content: |
1299
+ You are using the {{metadata.name}} cortex library.
1300
+ Node URL: {{node_url}}
1301
+
1302
+ Available API:
1303
+ AIMEAT.yourLib.methodName(params) — Description
1304
+ ...
1305
+
1306
+ To load in an app:
1307
+ <script src="{{node_url}}/v1/cortex/kebab-case-name/libs/kebab-case-name.js"></script>
1308
+
1309
+ - type: lib
1310
+ name: kebab-case-name
1311
+ filename: kebab-case-name.js
1312
+ exports: [methodName, ...]
1313
+ api_surface: |
1314
+ AIMEAT.yourLib.methodName(params) — Description and return type
1315
+ ...
1316
+ \\\`\\\`\\\`
1317
+
1318
+ Second block — JavaScript library:
1319
+ \\\`\\\`\\\`javascript
1320
+ (function (AIMEAT) {
1321
+ 'use strict';
1322
+ const LIB_NAME = 'yourLibName'; // camelCase of metadata.name
1323
+ const EXT_NAME = 'extension-name'; // kebab-case extension name from the extension section above
1324
+
1325
+ // ── EXACT callExt implementation — DO NOT MODIFY THIS PATTERN ──
1326
+ // Calls an extension action via the AIMEAT API. Returns the action's return value.
1327
+ // URL pattern is ALWAYS: /v1/ext/{extensionName}/{actionId}
1328
+ // session.fetch returns ALREADY-PARSED JSON — use resp.data directly, NEVER resp.json()
1329
+ async function callExt(actionId, body) {
1330
+ var resp = await AIMEAT.session.fetch('/v1/ext/' + EXT_NAME + '/' + actionId, {
1331
+ method: 'POST',
1332
+ headers: { 'Content-Type': 'application/json' },
1333
+ body: JSON.stringify(body || {})
1334
+ });
1335
+ return resp.data;
1336
+ }
1337
+
1338
+ // ── EXACT readExtMemory implementation — DO NOT MODIFY THIS PATTERN ──
1339
+ // Reads extension runtime data from the ext:{name} namespace.
1340
+ async function readExtMemory(key) {
1341
+ return await AIMEAT.data.getPublic('ext:' + EXT_NAME, key);
1342
+ }
1343
+
1344
+ // ── Public data access methods ──
1345
+ // CRITICAL: Every method takes a SINGLE OBJECT parameter and destructures it.
1346
+ // This matches the spec contract. The test will call: lib.methodName({ key: value })
1347
+ // Example:
1348
+ // async function doSomething(params) {
1349
+ // var id = params.id;
1350
+ // var filter = params.filter || 'all';
1351
+ // return await callExt('doSomething', { id: id, filter: filter });
1352
+ // }
1353
+ // NEVER use positional parameters like methodName(a, b) — always methodName(params).
1354
+ // Method names in exports MUST match the blueprint "produces: api:XXX" names EXACTLY.
1355
+ // Do NOT rename them to match extension action names — use the blueprint names.
1356
+
1357
+ async function methodName(params) { ... }
1358
+
1359
+ // Register
1360
+ const exports = { methodName, ... };
1361
+ if (AIMEAT.register) AIMEAT.register(LIB_NAME, exports);
1362
+ AIMEAT[LIB_NAME] = exports;
1363
+ })(window.AIMEAT || (window.AIMEAT = {}));
1364
+ \\\`\\\`\\\``,
1365
+ variables: ['disclaimer', 'label', 'project_description', 'spec_section', 'structures', 'methods_to_export', 'extension_section'],
1366
+ usedIn: ['generator-autopilot', 'generator-ui'],
1367
+ },
1368
+ {
1369
+ id: 'gen-cortex-component',
1370
+ group: 'generator',
1371
+ name: 'Feature Cortex Generator',
1372
+ description: 'Feature cortex IIFE — self-contained UI module with render(container).',
1373
+ content: `{{disclaimer}}
1374
+ Create a Feature Cortex component for: {{label}}
1375
+
1376
+ {{spec_section}}
1377
+
1378
+ ## Use Case
1379
+ {{use_case}}
1380
+
1381
+ ## View
1382
+ {{view_section}}
1383
+
1384
+ ## Goal
1385
+
1386
+ Build a self-contained feature module (data + UI) as a cortex IIFE.
1387
+ It must export a \\\`render(container)\\\` function that:
1388
+ 1. Renders UI using daisyUI CSS classes — semantic HTML with class names like "card", "table", "btn"
1389
+ 2. Fetches data from the data cortex
1390
+ 3. Uses daisyUI components for all visual elements — do NOT build raw unstyled HTML
1391
+ 4. Handles user interactions
1392
+ 5. Uses translation keys for all visible text
1393
+
1394
+ Think of it like aimeat-charts: \\\`ChartPanel({ target: container, ... })\\\` creates a complete chart.
1395
+ Your \\\`render(container)\\\` creates a complete feature view.
1396
+
1397
+ ## Data Structures
1398
+ {{structures}}
1399
+
1400
+ {{data_cortex_api}}
1401
+
1402
+ {{platform_ui_section}}
1403
+
1404
+ {{translation_section}}
1405
+
1406
+ ## Loading Translations
1407
+
1408
+ Translations are stored in the OWNER namespace (by the translation component).
1409
+ The service slug for this project is: {{service_slug}}
1410
+ Load translations inside your render() function BEFORE rendering any text:
1411
+ \\\`\\\`\\\`javascript
1412
+ // Load translations FIRST — call this at the start of render()
1413
+ var translations = await AIMEAT.data.get('{{service_slug}}.i18n.' + locale) || {};
1414
+ \\\`\\\`\\\`
1415
+ NEVER use empty translations {}. ALWAYS load them with the call above.
1416
+ NEVER read from ext: namespace — translations are in the OWNER namespace.
1417
+
1418
+ ## Translation Helper
1419
+ Use a t() function for all user-visible text:
1420
+ \\\`\\\`\\\`javascript
1421
+ function t(key, translations, vars) {
1422
+ if (!key || !translations) return key || '';
1423
+ var str = translations[key] != null ? translations[key] : key;
1424
+ if (vars && typeof str === 'string') {
1425
+ Object.keys(vars).forEach(function(k) {
1426
+ str = str.replace('$\\{' + k + '}', vars[k]);
1427
+ });
1428
+ }
1429
+ return str;
1430
+ }
1431
+ \\\`\\\`\\\`
1432
+
1433
+ ## Nested Object Helper
1434
+ API responses contain nested objects. Use this to safely render values:
1435
+ \\\`\\\`\\\`javascript
1436
+ function dv(val) {
1437
+ if (val == null) return '-';
1438
+ if (typeof val === 'string' || typeof val === 'number' || typeof val === 'boolean') return String(val);
1439
+ if (val.value) return val.value;
1440
+ if (val.url) return val.url;
1441
+ if (val.name) return val.name;
1442
+ if (Array.isArray(val)) return val.map(dv).join(', ');
1443
+ return JSON.stringify(val);
1444
+ }
1445
+ \\\`\\\`\\\`
1446
+
1447
+ ## Output Format
1448
+
1449
+ Return TWO separate, properly tagged code blocks.
1450
+ CRITICAL: Use \\\`\\\`\\\`yaml for the manifest and \\\`\\\`\\\`javascript for the library code.
1451
+
1452
+ First block — YAML manifest:
1453
+ \\\`\\\`\\\`yaml
1454
+ apiVersion: cortex.aimeat.org/v1
1455
+ kind: Extension
1456
+ metadata:
1457
+ name: kebab-case-feature-name
1458
+ namespace: community
1459
+ description: "Feature description"
1460
+ author: generator
1461
+ tags: [feature, domain-tag]
1462
+ labels:
1463
+ domain: specific-domain
1464
+ spec:
1465
+ version: "1.0.0"
1466
+ license: MIT
1467
+ components:
1468
+ - type: lib
1469
+ name: kebab-case-feature-name
1470
+ filename: kebab-case-feature-name.js
1471
+ exports: [render]
1472
+ api_surface: |
1473
+ AIMEAT.featureLib.render(container) — Renders the feature UI into the given DOM element
1474
+ \\\`\\\`\\\`
1475
+
1476
+ Second block — JavaScript library:
1477
+ \\\`\\\`\\\`javascript
1478
+ (function (AIMEAT) {
1479
+ 'use strict';
1480
+ const LIB_NAME = 'featureLib'; // camelCase
1481
+ // Use daisyUI classes for all UI: class="card", class="table", class="btn", etc.
1482
+ // DaisyUI + Tailwind CSS is loaded on the page.
1483
+ // ... render(container) implementation
1484
+ var exports = { render: render };
1485
+ if (AIMEAT.register) AIMEAT.register(LIB_NAME, exports);
1486
+ AIMEAT[LIB_NAME] = exports;
1487
+ })(window.AIMEAT || (window.AIMEAT = {}));
1488
+ \\\`\\\`\\\``,
1489
+ variables: ['disclaimer', 'label', 'spec_section', 'use_case', 'view_section', 'structures', 'data_cortex_api', 'translation_section', 'service_slug', 'platform_ui_section'],
1490
+ usedIn: ['generator-autopilot', 'generator-ui'],
1491
+ },
1492
+ {
1493
+ id: 'gen-cortex-app-domain',
1494
+ group: 'generator',
1495
+ name: 'App-Domain Cortex Generator',
1496
+ description: 'App-domain cortex — composition layer combining all features + auth + translations.',
1497
+ content: `{{disclaimer}}
1498
+ Create an App-Domain Cortex for: {{label}}
1499
+
1500
+ Project: {{project_description}}
1501
+
1502
+ {{spec_section}}
1503
+
1504
+ ## Goal
1505
+
1506
+ Build the top-level cortex library that the APP will use. It composes:
1507
+ 1. All feature cortex components (renders them into containers)
1508
+ 2. Auth initialization (AIMEAT.auth)
1509
+ 3. Translation loading and management
1510
+ 4. Settings management
1511
+ 5. Navigation support
1512
+
1513
+ The app loads ONLY this cortex. This cortex provides everything the app needs.
1514
+
1515
+ ## Feature Cortex Components (compose these)
1516
+ {{feature_apis}}
1517
+
1518
+ {{platform_layout_section}}
1519
+
1520
+ ## Data Cortex
1521
+ {{data_cortex_section}}
1522
+
1523
+ ## Translation Keys Available
1524
+ {{translation_keys}}
1525
+
1526
+ ## Methods to Export
1527
+
1528
+ - **init()** — Initialize auth, load translations, check data readiness. Returns { ready: boolean, authenticated: boolean }.
1529
+ - **render(container)** — Render the full application UI into the container. Sets up navigation, renders feature views.
1530
+ - **getTranslations(locale)** — Load translation strings for a locale. Returns the translation object.
1531
+ - **t(key, vars)** — Translate a key with optional variable interpolation. Uses loaded translations.
1532
+ - **switchLocale(locale)** — Change language, reload translations, re-render.
1533
+
1534
+ ## Auth Pattern
1535
+ \\\`\\\`\\\`javascript
1536
+ // Restore session from storage (MUST call login() first — getSession() alone returns null)
1537
+ var session = await AIMEAT.auth.login();
1538
+ if (!session) {
1539
+ // No stored session — show login button
1540
+ // mountLoginButton takes a CSS SELECTOR string, not a DOM element
1541
+ // Give the container an ID first, then pass the selector
1542
+ container.id = container.id || 'app-auth';
1543
+ AIMEAT.auth.mountLoginButton('#' + container.id);
1544
+ return { ready: false, authenticated: false };
1545
+ }
1546
+ \\\`\\\`\\\`
1547
+
1548
+ ## Translation Pattern
1549
+ \\\`\\\`\\\`javascript
1550
+ // Load translations — try service-prefixed key first, then plain key
1551
+ async function loadTranslations(locale) {
1552
+ try {
1553
+ // Translations are stored in the OWNER namespace by the translation component
1554
+ // Key format: {{service_slug}}.i18n.LOCALE (dots throughout)
1555
+ return await AIMEAT.data.get('{{service_slug}}.i18n.' + locale)
1556
+ || await AIMEAT.data.get('i18n.' + locale)
1557
+ || {};
1558
+ } catch (e) { return {}; }
1559
+ }
1560
+
1561
+ // Translate with interpolation
1562
+ function t(key, vars) {
1563
+ var str = translations[key] || key;
1564
+ if (vars) {
1565
+ Object.keys(vars).forEach(function(k) {
1566
+ str = str.replace('$\\{' + k + '}', vars[k]);
1567
+ });
1568
+ }
1569
+ return str;
1570
+ }
1571
+ \\\`\\\`\\\`
1572
+
1573
+ ## Output Format
1574
+
1575
+ Return TWO separate, properly tagged code blocks.
1576
+ CRITICAL: Use \\\`\\\`\\\`yaml for the manifest and \\\`\\\`\\\`javascript for the library code.
1577
+
1578
+ First block — YAML manifest:
1579
+ \\\`\\\`\\\`yaml
1580
+ apiVersion: cortex.aimeat.org/v1
1581
+ kind: Extension
1582
+ metadata:
1583
+ name: kebab-case-app-name
1584
+ namespace: community
1585
+ description: "App-domain cortex description"
1586
+ author: generator
1587
+ tags: [app, domain-tag]
1588
+ labels:
1589
+ domain: specific-domain
1590
+ spec:
1591
+ version: "1.0.0"
1592
+ license: MIT
1593
+ components:
1594
+ - type: lib
1595
+ name: kebab-case-app-name
1596
+ filename: kebab-case-app-name.js
1597
+ exports: [init, render, t, switchLocale, getTranslations]
1598
+ api_surface: |
1599
+ AIMEAT.appLib.init() — Initialize auth, load translations. Returns { ready, authenticated }
1600
+ AIMEAT.appLib.render(container) — Render the full application into DOM container
1601
+ AIMEAT.appLib.t(key, vars) — Translate with interpolation
1602
+ AIMEAT.appLib.switchLocale(locale) — Change language and re-render
1603
+ AIMEAT.appLib.getTranslations(locale) — Load translations for locale
1604
+ \\\`\\\`\\\`
1605
+
1606
+ Second block — JavaScript library. ADAPT this working template — change view definitions, component names, navigation labels to match the spec. Keep the structure intact.
1607
+ \\\`\\\`\\\`javascript
1608
+ {{app_domain_template}}
1609
+ \\\`\\\`\\\`
1610
+
1611
+ CRITICAL: The header (AIMEAT logo, sign in) is NOT your responsibility. It is provided by the page shell.
1612
+ Your render(container) receives a div#app — render your navigation + views INTO that container.
1613
+ Use ONLY the EXACT translation keys from the Translation Keys section. Do NOT invent shortened keys like "nav.search" — use "app.nav.search".`,
1614
+ variables: ['disclaimer', 'label', 'project_description', 'spec_section', 'feature_apis', 'data_cortex_section', 'translation_keys', 'service_slug', 'platform_layout_section', 'app_domain_template'],
1615
+ usedIn: ['generator-autopilot', 'generator-ui'],
1616
+ },
1617
+ {
1618
+ id: 'gen-app',
1619
+ group: 'generator',
1620
+ name: 'App HTML Generator',
1621
+ description: 'Complete HTML app — loads cortex libraries via app-domain cortex.',
1622
+ content: `{{context}}
1623
+
1624
+ Create an AIMEAT App (HTML page) for: {{label}}
1625
+
1626
+ {{project_context}}
1627
+
1628
+ ## Architecture
1629
+
1630
+ The app is a simple HTML page that:
1631
+ 1. Loads DaisyUI + Tailwind CSS (styling)
1632
+ 2. Loads AIMEAT auth + data libraries
1633
+ 3. Loads all cortex libraries (data, components, app-domain)
1634
+ 4. Has an AIMEAT header (logo + morselit + sign in) — FIXED, not part of app logic
1635
+ 5. Has a div#app where the app-domain cortex renders
1636
+
1637
+ The app-domain cortex handles ALL application logic (views, navigation, translations).
1638
+ The app page just loads libraries and calls init() + render().
1639
+
1640
+ {{cortex_or_api_section}}
1641
+
1642
+ ## Output: Complete HTML file
1643
+
1644
+ Return a complete HTML file using this EXACT structure. ADAPT only the marked sections.
1645
+
1646
+ \\\`\\\`\\\`html
1647
+ <!-- AIMEAT App Manifest
1648
+ name: {{app_name}}
1649
+ version: 1.0.0
1650
+ description: {{app_description}}
1651
+ entry: index.html
1652
+ -->
1653
+ <!DOCTYPE html>
1654
+ <html lang="{{app_locale}}" data-theme="{{app_theme}}">
1655
+ <head>
1656
+ <meta charset="UTF-8">
1657
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
1658
+ <title>{{app_title}}</title>
1659
+ <meta http-equiv="Content-Security-Policy" content="
1660
+ default-src 'self';
1661
+ script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net;
1662
+ style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net;
1663
+ img-src 'self' data: https: blob:;
1664
+ connect-src 'self';
1665
+ ">
1666
+ <link href="https://cdn.jsdelivr.net/npm/daisyui@5" rel="stylesheet" type="text/css" />
1667
+ <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
1668
+ </head>
1669
+ <body class="bg-base-100 min-h-screen flex flex-col">
1670
+
1671
+ <!-- AIMEAT Header — DO NOT MODIFY -->
1672
+ <nav class="navbar bg-base-200 shadow-sm px-4">
1673
+ <div class="flex-1 gap-4">
1674
+ <span class="text-lg font-bold">AIME<span style="color:#E8564A">&#9829;</span>AT</span>
1675
+ <span id="morsel-display" class="text-xs opacity-60"></span>
1676
+ </div>
1677
+ <div class="flex-none gap-2">
1678
+ <span id="header-auth"></span>
1679
+ </div>
1680
+ </nav>
1681
+
1682
+ <!-- App area — app-domain cortex renders here -->
1683
+ <div id="app" class="flex-1"></div>
1684
+
1685
+ <!-- Error collector (diagnostics) -->
1686
+ <script>
1687
+ (function() {
1688
+ var errors = [];
1689
+ window.onerror = function(msg, src, line) {
1690
+ errors.push(new Date().toISOString().slice(11,19) + ' ' + msg + ' (' + src + ':' + line + ')');
1691
+ showErrors();
1692
+ };
1693
+ window.addEventListener('unhandledrejection', function(e) {
1694
+ errors.push(new Date().toISOString().slice(11,19) + ' ' + String(e.reason));
1695
+ showErrors();
1696
+ });
1697
+ function showErrors() {
1698
+ var el = document.getElementById('app-errors');
1699
+ if (!el) { el = document.createElement('div'); el.id = 'app-errors'; el.style.cssText = 'position:fixed;bottom:0;left:0;right:0;background:#1a0000;color:#ff6b6b;font-size:12px;padding:8px 12px;max-height:120px;overflow:auto;z-index:9999;font-family:monospace;border-top:2px solid #ff4444'; document.body.appendChild(el); }
1700
+ el.innerHTML = errors.join('<br>');
1701
+ }
1702
+ })();
1703
+ </script>
1704
+
1705
+ <!-- Load AIMEAT libraries -->
1706
+ <script>
1707
+ function loadScript(src) {
1708
+ return new Promise(function(resolve, reject) {
1709
+ var s = document.createElement('script');
1710
+ s.src = src; s.onload = resolve; s.onerror = reject;
1711
+ document.head.appendChild(s);
1712
+ });
1713
+ }
1714
+
1715
+ async function boot() {
1716
+ try {
1717
+ await loadScript('/v1/libs/aimeat-auth.js');
1718
+ await loadScript('/v1/libs/aimeat-data.js');
1719
+ {{cortex_script_loads}}
1720
+
1721
+ // Mount sign-in button in header
1722
+ AIMEAT.auth.mountLoginButton('#header-auth', {
1723
+ onLogin: function() { startApp(); },
1724
+ onLogout: function() { location.reload(); }
1725
+ });
1726
+
1727
+ // Try to restore session
1728
+ var session = await AIMEAT.auth.login();
1729
+ if (session) {
1730
+ // CRITICAL: Set AIMEAT.session so cortex libraries can use session.fetch()
1731
+ AIMEAT.session = session;
1732
+ startApp();
1733
+ }
1734
+
1735
+ // Show morsel balance
1736
+ if (session) {
1737
+ try {
1738
+ var wallet = await session.fetch('/v1/wallet');
1739
+ if (wallet && wallet.data) {
1740
+ document.getElementById('morsel-display').textContent = wallet.data.balance + ' morsels';
1741
+ }
1742
+ } catch(e) {}
1743
+ }
1744
+ } catch (err) {
1745
+ document.getElementById('app').innerHTML =
1746
+ '<div class="alert alert-error m-4"><span>Failed to load: ' + err.message + '</span></div>';
1747
+ }
1748
+ }
1749
+
1750
+ function startApp() {
1751
+ var appLib = AIMEAT.{{app_domain_lib}};
1752
+ if (!appLib) {
1753
+ document.getElementById('app').innerHTML =
1754
+ '<div class="alert alert-error m-4"><span>App-domain cortex not loaded</span></div>';
1755
+ return;
1756
+ }
1757
+ appLib.init().then(function() {
1758
+ appLib.render(document.getElementById('app'));
1759
+ });
1760
+ }
1761
+
1762
+ boot();
1763
+ </script>
1764
+ </body>
1765
+ </html>
1766
+ \\\`\\\`\\\`
1767
+
1768
+ ## Rules
1769
+ - DO NOT modify the AIMEAT header — it is fixed
1770
+ - DO NOT add manual token/URL configuration — auth library handles everything
1771
+ - ALL API paths MUST be relative (start with /)
1772
+ - Use vanilla JS (no build step)
1773
+ - The app-domain cortex handles ALL application logic — the HTML page just loads libraries and boots
1774
+ {{cortex_rules}}
1775
+ {{html_entity_rules}}`,
1776
+ variables: ['context', 'label', 'project_context', 'cortex_script_loads', 'cortex_or_api_section', 'cortex_rules', 'html_entity_rules', 'app_name', 'app_description', 'app_title', 'app_domain_lib', 'app_locale', 'app_theme'],
1777
+ usedIn: ['generator-autopilot', 'generator-ui'],
1778
+ },
1779
+ {
1780
+ id: 'gen-test-cortex-spec',
1781
+ group: 'generator',
1782
+ name: 'Cortex Test (from Spec)',
1783
+ description: 'Browser-side cortex test — 6-step quality pattern, golden samples, full example.',
1784
+ content: `{{disclaimer}}You are generating TEST CODE for a CORTEX LIBRARY in an AIMEAT service.
1785
+
1786
+ ## Component Under Test
1787
+ - Type: cortex
1788
+ - Label: {{lib_name}}
1789
+ - Registered as: {{wraps_extension}}
1790
+
1791
+ {{cortex_methods}}
1792
+
1793
+ ## CRITICAL: What to Test and What NOT to Test
1794
+
1795
+ ╔══════════════════════════════════════════════════════════════════════════╗
1796
+ ║ Test ONLY the cortex library methods listed above. ║
1797
+ ║ Access them via: window.AIMEAT.{{lib_name}}.methodName(params) ║
1798
+ ║ ║
1799
+ ║ Do NOT call init(), checkChanges(), or any scheduled/bootstrap actions. ║
1800
+ ║ Do NOT use callExt(), readExtMemory(), or testFetch() — these do NOT ║
1801
+ ║ exist in the browser test page. ║
1802
+ ║ Do NOT call extension actions directly — only call cortex methods. ║
1803
+ ║ ║
1804
+ ║ Every method takes a SINGLE OBJECT parameter: lib.search({query: '...'})║
1805
+ ║ NEVER use positional params: lib.search('...') is WRONG. ║
1806
+ ╚══════════════════════════════════════════════════════════════════════════╝
1807
+
1808
+ {{golden_samples}}{{test_scenarios}}
1809
+ ## Data Structures (from blueprint — test against THESE shapes)
1810
+ {{structures}}
1811
+
1812
+ ## Cortex Action Contracts (test THESE methods with THESE shapes)
1813
+ {{action_contracts}}
1814
+
1815
+ {{project_context}}
1816
+
1817
+ ## Test Environment: Browser (page.evaluate sandbox)
1818
+
1819
+ CRITICAL SANDBOX RULES — violating ANY will crash the test:
1820
+ - NO import/require/export statements
1821
+ - Your code runs inside page.evaluate() in a real browser page
1822
+ - You have access to: window, document, fetch, DOM APIs
1823
+ - Set results on: window.__testResults = { passed: boolean, errors: string[], details: string }
1824
+
1825
+ For CORTEX tests:
1826
+ - The cortex library is already loaded on the test page
1827
+ - Access it via: window.AIMEAT.{{lib_name}}
1828
+ - Authentication IS available — session.fetch() works
1829
+
1830
+ ## QUALITY REQUIREMENTS (MANDATORY)
1831
+
1832
+ Every test MUST follow this pattern for EVERY API call:
1833
+
1834
+ 1. **Call** — invoke the method with real, meaningful parameters as an OBJECT: \\\`lib.methodName({key: value})\\\`
1835
+ 2. **Log** — log the FULL response: \\\`log('method returned: ' + JSON.stringify(result))\\\`
1836
+ 3. **Assert not null** — \\\`if (result === null) fail('method: got null')\\\`
1837
+ 4. **Assert shape** — check specific field names and types from the cortex code
1838
+ 5. **Assert values** — for external APIs, verify arrays have length > 0, objects have expected fields
1839
+ 6. **Verify side effects** — after writes, READ BACK and check the data is there
1840
+
1841
+ NEVER do this:
1842
+ \\\`\\\`\\\`
1843
+ if (result === null) log('returned null (expected without auth)'); // WRONG — auth IS available
1844
+ \\\`\\\`\\\`
1845
+
1846
+ ALWAYS do this:
1847
+ \\\`\\\`\\\`
1848
+ if (result === null) fail('method: returned null — should return data');
1849
+ if (!result.items) fail('method: missing items field');
1850
+ if (!Array.isArray(result.items)) fail('method: items should be array');
1851
+ log('method returned: ' + JSON.stringify(result));
1852
+ \\\`\\\`\\\`
1853
+
1854
+ ## CORTEX TEST EXAMPLE (follow this pattern exactly)
1855
+
1856
+ \\\`\\\`\\\`javascript
1857
+ // ALWAYS declare results and helpers FIRST, before any checks
1858
+ const results = { passed: false, errors: [], details: '' };
1859
+ const log = (msg) => { results.details += msg + '\\n'; };
1860
+ const fail = (msg) => { results.errors.push(msg); log('FAIL: ' + msg); };
1861
+ const pass = (msg) => { log('PASS: ' + msg); };
1862
+
1863
+ const lib = window.AIMEAT.myDomainLib;
1864
+ if (!lib) { fail('Library not loaded'); window.__testResults = results; return; }
1865
+
1866
+ // 1. SEARCH — verify real API data comes back (object params!)
1867
+ const searchResult = await lib.search({query: 'test'});
1868
+ log('search returned: ' + JSON.stringify(searchResult));
1869
+ if (!searchResult) fail('search: returned null');
1870
+ else if (!Array.isArray(searchResult.items)) fail('search: items should be array');
1871
+ else if (searchResult.items.length === 0) fail('search: got empty results for known query');
1872
+ else pass('search: got ' + searchResult.items.length + ' results');
1873
+
1874
+ // 2. GET — verify single item retrieval
1875
+ const item = await lib.getItem({id: searchResult.items[0].id});
1876
+ log('getItem returned: ' + JSON.stringify(item));
1877
+ if (!item) fail('getItem: returned null');
1878
+ else pass('getItem: returned item');
1879
+
1880
+ // 3. WRITE — add item, then READ BACK to verify
1881
+ const addResult = await lib.addItem({id: 'test-id', name: 'Test Name'});
1882
+ log('addItem returned: ' + JSON.stringify(addResult));
1883
+ if (!addResult) fail('addItem: returned null');
1884
+ else pass('addItem: succeeded');
1885
+
1886
+ // 3b. READ BACK — verify the item was actually saved
1887
+ const listAfterAdd = await lib.getItems();
1888
+ log('getItems after add: ' + JSON.stringify(listAfterAdd));
1889
+ if (!listAfterAdd || !Array.isArray(listAfterAdd)) fail('getItems: returned null after add');
1890
+ else {
1891
+ const found = listAfterAdd.find(i => i.id === 'test-id');
1892
+ if (!found) fail('addItem: item not found in list after add');
1893
+ else pass('addItem: item persisted and readable');
1894
+ }
1895
+
1896
+ // 4. DELETE — remove item, then READ BACK to verify
1897
+ const removeResult = await lib.removeItem({id: 'test-id'});
1898
+ log('removeItem returned: ' + JSON.stringify(removeResult));
1899
+ if (!removeResult) fail('removeItem: returned null');
1900
+
1901
+ // 4b. READ BACK — verify removal
1902
+ const listAfterRemove = await lib.getItems();
1903
+ log('getItems after remove: ' + JSON.stringify(listAfterRemove));
1904
+ if (listAfterRemove && Array.isArray(listAfterRemove)) {
1905
+ const stillThere = listAfterRemove.find(i => i.id === 'test-id');
1906
+ if (stillThere) fail('removeItem: item still in list after remove');
1907
+ else pass('removeItem: item removed successfully');
1908
+ }
1909
+
1910
+ window.__testResults = results;
1911
+ \\\`\\\`\\\`
1912
+
1913
+ Apply this EXACT pattern to the component under test. Use the actual method names and field names from the component code.
1914
+
1915
+ ## Output Rules
1916
+ 1. Return ONLY executable JavaScript code — NO markdown fences, NO explanation text
1917
+ 2. NO import/require/export — sandbox environment
1918
+ 3. Your code runs INSIDE an existing async function. Write sequential statements starting with variable declarations. The runtime already provides the async wrapper — write bare statements like \\\`const results = {...};\\\` not \\\`(async () => {...})()\\\`
1919
+ 4. Set window.__testResults = { passed, errors, details } as the LAST statement`,
1920
+ variables: ['disclaimer', 'lib_name', 'wraps_extension', 'golden_samples', 'test_scenarios', 'structures', 'action_contracts', 'project_context', 'cortex_methods'],
1921
+ usedIn: ['generator-autopilot'],
1922
+ },
1923
+ {
1924
+ id: 'gen-test-cortex-component',
1925
+ group: 'generator',
1926
+ name: 'Component Cortex Test (render)',
1927
+ description: 'Browser-side test for component cortexes — tests render(), DOM output, interactions.',
1928
+ content: `{{disclaimer}}You are generating TEST CODE for a UI COMPONENT CORTEX in an AIMEAT service.
1929
+
1930
+ ## Component Under Test
1931
+ - Type: cortex (component)
1932
+ - Label: {{component_label}}
1933
+ - Registered as: {{registered_as}}
1934
+ - Library: window.AIMEAT.{{lib_name}}
1935
+
1936
+ ## What This Component Does
1937
+ This is a UI COMPONENT — it exports render(container, props) that creates DOM elements.
1938
+ It does NOT export data methods like searchCompanies or getWatchlist.
1939
+ Those belong to the DATA CORTEX (a separate library).
1940
+
1941
+ {{spec_section}}
1942
+
1943
+ ## Data Cortex Available on Test Page
1944
+ {{data_cortex_info}}
1945
+
1946
+ {{project_context}}
1947
+
1948
+ ## Test Environment: Browser (page.evaluate sandbox)
1949
+
1950
+ CRITICAL SANDBOX RULES:
1951
+ - NO import/require/export statements
1952
+ - Your code runs inside page.evaluate() in a real browser page
1953
+ - You have access to: window, document, fetch, DOM APIs
1954
+ - Set results on: window.__testResults = { passed: boolean, errors: string[], details: string }
1955
+
1956
+ The component library AND the data cortex library are both loaded on the test page.
1957
+ Authentication IS available — the data cortex methods work.
1958
+
1959
+ ## Working Test Template
1960
+
1961
+ Below is a WORKING test with pre-filled values. The scaffolding is correct — do NOT rewrite it.
1962
+
1963
+ ADAPT only the sections marked with // ADAPT:
1964
+ 1. Data fetch — call the right data cortex method with real params
1965
+ 2. Render props — pass the right props to render()
1966
+ 3. DOM checks — verify component-specific content appears
1967
+
1968
+ You MAY modify other parts if needed, but do NOT remove:
1969
+ - window.__testResults assignment
1970
+ - window.__renderSnapshot capture
1971
+ - The 3-second async wait
1972
+ - The results/log/fail/pass scaffolding
1973
+
1974
+ \\\`\\\`\\\`javascript
1975
+ {{test_template}}
1976
+ \\\`\\\`\\\`
1977
+
1978
+ Return the ADAPTED version of this template. Keep all scaffolding intact.
1979
+
1980
+ ## Output Rules
1981
+ 1. Return ONLY executable JavaScript code — NO markdown fences, NO explanation text
1982
+ 2. NO import/require/export — sandbox environment
1983
+ 3. Your code runs INSIDE an existing async function. Write sequential statements starting with variable declarations.
1984
+ 4. BEFORE calling destroy(), capture the rendered HTML: window.__renderSnapshot = container.innerHTML;
1985
+ 5. Set window.__testResults = { passed, errors, details } as the LAST statement`,
1986
+ variables: ['disclaimer', 'component_label', 'registered_as', 'lib_name', 'spec_section', 'data_cortex_info', 'project_context', 'test_template'],
1987
+ usedIn: ['generator-autopilot'],
1988
+ },
1989
+ {
1990
+ id: 'gen-test-cortex-app-domain',
1991
+ group: 'generator',
1992
+ name: 'App-Domain Cortex Test (init + render)',
1993
+ description: 'Browser-side test for app-domain cortex — tests init(), render(), navigation.',
1994
+ content: `{{disclaimer}}You are generating TEST CODE for an APP-DOMAIN CORTEX in an AIMEAT service.
1995
+
1996
+ ## Component Under Test
1997
+ - Type: cortex (app-domain)
1998
+ - Label: {{component_label}}
1999
+ - Registered as: {{registered_as}}
2000
+ - Library: window.AIMEAT.{{lib_name}}
2001
+
2002
+ ## What This Component Does
2003
+ This is the APP-DOMAIN CORTEX — the top-level composition layer. It exports:
2004
+ - init() — initializes auth, loads translations, returns readiness status
2005
+ - render(container) — renders the full application UI with navigation
2006
+
2007
+ It composes all feature component cortexes into a complete application.
2008
+
2009
+ {{spec_section}}
2010
+
2011
+ ## Feature Components Available
2012
+ {{feature_components}}
2013
+
2014
+ ## Data Cortex Available
2015
+ {{data_cortex_info}}
2016
+
2017
+ {{project_context}}
2018
+
2019
+ ## Test Environment: Browser (page.evaluate sandbox)
2020
+
2021
+ CRITICAL SANDBOX RULES:
2022
+ - NO import/require/export statements
2023
+ - Your code runs inside page.evaluate() in a real browser page
2024
+ - You have access to: window, document, fetch, DOM APIs
2025
+ - Set results on: window.__testResults = { passed: boolean, errors: string[], details: string }
2026
+
2027
+ ALL cortex libraries (data, components, app-domain) are loaded on the test page.
2028
+ Authentication IS available.
2029
+
2030
+ ## Working Test Template
2031
+
2032
+ Below is a WORKING test with pre-filled values. ADAPT only the sections marked // ADAPT.
2033
+
2034
+ Do NOT remove: window.__testResults, window.__renderSnapshot, results scaffolding, async waits.
2035
+
2036
+ \\\`\\\`\\\`javascript
2037
+ {{test_template}}
2038
+ \\\`\\\`\\\`
2039
+
2040
+ Return the ADAPTED version of this template. Keep all scaffolding intact.
2041
+
2042
+ ## Output Rules
2043
+ 1. Return ONLY executable JavaScript code — NO markdown fences, NO explanation text
2044
+ 2. NO import/require/export — sandbox environment
2045
+ 3. Your code runs INSIDE an existing async function. Write sequential statements starting with variable declarations.
2046
+ 4. BEFORE cleanup, capture rendered HTML: window.__renderSnapshot = container.innerHTML;
2047
+ 5. Set window.__testResults = { passed, errors, details } as the LAST statement`,
2048
+ variables: ['disclaimer', 'component_label', 'registered_as', 'lib_name', 'spec_section', 'feature_components', 'data_cortex_info', 'project_context', 'test_template'],
2049
+ usedIn: ['generator-autopilot'],
2050
+ },
2051
+ // ── App spec prompt ──
2052
+ {
2053
+ id: 'gen-app-spec',
2054
+ group: 'generator',
2055
+ name: 'App Spec Generator',
2056
+ description: 'Generates app spec — defines app shell, dependencies, theme, locale.',
2057
+ content: `{{disclaimer}}
2058
+
2059
+ # Task: Generate App Spec
2060
+
2061
+ Define the configuration for an AIMEAT App (HTML page).
2062
+
2063
+ ## App: {{component_label}}
2064
+ {{project_description}}
2065
+
2066
+ ## Available Cortex Libraries
2067
+ {{cortex_dependencies}}
2068
+
2069
+ ## Output Format
2070
+ Return ONLY valid JSON:
2071
+ {
2072
+ "name": "<kebab-case app name>",
2073
+ "title": "<human-readable title>",
2074
+ "description": "<one-line description>",
2075
+ "appDomainLib": "<camelCase JS lib name of the app-domain cortex — copy EXACTLY from the list above>",
2076
+ "cortexDependencies": ["<ordered list of cortex registeredAs names to load via script tags>"],
2077
+ "daisyTheme": "<light | dark | cupcake | business | forest | etc.>",
2078
+ "locale": "<default locale: fi | en | etc.>"
2079
+ }
2080
+
2081
+ ## Rules
2082
+ 1. name MUST be ASCII kebab-case.
2083
+ 2. appDomainLib: find the app-domain cortex in the list above, copy its JS lib name EXACTLY.
2084
+ 3. cortexDependencies: list ALL cortex registeredAs names. Order: data first, components, app-domain last.
2085
+ 4. daisyTheme: pick a daisyUI theme. "light" is safe default.`,
2086
+ variables: ['disclaimer', 'component_label', 'project_description', 'cortex_dependencies'],
2087
+ usedIn: ['generator-autopilot', 'generator-ui'],
2088
+ },
2089
+ // ── App test prompt ──
2090
+ {
2091
+ id: 'gen-test-app',
2092
+ group: 'generator',
2093
+ name: 'App Test (HTML page)',
2094
+ description: 'Browser-side test for generated HTML apps — tests page loads, auth works, UI renders.',
2095
+ content: `{{disclaimer}}You are generating TEST CODE for an AIMEAT APP (HTML page).
2096
+
2097
+ ## App Under Test
2098
+ - Label: {{component_label}}
2099
+ - Type: app (HTML page)
2100
+
2101
+ {{project_context}}
2102
+
2103
+ ## Test Environment: Browser (page.evaluate sandbox)
2104
+
2105
+ The app HTML page is loaded in a browser. All cortex libraries are available.
2106
+ Authentication IS available — the user is logged in.
2107
+
2108
+ ## Working Test Template
2109
+
2110
+ \\\`\\\`\\\`javascript
2111
+ {{test_template}}
2112
+ \\\`\\\`\\\`
2113
+
2114
+ Keep the template AS-IS. Do NOT add checks for individual components (hakukentta, yrityskortti, etc.) — those have their own tests. This test ONLY verifies that the app shell loads and renders.
2115
+
2116
+ ## Output Rules
2117
+ 1. Return ONLY executable JavaScript code — NO markdown fences
2118
+ 2. NO import/require/export — sandbox environment
2119
+ 3. Do NOT test individual component rendering — only test init(), render(), and overall DOM output
2120
+ 4. Set window.__testResults as the LAST statement`,
2121
+ variables: ['disclaimer', 'component_label', 'project_context', 'test_template'],
2122
+ usedIn: ['generator-autopilot'],
2123
+ },
2124
+ // ── Blueprint & Interview prompts (migrated from browser JS) ──
2125
+ {
2126
+ id: 'gen-blueprint',
2127
+ group: 'generator',
2128
+ name: 'Blueprint Generator',
2129
+ description: 'Generates component blueprint from project description + interview spec.',
2130
+ content: `{{disclaimer}}{{context}}
2131
+
2132
+ The user wants to create this service:
2133
+ ---
2134
+ {{description}}
2135
+ ---
2136
+ {{interview_spec_section}}{{language_note}}{{cortex_catalog}}
2137
+ Analyze this request and produce a JSON blueprint listing ALL components needed.
2138
+
2139
+ CRITICAL: Return ONLY a JSON object with "service_slug", "architecture", "components", "phases", "dataModel", and optionally "settings" and "testScenarios". Nothing else.
2140
+ "service_slug" is a kebab-case identifier for this service (e.g., "company-registry", "weather-monitor"). ALL components use this SAME slug for memory keys, translation keys, and cortex naming. Derive it from the project name.
2141
+ Each component has these fields: "id", "type", "label", "produces", "consumes". Extension components may also have "schedules".
2142
+ Do NOT include manifest content, code, HTML, translations, or any implementation details.
2143
+ The blueprint is a lightweight plan — actual content is generated later per component.
2144
+
2145
+ Format:
2146
+ {
2147
+ "service_slug": "my-service",
2148
+ "architecture": "cortex-modular",
2149
+ "components": [
2150
+ { "id": "csm-1", "type": "csm", "label": "Human-readable name", "produces": ["memory:service.schema"], "consumes": [] },
2151
+ { "id": "memory-1", "type": "memory", "label": "Human-readable name", "produces": ["memory:settings.config"], "consumes": [] },
2152
+ { "id": "translation-1", "type": "translation", "label": "Human-readable name (fi)", "produces": ["memory:i18n.fi"], "consumes": [] },
2153
+ { "id": "translation-2", "type": "translation", "label": "Human-readable name (en)", "produces": ["memory:i18n.en"], "consumes": [] },
2154
+ { "id": "ext-1", "type": "extension", "label": "Human-readable name", "produces": ["memory:items.*"], "consumes": ["memory:settings.config"], "schedules": [{"action":"init","cron":"@activate"},{"action":"collect","cron":"0 2 * * *"}] },
2155
+ { "id": "cortex-data", "type": "cortex", "subtype": "data", "label": "Data layer", "produces": ["api:getData", "api:search", "api:addItem", "api:removeItem"], "consumes": ["memory:items.*", "memory:settings.config"], "uses": [] },
2156
+ { "id": "component-item-card", "type": "cortex", "subtype": "component", "label": "Item Card", "produces": ["ui:item-card"], "consumes": ["api:getData"], "uses": ["aimeat-ui-viewers"] },
2157
+ { "id": "component-search-input", "type": "cortex", "subtype": "component", "label": "Search Input", "produces": ["ui:search-input"], "consumes": ["api:search"], "uses": ["aimeat-ui-forms"] },
2158
+ { "id": "cortex-app", "type": "cortex", "subtype": "app-domain", "label": "App domain", "produces": ["api:init", "api:render"], "consumes": ["ui:item-card", "ui:search-input"], "uses": ["aimeat-ui-nav"] },
2159
+ { "id": "app-1", "type": "app", "label": "Human-readable name", "produces": [], "consumes": ["api:init", "api:render"] }
2160
+ ],
2161
+ "phases": [
2162
+ { "id": "define", "label": "Define Service", "componentIds": ["csm-1"] },
2163
+ { "id": "seed", "label": "Seed Data", "componentIds": ["memory-1", "translation-1", "translation-2"] },
2164
+ { "id": "logic", "label": "Capabilities", "componentIds": ["ext-1"] },
2165
+ { "id": "cortex-data", "label": "Data Layer", "componentIds": ["cortex-data"] },
2166
+ { "id": "components", "label": "UI Components", "componentIds": ["component-item-card", "component-search-input"] },
2167
+ { "id": "cortex-app", "label": "App Domain", "componentIds": ["cortex-app"] },
2168
+ { "id": "ui", "label": "Application", "componentIds": ["app-1"] }
2169
+ ],
2170
+ "dataModel": {
2171
+ "structures": {
2172
+ "Item": {
2173
+ "type": "object",
2174
+ "properties": {
2175
+ "id": { "type": "string" },
2176
+ "title": { "type": "string" },
2177
+ "status": { "type": "string" },
2178
+ "createdAt": { "type": "string", "description": "ISO 8601" }
2179
+ }
2180
+ },
2181
+ "SearchResult": {
2182
+ "type": "object",
2183
+ "properties": {
2184
+ "totalResults": { "type": "number" },
2185
+ "items": { "type": "array", "items": { "$ref": "Item" } }
2186
+ }
2187
+ }
2188
+ },
2189
+ "memoryKeys": {
2190
+ "settings.config": {
2191
+ "type": "object",
2192
+ "properties": { "locale": { "type": "string" }, "refreshHours": { "type": "number" } },
2193
+ "source": "config",
2194
+ "producedBy": "memory-1",
2195
+ "consumedBy": ["ext-1", "cortex-data"]
2196
+ },
2197
+ "items.data": {
2198
+ "type": "array",
2199
+ "items": { "$ref": "Item" },
2200
+ "source": "external",
2201
+ "producedBy": "ext-1",
2202
+ "consumedBy": ["cortex-data"]
2203
+ }
2204
+ },
2205
+ "actions": {
2206
+ "ext:search": { "input": { "query": { "type": "string" } }, "output": { "$ref": "SearchResult" } },
2207
+ "ext:getItem": { "input": { "id": { "type": "string" } }, "output": { "$ref": "Item" } },
2208
+ "ext:addItem": { "input": { "id": { "type": "string" }, "name": { "type": "string" } }, "output": { "$ref": "Item" } },
2209
+ "ext:removeItem": { "input": { "id": { "type": "string" } }, "output": { "type": "boolean" } },
2210
+ "cortex:search": { "input": { "query": { "type": "string" } }, "output": { "$ref": "SearchResult" } },
2211
+ "cortex:getItem": { "input": { "id": { "type": "string" } }, "output": { "$ref": "Item" } },
2212
+ "cortex:addItem": { "input": { "id": { "type": "string" }, "name": { "type": "string" } }, "output": { "$ref": "Item" } },
2213
+ "cortex:removeItem": { "input": { "id": { "type": "string" } }, "output": { "type": "boolean" } }
2214
+ }
2215
+ }
2216
+ }
2217
+
2218
+ CRITICAL RULES for the data model:
2219
+ - Build "structures" from the interview's sampleEntry data — these are the REAL shapes from the verified API response.
2220
+ - Every memory key and every action input/output MUST use "$ref" to reference a structure. This prevents data shape drift between components.
2221
+ - Every "$ref" value MUST match a key in the "structures" object.
2222
+ - Extension actions and cortex actions that pass through the same data MUST reference the SAME structure.
2223
+
2224
+ NOTE: The example above uses GENERIC placeholder names. Replace with domain-specific names from YOUR project. Do NOT copy these placeholder names.
2225
+
2226
+ Rules:
2227
+ - Component types: csm, msm, extension, app, memory, translation, cortex
2228
+ - IDs use format: {type}-{number} (e.g., csm-1, ext-1, app-1). ID prefixes can be short (ext-1) but the "type" field MUST be the full name: "extension" (not "ext").
2229
+ - Each component object has these fields: "id", "type", "label", "produces", "consumes"
2230
+ - Extension components may also have "schedules": array of { "action": "actionId", "cron": "cron-expression" }
2231
+ - Valid cron values: standard 5-field cron syntax OR the special value "@activate"
2232
+ - CRITICAL: cron expressions MUST have exactly 5 fields separated by spaces.
2233
+ CORRECT examples (copy these exactly):
2234
+ "0 2 * * *" ← every day at 02:00
2235
+ "*/15 * * * *" ← every 15 minutes (note: ASTERISK-SLASH-15, not just /15)
2236
+ "10 2 * * *" ← every day at 02:10
2237
+ WRONG: "/15 * * * *" (missing leading asterisk), "0 2 * *" (only 4 fields)
2238
+ Every asterisk character (*) is REQUIRED — do NOT omit them.
2239
+ - "@activate" means: runs on extension activation AND on every server restart. Use for init/bootstrap jobs that populate initial data, verify data integrity, or recover from missed scheduled runs. These MUST be idempotent (safe to run repeatedly).
2240
+ - Use "schedules" for any work that must happen automatically without a browser (data collection, nightly aggregation, periodic computation)
2241
+ - If an extension collects or computes data, it SHOULD have an "@activate" init job that checks for stale/missing data and populates it — this solves the cold-start problem (empty data after first install or server restart)
2242
+ - If an extension has NO scheduled actions, omit the "schedules" field entirely
2243
+ - "produces": array of data outputs (format: "memory:namespace.*" for memory, "api:methodName" for cortex/app)
2244
+ - "consumes": array of data inputs this component reads from
2245
+ - Group components into logical phases
2246
+ - Include ALL components needed for a complete, working service
2247
+ - Cortex components are layered: data cortex phase → feature cortex phase → app-domain cortex phase → app phase
2248
+ - Data cortex: ALL data operations (reads AND writes), wraps extension + AIMEAT platform libraries. Every extension action must have a corresponding cortex api: method — the data cortex is the ONLY gateway, UI components never call the extension directly
2249
+ - Feature cortex: self-contained data+UI per use case, uses data cortex + platform UI cortex libraries
2250
+ - App-domain cortex: composes all features + auth + translations, entry point for app
2251
+ - ALWAYS create at least 3 cortex components: one data, one or more feature, one app-domain
2252
+ - Only include what's actually needed — don't pad with unnecessary components
2253
+ - TRANSLATIONS: Create ONE translation component PER locale. If the spec has locales ["fi", "en"], create translation-1 for fi AND translation-2 for en. NEVER combine multiple locales into one component.
2254
+ - MSM: Only create an MSM if the external API requires authentication, API keys, or complex endpoint configuration. Public URLs (RSS feeds, open APIs, open data) do NOT need an MSM — extensions fetch them directly with ctx.fetch().
2255
+ - MEMORY: Create memory components for (a) static/seed data provided by the user (lookup tables, reference datasets) and (b) default settings/configuration that the service needs on first run. Pre-populating defaults in memory means the app works immediately without hardcoded fallbacks.
2256
+ - MEMORY KEY NAMING: Use consistent namespace prefixes. Standard conventions: "settings.config" for config, "i18n.{locale}" for translations, descriptive namespace for domain data (e.g., "orders.by-date.*", "stats.daily.*", "scores.by-date.*"). Use dot-separated namespaces, not nested objects.
2257
+ - CORTEX: Cortex is the application's brain. It handles data access, UI rendering, business logic, and composition. It can use AIMEAT platform libraries (data, storage, social, wallet) directly. It can render UI components (like aimeat-charts renders charts). Apps use cortex for everything.
2258
+
2259
+ ## dataModel — Domain Data Model (REQUIRED)
2260
+
2261
+ The dataModel is a JSON Schema based map of EVERY memory key in the project. It is the single source of truth — all components reference it to know exact data shapes.
2262
+
2263
+ Rules for dataModel:
2264
+ - One entry per memory key pattern (use YYYY-MM-DD for date-bucketed keys)
2265
+ - Each entry uses JSON Schema (draft 2020-12): type, properties, items, enum, description
2266
+ - "source": one of "static" (user-provided data), "external" (fetched from API/feed), "computed" (calculated by extension), "config" (default settings)
2267
+ - "producedBy": exactly ONE component ID that writes this key
2268
+ - "consumedBy": array of component IDs that read this key
2269
+ - Every memory key referenced in produces/consumes MUST have a dataModel entry
2270
+ - Prefer fewer, larger keys. A lookup table or dataset should be ONE key (array/object), not split per entry.
2271
+ - Include i18n keys (i18n.fi, i18n.en) with source "static" and translation component as producer
2272
+ - CRITICAL: If the interview provides static data in a specific format (e.g., array of {key, value} pairs), the dataModel schema MUST match that exact format. Do NOT redesign the data shape — the memory component will store it as-is.
2273
+ - Enum values: use consistent naming across all components. For computed enums (trends, levels, statuses), use lowercase English: "rising"/"falling"/"steady" for trends, "low"/"medium"/"high"/"critical" for levels. If source data uses locale-specific values, keep those as-is in storage — do NOT translate them. Store what the source provides.
2274
+ - Field names inside stored objects MUST use English camelCase (e.g., "itemCount", "categoryBreakdown", "statusSplit"). This applies even if the source data uses different naming.
2275
+
2276
+ ## Data Pipeline Verification (do this BEFORE listing components)
2277
+
2278
+ ### Step 1: Trace RENDER paths (what data does each view display?)
2279
+ For each VIEW in the spec:
2280
+ 1. What fields does this view need to render?
2281
+ 2. Where does each field come from? (external source, computed, user input)
2282
+ 3. Does the source provide this field directly, or does a component need to transform/enrich it?
2283
+ 4. If a field has no clear path from source to view, add a component that produces it.
2284
+
2285
+ ### Step 2: Trace USER ACTION paths (what can the user DO?)
2286
+ For each USE CASE in the spec:
2287
+ 1. What actions can the user take? (add, remove, save, update, delete, submit)
2288
+ 2. For each action, trace the full path: UI component → cortex-data → extension action
2289
+ 3. Does cortex-data produce an api: method for this action? If not, add it.
2290
+ 4. Does the UI component consume that api: method? If not, add it to consumes.
2291
+ 5. If an extension has a write action but no cortex api: method exposes it, the user cannot reach it — this is a gap.
2292
+
2293
+ Both reads AND writes must have complete paths from UI to extension. If a use case says "add item to list", there must be an api:addItem in cortex-data AND the relevant UI component must consume it.
2294
+
2295
+ ## Component Dependencies
2296
+
2297
+ Each component MUST declare what it produces and consumes:
2298
+ - Extensions produce memory keys (e.g., "memory:items.by-date.*")
2299
+ - Cortex libraries produce API methods (e.g., "api:getItems") and consume memory keys
2300
+ - Apps consume API methods or memory keys
2301
+ - Every "consumes" entry must be matched by a "produces" entry in another component
2302
+
2303
+ ## CRITICAL: Extension vs Cortex vs App — Decision Framework
2304
+
2305
+ ### The One Rule: EXTENSION = SERVER-ONLY WORK
2306
+ An extension MUST do something that a browser CANNOT do. If a browser can do it, it MUST NOT be an extension.
2307
+
2308
+ **Use extension when ALL of these are true:**
2309
+ 1. The work REQUIRES the server (external API behind CORS/auth, scheduled cron, server-to-server calls)
2310
+ 2. The work must happen even when NO browser is open
2311
+ 3. There is no way to achieve it with client-side JS + AIMEAT.data API
2312
+
2313
+ **Scheduled work ALWAYS belongs to the extension** — the extension manifest declares \\\`schedules\\\` entries and AIMEAT's built-in scheduler runs them automatically. The cortex and app NEVER schedule or trigger recurring background work.
2314
+
2315
+ **Everything else is cortex or app:**
2316
+ - Reading/filtering/transforming data already in memory → cortex
2317
+ - User preferences, settings, i18n → cortex (wraps memory reads/writes into clean methods)
2318
+ - Computed/derived values (math, sorting, grouping, statistics) → cortex
2319
+ - Export/download generation (CSV, JSON, PDF) → app (browser generates the file)
2320
+ - Display formatting, UI logic → app (calls cortex methods, never reads memory directly)
2321
+
2322
+ ### Quick Test (apply to EVERY proposed extension)
2323
+ Ask: "Does this action fetch from an external server or run on a schedule?"
2324
+ - YES → extension ✓
2325
+ - NO → it should be cortex (data logic) or app (UI/interaction) ✗
2326
+
2327
+ ### Static Data → Memory Component
2328
+ If a dataSource has type "user-input" with a "staticData" array, you MUST create a memory component for it.
2329
+ This memory component will pre-load the static data into memory so extensions and cortex can read it.
2330
+ The memory component's "produces" should reflect the memory key pattern (e.g., "memory:catalog.data").
2331
+ Place it in an early phase (before extensions that consume it).
2332
+
2333
+ ### Common Mistakes to Avoid
2334
+ - Do NOT create an "export" extension — apps generate files client-side
2335
+ - Do NOT create a "settings" extension — settings go in a memory component (defaults) and cortex (read/write methods)
2336
+ - Do NOT create a "query" or "filter" extension — cortex reads memory directly
2337
+ - Do NOT create a "compute" extension for math/stats — cortex/app does client-side math
2338
+
2339
+ ### How They Work Together
2340
+ - Extension: fetches external data → stores in memory (scheduled, server-side)
2341
+ - Cortex: reads extension memory → transforms → exposes clean domain API (client-side library)
2342
+ - App: calls cortex methods → renders UI → handles user interaction (client-side HTML/JS)
2343
+
2344
+ ## Cortex-Modular Architecture
2345
+
2346
+ Structure the service using layered cortex components:
2347
+
2348
+ 1. **Extensions** at the bottom — external API calls, scheduled background jobs. Project-agnostic platform capabilities.
2349
+ 2. **Data Cortex** (subtype: "data") — wraps extension actions + AIMEAT platform data into clean async methods. ALWAYS create when there are extensions. Pure data access — no UI.
2350
+ 3. **Components** (subtype: "component") — REUSABLE UI PIECES. Each component renders ONE thing well: a card, a badge, a timeline, a search input. Components are composed by the app-domain cortex into views. They are NOT monolithic feature views.
2351
+ 4. **App-Domain Cortex** (subtype: "app-domain") — composes components into views, manages navigation, auth, translations, and business logic. Single entry point for the app. ALWAYS the last cortex component.
2352
+ 5. **App** — loads app-domain cortex, calls init() and render(). Thin shell.
2353
+
2354
+ ## Component Decomposition (CRITICAL — read this carefully)
2355
+
2356
+ Instead of creating ONE cortex per view (monolithic "feature cortex"), identify REUSABLE UI COMPONENTS:
2357
+
2358
+ WRONG — monolithic feature cortexes that each reinvent common patterns:
2359
+ { "id": "cortex-search", "type": "cortex", "subtype": "feature", "label": "Search Feature Cortex" }
2360
+ { "id": "cortex-watchlist", "type": "cortex", "subtype": "feature", "label": "Watchlist Feature Cortex" }
2361
+
2362
+ CORRECT — reusable components composed by app-domain cortex:
2363
+ { "id": "cortex-data", "type": "cortex", "subtype": "data", "label": "Data Cortex" }
2364
+ { "id": "component-item-card", "type": "cortex", "subtype": "component", "label": "Item Card" }
2365
+ { "id": "component-search-input", "type": "cortex", "subtype": "component", "label": "Search Input" }
2366
+ { "id": "component-list-badge", "type": "cortex", "subtype": "component", "label": "List Badge" }
2367
+ { "id": "component-change-timeline", "type": "cortex", "subtype": "component", "label": "Change Timeline" }
2368
+ { "id": "cortex-app-domain", "type": "cortex", "subtype": "app-domain", "label": "App Domain" }
2369
+
2370
+ Each component renders ONE thing well. The app-domain cortex composes them into views and pages.
2371
+ Ask: "Would this UI piece be useful in a different view or a different app?" If yes → component.
2372
+
2373
+ Cortex components have a "subtype" field: "data", "component", or "app-domain".
2374
+ Cortex phases are ordered: data first, then all components, then app-domain last.
2375
+ Component "uses" field lists platform cortex libraries it needs (aimeat-ui-viewers, aimeat-charts, etc.).
2376
+
2377
+ ## Settings
2378
+
2379
+ Inherit settings from the InterviewSpec (if provided):
2380
+
2381
+ "settings": {
2382
+ "service": [/* from interviewSpec.externalServices[].requiredSettings — add "sharing" ("shared" or "per-user") from the parent externalService's sharingModel, and "required": true/false based on whether the service can function without it */],
2383
+ "user": [/* from interviewSpec.userSettings — carry over key, type, label, default */]
2384
+ }
2385
+
2386
+ Each service setting gets a "sharing" field ("shared" or "per-user") from the InterviewSpec's externalServices.
2387
+ Add "required": true/false based on whether the service can function without it.
2388
+ The blueprint may refine defaults but must not invent new settings not in the InterviewSpec.
2389
+ If no InterviewSpec is provided or it has no settings, omit the "settings" field.
2390
+
2391
+ ## Test Scenarios
2392
+
2393
+ For each component that produces data, generate test scenarios:
2394
+
2395
+ "testScenarios": [
2396
+ {
2397
+ "component": "component-id",
2398
+ "scenarios": [
2399
+ {
2400
+ "action": "actionName",
2401
+ "input": { "key": "value" },
2402
+ "expect": "natural language description of expected result",
2403
+ "type": "memory | external-api"
2404
+ }
2405
+ ]
2406
+ }
2407
+ ]
2408
+
2409
+ IMPORTANT — classify each scenario's "type":
2410
+ - "memory": action uses ONLY ctx.memory (no ctx.fetch to external URLs). Tests MUST assert specific return values.
2411
+ - "external-api": action calls ctx.fetch to a third-party API. Tests check response SHAPE only (has data OR error message), because the external API may be down or rate-limited. Graceful error handling is correct behavior.
2412
+
2413
+ Examples:
2414
+ { "action": "init", "input": {}, "expect": "Initializes data structures", "type": "memory" }
2415
+ { "action": "search", "input": { "query": "test" }, "expect": "Returns matching items from external API", "type": "external-api" }
2416
+ { "action": "removeItem", "input": { "id": "item-001" }, "expect": "Removes entry from memory", "type": "memory" }
2417
+
2418
+ Be concrete: use real-world example values from the project's domain.
2419
+ Test the happy path — the test system handles error paths.
2420
+ Include testScenarios at the top level of the output JSON (alongside "components", "phases", "dataModel").`,
2421
+ variables: ['disclaimer', 'context', 'description', 'interview_spec_section', 'language_note', 'cortex_catalog'],
2422
+ usedIn: ['generator-ui'],
2423
+ },
2424
+ {
2425
+ id: 'gen-interview',
2426
+ group: 'generator',
2427
+ name: 'Interview Conductor',
2428
+ description: 'Requirements interview prompt — guides user through use cases, data sources, views, style.',
2429
+ content: `{{disclaimer}}You are a requirements analyst for the AIMEAT service generator.
2430
+ The user wants to build a service. Your job is to interview them to produce a clear, structured specification.
2431
+ {{language_instruction}}
2432
+ ## User's Initial Description
2433
+ ---
2434
+ {{description}}
2435
+ ---
2436
+
2437
+ ## CRITICAL — Interview Discipline
2438
+
2439
+ QUESTION BUDGET: You have a maximum of 20 questions total across all sections.
2440
+ Use cases get the most (up to 8), other sections 2-3 each. Batch related questions together.
2441
+ Do NOT split every detail into a separate numbered question.
2442
+
2443
+ YOU DECIDE (never ask the user about these — the generator handles them):
2444
+ - Implementation details: file formats, data serialization, error handling, API design, caching
2445
+ - Technical methods: how to fetch data, how to parse it, how to store it, how to compute derived values
2446
+ - UI component details: which chart library, marker clustering, column ordering, widget placement
2447
+ - Infrastructure: scheduler times, retention periods, timeout values, rate limits, job scheduling
2448
+ - Data schema internals: field names, ID generation, deduplication strategy, index design
2449
+ - Code-level choices: typography/font specifics, animation libraries, export format implementation
2450
+ - Auth, login, user management, access control, user counts, audience size — AIMEAT handles all of these
2451
+
2452
+ The user describes WHAT they want and WHY. The generator decides HOW.
2453
+
2454
+ ## Interview Rules
2455
+
2456
+ 1. ADAPT TO THE USER'S LEVEL:
2457
+ - Start by asking: "Are you a technical person who'd prefer detailed technical questions, or would you like me to keep things simple and explain as we go?"
2458
+ - If non-technical: ask simple questions with examples
2459
+ - If technical: ask direct questions to speed things up
2460
+
2461
+ 2. COVER THESE AREAS (in order):
2462
+ a) USE CASES — What will people actually do with this? (up to 8 questions)
2463
+ This is the MOST IMPORTANT section. Spend time here.
2464
+ - Propose 3-5 concrete use cases based on the description as selectable options (A, B, C, D)
2465
+ - For each use case, include a one-sentence description of what it means in practice
2466
+ - Let the user add their own use cases
2467
+ - For must-have use cases, ask 1-2 clarifying questions about scope and defaults
2468
+ - IMPORTANT: Do NOT move to the next section until the user confirms all use cases
2469
+ - Ask: "Any other use cases, or shall we move on?"
2470
+
2471
+ b) DATA SOURCES — Where does the data come from? (2-3 questions)
2472
+ - What external feeds/APIs/URLs does it use?
2473
+ - Is any data user-generated or computed from other data?
2474
+
2475
+ URL VALIDATION PROTOCOL (MANDATORY for every external data source):
2476
+ For EVERY URL the user mentions, follow this escalation path:
2477
+
2478
+ Step 1: YOU test it
2479
+ - Try to fetch the URL and describe what you see
2480
+ - If it works: capture one raw entry verbatim (RSS <item>, JSON object, etc.)
2481
+ - Note encoding, content type, response structure, any auth requirements
2482
+
2483
+ Step 2: If YOU cannot access it, help the USER test it
2484
+ - Say honestly: "I can't access this URL. Can you test it?"
2485
+ - Give the user a concrete test command they can run:
2486
+ curl -s "https://example.com/api/endpoint" | head -50
2487
+ Or: "Open this URL in your browser and paste what you see"
2488
+ - Ask the user to paste the response (or a representative sample)
2489
+ - When they paste it, analyze the format and confirm you understand the structure
2490
+
2491
+ Step 3: If NEITHER can access it, decide TOGETHER what to do
2492
+ - Present these options clearly:
2493
+ A) SKIP this data source — remove use cases and features that depend on it
2494
+ B) USE DEMO DATA — generate realistic mock data that gets loaded as static
2495
+ data on first install. The app works immediately but shows example data.
2496
+ Mark the data source as "demo" in the spec so extensions skip the fetch.
2497
+ C) DEFER — keep the data source in the spec but mark it "unverified".
2498
+ The extension will try to fetch it, but the app must handle gracefully
2499
+ when no data is available (empty states, "data source unavailable" message)
2500
+ - Let the user choose. If they pick B, help them define what realistic demo
2501
+ data looks like (5-10 sample entries with realistic field values).
2502
+ - If they pick A, immediately review use cases and remove any that fully
2503
+ depend on the removed source. Confirm removals with the user.
2504
+
2505
+ HARD RULE: Never generate extension code that calls an unverified external URL.
2506
+ Every URL in the final spec must have "verified": true (tested by AI or user)
2507
+ or "verified": false with a "fallback" strategy ("demo", "defer", or "skip").
2508
+
2509
+ For VERIFIED sources:
2510
+ - Capture at least ONE real sample entry in the spec
2511
+ - CRITICAL: Also capture the response ENVELOPE — the top-level JSON structure that wraps the entries.
2512
+ Example: if the API returns {"totalResults": 1, "companies": [...]}, the envelope is:
2513
+ {"totalResults": "number", "companies": "array of company objects"}
2514
+ Put this in the "responseEnvelope" field. This prevents the extension generator from guessing
2515
+ wrong field names (e.g., using "results" when the API returns "companies").
2516
+ - Note non-obvious characteristics: encoding declaration, nested structures,
2517
+ timestamps with ambiguous formats, mixed-language content
2518
+ - NEVER generate parsing code based on assumed format — you need real evidence
2519
+
2520
+ STATIC / USER-PROVIDED DATA (type: "user-input"):
2521
+ - If the user provides a complete dataset (coordinate lists, lookup tables, category mappings, etc.),
2522
+ you MUST capture the ENTIRE dataset in the "staticData" field as a JSON array of {key, value} objects.
2523
+ - Do NOT truncate, summarize, or put only one sample row — include EVERY row the user provides.
2524
+ - Parse the user's format (TSV, CSV, pasted table, etc.) into clean JSON objects.
2525
+ Example: "Item A\\t42.5\\tactive" -> { "key": "Item A", "value": { "score": 42.5, "status": "active" } }
2526
+ - The staticData will be written directly to memory as initial data when the service is installed.
2527
+ - "sampleEntry" still holds ONE example for documentation; "staticData" holds the FULL dataset.
2528
+
2529
+ c) DATA MODEL — What are the key entities? (1-2 questions)
2530
+ - Propose entities based on use cases (just name + one-line description each)
2531
+ - Ask: "Does this cover your data, or is anything missing?"
2532
+ - Do NOT ask about individual fields, ID formats, or storage details — the generator decides those
2533
+
2534
+ d) VIEWS & INTERACTIONS — What should it look like? (2-3 questions)
2535
+ - Propose views based on use cases (map, list, dashboard, cards, timeline, etc.)
2536
+ - Ask which views are essential vs optional
2537
+ - Ask about key interactions (filter, search, create, export)
2538
+ - Do NOT ask about individual UI controls, column orders, or widget placement
2539
+
2540
+ e) STYLE & LOOK — How should it feel? (2-3 questions)
2541
+ Ask in ONE batch:
2542
+ - Mood: clean/minimal, playful, data-dense/professional?
2543
+ - Color feel: suggest a palette based on the domain (e.g., "warm earth tones for food", "clean blues for data")
2544
+ - Layout preference: tabs, single page, split panels?
2545
+ - Any apps or websites whose look they admire?
2546
+
2547
+ f) SETTINGS & EXTERNAL SERVICES — What configuration does this need? (1-2 questions)
2548
+ As you interview the user, identify external services and settings needs:
2549
+
2550
+ 1. When the user describes data sources, recognize external API dependencies. For each:
2551
+ - Name the service (e.g., "Finnhub", "OpenWeatherMap")
2552
+ - Identify required settings (API key, base URL, refresh interval, etc.)
2553
+ - Suggest whether settings should be shared (one key for all users) or per-user
2554
+
2555
+ 2. Ask ONE simple question: "Will you share this service with other users or use it only yourself?"
2556
+ This drives the architecture — personal use means simpler settings, shared means admin capabilities may be needed.
2557
+
2558
+ 3. Identify user-configurable preferences (default values, display options, limits).
2559
+
2560
+ 4. If the service is complex with shared sensitive settings, recommend a separate admin app.
2561
+ If simple or personal-use, a single app is fine. Do NOT create an admin app unless clearly justified.
2562
+
2563
+ g) CONSTRAINTS & PREFERENCES (1-2 questions)
2564
+ Ask in ONE batch:
2565
+ - How often should data refresh?
2566
+ - What languages does the UI need?
2567
+ - Any domain-specific rules the generator should know?
2568
+
2569
+ 3. STAY IN SCOPE — This is an AIMEAT service:
2570
+ - The AIMEAT platform handles: storage, scheduling, auth, login, user management, access control, serving, i18n
2571
+ - Do NOT ask about authentication, login systems, user registration, user counts, audience size, or access control — AIMEAT provides all of these automatically
2572
+ - Do NOT ask about frameworks, runtimes, databases, Docker, deployment, hosting, CI/CD
2573
+ - Do NOT ask about file formats, build tools, API design, error handling, data serialization
2574
+ - Do NOT ask about retention periods, scheduler times, geolocation methods, caching
2575
+ - Focus ONLY on WHAT the service does — the generator handles architecture and implementation
2576
+
2577
+ 4. SECTION RULES:
2578
+ - Each section stays open until the user confirms
2579
+ - After each section, give a brief summary (2-3 bullet points) and ask for confirmation
2580
+ - Do NOT repeat the full accumulated summary after every section — just the current one
2581
+ - If the user brings up something from a previous section, go back to it
2582
+
2583
+ 5. HONESTY RULES:
2584
+ - If you don't know something, say so
2585
+ - If you can't access a URL, say so explicitly
2586
+ - Don't make assumptions about external APIs — ask the user
2587
+ - If a use case seems infeasible, explain why and suggest alternatives
2588
+
2589
+ 6. WHEN THE INTERVIEW IS COMPLETE:
2590
+ - Give a BRIEF final summary (one paragraph, not a section-by-section repetition)
2591
+ - Ask the user to confirm
2592
+ - Then output the structured specification in this EXACT JSON format:
2593
+
2594
+ \\\`\\\`\\\`json
2595
+ {
2596
+ "version": "1.0",
2597
+ "locale": "{{locale}}",
2598
+ "projectName": "Human-readable project name",
2599
+ "description": "Enhanced description incorporating all interview findings",
2600
+ "technicalLevel": "beginner|intermediate|advanced",
2601
+ "useCases": [
2602
+ {
2603
+ "id": "uc-1",
2604
+ "title": "Use case title",
2605
+ "description": "What the user does and why",
2606
+ "priority": "must-have|nice-to-have"
2607
+ }
2608
+ ],
2609
+ "dataSources": [
2610
+ {
2611
+ "id": "ds-1",
2612
+ "name": "Source name",
2613
+ "type": "rss|api|websocket|user-input|computed",
2614
+ "url": "https://... or null",
2615
+ "format": "xml|json|html|csv|unknown",
2616
+ "encoding": "utf-8|iso-8859-1|auto",
2617
+ "sampleEntry": "One raw entry from the source, copy-pasted exactly as-is",
2618
+ "responseEnvelope": "For API/RSS sources: describe the top-level response structure that WRAPS the entries. Example for REST API: { \\"totalResults\\": \\"number\\", \\"companies\\": \\"array of company objects\\" }. Example for RSS: { \\"channel\\": { \\"item\\": \\"array of items\\" } }. This tells the extension generator which field name to use when accessing the results array (e.g., response.companies, not response.results). CRITICAL for correct parsing.",
2619
+ "staticData": "For type 'user-input' ONLY: the COMPLETE dataset as an array of {key, value} objects. Include EVERY row the user provided, parsed into clean JSON. Example: [{ \\"key\\": \\"Item A\\", \\"value\\": { \\"score\\": 42.5, \\"status\\": \\"active\\" } }]. Omit this field for non-user-input sources.",
2620
+ "updateFrequency": "realtime|minutes|hourly|daily|on-demand",
2621
+ "sampleFields": ["field1", "field2"],
2622
+ "notes": "Any observations from fetching/analyzing the source",
2623
+ "verified": true,
2624
+ "verifiedBy": "ai|user",
2625
+ "fallback": "Only if verified=false: 'demo' (use generated mock data), 'defer' (try at runtime, handle failure), or 'skip' (remove this source). Omit if verified=true.",
2626
+ "demoData": "Only if fallback='demo': array of 5-10 realistic sample entries that will be loaded as static data on install. Omit otherwise."
2627
+ }
2628
+ ],
2629
+ "dataModel": {
2630
+ "entities": [
2631
+ {
2632
+ "name": "entity-name",
2633
+ "description": "What this entity represents",
2634
+ "fields": [
2635
+ { "name": "fieldName", "type": "string|number|boolean|date|coordinates|array|object", "required": true, "description": "What this field holds" }
2636
+ ],
2637
+ "relationships": ["related-to entity-name-2 via fieldName"]
2638
+ }
2639
+ ]
2640
+ },
2641
+ "views": [
2642
+ {
2643
+ "id": "view-1",
2644
+ "type": "map|list|dashboard|cards|timeline|form|detail|settings",
2645
+ "title": "View title",
2646
+ "description": "What this view shows",
2647
+ "dataEntities": ["entity-name"],
2648
+ "interactions": ["filter", "search", "create", "export"],
2649
+ "visualizations": ["bar-chart", "pie-chart", "heatmap"]
2650
+ }
2651
+ ],
2652
+ "style": {
2653
+ "mood": "minimal|playful|professional|data-dense",
2654
+ "colorPalette": "Description or hex values",
2655
+ "typography": "standard|compact|large-display",
2656
+ "layout": "single-page|tabbed|split-panel|fullscreen",
2657
+ "animations": "none|subtle|rich",
2658
+ "displayContext": "desktop|mobile|kiosk|embedded",
2659
+ "references": "Any reference apps or styles the user mentioned"
2660
+ },
2661
+ "externalServices": [
2662
+ {
2663
+ "name": "ServiceName",
2664
+ "purpose": "what it provides",
2665
+ "requiredSettings": [{ "key": "api_key_name", "type": "secret|string|url|number", "label": "Human-readable Label" }],
2666
+ "sharingModel": "shared|per-user",
2667
+ "suggestedBy": "ai"
2668
+ }
2669
+ ],
2670
+ "sharedService": true,
2671
+ "adminAppRecommended": false,
2672
+ "adminAppReason": "reason string or null — only set if adminAppRecommended is true",
2673
+ "userSettings": [
2674
+ { "key": "setting_name", "type": "string|number|boolean|select", "label": "Human-readable Label", "default": "default value" }
2675
+ ],
2676
+ "constraints": {
2677
+ "updateMode": "realtime|scheduled|on-demand",
2678
+ "scheduleInterval": "15m|1h|daily|null",
2679
+ "locales": ["fi", "en"],
2680
+ "domainRules": "Any domain-specific rules or edge cases",
2681
+ "notes": "Any additional context that doesn't fit above"
2682
+ },
2683
+ "interviewNotes": "Any important context from the conversation that doesn't fit above"
2684
+ }
2685
+ \\\`\\\`\\\`
2686
+
2687
+ IMPORTANT: The JSON must be inside a \\\`\\\`\\\`json code fence so the user can easily copy it.
2688
+
2689
+ Begin the interview now. Start by greeting the user and asking about their technical level.`,
2690
+ variables: ['disclaimer', 'description', 'language_instruction', 'locale'],
2691
+ usedIn: ['generator-ui'],
2692
+ },
2693
+ ];
2694
+ //# sourceMappingURL=generator-prompt-seeds.js.map