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,1082 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file foundry-validate.js
|
|
3
|
+
* @description Validators for foundry component results, blueprints, and interview specs.
|
|
4
|
+
* Each component type (csm, msm, extension, app, memory, translation, cortex) has a
|
|
5
|
+
* validator that checks structure and extracts usable content from AI output.
|
|
6
|
+
* Includes validateInterviewSpec for structured interview JSON and cortex validator
|
|
7
|
+
* for IIFE domain library manifest + lib extraction.
|
|
8
|
+
* @structure
|
|
9
|
+
* - extractCodeBlock(text, lang): pulls content from markdown code fences
|
|
10
|
+
* - validators[type](result): per-type validation returning { valid, errors, extracted }
|
|
11
|
+
* - validateInterviewSpec(result): validates interview spec JSON from AI interviews
|
|
12
|
+
* - validateBlueprint(result): validates + sanitizes blueprint JSON (strips extra fields)
|
|
13
|
+
* - validateComponent(type, result): dispatches to per-type validator
|
|
14
|
+
* @usage import { validateBlueprint, validateComponent, validateInterviewSpec } from '/js/services/foundry-validate.js';
|
|
15
|
+
* @version-history
|
|
16
|
+
* v1.0.0 — 2026-03-10 — Initial validators
|
|
17
|
+
* v1.1.0 — 2026-03-14 — validateBlueprint now strips extra component fields
|
|
18
|
+
* (manifest, code, files, etc.) and returns warnings array
|
|
19
|
+
* v1.2.0 — 2026-03-14 — Add sanitizeJson() to fix AI markdown artifacts
|
|
20
|
+
* (\[ → [, trailing commas, zero-width chars) before JSON.parse
|
|
21
|
+
* v2.0.0 — 2026-03-14 — Use real yaml parser (yaml@2.8.2 via /lib/yaml.mjs)
|
|
22
|
+
* for CSM/MSM/Extension validation instead of regex heuristics
|
|
23
|
+
* v2.1.0 — 2026-03-14 — Fix MSM validator to check real structure
|
|
24
|
+
* (service.name/category, auth.type, actions[] with display_name/endpoint);
|
|
25
|
+
* fix Extension validator to check metadata.name/version/description/author
|
|
26
|
+
* and actions[].id/method/path/script
|
|
27
|
+
* v3.0.0 — 2026-03-14 — Replace regex sanitizeYaml with real yaml parse+stringify.
|
|
28
|
+
* YAML is now parsed by the yaml library, then re-serialized to clean output.
|
|
29
|
+
* No more regex hacks for block scalars, quoting, or multiline values.
|
|
30
|
+
* v3.1.0 — 2026-03-14 — Add validateInterviewSpec() for structured interview JSON,
|
|
31
|
+
* add cortex component validator, add 'cortex' to allowed blueprint types
|
|
32
|
+
* v4.0.0 — 2026-03-15 — Add validateAntiPatterns() for universal crash-prevention
|
|
33
|
+
* checks (JSON.parse on memory, require/import in sandbox, HTML entities,
|
|
34
|
+
* translation locale mismatch); integrate into extension/app/translation validators
|
|
35
|
+
* v4.1.0 — 2026-03-15 — Fix HTML entity false positives: strip string literals
|
|
36
|
+
* and regex patterns before checking for entities in code — prevents flagging
|
|
37
|
+
* legitimate entity-decoding code like .replace(/&/g, "&")
|
|
38
|
+
* v4.2.0 — 2026-03-15 — validateBlueprint now validates dataModel: checks
|
|
39
|
+
* producedBy/consumedBy reference valid component IDs, warns on missing schemas
|
|
40
|
+
* v4.3.0 — 2026-03-15 — Allow "schedules" field on extension components and "uses"
|
|
41
|
+
* field on cortex components in blueprint validation (not stripped as extra fields)
|
|
42
|
+
* v4.4.0 — 2026-03-15 — Cortex validator cross-checks YAML metadata.name against
|
|
43
|
+
* JS LIB_NAME (kebab→camelCase), verifies IIFE pattern and AIMEAT.register usage
|
|
44
|
+
* v4.5.0 — 2026-03-16 — Cortex validator supports single-block format (YAML + JS
|
|
45
|
+
* separated by // lib/ comment) in addition to legacy separate blocks. Accept
|
|
46
|
+
* var/let/const for LIB_NAME declaration.
|
|
47
|
+
* v5.0.0 — 2026-03-26 — Add validateSkeleton with cross-check against interview
|
|
48
|
+
* sampleResponse; add validateUnit with anti-pattern scan; add crossCheckSampleData,
|
|
49
|
+
* extractOutputFieldsNearUrl, deepFieldExists helpers
|
|
50
|
+
*/
|
|
51
|
+
import { parse as parseYaml, stringify as stringifyYaml } from '/lib/yaml.mjs';
|
|
52
|
+
|
|
53
|
+
/* ── Helpers ─────────────────────────────────────────── */
|
|
54
|
+
|
|
55
|
+
function extractCodeBlock(text, lang) {
|
|
56
|
+
const regex = new RegExp('```' + (lang || '') + '\\s*\\n([\\s\\S]*?)```', 'i');
|
|
57
|
+
const match = text.match(regex);
|
|
58
|
+
return match ? match[1].trim() : text.trim();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Sanitize JSON string from common AI/markdown artifacts before parsing.
|
|
63
|
+
*/
|
|
64
|
+
function sanitizeJson(text) {
|
|
65
|
+
let s = text;
|
|
66
|
+
// Strip markdown backslash escaping: \[ \] \{ \} \( \) \* \_ \` \| \~ \#
|
|
67
|
+
s = s.replace(/\\([[\]{}()*_`|~#])/g, '$1');
|
|
68
|
+
s = s.replace(/,\s*([}\]])/g, '$1');
|
|
69
|
+
s = s.replace(/[\u200B\u200C\u200D\uFEFF]/g, '');
|
|
70
|
+
return s;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Minimal text-level cleanup applied BEFORE YAML parsing.
|
|
75
|
+
* Only fixes characters that prevent the parser from running at all.
|
|
76
|
+
* No structural changes — the real yaml parser handles block scalars,
|
|
77
|
+
* multiline strings, etc. correctly on its own.
|
|
78
|
+
*/
|
|
79
|
+
function preCleanYaml(text) {
|
|
80
|
+
if (typeof text !== 'string') return text;
|
|
81
|
+
let s = text;
|
|
82
|
+
// Remove markdown-escaped chars that aren't valid YAML
|
|
83
|
+
s = s.replace(/\\_/g, '_');
|
|
84
|
+
s = s.replace(/\\\[/g, '[').replace(/\\\]/g, ']');
|
|
85
|
+
s = s.replace(/\\\{/g, '{').replace(/\\\}/g, '}');
|
|
86
|
+
// Remove zero-width unicode
|
|
87
|
+
s = s.replace(/[\u200B\u200C\u200D\uFEFF]/g, '');
|
|
88
|
+
// Fix common AI mistake: action list items missing "id:" key
|
|
89
|
+
// e.g. " - refreshQuotes\n description:" → " - id: refreshQuotes\n description:"
|
|
90
|
+
// Only match lines under "actions:" where the list item is a bare word followed by description on next line
|
|
91
|
+
s = s.replace(/^(\s+- )([a-zA-Z][\w-]*)\n(\s+description:)/gm, '$1id: $2\n$3');
|
|
92
|
+
return s;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* ── YAML Parse ──────────────────────────────────────── */
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Parse YAML using the real yaml library with multiple fallback strategies.
|
|
99
|
+
* 1. Try parsing as-is (after minimal pre-clean)
|
|
100
|
+
* 2. If that fails, try with yaml library's more tolerant options
|
|
101
|
+
* 3. Return { parsed, errors, cleaned } where cleaned is the canonical YAML
|
|
102
|
+
* re-serialized by the yaml library (no regex hacks)
|
|
103
|
+
*/
|
|
104
|
+
function tryParseYaml(text) {
|
|
105
|
+
const errors = [];
|
|
106
|
+
if (!text || typeof text !== 'string') {
|
|
107
|
+
errors.push('Result is empty');
|
|
108
|
+
return { errors, parsed: null, cleaned: text };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const preCleaned = preCleanYaml(text);
|
|
112
|
+
|
|
113
|
+
// Attempt 1: strict parse
|
|
114
|
+
try {
|
|
115
|
+
const parsed = parseYaml(preCleaned);
|
|
116
|
+
// Re-serialize through the real yaml library → guaranteed clean output
|
|
117
|
+
const cleaned = stringifyYaml(parsed, { lineWidth: 0 });
|
|
118
|
+
return { errors, parsed, cleaned };
|
|
119
|
+
} catch (_e1) {
|
|
120
|
+
// Attempt 2: try stripping markdown bullets `* ` → `- ` and retry
|
|
121
|
+
let fixed = preCleaned;
|
|
122
|
+
fixed = fixed.replace(/^(\s*)\*\s{2,}/gm, '$1- ');
|
|
123
|
+
fixed = fixed.replace(/^(\s*)\*\s+(?=\S)/gm, '$1- ');
|
|
124
|
+
try {
|
|
125
|
+
const parsed = parseYaml(fixed);
|
|
126
|
+
const cleaned = stringifyYaml(parsed, { lineWidth: 0 });
|
|
127
|
+
return { errors, parsed, cleaned };
|
|
128
|
+
} catch (_e2) {
|
|
129
|
+
// Both attempts failed — report the original error
|
|
130
|
+
errors.push(`YAML parse error: ${_e1.message}`);
|
|
131
|
+
return { errors, parsed: null, cleaned: preCleaned };
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* ── Anti-Pattern Validation ─────────────────────────── */
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Scan generated code for universal anti-patterns that always indicate bugs.
|
|
140
|
+
* Returns { warnings: string[], errors: string[] }
|
|
141
|
+
* - errors: patterns that will definitely crash (block install)
|
|
142
|
+
* - warnings: patterns that are suspicious (show warning, allow install)
|
|
143
|
+
*/
|
|
144
|
+
export function validateAntiPatterns(type, code) {
|
|
145
|
+
const errors = [];
|
|
146
|
+
const warnings = [];
|
|
147
|
+
if (!code || typeof code !== 'string') return { errors, warnings };
|
|
148
|
+
|
|
149
|
+
// === Extension-specific anti-patterns ===
|
|
150
|
+
if (type === 'extension') {
|
|
151
|
+
// JSON.parse on memory.get — always crashes with "undefined is not valid JSON"
|
|
152
|
+
if (/JSON\.parse\s*\(\s*(await\s+)?ctx\.memory\.get/i.test(code)) {
|
|
153
|
+
errors.push('CRASH: JSON.parse(ctx.memory.get(...)) — memory.get() already returns parsed values. Remove JSON.parse().');
|
|
154
|
+
}
|
|
155
|
+
// JSON.parse wrapping a variable that came from memory.get
|
|
156
|
+
if (/=\s*(await\s+)?ctx\.memory\.get\s*\([^)]+\)\s*;[\s\S]{0,100}JSON\.parse\s*\(\s*\w+\s*\)/m.test(code)) {
|
|
157
|
+
warnings.push('Suspicious: variable from ctx.memory.get() passed to JSON.parse() — memory values are already parsed.');
|
|
158
|
+
}
|
|
159
|
+
// require() — not available in V8 sandbox
|
|
160
|
+
if (/\brequire\s*\(/m.test(code)) {
|
|
161
|
+
errors.push('CRASH: require() is not available in the V8 sandbox. All code must be self-contained.');
|
|
162
|
+
}
|
|
163
|
+
// import ... from (but allow export default)
|
|
164
|
+
if (/\bimport\s+.+\s+from\s+/m.test(code)) {
|
|
165
|
+
errors.push('CRASH: import...from is not available in the V8 sandbox. Only "export default" is allowed.');
|
|
166
|
+
}
|
|
167
|
+
// global fetch() without ctx prefix
|
|
168
|
+
if (/(?<!ctx\.)fetch\s*\(/m.test(code) && !/function\s+fetch/m.test(code)) {
|
|
169
|
+
warnings.push('Suspicious: fetch() called without ctx prefix — use ctx.fetch() in the V8 sandbox. Global fetch is not available.');
|
|
170
|
+
}
|
|
171
|
+
// console.log — not available
|
|
172
|
+
if (/\bconsole\.(log|warn|error|info)\s*\(/m.test(code)) {
|
|
173
|
+
warnings.push('console.log is not available in the V8 sandbox. Use ctx.log.info/warn/error() instead.');
|
|
174
|
+
}
|
|
175
|
+
// setTimeout/setInterval — not available
|
|
176
|
+
if (/\b(setTimeout|setInterval|setImmediate)\s*\(/m.test(code)) {
|
|
177
|
+
errors.push('CRASH: setTimeout/setInterval/setImmediate are not available in the V8 sandbox.');
|
|
178
|
+
}
|
|
179
|
+
// Web APIs — not available in bare V8 isolate (not Node.js, not browser)
|
|
180
|
+
if (/\bnew\s+URLSearchParams\b/m.test(code)) {
|
|
181
|
+
errors.push('CRASH: URLSearchParams is not available in the V8 sandbox. Use string concatenation with encodeURIComponent() instead.');
|
|
182
|
+
}
|
|
183
|
+
if (/\bnew\s+URL\s*\(/m.test(code)) {
|
|
184
|
+
errors.push('CRASH: URL constructor is not available in the V8 sandbox. Use string concatenation instead.');
|
|
185
|
+
}
|
|
186
|
+
if (/\bnew\s+(TextEncoder|TextDecoder)\s*\(/m.test(code)) {
|
|
187
|
+
errors.push('CRASH: TextEncoder/TextDecoder are not available in the V8 sandbox.');
|
|
188
|
+
}
|
|
189
|
+
if (/\bnew\s+(Headers|Request|Response|FormData|Blob|AbortController)\s*\(/m.test(code)) {
|
|
190
|
+
errors.push('CRASH: Web API constructors (Headers, Request, Response, FormData, Blob, AbortController) are not available in the V8 sandbox.');
|
|
191
|
+
}
|
|
192
|
+
if (/\b(atob|btoa)\s*\(/m.test(code)) {
|
|
193
|
+
errors.push('CRASH: atob/btoa are not available in the V8 sandbox.');
|
|
194
|
+
}
|
|
195
|
+
if (/\bstructuredClone\s*\(/m.test(code)) {
|
|
196
|
+
errors.push('CRASH: structuredClone is not available in the V8 sandbox. Use JSON.parse(JSON.stringify(obj)) instead.');
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// === HTML entity corruption (any type) ===
|
|
201
|
+
// These appear when AI retries render HTML entities in code
|
|
202
|
+
if (/>|<|&(?!amp;)|"/.test(code)) {
|
|
203
|
+
const codeLines = code.split('\n');
|
|
204
|
+
const entityLines = codeLines.filter(line => {
|
|
205
|
+
// Skip lines that are clearly HTML text content
|
|
206
|
+
if (/^\s*<[^>]+>[^<]*&/.test(line)) return false;
|
|
207
|
+
// Skip lines where entities appear only inside string literals (e.g., .replace(/&/g, "&"))
|
|
208
|
+
// Strip quoted strings and regex literals before checking for entities
|
|
209
|
+
const stripped = line
|
|
210
|
+
.replace(/"(?:[^"\\]|\\.)*"/g, '""') // remove double-quoted strings
|
|
211
|
+
.replace(/'(?:[^'\\]|\\.)*'/g, "''") // remove single-quoted strings
|
|
212
|
+
.replace(/`(?:[^`\\]|\\.)*`/g, '``') // remove template literals
|
|
213
|
+
.replace(/\/(?:[^/\\]|\\.)+\/[gimsuy]*/g, '//'); // remove regex literals
|
|
214
|
+
if (!/>|<|&[a-z]|"/.test(stripped)) return false;
|
|
215
|
+
// Flag lines with entities in code context
|
|
216
|
+
return /[=(){}\[\];]/.test(line);
|
|
217
|
+
});
|
|
218
|
+
if (entityLines.length > 0) {
|
|
219
|
+
errors.push(`HTML entities found in code (${entityLines.length} lines) — use => not =>, && not &&, etc. This crashes the V8 sandbox.`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// === Translation anti-patterns ===
|
|
224
|
+
if (type === 'translation') {
|
|
225
|
+
try {
|
|
226
|
+
const parsed = JSON.parse(code);
|
|
227
|
+
if (parsed.en && !parsed.fi && Object.values(parsed.en).some(v => /[äöåÄÖÅ]/.test(String(v)))) {
|
|
228
|
+
warnings.push('Suspicious: "en" locale contains Finnish characters (ä, ö, å) — check if root key should be "fi".');
|
|
229
|
+
}
|
|
230
|
+
if (parsed.fi && Object.values(parsed.fi).every(v => !/[äöåÄÖÅ]/.test(String(v)))) {
|
|
231
|
+
warnings.push('Suspicious: "fi" locale has no Finnish characters (ä, ö, å) — may contain English text under wrong locale key.');
|
|
232
|
+
}
|
|
233
|
+
} catch { /* not valid JSON, other validators will catch this */ }
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return { errors, warnings };
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/* ── Validators ──────────────────────────────────────── */
|
|
240
|
+
|
|
241
|
+
const validators = {
|
|
242
|
+
csm(result) {
|
|
243
|
+
const errors = [];
|
|
244
|
+
const raw = extractCodeBlock(result, 'yaml');
|
|
245
|
+
const { parsed, errors: parseErrors, cleaned } = tryParseYaml(raw);
|
|
246
|
+
errors.push(...parseErrors);
|
|
247
|
+
|
|
248
|
+
if (parsed && typeof parsed === 'object') {
|
|
249
|
+
if (!parsed.service?.name) errors.push('Missing: service.name');
|
|
250
|
+
if (!parsed.service?.description) errors.push('Missing: service.description');
|
|
251
|
+
if (!parsed.data_schema?.required || Object.keys(parsed.data_schema.required).length === 0) {
|
|
252
|
+
errors.push('data_schema.required must have at least one field');
|
|
253
|
+
}
|
|
254
|
+
if (!parsed.consent_requirements) errors.push('Missing section: consent_requirements');
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return { valid: errors.length === 0, errors, extracted: cleaned };
|
|
258
|
+
},
|
|
259
|
+
|
|
260
|
+
msm(result) {
|
|
261
|
+
const errors = [];
|
|
262
|
+
const raw = extractCodeBlock(result, 'yaml');
|
|
263
|
+
const { parsed, errors: parseErrors, cleaned } = tryParseYaml(raw);
|
|
264
|
+
errors.push(...parseErrors);
|
|
265
|
+
|
|
266
|
+
if (parsed && typeof parsed === 'object') {
|
|
267
|
+
if (!parsed.service?.name) errors.push('Missing: service.name');
|
|
268
|
+
if (!parsed.service?.description) errors.push('Missing: service.description');
|
|
269
|
+
if (!parsed.service?.category) errors.push('Missing: service.category');
|
|
270
|
+
if (!parsed.auth?.type) errors.push('Missing: auth.type');
|
|
271
|
+
if (!Array.isArray(parsed.actions) || parsed.actions.length === 0) {
|
|
272
|
+
errors.push('actions must be a non-empty array');
|
|
273
|
+
} else {
|
|
274
|
+
for (const action of parsed.actions) {
|
|
275
|
+
const pfx = `action "${action?.id || '?'}"`;
|
|
276
|
+
if (!action?.id) errors.push(`${pfx}: missing id`);
|
|
277
|
+
if (!action?.display_name) errors.push(`${pfx}: missing display_name`);
|
|
278
|
+
if (!action?.endpoint?.method) errors.push(`${pfx}: missing endpoint.method`);
|
|
279
|
+
if (!action?.endpoint?.url) errors.push(`${pfx}: missing endpoint.url`);
|
|
280
|
+
if (!action?.output || Object.keys(action.output).length === 0) {
|
|
281
|
+
errors.push(`${pfx}: must have at least one output field`);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
return { valid: errors.length === 0, errors, extracted: cleaned };
|
|
288
|
+
},
|
|
289
|
+
|
|
290
|
+
extension(result, blueprint) {
|
|
291
|
+
const errors = [];
|
|
292
|
+
|
|
293
|
+
// ── Extract YAML manifest — supports three formats ──
|
|
294
|
+
// Format 1 (preferred): Single untagged code block with // actions/*.js separator
|
|
295
|
+
// Format 2: Fenced ```yaml block + JS markers
|
|
296
|
+
// Format 3: Raw text with JS markers
|
|
297
|
+
let raw = null;
|
|
298
|
+
|
|
299
|
+
// Format 1: single untagged code block — extract content, split at // actions/
|
|
300
|
+
const untaggedMatch = result.match(/```\s*\n([\s\S]*?)```/);
|
|
301
|
+
if (untaggedMatch) {
|
|
302
|
+
const content = untaggedMatch[1];
|
|
303
|
+
const actionSep = content.match(/^\/\/\s*actions\/\S+\.js\s*$/m);
|
|
304
|
+
if (actionSep) {
|
|
305
|
+
const sepIndex = content.indexOf(actionSep[0]);
|
|
306
|
+
raw = content.slice(0, sepIndex).trim();
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// Format 2/3: fenced ```yaml block or raw text — cut at JS markers
|
|
311
|
+
if (!raw) {
|
|
312
|
+
raw = extractCodeBlock(result, 'yaml');
|
|
313
|
+
const jsMarkers = [
|
|
314
|
+
/^\/\/\s*actions\//m,
|
|
315
|
+
/^#\s*actions\//m,
|
|
316
|
+
/^export\s+default\s+/m,
|
|
317
|
+
];
|
|
318
|
+
let jsStart = -1;
|
|
319
|
+
for (const rx of jsMarkers) {
|
|
320
|
+
const idx = raw.search(rx);
|
|
321
|
+
if (idx > 0 && (jsStart === -1 || idx < jsStart)) jsStart = idx;
|
|
322
|
+
}
|
|
323
|
+
if (jsStart > 0) raw = raw.slice(0, jsStart).trim();
|
|
324
|
+
}
|
|
325
|
+
const { parsed, errors: parseErrors } = tryParseYaml(raw);
|
|
326
|
+
errors.push(...parseErrors);
|
|
327
|
+
|
|
328
|
+
if (parsed && typeof parsed === 'object') {
|
|
329
|
+
if (!parsed.metadata?.name) errors.push('Missing: metadata.name');
|
|
330
|
+
else if (/\./.test(parsed.metadata.name)) errors.push('metadata.name must not contain dots (.) — dots cause namespace collisions in memory owner keys');
|
|
331
|
+
else if (!/^[a-z][a-z0-9-]*$/.test(parsed.metadata.name)) errors.push('metadata.name must be lowercase kebab-case (e.g., "my-collector")');
|
|
332
|
+
if (!parsed.metadata?.version) errors.push('Missing: metadata.version');
|
|
333
|
+
if (!parsed.metadata?.description) errors.push('Missing: metadata.description');
|
|
334
|
+
if (!parsed.metadata?.author) errors.push('Missing: metadata.author');
|
|
335
|
+
if (!Array.isArray(parsed.actions) || parsed.actions.length === 0) {
|
|
336
|
+
errors.push('actions array is required and must not be empty');
|
|
337
|
+
} else {
|
|
338
|
+
for (const action of parsed.actions) {
|
|
339
|
+
const pfx = `action "${action?.id || '?'}"`;
|
|
340
|
+
if (!action?.id) errors.push(`${pfx}: missing id`);
|
|
341
|
+
if (!action?.method) errors.push(`${pfx}: missing method`);
|
|
342
|
+
if (!action?.path) errors.push(`${pfx}: missing path`);
|
|
343
|
+
if (!action?.script) errors.push(`${pfx}: missing script`);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// Validate action IDs match blueprint testScenarios (if available)
|
|
349
|
+
if (blueprint?.testScenarios && Array.isArray(parsed?.actions)) {
|
|
350
|
+
const bpComp = blueprint.components?.find(c => c.type === 'extension');
|
|
351
|
+
if (bpComp) {
|
|
352
|
+
const testActions = (blueprint.testScenarios || [])
|
|
353
|
+
.filter(ts => ts.component === bpComp.id)
|
|
354
|
+
.flatMap(ts => (ts.scenarios || []).map(s => s.action));
|
|
355
|
+
const actualIds = new Set(parsed.actions.map(a => a.id));
|
|
356
|
+
for (const expected of testActions) {
|
|
357
|
+
if (!actualIds.has(expected)) {
|
|
358
|
+
errors.push(`Blueprint expects action "${expected}" but extension does not have it. Add it or rename the matching action to "${expected}".`);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// Check for action scripts — look for fenced JS blocks OR unfenced // actions/file.js comments
|
|
365
|
+
const fencedJs = result.match(/```javascript[\s\S]*?```/gi) || [];
|
|
366
|
+
const unfencedJs = result.match(/^\/\/\s*actions\/[\w-]+\.js\s*$/gm) || [];
|
|
367
|
+
const jsBlockCount = Math.max(fencedJs.length, unfencedJs.length);
|
|
368
|
+
const actionCount = Array.isArray(parsed?.actions) ? parsed.actions.length : 0;
|
|
369
|
+
if (actionCount > 0 && jsBlockCount === 0) {
|
|
370
|
+
errors.push(`Extension defines ${actionCount} action(s) but no JavaScript code blocks found`);
|
|
371
|
+
} else if (actionCount > 0 && jsBlockCount > 0 && jsBlockCount < actionCount) {
|
|
372
|
+
errors.push(`Extension defines ${actionCount} action(s) but only ${jsBlockCount} JavaScript code blocks found — each action needs its own script`);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// Anti-pattern scan
|
|
376
|
+
const ap = validateAntiPatterns('extension', result);
|
|
377
|
+
errors.push(...ap.errors);
|
|
378
|
+
|
|
379
|
+
return { valid: errors.length === 0, errors, extracted: result };
|
|
380
|
+
},
|
|
381
|
+
|
|
382
|
+
app(result) {
|
|
383
|
+
const errors = [];
|
|
384
|
+
const html = extractCodeBlock(result, 'html') || result;
|
|
385
|
+
|
|
386
|
+
if (!html.includes('<!DOCTYPE html') && !html.includes('<html')) {
|
|
387
|
+
errors.push('Not a valid HTML document — missing <!DOCTYPE html> or <html> tag');
|
|
388
|
+
}
|
|
389
|
+
if (!html.includes('<head')) errors.push('Missing <head> section');
|
|
390
|
+
if (!html.includes('<body')) errors.push('Missing <body> section');
|
|
391
|
+
if (!html.includes('AIMEAT App Manifest') && !html.match(/name:\s*.+/)) {
|
|
392
|
+
errors.push('Missing AIMEAT App Manifest comment');
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
// Anti-pattern scan
|
|
396
|
+
const ap = validateAntiPatterns('app', html);
|
|
397
|
+
errors.push(...ap.errors);
|
|
398
|
+
|
|
399
|
+
return { valid: errors.length === 0, errors, extracted: html };
|
|
400
|
+
},
|
|
401
|
+
|
|
402
|
+
memory(result) {
|
|
403
|
+
const errors = [];
|
|
404
|
+
const json = sanitizeJson(extractCodeBlock(result, 'json'));
|
|
405
|
+
try {
|
|
406
|
+
const parsed = JSON.parse(json);
|
|
407
|
+
if (typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
408
|
+
errors.push('Memory structure must be a JSON object with key-value pairs');
|
|
409
|
+
} else if (Object.keys(parsed).length === 0) {
|
|
410
|
+
errors.push('Memory structure is empty');
|
|
411
|
+
}
|
|
412
|
+
return { valid: errors.length === 0, errors, extracted: json };
|
|
413
|
+
} catch (e) {
|
|
414
|
+
errors.push(`Invalid JSON: ${e.message}`);
|
|
415
|
+
return { valid: false, errors, extracted: json };
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
|
|
419
|
+
translation(result) {
|
|
420
|
+
const errors = [];
|
|
421
|
+
const json = sanitizeJson(extractCodeBlock(result, 'json'));
|
|
422
|
+
try {
|
|
423
|
+
const parsed = JSON.parse(json);
|
|
424
|
+
// Each translation component produces ONE locale (e.g., { "fi": { ... } } or { "en": { ... } })
|
|
425
|
+
const locales = Object.keys(parsed).filter(k => typeof parsed[k] === 'object' && parsed[k] !== null);
|
|
426
|
+
if (locales.length === 0) {
|
|
427
|
+
errors.push('No locale object found — expected e.g. { "fi": { ... } } or { "en": { ... } }');
|
|
428
|
+
} else if (locales.length > 1) {
|
|
429
|
+
errors.push(`Multiple locales found (${locales.join(', ')}) — each translation component should contain only ONE locale`);
|
|
430
|
+
} else {
|
|
431
|
+
// Validate the single locale has content
|
|
432
|
+
const locale = locales[0];
|
|
433
|
+
const keys = Object.keys(parsed[locale]);
|
|
434
|
+
if (keys.length === 0) {
|
|
435
|
+
errors.push(`Locale "${locale}" is empty — no translation keys found`);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
// Anti-pattern scan
|
|
439
|
+
const ap = validateAntiPatterns('translation', json);
|
|
440
|
+
// translation anti-patterns are warnings only, don't block validation
|
|
441
|
+
|
|
442
|
+
return { valid: errors.length === 0, errors, extracted: json };
|
|
443
|
+
} catch (e) {
|
|
444
|
+
errors.push(`Invalid JSON: ${e.message}`);
|
|
445
|
+
return { valid: false, errors, extracted: json };
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
|
|
449
|
+
cortex(result, blueprint) {
|
|
450
|
+
const errors = [];
|
|
451
|
+
|
|
452
|
+
// ── Extract YAML and JS — supports two formats ──
|
|
453
|
+
// Format 1 (preferred): Single untagged code block with YAML first, then // lib/*.js separator
|
|
454
|
+
// Format 2 (legacy): Separate ```yaml and ```javascript blocks
|
|
455
|
+
let yamlBlock = null;
|
|
456
|
+
const jsBlocks = [];
|
|
457
|
+
|
|
458
|
+
// Try Format 1: single block with // lib/ separator
|
|
459
|
+
const untaggedMatch = result.match(/```\s*\n([\s\S]*?)```/);
|
|
460
|
+
if (untaggedMatch) {
|
|
461
|
+
const content = untaggedMatch[1];
|
|
462
|
+
const libSeparator = content.match(/^\/\/\s*lib\/\S+\.js\s*$/m);
|
|
463
|
+
if (libSeparator) {
|
|
464
|
+
const sepIndex = content.indexOf(libSeparator[0]);
|
|
465
|
+
yamlBlock = content.slice(0, sepIndex).trim();
|
|
466
|
+
jsBlocks.push(content.slice(sepIndex).trim());
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// Try Format 2: separate ```yaml and ```javascript blocks
|
|
471
|
+
if (!yamlBlock) {
|
|
472
|
+
yamlBlock = extractCodeBlock(result, 'yaml');
|
|
473
|
+
if (yamlBlock) {
|
|
474
|
+
const jsRegex = /```(?:javascript|js)\s*\n([\s\S]*?)```/gi;
|
|
475
|
+
let match;
|
|
476
|
+
const afterYaml = result.indexOf('```yaml') > -1
|
|
477
|
+
? result.slice(result.indexOf('```', result.indexOf('```yaml') + 7) + 3)
|
|
478
|
+
: result;
|
|
479
|
+
while ((match = jsRegex.exec(afterYaml)) !== null) {
|
|
480
|
+
jsBlocks.push(match[1].trim());
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
if (!yamlBlock) {
|
|
486
|
+
errors.push('No YAML manifest found — cortex must include a manifest (either in a single code block with // lib/ separator, or in a ```yaml block)');
|
|
487
|
+
return { valid: false, errors, extracted: null };
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
const { parsed, errors: yamlErrors } = tryParseYaml(yamlBlock);
|
|
491
|
+
if (yamlErrors.length > 0) return { valid: false, errors: yamlErrors, extracted: null };
|
|
492
|
+
|
|
493
|
+
if (parsed.apiVersion !== 'cortex.aimeat.org/v1') {
|
|
494
|
+
errors.push('apiVersion must be "cortex.aimeat.org/v1"');
|
|
495
|
+
}
|
|
496
|
+
if (parsed.kind !== 'Extension') errors.push('kind must be "Extension"');
|
|
497
|
+
if (!parsed.metadata?.name) errors.push('metadata.name is required');
|
|
498
|
+
else if (/\./.test(parsed.metadata.name)) errors.push('metadata.name must not contain dots (.)');
|
|
499
|
+
else if (!/^[a-z][a-z0-9-]*$/.test(parsed.metadata.name)) errors.push('metadata.name must be lowercase kebab-case (e.g., "my-domain-lib")');
|
|
500
|
+
if (!parsed.spec?.components || !Array.isArray(parsed.spec.components)) {
|
|
501
|
+
errors.push('spec.components array is required');
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
const libComponents = (parsed.spec?.components || []).filter(c => c.type === 'lib');
|
|
505
|
+
if (libComponents.length > 0 && jsBlocks.length === 0) {
|
|
506
|
+
errors.push(`Manifest declares ${libComponents.length} lib component(s) but no JavaScript code blocks found`);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
// ── Cross-check: YAML metadata.name ↔ JS LIB_NAME consistency ──
|
|
510
|
+
if (parsed.metadata?.name && jsBlocks.length > 0) {
|
|
511
|
+
const yamlName = parsed.metadata.name; // kebab-case e.g. "halytyskartta-cortex"
|
|
512
|
+
const expectedCamel = yamlName.replace(/-([a-z0-9])/g, (_, c) => c.toUpperCase()); // → "halytyskarttaCortex"
|
|
513
|
+
const jsCode = jsBlocks.join('\n');
|
|
514
|
+
|
|
515
|
+
// Check LIB_NAME matches expected camelCase
|
|
516
|
+
const libNameMatch = jsCode.match(/(?:const|let|var)\s+LIB_NAME\s*=\s*['"]([^'"]+)['"]/);
|
|
517
|
+
if (libNameMatch) {
|
|
518
|
+
const actualLibName = libNameMatch[1];
|
|
519
|
+
if (actualLibName !== expectedCamel) {
|
|
520
|
+
errors.push(`LIB_NAME mismatch: JS has "${actualLibName}" but YAML name "${yamlName}" expects "${expectedCamel}"`);
|
|
521
|
+
}
|
|
522
|
+
} else {
|
|
523
|
+
errors.push('No LIB_NAME constant found in JS code — cortex must declare const LIB_NAME = \'...\';');
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
// Check AIMEAT.register uses correct name
|
|
527
|
+
const registerMatch = jsCode.match(/AIMEAT\.register\s*\(\s*LIB_NAME/);
|
|
528
|
+
if (!registerMatch) {
|
|
529
|
+
const hardcodedRegister = jsCode.match(/AIMEAT\.register\s*\(\s*['"]([^'"]+)['"]/);
|
|
530
|
+
if (hardcodedRegister && hardcodedRegister[1] !== expectedCamel) {
|
|
531
|
+
errors.push(`AIMEAT.register uses "${hardcodedRegister[1]}" but expected "${expectedCamel}"`);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// Check IIFE pattern exists
|
|
536
|
+
if (!/\(function\s*\(\s*AIMEAT\s*\)/.test(jsCode)) {
|
|
537
|
+
errors.push('Cortex JS must use IIFE pattern: (function (AIMEAT) { ... })(window.AIMEAT || ...)');
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
// Check exports object includes all required methods from blueprint
|
|
541
|
+
// Accept "exports", "exportsObj", etc. — also handle multiline object literals
|
|
542
|
+
const exportsMatch = jsCode.match(/(?:const|let|var)\s+\w*[Ee]xport\w*\s*=\s*\{([\s\S]*?)\}/);
|
|
543
|
+
if (exportsMatch) {
|
|
544
|
+
const exportedMethods = exportsMatch[1].split(',').map(m => m.trim().split(':')[0].trim()).filter(Boolean);
|
|
545
|
+
|
|
546
|
+
// Cross-check with blueprint produces API methods if available
|
|
547
|
+
// Match the specific cortex component by metadata.name or subtype
|
|
548
|
+
if (blueprint?.components && parsed?.metadata?.name) {
|
|
549
|
+
const metaName = parsed.metadata.name;
|
|
550
|
+
// Find the blueprint component that matches this cortex by name similarity
|
|
551
|
+
const cortexComps = blueprint.components.filter(c => c.type === 'cortex');
|
|
552
|
+
const cortexComp = cortexComps.find(c =>
|
|
553
|
+
c.id === metaName || c.label?.toLowerCase().includes(metaName.replace(/-/g, ' ')) ||
|
|
554
|
+
metaName.includes(c.id?.replace('cortex-', ''))
|
|
555
|
+
) || (cortexComps.length === 1 ? cortexComps[0] : null);
|
|
556
|
+
if (cortexComp?.produces) {
|
|
557
|
+
const requiredMethods = cortexComp.produces
|
|
558
|
+
.filter(p => p.startsWith('api:'))
|
|
559
|
+
.map(p => p.replace('api:', ''));
|
|
560
|
+
for (const method of requiredMethods) {
|
|
561
|
+
if (!exportedMethods.includes(method)) {
|
|
562
|
+
errors.push(`Blueprint requires method "${method}" but it's not in the exports object. Found: ${exportedMethods.join(', ')}`);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
} else {
|
|
568
|
+
errors.push('No exports object found — cortex must have: const exports = { method1, method2, ... };');
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
if (errors.length > 0) return { valid: false, errors, extracted: null };
|
|
573
|
+
|
|
574
|
+
return {
|
|
575
|
+
valid: true,
|
|
576
|
+
errors: [],
|
|
577
|
+
extracted: {
|
|
578
|
+
manifest: stringifyYaml(parsed),
|
|
579
|
+
libs: libComponents.map((lib, i) => ({
|
|
580
|
+
filename: lib.filename || `${lib.name}.js`,
|
|
581
|
+
code: jsBlocks[i] || '',
|
|
582
|
+
})),
|
|
583
|
+
},
|
|
584
|
+
};
|
|
585
|
+
},
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
/* ── Interview Spec Validator ────────────────────────── */
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* Validate and extract an interview specification JSON from AI output.
|
|
592
|
+
* Expects a JSON code block with required fields.
|
|
593
|
+
*/
|
|
594
|
+
export function validateInterviewSpec(result) {
|
|
595
|
+
const errors = [];
|
|
596
|
+
const warnings = [];
|
|
597
|
+
|
|
598
|
+
try {
|
|
599
|
+
const raw = extractCodeBlock(result, 'json');
|
|
600
|
+
const cleaned = sanitizeJson(raw);
|
|
601
|
+
const spec = JSON.parse(cleaned);
|
|
602
|
+
|
|
603
|
+
if (!spec.version) errors.push('Missing "version" field');
|
|
604
|
+
if (!spec.projectName) errors.push('Missing "projectName" field');
|
|
605
|
+
if (!spec.description) errors.push('Missing "description" field');
|
|
606
|
+
if (!Array.isArray(spec.useCases) || spec.useCases.length === 0) {
|
|
607
|
+
errors.push('Missing or empty "useCases" array');
|
|
608
|
+
}
|
|
609
|
+
if (!Array.isArray(spec.dataSources)) errors.push('Missing "dataSources" array');
|
|
610
|
+
if (!spec.dataModel) errors.push('Missing "dataModel" object');
|
|
611
|
+
if (!Array.isArray(spec.views) || spec.views.length === 0) {
|
|
612
|
+
errors.push('Missing or empty "views" array');
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
if (Array.isArray(spec.useCases)) {
|
|
616
|
+
spec.useCases.forEach((uc, i) => {
|
|
617
|
+
if (!uc.id) errors.push(`useCases[${i}] missing "id"`);
|
|
618
|
+
if (!uc.title) errors.push(`useCases[${i}] missing "title"`);
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
if (Array.isArray(spec.dataSources)) {
|
|
623
|
+
spec.dataSources.forEach((ds, i) => {
|
|
624
|
+
if (!ds.name) errors.push(`dataSources[${i}] missing "name"`);
|
|
625
|
+
if (!ds.type) errors.push(`dataSources[${i}] missing "type"`);
|
|
626
|
+
if (ds.url && !ds.verified) {
|
|
627
|
+
warnings.push(`dataSources[${i}] "${ds.name}" URL not verified — may need manual validation`);
|
|
628
|
+
}
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
if (Array.isArray(spec.views)) {
|
|
633
|
+
spec.views.forEach((v, i) => {
|
|
634
|
+
if (!v.type) errors.push(`views[${i}] missing "type"`);
|
|
635
|
+
if (!v.title) errors.push(`views[${i}] missing "title"`);
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
// Validate optional externalServices
|
|
640
|
+
if (spec.externalServices !== undefined) {
|
|
641
|
+
if (!Array.isArray(spec.externalServices)) {
|
|
642
|
+
errors.push('externalServices must be an array');
|
|
643
|
+
} else {
|
|
644
|
+
for (const svc of spec.externalServices) {
|
|
645
|
+
if (!svc.name || typeof svc.name !== 'string') errors.push('externalServices[].name required');
|
|
646
|
+
if (!Array.isArray(svc.requiredSettings)) errors.push(`externalServices[${svc.name}].requiredSettings must be array`);
|
|
647
|
+
if (!['shared', 'per-user'].includes(svc.sharingModel)) errors.push(`externalServices[${svc.name}].sharingModel invalid`);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
// Validate optional userSettings
|
|
653
|
+
if (spec.userSettings !== undefined) {
|
|
654
|
+
if (!Array.isArray(spec.userSettings)) {
|
|
655
|
+
errors.push('userSettings must be an array');
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
if (errors.length > 0) return { valid: false, errors, warnings };
|
|
660
|
+
return { valid: true, errors: [], warnings, parsed: spec };
|
|
661
|
+
} catch (e) {
|
|
662
|
+
return { valid: false, errors: [`Failed to parse interview spec: ${e.message}`], warnings: [] };
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/* ── Spec Quality Gate ──────────────────────────────── */
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* Check interview spec quality before proceeding to blueprint.
|
|
670
|
+
* No AI needed — just automated checks on the spec data.
|
|
671
|
+
*/
|
|
672
|
+
export function validateSpecQuality(spec) {
|
|
673
|
+
const warnings = [];
|
|
674
|
+
const errors = [];
|
|
675
|
+
|
|
676
|
+
if (!spec) { errors.push('No specification provided'); return { valid: false, errors, warnings }; }
|
|
677
|
+
|
|
678
|
+
// Use cases
|
|
679
|
+
if (!Array.isArray(spec.useCases) || spec.useCases.length < 2) {
|
|
680
|
+
warnings.push('Less than 2 use cases defined — consider adding more to get a useful application');
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
// Data sources
|
|
684
|
+
if (Array.isArray(spec.dataSources)) {
|
|
685
|
+
for (const ds of spec.dataSources) {
|
|
686
|
+
if (!ds.url && ds.type !== 'user-input') {
|
|
687
|
+
warnings.push(`Data source "${ds.name || ds.id}" has no URL`);
|
|
688
|
+
}
|
|
689
|
+
if (!ds.sampleEntry && ds.type !== 'user-input' && ds.fallback !== 'defer') {
|
|
690
|
+
warnings.push(`Data source "${ds.name || ds.id}" has no sampleEntry — structures will be guessed, not verified`);
|
|
691
|
+
}
|
|
692
|
+
if (ds.verified === false && !ds.fallback) {
|
|
693
|
+
errors.push(`Data source "${ds.name || ds.id}" is unverified and has no fallback strategy`);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
// Views
|
|
699
|
+
if (!Array.isArray(spec.views) || spec.views.length === 0) {
|
|
700
|
+
warnings.push('No views defined — the blueprint will guess the UI layout');
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
// Locale
|
|
704
|
+
if (!spec.locale) {
|
|
705
|
+
warnings.push('No locale set — defaulting to English');
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
// Style
|
|
709
|
+
if (!spec.style) {
|
|
710
|
+
warnings.push('No style preferences — the app will use default layout');
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
return { valid: errors.length === 0, errors, warnings };
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/* ── Blueprint Validator ─────────────────────────────── */
|
|
717
|
+
|
|
718
|
+
export function validateBlueprint(result) {
|
|
719
|
+
const errors = [];
|
|
720
|
+
const warnings = [];
|
|
721
|
+
const raw = extractCodeBlock(result, 'json') || result;
|
|
722
|
+
const json = sanitizeJson(raw);
|
|
723
|
+
try {
|
|
724
|
+
const parsed = JSON.parse(json);
|
|
725
|
+
if (!Array.isArray(parsed.components)) errors.push('Missing "components" array');
|
|
726
|
+
else {
|
|
727
|
+
const allowedComponentKeys = new Set(['id', 'type', 'subtype', 'label', 'produces', 'consumes', 'schedules', 'uses', 'role']);
|
|
728
|
+
parsed.components = parsed.components.map(c => {
|
|
729
|
+
if (!c.id) errors.push(`Component missing "id" field`);
|
|
730
|
+
if (!c.type) errors.push(`Component "${c.id || '?'}" missing "type" field`);
|
|
731
|
+
if (!c.label) errors.push(`Component "${c.id || '?'}" missing "label" field`);
|
|
732
|
+
// Auto-fix common AI shorthand: "ext" → "extension"
|
|
733
|
+
if (c.type === 'ext') {
|
|
734
|
+
c.type = 'extension';
|
|
735
|
+
warnings.push(`Component "${c.id}": auto-corrected type "ext" → "extension"`);
|
|
736
|
+
}
|
|
737
|
+
if (c.type && !['csm', 'msm', 'extension', 'app', 'memory', 'translation', 'cortex'].includes(c.type)) {
|
|
738
|
+
errors.push(`Component "${c.id}" has unknown type "${c.type}"`);
|
|
739
|
+
}
|
|
740
|
+
// Validate produces/consumes are arrays of strings (if present)
|
|
741
|
+
if (c.produces && !Array.isArray(c.produces)) {
|
|
742
|
+
warnings.push(`Component "${c.id || '?'}": "produces" should be an array`);
|
|
743
|
+
}
|
|
744
|
+
if (c.consumes && !Array.isArray(c.consumes)) {
|
|
745
|
+
warnings.push(`Component "${c.id || '?'}": "consumes" should be an array`);
|
|
746
|
+
}
|
|
747
|
+
// Strip extra fields (manifest, code, files, etc.) — blueprint is lightweight
|
|
748
|
+
const extraKeys = Object.keys(c).filter(k => !allowedComponentKeys.has(k));
|
|
749
|
+
if (extraKeys.length > 0) {
|
|
750
|
+
warnings.push(`Component "${c.id || '?'}" had extra fields stripped: ${extraKeys.join(', ')}`);
|
|
751
|
+
}
|
|
752
|
+
const clean = { id: c.id, type: c.type, label: c.label };
|
|
753
|
+
if (typeof c.subtype === 'string' && c.type === 'cortex') clean.subtype = c.subtype;
|
|
754
|
+
if (typeof c.role === 'string') clean.role = c.role;
|
|
755
|
+
if (Array.isArray(c.produces)) clean.produces = c.produces;
|
|
756
|
+
if (Array.isArray(c.consumes)) clean.consumes = c.consumes;
|
|
757
|
+
if (Array.isArray(c.schedules) && c.type === 'extension') {
|
|
758
|
+
// Validate and auto-fix each schedule entry
|
|
759
|
+
for (const s of c.schedules) {
|
|
760
|
+
if (!s.action) errors.push(`Component "${c.id}": schedule missing "action" field`);
|
|
761
|
+
if (!s.cron) errors.push(`Component "${c.id}": schedule missing "cron" field`);
|
|
762
|
+
else if (s.cron !== '@activate') {
|
|
763
|
+
// Auto-fix: strip markdown backslash escaping (\* → *)
|
|
764
|
+
let cron = String(s.cron).trim().replace(/\\\*/g, '*');
|
|
765
|
+
if (cron !== String(s.cron).trim()) {
|
|
766
|
+
warnings.push(`Component "${c.id}": stripped backslash escaping from cron`);
|
|
767
|
+
s.cron = cron;
|
|
768
|
+
}
|
|
769
|
+
// Auto-fix: "/15" → "*/15" (AI commonly drops leading asterisk)
|
|
770
|
+
if (/^\/\d/.test(cron)) {
|
|
771
|
+
const fixed = '*' + cron;
|
|
772
|
+
warnings.push(`Component "${c.id}": auto-corrected cron "${cron}" → "${fixed}"`);
|
|
773
|
+
cron = fixed;
|
|
774
|
+
s.cron = fixed;
|
|
775
|
+
}
|
|
776
|
+
// Auto-fix: pad to 5 fields with * if fields are missing
|
|
777
|
+
const fields = cron.split(/\s+/);
|
|
778
|
+
if (fields.length < 5 && fields.length >= 3) {
|
|
779
|
+
while (fields.length < 5) fields.push('*');
|
|
780
|
+
const fixed = fields.join(' ');
|
|
781
|
+
warnings.push(`Component "${c.id}": auto-padded cron to 5 fields: "${fixed}"`);
|
|
782
|
+
s.cron = fixed;
|
|
783
|
+
} else if (fields.length !== 5) {
|
|
784
|
+
errors.push(`Component "${c.id}": cron "${s.cron}" must have exactly 5 fields (got ${fields.length}). Example: "*/15 * * * *"`);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
clean.schedules = c.schedules;
|
|
789
|
+
}
|
|
790
|
+
if (Array.isArray(c.uses) && c.type === 'cortex') clean.uses = c.uses;
|
|
791
|
+
return clean;
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
// Cross-validate produces/consumes: warn if a consumed key has no producer
|
|
795
|
+
if (parsed.components) {
|
|
796
|
+
const allProduced = new Set(parsed.components.flatMap(c => c.produces || []));
|
|
797
|
+
for (const c of parsed.components) {
|
|
798
|
+
for (const consumed of (c.consumes || [])) {
|
|
799
|
+
if (!allProduced.has(consumed)) {
|
|
800
|
+
warnings.push(`Component "${c.id}" consumes "${consumed}" but no component produces it`);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
if (!Array.isArray(parsed.phases)) errors.push('Missing "phases" array');
|
|
807
|
+
else {
|
|
808
|
+
parsed.phases = parsed.phases.map(p => {
|
|
809
|
+
if (!p.id) errors.push(`Phase missing "id"`);
|
|
810
|
+
if (!p.label) errors.push(`Phase "${p.id || '?'}" missing "label"`);
|
|
811
|
+
if (!Array.isArray(p.componentIds)) errors.push(`Phase "${p.id || '?'}" missing "componentIds" array`);
|
|
812
|
+
return { id: p.id, label: p.label, componentIds: p.componentIds };
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
// Validate dataModel if present — supports both old flat format and new structures/$ref format
|
|
817
|
+
if (parsed.dataModel && typeof parsed.dataModel === 'object') {
|
|
818
|
+
const componentIds = new Set((parsed.components || []).map(c => c.id));
|
|
819
|
+
const dm = parsed.dataModel;
|
|
820
|
+
|
|
821
|
+
// New format: has structures + memoryKeys + actions
|
|
822
|
+
if (dm.structures && typeof dm.structures === 'object') {
|
|
823
|
+
// Validate structures
|
|
824
|
+
for (const [name, struct] of Object.entries(dm.structures)) {
|
|
825
|
+
if (!struct.type) warnings.push(`structure "${name}" missing "type"`);
|
|
826
|
+
}
|
|
827
|
+
// Validate $ref references in memoryKeys
|
|
828
|
+
if (dm.memoryKeys && typeof dm.memoryKeys === 'object') {
|
|
829
|
+
for (const [key, schema] of Object.entries(dm.memoryKeys)) {
|
|
830
|
+
if (schema.$ref && !dm.structures[schema.$ref]) {
|
|
831
|
+
errors.push(`memoryKey "${key}" references unknown structure "${schema.$ref}"`);
|
|
832
|
+
}
|
|
833
|
+
if (schema.items?.$ref && !dm.structures[schema.items.$ref]) {
|
|
834
|
+
errors.push(`memoryKey "${key}" items references unknown structure "${schema.items.$ref}"`);
|
|
835
|
+
}
|
|
836
|
+
if (schema.producedBy && !componentIds.has(schema.producedBy)) {
|
|
837
|
+
errors.push(`memoryKey "${key}" producedBy "${schema.producedBy}" does not match any component`);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
// Validate $ref references in actions
|
|
842
|
+
if (dm.actions && typeof dm.actions === 'object') {
|
|
843
|
+
for (const [name, action] of Object.entries(dm.actions)) {
|
|
844
|
+
if (action.output?.$ref && !dm.structures[action.output.$ref]) {
|
|
845
|
+
errors.push(`action "${name}" output references unknown structure "${action.output.$ref}"`);
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
} else {
|
|
850
|
+
// Old flat format — backward compatible
|
|
851
|
+
for (const [key, schema] of Object.entries(dm)) {
|
|
852
|
+
if (key === 'structures' || key === 'memoryKeys' || key === 'actions') continue;
|
|
853
|
+
if (!schema.type) warnings.push(`dataModel "${key}" missing "type"`);
|
|
854
|
+
if (!schema.source) warnings.push(`dataModel "${key}" missing "source"`);
|
|
855
|
+
if (!schema.producedBy) {
|
|
856
|
+
errors.push(`dataModel "${key}" missing "producedBy"`);
|
|
857
|
+
} else if (!componentIds.has(schema.producedBy)) {
|
|
858
|
+
errors.push(`dataModel "${key}" producedBy "${schema.producedBy}" does not match any component`);
|
|
859
|
+
}
|
|
860
|
+
if (!Array.isArray(schema.consumedBy) || schema.consumedBy.length === 0) {
|
|
861
|
+
warnings.push(`dataModel "${key}" has no consumers`);
|
|
862
|
+
} else {
|
|
863
|
+
for (const cid of schema.consumedBy) {
|
|
864
|
+
if (!componentIds.has(cid)) {
|
|
865
|
+
errors.push(`dataModel "${key}" consumedBy "${cid}" does not match any component`);
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
} // end old flat format else
|
|
871
|
+
} else {
|
|
872
|
+
warnings.push('Missing "dataModel" — downstream components will not have schema guidance');
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
// Validate optional settings
|
|
876
|
+
if (parsed.settings) {
|
|
877
|
+
const s = parsed.settings;
|
|
878
|
+
if (s.service && !Array.isArray(s.service)) errors.push('settings.service must be an array');
|
|
879
|
+
if (s.user && !Array.isArray(s.user)) errors.push('settings.user must be an array');
|
|
880
|
+
if (Array.isArray(s.service)) {
|
|
881
|
+
for (const entry of s.service) {
|
|
882
|
+
if (!entry.key || !entry.type || !entry.label) {
|
|
883
|
+
errors.push('settings.service entry missing key/type/label');
|
|
884
|
+
}
|
|
885
|
+
if (entry.type && !['secret', 'url', 'string', 'number', 'boolean'].includes(entry.type)) {
|
|
886
|
+
warnings.push(`settings.service[${entry.key}] has unknown type: ${entry.type}`);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
// Preserve new top-level blueprint fields
|
|
893
|
+
if (parsed.settings) parsed.settings = parsed.settings;
|
|
894
|
+
if (parsed.testScenarios) parsed.testScenarios = parsed.testScenarios;
|
|
895
|
+
if (parsed.architecture) parsed.architecture = parsed.architecture;
|
|
896
|
+
|
|
897
|
+
return { valid: errors.length === 0, errors, warnings, parsed, extracted: json };
|
|
898
|
+
} catch (e) {
|
|
899
|
+
errors.push(`Invalid JSON: ${e.message}`);
|
|
900
|
+
return { valid: false, errors, warnings, parsed: null, extracted: json };
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
/* ── Skeleton Validation ─────────────────────────────── */
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* Validate a skeleton YAML document.
|
|
908
|
+
* Checks: structure completeness, schema parseability, no implementation code,
|
|
909
|
+
* and critically — cross-checks output field names against interview sampleResponse.
|
|
910
|
+
*
|
|
911
|
+
* @param {string} skeletonYaml - Raw YAML skeleton text
|
|
912
|
+
* @param {object} blueprintComponent - The blueprint's component definition
|
|
913
|
+
* @param {object} interviewSpec - The interview specification (for sampleResponse cross-check)
|
|
914
|
+
* @returns {{ valid: boolean, errors: string[], warnings: string[] }}
|
|
915
|
+
*/
|
|
916
|
+
export function validateSkeleton(skeletonYaml, blueprintComponent, interviewSpec) {
|
|
917
|
+
const errors = [];
|
|
918
|
+
const warnings = [];
|
|
919
|
+
|
|
920
|
+
// 1. Basic check
|
|
921
|
+
if (!skeletonYaml || typeof skeletonYaml !== 'string' || skeletonYaml.trim().length === 0) {
|
|
922
|
+
return { valid: false, errors: ['Skeleton is empty'], warnings: [] };
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
// 2. Check for implementation code (function bodies, loops, conditionals)
|
|
926
|
+
const codePatterns = [
|
|
927
|
+
/\bfunction\s*\(/,
|
|
928
|
+
/=>\s*\{/,
|
|
929
|
+
/\bif\s*\(/,
|
|
930
|
+
/\bfor\s*\(/,
|
|
931
|
+
/\bwhile\s*\(/,
|
|
932
|
+
/\bawait\s+/,
|
|
933
|
+
/\breturn\s+/,
|
|
934
|
+
/\bconst\s+\w+\s*=/,
|
|
935
|
+
/\blet\s+\w+\s*=/,
|
|
936
|
+
/ctx\.\w+/,
|
|
937
|
+
];
|
|
938
|
+
for (const pattern of codePatterns) {
|
|
939
|
+
if (pattern.test(skeletonYaml)) {
|
|
940
|
+
errors.push(`Skeleton contains implementation code (matched: ${pattern.source}). Skeletons must contain only structure, signatures, and schemas — no code.`);
|
|
941
|
+
break; // one error is enough
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
// 3. Check required sections based on component type
|
|
946
|
+
const type = blueprintComponent?.type;
|
|
947
|
+
if (type === 'extension') {
|
|
948
|
+
if (!skeletonYaml.includes('actions:')) errors.push('Extension skeleton missing "actions:" section');
|
|
949
|
+
if (!skeletonYaml.includes('metadata:') && !skeletonYaml.includes('name:')) errors.push('Extension skeleton missing metadata');
|
|
950
|
+
} else if (type === 'cortex') {
|
|
951
|
+
const subtype = blueprintComponent?.subtype || 'data';
|
|
952
|
+
if (subtype === 'data' && !skeletonYaml.includes('methods:')) errors.push('Data cortex skeleton missing "methods:" section');
|
|
953
|
+
if (subtype === 'feature' && !skeletonYaml.includes('sections:')) errors.push('Feature cortex skeleton missing "sections:" section');
|
|
954
|
+
if (subtype === 'app-domain' && !skeletonYaml.includes('exports:')) errors.push('App-domain cortex skeleton missing "exports:" section');
|
|
955
|
+
} else if (type === 'app') {
|
|
956
|
+
if (!skeletonYaml.includes('views:')) errors.push('App skeleton missing "views:" section');
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
// 4. Cross-check output fields against interview sampleResponse
|
|
960
|
+
const sampleMismatches = crossCheckSampleData(skeletonYaml, interviewSpec);
|
|
961
|
+
for (const mismatch of sampleMismatches) {
|
|
962
|
+
warnings.push(mismatch);
|
|
963
|
+
}
|
|
964
|
+
// Promote warnings to errors if there are clear field name mismatches
|
|
965
|
+
const criticalMismatches = sampleMismatches.filter(m => m.includes('field mismatch'));
|
|
966
|
+
if (criticalMismatches.length > 0) {
|
|
967
|
+
errors.push(...criticalMismatches.map(m => `CRITICAL: ${m}`));
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
return { valid: errors.length === 0, errors, warnings };
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* Cross-check skeleton output field names against interview sampleResponse data.
|
|
975
|
+
* This prevents the #1 failure mode: skeleton declares field names the API doesn't use.
|
|
976
|
+
*
|
|
977
|
+
* @param {string} skeletonYaml - The skeleton YAML
|
|
978
|
+
* @param {object} interviewSpec - Interview spec with dataSources[].sampleEntry
|
|
979
|
+
* @returns {string[]} - Array of mismatch descriptions
|
|
980
|
+
*/
|
|
981
|
+
function crossCheckSampleData(skeletonYaml, interviewSpec) {
|
|
982
|
+
const mismatches = [];
|
|
983
|
+
if (!interviewSpec?.dataSources) return mismatches;
|
|
984
|
+
|
|
985
|
+
for (const ds of interviewSpec.dataSources) {
|
|
986
|
+
if (!ds.sampleEntry && !ds.sampleResponse) continue;
|
|
987
|
+
const sample = ds.sampleResponse || ds.sampleEntry;
|
|
988
|
+
if (typeof sample !== 'object') continue;
|
|
989
|
+
|
|
990
|
+
// Extract field names from the sample (top-level keys)
|
|
991
|
+
const sampleFields = Object.keys(sample);
|
|
992
|
+
|
|
993
|
+
// Look for output schemas in the skeleton that reference this data source
|
|
994
|
+
if (ds.url && skeletonYaml.includes(ds.url)) {
|
|
995
|
+
const outputFields = extractOutputFieldsNearUrl(skeletonYaml, ds.url);
|
|
996
|
+
for (const field of outputFields) {
|
|
997
|
+
if (!sampleFields.includes(field) && !deepFieldExists(sample, field)) {
|
|
998
|
+
mismatches.push(`Skeleton output field "${field}" not found in sample data from ${ds.url}. Sample has: [${sampleFields.join(', ')}]. Possible field mismatch.`);
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
return mismatches;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* Extract output field names declared near a data source URL in the skeleton.
|
|
1008
|
+
*/
|
|
1009
|
+
function extractOutputFieldsNearUrl(yaml, url) {
|
|
1010
|
+
const fields = [];
|
|
1011
|
+
const lines = yaml.split('\n');
|
|
1012
|
+
let nearUrl = false;
|
|
1013
|
+
let inOutput = false;
|
|
1014
|
+
|
|
1015
|
+
for (const line of lines) {
|
|
1016
|
+
if (line.includes(url)) nearUrl = true;
|
|
1017
|
+
if (nearUrl && /output:/i.test(line)) inOutput = true;
|
|
1018
|
+
if (inOutput && /^\s+-?\s*\w+:/.test(line)) {
|
|
1019
|
+
const match = line.match(/(\w+):/);
|
|
1020
|
+
if (match && !['type', 'items', 'schema', 'output', 'input'].includes(match[1])) {
|
|
1021
|
+
fields.push(match[1]);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
// Stop at the next action/method
|
|
1025
|
+
if (nearUrl && inOutput && /^ - id:|^ - name:|^\w/.test(line) && !line.includes(url)) {
|
|
1026
|
+
break;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
return fields;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
/**
|
|
1033
|
+
* Check if a field exists anywhere in a nested object (dot-path or direct).
|
|
1034
|
+
*/
|
|
1035
|
+
function deepFieldExists(obj, field) {
|
|
1036
|
+
if (obj === null || typeof obj !== 'object') return false;
|
|
1037
|
+
if (field in obj) return true;
|
|
1038
|
+
for (const val of Object.values(obj)) {
|
|
1039
|
+
if (typeof val === 'object' && val !== null && deepFieldExists(val, field)) return true;
|
|
1040
|
+
}
|
|
1041
|
+
return false;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
/* ── Unit Validation ─────────────────────────────────── */
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* Validate a unit implementation against its skeleton entry.
|
|
1048
|
+
* Checks: syntax, anti-patterns, and that the implementation matches the skeleton's contract.
|
|
1049
|
+
*
|
|
1050
|
+
* @param {string} code - The unit implementation code
|
|
1051
|
+
* @param {object} unitDef - The unit's definition from the skeleton ({ id, input, output, ... })
|
|
1052
|
+
* @param {string} componentType - 'extension' | 'cortex' | 'app'
|
|
1053
|
+
* @returns {{ valid: boolean, errors: string[], warnings: string[] }}
|
|
1054
|
+
*/
|
|
1055
|
+
export function validateUnit(code, unitDef, componentType) {
|
|
1056
|
+
const errors = [];
|
|
1057
|
+
const warnings = [];
|
|
1058
|
+
|
|
1059
|
+
if (!code || code.trim().length === 0) {
|
|
1060
|
+
return { valid: false, errors: ['Unit implementation is empty'], warnings: [] };
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
// Run anti-pattern check
|
|
1064
|
+
const antiPatterns = validateAntiPatterns(componentType, code);
|
|
1065
|
+
if (antiPatterns.errors) errors.push(...antiPatterns.errors);
|
|
1066
|
+
if (antiPatterns.warnings) warnings.push(...antiPatterns.warnings);
|
|
1067
|
+
|
|
1068
|
+
// Check that the implementation references the expected function/action name
|
|
1069
|
+
if (unitDef?.id && !code.includes(unitDef.id)) {
|
|
1070
|
+
warnings.push(`Unit implementation does not reference "${unitDef.id}" — verify it implements the correct unit.`);
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
return { valid: errors.length === 0, errors, warnings };
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
/* ── Main Validate Function ──────────────────────────── */
|
|
1077
|
+
|
|
1078
|
+
export function validateComponent(type, result, blueprint = null) {
|
|
1079
|
+
const validator = validators[type];
|
|
1080
|
+
if (!validator) return { valid: false, errors: [`No validator for type: ${type}`], extracted: result };
|
|
1081
|
+
return validator(result, blueprint);
|
|
1082
|
+
}
|