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,1016 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file use-autopilot.js
|
|
3
|
+
* @description Custom hook for the autopilot generation pipeline — the most complex
|
|
4
|
+
* hook in the system. Iterates through all unregistered components in phase order,
|
|
5
|
+
* generates code via AI, validates, auto-retries on failure, registers, applies
|
|
6
|
+
* settings, activates, and runs per-component tests with fix loops.
|
|
7
|
+
*
|
|
8
|
+
* Part of the hook-per-domain architecture for ProjectDashboard. This hook has NO
|
|
9
|
+
* own state — it uses autopilotState (from useAutopilotState) for UI state and
|
|
10
|
+
* testExec.pushTestResult (from useTestExecution) for test result accumulation.
|
|
11
|
+
*
|
|
12
|
+
* STALE CLOSURE WARNING: handleRunAll runs for minutes. All reads of state that
|
|
13
|
+
* might change during execution use refs (testExec.testScopeRef, testExec.testReportRef)
|
|
14
|
+
* or fresh API calls (loadAllComponents). core.project and core.interviewSpec are
|
|
15
|
+
* read once at call time — they don't change during autopilot.
|
|
16
|
+
*
|
|
17
|
+
* Architecture: useDashboardCore → useAutopilot ← useAutopilotState
|
|
18
|
+
* ← useTestExecution (pushTestResult, refs)
|
|
19
|
+
*
|
|
20
|
+
* @structure
|
|
21
|
+
* - useAutopilot(core, autopilotState, projectId, orSettings, session, testExec, showToast): custom hook
|
|
22
|
+
* State: none (uses autopilotState)
|
|
23
|
+
* Handler: handleRunAll
|
|
24
|
+
* @usage
|
|
25
|
+
* import { useAutopilot } from './foundry-dashboard/use-autopilot.js';
|
|
26
|
+
* const autopilot = useAutopilot(core, autopilotState, projectId, orSettings, session, testExec, showToast);
|
|
27
|
+
* @version-history
|
|
28
|
+
* v1.0.0 — 2026-03-22 — Extracted from foundry-tab.js ProjectDashboard
|
|
29
|
+
* v2.0.0 — 2026-03-26 — Wire multi-pass flow: runComponentPasses for extension/cortex/app
|
|
30
|
+
*/
|
|
31
|
+
import { t } from '/js/i18n.js';
|
|
32
|
+
import { apiPost, apiDelete } from '/js/api.js';
|
|
33
|
+
import {
|
|
34
|
+
loadAllComponents, saveComponent, registerComponent, writeProjectLog, writeDebugArtifact,
|
|
35
|
+
MULTI_PASS_TYPES, createInitialPasses, createUnitPasses, getNextPass,
|
|
36
|
+
saveSkeleton, saveUnit, saveTestCode, loadSkeleton, loadUnits, loadTestCode,
|
|
37
|
+
appendReflection, loadReflectionHistory, isDuplicatePrescription, MAX_REFLECTIONS,
|
|
38
|
+
} from '/js/services/foundry.js';
|
|
39
|
+
import { buildComponentPrompt, buildFixPrompt, buildReflectionPrompt, buildFreshGenerationPrompt, buildTestPrompt } from '/js/services/foundry-prompts.js';
|
|
40
|
+
import {
|
|
41
|
+
buildSkeletonPrompt, buildExtensionUnitPrompt, buildCortexMethodUnitPrompt,
|
|
42
|
+
buildFeatureCortexSectionPrompt, buildAppViewUnitPrompt,
|
|
43
|
+
buildExtensionAssemblyPrompt, buildCortexAssemblyPrompt, buildAppAssemblyPrompt,
|
|
44
|
+
} from '/js/services/foundry-prompts-build.js';
|
|
45
|
+
import { buildTestFirstPrompt } from '/js/services/foundry-prompts-test.js';
|
|
46
|
+
import { buildFoundryReflectionPrompt } from '/js/services/foundry-prompts-fix.js';
|
|
47
|
+
import { validateComponent, validateSkeleton, validateUnit } from '/js/services/foundry-validate.js';
|
|
48
|
+
import { runComponentTest, probeExtension } from '/js/services/foundry-testing.js';
|
|
49
|
+
import { createBundle } from '/js/services/foundry-context-bundle.js';
|
|
50
|
+
import { runWithAi, stripCodeblock } from '../foundry-detail.js';
|
|
51
|
+
|
|
52
|
+
/* ── Multi-Pass Helpers (replicated from foundry-detail.js) ── */
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Extract one unit's definition block from skeleton YAML by finding its id.
|
|
56
|
+
*/
|
|
57
|
+
function parseUnitFromSkeleton(skeletonYaml, unitId) {
|
|
58
|
+
if (!skeletonYaml || !unitId) return { id: unitId, label: unitId };
|
|
59
|
+
const lines = skeletonYaml.split('\n');
|
|
60
|
+
let found = false;
|
|
61
|
+
const block = [];
|
|
62
|
+
for (const line of lines) {
|
|
63
|
+
const trimmed = line.trim();
|
|
64
|
+
if ((trimmed.startsWith('- id: ') && trimmed.slice(6).trim() === unitId) ||
|
|
65
|
+
(trimmed.startsWith('- name: ') && trimmed.slice(8).trim() === unitId)) {
|
|
66
|
+
found = true;
|
|
67
|
+
block.push(line);
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (found) {
|
|
71
|
+
if (trimmed.startsWith('- ') || (/^\w/.test(trimmed) && trimmed.endsWith(':'))) {
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
block.push(line);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return { id: unitId, label: unitId, raw: block.join('\n') };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Extract the test section for a specific unit from the full test code.
|
|
82
|
+
*/
|
|
83
|
+
function extractTestForUnit(testCode, unitId) {
|
|
84
|
+
if (!testCode || !unitId) return '';
|
|
85
|
+
const regex = new RegExp(`(describe|test|it)\\s*\\(['"](.*?${unitId.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}.*?)['"]`, 'i');
|
|
86
|
+
const match = testCode.match(regex);
|
|
87
|
+
if (!match) return '';
|
|
88
|
+
const idx = testCode.indexOf(match[0]);
|
|
89
|
+
const start = Math.max(0, testCode.lastIndexOf('\n', idx - 200));
|
|
90
|
+
const end = Math.min(testCode.length, testCode.indexOf('\n', idx + 500));
|
|
91
|
+
return testCode.slice(start, end > start ? end : testCode.length).trim();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Parse a reflection response to extract diagnosis and prescription.
|
|
96
|
+
*/
|
|
97
|
+
function parseReflectionPrescription(responseText) {
|
|
98
|
+
if (!responseText) return null;
|
|
99
|
+
try {
|
|
100
|
+
const yamlMatch = responseText.match(/```(?:yaml)?\s*\n([\s\S]*?)```/);
|
|
101
|
+
const block = yamlMatch ? yamlMatch[1] : responseText;
|
|
102
|
+
const diagMatch = block.match(/diagnosis:\s*(.+)/);
|
|
103
|
+
const rootMatch = block.match(/root_cause:\s*(.+)/);
|
|
104
|
+
const actionMatch = block.match(/action:\s*(.+)/);
|
|
105
|
+
const targetMatch = block.match(/target:\s*(.+)/);
|
|
106
|
+
if (diagMatch || actionMatch) {
|
|
107
|
+
return {
|
|
108
|
+
diagnosis: diagMatch ? diagMatch[1].trim() : '',
|
|
109
|
+
rootCause: rootMatch ? rootMatch[1].trim() : '',
|
|
110
|
+
action: actionMatch ? actionMatch[1].trim() : 'unknown',
|
|
111
|
+
target: targetMatch ? targetMatch[1].trim() : '',
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
} catch { /* parse failed */ }
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Generate the prompt for a given pass based on type and context.
|
|
120
|
+
* Dispatch logic mirrors foundry-detail.js generatePassPrompt().
|
|
121
|
+
*/
|
|
122
|
+
function generatePassPrompt(pass, ctx) {
|
|
123
|
+
const { component, blueprint, interviewSpec, skeleton, units, testCode, reflectionHistory } = ctx;
|
|
124
|
+
const bpComp = blueprint?.components?.find(c => c.label === component.label || c.id === component.id);
|
|
125
|
+
|
|
126
|
+
switch (pass.type) {
|
|
127
|
+
case 'test':
|
|
128
|
+
return buildTestFirstPrompt({
|
|
129
|
+
componentType: component.type,
|
|
130
|
+
subtype: bpComp?.subtype,
|
|
131
|
+
label: component.label,
|
|
132
|
+
blueprint,
|
|
133
|
+
blueprintComponent: bpComp,
|
|
134
|
+
interviewSpec,
|
|
135
|
+
});
|
|
136
|
+
case 'skeleton':
|
|
137
|
+
return buildSkeletonPrompt({
|
|
138
|
+
componentType: component.type,
|
|
139
|
+
subtype: bpComp?.subtype,
|
|
140
|
+
label: component.label,
|
|
141
|
+
blueprint,
|
|
142
|
+
blueprintComponent: bpComp,
|
|
143
|
+
interviewSpec,
|
|
144
|
+
testCode,
|
|
145
|
+
});
|
|
146
|
+
case 'unit': {
|
|
147
|
+
const unitDef = parseUnitFromSkeleton(skeleton || '', pass.unitId);
|
|
148
|
+
const testExcerpt = extractTestForUnit(testCode || '', pass.unitId);
|
|
149
|
+
if (component.type === 'extension') {
|
|
150
|
+
return buildExtensionUnitPrompt({ skeleton, unitDef, dataSources: bpComp?.dataSources, testExcerpt });
|
|
151
|
+
} else if (component.type === 'cortex') {
|
|
152
|
+
const subtype = bpComp?.subtype || 'data';
|
|
153
|
+
if (subtype === 'feature') {
|
|
154
|
+
return buildFeatureCortexSectionPrompt({ skeleton, sectionDef: unitDef, dataCortexProbe: null, platformUiExample: null, translationKeys: null });
|
|
155
|
+
}
|
|
156
|
+
return buildCortexMethodUnitPrompt({ skeleton, unitDef, extensionProbeResult: null, componentSubtype: subtype });
|
|
157
|
+
} else if (component.type === 'app') {
|
|
158
|
+
return buildAppViewUnitPrompt({ skeleton, viewDef: unitDef, featureCortexRenderSpec: null, translationKeys: null });
|
|
159
|
+
}
|
|
160
|
+
return '';
|
|
161
|
+
}
|
|
162
|
+
case 'assembly': {
|
|
163
|
+
// Convert unitMap {id: code} to array [{id, code}] for assembly prompt builders
|
|
164
|
+
const unitsArr = units && typeof units === 'object' && !Array.isArray(units)
|
|
165
|
+
? Object.entries(units).map(([id, code]) => ({ id, code }))
|
|
166
|
+
: (Array.isArray(units) ? units : []);
|
|
167
|
+
if (component.type === 'extension') {
|
|
168
|
+
return buildExtensionAssemblyPrompt({ skeleton, units: unitsArr, label: component.label });
|
|
169
|
+
} else if (component.type === 'cortex') {
|
|
170
|
+
return buildCortexAssemblyPrompt({ skeleton, units: unitsArr, label: component.label, subtype: bpComp?.subtype });
|
|
171
|
+
} else if (component.type === 'app') {
|
|
172
|
+
return buildAppAssemblyPrompt({ skeleton, units: unitsArr, label: component.label, appDomainCortexName: null, designSystem: null });
|
|
173
|
+
}
|
|
174
|
+
return '';
|
|
175
|
+
}
|
|
176
|
+
case 'reflection':
|
|
177
|
+
return buildFoundryReflectionPrompt({
|
|
178
|
+
skeleton, testCode,
|
|
179
|
+
failedOutput: pass.failedOutput || '',
|
|
180
|
+
errors: pass.errors || [],
|
|
181
|
+
failedPass: pass.failedPass || {},
|
|
182
|
+
reflectionHistory: reflectionHistory || [],
|
|
183
|
+
upstreamProbes: null,
|
|
184
|
+
});
|
|
185
|
+
default:
|
|
186
|
+
return '';
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @param {Object} core — useDashboardCore return value
|
|
192
|
+
* @param {Object} autopilotState — useAutopilotState return value
|
|
193
|
+
* @param {string} projectId
|
|
194
|
+
* @param {Object} orSettings — { hasApiKey, autoRetry, maxRetries }
|
|
195
|
+
* @param {Object} session
|
|
196
|
+
* @param {Object} testExec — useTestExecution return value (testScopeRef, testReportRef, pushTestResult)
|
|
197
|
+
* @param {Function} showToast
|
|
198
|
+
*/
|
|
199
|
+
export function useAutopilot(core, autopilotState, projectId, orSettings, session, testExec, showToast) {
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Run all passes for a multi-pass component (extension, cortex, app).
|
|
203
|
+
* Iterates: test → skeleton → unit(s) → assembly, with reflection on failure.
|
|
204
|
+
*
|
|
205
|
+
* @param {Object} comp - The component object
|
|
206
|
+
* @param {string} cid - Component ID
|
|
207
|
+
* @param {Object} project - Project object (with blueprint)
|
|
208
|
+
* @param {Object} interviewSpec - Interview spec
|
|
209
|
+
* @returns {{ success: boolean, content: string|null, updated: Object }} - Final result
|
|
210
|
+
*/
|
|
211
|
+
async function runComponentPasses(comp, cid, project, interviewSpec) {
|
|
212
|
+
const blueprint = project.blueprint;
|
|
213
|
+
const bpComp = blueprint?.components?.find(c => c.label === comp.label || c.id === comp.id);
|
|
214
|
+
|
|
215
|
+
// Initialize passes
|
|
216
|
+
let passes = createInitialPasses(comp.type);
|
|
217
|
+
let skeleton = await loadSkeleton(projectId, cid) || '';
|
|
218
|
+
let testCode = await loadTestCode(projectId, cid) || '';
|
|
219
|
+
let units = await loadUnits(projectId, cid) || {};
|
|
220
|
+
let reflectionHistory = await loadReflectionHistory(projectId, cid) || [];
|
|
221
|
+
let updated = { ...comp };
|
|
222
|
+
|
|
223
|
+
// If skeleton already exists, we may have unit passes created already
|
|
224
|
+
if (skeleton && passes.length >= 2) {
|
|
225
|
+
// Mark test and skeleton as done if they exist
|
|
226
|
+
const testPass = passes.find(p => p.type === 'test');
|
|
227
|
+
if (testPass && testCode) testPass.status = 'validated';
|
|
228
|
+
const skelPass = passes.find(p => p.type === 'skeleton');
|
|
229
|
+
if (skelPass && skeleton) {
|
|
230
|
+
skelPass.status = 'validated';
|
|
231
|
+
const unitPasses = createUnitPasses(skeleton);
|
|
232
|
+
// Mark already-completed units
|
|
233
|
+
for (const up of unitPasses) {
|
|
234
|
+
if (units[up.unitId]) up.status = 'validated';
|
|
235
|
+
}
|
|
236
|
+
passes = [...passes, ...unitPasses];
|
|
237
|
+
// Add assembly if all units done
|
|
238
|
+
const allUnitsDone = unitPasses.every(up => up.status === 'validated');
|
|
239
|
+
if (allUnitsDone && unitPasses.length > 0) {
|
|
240
|
+
passes.push({ id: 'assembly', type: 'assembly', status: 'pending', attempt: 1 });
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
await writeProjectLog(projectId, 'multipass_start', {
|
|
246
|
+
meta: { component: comp.label, type: comp.type, passCount: passes.length, by: 'autopilot' },
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
// Track the last AI response — used as final assembly content
|
|
250
|
+
let lastContent = null;
|
|
251
|
+
|
|
252
|
+
// Iterate through passes
|
|
253
|
+
while (true) {
|
|
254
|
+
if (autopilotState.cancelledRef.current) return { success: false, content: null, updated };
|
|
255
|
+
|
|
256
|
+
const nextPass = getNextPass(passes);
|
|
257
|
+
if (!nextPass) break; // All passes done
|
|
258
|
+
|
|
259
|
+
autopilotState.setStep(`${comp.label} — pass: ${nextPass.type}${nextPass.unitId ? ` (${nextPass.unitId})` : ''}`);
|
|
260
|
+
|
|
261
|
+
// Build context for prompt generation
|
|
262
|
+
const ctx = { component: comp, blueprint, interviewSpec, skeleton, units, testCode, reflectionHistory };
|
|
263
|
+
const prompt = generatePassPrompt(nextPass, ctx);
|
|
264
|
+
|
|
265
|
+
if (!prompt) {
|
|
266
|
+
await writeProjectLog(projectId, 'multipass_empty_prompt', {
|
|
267
|
+
meta: { component: comp.label, pass: nextPass.id, type: nextPass.type, by: 'autopilot' },
|
|
268
|
+
});
|
|
269
|
+
nextPass.status = 'validated'; // skip empty-prompt passes
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
writeDebugArtifact(projectId, cid, `pass-${nextPass.id}-prompt`, prompt);
|
|
274
|
+
|
|
275
|
+
// Determine model role: reasoning for planning passes, execution for code passes
|
|
276
|
+
const reasoningPasses = ['test', 'skeleton', 'reflection'];
|
|
277
|
+
const passModelRole = reasoningPasses.includes(nextPass.type) ? 'reasoning' : 'execution';
|
|
278
|
+
|
|
279
|
+
await writeProjectLog(projectId, 'multipass_ai_call', {
|
|
280
|
+
meta: { component: comp.label, pass: nextPass.id, type: nextPass.type, modelRole: passModelRole, promptLength: prompt.length, by: 'autopilot' },
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
// Call AI
|
|
284
|
+
let content;
|
|
285
|
+
try {
|
|
286
|
+
content = await runWithAi(projectId, prompt, null, passModelRole);
|
|
287
|
+
} catch (e) {
|
|
288
|
+
showToast?.(`${comp.label} (${nextPass.id}): ${e.message}`, true);
|
|
289
|
+
await writeProjectLog(projectId, 'multipass_ai_failed', {
|
|
290
|
+
meta: { component: comp.label, pass: nextPass.id, type: nextPass.type, modelRole: passModelRole, error: e.message, by: 'autopilot' },
|
|
291
|
+
});
|
|
292
|
+
return { success: false, content: null, updated };
|
|
293
|
+
}
|
|
294
|
+
if (autopilotState.cancelledRef.current) return { success: false, content: null, updated };
|
|
295
|
+
|
|
296
|
+
writeDebugArtifact(projectId, cid, `pass-${nextPass.id}-raw`, content);
|
|
297
|
+
await writeProjectLog(projectId, 'multipass_ai_response', {
|
|
298
|
+
meta: { component: comp.label, pass: nextPass.id, type: nextPass.type, modelRole: passModelRole, responseLength: content.length, by: 'autopilot' },
|
|
299
|
+
});
|
|
300
|
+
content = stripCodeblock(content);
|
|
301
|
+
writeDebugArtifact(projectId, cid, `pass-${nextPass.id}-stripped`, content);
|
|
302
|
+
|
|
303
|
+
// Validate based on pass type
|
|
304
|
+
let validationResult;
|
|
305
|
+
switch (nextPass.type) {
|
|
306
|
+
case 'test':
|
|
307
|
+
// Basic check: non-empty and contains assert/expect/test
|
|
308
|
+
validationResult = {
|
|
309
|
+
valid: content.length > 50 && (/assert|expect|test|describe|it\s*\(/.test(content)),
|
|
310
|
+
errors: content.length <= 50 ? ['Test code too short'] : (!(/assert|expect|test|describe|it\s*\(/.test(content)) ? ['No assertions found in test code'] : []),
|
|
311
|
+
};
|
|
312
|
+
break;
|
|
313
|
+
case 'skeleton':
|
|
314
|
+
validationResult = validateSkeleton(content, bpComp, interviewSpec);
|
|
315
|
+
break;
|
|
316
|
+
case 'unit':
|
|
317
|
+
validationResult = validateUnit(content, parseUnitFromSkeleton(skeleton, nextPass.unitId), comp.type);
|
|
318
|
+
break;
|
|
319
|
+
case 'assembly':
|
|
320
|
+
validationResult = validateComponent(comp.type, content, blueprint);
|
|
321
|
+
break;
|
|
322
|
+
default:
|
|
323
|
+
validationResult = { valid: true, errors: [] };
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// Handle validation failure — trigger reflection loop
|
|
327
|
+
if (!validationResult.valid) {
|
|
328
|
+
await writeProjectLog(projectId, 'multipass_validation_failed', {
|
|
329
|
+
meta: { component: comp.label, pass: nextPass.id, type: nextPass.type, errors: validationResult.errors, by: 'autopilot' },
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
let resolved = false;
|
|
333
|
+
for (let reflectAttempt = 0; reflectAttempt < MAX_REFLECTIONS && !resolved; reflectAttempt++) {
|
|
334
|
+
if (autopilotState.cancelledRef.current) return { success: false, content: null, updated };
|
|
335
|
+
|
|
336
|
+
autopilotState.setStep(`${comp.label} — reflection ${reflectAttempt + 1}/${MAX_REFLECTIONS} for ${nextPass.id}`);
|
|
337
|
+
|
|
338
|
+
// Build reflection prompt
|
|
339
|
+
const reflectionPass = {
|
|
340
|
+
type: 'reflection',
|
|
341
|
+
failedOutput: content,
|
|
342
|
+
errors: validationResult.errors,
|
|
343
|
+
failedPass: nextPass,
|
|
344
|
+
};
|
|
345
|
+
const reflCtx = { component: comp, blueprint, interviewSpec, skeleton, units, testCode, reflectionHistory };
|
|
346
|
+
const reflPrompt = generatePassPrompt(reflectionPass, reflCtx);
|
|
347
|
+
writeDebugArtifact(projectId, cid, `pass-${nextPass.id}-reflection-${reflectAttempt + 1}-prompt`, reflPrompt);
|
|
348
|
+
|
|
349
|
+
let reflResponse;
|
|
350
|
+
try {
|
|
351
|
+
reflResponse = await runWithAi(projectId, reflPrompt, null, 'reasoning');
|
|
352
|
+
} catch (e) {
|
|
353
|
+
await writeProjectLog(projectId, 'multipass_reflection_ai_failed', {
|
|
354
|
+
meta: { component: comp.label, pass: nextPass.id, attempt: reflectAttempt + 1, error: e.message, by: 'autopilot' },
|
|
355
|
+
});
|
|
356
|
+
break;
|
|
357
|
+
}
|
|
358
|
+
writeDebugArtifact(projectId, cid, `pass-${nextPass.id}-reflection-${reflectAttempt + 1}-response`, reflResponse);
|
|
359
|
+
reflResponse = stripCodeblock(reflResponse);
|
|
360
|
+
|
|
361
|
+
// Parse prescription
|
|
362
|
+
const prescription = parseReflectionPrescription(reflResponse);
|
|
363
|
+
|
|
364
|
+
// Save reflection
|
|
365
|
+
await appendReflection(projectId, cid, {
|
|
366
|
+
attempt: reflectAttempt + 1,
|
|
367
|
+
at: new Date().toISOString(),
|
|
368
|
+
prescription,
|
|
369
|
+
passId: nextPass.id,
|
|
370
|
+
});
|
|
371
|
+
reflectionHistory = await loadReflectionHistory(projectId, cid);
|
|
372
|
+
|
|
373
|
+
// Check for escalation or loop
|
|
374
|
+
if (prescription?.action === 'escalate_to_user') {
|
|
375
|
+
await writeProjectLog(projectId, 'multipass_escalated', {
|
|
376
|
+
meta: { component: comp.label, pass: nextPass.id, diagnosis: prescription.diagnosis, by: 'autopilot' },
|
|
377
|
+
});
|
|
378
|
+
showToast?.(`${comp.label}: Reflection escalated — needs manual attention`, true);
|
|
379
|
+
return { success: false, content: null, updated };
|
|
380
|
+
}
|
|
381
|
+
if (isDuplicatePrescription(reflectionHistory.slice(0, -1), prescription)) {
|
|
382
|
+
await writeProjectLog(projectId, 'multipass_reflection_loop', {
|
|
383
|
+
meta: { component: comp.label, pass: nextPass.id, attempt: reflectAttempt + 1, by: 'autopilot' },
|
|
384
|
+
});
|
|
385
|
+
showToast?.(`${comp.label}: Reflection loop detected for ${nextPass.id}`, true);
|
|
386
|
+
return { success: false, content: null, updated };
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// Retry the pass with context from reflection
|
|
390
|
+
const retryPrompt = prompt + `\n\n--- PREVIOUS ATTEMPT FAILED ---\nErrors: ${validationResult.errors.join('; ')}\nDiagnosis: ${prescription?.diagnosis || reflResponse}\nFix: Regenerate addressing the above issues.\n`;
|
|
391
|
+
writeDebugArtifact(projectId, cid, `pass-${nextPass.id}-retry-${reflectAttempt + 1}-prompt`, retryPrompt);
|
|
392
|
+
|
|
393
|
+
try {
|
|
394
|
+
content = await runWithAi(projectId, retryPrompt, null, passModelRole);
|
|
395
|
+
} catch (e) {
|
|
396
|
+
showToast?.(`${comp.label} (${nextPass.id} retry): ${e.message}`, true);
|
|
397
|
+
return { success: false, content: null, updated };
|
|
398
|
+
}
|
|
399
|
+
content = stripCodeblock(content);
|
|
400
|
+
writeDebugArtifact(projectId, cid, `pass-${nextPass.id}-retry-${reflectAttempt + 1}-stripped`, content);
|
|
401
|
+
|
|
402
|
+
// Re-validate
|
|
403
|
+
switch (nextPass.type) {
|
|
404
|
+
case 'test':
|
|
405
|
+
validationResult = {
|
|
406
|
+
valid: content.length > 50 && (/assert|expect|test|describe|it\s*\(/.test(content)),
|
|
407
|
+
errors: content.length <= 50 ? ['Test code too short'] : (!(/assert|expect|test|describe|it\s*\(/.test(content)) ? ['No assertions found'] : []),
|
|
408
|
+
};
|
|
409
|
+
break;
|
|
410
|
+
case 'skeleton':
|
|
411
|
+
validationResult = validateSkeleton(content, bpComp, interviewSpec);
|
|
412
|
+
break;
|
|
413
|
+
case 'unit':
|
|
414
|
+
validationResult = validateUnit(content, parseUnitFromSkeleton(skeleton, nextPass.unitId), comp.type);
|
|
415
|
+
break;
|
|
416
|
+
case 'assembly':
|
|
417
|
+
validationResult = validateComponent(comp.type, content, blueprint);
|
|
418
|
+
break;
|
|
419
|
+
default:
|
|
420
|
+
validationResult = { valid: true, errors: [] };
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
if (validationResult.valid) resolved = true;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
if (!resolved) {
|
|
427
|
+
showToast?.(`${comp.label}: Failed after ${MAX_REFLECTIONS} reflections on ${nextPass.id}`, true);
|
|
428
|
+
await writeProjectLog(projectId, 'multipass_gave_up', {
|
|
429
|
+
meta: { component: comp.label, pass: nextPass.id, maxReflections: MAX_REFLECTIONS, by: 'autopilot' },
|
|
430
|
+
});
|
|
431
|
+
return { success: false, content: null, updated };
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// Validation passed — save based on pass type
|
|
436
|
+
switch (nextPass.type) {
|
|
437
|
+
case 'test':
|
|
438
|
+
await saveTestCode(projectId, cid, content);
|
|
439
|
+
testCode = content;
|
|
440
|
+
break;
|
|
441
|
+
case 'skeleton':
|
|
442
|
+
await saveSkeleton(projectId, cid, content);
|
|
443
|
+
skeleton = content;
|
|
444
|
+
// Create unit passes from skeleton
|
|
445
|
+
{
|
|
446
|
+
const unitPasses = createUnitPasses(skeleton);
|
|
447
|
+
if (unitPasses.length > 0) {
|
|
448
|
+
passes.push(...unitPasses);
|
|
449
|
+
// Add assembly pass after all unit passes
|
|
450
|
+
passes.push({ id: 'assembly', type: 'assembly', status: 'pending', attempt: 1 });
|
|
451
|
+
} else {
|
|
452
|
+
// No units extracted — add assembly directly
|
|
453
|
+
passes.push({ id: 'assembly', type: 'assembly', status: 'pending', attempt: 1 });
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
break;
|
|
457
|
+
case 'unit':
|
|
458
|
+
await saveUnit(projectId, cid, nextPass.unitId, content);
|
|
459
|
+
units[nextPass.unitId] = content;
|
|
460
|
+
break;
|
|
461
|
+
case 'assembly':
|
|
462
|
+
// Assembly produces the final component code — will be returned
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
nextPass.status = 'validated';
|
|
467
|
+
updated = {
|
|
468
|
+
...updated,
|
|
469
|
+
history: [...(updated.history || []), {
|
|
470
|
+
action: `pass_${nextPass.type}_validated`,
|
|
471
|
+
at: new Date().toISOString(),
|
|
472
|
+
by: 'autopilot',
|
|
473
|
+
passId: nextPass.id,
|
|
474
|
+
}],
|
|
475
|
+
};
|
|
476
|
+
await saveComponent(projectId, updated);
|
|
477
|
+
|
|
478
|
+
// Track last content for return value (assembly output is the final result)
|
|
479
|
+
lastContent = content;
|
|
480
|
+
|
|
481
|
+
await writeProjectLog(projectId, 'multipass_pass_done', {
|
|
482
|
+
meta: { component: comp.label, pass: nextPass.id, type: nextPass.type, by: 'autopilot' },
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// All passes done — the last content is from assembly
|
|
487
|
+
await writeProjectLog(projectId, 'multipass_complete', {
|
|
488
|
+
meta: { component: comp.label, type: comp.type, totalPasses: passes.length, by: 'autopilot' },
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
// Load final assembly content: it's the last 'content' from the assembly pass
|
|
492
|
+
// (content variable still holds the last AI response, which is the assembly output)
|
|
493
|
+
// Verify we have a non-empty result
|
|
494
|
+
const assemblyPass = passes.find(p => p.type === 'assembly');
|
|
495
|
+
if (!assemblyPass) {
|
|
496
|
+
// No assembly was needed (shouldn't happen for multi-pass)
|
|
497
|
+
return { success: false, content: null, updated };
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
return { success: true, content: lastContent, updated };
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
async function handleRunAll() {
|
|
504
|
+
if (!orSettings?.hasApiKey || autopilotState.running) return;
|
|
505
|
+
autopilotState.start();
|
|
506
|
+
|
|
507
|
+
// Read project/interviewSpec once — they don't change during autopilot
|
|
508
|
+
const project = core.project;
|
|
509
|
+
const interviewSpec = core.interviewSpec;
|
|
510
|
+
const phases = project?.blueprint?.phases || [];
|
|
511
|
+
const phaseOrder = phases.flatMap(p => p.componentIds || []);
|
|
512
|
+
|
|
513
|
+
// Debug: write project metadata at autopilot start
|
|
514
|
+
writeDebugArtifact(projectId, '_project', 'project-meta', {
|
|
515
|
+
project: { projectId, name: project?.name, description: project?.description },
|
|
516
|
+
interviewSpec,
|
|
517
|
+
blueprint: project?.blueprint,
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
try {
|
|
521
|
+
// Iterate through all components in phase order
|
|
522
|
+
for (const cid of phaseOrder) {
|
|
523
|
+
if (autopilotState.cancelledRef.current) break;
|
|
524
|
+
// IMPORTANT: always fetch fresh state from API, not from closure (which is stale after loadData)
|
|
525
|
+
const freshComps = await loadAllComponents(projectId);
|
|
526
|
+
const comp = freshComps.find(c => c.id === cid);
|
|
527
|
+
if (!comp || comp.registeredAs) continue; // skip already registered
|
|
528
|
+
|
|
529
|
+
autopilotState.setStep(comp.label);
|
|
530
|
+
core.setSelectedId(cid);
|
|
531
|
+
|
|
532
|
+
let content;
|
|
533
|
+
let updated;
|
|
534
|
+
let vr;
|
|
535
|
+
let prompt; // original prompt — used by test fix loops
|
|
536
|
+
|
|
537
|
+
// ── Multi-pass vs single-shot dispatch ──
|
|
538
|
+
if (MULTI_PASS_TYPES.includes(comp.type)) {
|
|
539
|
+
// Multi-pass flow: test → skeleton → units → assembly
|
|
540
|
+
const passResult = await runComponentPasses(comp, cid, project, interviewSpec);
|
|
541
|
+
if (!passResult.success) {
|
|
542
|
+
// runComponentPasses already logged and toasted — move to next component or stop
|
|
543
|
+
updated = passResult.updated;
|
|
544
|
+
await core.loadData();
|
|
545
|
+
if (autopilotState.cancelledRef.current) break;
|
|
546
|
+
continue; // skip to next component
|
|
547
|
+
}
|
|
548
|
+
content = passResult.content;
|
|
549
|
+
updated = passResult.updated;
|
|
550
|
+
// Set prompt for test fix loops — use the assembly prompt as representative
|
|
551
|
+
prompt = `[Multi-pass ${comp.type} component: ${comp.label}] Final assembled code.`;
|
|
552
|
+
// Validate the final assembly output
|
|
553
|
+
vr = validateComponent(comp.type, content, project.blueprint);
|
|
554
|
+
if (!vr.valid) {
|
|
555
|
+
updated = { ...updated, result: content, status: 'errors', validationErrors: vr.errors,
|
|
556
|
+
history: [...(updated.history || []), { action: 'assembly_validation_failed', at: new Date().toISOString(), by: 'autopilot', errors: vr.errors }],
|
|
557
|
+
};
|
|
558
|
+
await saveComponent(projectId, updated);
|
|
559
|
+
await core.loadData();
|
|
560
|
+
showToast?.(t('profile.foundry.openrouter.stepFailed') + ': ' + comp.label, true);
|
|
561
|
+
break;
|
|
562
|
+
}
|
|
563
|
+
// Save final result
|
|
564
|
+
updated = { ...updated, result: content, status: 'done', validationErrors: [],
|
|
565
|
+
history: [...(updated.history || []), { action: 'multipass_validation_passed', at: new Date().toISOString(), by: 'autopilot' }],
|
|
566
|
+
};
|
|
567
|
+
await saveComponent(projectId, updated);
|
|
568
|
+
} else {
|
|
569
|
+
// Single-shot flow (CSM, MSM, Memory, Translation) — existing behavior
|
|
570
|
+
const latestComps = await loadAllComponents(projectId);
|
|
571
|
+
const completedComponents = latestComps.filter(c => c.status === 'done' && c.registeredAs);
|
|
572
|
+
prompt = await buildComponentPrompt(
|
|
573
|
+
comp.type, comp.label,
|
|
574
|
+
project.description, project.blueprint, completedComponents,
|
|
575
|
+
interviewSpec,
|
|
576
|
+
);
|
|
577
|
+
try {
|
|
578
|
+
content = await runWithAi(projectId, prompt, null, 'execution');
|
|
579
|
+
} catch (e) {
|
|
580
|
+
showToast?.(`${comp.label}: ${e.message}`, true);
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
if (autopilotState.cancelledRef.current) break;
|
|
584
|
+
writeDebugArtifact(projectId, cid, 'prompt', prompt);
|
|
585
|
+
writeDebugArtifact(projectId, cid, 'ai-raw-response', content);
|
|
586
|
+
content = stripCodeblock(content);
|
|
587
|
+
writeDebugArtifact(projectId, cid, 'generated', content);
|
|
588
|
+
|
|
589
|
+
updated = { ...comp, result: content, status: 'validating', prompt,
|
|
590
|
+
history: [...(comp.history || []), { action: 'ai_response_received', at: new Date().toISOString(), by: 'autopilot' }],
|
|
591
|
+
};
|
|
592
|
+
await saveComponent(projectId, updated);
|
|
593
|
+
|
|
594
|
+
vr = validateComponent(comp.type, content, project.blueprint);
|
|
595
|
+
|
|
596
|
+
// Auto-retry if enabled
|
|
597
|
+
if (!vr.valid && orSettings?.autoRetry) {
|
|
598
|
+
const max = orSettings.maxRetries || 3;
|
|
599
|
+
for (let attempt = 1; attempt <= max && !vr.valid; attempt++) {
|
|
600
|
+
if (autopilotState.cancelledRef.current) break;
|
|
601
|
+
autopilotState.setStep(
|
|
602
|
+
comp.label + ' - ' + t('profile.foundry.openrouter.retrying').replace('{current}', attempt).replace('{max}', max)
|
|
603
|
+
);
|
|
604
|
+
const fixPrompt = buildFixPrompt(prompt, content, vr.errors, comp.type);
|
|
605
|
+
writeDebugArtifact(projectId, cid, 'fix-prompt-' + attempt, fixPrompt);
|
|
606
|
+
try {
|
|
607
|
+
content = await runWithAi(projectId, fixPrompt, null, 'execution');
|
|
608
|
+
} catch (e) {
|
|
609
|
+
showToast?.(`${comp.label}: ${e.message}`, true);
|
|
610
|
+
break;
|
|
611
|
+
}
|
|
612
|
+
writeDebugArtifact(projectId, cid, 'fix-raw-response-' + attempt, content);
|
|
613
|
+
content = stripCodeblock(content);
|
|
614
|
+
vr = validateComponent(comp.type, content, project.blueprint);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
if (!vr.valid) {
|
|
619
|
+
updated = { ...updated, result: content, status: 'errors', validationErrors: vr.errors,
|
|
620
|
+
history: [...updated.history, { action: 'validation_failed', at: new Date().toISOString(), by: 'autopilot', errors: vr.errors }],
|
|
621
|
+
};
|
|
622
|
+
await saveComponent(projectId, updated);
|
|
623
|
+
await core.loadData();
|
|
624
|
+
showToast?.(t('profile.foundry.openrouter.stepFailed') + ': ' + comp.label, true);
|
|
625
|
+
break;
|
|
626
|
+
}
|
|
627
|
+
if (autopilotState.cancelledRef.current) break;
|
|
628
|
+
|
|
629
|
+
// Validation passed — save and register
|
|
630
|
+
updated = { ...updated, result: content, status: 'done', validationErrors: [],
|
|
631
|
+
history: [...updated.history, { action: 'validation_passed', at: new Date().toISOString(), by: 'autopilot' }],
|
|
632
|
+
};
|
|
633
|
+
await saveComponent(projectId, updated);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
// Register component
|
|
637
|
+
try {
|
|
638
|
+
const extComp = (await loadAllComponents(projectId)).find(c => c.type === 'extension' && c.registeredAs);
|
|
639
|
+
const csmComp = (await loadAllComponents(projectId)).find(c => c.type === 'csm' && c.registeredAs);
|
|
640
|
+
const serviceSlug = extComp?.registeredAs || csmComp?.registeredAs?.split('/')?.pop() || '';
|
|
641
|
+
|
|
642
|
+
let resp;
|
|
643
|
+
const doRegister = async () => {
|
|
644
|
+
if (comp.type === 'cortex') {
|
|
645
|
+
const cortexVr = validateComponent('cortex', content, project.blueprint);
|
|
646
|
+
return registerComponent('cortex', cortexVr.extracted, session, serviceSlug);
|
|
647
|
+
}
|
|
648
|
+
return registerComponent(comp.type, vr.extracted || content, session, serviceSlug);
|
|
649
|
+
};
|
|
650
|
+
try {
|
|
651
|
+
resp = await doRegister();
|
|
652
|
+
} catch (regErr) {
|
|
653
|
+
// If "already installed", remove the old one and retry
|
|
654
|
+
if (regErr.message?.includes('already installed') || regErr.message?.includes('already exists') || regErr.message?.includes('409')) {
|
|
655
|
+
const oldName = vr.extracted?.match?.(/name:\s*"?([^\s"]+)/)?.[1] || content?.match?.(/name:\s*"?([^\s"]+)/)?.[1];
|
|
656
|
+
if (oldName) {
|
|
657
|
+
await writeProjectLog(projectId, 'component_reregistering', { meta: { component: comp.label, oldName, by: 'autopilot' } });
|
|
658
|
+
const deactUrl = comp.type === 'extension' ? `/v1/extensions/${encodeURIComponent(oldName)}/deactivate` : `/v1/cortex/${encodeURIComponent(oldName)}/deactivate`;
|
|
659
|
+
await apiPost(deactUrl).catch(() => {});
|
|
660
|
+
const delUrl = comp.type === 'extension' ? `/v1/extensions/${encodeURIComponent(oldName)}` : `/v1/cortex/${encodeURIComponent(oldName)}`;
|
|
661
|
+
await apiDelete(delUrl);
|
|
662
|
+
resp = await doRegister();
|
|
663
|
+
} else {
|
|
664
|
+
throw regErr;
|
|
665
|
+
}
|
|
666
|
+
} else {
|
|
667
|
+
throw regErr;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
const d = resp?.data || {};
|
|
671
|
+
const regName = d.csm?.name || d.integration?.name || d.extension?.name
|
|
672
|
+
|| d.filename || d.name || d.id
|
|
673
|
+
|| (d.locales ? `i18n-${d.locales.join('-')}` : null)
|
|
674
|
+
|| (d.keys?.length ? `memory:${d.keys[d.keys.length - 1]}` : null)
|
|
675
|
+
|| null;
|
|
676
|
+
if (regName) {
|
|
677
|
+
updated = { ...updated, registeredAs: regName,
|
|
678
|
+
history: [...updated.history, { action: 'registered', at: new Date().toISOString(), by: 'autopilot', registeredAs: regName }],
|
|
679
|
+
};
|
|
680
|
+
await saveComponent(projectId, updated);
|
|
681
|
+
await writeProjectLog(projectId, 'component_registered', { meta: { component: comp.label, registeredAs: regName, by: 'autopilot' } });
|
|
682
|
+
}
|
|
683
|
+
} catch (e) {
|
|
684
|
+
const errMsg = e.message || String(e);
|
|
685
|
+
showToast?.(`${comp.label}: Registration failed: ${errMsg}`, true);
|
|
686
|
+
await writeProjectLog(projectId, 'component_registration_failed', { meta: { component: comp.label, type: comp.type, error: errMsg, by: 'autopilot' } });
|
|
687
|
+
await core.loadData();
|
|
688
|
+
break;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
await core.loadData();
|
|
692
|
+
|
|
693
|
+
// Apply project settings to extension config (API keys, etc.) + activate
|
|
694
|
+
if ((comp.type === 'extension' || comp.type === 'cortex') && updated.registeredAs) {
|
|
695
|
+
if (comp.type === 'extension') {
|
|
696
|
+
try {
|
|
697
|
+
await apiPost(`/v1/foundry/${projectId}/apply-settings/${encodeURIComponent(updated.registeredAs)}`);
|
|
698
|
+
await writeProjectLog(projectId, 'settings_applied', { meta: { component: comp.label, registeredAs: updated.registeredAs, by: 'autopilot' } });
|
|
699
|
+
} catch (e) {
|
|
700
|
+
await writeProjectLog(projectId, 'settings_apply_failed', { meta: { component: comp.label, error: e.message, by: 'autopilot' } });
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
try {
|
|
704
|
+
const activateUrl = comp.type === 'extension'
|
|
705
|
+
? `/v1/extensions/${encodeURIComponent(updated.registeredAs)}/activate`
|
|
706
|
+
: `/v1/cortex/${encodeURIComponent(updated.registeredAs)}/activate`;
|
|
707
|
+
await apiPost(activateUrl);
|
|
708
|
+
await writeProjectLog(projectId, 'component_activated', { meta: { component: comp.label, registeredAs: updated.registeredAs, by: 'autopilot' } });
|
|
709
|
+
} catch (e) {
|
|
710
|
+
await writeProjectLog(projectId, 'component_activation_failed', { meta: { component: comp.label, error: e.message, by: 'autopilot' } });
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
// Probe extension after activation — capture real API responses for downstream prompts
|
|
715
|
+
if (comp.type === 'extension' && updated.registeredAs && !autopilotState.cancelledRef.current) {
|
|
716
|
+
try {
|
|
717
|
+
// Build probe scenarios from blueprint testScenarios or from extension action list
|
|
718
|
+
const bpComp = project.blueprint?.components?.find(c => c.label === comp.label);
|
|
719
|
+
const bpScenarios = (project.blueprint?.testScenarios || [])
|
|
720
|
+
.filter(ts => ts.component === bpComp?.id)
|
|
721
|
+
.flatMap(ts => ts.scenarios || []);
|
|
722
|
+
|
|
723
|
+
let probeScenarios;
|
|
724
|
+
if (bpScenarios.length > 0) {
|
|
725
|
+
probeScenarios = bpScenarios.map(s => ({ action: s.action, input: s.input || {} }));
|
|
726
|
+
} else {
|
|
727
|
+
// Fallback: extract action names from generated YAML and call each with empty input
|
|
728
|
+
const actionMatches = [...(content.matchAll(/- id:\s*"?([^\s"]+)/g) || [])];
|
|
729
|
+
probeScenarios = actionMatches.map(m => ({ action: m[1], input: {} }));
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
if (probeScenarios.length > 0) {
|
|
733
|
+
autopilotState.setStep(comp.label + ' — probing extension...');
|
|
734
|
+
await writeProjectLog(projectId, 'extension_probe_start', { meta: { component: comp.label, extensionName: updated.registeredAs, scenarios: probeScenarios.length, by: 'autopilot' } });
|
|
735
|
+
|
|
736
|
+
const probeResp = await probeExtension(projectId, updated.registeredAs, probeScenarios);
|
|
737
|
+
const probeResults = probeResp?.data?.results || [];
|
|
738
|
+
|
|
739
|
+
// Save probe results + context bundle — downstream prompts will inject these
|
|
740
|
+
const contextBundle = createBundle(updated, probeResults);
|
|
741
|
+
updated = { ...updated, probeResults, contextBundle,
|
|
742
|
+
history: [...(updated.history || []), { action: 'extension_probed', at: new Date().toISOString(), by: 'autopilot', probed: probeResults.length }],
|
|
743
|
+
};
|
|
744
|
+
await saveComponent(projectId, updated);
|
|
745
|
+
writeDebugArtifact(projectId, comp.id || bpComp?.id || 'ext', 'probe-results', JSON.stringify(probeResults, null, 2));
|
|
746
|
+
await writeProjectLog(projectId, 'extension_probe_complete', { meta: { component: comp.label, results: probeResults.length, by: 'autopilot' } });
|
|
747
|
+
}
|
|
748
|
+
} catch (e) {
|
|
749
|
+
await writeProjectLog(projectId, 'extension_probe_failed', { meta: { component: comp.label, error: e.message, by: 'autopilot' } });
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
// Per-component test immediately after registration
|
|
754
|
+
// Read testScope via ref for stale-closure safety
|
|
755
|
+
if (!autopilotState.cancelledRef.current && testExec.testScopeRef.current !== 'none') {
|
|
756
|
+
const testableTypes = ['extension', 'cortex', 'app'];
|
|
757
|
+
if (testableTypes.includes(comp.type)) {
|
|
758
|
+
autopilotState.setStep(comp.label + ' — ' + t('profile.foundry.test_generating'));
|
|
759
|
+
await writeProjectLog(projectId, 'test_prompt_generating', { meta: { component: comp.label, type: comp.type, by: 'autopilot' } });
|
|
760
|
+
const testEnvironment = (comp.type === 'cortex' || comp.type === 'app') ? 'browser' : 'server';
|
|
761
|
+
let aiTestCode;
|
|
762
|
+
let testPromptText;
|
|
763
|
+
// Gather probe results: own probeResults for extensions, or extension's probeResults for cortex/app
|
|
764
|
+
let testProbeResults = updated.probeResults || null;
|
|
765
|
+
if (!testProbeResults && (comp.type === 'cortex' || comp.type === 'app')) {
|
|
766
|
+
const allComps = await loadAllComponents(projectId);
|
|
767
|
+
const extComp = allComps.find(c => c.type === 'extension' && c.probeResults);
|
|
768
|
+
testProbeResults = extComp?.probeResults || null;
|
|
769
|
+
}
|
|
770
|
+
try {
|
|
771
|
+
testPromptText = buildTestPrompt(
|
|
772
|
+
comp.type, content, comp.label, updated.registeredAs,
|
|
773
|
+
project.blueprint, interviewSpec, testProbeResults
|
|
774
|
+
);
|
|
775
|
+
await writeProjectLog(projectId, 'test_prompt_built', { meta: { component: comp.label, environment: testEnvironment, promptLength: testPromptText.length, by: 'autopilot' } });
|
|
776
|
+
writeDebugArtifact(projectId, cid, 'test-prompt', testPromptText);
|
|
777
|
+
aiTestCode = await runWithAi(projectId, testPromptText, null, 'reasoning');
|
|
778
|
+
writeDebugArtifact(projectId, cid, 'test-raw-response', aiTestCode);
|
|
779
|
+
aiTestCode = stripCodeblock(aiTestCode);
|
|
780
|
+
writeDebugArtifact(projectId, cid, 'test-code', aiTestCode);
|
|
781
|
+
updated = { ...updated, testPrompt: testPromptText, testCode: aiTestCode, testEnvironment,
|
|
782
|
+
history: [...(updated.history || []), { action: 'test_code_generated', at: new Date().toISOString(), by: 'autopilot' }],
|
|
783
|
+
};
|
|
784
|
+
await saveComponent(projectId, updated);
|
|
785
|
+
await writeProjectLog(projectId, 'test_code_generated', { meta: { component: comp.label, environment: testEnvironment, codeLength: aiTestCode.length, by: 'autopilot' } });
|
|
786
|
+
// Refresh UI so test code textarea shows the generated code before test runs
|
|
787
|
+
await core.loadData();
|
|
788
|
+
} catch (e) {
|
|
789
|
+
await writeProjectLog(projectId, 'test_code_generation_failed', { meta: { component: comp.label, error: e.message, by: 'autopilot' } });
|
|
790
|
+
showToast?.(`${comp.label}: Test generation failed: ${e.message}`, true);
|
|
791
|
+
await core.loadData();
|
|
792
|
+
continue;
|
|
793
|
+
}
|
|
794
|
+
if (autopilotState.cancelledRef.current) break;
|
|
795
|
+
|
|
796
|
+
// Execute test
|
|
797
|
+
autopilotState.setStep(comp.label + ' — ' + t('profile.foundry.test_running'));
|
|
798
|
+
await writeProjectLog(projectId, 'test_executing', { meta: { component: comp.label, environment: testEnvironment, by: 'autopilot' } });
|
|
799
|
+
try {
|
|
800
|
+
const testResp = await runComponentTest(projectId, comp.id, aiTestCode, testEnvironment);
|
|
801
|
+
const testResult = testResp?.data?.result || testResp?.result;
|
|
802
|
+
|
|
803
|
+
if (testResult) {
|
|
804
|
+
updated = { ...updated, testResult,
|
|
805
|
+
history: [...(updated.history || []), { action: 'test_' + testResult.status, at: new Date().toISOString(), by: 'autopilot', errors: testResult.errors }],
|
|
806
|
+
};
|
|
807
|
+
await saveComponent(projectId, updated);
|
|
808
|
+
// Refresh UI so test result displays immediately
|
|
809
|
+
await core.loadData();
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
if (testResult) {
|
|
813
|
+
testExec.pushTestResult(comp.id, comp.label, testResult);
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
if (testResult && testResult.status === 'failed') {
|
|
817
|
+
await writeProjectLog(projectId, 'component_test_failed', { meta: { component: comp.label, errors: testResult.errors, by: 'autopilot' } });
|
|
818
|
+
showToast?.(`${comp.label}: ${t('profile.foundry.test_failed')}`, true);
|
|
819
|
+
|
|
820
|
+
// Per-component fix loop with reflection + history + fresh generation
|
|
821
|
+
const MAX_FIX = 3;
|
|
822
|
+
let fixed = false;
|
|
823
|
+
const previousAttempts = [];
|
|
824
|
+
for (let fix = 0; fix < MAX_FIX && !fixed && !autopilotState.cancelledRef.current; fix++) {
|
|
825
|
+
autopilotState.setStep(
|
|
826
|
+
comp.label + ' — ' + t('profile.foundry.openrouter.retrying').replace('{current}', fix + 1).replace('{max}', MAX_FIX)
|
|
827
|
+
);
|
|
828
|
+
await writeProjectLog(projectId, 'test_fix_round_start', { meta: { component: comp.label, round: fix + 1, maxRounds: MAX_FIX, by: 'autopilot' } });
|
|
829
|
+
updated = { ...updated, history: [...(updated.history || []), { action: 'test_fix_round', at: new Date().toISOString(), by: 'autopilot', round: fix + 1, maxRounds: MAX_FIX }] };
|
|
830
|
+
await saveComponent(projectId, updated);
|
|
831
|
+
|
|
832
|
+
// Build testContext with trace data
|
|
833
|
+
const currentReport = testExec.testReportRef.current;
|
|
834
|
+
const testContext = {
|
|
835
|
+
errors: testResult.errors,
|
|
836
|
+
trace: testResult.trace || [],
|
|
837
|
+
dependencyResults: (currentReport?.components || [])
|
|
838
|
+
.filter(c => c.componentId !== comp.id && c.status === 'passed')
|
|
839
|
+
.map(c => ({ componentId: c.componentId, status: c.status })),
|
|
840
|
+
blueprintComponent: project.blueprint?.components?.find(c => c.label === comp.label) || null,
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
const allErrors = [
|
|
844
|
+
...(vr.errors || []),
|
|
845
|
+
...testResult.errors.map(e => `TEST FAILURE: ${e}`),
|
|
846
|
+
];
|
|
847
|
+
|
|
848
|
+
// Step 1: Reflection — diagnose the failure before writing code
|
|
849
|
+
let reflectionDiagnosis = '';
|
|
850
|
+
try {
|
|
851
|
+
const reflectionPrompt = buildReflectionPrompt(content, allErrors, testContext);
|
|
852
|
+
writeDebugArtifact(projectId, cid, 'test-fix-reflection-' + (fix + 1), reflectionPrompt);
|
|
853
|
+
reflectionDiagnosis = await runWithAi(projectId, reflectionPrompt, null, 'reasoning');
|
|
854
|
+
writeDebugArtifact(projectId, cid, 'test-fix-diagnosis-' + (fix + 1), reflectionDiagnosis);
|
|
855
|
+
} catch (e) {
|
|
856
|
+
await writeProjectLog(projectId, 'test_fix_reflection_failed', { meta: { component: comp.label, round: fix + 1, error: e.message } });
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
// Step 2: Detect oscillation — same errors as previous round?
|
|
860
|
+
const lastAttempt = previousAttempts[previousAttempts.length - 1];
|
|
861
|
+
const sameErrors = lastAttempt && JSON.stringify(lastAttempt.errors.sort()) === JSON.stringify(allErrors.sort());
|
|
862
|
+
|
|
863
|
+
let fixPrompt;
|
|
864
|
+
if (fix === MAX_FIX - 1 || sameErrors) {
|
|
865
|
+
// Final round or oscillation detected: fresh generation with pitfalls
|
|
866
|
+
fixPrompt = buildFreshGenerationPrompt(prompt, previousAttempts, testContext);
|
|
867
|
+
writeDebugArtifact(projectId, cid, 'test-fix-prompt-' + (fix + 1) + '-FRESH', fixPrompt);
|
|
868
|
+
await writeProjectLog(projectId, 'test_fix_fresh_generation', { meta: { component: comp.label, round: fix + 1, reason: sameErrors ? 'oscillation_detected' : 'final_round' } });
|
|
869
|
+
} else {
|
|
870
|
+
// Normal fix with reflection + history
|
|
871
|
+
fixPrompt = buildFixPrompt(prompt, content, allErrors, comp.type, testContext, previousAttempts, reflectionDiagnosis);
|
|
872
|
+
writeDebugArtifact(projectId, cid, 'test-fix-prompt-' + (fix + 1), fixPrompt);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
try {
|
|
876
|
+
content = await runWithAi(projectId, fixPrompt, null, 'execution');
|
|
877
|
+
writeDebugArtifact(projectId, cid, 'test-fix-raw-response-' + (fix + 1), content);
|
|
878
|
+
} catch (e) {
|
|
879
|
+
showToast?.(`${comp.label}: ${e.message}`, true);
|
|
880
|
+
await writeProjectLog(projectId, 'test_fix_ai_failed', { meta: { component: comp.label, round: fix + 1, error: e.message, by: 'autopilot' } });
|
|
881
|
+
break;
|
|
882
|
+
}
|
|
883
|
+
if (autopilotState.cancelledRef.current) break;
|
|
884
|
+
|
|
885
|
+
const fixVr = validateComponent(comp.type, content, project.blueprint);
|
|
886
|
+
if (!fixVr.valid) {
|
|
887
|
+
updated = { ...updated, history: [...(updated.history || []), { action: 'test_fix_validation_failed', at: new Date().toISOString(), by: 'autopilot', round: fix + 1, errors: fixVr.errors }] };
|
|
888
|
+
await saveComponent(projectId, updated);
|
|
889
|
+
await writeProjectLog(projectId, 'test_fix_validation_failed', { meta: { component: comp.label, round: fix + 1, errors: fixVr.errors, by: 'autopilot' } });
|
|
890
|
+
continue;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
// Deactivate + remove before re-registering to ensure clean state
|
|
894
|
+
if ((comp.type === 'extension' || comp.type === 'cortex') && updated.registeredAs) {
|
|
895
|
+
try {
|
|
896
|
+
const deactUrl = comp.type === 'extension'
|
|
897
|
+
? `/v1/extensions/${encodeURIComponent(updated.registeredAs)}/deactivate`
|
|
898
|
+
: `/v1/cortex/${encodeURIComponent(updated.registeredAs)}/deactivate`;
|
|
899
|
+
await apiPost(deactUrl).catch(() => {});
|
|
900
|
+
const delUrl = comp.type === 'extension'
|
|
901
|
+
? `/v1/extensions/${encodeURIComponent(updated.registeredAs)}`
|
|
902
|
+
: `/v1/cortex/${encodeURIComponent(updated.registeredAs)}`;
|
|
903
|
+
await apiDelete(delUrl);
|
|
904
|
+
} catch { /* may not exist */ }
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
// Re-register fixed version
|
|
908
|
+
updated = { ...updated, result: content, status: 'done', validationErrors: [] };
|
|
909
|
+
await saveComponent(projectId, updated);
|
|
910
|
+
|
|
911
|
+
try {
|
|
912
|
+
const extComp2 = (await loadAllComponents(projectId)).find(c => c.type === 'extension' && c.registeredAs);
|
|
913
|
+
const csmComp2 = (await loadAllComponents(projectId)).find(c => c.type === 'csm' && c.registeredAs);
|
|
914
|
+
const slug2 = extComp2?.registeredAs || csmComp2?.registeredAs?.split('/')?.pop() || '';
|
|
915
|
+
if (comp.type === 'cortex') {
|
|
916
|
+
const cvr = validateComponent('cortex', content, project.blueprint);
|
|
917
|
+
await registerComponent('cortex', cvr.extracted, session, slug2);
|
|
918
|
+
} else {
|
|
919
|
+
await registerComponent(comp.type, fixVr.extracted || content, session, slug2);
|
|
920
|
+
}
|
|
921
|
+
await writeProjectLog(projectId, 'test_fix_reregistered', { meta: { component: comp.label, round: fix + 1, by: 'autopilot' } });
|
|
922
|
+
|
|
923
|
+
if (comp.type === 'extension') {
|
|
924
|
+
await apiPost(`/v1/foundry/${projectId}/apply-settings/${encodeURIComponent(updated.registeredAs)}`);
|
|
925
|
+
}
|
|
926
|
+
if (comp.type === 'extension' || comp.type === 'cortex') {
|
|
927
|
+
const actUrl = comp.type === 'extension'
|
|
928
|
+
? `/v1/extensions/${encodeURIComponent(updated.registeredAs)}/activate`
|
|
929
|
+
: `/v1/cortex/${encodeURIComponent(updated.registeredAs)}/activate`;
|
|
930
|
+
await apiPost(actUrl);
|
|
931
|
+
}
|
|
932
|
+
} catch (e) {
|
|
933
|
+
showToast?.(`${comp.label}: Re-register failed: ${e.message}`, true);
|
|
934
|
+
await writeProjectLog(projectId, 'test_fix_reregister_failed', { meta: { component: comp.label, round: fix + 1, error: e.message, by: 'autopilot' } });
|
|
935
|
+
continue;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
// Regenerate test code for the fixed component
|
|
939
|
+
await writeProjectLog(projectId, 'test_fix_regenerating_test', { meta: { component: comp.label, round: fix + 1, by: 'autopilot' } });
|
|
940
|
+
try {
|
|
941
|
+
const newTestPrompt = buildTestPrompt(comp.type, content, comp.label, updated.registeredAs, project.blueprint, interviewSpec, testProbeResults);
|
|
942
|
+
writeDebugArtifact(projectId, cid, 'test-fix-test-prompt-' + (fix + 1), newTestPrompt);
|
|
943
|
+
let newTestCode = await runWithAi(projectId, newTestPrompt, null, 'reasoning');
|
|
944
|
+
writeDebugArtifact(projectId, cid, 'test-fix-test-raw-response-' + (fix + 1), newTestCode);
|
|
945
|
+
newTestCode = stripCodeblock(newTestCode);
|
|
946
|
+
aiTestCode = newTestCode;
|
|
947
|
+
} catch (e) {
|
|
948
|
+
await writeProjectLog(projectId, 'test_fix_regen_failed', { meta: { component: comp.label, round: fix + 1, error: e.message, by: 'autopilot' } });
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
await writeProjectLog(projectId, 'test_fix_retesting', { meta: { component: comp.label, round: fix + 1, by: 'autopilot' } });
|
|
952
|
+
const reTestResp = await runComponentTest(projectId, comp.id, aiTestCode, testEnvironment);
|
|
953
|
+
const reTestResult = reTestResp?.data?.result || reTestResp?.result;
|
|
954
|
+
|
|
955
|
+
if (reTestResult) {
|
|
956
|
+
reTestResult.fixRound = fix + 1;
|
|
957
|
+
testExec.pushTestResult(comp.id, comp.label, reTestResult);
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
if (reTestResult && reTestResult.status !== 'failed') {
|
|
961
|
+
fixed = true;
|
|
962
|
+
updated = { ...updated, testResult: reTestResult, testCode: aiTestCode,
|
|
963
|
+
history: [...(updated.history || []), { action: 'test_fixed', at: new Date().toISOString(), by: 'autopilot', round: fix + 1 }],
|
|
964
|
+
};
|
|
965
|
+
await saveComponent(projectId, updated);
|
|
966
|
+
await writeProjectLog(projectId, 'component_test_fixed', { meta: { component: comp.label, fixRound: fix + 1, by: 'autopilot' } });
|
|
967
|
+
showToast?.(`${comp.label}: ${t('profile.foundry.test_passed')}`);
|
|
968
|
+
} else {
|
|
969
|
+
testResult.errors = reTestResult?.errors || testResult.errors;
|
|
970
|
+
// Record this attempt for next round's context
|
|
971
|
+
previousAttempts.push({
|
|
972
|
+
round: fix + 1,
|
|
973
|
+
diagnosis: reflectionDiagnosis || null,
|
|
974
|
+
errors: reTestResult?.errors || testResult.errors,
|
|
975
|
+
});
|
|
976
|
+
// Update trace for next round
|
|
977
|
+
if (reTestResult?.trace) testContext.trace = reTestResult.trace;
|
|
978
|
+
updated = { ...updated, testResult: reTestResult || testResult, testCode: aiTestCode,
|
|
979
|
+
history: [...(updated.history || []), { action: 'test_fix_still_failing', at: new Date().toISOString(), by: 'autopilot', round: fix + 1, errors: reTestResult?.errors }],
|
|
980
|
+
};
|
|
981
|
+
await saveComponent(projectId, updated);
|
|
982
|
+
await writeProjectLog(projectId, 'test_fix_still_failing', { meta: { component: comp.label, round: fix + 1, errors: reTestResult?.errors, by: 'autopilot' } });
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
if (!fixed && !autopilotState.cancelledRef.current) {
|
|
987
|
+
updated = { ...updated, history: [...(updated.history || []), { action: 'test_gave_up', at: new Date().toISOString(), by: 'autopilot', maxRounds: MAX_FIX }] };
|
|
988
|
+
await saveComponent(projectId, updated);
|
|
989
|
+
await writeProjectLog(projectId, 'component_test_gave_up', { meta: { component: comp.label, maxRounds: MAX_FIX, by: 'autopilot' } });
|
|
990
|
+
showToast?.(`${comp.label}: ${t('profile.foundry.test_fix_round')} ${MAX_FIX}`, true);
|
|
991
|
+
break;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
await core.loadData();
|
|
995
|
+
} else if (testResult) {
|
|
996
|
+
await writeProjectLog(projectId, 'component_test_passed', { meta: { component: comp.label, by: 'autopilot' } });
|
|
997
|
+
} else {
|
|
998
|
+
await writeProjectLog(projectId, 'component_test_no_result', { meta: { component: comp.label, response: JSON.stringify(testResp).slice(0, 200), by: 'autopilot' } });
|
|
999
|
+
}
|
|
1000
|
+
} catch (e) {
|
|
1001
|
+
await writeProjectLog(projectId, 'component_test_error', { meta: { component: comp.label, error: e.message, by: 'autopilot' } });
|
|
1002
|
+
showToast?.(`${comp.label}: Test error: ${e.message}`, true);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
} catch (e) {
|
|
1008
|
+
showToast?.(e.message, true);
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
autopilotState.finish();
|
|
1012
|
+
await core.loadData();
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
return { handleRunAll };
|
|
1016
|
+
}
|