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.
- package/dist/.env.example +300 -0
- package/dist/bin/aimeat.d.ts +3 -0
- package/dist/bin/aimeat.d.ts.map +1 -0
- package/dist/bin/aimeat.js +22 -0
- package/dist/bin/aimeat.js.map +1 -0
- package/dist/locales/en.json +4566 -0
- package/dist/locales/fi.json +4566 -0
- package/dist/public/BingSiteAuth.xml +4 -0
- package/dist/public/agent-consent.html +521 -0
- package/dist/public/aimeat-developers.html +679 -0
- package/dist/public/assets/mcp_1_add_custom_connector.png +0 -0
- package/dist/public/assets/mcp_2_connect_disconnect_connector.png +0 -0
- package/dist/public/components/Alert.js +18 -0
- package/dist/public/components/Card.js +19 -0
- package/dist/public/components/CopyButton.js +24 -0
- package/dist/public/components/FormField.js +16 -0
- package/dist/public/components/Modal.js +121 -0
- package/dist/public/components/Spinner.js +11 -0
- package/dist/public/components/Toast.js +26 -0
- package/dist/public/components/index.js +8 -0
- package/dist/public/components/useViewCSS.js +12 -0
- package/dist/public/cortex-bundled/aimeat-canvas.js +1408 -0
- package/dist/public/cortex-bundled/aimeat-canvas.yaml +241 -0
- package/dist/public/cortex-bundled/aimeat-charts.js +455 -0
- package/dist/public/cortex-bundled/aimeat-charts.yaml +178 -0
- package/dist/public/cortex-bundled/aimeat-ui-dialogs.js +667 -0
- package/dist/public/cortex-bundled/aimeat-ui-dialogs.yaml +66 -0
- package/dist/public/cortex-bundled/aimeat-ui-forms.js +1106 -0
- package/dist/public/cortex-bundled/aimeat-ui-forms.yaml +90 -0
- package/dist/public/cortex-bundled/aimeat-ui-layout.js +436 -0
- package/dist/public/cortex-bundled/aimeat-ui-layout.yaml +87 -0
- package/dist/public/cortex-bundled/aimeat-ui-nav.js +722 -0
- package/dist/public/cortex-bundled/aimeat-ui-nav.yaml +73 -0
- package/dist/public/cortex-bundled/aimeat-ui-viewers.js +602 -0
- package/dist/public/cortex-bundled/aimeat-ui-viewers.yaml +73 -0
- package/dist/public/css/components/tags.css +67 -0
- package/dist/public/css/theme.css +716 -0
- package/dist/public/css/views/admin.css +576 -0
- package/dist/public/css/views/aimeat-os.css +153 -0
- package/dist/public/css/views/calibrator.css +480 -0
- package/dist/public/css/views/foundry.css +1334 -0
- package/dist/public/css/views/help.css +136 -0
- package/dist/public/css/views/hobbies.css +73 -0
- package/dist/public/css/views/marketplace.css +134 -0
- package/dist/public/css/views/openclaw.css +33 -0
- package/dist/public/css/views/portal-classic.css +484 -0
- package/dist/public/css/views/portal-dev.css +139 -0
- package/dist/public/css/views/portal.css +365 -0
- package/dist/public/css/views/portfolio.css +322 -0
- package/dist/public/css/views/profile.css +1799 -0
- package/dist/public/echat.html +442 -0
- package/dist/public/img/genesis-001-badge.png +0 -0
- package/dist/public/img/platforms/chatgpt.png +0 -0
- package/dist/public/img/platforms/claude.png +0 -0
- package/dist/public/img/platforms/copilot.png +0 -0
- package/dist/public/img/platforms/deepseek.png +0 -0
- package/dist/public/img/platforms/gemini.png +0 -0
- package/dist/public/img/platforms/grok.png +0 -0
- package/dist/public/img/platforms/lmstudio.png +0 -0
- package/dist/public/img/platforms/m365copilot.png +0 -0
- package/dist/public/img/platforms/openclaw.png +0 -0
- package/dist/public/img/platforms/other.png +0 -0
- package/dist/public/js/api.js +123 -0
- package/dist/public/js/components/auth-image.js +59 -0
- package/dist/public/js/components/tag-cloud.js +31 -0
- package/dist/public/js/components/tag-editor.js +46 -0
- package/dist/public/js/hooks.js +63 -0
- package/dist/public/js/i18n.js +76 -0
- package/dist/public/js/services/admin.js +239 -0
- package/dist/public/js/services/agents.js +57 -0
- package/dist/public/js/services/apps.js +35 -0
- package/dist/public/js/services/auth.js +40 -0
- package/dist/public/js/services/boards.js +79 -0
- package/dist/public/js/services/calibrator.js +97 -0
- package/dist/public/js/services/catalogue.js +39 -0
- package/dist/public/js/services/consent.js +57 -0
- package/dist/public/js/services/cortex.js +95 -0
- package/dist/public/js/services/extensions.js +61 -0
- package/dist/public/js/services/federation.js +11 -0
- package/dist/public/js/services/foundry-context-bundle.js +128 -0
- package/dist/public/js/services/foundry-contract.js +117 -0
- package/dist/public/js/services/foundry-packaging.js +762 -0
- package/dist/public/js/services/foundry-probe-reconcile.js +52 -0
- package/dist/public/js/services/foundry-prompts-base.js +1886 -0
- package/dist/public/js/services/foundry-prompts-build.js +2187 -0
- package/dist/public/js/services/foundry-prompts-cortex-app.js +154 -0
- package/dist/public/js/services/foundry-prompts-cortex-data.js +241 -0
- package/dist/public/js/services/foundry-prompts-cortex-feature.js +281 -0
- package/dist/public/js/services/foundry-prompts-fix.js +408 -0
- package/dist/public/js/services/foundry-prompts-test.js +520 -0
- package/dist/public/js/services/foundry-prompts.js +31 -0
- package/dist/public/js/services/foundry-smoke.js +65 -0
- package/dist/public/js/services/foundry-testing.js +64 -0
- package/dist/public/js/services/foundry-validate.js +1082 -0
- package/dist/public/js/services/foundry.js +1194 -0
- package/dist/public/js/services/generator-context-bundle.js +134 -0
- package/dist/public/js/services/generator-contract.js +117 -0
- package/dist/public/js/services/generator-packaging.js +762 -0
- package/dist/public/js/services/generator-probe-reconcile.js +52 -0
- package/dist/public/js/services/generator-prompts-base.js +1890 -0
- package/dist/public/js/services/generator-prompts-build.js +1126 -0
- package/dist/public/js/services/generator-prompts-cortex-app.js +155 -0
- package/dist/public/js/services/generator-prompts-cortex-data.js +199 -0
- package/dist/public/js/services/generator-prompts-cortex-feature.js +276 -0
- package/dist/public/js/services/generator-prompts-fix.js +316 -0
- package/dist/public/js/services/generator-prompts-test.js +402 -0
- package/dist/public/js/services/generator-prompts.js +31 -0
- package/dist/public/js/services/generator-smoke.js +65 -0
- package/dist/public/js/services/generator-spec-tests.js +280 -0
- package/dist/public/js/services/generator-spec-validate.js +192 -0
- package/dist/public/js/services/generator-specs.js +369 -0
- package/dist/public/js/services/generator-testing.js +64 -0
- package/dist/public/js/services/generator-validate.js +916 -0
- package/dist/public/js/services/generator.js +952 -0
- package/dist/public/js/services/knowledge.js +120 -0
- package/dist/public/js/services/memory.js +112 -0
- package/dist/public/js/services/nodes.js +55 -0
- package/dist/public/js/services/organisms.js +74 -0
- package/dist/public/js/services/packages.js +97 -0
- package/dist/public/js/services/security.js +67 -0
- package/dist/public/js/services/stats.js +11 -0
- package/dist/public/js/services/wallet.js +24 -0
- package/dist/public/js/services/work.js +51 -0
- package/dist/public/js/utils.js +184 -0
- package/dist/public/lib/htm.mjs +4 -0
- package/dist/public/lib/live-updates.js +89 -0
- package/dist/public/lib/minidenticons.min.js +1 -0
- package/dist/public/lib/preact-hooks.mjs +3 -0
- package/dist/public/lib/preact.mjs +3 -0
- package/dist/public/lib/realtime.js +549 -0
- package/dist/public/lib/three.min.js +6 -0
- package/dist/public/lib/yaml.mjs +141 -0
- package/dist/public/llms-template.txt +1043 -0
- package/dist/public/oauth-consent.html +388 -0
- package/dist/public/og-image.png +0 -0
- package/dist/public/robots.txt +52 -0
- package/dist/public/spa.html +533 -0
- package/dist/public/sw.js +34 -0
- package/dist/public/tmp-paste.txt +223 -0
- package/dist/public/views/_template.js +85 -0
- package/dist/public/views/admin/actions-tab.js +41 -0
- package/dist/public/views/admin/agents-tab.js +84 -0
- package/dist/public/views/admin/boards-tab.js +154 -0
- package/dist/public/views/admin/chat-instances-tab.js +207 -0
- package/dist/public/views/admin/config-tab.js +151 -0
- package/dist/public/views/admin/consul-tab.js +77 -0
- package/dist/public/views/admin/cors-tab.js +240 -0
- package/dist/public/views/admin/cortex-tab.js +171 -0
- package/dist/public/views/admin/csm-tab.js +261 -0
- package/dist/public/views/admin/directory-tab.js +44 -0
- package/dist/public/views/admin/economy-tab.js +80 -0
- package/dist/public/views/admin/email-tab.js +460 -0
- package/dist/public/views/admin/federation-tab.js +412 -0
- package/dist/public/views/admin/generator-debug-tab.js +238 -0
- package/dist/public/views/admin/genesis-tab.js +70 -0
- package/dist/public/views/admin/ghii-tab.js +101 -0
- package/dist/public/views/admin/hooks-tab.js +69 -0
- package/dist/public/views/admin/knowledge-tab.js +297 -0
- package/dist/public/views/admin/maintenance-tab.js +98 -0
- package/dist/public/views/admin/matching-tab.js +44 -0
- package/dist/public/views/admin/memory-tab.js +222 -0
- package/dist/public/views/admin/msm-tab.js +342 -0
- package/dist/public/views/admin/overview-tab.js +90 -0
- package/dist/public/views/admin/owners-tab.js +55 -0
- package/dist/public/views/admin/packages-tab.js +510 -0
- package/dist/public/views/admin/portal-tab.js +211 -0
- package/dist/public/views/admin/prompts-tab.js +287 -0
- package/dist/public/views/admin/push-tab.js +291 -0
- package/dist/public/views/admin/realtime-tab.js +68 -0
- package/dist/public/views/admin/scheduler-tab.js +156 -0
- package/dist/public/views/admin/services-tab.js +981 -0
- package/dist/public/views/admin/shared.js +148 -0
- package/dist/public/views/admin/stats-tab.js +187 -0
- package/dist/public/views/admin/work-tab.js +45 -0
- package/dist/public/views/admin.js +400 -0
- package/dist/public/views/aimeat-os.js +259 -0
- package/dist/public/views/guides.js +402 -0
- package/dist/public/views/help.js +79 -0
- package/dist/public/views/hobbies.js +697 -0
- package/dist/public/views/marketplace.js +647 -0
- package/dist/public/views/openclaw.js +223 -0
- package/dist/public/views/portal-classic.js +519 -0
- package/dist/public/views/portal-dev.js +816 -0
- package/dist/public/views/portal.js +1354 -0
- package/dist/public/views/portfolio.js +795 -0
- package/dist/public/views/profile/access-tab.js +58 -0
- package/dist/public/views/profile/agents-tab.js +689 -0
- package/dist/public/views/profile/apps-tab.js +197 -0
- package/dist/public/views/profile/boards-tab.js +323 -0
- package/dist/public/views/profile/calibrator-batch.js +926 -0
- package/dist/public/views/profile/calibrator-chart.js +135 -0
- package/dist/public/views/profile/calibrator-llm-editor.js +205 -0
- package/dist/public/views/profile/calibrator-tab.js +535 -0
- package/dist/public/views/profile/chat-sessions-tab.js +184 -0
- package/dist/public/views/profile/data-wallet-tab.js +313 -0
- package/dist/public/views/profile/email-tab.js +157 -0
- package/dist/public/views/profile/extensions-tab.js +711 -0
- package/dist/public/views/profile/federation-tab.js +63 -0
- package/dist/public/views/profile/foundry-dashboard/DebugPanel.js +193 -0
- package/dist/public/views/profile/foundry-dashboard/DiagnosticsPanel.js +69 -0
- package/dist/public/views/profile/foundry-dashboard/EditModePanel.js +141 -0
- package/dist/public/views/profile/foundry-dashboard/PackageDialog.js +96 -0
- package/dist/public/views/profile/foundry-dashboard/RemovePanel.js +53 -0
- package/dist/public/views/profile/foundry-dashboard/use-autopilot-state.js +53 -0
- package/dist/public/views/profile/foundry-dashboard/use-autopilot.js +1016 -0
- package/dist/public/views/profile/foundry-dashboard/use-dashboard-core.js +154 -0
- package/dist/public/views/profile/foundry-dashboard/use-edit-mode.js +294 -0
- package/dist/public/views/profile/foundry-dashboard/use-lifecycle.js +101 -0
- package/dist/public/views/profile/foundry-dashboard/use-packaging.js +97 -0
- package/dist/public/views/profile/foundry-dashboard/use-test-execution.js +275 -0
- package/dist/public/views/profile/foundry-dashboard.js +395 -0
- package/dist/public/views/profile/foundry-detail.js +1178 -0
- package/dist/public/views/profile/foundry-settings.js +377 -0
- package/dist/public/views/profile/foundry-tab.js +546 -0
- package/dist/public/views/profile/generator-dashboard/DebugPanel.js +193 -0
- package/dist/public/views/profile/generator-dashboard/DiagnosticsPanel.js +69 -0
- package/dist/public/views/profile/generator-dashboard/EditModePanel.js +141 -0
- package/dist/public/views/profile/generator-dashboard/PackageDialog.js +96 -0
- package/dist/public/views/profile/generator-dashboard/RemovePanel.js +53 -0
- package/dist/public/views/profile/generator-dashboard/use-autopilot-state.js +53 -0
- package/dist/public/views/profile/generator-dashboard/use-autopilot.js +136 -0
- package/dist/public/views/profile/generator-dashboard/use-dashboard-core.js +143 -0
- package/dist/public/views/profile/generator-dashboard/use-edit-mode.js +296 -0
- package/dist/public/views/profile/generator-dashboard/use-lifecycle.js +101 -0
- package/dist/public/views/profile/generator-dashboard/use-packaging.js +97 -0
- package/dist/public/views/profile/generator-dashboard/use-test-execution.js +275 -0
- package/dist/public/views/profile/generator-dashboard.js +377 -0
- package/dist/public/views/profile/generator-detail.js +1007 -0
- package/dist/public/views/profile/generator-settings.js +417 -0
- package/dist/public/views/profile/generator-tab.js +544 -0
- package/dist/public/views/profile/inline-panels.js +277 -0
- package/dist/public/views/profile/knowledge-tab.js +735 -0
- package/dist/public/views/profile/landing-page.js +539 -0
- package/dist/public/views/profile/mcp-tab.js +140 -0
- package/dist/public/views/profile/memory-tab.js +599 -0
- package/dist/public/views/profile/node-stats-tab.js +132 -0
- package/dist/public/views/profile/nodes-tab.js +195 -0
- package/dist/public/views/profile/notifications-tab.js +274 -0
- package/dist/public/views/profile/organisms-tab.js +402 -0
- package/dist/public/views/profile/packages-tab.js +393 -0
- package/dist/public/views/profile/portfolio-tab.js +31 -0
- package/dist/public/views/profile/security-tab.js +219 -0
- package/dist/public/views/profile/services-tab.js +281 -0
- package/dist/public/views/profile/shared.js +58 -0
- package/dist/public/views/profile/wallet-tab.js +272 -0
- package/dist/public/views/profile/work-tab.js +220 -0
- package/dist/public/views/profile.js +271 -0
- package/dist/public/wizard.html +1320 -0
- package/dist/scripts/db-init.d.ts +19 -0
- package/dist/scripts/db-init.d.ts.map +1 -0
- package/dist/scripts/db-init.js +168 -0
- package/dist/scripts/db-init.js.map +1 -0
- package/dist/scripts/db-reset.d.ts +15 -0
- package/dist/scripts/db-reset.d.ts.map +1 -0
- package/dist/scripts/db-reset.js +162 -0
- package/dist/scripts/db-reset.js.map +1 -0
- package/dist/scripts/indexnow.d.ts +18 -0
- package/dist/scripts/indexnow.d.ts.map +1 -0
- package/dist/scripts/indexnow.js +104 -0
- package/dist/scripts/indexnow.js.map +1 -0
- package/dist/scripts/kill-port.d.ts +3 -0
- package/dist/scripts/kill-port.d.ts.map +1 -0
- package/dist/scripts/kill-port.js +89 -0
- package/dist/scripts/kill-port.js.map +1 -0
- package/dist/scripts/seed-digital-signage.d.ts +13 -0
- package/dist/scripts/seed-digital-signage.d.ts.map +1 -0
- package/dist/scripts/seed-digital-signage.js +85 -0
- package/dist/scripts/seed-digital-signage.js.map +1 -0
- package/dist/src/auth/jwt.d.ts +40 -0
- package/dist/src/auth/jwt.d.ts.map +1 -0
- package/dist/src/auth/jwt.js +139 -0
- package/dist/src/auth/jwt.js.map +1 -0
- package/dist/src/auth/keypair.d.ts +8 -0
- package/dist/src/auth/keypair.d.ts.map +1 -0
- package/dist/src/auth/keypair.js +35 -0
- package/dist/src/auth/keypair.js.map +1 -0
- package/dist/src/auth/middleware.d.ts +50 -0
- package/dist/src/auth/middleware.d.ts.map +1 -0
- package/dist/src/auth/middleware.js +241 -0
- package/dist/src/auth/middleware.js.map +1 -0
- package/dist/src/auth/node-keys.d.ts +7 -0
- package/dist/src/auth/node-keys.d.ts.map +1 -0
- package/dist/src/auth/node-keys.js +116 -0
- package/dist/src/auth/node-keys.js.map +1 -0
- package/dist/src/cli/config-export.d.ts +9 -0
- package/dist/src/cli/config-export.d.ts.map +1 -0
- package/dist/src/cli/config-export.js +90 -0
- package/dist/src/cli/config-export.js.map +1 -0
- package/dist/src/cli/config-import.d.ts +10 -0
- package/dist/src/cli/config-import.d.ts.map +1 -0
- package/dist/src/cli/config-import.js +124 -0
- package/dist/src/cli/config-import.js.map +1 -0
- package/dist/src/cli/federation-join.d.ts +13 -0
- package/dist/src/cli/federation-join.d.ts.map +1 -0
- package/dist/src/cli/federation-join.js +395 -0
- package/dist/src/cli/federation-join.js.map +1 -0
- package/dist/src/cli/init-wizard.d.ts +8 -0
- package/dist/src/cli/init-wizard.d.ts.map +1 -0
- package/dist/src/cli/init-wizard.js +1489 -0
- package/dist/src/cli/init-wizard.js.map +1 -0
- package/dist/src/cli/scaffold.d.ts +33 -0
- package/dist/src/cli/scaffold.d.ts.map +1 -0
- package/dist/src/cli/scaffold.js +142 -0
- package/dist/src/cli/scaffold.js.map +1 -0
- package/dist/src/config.d.ts +272 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +362 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/data/example-packages.d.ts +49 -0
- package/dist/src/data/example-packages.d.ts.map +1 -0
- package/dist/src/data/example-packages.js +814 -0
- package/dist/src/data/example-packages.js.map +1 -0
- package/dist/src/i18n.d.ts +19 -0
- package/dist/src/i18n.d.ts.map +1 -0
- package/dist/src/i18n.js +126 -0
- package/dist/src/i18n.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +608 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/mcp/boards.d.ts +18 -0
- package/dist/src/mcp/boards.d.ts.map +1 -0
- package/dist/src/mcp/boards.js +279 -0
- package/dist/src/mcp/boards.js.map +1 -0
- package/dist/src/mcp/catalogue.d.ts +17 -0
- package/dist/src/mcp/catalogue.d.ts.map +1 -0
- package/dist/src/mcp/catalogue.js +114 -0
- package/dist/src/mcp/catalogue.js.map +1 -0
- package/dist/src/mcp/chat-instances.d.ts +18 -0
- package/dist/src/mcp/chat-instances.d.ts.map +1 -0
- package/dist/src/mcp/chat-instances.js +161 -0
- package/dist/src/mcp/chat-instances.js.map +1 -0
- package/dist/src/mcp/consent.d.ts +18 -0
- package/dist/src/mcp/consent.d.ts.map +1 -0
- package/dist/src/mcp/consent.js +158 -0
- package/dist/src/mcp/consent.js.map +1 -0
- package/dist/src/mcp/core.d.ts +18 -0
- package/dist/src/mcp/core.d.ts.map +1 -0
- package/dist/src/mcp/core.js +489 -0
- package/dist/src/mcp/core.js.map +1 -0
- package/dist/src/mcp/extensions.d.ts +18 -0
- package/dist/src/mcp/extensions.d.ts.map +1 -0
- package/dist/src/mcp/extensions.js +299 -0
- package/dist/src/mcp/extensions.js.map +1 -0
- package/dist/src/mcp/flags.d.ts +18 -0
- package/dist/src/mcp/flags.d.ts.map +1 -0
- package/dist/src/mcp/flags.js +59 -0
- package/dist/src/mcp/flags.js.map +1 -0
- package/dist/src/mcp/index.d.ts +31 -0
- package/dist/src/mcp/index.d.ts.map +1 -0
- package/dist/src/mcp/index.js +694 -0
- package/dist/src/mcp/index.js.map +1 -0
- package/dist/src/mcp/knowledge.d.ts +18 -0
- package/dist/src/mcp/knowledge.d.ts.map +1 -0
- package/dist/src/mcp/knowledge.js +214 -0
- package/dist/src/mcp/knowledge.js.map +1 -0
- package/dist/src/mcp/memory-extended.d.ts +18 -0
- package/dist/src/mcp/memory-extended.d.ts.map +1 -0
- package/dist/src/mcp/memory-extended.js +73 -0
- package/dist/src/mcp/memory-extended.js.map +1 -0
- package/dist/src/mcp/organisms.d.ts +18 -0
- package/dist/src/mcp/organisms.d.ts.map +1 -0
- package/dist/src/mcp/organisms.js +291 -0
- package/dist/src/mcp/organisms.js.map +1 -0
- package/dist/src/mcp/prompts.d.ts +17 -0
- package/dist/src/mcp/prompts.d.ts.map +1 -0
- package/dist/src/mcp/prompts.js +65 -0
- package/dist/src/mcp/prompts.js.map +1 -0
- package/dist/src/mcp/wallet-extended.d.ts +17 -0
- package/dist/src/mcp/wallet-extended.d.ts.map +1 -0
- package/dist/src/mcp/wallet-extended.js +42 -0
- package/dist/src/mcp/wallet-extended.js.map +1 -0
- package/dist/src/middleware/__tests__/cookie-consent.test.d.ts +2 -0
- package/dist/src/middleware/__tests__/cookie-consent.test.d.ts.map +1 -0
- package/dist/src/middleware/__tests__/cookie-consent.test.js +432 -0
- package/dist/src/middleware/__tests__/cookie-consent.test.js.map +1 -0
- package/dist/src/middleware/cookie-consent.d.ts +19 -0
- package/dist/src/middleware/cookie-consent.d.ts.map +1 -0
- package/dist/src/middleware/cookie-consent.js +127 -0
- package/dist/src/middleware/cookie-consent.js.map +1 -0
- package/dist/src/middleware/cors.d.ts +12 -0
- package/dist/src/middleware/cors.d.ts.map +1 -0
- package/dist/src/middleware/cors.js +112 -0
- package/dist/src/middleware/cors.js.map +1 -0
- package/dist/src/middleware/envelope.d.ts +33 -0
- package/dist/src/middleware/envelope.d.ts.map +1 -0
- package/dist/src/middleware/envelope.js +32 -0
- package/dist/src/middleware/envelope.js.map +1 -0
- package/dist/src/middleware/idempotency.d.ts +3 -0
- package/dist/src/middleware/idempotency.d.ts.map +1 -0
- package/dist/src/middleware/idempotency.js +64 -0
- package/dist/src/middleware/idempotency.js.map +1 -0
- package/dist/src/middleware/metrics.d.ts +8 -0
- package/dist/src/middleware/metrics.d.ts.map +1 -0
- package/dist/src/middleware/metrics.js +25 -0
- package/dist/src/middleware/metrics.js.map +1 -0
- package/dist/src/middleware/rate-limit.d.ts +4 -0
- package/dist/src/middleware/rate-limit.d.ts.map +1 -0
- package/dist/src/middleware/rate-limit.js +73 -0
- package/dist/src/middleware/rate-limit.js.map +1 -0
- package/dist/src/middleware/request-id.d.ts +18 -0
- package/dist/src/middleware/request-id.d.ts.map +1 -0
- package/dist/src/middleware/request-id.js +23 -0
- package/dist/src/middleware/request-id.js.map +1 -0
- package/dist/src/middleware/stats.d.ts +4 -0
- package/dist/src/middleware/stats.d.ts.map +1 -0
- package/dist/src/middleware/stats.js +11 -0
- package/dist/src/middleware/stats.js.map +1 -0
- package/dist/src/middleware/workspace-access.d.ts +16 -0
- package/dist/src/middleware/workspace-access.d.ts.map +1 -0
- package/dist/src/middleware/workspace-access.js +115 -0
- package/dist/src/middleware/workspace-access.js.map +1 -0
- package/dist/src/models/schemas.d.ts +311 -0
- package/dist/src/models/schemas.d.ts.map +1 -0
- package/dist/src/models/schemas.js +281 -0
- package/dist/src/models/schemas.js.map +1 -0
- package/dist/src/routes/actions.d.ts +5 -0
- package/dist/src/routes/actions.d.ts.map +1 -0
- package/dist/src/routes/actions.js +199 -0
- package/dist/src/routes/actions.js.map +1 -0
- package/dist/src/routes/admin-agents.d.ts +5 -0
- package/dist/src/routes/admin-agents.d.ts.map +1 -0
- package/dist/src/routes/admin-agents.js +60 -0
- package/dist/src/routes/admin-agents.js.map +1 -0
- package/dist/src/routes/admin-config.d.ts +7 -0
- package/dist/src/routes/admin-config.d.ts.map +1 -0
- package/dist/src/routes/admin-config.js +209 -0
- package/dist/src/routes/admin-config.js.map +1 -0
- package/dist/src/routes/admin-economy.d.ts +5 -0
- package/dist/src/routes/admin-economy.d.ts.map +1 -0
- package/dist/src/routes/admin-economy.js +57 -0
- package/dist/src/routes/admin-economy.js.map +1 -0
- package/dist/src/routes/admin-extensions.d.ts +6 -0
- package/dist/src/routes/admin-extensions.d.ts.map +1 -0
- package/dist/src/routes/admin-extensions.js +619 -0
- package/dist/src/routes/admin-extensions.js.map +1 -0
- package/dist/src/routes/admin-features.d.ts +16 -0
- package/dist/src/routes/admin-features.d.ts.map +1 -0
- package/dist/src/routes/admin-features.js +672 -0
- package/dist/src/routes/admin-features.js.map +1 -0
- package/dist/src/routes/admin-maintenance.d.ts +8 -0
- package/dist/src/routes/admin-maintenance.d.ts.map +1 -0
- package/dist/src/routes/admin-maintenance.js +86 -0
- package/dist/src/routes/admin-maintenance.js.map +1 -0
- package/dist/src/routes/admin-memory.d.ts +12 -0
- package/dist/src/routes/admin-memory.d.ts.map +1 -0
- package/dist/src/routes/admin-memory.js +64 -0
- package/dist/src/routes/admin-memory.js.map +1 -0
- package/dist/src/routes/admin-monitoring.d.ts +5 -0
- package/dist/src/routes/admin-monitoring.d.ts.map +1 -0
- package/dist/src/routes/admin-monitoring.js +343 -0
- package/dist/src/routes/admin-monitoring.js.map +1 -0
- package/dist/src/routes/admin-prompts.d.ts +5 -0
- package/dist/src/routes/admin-prompts.d.ts.map +1 -0
- package/dist/src/routes/admin-prompts.js +198 -0
- package/dist/src/routes/admin-prompts.js.map +1 -0
- package/dist/src/routes/admin-scheduler.d.ts +6 -0
- package/dist/src/routes/admin-scheduler.d.ts.map +1 -0
- package/dist/src/routes/admin-scheduler.js +153 -0
- package/dist/src/routes/admin-scheduler.js.map +1 -0
- package/dist/src/routes/admin.d.ts +10 -0
- package/dist/src/routes/admin.d.ts.map +1 -0
- package/dist/src/routes/admin.js +847 -0
- package/dist/src/routes/admin.js.map +1 -0
- package/dist/src/routes/agents.d.ts +5 -0
- package/dist/src/routes/agents.d.ts.map +1 -0
- package/dist/src/routes/agents.js +946 -0
- package/dist/src/routes/agents.js.map +1 -0
- package/dist/src/routes/app-store.d.ts +25 -0
- package/dist/src/routes/app-store.d.ts.map +1 -0
- package/dist/src/routes/app-store.js +269 -0
- package/dist/src/routes/app-store.js.map +1 -0
- package/dist/src/routes/appeals.d.ts +5 -0
- package/dist/src/routes/appeals.d.ts.map +1 -0
- package/dist/src/routes/appeals.js +241 -0
- package/dist/src/routes/appeals.js.map +1 -0
- package/dist/src/routes/apps.d.ts +14 -0
- package/dist/src/routes/apps.d.ts.map +1 -0
- package/dist/src/routes/apps.js +395 -0
- package/dist/src/routes/apps.js.map +1 -0
- package/dist/src/routes/auth.d.ts +13 -0
- package/dist/src/routes/auth.d.ts.map +1 -0
- package/dist/src/routes/auth.js +517 -0
- package/dist/src/routes/auth.js.map +1 -0
- package/dist/src/routes/boards.d.ts +5 -0
- package/dist/src/routes/boards.d.ts.map +1 -0
- package/dist/src/routes/boards.js +614 -0
- package/dist/src/routes/boards.js.map +1 -0
- package/dist/src/routes/bootstrap.d.ts +6 -0
- package/dist/src/routes/bootstrap.d.ts.map +1 -0
- package/dist/src/routes/bootstrap.js +360 -0
- package/dist/src/routes/bootstrap.js.map +1 -0
- package/dist/src/routes/calibrator.d.ts +28 -0
- package/dist/src/routes/calibrator.d.ts.map +1 -0
- package/dist/src/routes/calibrator.js +556 -0
- package/dist/src/routes/calibrator.js.map +1 -0
- package/dist/src/routes/catalogue.d.ts +7 -0
- package/dist/src/routes/catalogue.d.ts.map +1 -0
- package/dist/src/routes/catalogue.js +377 -0
- package/dist/src/routes/catalogue.js.map +1 -0
- package/dist/src/routes/chat-instances.d.ts +5 -0
- package/dist/src/routes/chat-instances.d.ts.map +1 -0
- package/dist/src/routes/chat-instances.js +131 -0
- package/dist/src/routes/chat-instances.js.map +1 -0
- package/dist/src/routes/consent.d.ts +6 -0
- package/dist/src/routes/consent.d.ts.map +1 -0
- package/dist/src/routes/consent.js +188 -0
- package/dist/src/routes/consent.js.map +1 -0
- package/dist/src/routes/cortex.d.ts +5 -0
- package/dist/src/routes/cortex.d.ts.map +1 -0
- package/dist/src/routes/cortex.js +617 -0
- package/dist/src/routes/cortex.js.map +1 -0
- package/dist/src/routes/csm.d.ts +5 -0
- package/dist/src/routes/csm.d.ts.map +1 -0
- package/dist/src/routes/csm.js +258 -0
- package/dist/src/routes/csm.js.map +1 -0
- package/dist/src/routes/disputes.d.ts +5 -0
- package/dist/src/routes/disputes.d.ts.map +1 -0
- package/dist/src/routes/disputes.js +528 -0
- package/dist/src/routes/disputes.js.map +1 -0
- package/dist/src/routes/extensions.d.ts +6 -0
- package/dist/src/routes/extensions.d.ts.map +1 -0
- package/dist/src/routes/extensions.js +1149 -0
- package/dist/src/routes/extensions.js.map +1 -0
- package/dist/src/routes/federation-genesis.d.ts +11 -0
- package/dist/src/routes/federation-genesis.d.ts.map +1 -0
- package/dist/src/routes/federation-genesis.js +638 -0
- package/dist/src/routes/federation-genesis.js.map +1 -0
- package/dist/src/routes/federation-peer.d.ts +10 -0
- package/dist/src/routes/federation-peer.d.ts.map +1 -0
- package/dist/src/routes/federation-peer.js +613 -0
- package/dist/src/routes/federation-peer.js.map +1 -0
- package/dist/src/routes/federation-settlements.d.ts +10 -0
- package/dist/src/routes/federation-settlements.d.ts.map +1 -0
- package/dist/src/routes/federation-settlements.js +231 -0
- package/dist/src/routes/federation-settlements.js.map +1 -0
- package/dist/src/routes/federation-sync.d.ts +15 -0
- package/dist/src/routes/federation-sync.d.ts.map +1 -0
- package/dist/src/routes/federation-sync.js +629 -0
- package/dist/src/routes/federation-sync.js.map +1 -0
- package/dist/src/routes/federation.d.ts +15 -0
- package/dist/src/routes/federation.d.ts.map +1 -0
- package/dist/src/routes/federation.js +23 -0
- package/dist/src/routes/federation.js.map +1 -0
- package/dist/src/routes/flags.d.ts +5 -0
- package/dist/src/routes/flags.d.ts.map +1 -0
- package/dist/src/routes/flags.js +194 -0
- package/dist/src/routes/flags.js.map +1 -0
- package/dist/src/routes/foundry.d.ts +5 -0
- package/dist/src/routes/foundry.d.ts.map +1 -0
- package/dist/src/routes/foundry.js +955 -0
- package/dist/src/routes/foundry.js.map +1 -0
- package/dist/src/routes/generator-autopilot.d.ts +12 -0
- package/dist/src/routes/generator-autopilot.d.ts.map +1 -0
- package/dist/src/routes/generator-autopilot.js +71 -0
- package/dist/src/routes/generator-autopilot.js.map +1 -0
- package/dist/src/routes/generator.d.ts +5 -0
- package/dist/src/routes/generator.d.ts.map +1 -0
- package/dist/src/routes/generator.js +1313 -0
- package/dist/src/routes/generator.js.map +1 -0
- package/dist/src/routes/ghii.d.ts +16 -0
- package/dist/src/routes/ghii.d.ts.map +1 -0
- package/dist/src/routes/ghii.js +1115 -0
- package/dist/src/routes/ghii.js.map +1 -0
- package/dist/src/routes/instances.d.ts +31 -0
- package/dist/src/routes/instances.d.ts.map +1 -0
- package/dist/src/routes/instances.js +722 -0
- package/dist/src/routes/instances.js.map +1 -0
- package/dist/src/routes/knowledge.d.ts +33 -0
- package/dist/src/routes/knowledge.d.ts.map +1 -0
- package/dist/src/routes/knowledge.js +1108 -0
- package/dist/src/routes/knowledge.js.map +1 -0
- package/dist/src/routes/lib-data.d.ts +7 -0
- package/dist/src/routes/lib-data.d.ts.map +1 -0
- package/dist/src/routes/lib-data.js +189 -0
- package/dist/src/routes/lib-data.js.map +1 -0
- package/dist/src/routes/lib-social.d.ts +7 -0
- package/dist/src/routes/lib-social.d.ts.map +1 -0
- package/dist/src/routes/lib-social.js +159 -0
- package/dist/src/routes/lib-social.js.map +1 -0
- package/dist/src/routes/lib-storage.d.ts +7 -0
- package/dist/src/routes/lib-storage.d.ts.map +1 -0
- package/dist/src/routes/lib-storage.js +202 -0
- package/dist/src/routes/lib-storage.js.map +1 -0
- package/dist/src/routes/lib-tunnel.d.ts +8 -0
- package/dist/src/routes/lib-tunnel.d.ts.map +1 -0
- package/dist/src/routes/lib-tunnel.js +442 -0
- package/dist/src/routes/lib-tunnel.js.map +1 -0
- package/dist/src/routes/lib-wallet.d.ts +7 -0
- package/dist/src/routes/lib-wallet.d.ts.map +1 -0
- package/dist/src/routes/lib-wallet.js +129 -0
- package/dist/src/routes/lib-wallet.js.map +1 -0
- package/dist/src/routes/lib-work.d.ts +7 -0
- package/dist/src/routes/lib-work.d.ts.map +1 -0
- package/dist/src/routes/lib-work.js +210 -0
- package/dist/src/routes/lib-work.js.map +1 -0
- package/dist/src/routes/libs.d.ts +10 -0
- package/dist/src/routes/libs.d.ts.map +1 -0
- package/dist/src/routes/libs.js +989 -0
- package/dist/src/routes/libs.js.map +1 -0
- package/dist/src/routes/matches.d.ts +10 -0
- package/dist/src/routes/matches.d.ts.map +1 -0
- package/dist/src/routes/matches.js +218 -0
- package/dist/src/routes/matches.js.map +1 -0
- package/dist/src/routes/memory.d.ts +6 -0
- package/dist/src/routes/memory.d.ts.map +1 -0
- package/dist/src/routes/memory.js +796 -0
- package/dist/src/routes/memory.js.map +1 -0
- package/dist/src/routes/micro-memory.d.ts +5 -0
- package/dist/src/routes/micro-memory.d.ts.map +1 -0
- package/dist/src/routes/micro-memory.js +488 -0
- package/dist/src/routes/micro-memory.js.map +1 -0
- package/dist/src/routes/msm.d.ts +5 -0
- package/dist/src/routes/msm.d.ts.map +1 -0
- package/dist/src/routes/msm.js +242 -0
- package/dist/src/routes/msm.js.map +1 -0
- package/dist/src/routes/openrouter.d.ts +23 -0
- package/dist/src/routes/openrouter.d.ts.map +1 -0
- package/dist/src/routes/openrouter.js +337 -0
- package/dist/src/routes/openrouter.js.map +1 -0
- package/dist/src/routes/organisms.d.ts +5 -0
- package/dist/src/routes/organisms.d.ts.map +1 -0
- package/dist/src/routes/organisms.js +415 -0
- package/dist/src/routes/organisms.js.map +1 -0
- package/dist/src/routes/owners.d.ts +5 -0
- package/dist/src/routes/owners.d.ts.map +1 -0
- package/dist/src/routes/owners.js +637 -0
- package/dist/src/routes/owners.js.map +1 -0
- package/dist/src/routes/packages.d.ts +35 -0
- package/dist/src/routes/packages.d.ts.map +1 -0
- package/dist/src/routes/packages.js +600 -0
- package/dist/src/routes/packages.js.map +1 -0
- package/dist/src/routes/permissions.d.ts +5 -0
- package/dist/src/routes/permissions.d.ts.map +1 -0
- package/dist/src/routes/permissions.js +85 -0
- package/dist/src/routes/permissions.js.map +1 -0
- package/dist/src/routes/personal.d.ts +7 -0
- package/dist/src/routes/personal.d.ts.map +1 -0
- package/dist/src/routes/personal.js +594 -0
- package/dist/src/routes/personal.js.map +1 -0
- package/dist/src/routes/portal-api.d.ts +9 -0
- package/dist/src/routes/portal-api.d.ts.map +1 -0
- package/dist/src/routes/portal-api.js +49 -0
- package/dist/src/routes/portal-api.js.map +1 -0
- package/dist/src/routes/portal-human.d.ts +12 -0
- package/dist/src/routes/portal-human.d.ts.map +1 -0
- package/dist/src/routes/portal-human.js +2652 -0
- package/dist/src/routes/portal-human.js.map +1 -0
- package/dist/src/routes/portal.d.ts +24 -0
- package/dist/src/routes/portal.d.ts.map +1 -0
- package/dist/src/routes/portal.js +372 -0
- package/dist/src/routes/portal.js.map +1 -0
- package/dist/src/routes/portfolio.d.ts +5 -0
- package/dist/src/routes/portfolio.d.ts.map +1 -0
- package/dist/src/routes/portfolio.js +231 -0
- package/dist/src/routes/portfolio.js.map +1 -0
- package/dist/src/routes/profile.d.ts +5 -0
- package/dist/src/routes/profile.d.ts.map +1 -0
- package/dist/src/routes/profile.js +2042 -0
- package/dist/src/routes/profile.js.map +1 -0
- package/dist/src/routes/prompts.d.ts +5 -0
- package/dist/src/routes/prompts.d.ts.map +1 -0
- package/dist/src/routes/prompts.js +318 -0
- package/dist/src/routes/prompts.js.map +1 -0
- package/dist/src/routes/push.d.ts +6 -0
- package/dist/src/routes/push.d.ts.map +1 -0
- package/dist/src/routes/push.js +75 -0
- package/dist/src/routes/push.js.map +1 -0
- package/dist/src/routes/realtime.d.ts +7 -0
- package/dist/src/routes/realtime.d.ts.map +1 -0
- package/dist/src/routes/realtime.js +289 -0
- package/dist/src/routes/realtime.js.map +1 -0
- package/dist/src/routes/schemas.d.ts +5 -0
- package/dist/src/routes/schemas.d.ts.map +1 -0
- package/dist/src/routes/schemas.js +130 -0
- package/dist/src/routes/schemas.js.map +1 -0
- package/dist/src/routes/setup.d.ts +7 -0
- package/dist/src/routes/setup.d.ts.map +1 -0
- package/dist/src/routes/setup.js +243 -0
- package/dist/src/routes/setup.js.map +1 -0
- package/dist/src/routes/site.d.ts +6 -0
- package/dist/src/routes/site.d.ts.map +1 -0
- package/dist/src/routes/site.js +201 -0
- package/dist/src/routes/site.js.map +1 -0
- package/dist/src/routes/spec.d.ts +3 -0
- package/dist/src/routes/spec.d.ts.map +1 -0
- package/dist/src/routes/spec.js +47 -0
- package/dist/src/routes/spec.js.map +1 -0
- package/dist/src/routes/sse.d.ts +5 -0
- package/dist/src/routes/sse.d.ts.map +1 -0
- package/dist/src/routes/sse.js +66 -0
- package/dist/src/routes/sse.js.map +1 -0
- package/dist/src/routes/stats.d.ts +7 -0
- package/dist/src/routes/stats.d.ts.map +1 -0
- package/dist/src/routes/stats.js +98 -0
- package/dist/src/routes/stats.js.map +1 -0
- package/dist/src/routes/storage-files.d.ts +5 -0
- package/dist/src/routes/storage-files.d.ts.map +1 -0
- package/dist/src/routes/storage-files.js +460 -0
- package/dist/src/routes/storage-files.js.map +1 -0
- package/dist/src/routes/templates.d.ts +30 -0
- package/dist/src/routes/templates.d.ts.map +1 -0
- package/dist/src/routes/templates.js +511 -0
- package/dist/src/routes/templates.js.map +1 -0
- package/dist/src/routes/totp.d.ts +5 -0
- package/dist/src/routes/totp.d.ts.map +1 -0
- package/dist/src/routes/totp.js +166 -0
- package/dist/src/routes/totp.js.map +1 -0
- package/dist/src/routes/validate.d.ts +4 -0
- package/dist/src/routes/validate.d.ts.map +1 -0
- package/dist/src/routes/validate.js +71 -0
- package/dist/src/routes/validate.js.map +1 -0
- package/dist/src/routes/verification.d.ts +8 -0
- package/dist/src/routes/verification.d.ts.map +1 -0
- package/dist/src/routes/verification.js +259 -0
- package/dist/src/routes/verification.js.map +1 -0
- package/dist/src/routes/wallet.d.ts +18 -0
- package/dist/src/routes/wallet.d.ts.map +1 -0
- package/dist/src/routes/wallet.js +164 -0
- package/dist/src/routes/wallet.js.map +1 -0
- package/dist/src/routes/wellknown.d.ts +5 -0
- package/dist/src/routes/wellknown.d.ts.map +1 -0
- package/dist/src/routes/wellknown.js +57 -0
- package/dist/src/routes/wellknown.js.map +1 -0
- package/dist/src/routes/work.d.ts +21 -0
- package/dist/src/routes/work.d.ts.map +1 -0
- package/dist/src/routes/work.js +654 -0
- package/dist/src/routes/work.js.map +1 -0
- package/dist/src/schemas/knowledge-package.d.ts +203 -0
- package/dist/src/schemas/knowledge-package.d.ts.map +1 -0
- package/dist/src/schemas/knowledge-package.js +233 -0
- package/dist/src/schemas/knowledge-package.js.map +1 -0
- package/dist/src/server-bootstrap/config-init.d.ts +16 -0
- package/dist/src/server-bootstrap/config-init.d.ts.map +1 -0
- package/dist/src/server-bootstrap/config-init.js +113 -0
- package/dist/src/server-bootstrap/config-init.js.map +1 -0
- package/dist/src/server-bootstrap/middleware-guards.d.ts +15 -0
- package/dist/src/server-bootstrap/middleware-guards.d.ts.map +1 -0
- package/dist/src/server-bootstrap/middleware-guards.js +244 -0
- package/dist/src/server-bootstrap/middleware-guards.js.map +1 -0
- package/dist/src/server-bootstrap/routes-loader.d.ts +35 -0
- package/dist/src/server-bootstrap/routes-loader.d.ts.map +1 -0
- package/dist/src/server-bootstrap/routes-loader.js +290 -0
- package/dist/src/server-bootstrap/routes-loader.js.map +1 -0
- package/dist/src/server-bootstrap/service-init.d.ts +24 -0
- package/dist/src/server-bootstrap/service-init.d.ts.map +1 -0
- package/dist/src/server-bootstrap/service-init.js +195 -0
- package/dist/src/server-bootstrap/service-init.js.map +1 -0
- package/dist/src/server-bootstrap/static-files.d.ts +7 -0
- package/dist/src/server-bootstrap/static-files.d.ts.map +1 -0
- package/dist/src/server-bootstrap/static-files.js +119 -0
- package/dist/src/server-bootstrap/static-files.js.map +1 -0
- package/dist/src/server.d.ts +22 -0
- package/dist/src/server.d.ts.map +1 -0
- package/dist/src/server.js +133 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/services/cache-cleanup.d.ts +31 -0
- package/dist/src/services/cache-cleanup.d.ts.map +1 -0
- package/dist/src/services/cache-cleanup.js +123 -0
- package/dist/src/services/cache-cleanup.js.map +1 -0
- package/dist/src/services/catalogue-sync.d.ts +45 -0
- package/dist/src/services/catalogue-sync.d.ts.map +1 -0
- package/dist/src/services/catalogue-sync.js +196 -0
- package/dist/src/services/catalogue-sync.js.map +1 -0
- package/dist/src/services/component-registrar.d.ts +46 -0
- package/dist/src/services/component-registrar.d.ts.map +1 -0
- package/dist/src/services/component-registrar.js +389 -0
- package/dist/src/services/component-registrar.js.map +1 -0
- package/dist/src/services/config-loader.d.ts +42 -0
- package/dist/src/services/config-loader.d.ts.map +1 -0
- package/dist/src/services/config-loader.js +187 -0
- package/dist/src/services/config-loader.js.map +1 -0
- package/dist/src/services/config-provenance.d.ts +32 -0
- package/dist/src/services/config-provenance.d.ts.map +1 -0
- package/dist/src/services/config-provenance.js +59 -0
- package/dist/src/services/config-provenance.js.map +1 -0
- package/dist/src/services/config-schema.d.ts +52 -0
- package/dist/src/services/config-schema.d.ts.map +1 -0
- package/dist/src/services/config-schema.js +288 -0
- package/dist/src/services/config-schema.js.map +1 -0
- package/dist/src/services/consent.d.ts +43 -0
- package/dist/src/services/consent.d.ts.map +1 -0
- package/dist/src/services/consent.js +137 -0
- package/dist/src/services/consent.js.map +1 -0
- package/dist/src/services/consul-config.d.ts +30 -0
- package/dist/src/services/consul-config.d.ts.map +1 -0
- package/dist/src/services/consul-config.js +110 -0
- package/dist/src/services/consul-config.js.map +1 -0
- package/dist/src/services/core-jobs.d.ts +8 -0
- package/dist/src/services/core-jobs.d.ts.map +1 -0
- package/dist/src/services/core-jobs.js +161 -0
- package/dist/src/services/core-jobs.js.map +1 -0
- package/dist/src/services/cortex-manifest.d.ts +17 -0
- package/dist/src/services/cortex-manifest.d.ts.map +1 -0
- package/dist/src/services/cortex-manifest.js +343 -0
- package/dist/src/services/cortex-manifest.js.map +1 -0
- package/dist/src/services/cortex-seeder.d.ts +18 -0
- package/dist/src/services/cortex-seeder.d.ts.map +1 -0
- package/dist/src/services/cortex-seeder.js +86 -0
- package/dist/src/services/cortex-seeder.js.map +1 -0
- package/dist/src/services/cross-node-matching.d.ts +23 -0
- package/dist/src/services/cross-node-matching.d.ts.map +1 -0
- package/dist/src/services/cross-node-matching.js +62 -0
- package/dist/src/services/cross-node-matching.js.map +1 -0
- package/dist/src/services/csm-parser.d.ts +57 -0
- package/dist/src/services/csm-parser.d.ts.map +1 -0
- package/dist/src/services/csm-parser.js +161 -0
- package/dist/src/services/csm-parser.js.map +1 -0
- package/dist/src/services/csm-seed.d.ts +15 -0
- package/dist/src/services/csm-seed.d.ts.map +1 -0
- package/dist/src/services/csm-seed.js +89 -0
- package/dist/src/services/csm-seed.js.map +1 -0
- package/dist/src/services/directory.d.ts +86 -0
- package/dist/src/services/directory.d.ts.map +1 -0
- package/dist/src/services/directory.js +307 -0
- package/dist/src/services/directory.js.map +1 -0
- package/dist/src/services/email-templates.d.ts +29 -0
- package/dist/src/services/email-templates.d.ts.map +1 -0
- package/dist/src/services/email-templates.js +204 -0
- package/dist/src/services/email-templates.js.map +1 -0
- package/dist/src/services/email.d.ts +18 -0
- package/dist/src/services/email.d.ts.map +1 -0
- package/dist/src/services/email.js +102 -0
- package/dist/src/services/email.js.map +1 -0
- package/dist/src/services/encryption.d.ts +31 -0
- package/dist/src/services/encryption.d.ts.map +1 -0
- package/dist/src/services/encryption.js +51 -0
- package/dist/src/services/encryption.js.map +1 -0
- package/dist/src/services/eudiw.d.ts +15 -0
- package/dist/src/services/eudiw.d.ts.map +1 -0
- package/dist/src/services/eudiw.js +89 -0
- package/dist/src/services/eudiw.js.map +1 -0
- package/dist/src/services/event-bus.d.ts +8 -0
- package/dist/src/services/event-bus.d.ts.map +1 -0
- package/dist/src/services/event-bus.js +13 -0
- package/dist/src/services/event-bus.js.map +1 -0
- package/dist/src/services/extension-runtime.d.ts +72 -0
- package/dist/src/services/extension-runtime.d.ts.map +1 -0
- package/dist/src/services/extension-runtime.js +282 -0
- package/dist/src/services/extension-runtime.js.map +1 -0
- package/dist/src/services/federation-helpers.d.ts +37 -0
- package/dist/src/services/federation-helpers.d.ts.map +1 -0
- package/dist/src/services/federation-helpers.js +100 -0
- package/dist/src/services/federation-helpers.js.map +1 -0
- package/dist/src/services/federation.d.ts +32 -0
- package/dist/src/services/federation.d.ts.map +1 -0
- package/dist/src/services/federation.js +201 -0
- package/dist/src/services/federation.js.map +1 -0
- package/dist/src/services/foundry-debug.d.ts +77 -0
- package/dist/src/services/foundry-debug.d.ts.map +1 -0
- package/dist/src/services/foundry-debug.js +214 -0
- package/dist/src/services/foundry-debug.js.map +1 -0
- package/dist/src/services/foundry-registration.d.ts +42 -0
- package/dist/src/services/foundry-registration.d.ts.map +1 -0
- package/dist/src/services/foundry-registration.js +330 -0
- package/dist/src/services/foundry-registration.js.map +1 -0
- package/dist/src/services/foundry-testing.d.ts +90 -0
- package/dist/src/services/foundry-testing.d.ts.map +1 -0
- package/dist/src/services/foundry-testing.js +253 -0
- package/dist/src/services/foundry-testing.js.map +1 -0
- package/dist/src/services/foundry-validate.d.ts +115 -0
- package/dist/src/services/foundry-validate.d.ts.map +1 -0
- package/dist/src/services/foundry-validate.js +781 -0
- package/dist/src/services/foundry-validate.js.map +1 -0
- package/dist/src/services/generator-autopilot.d.ts +37 -0
- package/dist/src/services/generator-autopilot.d.ts.map +1 -0
- package/dist/src/services/generator-autopilot.js +1076 -0
- package/dist/src/services/generator-autopilot.js.map +1 -0
- package/dist/src/services/generator-debug.d.ts +79 -0
- package/dist/src/services/generator-debug.d.ts.map +1 -0
- package/dist/src/services/generator-debug.js +218 -0
- package/dist/src/services/generator-debug.js.map +1 -0
- package/dist/src/services/generator-prompt-seeds.d.ts +13 -0
- package/dist/src/services/generator-prompt-seeds.d.ts.map +1 -0
- package/dist/src/services/generator-prompt-seeds.js +2694 -0
- package/dist/src/services/generator-prompt-seeds.js.map +1 -0
- package/dist/src/services/generator-prompts/bundle.d.ts +17 -0
- package/dist/src/services/generator-prompts/bundle.d.ts.map +1 -0
- package/dist/src/services/generator-prompts/bundle.js +95 -0
- package/dist/src/services/generator-prompts/bundle.js.map +1 -0
- package/dist/src/services/generator-prompts/index.d.ts +48 -0
- package/dist/src/services/generator-prompts/index.d.ts.map +1 -0
- package/dist/src/services/generator-prompts/index.js +97 -0
- package/dist/src/services/generator-prompts/index.js.map +1 -0
- package/dist/src/services/generator-prompts/resolvers.d.ts +21 -0
- package/dist/src/services/generator-prompts/resolvers.d.ts.map +1 -0
- package/dist/src/services/generator-prompts/resolvers.js +1553 -0
- package/dist/src/services/generator-prompts/resolvers.js.map +1 -0
- package/dist/src/services/generator-prompts/spec-validate.d.ts +29 -0
- package/dist/src/services/generator-prompts/spec-validate.d.ts.map +1 -0
- package/dist/src/services/generator-prompts/spec-validate.js +190 -0
- package/dist/src/services/generator-prompts/spec-validate.js.map +1 -0
- package/dist/src/services/generator-prompts/strip.d.ts +13 -0
- package/dist/src/services/generator-prompts/strip.d.ts.map +1 -0
- package/dist/src/services/generator-prompts/strip.js +60 -0
- package/dist/src/services/generator-prompts/strip.js.map +1 -0
- package/dist/src/services/generator-prompts/types.d.ts +229 -0
- package/dist/src/services/generator-prompts/types.d.ts.map +1 -0
- package/dist/src/services/generator-prompts/types.js +8 -0
- package/dist/src/services/generator-prompts/types.js.map +1 -0
- package/dist/src/services/generator-prompts/validate.d.ts +48 -0
- package/dist/src/services/generator-prompts/validate.d.ts.map +1 -0
- package/dist/src/services/generator-prompts/validate.js +927 -0
- package/dist/src/services/generator-prompts/validate.js.map +1 -0
- package/dist/src/services/generator-registration.d.ts +43 -0
- package/dist/src/services/generator-registration.d.ts.map +1 -0
- package/dist/src/services/generator-registration.js +343 -0
- package/dist/src/services/generator-registration.js.map +1 -0
- package/dist/src/services/generator-testing.d.ts +93 -0
- package/dist/src/services/generator-testing.d.ts.map +1 -0
- package/dist/src/services/generator-testing.js +300 -0
- package/dist/src/services/generator-testing.js.map +1 -0
- package/dist/src/services/generator-validate.d.ts +117 -0
- package/dist/src/services/generator-validate.d.ts.map +1 -0
- package/dist/src/services/generator-validate.js +790 -0
- package/dist/src/services/generator-validate.js.map +1 -0
- package/dist/src/services/genesis-peering.d.ts +12 -0
- package/dist/src/services/genesis-peering.d.ts.map +1 -0
- package/dist/src/services/genesis-peering.js +91 -0
- package/dist/src/services/genesis-peering.js.map +1 -0
- package/dist/src/services/genesis-sync.d.ts +29 -0
- package/dist/src/services/genesis-sync.d.ts.map +1 -0
- package/dist/src/services/genesis-sync.js +370 -0
- package/dist/src/services/genesis-sync.js.map +1 -0
- package/dist/src/services/hooks.d.ts +21 -0
- package/dist/src/services/hooks.d.ts.map +1 -0
- package/dist/src/services/hooks.js +85 -0
- package/dist/src/services/hooks.js.map +1 -0
- package/dist/src/services/job-seeding.d.ts +7 -0
- package/dist/src/services/job-seeding.d.ts.map +1 -0
- package/dist/src/services/job-seeding.js +39 -0
- package/dist/src/services/job-seeding.js.map +1 -0
- package/dist/src/services/knowledge.d.ts +13 -0
- package/dist/src/services/knowledge.d.ts.map +1 -0
- package/dist/src/services/knowledge.js +15 -0
- package/dist/src/services/knowledge.js.map +1 -0
- package/dist/src/services/mailbox-notification.d.ts +37 -0
- package/dist/src/services/mailbox-notification.d.ts.map +1 -0
- package/dist/src/services/mailbox-notification.js +249 -0
- package/dist/src/services/mailbox-notification.js.map +1 -0
- package/dist/src/services/mailbox.d.ts +16 -0
- package/dist/src/services/mailbox.d.ts.map +1 -0
- package/dist/src/services/mailbox.js +77 -0
- package/dist/src/services/mailbox.js.map +1 -0
- package/dist/src/services/match-notification.d.ts +12 -0
- package/dist/src/services/match-notification.d.ts.map +1 -0
- package/dist/src/services/match-notification.js +121 -0
- package/dist/src/services/match-notification.js.map +1 -0
- package/dist/src/services/matching.d.ts +54 -0
- package/dist/src/services/matching.d.ts.map +1 -0
- package/dist/src/services/matching.js +293 -0
- package/dist/src/services/matching.js.map +1 -0
- package/dist/src/services/memory-replication.d.ts +43 -0
- package/dist/src/services/memory-replication.d.ts.map +1 -0
- package/dist/src/services/memory-replication.js +213 -0
- package/dist/src/services/memory-replication.js.map +1 -0
- package/dist/src/services/morsel.d.ts +49 -0
- package/dist/src/services/morsel.d.ts.map +1 -0
- package/dist/src/services/morsel.js +174 -0
- package/dist/src/services/morsel.js.map +1 -0
- package/dist/src/services/msm-parser.d.ts +55 -0
- package/dist/src/services/msm-parser.d.ts.map +1 -0
- package/dist/src/services/msm-parser.js +186 -0
- package/dist/src/services/msm-parser.js.map +1 -0
- package/dist/src/services/mydata-receipt.d.ts +29 -0
- package/dist/src/services/mydata-receipt.d.ts.map +1 -0
- package/dist/src/services/mydata-receipt.js +31 -0
- package/dist/src/services/mydata-receipt.js.map +1 -0
- package/dist/src/services/notification-templates.d.ts +40 -0
- package/dist/src/services/notification-templates.d.ts.map +1 -0
- package/dist/src/services/notification-templates.js +109 -0
- package/dist/src/services/notification-templates.js.map +1 -0
- package/dist/src/services/openrouter.d.ts +30 -0
- package/dist/src/services/openrouter.d.ts.map +1 -0
- package/dist/src/services/openrouter.js +95 -0
- package/dist/src/services/openrouter.js.map +1 -0
- package/dist/src/services/organism-reputation.d.ts +7 -0
- package/dist/src/services/organism-reputation.d.ts.map +1 -0
- package/dist/src/services/organism-reputation.js +107 -0
- package/dist/src/services/organism-reputation.js.map +1 -0
- package/dist/src/services/package-hash.d.ts +19 -0
- package/dist/src/services/package-hash.d.ts.map +1 -0
- package/dist/src/services/package-hash.js +22 -0
- package/dist/src/services/package-hash.js.map +1 -0
- package/dist/src/services/package-zip.d.ts +60 -0
- package/dist/src/services/package-zip.d.ts.map +1 -0
- package/dist/src/services/package-zip.js +267 -0
- package/dist/src/services/package-zip.js.map +1 -0
- package/dist/src/services/password.d.ts +9 -0
- package/dist/src/services/password.d.ts.map +1 -0
- package/dist/src/services/password.js +32 -0
- package/dist/src/services/password.js.map +1 -0
- package/dist/src/services/personal-routing.d.ts +21 -0
- package/dist/src/services/personal-routing.d.ts.map +1 -0
- package/dist/src/services/personal-routing.js +77 -0
- package/dist/src/services/personal-routing.js.map +1 -0
- package/dist/src/services/personal-tunnel.d.ts +39 -0
- package/dist/src/services/personal-tunnel.d.ts.map +1 -0
- package/dist/src/services/personal-tunnel.js +371 -0
- package/dist/src/services/personal-tunnel.js.map +1 -0
- package/dist/src/services/profile-schemas.d.ts +12 -0
- package/dist/src/services/profile-schemas.d.ts.map +1 -0
- package/dist/src/services/profile-schemas.js +100 -0
- package/dist/src/services/profile-schemas.js.map +1 -0
- package/dist/src/services/prometheus.d.ts +32 -0
- package/dist/src/services/prometheus.d.ts.map +1 -0
- package/dist/src/services/prometheus.js +162 -0
- package/dist/src/services/prometheus.js.map +1 -0
- package/dist/src/services/prompt-defaults.d.ts +33 -0
- package/dist/src/services/prompt-defaults.d.ts.map +1 -0
- package/dist/src/services/prompt-defaults.js +1675 -0
- package/dist/src/services/prompt-defaults.js.map +1 -0
- package/dist/src/services/prompt-seeder.d.ts +8 -0
- package/dist/src/services/prompt-seeder.d.ts.map +1 -0
- package/dist/src/services/prompt-seeder.js +65 -0
- package/dist/src/services/prompt-seeder.js.map +1 -0
- package/dist/src/services/prompt-variables.d.ts +15 -0
- package/dist/src/services/prompt-variables.d.ts.map +1 -0
- package/dist/src/services/prompt-variables.js +34 -0
- package/dist/src/services/prompt-variables.js.map +1 -0
- package/dist/src/services/push.d.ts +26 -0
- package/dist/src/services/push.d.ts.map +1 -0
- package/dist/src/services/push.js +70 -0
- package/dist/src/services/push.js.map +1 -0
- package/dist/src/services/quota.d.ts +45 -0
- package/dist/src/services/quota.d.ts.map +1 -0
- package/dist/src/services/quota.js +129 -0
- package/dist/src/services/quota.js.map +1 -0
- package/dist/src/services/realtime-manager.d.ts +144 -0
- package/dist/src/services/realtime-manager.d.ts.map +1 -0
- package/dist/src/services/realtime-manager.js +640 -0
- package/dist/src/services/realtime-manager.js.map +1 -0
- package/dist/src/services/scheduler.d.ts +55 -0
- package/dist/src/services/scheduler.d.ts.map +1 -0
- package/dist/src/services/scheduler.js +420 -0
- package/dist/src/services/scheduler.js.map +1 -0
- package/dist/src/services/schema-validator.d.ts +20 -0
- package/dist/src/services/schema-validator.d.ts.map +1 -0
- package/dist/src/services/schema-validator.js +68 -0
- package/dist/src/services/schema-validator.js.map +1 -0
- package/dist/src/services/site-sync.d.ts +15 -0
- package/dist/src/services/site-sync.d.ts.map +1 -0
- package/dist/src/services/site-sync.js +99 -0
- package/dist/src/services/site-sync.js.map +1 -0
- package/dist/src/services/site.d.ts +65 -0
- package/dist/src/services/site.d.ts.map +1 -0
- package/dist/src/services/site.js +378 -0
- package/dist/src/services/site.js.map +1 -0
- package/dist/src/services/stats.d.ts +75 -0
- package/dist/src/services/stats.d.ts.map +1 -0
- package/dist/src/services/stats.js +124 -0
- package/dist/src/services/stats.js.map +1 -0
- package/dist/src/services/sync-health.d.ts +53 -0
- package/dist/src/services/sync-health.d.ts.map +1 -0
- package/dist/src/services/sync-health.js +122 -0
- package/dist/src/services/sync-health.js.map +1 -0
- package/dist/src/services/sync-scheduler.d.ts +25 -0
- package/dist/src/services/sync-scheduler.d.ts.map +1 -0
- package/dist/src/services/sync-scheduler.js +211 -0
- package/dist/src/services/sync-scheduler.js.map +1 -0
- package/dist/src/services/totp.d.ts +31 -0
- package/dist/src/services/totp.d.ts.map +1 -0
- package/dist/src/services/totp.js +96 -0
- package/dist/src/services/totp.js.map +1 -0
- package/dist/src/services/trust-broadcast.d.ts +37 -0
- package/dist/src/services/trust-broadcast.d.ts.map +1 -0
- package/dist/src/services/trust-broadcast.js +107 -0
- package/dist/src/services/trust-broadcast.js.map +1 -0
- package/dist/src/services/trust.d.ts +16 -0
- package/dist/src/services/trust.d.ts.map +1 -0
- package/dist/src/services/trust.js +109 -0
- package/dist/src/services/trust.js.map +1 -0
- package/dist/src/services/vc-issuer.d.ts +14 -0
- package/dist/src/services/vc-issuer.d.ts.map +1 -0
- package/dist/src/services/vc-issuer.js +24 -0
- package/dist/src/services/vc-issuer.js.map +1 -0
- package/dist/src/storage/interface.d.ts +1161 -0
- package/dist/src/storage/interface.d.ts.map +1 -0
- package/dist/src/storage/interface.js +2 -0
- package/dist/src/storage/interface.js.map +1 -0
- package/dist/src/storage/pattern-utils.d.ts +20 -0
- package/dist/src/storage/pattern-utils.d.ts.map +1 -0
- package/dist/src/storage/pattern-utils.js +57 -0
- package/dist/src/storage/pattern-utils.js.map +1 -0
- package/dist/src/storage/providers/mongodb/index.d.ts +608 -0
- package/dist/src/storage/providers/mongodb/index.d.ts.map +1 -0
- package/dist/src/storage/providers/mongodb/index.js +4931 -0
- package/dist/src/storage/providers/mongodb/index.js.map +1 -0
- package/dist/src/storage/providers/sqlite/index.d.ts +602 -0
- package/dist/src/storage/providers/sqlite/index.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/index.js +4156 -0
- package/dist/src/storage/providers/sqlite/index.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/action.d.ts +13 -0
- package/dist/src/storage/providers/sqlite/repos/action.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/action.js +79 -0
- package/dist/src/storage/providers/sqlite/repos/action.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/agent.d.ts +13 -0
- package/dist/src/storage/providers/sqlite/repos/agent.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/agent.js +103 -0
- package/dist/src/storage/providers/sqlite/repos/agent.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/auth.d.ts +56 -0
- package/dist/src/storage/providers/sqlite/repos/auth.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/auth.js +282 -0
- package/dist/src/storage/providers/sqlite/repos/auth.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/board.d.ts +24 -0
- package/dist/src/storage/providers/sqlite/repos/board.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/board.js +154 -0
- package/dist/src/storage/providers/sqlite/repos/board.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/community.d.ts +33 -0
- package/dist/src/storage/providers/sqlite/repos/community.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/community.js +202 -0
- package/dist/src/storage/providers/sqlite/repos/community.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/consent.d.ts +23 -0
- package/dist/src/storage/providers/sqlite/repos/consent.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/consent.js +187 -0
- package/dist/src/storage/providers/sqlite/repos/consent.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/dispute.d.ts +20 -0
- package/dist/src/storage/providers/sqlite/repos/dispute.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/dispute.js +118 -0
- package/dist/src/storage/providers/sqlite/repos/dispute.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/flag.d.ts +26 -0
- package/dist/src/storage/providers/sqlite/repos/flag.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/flag.js +147 -0
- package/dist/src/storage/providers/sqlite/repos/flag.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/identity.d.ts +36 -0
- package/dist/src/storage/providers/sqlite/repos/identity.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/identity.js +297 -0
- package/dist/src/storage/providers/sqlite/repos/identity.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/mailbox.d.ts +18 -0
- package/dist/src/storage/providers/sqlite/repos/mailbox.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/mailbox.js +91 -0
- package/dist/src/storage/providers/sqlite/repos/mailbox.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/memory.d.ts +28 -0
- package/dist/src/storage/providers/sqlite/repos/memory.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/memory.js +152 -0
- package/dist/src/storage/providers/sqlite/repos/memory.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/owner.d.ts +14 -0
- package/dist/src/storage/providers/sqlite/repos/owner.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/owner.js +124 -0
- package/dist/src/storage/providers/sqlite/repos/owner.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/service-manifest.d.ts +17 -0
- package/dist/src/storage/providers/sqlite/repos/service-manifest.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/service-manifest.js +114 -0
- package/dist/src/storage/providers/sqlite/repos/service-manifest.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/storage-file.d.ts +19 -0
- package/dist/src/storage/providers/sqlite/repos/storage-file.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/storage-file.js +128 -0
- package/dist/src/storage/providers/sqlite/repos/storage-file.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/work.d.ts +13 -0
- package/dist/src/storage/providers/sqlite/repos/work.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/work.js +86 -0
- package/dist/src/storage/providers/sqlite/repos/work.js.map +1 -0
- package/dist/src/storage/providers/sqlite/schema.d.ts +7 -0
- package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/schema.js +1090 -0
- package/dist/src/storage/providers/sqlite/schema.js.map +1 -0
- package/dist/src/storage/repositories/action.repository.d.ts +14 -0
- package/dist/src/storage/repositories/action.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/action.repository.js +2 -0
- package/dist/src/storage/repositories/action.repository.js.map +1 -0
- package/dist/src/storage/repositories/agent.repository.d.ts +18 -0
- package/dist/src/storage/repositories/agent.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/agent.repository.js +2 -0
- package/dist/src/storage/repositories/agent.repository.js.map +1 -0
- package/dist/src/storage/repositories/app-marketplace.repository.d.ts +9 -0
- package/dist/src/storage/repositories/app-marketplace.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/app-marketplace.repository.js +2 -0
- package/dist/src/storage/repositories/app-marketplace.repository.js.map +1 -0
- package/dist/src/storage/repositories/app.repository.d.ts +17 -0
- package/dist/src/storage/repositories/app.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/app.repository.js +2 -0
- package/dist/src/storage/repositories/app.repository.js.map +1 -0
- package/dist/src/storage/repositories/auth.repository.d.ts +6 -0
- package/dist/src/storage/repositories/auth.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/auth.repository.js +2 -0
- package/dist/src/storage/repositories/auth.repository.js.map +1 -0
- package/dist/src/storage/repositories/board.repository.d.ts +27 -0
- package/dist/src/storage/repositories/board.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/board.repository.js +2 -0
- package/dist/src/storage/repositories/board.repository.js.map +1 -0
- package/dist/src/storage/repositories/catalogue.repository.d.ts +18 -0
- package/dist/src/storage/repositories/catalogue.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/catalogue.repository.js +2 -0
- package/dist/src/storage/repositories/catalogue.repository.js.map +1 -0
- package/dist/src/storage/repositories/config.repository.d.ts +17 -0
- package/dist/src/storage/repositories/config.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/config.repository.js +2 -0
- package/dist/src/storage/repositories/config.repository.js.map +1 -0
- package/dist/src/storage/repositories/consent.repository.d.ts +19 -0
- package/dist/src/storage/repositories/consent.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/consent.repository.js +2 -0
- package/dist/src/storage/repositories/consent.repository.js.map +1 -0
- package/dist/src/storage/repositories/device-auth.repository.d.ts +11 -0
- package/dist/src/storage/repositories/device-auth.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/device-auth.repository.js +2 -0
- package/dist/src/storage/repositories/device-auth.repository.js.map +1 -0
- package/dist/src/storage/repositories/dispute.repository.d.ts +12 -0
- package/dist/src/storage/repositories/dispute.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/dispute.repository.js +2 -0
- package/dist/src/storage/repositories/dispute.repository.js.map +1 -0
- package/dist/src/storage/repositories/extension-instance.repository.d.ts +9 -0
- package/dist/src/storage/repositories/extension-instance.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/extension-instance.repository.js +2 -0
- package/dist/src/storage/repositories/extension-instance.repository.js.map +1 -0
- package/dist/src/storage/repositories/federation.repository.d.ts +37 -0
- package/dist/src/storage/repositories/federation.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/federation.repository.js +2 -0
- package/dist/src/storage/repositories/federation.repository.js.map +1 -0
- package/dist/src/storage/repositories/file.repository.d.ts +14 -0
- package/dist/src/storage/repositories/file.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/file.repository.js +2 -0
- package/dist/src/storage/repositories/file.repository.js.map +1 -0
- package/dist/src/storage/repositories/identity.repository.d.ts +29 -0
- package/dist/src/storage/repositories/identity.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/identity.repository.js +2 -0
- package/dist/src/storage/repositories/identity.repository.js.map +1 -0
- package/dist/src/storage/repositories/index.d.ts +34 -0
- package/dist/src/storage/repositories/index.d.ts.map +1 -0
- package/dist/src/storage/repositories/index.js +2 -0
- package/dist/src/storage/repositories/index.js.map +1 -0
- package/dist/src/storage/repositories/knowledge.repository.d.ts +18 -0
- package/dist/src/storage/repositories/knowledge.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/knowledge.repository.js +2 -0
- package/dist/src/storage/repositories/knowledge.repository.js.map +1 -0
- package/dist/src/storage/repositories/marketplace.repository.d.ts +23 -0
- package/dist/src/storage/repositories/marketplace.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/marketplace.repository.js +2 -0
- package/dist/src/storage/repositories/marketplace.repository.js.map +1 -0
- package/dist/src/storage/repositories/memory.repository.d.ts +32 -0
- package/dist/src/storage/repositories/memory.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/memory.repository.js +2 -0
- package/dist/src/storage/repositories/memory.repository.js.map +1 -0
- package/dist/src/storage/repositories/micro-memory.repository.d.ts +10 -0
- package/dist/src/storage/repositories/micro-memory.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/micro-memory.repository.js +2 -0
- package/dist/src/storage/repositories/micro-memory.repository.js.map +1 -0
- package/dist/src/storage/repositories/moderation.repository.d.ts +36 -0
- package/dist/src/storage/repositories/moderation.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/moderation.repository.js +2 -0
- package/dist/src/storage/repositories/moderation.repository.js.map +1 -0
- package/dist/src/storage/repositories/node.repository.d.ts +59 -0
- package/dist/src/storage/repositories/node.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/node.repository.js +2 -0
- package/dist/src/storage/repositories/node.repository.js.map +1 -0
- package/dist/src/storage/repositories/notification-template.repository.d.ts +8 -0
- package/dist/src/storage/repositories/notification-template.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/notification-template.repository.js +2 -0
- package/dist/src/storage/repositories/notification-template.repository.js.map +1 -0
- package/dist/src/storage/repositories/notification.repository.d.ts +14 -0
- package/dist/src/storage/repositories/notification.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/notification.repository.js +2 -0
- package/dist/src/storage/repositories/notification.repository.js.map +1 -0
- package/dist/src/storage/repositories/oauth.repository.d.ts +19 -0
- package/dist/src/storage/repositories/oauth.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/oauth.repository.js +2 -0
- package/dist/src/storage/repositories/oauth.repository.js.map +1 -0
- package/dist/src/storage/repositories/organism.repository.d.ts +34 -0
- package/dist/src/storage/repositories/organism.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/organism.repository.js +2 -0
- package/dist/src/storage/repositories/organism.repository.js.map +1 -0
- package/dist/src/storage/repositories/otk.repository.d.ts +9 -0
- package/dist/src/storage/repositories/otk.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/otk.repository.js +2 -0
- package/dist/src/storage/repositories/otk.repository.js.map +1 -0
- package/dist/src/storage/repositories/owner.repository.d.ts +9 -0
- package/dist/src/storage/repositories/owner.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/owner.repository.js +2 -0
- package/dist/src/storage/repositories/owner.repository.js.map +1 -0
- package/dist/src/storage/repositories/package-instance.repository.d.ts +26 -0
- package/dist/src/storage/repositories/package-instance.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/package-instance.repository.js +12 -0
- package/dist/src/storage/repositories/package-instance.repository.js.map +1 -0
- package/dist/src/storage/repositories/package.repository.d.ts +28 -0
- package/dist/src/storage/repositories/package.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/package.repository.js +12 -0
- package/dist/src/storage/repositories/package.repository.js.map +1 -0
- package/dist/src/storage/repositories/replication-queue.repository.d.ts +10 -0
- package/dist/src/storage/repositories/replication-queue.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/replication-queue.repository.js +2 -0
- package/dist/src/storage/repositories/replication-queue.repository.js.map +1 -0
- package/dist/src/storage/repositories/scheduler.repository.d.ts +30 -0
- package/dist/src/storage/repositories/scheduler.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/scheduler.repository.js +2 -0
- package/dist/src/storage/repositories/scheduler.repository.js.map +1 -0
- package/dist/src/storage/repositories/schema.repository.d.ts +9 -0
- package/dist/src/storage/repositories/schema.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/schema.repository.js +2 -0
- package/dist/src/storage/repositories/schema.repository.js.map +1 -0
- package/dist/src/storage/repositories/session.repository.d.ts +22 -0
- package/dist/src/storage/repositories/session.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/session.repository.js +2 -0
- package/dist/src/storage/repositories/session.repository.js.map +1 -0
- package/dist/src/storage/repositories/system-prompt.repository.d.ts +14 -0
- package/dist/src/storage/repositories/system-prompt.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/system-prompt.repository.js +2 -0
- package/dist/src/storage/repositories/system-prompt.repository.js.map +1 -0
- package/dist/src/storage/repositories/template-listing.repository.d.ts +44 -0
- package/dist/src/storage/repositories/template-listing.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/template-listing.repository.js +13 -0
- package/dist/src/storage/repositories/template-listing.repository.js.map +1 -0
- package/dist/src/storage/repositories/wallet.repository.d.ts +8 -0
- package/dist/src/storage/repositories/wallet.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/wallet.repository.js +2 -0
- package/dist/src/storage/repositories/wallet.repository.js.map +1 -0
- package/dist/src/storage/repositories/work.repository.d.ts +10 -0
- package/dist/src/storage/repositories/work.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/work.repository.js +2 -0
- package/dist/src/storage/repositories/work.repository.js.map +1 -0
- package/dist/src/storage/storage-factory.d.ts +9 -0
- package/dist/src/storage/storage-factory.d.ts.map +1 -0
- package/dist/src/storage/storage-factory.js +20 -0
- package/dist/src/storage/storage-factory.js.map +1 -0
- package/dist/src/types/route-manifest.d.ts +53 -0
- package/dist/src/types/route-manifest.d.ts.map +1 -0
- package/dist/src/types/route-manifest.js +44 -0
- package/dist/src/types/route-manifest.js.map +1 -0
- package/dist/src/utils/catalogue-hash.d.ts +10 -0
- package/dist/src/utils/catalogue-hash.d.ts.map +1 -0
- package/dist/src/utils/catalogue-hash.js +23 -0
- package/dist/src/utils/catalogue-hash.js.map +1 -0
- package/dist/src/utils/env-config.d.ts +8 -0
- package/dist/src/utils/env-config.d.ts.map +1 -0
- package/dist/src/utils/env-config.js +1264 -0
- package/dist/src/utils/env-config.js.map +1 -0
- package/dist/src/utils/env-validator.d.ts +14 -0
- package/dist/src/utils/env-validator.d.ts.map +1 -0
- package/dist/src/utils/env-validator.js +338 -0
- package/dist/src/utils/env-validator.js.map +1 -0
- package/dist/src/utils/fire-hook.d.ts +9 -0
- package/dist/src/utils/fire-hook.d.ts.map +1 -0
- package/dist/src/utils/fire-hook.js +12 -0
- package/dist/src/utils/fire-hook.js.map +1 -0
- package/dist/src/utils/gaii.d.ts +57 -0
- package/dist/src/utils/gaii.d.ts.map +1 -0
- package/dist/src/utils/gaii.js +148 -0
- package/dist/src/utils/gaii.js.map +1 -0
- package/dist/src/utils/ghii-resolver.d.ts +14 -0
- package/dist/src/utils/ghii-resolver.d.ts.map +1 -0
- package/dist/src/utils/ghii-resolver.js +21 -0
- package/dist/src/utils/ghii-resolver.js.map +1 -0
- package/dist/src/utils/logger.d.ts +9 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/logger.js +36 -0
- package/dist/src/utils/logger.js.map +1 -0
- package/dist/src/utils/otk.d.ts +2 -0
- package/dist/src/utils/otk.d.ts.map +1 -0
- package/dist/src/utils/otk.js +5 -0
- package/dist/src/utils/otk.js.map +1 -0
- package/dist/src/utils/tracking-code.d.ts +9 -0
- package/dist/src/utils/tracking-code.d.ts.map +1 -0
- package/dist/src/utils/tracking-code.js +16 -0
- package/dist/src/utils/tracking-code.js.map +1 -0
- package/dist/src/utils/url-validator.d.ts +5 -0
- package/dist/src/utils/url-validator.d.ts.map +1 -0
- package/dist/src/utils/url-validator.js +56 -0
- package/dist/src/utils/url-validator.js.map +1 -0
- package/dist/static/app-catalog.html +4401 -0
- package/dist/static/cookieconsent.css +1 -0
- package/dist/static/cookieconsent.umd.js +7 -0
- package/dist/static/icons/icon-maskable.svg +27 -0
- package/dist/static/icons/icon.svg +27 -0
- package/dist/static/manifest.json +17 -0
- package/dist/static/offline.html +167 -0
- package/dist/static/sw.js +260 -0
- package/package.json +182 -0
- package/prisma/schema.prisma +1086 -0
|
@@ -0,0 +1,1553 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file resolvers.ts
|
|
3
|
+
* @description Per-prompt variable resolver functions. Each resolver takes typed
|
|
4
|
+
* runtime data and produces Record<string, string> for template substitution.
|
|
5
|
+
*
|
|
6
|
+
* The resolver does the heavy lifting: filtering dataModel entries, formatting
|
|
7
|
+
* JSON structures, building context from completed components, injecting specs.
|
|
8
|
+
* The DB template just has {{variable}} placeholders.
|
|
9
|
+
*
|
|
10
|
+
* @version-history
|
|
11
|
+
* v1.0.0 — 2026-04-01 — Initial resolvers for DB-backed generator prompts
|
|
12
|
+
*/
|
|
13
|
+
import { logger } from '../../utils/logger.js';
|
|
14
|
+
/** Log a loud warning when a resolver variable falls back to a default value.
|
|
15
|
+
* This means the blueprint/interview data is missing or the filter didn't match. */
|
|
16
|
+
function warnFallback(promptId, varName, fallbackValue) {
|
|
17
|
+
logger.error(`[RESOLVER FALLBACK] ⚠️⚠️⚠️ ${promptId} → {{${varName}}} used FALLBACK: "${fallbackValue.slice(0, 80)}" — DATA IS MISSING, PROMPT WILL BE DEGRADED`);
|
|
18
|
+
return fallbackValue;
|
|
19
|
+
}
|
|
20
|
+
import { formatBundlesForPrompt } from './bundle.js';
|
|
21
|
+
// ── DaisyUI component HTML examples ──
|
|
22
|
+
// Used by resolvers to inject ONLY the components the spec selected.
|
|
23
|
+
const DAISYUI_COMPONENTS = {
|
|
24
|
+
table: '<table class="table">\n <thead><tr><th>Name</th><th>Status</th></tr></thead>\n <tbody><tr><td>Item</td><td><span class="badge badge-success">Active</span></td></tr></tbody>\n</table>',
|
|
25
|
+
card: '<div class="card bg-base-100 shadow-sm">\n <div class="card-body">\n <h2 class="card-title">Title</h2>\n <p>Content</p>\n <div class="card-actions justify-end"><button class="btn btn-primary">Action</button></div>\n </div>\n</div>',
|
|
26
|
+
tabs: '<div role="tablist" class="tabs tabs-bordered">\n <a role="tab" class="tab tab-active">Tab 1</a>\n <a role="tab" class="tab">Tab 2</a>\n</div>',
|
|
27
|
+
badge: '<span class="badge badge-primary">Label</span>\n<span class="badge badge-success">Active</span>\n<span class="badge badge-warning">Pending</span>',
|
|
28
|
+
alert: '<div role="alert" class="alert alert-info"><span>Info message</span></div>',
|
|
29
|
+
modal: '<dialog class="modal"><div class="modal-box">\n <h3 class="font-bold text-lg">Title</h3>\n <p>Content</p>\n <div class="modal-action"><form method="dialog"><button class="btn">Close</button></form></div>\n</div></dialog>',
|
|
30
|
+
stat: '<div class="stats shadow">\n <div class="stat"><div class="stat-title">Total</div><div class="stat-value">31K</div></div>\n</div>',
|
|
31
|
+
timeline: '<ul class="timeline timeline-vertical">\n <li><div class="timeline-start">Date</div><div class="timeline-middle">\u25cf</div><div class="timeline-end">Event</div><hr/></li>\n</ul>',
|
|
32
|
+
input: '<label class="input"><span class="label">Label</span><input type="text" placeholder="Type..." /></label>',
|
|
33
|
+
select: '<label class="select"><span class="label">Pick</span><select><option>Option</option></select></label>',
|
|
34
|
+
toggle: '<label class="toggle"><span class="label">Setting</span><input type="checkbox" /></label>',
|
|
35
|
+
checkbox: '<label class="checkbox"><input type="checkbox" /><span>Option</span></label>',
|
|
36
|
+
textarea: '<label class="textarea"><span class="label">Notes</span><textarea placeholder="Write..."></textarea></label>',
|
|
37
|
+
button: '<button class="btn btn-primary">Primary</button>\n<button class="btn btn-outline">Outline</button>\n<button class="btn btn-ghost">Ghost</button>',
|
|
38
|
+
loading: '<span class="loading loading-spinner loading-md"></span>',
|
|
39
|
+
progress: '<progress class="progress progress-primary w-56" value="70" max="100"></progress>',
|
|
40
|
+
tooltip: '<div class="tooltip" data-tip="Info"><button class="btn">Hover</button></div>',
|
|
41
|
+
collapse: '<div class="collapse collapse-arrow bg-base-100 border border-base-300">\n <input type="radio" name="accordion" />\n <div class="collapse-title font-semibold">Title</div>\n <div class="collapse-content"><p>Content</p></div>\n</div>',
|
|
42
|
+
dropdown: '<div class="dropdown"><div tabindex="0" role="button" class="btn">Menu</div>\n <ul tabindex="0" class="dropdown-content menu bg-base-100 rounded-box w-52 p-2 shadow-sm">\n <li><a>Item 1</a></li><li><a>Item 2</a></li>\n </ul>\n</div>',
|
|
43
|
+
drawer: '<div class="drawer lg:drawer-open">\n <input id="drawer" type="checkbox" class="drawer-toggle" />\n <div class="drawer-content"><!-- main content --></div>\n <div class="drawer-side"><ul class="menu bg-base-200 min-h-full w-60 p-4">\n <li><a>Home</a></li><li><a>Settings</a></li>\n </ul></div>\n</div>',
|
|
44
|
+
navbar: '<div class="navbar bg-base-100 shadow-sm">\n <div class="flex-1"><a class="btn btn-ghost text-xl">App</a></div>\n <div class="flex-none"><button class="btn btn-ghost">Settings</button></div>\n</div>',
|
|
45
|
+
menu: '<ul class="menu bg-base-200 rounded-box w-56">\n <li><a>Item 1</a></li><li><a class="active">Active</a></li>\n</ul>',
|
|
46
|
+
breadcrumbs: '<div class="breadcrumbs text-sm"><ul><li><a>Home</a></li><li>Current</li></ul></div>',
|
|
47
|
+
steps: '<ul class="steps"><li class="step step-primary">Step 1</li><li class="step">Step 2</li></ul>',
|
|
48
|
+
hero: '<div class="hero bg-base-200 min-h-96"><div class="hero-content text-center">\n <div class="max-w-md"><h1 class="text-5xl font-bold">Title</h1><p>Description</p></div>\n</div></div>',
|
|
49
|
+
carousel: '<div class="carousel w-full"><div class="carousel-item w-full"><img src="..." class="w-full" /></div></div>',
|
|
50
|
+
divider: '<div class="divider">OR</div>',
|
|
51
|
+
toast: '<div class="toast toast-end"><div class="alert alert-success"><span>Saved!</span></div></div>',
|
|
52
|
+
pagination: '<div class="join"><button class="join-item btn">\u00ab</button><button class="join-item btn btn-active">1</button><button class="join-item btn">\u00bb</button></div>',
|
|
53
|
+
avatar: '<div class="avatar placeholder"><div class="bg-neutral text-neutral-content w-12 rounded-full"><span>AB</span></div></div>',
|
|
54
|
+
skeleton: '<div class="skeleton h-32 w-full"></div>',
|
|
55
|
+
};
|
|
56
|
+
/** Build daisyUI section from spec's ui.components list */
|
|
57
|
+
function buildDaisyUiSection(components) {
|
|
58
|
+
if (components.length === 0)
|
|
59
|
+
return '';
|
|
60
|
+
let section = '## UI Component Reference (daisyUI) \u2014 MANDATORY\n\n';
|
|
61
|
+
section += 'Use these daisyUI CSS classes for all UI. Do NOT build raw unstyled HTML.\n';
|
|
62
|
+
section += 'DaisyUI + Tailwind CSS is loaded on the page. Just use the class names.\n\n';
|
|
63
|
+
for (const comp of components) {
|
|
64
|
+
const html = DAISYUI_COMPONENTS[comp];
|
|
65
|
+
if (html) {
|
|
66
|
+
section += `### ${comp}\n\`\`\`html\n${html}\n\`\`\`\n\n`;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
section += 'Combine with Tailwind utilities for spacing/layout: `p-4`, `mb-2`, `flex`, `grid`, `gap-4`, `w-full`, `max-w-lg`, `rounded-lg`, `text-sm`, `font-bold`, etc.\n';
|
|
70
|
+
return section;
|
|
71
|
+
}
|
|
72
|
+
/** Full daisyUI section fallback (for specs without ui.components) */
|
|
73
|
+
function buildFullDaisyUiSection() {
|
|
74
|
+
return buildDaisyUiSection(['card', 'table', 'badge', 'button', 'input', 'select', 'alert', 'tabs', 'loading', 'modal', 'toast']);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Master resolver — dispatches to the appropriate per-prompt resolver.
|
|
78
|
+
*/
|
|
79
|
+
export async function resolvePromptVars(storage, promptId, data, fragments) {
|
|
80
|
+
const resolverMap = {
|
|
81
|
+
'gen-extension-spec': resolveExtensionSpec,
|
|
82
|
+
'gen-data-api-spec': resolveDataApiSpec,
|
|
83
|
+
'gen-component-spec': resolveComponentSpec,
|
|
84
|
+
'gen-app-domain-spec': resolveAppDomainSpec,
|
|
85
|
+
'gen-csm': resolveSimpleComponent,
|
|
86
|
+
'gen-memory': resolveSimpleComponent,
|
|
87
|
+
'gen-translation': resolveTranslation,
|
|
88
|
+
'gen-extension-code': resolveExtensionCode,
|
|
89
|
+
'gen-cortex-data': resolveCortexData,
|
|
90
|
+
'gen-cortex-component': resolveCortexComponent,
|
|
91
|
+
'gen-cortex-app-domain': resolveCortexAppDomain,
|
|
92
|
+
'gen-app-spec': resolveAppSpec,
|
|
93
|
+
'gen-app': resolveApp,
|
|
94
|
+
'gen-reflection': resolveReflection,
|
|
95
|
+
'gen-fresh-generation': resolveFreshGeneration,
|
|
96
|
+
'gen-fix': resolveFix,
|
|
97
|
+
'gen-test-extension-spec': resolveTestExtensionSpec,
|
|
98
|
+
'gen-test-cortex-spec': resolveTestCortexSpec,
|
|
99
|
+
'gen-test-cortex-component': resolveTestCortexComponent,
|
|
100
|
+
'gen-test-cortex-app-domain': resolveTestCortexAppDomain,
|
|
101
|
+
'gen-test-app': resolveTestApp,
|
|
102
|
+
'gen-blueprint': resolveBlueprint,
|
|
103
|
+
'gen-interview': resolveInterview,
|
|
104
|
+
};
|
|
105
|
+
const resolver = resolverMap[promptId];
|
|
106
|
+
if (!resolver) {
|
|
107
|
+
// No resolver = no dynamic variables (static prompt)
|
|
108
|
+
return {};
|
|
109
|
+
}
|
|
110
|
+
return resolver(data, fragments);
|
|
111
|
+
}
|
|
112
|
+
// ── Helper functions ──
|
|
113
|
+
function formatDataSources(dataSources) {
|
|
114
|
+
if (!dataSources || dataSources.length === 0)
|
|
115
|
+
return warnFallback('helper', 'data_sources', 'No data sources specified.');
|
|
116
|
+
return dataSources.map(ds => {
|
|
117
|
+
const lines = [`- **${ds.name}**: ${ds.url || 'user-input'}`];
|
|
118
|
+
if (ds.responseEnvelope) {
|
|
119
|
+
lines.push(` Response envelope: \`${typeof ds.responseEnvelope === 'string' ? ds.responseEnvelope : JSON.stringify(ds.responseEnvelope)}\``);
|
|
120
|
+
}
|
|
121
|
+
if (ds.sampleEntry) {
|
|
122
|
+
lines.push(` Sample entry:\n\`\`\`json\n${typeof ds.sampleEntry === 'string' ? ds.sampleEntry : JSON.stringify(ds.sampleEntry, null, 2)}\n\`\`\``);
|
|
123
|
+
}
|
|
124
|
+
if (ds.sampleResponse) {
|
|
125
|
+
const text = typeof ds.sampleResponse === 'string' ? ds.sampleResponse : JSON.stringify(ds.sampleResponse, null, 2);
|
|
126
|
+
lines.push(` Sample response:\n\`\`\`json\n${text.slice(0, 2000)}\n\`\`\``);
|
|
127
|
+
}
|
|
128
|
+
if (ds.notes)
|
|
129
|
+
lines.push(` Notes: ${ds.notes}`);
|
|
130
|
+
return lines.join('\n');
|
|
131
|
+
}).join('\n\n');
|
|
132
|
+
}
|
|
133
|
+
function formatStructures(structures) {
|
|
134
|
+
if (!structures || Object.keys(structures).length === 0)
|
|
135
|
+
return warnFallback('helper', 'structures', 'No structures defined.');
|
|
136
|
+
return Object.entries(structures).map(([name, schema]) => `### ${name}\n\`\`\`json\n${JSON.stringify(schema, null, 2)}\n\`\`\``).join('\n\n');
|
|
137
|
+
}
|
|
138
|
+
function formatSpec(spec, label) {
|
|
139
|
+
if (!spec)
|
|
140
|
+
return '';
|
|
141
|
+
return `\n## ${label} (formal contract — your code MUST match this exactly)\n\n\`\`\`json\n${JSON.stringify(spec, null, 2)}\n\`\`\`\n`;
|
|
142
|
+
}
|
|
143
|
+
function formatUseCases(useCases) {
|
|
144
|
+
if (!useCases || useCases.length === 0)
|
|
145
|
+
return 'Not specified.';
|
|
146
|
+
return useCases.map((uc, i) => {
|
|
147
|
+
if (typeof uc === 'string')
|
|
148
|
+
return `${i + 1}. ${uc}`;
|
|
149
|
+
const obj = uc;
|
|
150
|
+
return `${i + 1}. ${obj.description || obj.title || JSON.stringify(uc)}`;
|
|
151
|
+
}).join('\n');
|
|
152
|
+
}
|
|
153
|
+
function formatCompletedContext(completedComponents) {
|
|
154
|
+
if (!completedComponents || completedComponents.length === 0)
|
|
155
|
+
return '';
|
|
156
|
+
const withSpecs = completedComponents.filter(c => c.spec);
|
|
157
|
+
const withoutSpecs = completedComponents.filter(c => !c.spec);
|
|
158
|
+
let context = '';
|
|
159
|
+
for (const c of withSpecs) {
|
|
160
|
+
const specLabel = c.type === 'extension' ? `Extension Spec: ${c.spec?.name || c.label}`
|
|
161
|
+
: c.subtype === 'data' ? `Data API Spec: ${c.spec?.name || c.label}`
|
|
162
|
+
: c.subtype === 'component' ? `Component Spec: ${c.spec?.name || c.label}`
|
|
163
|
+
: `Spec: ${c.label}`;
|
|
164
|
+
context += formatSpec(c.spec, specLabel);
|
|
165
|
+
}
|
|
166
|
+
const bundles = withoutSpecs
|
|
167
|
+
.filter(c => c.contextBundle)
|
|
168
|
+
.map(c => c.contextBundle);
|
|
169
|
+
if (bundles.length > 0) {
|
|
170
|
+
context += formatBundlesForPrompt(bundles);
|
|
171
|
+
}
|
|
172
|
+
const unbundled = withoutSpecs.filter(c => !c.contextBundle);
|
|
173
|
+
if (unbundled.length > 0) {
|
|
174
|
+
context += '\nAlready completed:\n';
|
|
175
|
+
for (const c of unbundled) {
|
|
176
|
+
context += `- ${c.id} (${c.type}: ${c.label}): registered as "${c.registeredAs}"\n`;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return context;
|
|
180
|
+
}
|
|
181
|
+
// ── Per-prompt resolvers ──
|
|
182
|
+
function resolveExtensionSpec(data) {
|
|
183
|
+
const bp = data.blueprint;
|
|
184
|
+
const bpComp = data.blueprintComponent;
|
|
185
|
+
const interview = data.interviewSpec;
|
|
186
|
+
const actions = bp.dataModel?.actions || {};
|
|
187
|
+
const memoryKeys = bp.dataModel?.memoryKeys || {};
|
|
188
|
+
// Filter actions by component field OR by key prefix (ext: for extensions, cortex: for cortex)
|
|
189
|
+
// Blueprint generator sometimes doesn't populate the component field, so we fall back to prefix matching
|
|
190
|
+
const compPrefix = bpComp?.type === 'extension' ? 'ext:' : bpComp?.type === 'cortex' ? 'cortex:' : '';
|
|
191
|
+
const compActions = Object.entries(actions)
|
|
192
|
+
.filter(([key, v]) => v.component === bpComp?.id || (compPrefix && key.startsWith(compPrefix)))
|
|
193
|
+
.map(([name, def]) => `- **${name.replace(/^ext:/, '').replace(/^cortex:/, '').replace(/^[^/]+\//, '')}**: ${def.description || ''}\n Input: \`${JSON.stringify(def.input || {})}\`\n Output: \`${JSON.stringify(def.output || {})}`)
|
|
194
|
+
.join('\n');
|
|
195
|
+
const compMemoryKeys = Object.entries(memoryKeys)
|
|
196
|
+
.filter(([, v]) => v.producedBy === bpComp?.id || v.consumedBy?.includes(bpComp?.id || ''))
|
|
197
|
+
.map(([key, def]) => `- \`${key}\` (${def.producedBy === bpComp?.id ? 'writes' : 'reads'}): ${def.description || ''}`)
|
|
198
|
+
.join('\n');
|
|
199
|
+
const schedules = bpComp?.schedules || [];
|
|
200
|
+
const settingsArr = [
|
|
201
|
+
...(Array.isArray(bp.settings) ? bp.settings : []),
|
|
202
|
+
...(bp.settings?.service || []),
|
|
203
|
+
...(bp.settings?.user || []),
|
|
204
|
+
];
|
|
205
|
+
return {
|
|
206
|
+
data_sources: formatDataSources(interview?.dataSources),
|
|
207
|
+
blueprint_actions: compActions || warnFallback('gen-extension-spec', 'blueprint_actions', 'Infer from data sources.'),
|
|
208
|
+
structures: formatStructures(bp.dataModel?.structures),
|
|
209
|
+
memory_keys: compMemoryKeys || warnFallback('gen-extension-spec', 'memory_keys', 'Infer from actions.'),
|
|
210
|
+
schedules: schedules.length > 0
|
|
211
|
+
? schedules.map(s => `- ${s.action}: ${s.cron} — ${s.description || ''}`).join('\n')
|
|
212
|
+
: 'None. Add @activate init if the extension needs initialization.',
|
|
213
|
+
config_keys: settingsArr.length > 0
|
|
214
|
+
? settingsArr.map(s => `- ${s.key} (${s.type || 'string'}): ${s.label || s.key}`).join('\n')
|
|
215
|
+
: 'None.',
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function resolveDataApiSpec(data) {
|
|
219
|
+
// Extract blueprint's produces: api:* method names for the cortex-data component
|
|
220
|
+
const dataCortexComp = data.blueprint.components?.find(c => c.type === 'cortex' && c.subtype === 'data');
|
|
221
|
+
const blueprintMethods = (dataCortexComp?.produces || [])
|
|
222
|
+
.filter((p) => p.startsWith('api:'))
|
|
223
|
+
.map((p) => p.replace('api:', ''));
|
|
224
|
+
const blueprintMethodsStr = blueprintMethods.length > 0
|
|
225
|
+
? blueprintMethods.map((m) => `- ${m}`).join('\n')
|
|
226
|
+
: warnFallback('gen-data-api-spec', 'blueprint_methods', 'No api: methods found in blueprint.');
|
|
227
|
+
return {
|
|
228
|
+
extension_spec: JSON.stringify(data.extensionSpec || {}, null, 2),
|
|
229
|
+
structures: formatStructures(data.blueprint.dataModel?.structures),
|
|
230
|
+
blueprint_methods: blueprintMethodsStr,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
function resolveComponentSpec(data) {
|
|
234
|
+
return {
|
|
235
|
+
data_api_spec: JSON.stringify(data.dataApiSpec || {}, null, 2),
|
|
236
|
+
component_label: data.componentLabel || '',
|
|
237
|
+
view_context: data.viewDefinition ? (typeof data.viewDefinition === 'string' ? data.viewDefinition : JSON.stringify(data.viewDefinition)) : '',
|
|
238
|
+
translation_keys: (data.translationKeys || []).slice(0, 30).map(k => `\`${k}\``).join(', ') +
|
|
239
|
+
((data.translationKeys || []).length > 30 ? ` ... and ${(data.translationKeys || []).length - 30} more` : ''),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
function resolveAppDomainSpec(data) {
|
|
243
|
+
return {
|
|
244
|
+
component_specs: (data.componentSpecs || []).map(cs => `### ${cs.name}\n\`\`\`json\n${JSON.stringify(cs, null, 2)}\n\`\`\``).join('\n\n'),
|
|
245
|
+
data_api_spec: JSON.stringify(data.dataApiSpec || {}, null, 2),
|
|
246
|
+
use_cases: formatUseCases(data.useCases),
|
|
247
|
+
views: (data.views || []).map((v) => {
|
|
248
|
+
const view = v;
|
|
249
|
+
return `- **${view.title}** (${view.type || 'page'}): ${view.description || ''}`;
|
|
250
|
+
}).join('\n'),
|
|
251
|
+
translation_keys: (data.translationKeys || []).slice(0, 20).map(k => `\`${k}\``).join(', ') +
|
|
252
|
+
((data.translationKeys || []).length > 20 ? ` ... and ${(data.translationKeys || []).length - 20} more` : ''),
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function resolveSimpleComponent(data) {
|
|
256
|
+
return {
|
|
257
|
+
label: data.componentLabel || '',
|
|
258
|
+
component_context: buildContextString(data),
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function resolveTranslation(data) {
|
|
262
|
+
const vars = resolveSimpleComponent(data);
|
|
263
|
+
// If another translation is already done, inject its keys
|
|
264
|
+
const otherTranslations = (data.completedComponents || []).filter(c => c.type === 'translation' && c.contextBundle?.keys);
|
|
265
|
+
if (otherTranslations.length > 0) {
|
|
266
|
+
const keys = otherTranslations[0].contextBundle.keys;
|
|
267
|
+
vars.matching_keys_section = `\n## REQUIRED: Match these EXACT keys from the other locale\nThe other locale has these ${keys.length} keys. You MUST use the SAME keys:\n\`\`\`\n${keys.join('\n')}\n\`\`\`\nDo NOT add extra keys and do NOT omit any keys.\n`;
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
vars.matching_keys_section = '';
|
|
271
|
+
}
|
|
272
|
+
return vars;
|
|
273
|
+
}
|
|
274
|
+
function resolveExtensionCode(data) {
|
|
275
|
+
// Build explicit required action IDs from blueprint (prevents LLM from renaming them)
|
|
276
|
+
let requiredActions = '';
|
|
277
|
+
if (data.blueprint.testScenarios) {
|
|
278
|
+
const bpComp = data.blueprint.components?.find(c => c.type === 'extension');
|
|
279
|
+
if (bpComp) {
|
|
280
|
+
const actionIds = (data.blueprint.testScenarios || [])
|
|
281
|
+
.filter(ts => ts.component === bpComp.id)
|
|
282
|
+
.flatMap(ts => (ts.scenarios || []).map(s => s.action));
|
|
283
|
+
if (actionIds.length > 0) {
|
|
284
|
+
requiredActions = `\n## REQUIRED ACTION IDs (from blueprint — use these EXACT names)\n\n╔══════════════════════════════════════════════════════════════════════════╗\n║ Your actions array MUST use these EXACT id values. Do NOT rename them. ║\n╚══════════════════════════════════════════════════════════════════════════╝\n\n${actionIds.map(id => `- id: ${id}`).join('\n')}\n`;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return {
|
|
289
|
+
label: data.componentLabel || '',
|
|
290
|
+
spec_section: (data.selfSpec ? formatSpec(data.selfSpec, 'YOUR SPEC — implement this contract exactly') : '') + requiredActions,
|
|
291
|
+
completed_context: formatCompletedContext(data.completedComponents),
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
function resolveCortexData(data) {
|
|
295
|
+
// Match browser buildDataCortexPrompt() — produce same variable content
|
|
296
|
+
const bp = data.blueprint;
|
|
297
|
+
const actions = bp.dataModel?.actions || {};
|
|
298
|
+
const cortexActions = Object.entries(actions)
|
|
299
|
+
.filter(([key]) => key.startsWith('cortex:'))
|
|
300
|
+
.map(([key, def]) => ({ method: key.replace('cortex:', ''), ...def }));
|
|
301
|
+
const methodsExport = cortexActions.length > 0
|
|
302
|
+
? cortexActions.map(a => {
|
|
303
|
+
const inputKeys = Object.keys(a.input || {}).join(', ');
|
|
304
|
+
const outputRef = a.output?.$ref || JSON.stringify(a.output || 'any');
|
|
305
|
+
return `- **${a.method}**(${inputKeys}) → returns ${outputRef}`;
|
|
306
|
+
}).join('\n')
|
|
307
|
+
: warnFallback('gen-cortex-data', 'methods_to_export', 'Infer from extension actions and data model.');
|
|
308
|
+
// Build extension section matching browser: name, actions, probe results, callExt hint
|
|
309
|
+
const extComp = (data.completedComponents || []).find(c => c.type === 'extension');
|
|
310
|
+
const extBundle = extComp?.contextBundle;
|
|
311
|
+
let extensionSection;
|
|
312
|
+
if (extBundle) {
|
|
313
|
+
const probes = (extBundle.probeResults || extComp?.probeResults || []);
|
|
314
|
+
extensionSection = `\n## Extension (this cortex wraps it)\n\nExtension name: ${extBundle.registeredAs || ''}\nActions: ${(extBundle.actions || []).join(', ') || 'none'}\n`;
|
|
315
|
+
if (probes.length > 0) {
|
|
316
|
+
extensionSection += '\n### Actual responses from live probes:\n';
|
|
317
|
+
for (const p of probes)
|
|
318
|
+
extensionSection += `${p.action}(${JSON.stringify(p.input)}) → ${JSON.stringify(p.response).substring(0, 500)}\n`;
|
|
319
|
+
}
|
|
320
|
+
extensionSection += `\nUse callExt('${extBundle.registeredAs || ''}', actionId, body) for extension calls.\nsession.fetch returns ALREADY-PARSED JSON — use resp.data, never resp.json().\n`;
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
extensionSection = '\n## No Extension\n\nThis data cortex uses AIMEAT platform libraries directly (no extension needed).\n';
|
|
324
|
+
}
|
|
325
|
+
// Inject spec name and libName so the code uses the EXACT names from the spec
|
|
326
|
+
const spec = data.selfSpec;
|
|
327
|
+
const specName = spec?.name || '';
|
|
328
|
+
const specLibName = spec?.libName || '';
|
|
329
|
+
let specSection = '';
|
|
330
|
+
if (spec) {
|
|
331
|
+
specSection = `\n## YOUR SPEC — use these EXACT names\n\n╔══════════════════════════════════════════════════════════════════════════╗\n║ metadata.name MUST be: ${specName} \n║ LIB_NAME MUST be: ${specLibName} \n║ These come from the spec. Do NOT use the component label as the name. ║\n╚══════════════════════════════════════════════════════════════════════════╝\n\nFull spec:\n\`\`\`json\n${JSON.stringify(spec, null, 2).slice(0, 3000)}\n\`\`\`\n`;
|
|
332
|
+
}
|
|
333
|
+
return {
|
|
334
|
+
label: data.componentLabel || warnFallback('gen-cortex-data', 'label', ''),
|
|
335
|
+
project_description: data.projectDescription || warnFallback('gen-cortex-data', 'project_description', ''),
|
|
336
|
+
structures: formatStructures(bp.dataModel?.structures),
|
|
337
|
+
methods_to_export: methodsExport,
|
|
338
|
+
extension_section: extensionSection,
|
|
339
|
+
spec_section: specSection,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
function resolveCortexComponent(data) {
|
|
343
|
+
// Match browser buildFeatureCortexPrompt() — use case, view, structures, data cortex API
|
|
344
|
+
const interview = data.interviewSpec;
|
|
345
|
+
const bpComp = data.blueprintComponent;
|
|
346
|
+
const labelLower = (data.componentLabel || '').toLowerCase();
|
|
347
|
+
// Use cases — pass ALL use cases so the LLM can pick the relevant one
|
|
348
|
+
// (Label matching doesn't work when labels are in a different language than use case titles)
|
|
349
|
+
let useCase = '';
|
|
350
|
+
if (interview?.useCases && interview.useCases.length > 0) {
|
|
351
|
+
useCase = interview.useCases
|
|
352
|
+
.map(u => `- **${u.title}** [${u.priority || 'medium'}]: ${u.description || ''}`)
|
|
353
|
+
.join('\n');
|
|
354
|
+
}
|
|
355
|
+
if (!useCase)
|
|
356
|
+
useCase = warnFallback('gen-cortex-component', 'use_case', 'No use cases provided');
|
|
357
|
+
// Views — pass ALL views
|
|
358
|
+
let viewSection = '';
|
|
359
|
+
if (interview?.views && interview.views.length > 0) {
|
|
360
|
+
viewSection = interview.views
|
|
361
|
+
.map(v => {
|
|
362
|
+
let line = `- **${v.title}** (${v.type || 'page'}): ${v.description || ''}`;
|
|
363
|
+
if (Array.isArray(v.interactions))
|
|
364
|
+
line += ` [${v.interactions.join(', ')}]`;
|
|
365
|
+
return line;
|
|
366
|
+
}).join('\n');
|
|
367
|
+
}
|
|
368
|
+
if (!viewSection)
|
|
369
|
+
viewSection = warnFallback('gen-cortex-component', 'view_section', 'No views provided');
|
|
370
|
+
// Structures
|
|
371
|
+
const structures = data.blueprint.dataModel?.structures || {};
|
|
372
|
+
const structuresText = Object.entries(structures).map(([name, schema]) => `**${name}**: ${JSON.stringify(schema, null, 2)}`).join('\n\n') || 'See data cortex API for available data.';
|
|
373
|
+
// Data cortex API — inject the SPEC with returnsExamples showing exact data shapes
|
|
374
|
+
const dataCortex = (data.completedComponents || []).find(c => c.type === 'cortex' && c.subtype === 'data');
|
|
375
|
+
const dcBundle = dataCortex?.contextBundle;
|
|
376
|
+
const dcSpec = dataCortex?.spec;
|
|
377
|
+
let dataCortexApi;
|
|
378
|
+
if (dcBundle || dcSpec) {
|
|
379
|
+
const libName = dcSpec?.libName || dcBundle?.libName || dcBundle?.registeredAs || '';
|
|
380
|
+
dataCortexApi = `\n## Data Cortex API (use this for ALL data access)\n\nAccess via: AIMEAT.${libName}\n`;
|
|
381
|
+
// Inject method signatures WITH returnsExamples from the data cortex spec
|
|
382
|
+
const methods = dcSpec?.methods || [];
|
|
383
|
+
if (methods.length > 0) {
|
|
384
|
+
dataCortexApi += '\n### Methods and Return Values\n\n';
|
|
385
|
+
for (const m of methods) {
|
|
386
|
+
dataCortexApi += `**AIMEAT.${libName}.${m.name}(${m.params || ''})** → ${m.returns || 'unknown'}\n`;
|
|
387
|
+
if (m.returnsExample) {
|
|
388
|
+
const example = typeof m.returnsExample === 'string' ? m.returnsExample : JSON.stringify(m.returnsExample, null, 2);
|
|
389
|
+
dataCortexApi += `\`\`\`json\n${example.substring(0, 600)}\n\`\`\`\n`;
|
|
390
|
+
}
|
|
391
|
+
dataCortexApi += '\n';
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
dataCortexApi += `Methods: ${(dcBundle?.exports || []).join(', ')}\n`;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
else {
|
|
399
|
+
dataCortexApi = warnFallback('gen-cortex-component', 'data_cortex_api', 'No data cortex API available — data cortex may not be registered yet.');
|
|
400
|
+
}
|
|
401
|
+
// Translation — deduplicate keys (fi + en have identical keys)
|
|
402
|
+
const tk = [...new Set(data.translationKeys || [])];
|
|
403
|
+
const translationSection = tk.length > 0
|
|
404
|
+
? `\n## Translation Keys (use these exact keys)\n\n${tk.map(k => '- `' + k + '`').join('\n')}\n`
|
|
405
|
+
: '';
|
|
406
|
+
// Inject spec name/libName (same pattern as data cortex)
|
|
407
|
+
const spec = data.selfSpec;
|
|
408
|
+
let specSection = '';
|
|
409
|
+
if (spec) {
|
|
410
|
+
const specName = spec.name || '';
|
|
411
|
+
const specLibName = spec.libName || '';
|
|
412
|
+
specSection = `\n## YOUR SPEC — use these EXACT names\n\n╔══════════════════════════════════════════════════════════════════════════╗\n║ metadata.name MUST be: ${specName} \n║ LIB_NAME MUST be: ${specLibName} \n║ These come from the spec. Do NOT use placeholder names like featureLib.║\n╚══════════════════════════════════════════════════════════════════════════╝\n\nFull spec:\n\`\`\`json\n${JSON.stringify(spec, null, 2).slice(0, 3000)}\n\`\`\`\n`;
|
|
413
|
+
}
|
|
414
|
+
// Service slug from blueprint — the single source of truth for namespacing
|
|
415
|
+
const serviceSlug = data.blueprint.service_slug;
|
|
416
|
+
if (!serviceSlug)
|
|
417
|
+
throw new Error('Blueprint missing "service_slug" — cannot build cortex-component prompt. Regenerate blueprint.');
|
|
418
|
+
// DaisyUI section — from spec's ui.components or full fallback
|
|
419
|
+
const uiSpec = spec?.ui;
|
|
420
|
+
const uiComponents = uiSpec?.components || [];
|
|
421
|
+
const platformUiSection = uiComponents.length > 0
|
|
422
|
+
? buildDaisyUiSection(uiComponents)
|
|
423
|
+
: buildFullDaisyUiSection();
|
|
424
|
+
return {
|
|
425
|
+
label: data.componentLabel || '',
|
|
426
|
+
use_case: useCase,
|
|
427
|
+
view_section: viewSection,
|
|
428
|
+
structures: structuresText,
|
|
429
|
+
data_cortex_api: dataCortexApi,
|
|
430
|
+
translation_section: translationSection,
|
|
431
|
+
spec_section: specSection,
|
|
432
|
+
service_slug: serviceSlug,
|
|
433
|
+
platform_ui_section: platformUiSection,
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
function resolveCortexAppDomain(data) {
|
|
437
|
+
// Match browser buildAppDomainCortexPrompt() — feature APIs, data cortex, translation keys
|
|
438
|
+
const featureComps = (data.completedComponents || []).filter(c => c.type === 'cortex' && (c.subtype === 'component' || c.subtype === 'feature'));
|
|
439
|
+
const featureApis = featureComps.map(c => {
|
|
440
|
+
const b = c.contextBundle;
|
|
441
|
+
return `\n### ${b?.name || c.label}\nRegistered as: ${b?.registeredAs || c.registeredAs || ''}\nAccess via: AIMEAT.${b?.libName || c.registeredAs || ''}\nExports: ${(b?.exports || []).join(', ')}\n`;
|
|
442
|
+
}).join('\n');
|
|
443
|
+
const dataCortex = (data.completedComponents || []).find(c => c.type === 'cortex' && c.subtype === 'data');
|
|
444
|
+
const dcBundle = dataCortex?.contextBundle;
|
|
445
|
+
const dataCortexSection = dcBundle
|
|
446
|
+
? `\nAccess via: AIMEAT.${dcBundle.libName || dcBundle.registeredAs || ''}\nMethods: ${(dcBundle.exports || []).join(', ')}\n`
|
|
447
|
+
: warnFallback('gen-cortex-app-domain', 'data_cortex_section', 'No data cortex available');
|
|
448
|
+
const translationComp = (data.completedComponents || []).find(c => c.type === 'translation' && c.contextBundle?.keys);
|
|
449
|
+
const translationKeys = translationComp?.contextBundle?.keys?.slice(0, 30).join(', ') || 'none available';
|
|
450
|
+
// Inject spec name/libName (same pattern as data cortex and component cortex)
|
|
451
|
+
const spec = data.selfSpec;
|
|
452
|
+
let specSection = '';
|
|
453
|
+
if (spec) {
|
|
454
|
+
const specName = spec.name || '';
|
|
455
|
+
const specLibName = spec.libName || '';
|
|
456
|
+
specSection = `\n## YOUR SPEC — use these EXACT names\n\n╔══════════════════════════════════════════════════════════════════════════╗\n║ metadata.name MUST be: ${specName} \n║ LIB_NAME MUST be: ${specLibName} \n║ These come from the spec. Do NOT use placeholder names like appLib. ║\n╚══════════════════════════════════════════════════════════════════════════╝\n\nFull spec:\n\`\`\`json\n${JSON.stringify(spec, null, 2).slice(0, 3000)}\n\`\`\`\n`;
|
|
457
|
+
}
|
|
458
|
+
// Service slug from blueprint — the single source of truth for namespacing
|
|
459
|
+
const serviceSlug = data.blueprint.service_slug;
|
|
460
|
+
if (!serviceSlug)
|
|
461
|
+
throw new Error('Blueprint missing "service_slug" — cannot build cortex-app-domain prompt. Regenerate blueprint.');
|
|
462
|
+
// DaisyUI layout section from spec's appShell/navStyle
|
|
463
|
+
const appShell = spec?.appShell || '';
|
|
464
|
+
const navStyle = spec?.navStyle || '';
|
|
465
|
+
let platformLayoutSection = '';
|
|
466
|
+
if (appShell || navStyle) {
|
|
467
|
+
platformLayoutSection = '## App Shell (daisyUI) \u2014 MANDATORY\n\n';
|
|
468
|
+
platformLayoutSection += 'Use these daisyUI patterns for the app shell. Do NOT build raw layout HTML.\n\n';
|
|
469
|
+
if (appShell) {
|
|
470
|
+
const html = DAISYUI_COMPONENTS[appShell];
|
|
471
|
+
if (html)
|
|
472
|
+
platformLayoutSection += `### Layout: ${appShell}\n\`\`\`html\n${html}\n\`\`\`\n\n`;
|
|
473
|
+
}
|
|
474
|
+
if (navStyle) {
|
|
475
|
+
const html = DAISYUI_COMPONENTS[navStyle];
|
|
476
|
+
if (html)
|
|
477
|
+
platformLayoutSection += `### Navigation: ${navStyle}\n\`\`\`html\n${html}\n\`\`\`\n\n`;
|
|
478
|
+
}
|
|
479
|
+
platformLayoutSection += 'Combine with Tailwind utilities: `p-4`, `flex`, `grid`, `gap-4`, `w-full`, etc.\n';
|
|
480
|
+
}
|
|
481
|
+
// Build app-domain code template from spec
|
|
482
|
+
const specName = spec?.name || 'app';
|
|
483
|
+
const specLibName = spec?.libName || 'app';
|
|
484
|
+
const views = spec?.views || [];
|
|
485
|
+
const viewComp = spec?.viewComposition || {};
|
|
486
|
+
// Build nav items — use view ID as placeholder label.
|
|
487
|
+
// LLM MUST replace these with the correct app.nav.* translation keys from the Translation Keys section.
|
|
488
|
+
const navItems = views.map(v => {
|
|
489
|
+
return ` { id: '${v}', label: t('app.nav.TODO_REPLACE_WITH_CORRECT_KEY'), icon: '' } // ADAPT: use correct app.nav.* key for "${v}"`;
|
|
490
|
+
}).join(',\n');
|
|
491
|
+
const viewCases = views.map(v => {
|
|
492
|
+
const comps = viewComp[v] || [];
|
|
493
|
+
const renderCalls = comps.map(c => ` var c_${c.replace(/-/g, '_')} = document.createElement('div');\n c_${c.replace(/-/g, '_')}.className = 'mb-4';\n viewEl.appendChild(c_${c.replace(/-/g, '_')});\n if (AIMEAT.${c} && AIMEAT.${c}.render) AIMEAT.${c}.render(c_${c.replace(/-/g, '_')}, { locale: currentLocale, translations: translations });`).join('\n');
|
|
494
|
+
return ` case '${v}':\n${renderCalls}\n break;`;
|
|
495
|
+
}).join('\n');
|
|
496
|
+
const appDomainTemplate = `(function (AIMEAT) {
|
|
497
|
+
'use strict';
|
|
498
|
+
var LIB_NAME = '${specLibName}';
|
|
499
|
+
var currentLocale = 'fi';
|
|
500
|
+
var translations = {};
|
|
501
|
+
var currentView = '${views[0] || 'home'}';
|
|
502
|
+
var appContainer = null;
|
|
503
|
+
|
|
504
|
+
// ── Init: auth + translations + settings ──
|
|
505
|
+
async function init() {
|
|
506
|
+
var session = await AIMEAT.auth.login();
|
|
507
|
+
translations = await getTranslations(currentLocale);
|
|
508
|
+
var settings = {};
|
|
509
|
+
try { settings = await AIMEAT.data.get('${serviceSlug}.settings') || {}; } catch(e) {}
|
|
510
|
+
return { session: session, translations: translations, settings: settings };
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// ── Render: navigation + view area ──
|
|
514
|
+
function render(container) {
|
|
515
|
+
appContainer = container;
|
|
516
|
+
container.innerHTML = '';
|
|
517
|
+
container.className = 'flex flex-col h-full';
|
|
518
|
+
|
|
519
|
+
// Navigation — ADAPT: change tabs/menu/sidebar per spec navStyle
|
|
520
|
+
var navEl = document.createElement('div');
|
|
521
|
+
navEl.innerHTML = buildNavigation();
|
|
522
|
+
container.appendChild(navEl);
|
|
523
|
+
|
|
524
|
+
// View container
|
|
525
|
+
var viewEl = document.createElement('div');
|
|
526
|
+
viewEl.id = 'view-content';
|
|
527
|
+
viewEl.className = 'flex-1 p-4';
|
|
528
|
+
container.appendChild(viewEl);
|
|
529
|
+
|
|
530
|
+
// Setup nav click handlers
|
|
531
|
+
navEl.querySelectorAll('[data-view]').forEach(function(el) {
|
|
532
|
+
el.addEventListener('click', function(e) {
|
|
533
|
+
e.preventDefault();
|
|
534
|
+
navigateTo(el.getAttribute('data-view'));
|
|
535
|
+
});
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
renderView(currentView);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// ── Navigation builder ──
|
|
542
|
+
function buildNavigation() {
|
|
543
|
+
var items = [
|
|
544
|
+
${navItems}
|
|
545
|
+
];
|
|
546
|
+
// ADAPT: change navigation style (tabs/menu/sidebar) to match spec
|
|
547
|
+
return '<div role="tablist" class="tabs tabs-bordered mb-4">' +
|
|
548
|
+
items.map(function(item) {
|
|
549
|
+
var active = item.id === currentView ? ' tab-active' : '';
|
|
550
|
+
return '<a role="tab" class="tab' + active + '" data-view="' + item.id + '">' +
|
|
551
|
+
(item.icon ? item.icon + ' ' : '') + item.label + '</a>';
|
|
552
|
+
}).join('') + '</div>';
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// ── View rendering — ADAPT: add component-specific props ──
|
|
556
|
+
function renderView(viewId) {
|
|
557
|
+
currentView = viewId;
|
|
558
|
+
var viewEl = document.getElementById('view-content');
|
|
559
|
+
if (!viewEl) return;
|
|
560
|
+
viewEl.innerHTML = '';
|
|
561
|
+
|
|
562
|
+
switch (viewId) {
|
|
563
|
+
${viewCases}
|
|
564
|
+
default:
|
|
565
|
+
viewEl.innerHTML = '<div class="alert alert-info"><span>' + t('app.empty') + '</span></div>';
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
// Update nav active state
|
|
569
|
+
if (appContainer) {
|
|
570
|
+
appContainer.querySelectorAll('[data-view]').forEach(function(el) {
|
|
571
|
+
if (el.getAttribute('data-view') === viewId) el.classList.add('tab-active');
|
|
572
|
+
else el.classList.remove('tab-active');
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
function navigateTo(viewId) { renderView(viewId); }
|
|
578
|
+
|
|
579
|
+
// ── Translation ──
|
|
580
|
+
async function getTranslations(locale) {
|
|
581
|
+
try {
|
|
582
|
+
return await AIMEAT.data.get('${serviceSlug}.i18n.' + locale)
|
|
583
|
+
|| await AIMEAT.data.get('i18n.' + locale)
|
|
584
|
+
|| {};
|
|
585
|
+
} catch (e) { return {}; }
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
function t(key, vars) {
|
|
589
|
+
var str = translations[key] || key;
|
|
590
|
+
if (vars) {
|
|
591
|
+
Object.keys(vars).forEach(function(k) {
|
|
592
|
+
str = str.replace('$' + '{' + k + '}', vars[k]);
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
return str;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
async function switchLocale(locale) {
|
|
599
|
+
currentLocale = locale;
|
|
600
|
+
translations = await getTranslations(locale);
|
|
601
|
+
if (appContainer) render(appContainer);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
var exports = { init: init, render: render, t: t, switchLocale: switchLocale, getTranslations: getTranslations };
|
|
605
|
+
if (AIMEAT.register) AIMEAT.register(LIB_NAME, exports);
|
|
606
|
+
AIMEAT[LIB_NAME] = exports;
|
|
607
|
+
})(window.AIMEAT || (window.AIMEAT = {}));`;
|
|
608
|
+
return {
|
|
609
|
+
label: data.componentLabel || '',
|
|
610
|
+
project_description: data.projectDescription || '',
|
|
611
|
+
feature_apis: featureApis,
|
|
612
|
+
data_cortex_section: dataCortexSection,
|
|
613
|
+
translation_keys: translationKeys,
|
|
614
|
+
spec_section: specSection,
|
|
615
|
+
service_slug: serviceSlug,
|
|
616
|
+
platform_layout_section: platformLayoutSection,
|
|
617
|
+
app_domain_template: appDomainTemplate,
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
function resolveAppSpec(data) {
|
|
621
|
+
// App spec is simple — name, theme, locale. All cortex info comes from blueprint.
|
|
622
|
+
const bp = data.blueprint;
|
|
623
|
+
const comps = data.completedComponents || [];
|
|
624
|
+
// List all registered cortexes with their specs
|
|
625
|
+
const cortexes = comps.filter(c => c.type === 'cortex' && c.registeredAs);
|
|
626
|
+
const cortexList = cortexes.map(c => {
|
|
627
|
+
const sp = c.spec;
|
|
628
|
+
return `- ${c.registeredAs} (${c.subtype || c.type})${sp?.libName ? ` — libName: ${sp.libName}` : ''}`;
|
|
629
|
+
}).join('\n') || 'No cortex dependencies';
|
|
630
|
+
return {
|
|
631
|
+
component_label: data.componentLabel || '',
|
|
632
|
+
project_description: data.projectDescription || '',
|
|
633
|
+
cortex_dependencies: cortexList,
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
function resolveApp(data) {
|
|
637
|
+
// Find app-domain cortex — try subtype first, then fall back to spec.methods check
|
|
638
|
+
const appDomainComp2 = (data.completedComponents || [])
|
|
639
|
+
.find(c => c.type === 'cortex' && (c.subtype === 'app-domain' || c.spec?.methods) && c.registeredAs);
|
|
640
|
+
const appDomainSpec = appDomainComp2?.spec;
|
|
641
|
+
// Build cortex script loads — prefer app spec's cortexDependencies if available
|
|
642
|
+
const appSpec = data.selfSpec;
|
|
643
|
+
const specDeps = appSpec?.cortexDependencies;
|
|
644
|
+
const cortexComponents = (data.completedComponents || []).filter(c => c.type === 'cortex');
|
|
645
|
+
let cortexScriptLoads = '';
|
|
646
|
+
let cortexInstructions = '';
|
|
647
|
+
const cortexLibs = cortexComponents.map(c => {
|
|
648
|
+
const libName = c.registeredAs || c.label;
|
|
649
|
+
return { name: libName, label: c.label, result: c.result };
|
|
650
|
+
});
|
|
651
|
+
if (specDeps && specDeps.length > 0) {
|
|
652
|
+
cortexScriptLoads = specDeps.map(name => ` await loadScript('/v1/cortex/${name}/libs/${name}.js');`).join('\n');
|
|
653
|
+
}
|
|
654
|
+
else if (cortexLibs.length > 0) {
|
|
655
|
+
cortexScriptLoads = cortexLibs.map(lib => ` await loadScript('/v1/cortex/${lib.name}/libs/${lib.name}.js');`).join('\n');
|
|
656
|
+
}
|
|
657
|
+
if (cortexLibs.length > 0) {
|
|
658
|
+
const extractedMethods = [];
|
|
659
|
+
for (const lib of cortexLibs) {
|
|
660
|
+
const libNameMatch = lib.result?.match?.(/const\s+LIB_NAME\s*=\s*['"]([^'"]+)['"]/);
|
|
661
|
+
const camelName = libNameMatch ? libNameMatch[1] : lib.name.replace(/-([a-z0-9])/g, (_, ch) => ch.toUpperCase());
|
|
662
|
+
const exportsMatch = lib.result?.match?.(/(?:const|let|var)\s+\w*[Ee]xport\w*\s*=\s*\{([\s\S]*?)\}/);
|
|
663
|
+
if (exportsMatch) {
|
|
664
|
+
const methods = exportsMatch[1].split(',').map((m) => m.trim().split(':')[0].trim()).filter(Boolean);
|
|
665
|
+
for (const m of methods) {
|
|
666
|
+
extractedMethods.push(`- \`AIMEAT.${camelName}.${m}()\``);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
cortexInstructions = `
|
|
671
|
+
## CORTEX LIBRARIES (use these — do NOT call extensions or memory directly)
|
|
672
|
+
|
|
673
|
+
This project has Cortex libraries that wrap all extension APIs into clean domain methods.
|
|
674
|
+
Load them via <script> tags and use their API.
|
|
675
|
+
|
|
676
|
+
${cortexLibs.map(lib => `### ${lib.label}
|
|
677
|
+
Load: \`<script src="/v1/cortex/${lib.name}/libs/${lib.name}.js"></script>\`
|
|
678
|
+
`).join('\n')}
|
|
679
|
+
|
|
680
|
+
${extractedMethods.length > 0 ? `### AVAILABLE CORTEX METHODS (extracted from actual code — use ONLY these):
|
|
681
|
+
${extractedMethods.join('\n')}
|
|
682
|
+
|
|
683
|
+
Do NOT call any method not in this list. Do NOT rename these methods.` : ''}
|
|
684
|
+
|
|
685
|
+
RULES:
|
|
686
|
+
- Call \`AIMEAT.{libName}.init()\` on app start (libName is camelCase of cortex name)
|
|
687
|
+
- Use cortex methods for ALL data access — never call extensions or memory directly
|
|
688
|
+
- NEVER call internal functions like callExt(), readExtMemory() — these are PRIVATE
|
|
689
|
+
- NEVER build retry loops — show an error message on failure, do NOT auto-retry
|
|
690
|
+
- Use EXACTLY the method names and return value shapes shown above
|
|
691
|
+
|
|
692
|
+
### UI Styling
|
|
693
|
+
|
|
694
|
+
DaisyUI + Tailwind CSS are loaded via CDN in the HTML head.
|
|
695
|
+
Use daisyUI CSS classes for all UI components: \`class="card"\`, \`class="table"\`, \`class="btn"\`, \`class="tabs"\`, etc.
|
|
696
|
+
Do NOT load aimeat-ui-* libraries — use daisyUI instead.
|
|
697
|
+
`;
|
|
698
|
+
}
|
|
699
|
+
// Build translation keys section
|
|
700
|
+
const translationKeys = data.translationKeys || [];
|
|
701
|
+
let translationKeysSection = '';
|
|
702
|
+
if (translationKeys.length > 0) {
|
|
703
|
+
const sorted = [...translationKeys].sort();
|
|
704
|
+
translationKeysSection = `
|
|
705
|
+
## AVAILABLE TRANSLATION KEYS (from registered translation components — use EXACTLY these)
|
|
706
|
+
|
|
707
|
+
╔══════════════════════════════════════════════════════════════════════════╗
|
|
708
|
+
║ Your app MUST use these EXACT keys when calling t(key, translations). ║
|
|
709
|
+
║ Do NOT invent your own keys like "field.name" or "detail.addresses". ║
|
|
710
|
+
║ The translation components have ALREADY defined these keys. ║
|
|
711
|
+
╚══════════════════════════════════════════════════════════════════════════╝
|
|
712
|
+
|
|
713
|
+
${sorted.map(k => '- `' + k + '`').join('\n')}
|
|
714
|
+
|
|
715
|
+
Total: ${sorted.length} keys available. If you need a label, find the closest matching key from this list.
|
|
716
|
+
`;
|
|
717
|
+
}
|
|
718
|
+
// Build the conditional cortex-or-api section (browser has hasCortex conditional)
|
|
719
|
+
const hasCortex = cortexComponents.length > 0;
|
|
720
|
+
let cortexOrApiSection;
|
|
721
|
+
if (hasCortex) {
|
|
722
|
+
cortexOrApiSection = cortexInstructions;
|
|
723
|
+
}
|
|
724
|
+
else {
|
|
725
|
+
// Non-cortex path — verbatim from browser base.js lines 642-703
|
|
726
|
+
cortexOrApiSection = `### AIMEAT.data API (memory read/write — handles auth and envelope automatically):
|
|
727
|
+
\`\`\`javascript
|
|
728
|
+
// Read YOUR OWN memory key — returns the stored value directly, or null
|
|
729
|
+
const myData = await AIMEAT.data.get('my.settings');
|
|
730
|
+
|
|
731
|
+
// Write a memory key (your own namespace)
|
|
732
|
+
await AIMEAT.data.set('my.key', { count: 42 });
|
|
733
|
+
|
|
734
|
+
// Delete your own memory key
|
|
735
|
+
await AIMEAT.data.delete('my.key');
|
|
736
|
+
\`\`\`
|
|
737
|
+
|
|
738
|
+
### Reading EXTENSION-produced data (CRITICAL — most apps need this):
|
|
739
|
+
Extensions store data in their OWN namespace (\`ext:{extension-name}\`).
|
|
740
|
+
To read data that an extension wrote, use \`getPublic()\`:
|
|
741
|
+
\`\`\`javascript
|
|
742
|
+
// WRONG — this reads YOUR memory, not the extension's:
|
|
743
|
+
const data = await AIMEAT.data.get('items.by-date.__index'); // returns null!
|
|
744
|
+
|
|
745
|
+
// CORRECT — read from the extension's namespace:
|
|
746
|
+
const data = await AIMEAT.data.getPublic('ext:my-collector-extension', 'items.by-date.__index');
|
|
747
|
+
\`\`\`
|
|
748
|
+
The first argument is the extension's memory owner: \`"ext:" + extensionName\` (the \`name\` field from the extension manifest metadata).
|
|
749
|
+
Use this for ALL data produced by extensions (collected data, computed stats, caches, etc.).
|
|
750
|
+
\`getPublic()\` returns the value directly (auto-unwraps), or null if not found.
|
|
751
|
+
|
|
752
|
+
### Reading TRANSLATIONS (stored in owner namespace by translation components):
|
|
753
|
+
Translations are stored in the OWNER's namespace by the translation component during registration.
|
|
754
|
+
The key format is: \`{service-name}.i18n.{locale}\` (e.g. \`my-service.i18n.fi\`).
|
|
755
|
+
\`\`\`javascript
|
|
756
|
+
// Read translations from OWNER namespace (the translation component stored them here):
|
|
757
|
+
const fiStrings = await AIMEAT.data.get('my-service.i18n.fi') || await AIMEAT.data.get('i18n.fi') || {};
|
|
758
|
+
const enStrings = await AIMEAT.data.get('my-service.i18n.en') || await AIMEAT.data.get('i18n.en') || {};
|
|
759
|
+
\`\`\`
|
|
760
|
+
Use AIMEAT.data.get() — this reads from the current user's namespace where translations live.
|
|
761
|
+
If a cortex library has a getI18n(locale) method, use that instead (recommended).
|
|
762
|
+
|
|
763
|
+
### Calling extension actions (use AIMEAT.auth session for authenticated fetch):
|
|
764
|
+
|
|
765
|
+
╔══════════════════════════════════════════════════════════════════════════╗
|
|
766
|
+
║ CRITICAL: session.fetch() returns ALREADY-PARSED JSON, not Response. ║
|
|
767
|
+
║ Do NOT call resp.json() — it will crash with "not a function". ║
|
|
768
|
+
║ Access resp.ok, resp.data, resp.error directly. ║
|
|
769
|
+
╚══════════════════════════════════════════════════════════════════════════╝
|
|
770
|
+
|
|
771
|
+
\`\`\`javascript
|
|
772
|
+
// Helper for extension calls (copy this EXACTLY):
|
|
773
|
+
// ALL extension actions are POST — the backend only has router.post() routes
|
|
774
|
+
async function extCall(extName, actionId, body = {}) {
|
|
775
|
+
const session = await AIMEAT.auth.login();
|
|
776
|
+
if (!session) throw new Error('Not logged in');
|
|
777
|
+
const url = '/v1/ext/' + extName + '/' + actionId;
|
|
778
|
+
const resp = await session.fetch(url, { method: 'POST', body: JSON.stringify(body) });
|
|
779
|
+
// resp is ALREADY parsed JSON — never call resp.json()
|
|
780
|
+
if (!resp.ok) throw new Error(resp.error?.message || 'Extension call failed');
|
|
781
|
+
return resp.data; // unwrapped payload
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
// Usage:
|
|
785
|
+
const results = await extCall('my-extension', 'search', { query: 'test' });
|
|
786
|
+
const detail = await extCall('my-extension', 'getDetail', { id: 'abc-123' });
|
|
787
|
+
\`\`\``;
|
|
788
|
+
}
|
|
789
|
+
// Build project context (description + completed component info)
|
|
790
|
+
let projectContext = data.projectDescription || '';
|
|
791
|
+
if (appDomainSpec)
|
|
792
|
+
projectContext += formatSpec(appDomainSpec, 'App-Domain Cortex Spec');
|
|
793
|
+
// App-domain cortex lib name — from app's OWN spec, then fallback
|
|
794
|
+
// appSpec already declared at top of resolveApp
|
|
795
|
+
const appDomainLib = appSpec?.appDomainLib
|
|
796
|
+
|| appDomainSpec?.libName
|
|
797
|
+
|| appDomainComp2?.contextBundle?.libName
|
|
798
|
+
|| (appDomainComp2?.registeredAs || 'app').replace(/-([a-z0-9])/g, (_, ch) => ch.toUpperCase());
|
|
799
|
+
if (!appSpec?.appDomainLib)
|
|
800
|
+
logger.error(`[resolveApp] ⚠️ App spec missing appDomainLib — using fallback: ${appDomainLib}`);
|
|
801
|
+
// App metadata — from spec or blueprint
|
|
802
|
+
const bp = data.blueprint;
|
|
803
|
+
const appComp = bp.components?.find(c => c.type === 'app');
|
|
804
|
+
const appName = appSpec?.name || (appComp?.label || data.componentLabel || 'app').toLowerCase().replace(/[^a-z0-9]+/g, '-');
|
|
805
|
+
const appTitle = appSpec?.title || appComp?.label || data.componentLabel || 'AIMEAT App';
|
|
806
|
+
const appDescription = appSpec?.description || data.projectDescription || '';
|
|
807
|
+
const appLocale = appSpec?.locale || 'fi';
|
|
808
|
+
const appTheme = appSpec?.daisyTheme || 'light';
|
|
809
|
+
return {
|
|
810
|
+
label: data.componentLabel || '',
|
|
811
|
+
project_context: projectContext,
|
|
812
|
+
cortex_script_loads: cortexScriptLoads,
|
|
813
|
+
cortex_or_api_section: cortexOrApiSection,
|
|
814
|
+
cortex_rules: hasCortex ? '- Call cortex init() on app start — it handles everything automatically\n- Focus on UX/UI — the cortex handles data access and initialization' : '',
|
|
815
|
+
app_name: appName,
|
|
816
|
+
app_title: appTitle,
|
|
817
|
+
app_description: appDescription,
|
|
818
|
+
app_domain_lib: appDomainLib,
|
|
819
|
+
app_locale: appLocale,
|
|
820
|
+
app_theme: appTheme,
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
function resolveReflection(data) {
|
|
824
|
+
// Match browser buildReflectionPrompt() from fix.js lines 59-78
|
|
825
|
+
const errors = (data.errors || []).map((e, i) => `${i + 1}. ${e}`).join('\n');
|
|
826
|
+
const testCtx = data.testContext ? buildTestContextSection(data.testContext) : '';
|
|
827
|
+
const specContract = data.selfSpec
|
|
828
|
+
? `\`\`\`json\n${JSON.stringify(data.selfSpec, null, 2).slice(0, 3000)}\n\`\`\``
|
|
829
|
+
: 'No spec available';
|
|
830
|
+
return {
|
|
831
|
+
failed_code: data.code || '',
|
|
832
|
+
spec_contract: specContract,
|
|
833
|
+
errors,
|
|
834
|
+
test_context: testCtx,
|
|
835
|
+
};
|
|
836
|
+
}
|
|
837
|
+
function resolveFreshGeneration(data) {
|
|
838
|
+
// Match browser buildFreshGenerationPrompt() from fix.js lines 139-170
|
|
839
|
+
let pitfalls = '';
|
|
840
|
+
if (data.previousAttempts && data.previousAttempts.length > 0) {
|
|
841
|
+
pitfalls = '\n\n## KNOWN PITFALLS (from previous failed attempts — AVOID ALL of these)\n\n';
|
|
842
|
+
const seen = new Set();
|
|
843
|
+
for (const attempt of data.previousAttempts) {
|
|
844
|
+
const diag = attempt.diagnosis;
|
|
845
|
+
if (diag && !seen.has(diag)) {
|
|
846
|
+
pitfalls += `- ${diag}\n`;
|
|
847
|
+
seen.add(diag);
|
|
848
|
+
}
|
|
849
|
+
for (const err of attempt.errors || []) {
|
|
850
|
+
if (!seen.has(err)) {
|
|
851
|
+
pitfalls += `- Error to avoid: ${err}\n`;
|
|
852
|
+
seen.add(err);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
let testTrace = '';
|
|
858
|
+
const trace = data.testContext?.trace || [];
|
|
859
|
+
if (trace.length > 0) {
|
|
860
|
+
testTrace = '\n\n## ACTUAL API RESPONSES (use these exact data shapes)\n\n';
|
|
861
|
+
for (const t of trace)
|
|
862
|
+
testTrace += `[${t.status}] ${t.fn}(${t.args})\n → ${t.result}\n\n`;
|
|
863
|
+
}
|
|
864
|
+
return {
|
|
865
|
+
original_prompt: data.originalPrompt || '',
|
|
866
|
+
pitfalls,
|
|
867
|
+
test_trace: testTrace,
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
function resolveFix(data, fragments) {
|
|
871
|
+
// Match browser buildFixPrompt() — inject ACTUAL fragment content, not references
|
|
872
|
+
const ct = data.componentType || '';
|
|
873
|
+
const sc = fragments.sandbox_constraints || '';
|
|
874
|
+
const nr = fragments.namespace_rules || '';
|
|
875
|
+
const ecr = fragments.extension_consumption_rules || '';
|
|
876
|
+
let typeConstraints = '';
|
|
877
|
+
if (ct === 'extension') {
|
|
878
|
+
typeConstraints = `\n${sc}\n\n${nr}\n`;
|
|
879
|
+
}
|
|
880
|
+
else if (ct === 'cortex') {
|
|
881
|
+
typeConstraints = `\n${nr}\n\n${ecr}\n\nCORTEX CONSTRAINTS (browser IIFE):\n- Must be a single IIFE registering on window.AIMEAT\n- YAML metadata.name (kebab-case) and JS LIB_NAME (camelCase) must match\n- Every readExtMemory/getPublic call must be null-checked\n`;
|
|
882
|
+
}
|
|
883
|
+
else if (ct === 'app') {
|
|
884
|
+
typeConstraints = `\n${nr}\n\nAPP CONSTRAINTS (browser HTML):\n- Include CSP meta tag if using CDN scripts\n- Use AIMEAT.auth for login, AIMEAT.data for memory access\n- Call cortex init() before accessing data\n- Handle empty state gracefully (no data on first run)\n`;
|
|
885
|
+
}
|
|
886
|
+
return {
|
|
887
|
+
original_prompt: data.originalPrompt || '',
|
|
888
|
+
code: data.code || '',
|
|
889
|
+
errors: (data.errors || []).map((e, i) => `${i + 1}. ${e}`).join('\n'),
|
|
890
|
+
component_type: ct,
|
|
891
|
+
type_constraints: typeConstraints,
|
|
892
|
+
// These are populated when the autopilot passes them in PromptRuntimeData.
|
|
893
|
+
// The browser buildFixPrompt() builds these from testContext, previousAttempts, reflectionDiagnosis params.
|
|
894
|
+
// The autopilot currently passes errors but not test traces — these enable it when it does.
|
|
895
|
+
test_context: data.testContext ? buildTestContextSection(data.testContext) : '',
|
|
896
|
+
previous_attempts: data.previousAttempts ? buildPreviousAttemptsSection(data.previousAttempts) : '',
|
|
897
|
+
reflection_diagnosis: data.reflectionDiagnosis ? `\n\n## ROOT CAUSE ANALYSIS (from diagnostic step)\n\n${data.reflectionDiagnosis}\n\nApply this analysis precisely when fixing the code.\n` : '',
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
// Match browser buildTestContextSection() from fix.js lines 173-199
|
|
901
|
+
function buildTestContextSection(testContext) {
|
|
902
|
+
let section = '\n\n## Test Failure Context\n';
|
|
903
|
+
const errors = testContext.errors;
|
|
904
|
+
if (errors)
|
|
905
|
+
section += 'Test errors:\n' + errors.join('\n') + '\n';
|
|
906
|
+
const trace = testContext.trace;
|
|
907
|
+
if (trace && trace.length > 0) {
|
|
908
|
+
section += '\n## ACTUAL API RESPONSES (diagnostic trace)\n';
|
|
909
|
+
section += 'These are the real responses from every API call during the test.\n';
|
|
910
|
+
section += 'Study these carefully to understand the actual data shapes before fixing.\n\n';
|
|
911
|
+
for (const t of trace) {
|
|
912
|
+
section += `[${t.status}] ${t.fn}(${t.args})\n → ${t.result}\n\n`;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
const depResults = testContext.dependencyResults;
|
|
916
|
+
if (depResults) {
|
|
917
|
+
section += '\nDependency test results (these passed):\n';
|
|
918
|
+
for (const dep of depResults)
|
|
919
|
+
section += `- ${dep.componentId}: ${dep.status}\n`;
|
|
920
|
+
}
|
|
921
|
+
const bpComp = testContext.blueprintComponent;
|
|
922
|
+
if (bpComp) {
|
|
923
|
+
section += `\nBlueprint component spec:\n- type: ${bpComp.type}, produces: ${(bpComp.produces || []).join(', ')}, consumes: ${(bpComp.consumes || []).join(', ')}\n`;
|
|
924
|
+
}
|
|
925
|
+
return section;
|
|
926
|
+
}
|
|
927
|
+
// Match browser buildFixPrompt() previousAttempts section from fix.js lines 101-110
|
|
928
|
+
function buildPreviousAttemptsSection(attempts) {
|
|
929
|
+
if (!attempts || attempts.length === 0)
|
|
930
|
+
return '';
|
|
931
|
+
let section = '\n\n## PREVIOUS FIX ATTEMPTS (DO NOT repeat these approaches)\n\n';
|
|
932
|
+
for (const attempt of attempts) {
|
|
933
|
+
section += `### Round ${attempt.round}\n`;
|
|
934
|
+
if (attempt.diagnosis)
|
|
935
|
+
section += `Diagnosis: ${attempt.diagnosis}\n`;
|
|
936
|
+
section += `Errors after this round: ${(attempt.errors || []).join('; ')}\n\n`;
|
|
937
|
+
}
|
|
938
|
+
section += `You are now on round ${attempts.length + 1}. You MUST try a FUNDAMENTALLY different approach than the previous rounds.\n`;
|
|
939
|
+
return section;
|
|
940
|
+
}
|
|
941
|
+
function resolveTestExtensionSpec(data) {
|
|
942
|
+
// Match browser buildTestPrompt() — golden samples, scenarios, structures, contracts
|
|
943
|
+
const bp = data.blueprint;
|
|
944
|
+
const spec = data.selfSpec;
|
|
945
|
+
const extName = data.extensionName || spec?.name || '';
|
|
946
|
+
// Golden samples from probe results
|
|
947
|
+
const probes = (data.completedComponents || [])
|
|
948
|
+
.find(c => c.type === 'extension')?.probeResults;
|
|
949
|
+
let goldenSamples = '';
|
|
950
|
+
if (probes && probes.length > 0) {
|
|
951
|
+
const successful = probes.filter(p => p.status === 200 && p.response);
|
|
952
|
+
if (successful.length > 0) {
|
|
953
|
+
goldenSamples = '\n## GOLDEN SAMPLES — Real API responses (use these as test reference)\n\nThese are ACTUAL responses captured from the live extension. Your test assertions\nMUST match these data shapes. Do NOT invent field names — use exactly what you see here.\n\n';
|
|
954
|
+
for (const p of successful) {
|
|
955
|
+
// Truncate large responses to 2KB — show structure, not full data
|
|
956
|
+
let responseStr = JSON.stringify(p.response, null, 2);
|
|
957
|
+
if (responseStr.length > 2000) {
|
|
958
|
+
responseStr = responseStr.slice(0, 2000) + '\n... [truncated, ' + responseStr.length + ' chars total]';
|
|
959
|
+
}
|
|
960
|
+
goldenSamples += `### ${p.action}(${JSON.stringify(p.input)})\n\`\`\`json\n${responseStr}\n\`\`\`\n\n`;
|
|
961
|
+
}
|
|
962
|
+
goldenSamples += 'When writing assertions, reference the EXACT field names from the golden samples above.\n';
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
// Test scenarios — prefer SPEC actions over blueprint scenarios.
|
|
966
|
+
// Blueprint scenarios have abstract input shapes (e.g. {query, type}) that don't match
|
|
967
|
+
// the actual extension input schema (e.g. {name, businessId}). The spec is authoritative.
|
|
968
|
+
const bpComp = bp.components?.find(c => c.type === 'extension');
|
|
969
|
+
let testScenarios = '';
|
|
970
|
+
// Memory keys for cleanup instructions
|
|
971
|
+
const memoryProduces = (bpComp?.produces || [])
|
|
972
|
+
.filter((p) => p.startsWith('memory:'))
|
|
973
|
+
.map((p) => p.replace('memory:', ''));
|
|
974
|
+
if (memoryProduces.length > 0) {
|
|
975
|
+
testScenarios += `\n## State to Clean Up at Start\nThe extension writes to: ${memoryProduces.map(k => '`' + k + '`').join(', ')}\nBefore the first test scenario, clean stale data using the extension's OWN remove/delete actions via callExt.\nRead lists with readExtMemory, call remove for each item, then call init.\n`;
|
|
976
|
+
}
|
|
977
|
+
// Build scenarios from the SPEC (has correct action IDs and input schemas)
|
|
978
|
+
const specObj = data.selfSpec;
|
|
979
|
+
const specActions = (specObj?.actions || []);
|
|
980
|
+
if (specActions.length > 0) {
|
|
981
|
+
testScenarios += '\n## Test Scenarios (from extension spec — use THESE exact action IDs and input shapes)\n\n';
|
|
982
|
+
testScenarios += specActions.map((a, i) => {
|
|
983
|
+
const example = a.example;
|
|
984
|
+
const inputStr = example?.input ? JSON.stringify(example.input) : JSON.stringify(a.input || {});
|
|
985
|
+
return `${i + 1}. **${a.id}** — ${a.description || ''}\n Input: ${inputStr}\n Expected output fields: ${JSON.stringify(a.output || {})}`;
|
|
986
|
+
}).join('\n\n');
|
|
987
|
+
testScenarios += '\n\nTest EVERY action above using the EXACT input from the spec examples.\nFor actions that call external APIs: check response shape (has the right fields). A single graceful error is OK, but if ALL external API actions return errors, FAIL the test.\nFor memory-only actions: assert return values match the spec output shape.\n';
|
|
988
|
+
}
|
|
989
|
+
else if (bp.testScenarios && bpComp) {
|
|
990
|
+
// Fallback: use blueprint scenarios if no spec available
|
|
991
|
+
const scenarios = (bp.testScenarios || []).filter(ts => ts.component === bpComp.id).flatMap(ts => ts.scenarios || []);
|
|
992
|
+
if (scenarios.length > 0) {
|
|
993
|
+
testScenarios += '\n## Test Scenarios (from blueprint)\n\n' +
|
|
994
|
+
scenarios.map((s, i) => `${i + 1}. ${s.action}${s.type === 'external-api' ? ' [EXTERNAL API]' : ' [MEMORY]'}\n Input: ${JSON.stringify(s.input)}\n Expected: ${s.expect}`).join('\n\n') +
|
|
995
|
+
'\n\nTest EVERY scenario above.\nFor [EXTERNAL API]: check response shape. A single graceful error is OK, but if ALL fail, FAIL the test.\nFor [MEMORY]: assert return values match what the action code returns on success.\n';
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
// Golden samples extra guidance — browser lines 121-123
|
|
999
|
+
if (goldenSamples) {
|
|
1000
|
+
goldenSamples += 'For example, if the response has `item: { id: "abc", name: "Test" }`, assert `result.item.id`, NOT `result.item === "abc"`.\n';
|
|
1001
|
+
}
|
|
1002
|
+
// Structures and action contracts from blueprint
|
|
1003
|
+
const structures = bp.dataModel?.structures
|
|
1004
|
+
? Object.entries(bp.dataModel.structures).map(([name, schema]) => `### ${name}\n\`\`\`json\n${JSON.stringify(schema, null, 2)}\n\`\`\``).join('\n\n')
|
|
1005
|
+
: 'No structures defined';
|
|
1006
|
+
const actionContracts = bp.dataModel?.actions
|
|
1007
|
+
? Object.entries(bp.dataModel.actions).map(([name, def]) => `- **${name}**: input=${JSON.stringify(def.input || {})}, output=${def.output?.$ref ? '$ref:' + def.output.$ref : JSON.stringify(def.output || 'any')}`).join('\n')
|
|
1008
|
+
: 'No actions defined';
|
|
1009
|
+
// Project context — browser lines 48-55: blueprint components + use cases from interview
|
|
1010
|
+
const bpComponents = bp.components?.map(c => `- ${c.id} (${c.type}): ${c.label}`).join('\n') || '';
|
|
1011
|
+
const useCases = data.interviewSpec?.useCases
|
|
1012
|
+
? data.interviewSpec.useCases.map((uc, i) => {
|
|
1013
|
+
if (typeof uc === 'string')
|
|
1014
|
+
return `${i + 1}. ${uc}`;
|
|
1015
|
+
return `${i + 1}. ${uc.description || uc.title || JSON.stringify(uc)}`;
|
|
1016
|
+
}).join('\n')
|
|
1017
|
+
: 'No use cases specified';
|
|
1018
|
+
// Extension spec — gives the test the ACTUAL contracted action IDs (not just blueprint guesses)
|
|
1019
|
+
const extensionSpec = data.selfSpec
|
|
1020
|
+
? `\n## Extension Spec (actual contract — use THESE action IDs)\n\n\`\`\`json\n${JSON.stringify(data.selfSpec, null, 2).slice(0, 3000)}\n\`\`\`\n`
|
|
1021
|
+
: '';
|
|
1022
|
+
return {
|
|
1023
|
+
extension_name: extName,
|
|
1024
|
+
golden_samples: goldenSamples,
|
|
1025
|
+
extension_spec: extensionSpec,
|
|
1026
|
+
test_scenarios: testScenarios,
|
|
1027
|
+
structures,
|
|
1028
|
+
action_contracts: actionContracts,
|
|
1029
|
+
project_context: `## Project Context\nBlueprint components:\n${bpComponents}\n\nUse cases from interview:\n${useCases}`,
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
function resolveTestCortexSpec(data) {
|
|
1033
|
+
const bp = data.blueprint;
|
|
1034
|
+
const spec = data.selfSpec;
|
|
1035
|
+
const libName = spec?.libName || '';
|
|
1036
|
+
const wrapsExt = spec?.wrapsExtension || '';
|
|
1037
|
+
// Cortex methods from blueprint — this is the DEFINITIVE list of what to test
|
|
1038
|
+
const bpComp = bp.components?.find(c => c.label === data.componentLabel);
|
|
1039
|
+
let cortexMethods = '';
|
|
1040
|
+
if (bpComp) {
|
|
1041
|
+
const methods = (bpComp.produces || []).filter((p) => p.startsWith('api:')).map((p) => p.replace('api:', ''));
|
|
1042
|
+
if (methods.length > 0)
|
|
1043
|
+
cortexMethods = `\n## Cortex Methods to Test (from blueprint — test ALL of these and NOTHING ELSE)\n${methods.map((m) => `- ${m}(params)`).join('\n')}\n\nTest ONLY these methods via window.AIMEAT.${libName}. Do NOT call init(), checkChanges(), or any scheduled/bootstrap actions — those are server-only extension jobs, not cortex library methods.\n`;
|
|
1044
|
+
}
|
|
1045
|
+
// Golden samples from probes — labeled as EXTENSION responses for context
|
|
1046
|
+
const probes = (data.completedComponents || [])
|
|
1047
|
+
.find(c => c.type === 'extension')?.probeResults;
|
|
1048
|
+
let goldenSamples = '';
|
|
1049
|
+
if (probes && probes.length > 0) {
|
|
1050
|
+
const successful = probes.filter(p => p.status === 200 && p.response);
|
|
1051
|
+
if (successful.length > 0) {
|
|
1052
|
+
goldenSamples = '\n## GOLDEN SAMPLES — Real responses from the EXTENSION that the cortex wraps\n\nThese show what the extension returns. The cortex methods call these internally.\nUse these to understand the data shapes, but test the CORTEX methods listed above, not the extension actions.\n\n';
|
|
1053
|
+
for (const p of successful)
|
|
1054
|
+
goldenSamples += `### ${p.action}(${JSON.stringify(p.input)})\n\`\`\`json\n${JSON.stringify(p.response, null, 2)}\n\`\`\`\n\n`;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
// Test scenarios from blueprint (if any exist for this cortex component)
|
|
1058
|
+
let testScenarios = '';
|
|
1059
|
+
if (bp.testScenarios && bpComp) {
|
|
1060
|
+
const scenarios = (bp.testScenarios || []).filter(ts => ts.component === bpComp.id).flatMap(ts => ts.scenarios || []);
|
|
1061
|
+
if (scenarios.length > 0) {
|
|
1062
|
+
testScenarios = '\n## Test Scenarios (from blueprint)\n\n' +
|
|
1063
|
+
scenarios.map((s, i) => `${i + 1}. Call ${s.action}(${JSON.stringify(s.input)})\n Expected: ${s.expect}`).join('\n\n') +
|
|
1064
|
+
'\n\nTest EVERY scenario above.\n';
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
const structures = bp.dataModel?.structures
|
|
1068
|
+
? Object.entries(bp.dataModel.structures).map(([name, schema]) => `### ${name}\n\`\`\`json\n${JSON.stringify(schema, null, 2)}\n\`\`\``).join('\n\n')
|
|
1069
|
+
: 'No structures defined';
|
|
1070
|
+
// FIX #2: Filter action contracts to cortex: only — extension actions confuse the LLM into testing them directly
|
|
1071
|
+
const actionContracts = bp.dataModel?.actions
|
|
1072
|
+
? Object.entries(bp.dataModel.actions)
|
|
1073
|
+
.filter(([name]) => name.startsWith('cortex:'))
|
|
1074
|
+
.map(([name, def]) => `- **${name}**: input=${JSON.stringify(def.input || {})}, output=${def.output?.$ref ? '$ref:' + def.output.$ref : JSON.stringify(def.output || 'any')}`)
|
|
1075
|
+
.join('\n')
|
|
1076
|
+
: 'No actions defined';
|
|
1077
|
+
// FIX #6: Only include APP test block for app-domain cortex, not data cortex
|
|
1078
|
+
const subtype = bpComp?.subtype || '';
|
|
1079
|
+
let appTestBlock = '';
|
|
1080
|
+
if (subtype === 'app-domain') {
|
|
1081
|
+
const appApis = bpComp ? (bpComp.consumes || []).filter((p) => p.startsWith('api:')).map((p) => p.replace('api:', '')) : [];
|
|
1082
|
+
appTestBlock = `\nFor APP tests:
|
|
1083
|
+
- The app is already loaded on the test page
|
|
1084
|
+
- Authentication IS available
|
|
1085
|
+
- Wait for data to render: await new Promise(r => setTimeout(r, 3000));
|
|
1086
|
+
- Check DOM elements, click buttons, verify results
|
|
1087
|
+
- Verify actual content renders (not translation keys like "search.title")
|
|
1088
|
+
- Verify API calls return real data visible in the UI\n`;
|
|
1089
|
+
if (appApis.length > 0) {
|
|
1090
|
+
appTestBlock += `\n## App APIs (verify they work in the UI)\n${appApis.map((a) => `- ${a}`).join('\n')}\n`;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
// Project context
|
|
1094
|
+
const bpComponents = bp.components?.map(c => `- ${c.id} (${c.type}): ${c.label}`).join('\n') || '';
|
|
1095
|
+
const useCases = data.interviewSpec?.useCases
|
|
1096
|
+
? data.interviewSpec.useCases.map((uc, i) => {
|
|
1097
|
+
if (typeof uc === 'string')
|
|
1098
|
+
return `${i + 1}. ${uc}`;
|
|
1099
|
+
return `${i + 1}. ${uc.description || uc.title || JSON.stringify(uc)}`;
|
|
1100
|
+
}).join('\n')
|
|
1101
|
+
: 'No use cases specified';
|
|
1102
|
+
return {
|
|
1103
|
+
lib_name: libName,
|
|
1104
|
+
wraps_extension: wrapsExt,
|
|
1105
|
+
golden_samples: goldenSamples,
|
|
1106
|
+
test_scenarios: testScenarios,
|
|
1107
|
+
structures,
|
|
1108
|
+
action_contracts: actionContracts,
|
|
1109
|
+
project_context: `## Project Context\nBlueprint components:\n${bpComponents}\n\nUse cases from interview:\n${useCases}`,
|
|
1110
|
+
cortex_methods: cortexMethods + appTestBlock,
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
// ── Shared context builder ──
|
|
1114
|
+
function buildContextString(data) {
|
|
1115
|
+
let context = '';
|
|
1116
|
+
// Project description (not for extensions — they're project-agnostic)
|
|
1117
|
+
if (data.componentType !== 'extension') {
|
|
1118
|
+
context += `Project: ${data.projectDescription || ''}\n`;
|
|
1119
|
+
}
|
|
1120
|
+
// DataModel entries relevant to this component
|
|
1121
|
+
if (data.blueprint.dataModel && data.blueprintComponent) {
|
|
1122
|
+
const dm = data.blueprint.dataModel;
|
|
1123
|
+
const compId = data.blueprintComponent.id;
|
|
1124
|
+
const relevant = {};
|
|
1125
|
+
for (const [key, schema] of Object.entries(dm.memoryKeys || {})) {
|
|
1126
|
+
if (schema.producedBy === compId || schema.consumedBy?.includes(compId)) {
|
|
1127
|
+
const { source, producedBy, consumedBy, ...rest } = schema;
|
|
1128
|
+
relevant[key] = rest;
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
if (Object.keys(relevant).length > 0) {
|
|
1132
|
+
context += '\n## Domain Data Model (EXACT schemas)\n```json\n' + JSON.stringify(relevant, null, 2) + '\n```\n\n';
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
// Data sources for extensions
|
|
1136
|
+
if (data.componentType === 'extension' && data.interviewSpec?.dataSources) {
|
|
1137
|
+
context += '\n## Data Source Details\n' + formatDataSources(data.interviewSpec.dataSources) + '\n';
|
|
1138
|
+
}
|
|
1139
|
+
// Completed components context
|
|
1140
|
+
context += formatCompletedContext(data.completedComponents);
|
|
1141
|
+
// Interview use cases (for app/cortex)
|
|
1142
|
+
if ((data.componentType === 'app' || data.componentType === 'cortex') && data.interviewSpec?.useCases) {
|
|
1143
|
+
context += '\n## Use Cases\n' + formatUseCases(data.interviewSpec.useCases) + '\n';
|
|
1144
|
+
}
|
|
1145
|
+
return context;
|
|
1146
|
+
}
|
|
1147
|
+
// ── Component cortex test resolver ──
|
|
1148
|
+
function resolveTestCortexComponent(data) {
|
|
1149
|
+
const bp = data.blueprint;
|
|
1150
|
+
const spec = data.selfSpec;
|
|
1151
|
+
const libName = spec?.libName || spec?.name || '';
|
|
1152
|
+
// Spec section
|
|
1153
|
+
let specSection = '';
|
|
1154
|
+
if (spec) {
|
|
1155
|
+
specSection = `\n## Component Spec\n\`\`\`json\n${JSON.stringify(spec, null, 2).slice(0, 3000)}\n\`\`\`\n`;
|
|
1156
|
+
}
|
|
1157
|
+
// Data cortex info — inject SPEC with returnsExamples so the test knows the exact data shapes
|
|
1158
|
+
const dataCortex = (data.completedComponents || []).find(c => c.type === 'cortex' && c.subtype === 'data');
|
|
1159
|
+
const dcBundle = dataCortex?.contextBundle;
|
|
1160
|
+
const dcSpec = dataCortex?.spec;
|
|
1161
|
+
let dataCortexInfo;
|
|
1162
|
+
if (dcBundle || dcSpec) {
|
|
1163
|
+
const libName2 = dcSpec?.libName || dcBundle?.libName || dcBundle?.registeredAs || '';
|
|
1164
|
+
dataCortexInfo = `\nThe data cortex is loaded at: window.AIMEAT.${libName2}\n`;
|
|
1165
|
+
dataCortexInfo += `\nIMPORTANT: All data cortex methods take a SINGLE OBJECT parameter: dataCortex.getCompany({businessId: '3323553-5'})\nNEVER pass plain strings: dataCortex.getCompany('3323553-5') is WRONG.\n`;
|
|
1166
|
+
// Inject method return shapes from spec
|
|
1167
|
+
const methods = dcSpec?.methods || [];
|
|
1168
|
+
if (methods.length > 0) {
|
|
1169
|
+
dataCortexInfo += '\n### Data Cortex Methods and Return Shapes\n\n';
|
|
1170
|
+
for (const m of methods) {
|
|
1171
|
+
dataCortexInfo += `**${m.name}(${m.params || ''})** → ${m.returns || 'unknown'}\n`;
|
|
1172
|
+
if (m.returnsExample) {
|
|
1173
|
+
const example = typeof m.returnsExample === 'string' ? m.returnsExample : JSON.stringify(m.returnsExample, null, 2);
|
|
1174
|
+
dataCortexInfo += `\`\`\`json\n${example.substring(0, 400)}\n\`\`\`\n`;
|
|
1175
|
+
}
|
|
1176
|
+
dataCortexInfo += '\n';
|
|
1177
|
+
}
|
|
1178
|
+
dataCortexInfo += 'CRITICAL: Data has NESTED OBJECTS. businessId is {value: "..."} NOT a plain string. names is [{name: "..."}] NOT a string array.\nUse: company.businessId.value, company.names[0].name\n';
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
else {
|
|
1182
|
+
dataCortexInfo = warnFallback('gen-test-cortex-component', 'data_cortex_info', 'No data cortex available on test page.');
|
|
1183
|
+
}
|
|
1184
|
+
// Project context
|
|
1185
|
+
const bpComponents = bp.components?.map(c => `- ${c.id} (${c.type}): ${c.label}`).join('\n') || '';
|
|
1186
|
+
const useCases = data.interviewSpec?.useCases
|
|
1187
|
+
? data.interviewSpec.useCases.map((uc, i) => {
|
|
1188
|
+
if (typeof uc === 'string')
|
|
1189
|
+
return `${i + 1}. ${uc}`;
|
|
1190
|
+
return `${i + 1}. ${uc.description || uc.title || JSON.stringify(uc)}`;
|
|
1191
|
+
}).join('\n')
|
|
1192
|
+
: 'No use cases specified';
|
|
1193
|
+
// Service slug from blueprint — the single source of truth for namespacing
|
|
1194
|
+
const serviceSlug2 = data.blueprint.service_slug;
|
|
1195
|
+
if (!serviceSlug2)
|
|
1196
|
+
throw new Error('Blueprint missing "service_slug" — cannot build app prompt. Regenerate blueprint.');
|
|
1197
|
+
// Data cortex lib name and first method for template
|
|
1198
|
+
const dcLibName = dcSpec?.libName || dcBundle?.libName || dcBundle?.registeredAs || 'dataCortex';
|
|
1199
|
+
const dcMethods = dcSpec?.methods || [];
|
|
1200
|
+
const firstMethod = dcMethods[0];
|
|
1201
|
+
const firstMethodName = firstMethod?.name || 'getData';
|
|
1202
|
+
const firstMethodParams = firstMethod?.params || '{}';
|
|
1203
|
+
// Build method list for ADAPT comment
|
|
1204
|
+
const methodList = dcMethods.map(m => `${m.name}(${m.params || ''})`).join(', ') || 'no methods available';
|
|
1205
|
+
// Build pre-filled test template
|
|
1206
|
+
const testTemplate = `// ── Test scaffolding (do not remove) ──
|
|
1207
|
+
const results = { passed: false, errors: [], details: '' };
|
|
1208
|
+
const log = (msg) => { results.details += msg + '\\n'; };
|
|
1209
|
+
const fail = (msg) => { results.errors.push(msg); log('FAIL: ' + msg); };
|
|
1210
|
+
const pass = (msg) => { log('PASS: ' + msg); };
|
|
1211
|
+
|
|
1212
|
+
// ── Library checks ──
|
|
1213
|
+
const lib = window.AIMEAT.${libName};
|
|
1214
|
+
if (!lib) { fail('Library not loaded'); window.__testResults = results; return; }
|
|
1215
|
+
if (typeof lib.render !== 'function') { fail('render not a function'); window.__testResults = results; return; }
|
|
1216
|
+
pass('Component library loaded');
|
|
1217
|
+
|
|
1218
|
+
const dataCortex = window.AIMEAT.${dcLibName};
|
|
1219
|
+
if (!dataCortex) { fail('Data cortex not loaded'); window.__testResults = results; return; }
|
|
1220
|
+
pass('Data cortex loaded');
|
|
1221
|
+
|
|
1222
|
+
// ── Load translations ──
|
|
1223
|
+
const translations = await AIMEAT.data.get('${serviceSlug2}.i18n.fi') || {};
|
|
1224
|
+
log('Loaded ' + Object.keys(translations).length + ' translation keys');
|
|
1225
|
+
|
|
1226
|
+
// ── ADAPT: Fetch test data ──
|
|
1227
|
+
// Available methods: ${methodList}
|
|
1228
|
+
// All methods take OBJECT params: dataCortex.method({key: 'value'})
|
|
1229
|
+
let testData;
|
|
1230
|
+
try {
|
|
1231
|
+
testData = await dataCortex.${firstMethodName}(${firstMethodParams});
|
|
1232
|
+
log('Data: ' + JSON.stringify(testData).substring(0, 200));
|
|
1233
|
+
} catch (e) {
|
|
1234
|
+
log('Data fetch error: ' + e.message + ' — testing with empty data');
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
// ── Render ──
|
|
1238
|
+
const container = document.createElement('div');
|
|
1239
|
+
container.id = 'test-container';
|
|
1240
|
+
document.body.appendChild(container);
|
|
1241
|
+
|
|
1242
|
+
// ADAPT: adjust render props for this component
|
|
1243
|
+
const result = await lib.render(container, {
|
|
1244
|
+
locale: 'fi',
|
|
1245
|
+
translations: translations,
|
|
1246
|
+
// TODO: add component-specific props from testData
|
|
1247
|
+
});
|
|
1248
|
+
|
|
1249
|
+
// ── Wait for async DOM (do not remove) ──
|
|
1250
|
+
await new Promise(r => setTimeout(r, 3000));
|
|
1251
|
+
|
|
1252
|
+
// ── Check DOM output ──
|
|
1253
|
+
log('Container HTML length: ' + container.innerHTML.length);
|
|
1254
|
+
if (container.innerHTML.length < 50) fail('render: container nearly empty');
|
|
1255
|
+
else pass('render: produced HTML content');
|
|
1256
|
+
|
|
1257
|
+
const text = container.textContent || '';
|
|
1258
|
+
log('Container text (first 300): ' + text.substring(0, 300));
|
|
1259
|
+
|
|
1260
|
+
// ── ADAPT: Check component-specific content ──
|
|
1261
|
+
if (text.length > 20) pass('render: has text content');
|
|
1262
|
+
else fail('render: no text content');
|
|
1263
|
+
|
|
1264
|
+
// ── Check daisyUI usage ──
|
|
1265
|
+
const hasDaisyUI = container.querySelector('[class*="card"], [class*="table"], [class*="badge"], [class*="btn"], [class*="alert"], [class*="tabs"], [class*="stat"], [class*="timeline"]');
|
|
1266
|
+
if (hasDaisyUI) pass('render: uses daisyUI components');
|
|
1267
|
+
else log('Note: no daisyUI classes detected');
|
|
1268
|
+
|
|
1269
|
+
// ── Check translations ──
|
|
1270
|
+
const rawKeys = (text.match(/app\\.[a-z]+\\.[a-z]+/g) || []);
|
|
1271
|
+
if (Object.keys(translations).length > 0 && rawKeys.length > 3) {
|
|
1272
|
+
fail('render: ' + rawKeys.length + ' raw translation keys: ' + rawKeys.slice(0,5).join(', '));
|
|
1273
|
+
} else {
|
|
1274
|
+
pass('render: translations applied');
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
// ── Snapshot (do not remove) ──
|
|
1278
|
+
window.__renderSnapshot = container.innerHTML;
|
|
1279
|
+
|
|
1280
|
+
// ── Check return object ──
|
|
1281
|
+
if (result && result.el instanceof HTMLElement) pass('render: returned {el}');
|
|
1282
|
+
else log('Note: no el returned (component may use container directly)');
|
|
1283
|
+
|
|
1284
|
+
if (result && typeof result.destroy === 'function') {
|
|
1285
|
+
try { result.destroy(); pass('destroy: OK'); }
|
|
1286
|
+
catch (e) { fail('destroy threw: ' + e.message); }
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
// ── Cleanup (do not remove) ──
|
|
1290
|
+
if (container.parentNode) container.parentNode.removeChild(container);
|
|
1291
|
+
if (results.errors.length === 0) results.passed = true;
|
|
1292
|
+
window.__testResults = results;`;
|
|
1293
|
+
return {
|
|
1294
|
+
component_label: data.componentLabel || '',
|
|
1295
|
+
registered_as: spec?.name || '',
|
|
1296
|
+
lib_name: libName,
|
|
1297
|
+
spec_section: specSection,
|
|
1298
|
+
data_cortex_info: dataCortexInfo,
|
|
1299
|
+
project_context: `## Project Context\nBlueprint components:\n${bpComponents}\n\nUse cases:\n${useCases}`,
|
|
1300
|
+
test_template: testTemplate,
|
|
1301
|
+
};
|
|
1302
|
+
}
|
|
1303
|
+
// ── App-domain cortex test resolver ──
|
|
1304
|
+
function resolveTestCortexAppDomain(data) {
|
|
1305
|
+
const bp = data.blueprint;
|
|
1306
|
+
const spec = data.selfSpec;
|
|
1307
|
+
const libName = spec?.libName || spec?.name || '';
|
|
1308
|
+
// Spec section
|
|
1309
|
+
let specSection = '';
|
|
1310
|
+
if (spec) {
|
|
1311
|
+
specSection = `\n## App-Domain Spec\n\`\`\`json\n${JSON.stringify(spec, null, 2).slice(0, 3000)}\n\`\`\`\n`;
|
|
1312
|
+
}
|
|
1313
|
+
// Feature components
|
|
1314
|
+
const featureComps = (data.completedComponents || []).filter(c => c.type === 'cortex' && (c.subtype === 'component' || c.subtype === 'feature'));
|
|
1315
|
+
const featureComponents = featureComps.length > 0
|
|
1316
|
+
? featureComps.map(c => {
|
|
1317
|
+
const b = c.contextBundle;
|
|
1318
|
+
return `- ${b?.name || c.label}: AIMEAT.${b?.libName || c.registeredAs || ''} (exports: ${(b?.exports || []).join(', ')})`;
|
|
1319
|
+
}).join('\n')
|
|
1320
|
+
: 'No feature components registered yet.';
|
|
1321
|
+
// Data cortex info
|
|
1322
|
+
const dataCortex = (data.completedComponents || []).find(c => c.type === 'cortex' && c.subtype === 'data');
|
|
1323
|
+
const dcBundle = dataCortex?.contextBundle;
|
|
1324
|
+
let dataCortexInfo;
|
|
1325
|
+
if (dcBundle) {
|
|
1326
|
+
dataCortexInfo = `window.AIMEAT.${dcBundle.libName || dcBundle.registeredAs || ''} — methods: ${(dcBundle.exports || []).join(', ')}`;
|
|
1327
|
+
}
|
|
1328
|
+
else {
|
|
1329
|
+
dataCortexInfo = warnFallback('gen-test-cortex-app-domain', 'data_cortex_info', 'No data cortex available.');
|
|
1330
|
+
}
|
|
1331
|
+
// Project context
|
|
1332
|
+
const bpComponents = bp.components?.map(c => `- ${c.id} (${c.type}): ${c.label}`).join('\n') || '';
|
|
1333
|
+
// Build pre-filled app-domain test template
|
|
1334
|
+
const testTemplate = `// ── Test scaffolding (do not remove) ──
|
|
1335
|
+
const results = { passed: false, errors: [], details: '' };
|
|
1336
|
+
const log = (msg) => { results.details += msg + '\\n'; };
|
|
1337
|
+
const fail = (msg) => { results.errors.push(msg); log('FAIL: ' + msg); };
|
|
1338
|
+
const pass = (msg) => { log('PASS: ' + msg); };
|
|
1339
|
+
|
|
1340
|
+
// ── Library check ──
|
|
1341
|
+
const lib = window.AIMEAT.${libName};
|
|
1342
|
+
if (!lib) { fail('Library not loaded'); window.__testResults = results; return; }
|
|
1343
|
+
pass('App-domain library loaded');
|
|
1344
|
+
|
|
1345
|
+
// 1. TEST INIT
|
|
1346
|
+
log('Testing init...');
|
|
1347
|
+
try {
|
|
1348
|
+
const initResult = await lib.init();
|
|
1349
|
+
log('init returned: ' + JSON.stringify(initResult));
|
|
1350
|
+
pass('init: completed successfully');
|
|
1351
|
+
} catch (e) {
|
|
1352
|
+
fail('init: threw error: ' + e.message);
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
// 2. TEST RENDER
|
|
1356
|
+
log('Testing render...');
|
|
1357
|
+
const container = document.createElement('div');
|
|
1358
|
+
container.id = 'test-app-container';
|
|
1359
|
+
container.style.width = '1024px';
|
|
1360
|
+
container.style.height = '768px';
|
|
1361
|
+
document.body.appendChild(container);
|
|
1362
|
+
|
|
1363
|
+
try {
|
|
1364
|
+
await lib.render(container);
|
|
1365
|
+
} catch (e) {
|
|
1366
|
+
fail('render: threw error: ' + e.message);
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
// ── Wait for async DOM (do not remove) ──
|
|
1370
|
+
await new Promise(r => setTimeout(r, 3000));
|
|
1371
|
+
|
|
1372
|
+
// ── Check DOM output ──
|
|
1373
|
+
log('Container HTML length: ' + container.innerHTML.length);
|
|
1374
|
+
if (container.innerHTML.length < 100) fail('render: container nearly empty');
|
|
1375
|
+
else pass('render: produced HTML content (' + container.innerHTML.length + ' chars)');
|
|
1376
|
+
|
|
1377
|
+
// ── Check navigation (daisyUI) ──
|
|
1378
|
+
const hasNav = container.querySelector('[class*="tabs"], [class*="menu"], [class*="navbar"], [class*="drawer"], nav');
|
|
1379
|
+
if (hasNav) pass('render: navigation elements found');
|
|
1380
|
+
else log('Note: no navigation elements detected');
|
|
1381
|
+
|
|
1382
|
+
// ── Check daisyUI usage ──
|
|
1383
|
+
const hasDaisyUI = container.querySelector('[class*="card"], [class*="table"], [class*="btn"], [class*="tabs"], [class*="drawer"]');
|
|
1384
|
+
if (hasDaisyUI) pass('render: uses daisyUI components');
|
|
1385
|
+
else log('Note: no daisyUI classes detected');
|
|
1386
|
+
|
|
1387
|
+
// ── ADAPT: Check component-specific content ──
|
|
1388
|
+
const text = container.textContent || '';
|
|
1389
|
+
log('Container text (first 300): ' + text.substring(0, 300));
|
|
1390
|
+
if (text.length > 50) pass('render: has text content');
|
|
1391
|
+
else fail('render: no text content');
|
|
1392
|
+
|
|
1393
|
+
// 3. TEST t() FUNCTION
|
|
1394
|
+
if (typeof lib.t === 'function') {
|
|
1395
|
+
const translated = lib.t('app.title');
|
|
1396
|
+
log('t("app.title") = ' + translated);
|
|
1397
|
+
if (translated && translated !== 'app.title') pass('t: translates keys');
|
|
1398
|
+
else log('Note: t() returned raw key (translations may not be loaded)');
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
// 4. TEST switchLocale
|
|
1402
|
+
if (typeof lib.switchLocale === 'function') {
|
|
1403
|
+
try {
|
|
1404
|
+
await lib.switchLocale('en');
|
|
1405
|
+
pass('switchLocale: executed without error');
|
|
1406
|
+
} catch (e) {
|
|
1407
|
+
log('Note: switchLocale threw: ' + e.message);
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
// ── Snapshot (do not remove) ──
|
|
1412
|
+
window.__renderSnapshot = container.innerHTML;
|
|
1413
|
+
|
|
1414
|
+
// ── Cleanup (do not remove) ──
|
|
1415
|
+
if (container.parentNode) container.parentNode.removeChild(container);
|
|
1416
|
+
if (results.errors.length === 0) results.passed = true;
|
|
1417
|
+
window.__testResults = results;`;
|
|
1418
|
+
return {
|
|
1419
|
+
component_label: data.componentLabel || '',
|
|
1420
|
+
registered_as: spec?.name || '',
|
|
1421
|
+
lib_name: libName,
|
|
1422
|
+
spec_section: specSection,
|
|
1423
|
+
feature_components: featureComponents,
|
|
1424
|
+
data_cortex_info: dataCortexInfo,
|
|
1425
|
+
project_context: `## Project Context\nBlueprint components:\n${bpComponents}`,
|
|
1426
|
+
test_template: testTemplate,
|
|
1427
|
+
};
|
|
1428
|
+
}
|
|
1429
|
+
// ── App test resolver ──
|
|
1430
|
+
function resolveTestApp(data) {
|
|
1431
|
+
const bp = data.blueprint;
|
|
1432
|
+
const bpComponents = bp.components?.map(c => `- ${c.id} (${c.type}): ${c.label}`).join('\n') || '';
|
|
1433
|
+
// App-domain lib name — from app's OWN spec first, then fallback
|
|
1434
|
+
const appSpec = data.selfSpec;
|
|
1435
|
+
const appDomain = (data.completedComponents || []).find(c => c.type === 'cortex' && (c.subtype === 'app-domain' || c.spec?.methods) && c.registeredAs);
|
|
1436
|
+
const appDomainSpec2 = appDomain?.spec;
|
|
1437
|
+
const appLibName = appSpec?.appDomainLib
|
|
1438
|
+
|| appDomainSpec2?.libName
|
|
1439
|
+
|| appDomain?.contextBundle?.libName
|
|
1440
|
+
|| (appDomain?.registeredAs || 'app').replace(/-([a-z0-9])/g, (_, ch) => ch.toUpperCase());
|
|
1441
|
+
if (!appSpec?.appDomainLib)
|
|
1442
|
+
logger.error(`[resolveTestApp] ⚠️ App spec missing appDomainLib — using fallback: ${appLibName}`);
|
|
1443
|
+
const testTemplate = `// ── Test scaffolding (do not remove) ──
|
|
1444
|
+
const results = { passed: false, errors: [], details: '' };
|
|
1445
|
+
const log = (msg) => { results.details += msg + '\\n'; };
|
|
1446
|
+
const fail = (msg) => { results.errors.push(msg); log('FAIL: ' + msg); };
|
|
1447
|
+
const pass = (msg) => { log('PASS: ' + msg); };
|
|
1448
|
+
|
|
1449
|
+
// ── Check app-domain cortex ──
|
|
1450
|
+
const appLib = window.AIMEAT.${appLibName};
|
|
1451
|
+
if (!appLib) { fail('App-domain library ${appLibName} not loaded'); window.__testResults = results; return; }
|
|
1452
|
+
pass('App-domain library loaded');
|
|
1453
|
+
|
|
1454
|
+
// ── Init ──
|
|
1455
|
+
try {
|
|
1456
|
+
const initResult = await appLib.init();
|
|
1457
|
+
log('init returned: ' + JSON.stringify(initResult).substring(0, 200));
|
|
1458
|
+
pass('init: completed');
|
|
1459
|
+
} catch (e) {
|
|
1460
|
+
fail('init threw: ' + e.message);
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
// ── Render into #app ──
|
|
1464
|
+
const appEl = document.getElementById('app') || document.createElement('div');
|
|
1465
|
+
if (!appEl.id) { appEl.id = 'app'; document.body.appendChild(appEl); }
|
|
1466
|
+
|
|
1467
|
+
try {
|
|
1468
|
+
await appLib.render(appEl);
|
|
1469
|
+
} catch (e) {
|
|
1470
|
+
fail('render threw: ' + e.message);
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
// ── Wait for async DOM (do not remove) ──
|
|
1474
|
+
await new Promise(r => setTimeout(r, 3000));
|
|
1475
|
+
|
|
1476
|
+
// ── Check content ──
|
|
1477
|
+
log('App HTML length: ' + appEl.innerHTML.length);
|
|
1478
|
+
if (appEl.innerHTML.length < 100) fail('render: app container nearly empty');
|
|
1479
|
+
else pass('render: produced HTML content');
|
|
1480
|
+
|
|
1481
|
+
const text = appEl.textContent || '';
|
|
1482
|
+
log('App text (first 300): ' + text.substring(0, 300));
|
|
1483
|
+
if (text.length > 50) pass('render: has text content');
|
|
1484
|
+
else fail('render: no text content');
|
|
1485
|
+
|
|
1486
|
+
// ── Check daisyUI ──
|
|
1487
|
+
const hasDaisyUI = appEl.querySelector('[class*="card"], [class*="table"], [class*="btn"], [class*="tabs"], [class*="menu"], [class*="drawer"]');
|
|
1488
|
+
if (hasDaisyUI) pass('render: uses daisyUI components');
|
|
1489
|
+
else log('Note: no daisyUI classes detected');
|
|
1490
|
+
|
|
1491
|
+
// ── Check navigation ──
|
|
1492
|
+
const hasNav = appEl.querySelector('[class*="tabs"], [class*="menu"], [class*="drawer"], [data-view], nav');
|
|
1493
|
+
if (hasNav) pass('render: navigation present');
|
|
1494
|
+
else log('Note: no navigation found');
|
|
1495
|
+
|
|
1496
|
+
// ── Check text content (do NOT test individual components — they have their own tests) ──
|
|
1497
|
+
|
|
1498
|
+
// ── Snapshot (do not remove) ──
|
|
1499
|
+
window.__renderSnapshot = appEl.innerHTML;
|
|
1500
|
+
|
|
1501
|
+
// ── Cleanup (do not remove) ──
|
|
1502
|
+
if (results.errors.length === 0) results.passed = true;
|
|
1503
|
+
window.__testResults = results;`;
|
|
1504
|
+
return {
|
|
1505
|
+
component_label: data.componentLabel || '',
|
|
1506
|
+
project_context: `## Project Context\nBlueprint components:\n${bpComponents}`,
|
|
1507
|
+
test_template: testTemplate,
|
|
1508
|
+
};
|
|
1509
|
+
}
|
|
1510
|
+
// ── Blueprint & Interview resolvers ──
|
|
1511
|
+
function resolveBlueprint(data) {
|
|
1512
|
+
const interviewSpec = data.interviewSpec;
|
|
1513
|
+
const interviewSpecSection = interviewSpec
|
|
1514
|
+
? `\n## Refined Specification (from requirements interview)\n\`\`\`json\n${JSON.stringify(interviewSpec, null, 2)}\n\`\`\`\n\nUse the specification above to determine the exact components needed. The data sources, entities, views, and constraints have been validated with the user.\n`
|
|
1515
|
+
: '';
|
|
1516
|
+
const specLocale = interviewSpec?.locale;
|
|
1517
|
+
const languageNote = specLocale && specLocale !== 'en'
|
|
1518
|
+
? `\n## LANGUAGE\n\nThe user's language is "${specLocale}". Write all human-readable labels and descriptions in that language.\nJSON keys and technical identifiers stay in English.\n`
|
|
1519
|
+
: '';
|
|
1520
|
+
// Cortex catalog built from data.cortexCatalog if available
|
|
1521
|
+
let cortexCatalog = '';
|
|
1522
|
+
const libs = data.cortexCatalog;
|
|
1523
|
+
if (libs && libs.length > 0) {
|
|
1524
|
+
cortexCatalog = '\n## Available Cortex Libraries (reuse these — do NOT recreate)\n\n' +
|
|
1525
|
+
libs.map(lib => {
|
|
1526
|
+
const libComps = (lib.components || []).filter(c => c.type === 'lib');
|
|
1527
|
+
const exports = libComps.map(c => c.exports || []).flat();
|
|
1528
|
+
const apiSurface = libComps.map(c => c.api_surface || '').filter(Boolean).join('\n');
|
|
1529
|
+
return `### ${lib.name} — ${lib.description || 'no description'}\n- **Exports:** ${exports.join(', ') || 'none'}\n${apiSurface ? `- **API:**\n\`\`\`\n${apiSurface.trim()}\n\`\`\`` : ''}\n- **Load:** \`<script src="/v1/cortex/${lib.name}/libs/${libComps[0]?.filename || lib.name + '.js'}"></script>\``;
|
|
1530
|
+
}).join('\n\n') +
|
|
1531
|
+
'\n\nWhen the blueprint\'s cortex component needs an existing library, add a "uses" field listing the library names.\n';
|
|
1532
|
+
}
|
|
1533
|
+
return {
|
|
1534
|
+
description: data.projectDescription || '',
|
|
1535
|
+
interview_spec_section: interviewSpecSection,
|
|
1536
|
+
language_note: languageNote,
|
|
1537
|
+
cortex_catalog: cortexCatalog,
|
|
1538
|
+
};
|
|
1539
|
+
}
|
|
1540
|
+
function resolveInterview(data) {
|
|
1541
|
+
const locale = data.locale || 'en';
|
|
1542
|
+
const langMap = { fi: 'Finnish (suomi)', en: 'English', sv: 'Swedish (svenska)', de: 'German (Deutsch)', fr: 'French (français)', es: 'Spanish (español)', ja: 'Japanese (日本語)', zh: 'Chinese (中文)' };
|
|
1543
|
+
const langName = langMap[locale] || locale;
|
|
1544
|
+
const languageInstruction = locale !== 'en'
|
|
1545
|
+
? `\n## LANGUAGE\n\nCONDUCT THIS ENTIRE INTERVIEW IN ${langName.toUpperCase()}.\nAll your questions, summaries, options, and explanations must be in ${langName}.\nThe final JSON specification field values (descriptions, titles, notes) should also be in ${langName}.\nJSON keys and technical identifiers (field names, type values) stay in English.\nInclude "locale": "${locale}" in the output JSON root so downstream prompts continue in the same language.\n`
|
|
1546
|
+
: '';
|
|
1547
|
+
return {
|
|
1548
|
+
description: data.projectDescription || '',
|
|
1549
|
+
language_instruction: languageInstruction,
|
|
1550
|
+
locale,
|
|
1551
|
+
};
|
|
1552
|
+
}
|
|
1553
|
+
//# sourceMappingURL=resolvers.js.map
|