aimeat 2.0.0 → 2.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 +9 -4
- package/dist/locales/en.json +63 -1
- package/dist/locales/fi.json +63 -1
- package/dist/public/components/LinkPreview.js +101 -0
- package/dist/public/components/NotificationBell.js +18 -1
- package/dist/public/cortex-bundled/aimeat-charts.js +158 -10
- package/dist/public/cortex-bundled/aimeat-charts.yaml +1 -1
- package/dist/public/cortex-bundled/aimeat-dag.js +515 -173
- package/dist/public/cortex-bundled/aimeat-dag.yaml +1 -1
- package/dist/public/cortex-bundled/aimeat-i18n.js +6 -1
- package/dist/public/cortex-bundled/aimeat-i18n.yaml +1 -1
- package/dist/public/cortex-bundled/aimeat-surface.js +577 -0
- package/dist/public/cortex-bundled/aimeat-surface.yaml +107 -0
- package/dist/public/cortex-bundled/aimeat-viewport.js +405 -0
- package/dist/public/cortex-bundled/aimeat-viewport.yaml +100 -0
- package/dist/public/css/theme.css +57 -7
- package/dist/public/css/views/admin.css +8 -1
- package/dist/public/css/views/app-grant.css +18 -0
- package/dist/public/css/views/inbox.css +47 -1
- package/dist/public/css/views/portfolio.css +46 -0
- package/dist/public/css/views/profile.css +38 -4
- package/dist/public/js/services/apps.js +19 -3
- package/dist/public/js/services/messages-ai-prompts.js +38 -0
- package/dist/public/js/services/messages.js +26 -4
- package/dist/public/js/services/notebook.js +76 -0
- package/dist/public/js/services/unfurl.js +43 -0
- package/dist/public/lib/VENDORED.md +6 -3
- package/dist/public/lib/aimeat-daisyui-bridge.css +39 -2
- package/dist/public/lib/aimeat-theme.css +538 -0
- package/dist/public/lib/fonts/LICENSE.md +11 -4
- package/dist/public/lib/fonts/fraunces-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/fraunces-var-latin.woff2 +0 -0
- package/dist/public/lib/fonts/inter-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/inter-var-latin.woff2 +0 -0
- package/dist/public/lib/fonts/jetbrains-mono-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/jetbrains-mono-var-latin.woff2 +0 -0
- package/dist/public/lib/fonts/space-grotesk-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/space-grotesk-var-latin.woff2 +0 -0
- package/dist/public/lib/samples/LICENSE.md +11 -0
- package/dist/public/lib/samples/bass/A1.mp3 +0 -0
- package/dist/public/lib/samples/bass/B2.mp3 +0 -0
- package/dist/public/lib/samples/bass/D2.mp3 +0 -0
- package/dist/public/lib/samples/bass/E1.mp3 +0 -0
- package/dist/public/lib/samples/bass/E3.mp3 +0 -0
- package/dist/public/lib/samples/bass/G2.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C2.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C3.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C4.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C5.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C6.mp3 +0 -0
- package/dist/public/lib/samples/epiano/G2.mp3 +0 -0
- package/dist/public/lib/samples/epiano/G3.mp3 +0 -0
- package/dist/public/lib/samples/epiano/G4.mp3 +0 -0
- package/dist/public/lib/samples/epiano/G5.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/A2.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/A4.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/B3.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/D3.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/E2.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/E4.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/E5.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/G3.mp3 +0 -0
- package/dist/public/lib/samples/organ/C2.mp3 +0 -0
- package/dist/public/lib/samples/organ/C3.mp3 +0 -0
- package/dist/public/lib/samples/organ/C4.mp3 +0 -0
- package/dist/public/lib/samples/organ/C5.mp3 +0 -0
- package/dist/public/lib/samples/organ/C6.mp3 +0 -0
- package/dist/public/lib/samples/organ/G2.mp3 +0 -0
- package/dist/public/lib/samples/organ/G3.mp3 +0 -0
- package/dist/public/lib/samples/organ/G4.mp3 +0 -0
- package/dist/public/lib/samples/organ/G5.mp3 +0 -0
- package/dist/public/lib/samples/strings/C2.mp3 +0 -0
- package/dist/public/lib/samples/strings/C3.mp3 +0 -0
- package/dist/public/lib/samples/strings/C4.mp3 +0 -0
- package/dist/public/lib/samples/strings/C5.mp3 +0 -0
- package/dist/public/lib/samples/strings/C6.mp3 +0 -0
- package/dist/public/lib/samples/strings/G2.mp3 +0 -0
- package/dist/public/lib/samples/strings/G3.mp3 +0 -0
- package/dist/public/lib/samples/strings/G4.mp3 +0 -0
- package/dist/public/lib/samples/strings/G5.mp3 +0 -0
- package/dist/public/lib/samples/theme-check.html +92 -0
- package/dist/public/lib/samples/themes-boot.js +20 -0
- package/dist/public/lib/samples/themes.html +154 -0
- package/dist/public/lib/samples/themes.js +60 -0
- package/dist/public/lib/samples/trumpet/A3.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/A4.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/A5.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/C4.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/C5.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/E3.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/E4.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/E5.mp3 +0 -0
- package/dist/public/spa.html +2 -0
- package/dist/public/views/app-grant.js +24 -4
- package/dist/public/views/portfolio.js +61 -6
- package/dist/public/views/profile/access-tab/connected-apps.js +81 -5
- package/dist/public/views/profile/apps-tab.js +18 -1
- package/dist/public/views/profile/extensions-tab.maturity.js +4 -1
- package/dist/public/views/profile/inbox-tab/ai-actions.js +86 -0
- package/dist/public/views/profile/inbox-tab/components.js +141 -10
- package/dist/public/views/profile/inbox-tab/helpers.js +26 -0
- package/dist/public/views/profile/inbox-tab/panels.js +18 -3
- package/dist/public/views/profile/inbox-tab/use-thread-ux.js +47 -3
- package/dist/public/views/profile/inbox-tab.js +46 -49
- package/dist/public/views/profile/landing-page.cards.js +7 -0
- package/dist/public/views/profile/landing-page.js +12 -1
- package/dist/public/views/profile/libraries-tab.js +10 -2
- package/dist/public/views/profile/skills-tab.js +1 -1
- package/dist/public/views/profile/wallet-tab.js +64 -0
- package/dist/public/views/public-workspace-viewer.js +1 -1
- package/dist/public/views/start.js +2 -1
- package/dist/scripts/build-sdk-libs.d.ts +16 -0
- package/dist/scripts/build-sdk-libs.d.ts.map +1 -0
- package/dist/scripts/build-sdk-libs.js +112 -0
- package/dist/scripts/build-sdk-libs.js.map +1 -0
- package/dist/scripts/check-openapi.d.ts +2 -0
- package/dist/scripts/check-openapi.d.ts.map +1 -0
- package/dist/scripts/check-openapi.js +139 -0
- package/dist/scripts/check-openapi.js.map +1 -0
- package/dist/scripts/embed-viewport.d.ts +23 -0
- package/dist/scripts/embed-viewport.d.ts.map +1 -0
- package/dist/scripts/embed-viewport.js +116 -0
- package/dist/scripts/embed-viewport.js.map +1 -0
- package/dist/src/auth/sse-domain-scopes.d.ts +50 -0
- package/dist/src/auth/sse-domain-scopes.d.ts.map +1 -0
- package/dist/src/auth/sse-domain-scopes.js +111 -0
- package/dist/src/auth/sse-domain-scopes.js.map +1 -0
- package/dist/src/cli/connect/auth.d.ts +15 -0
- package/dist/src/cli/connect/auth.d.ts.map +1 -1
- package/dist/src/cli/connect/auth.js +25 -6
- package/dist/src/cli/connect/auth.js.map +1 -1
- package/dist/src/cli/connect/keychain.d.ts +9 -0
- package/dist/src/cli/connect/keychain.d.ts.map +1 -1
- package/dist/src/cli/connect/keychain.js +21 -8
- package/dist/src/cli/connect/keychain.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/agent-tasks.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/agent-tasks.js +4 -1
- package/dist/src/cli/connect/mcp/tools/agent-tasks.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/core.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/core.js +14 -3
- package/dist/src/cli/connect/mcp/tools/core.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/exchange.d.ts +18 -0
- package/dist/src/cli/connect/mcp/tools/exchange.d.ts.map +1 -0
- package/dist/src/cli/connect/mcp/tools/exchange.js +170 -0
- package/dist/src/cli/connect/mcp/tools/exchange.js.map +1 -0
- package/dist/src/cli/connect/mcp/tools/index.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/index.js +2 -0
- package/dist/src/cli/connect/mcp/tools/index.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/workspaces.d.ts +3 -0
- package/dist/src/cli/connect/mcp/tools/workspaces.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/workspaces.js +4 -2
- package/dist/src/cli/connect/mcp/tools/workspaces.js.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-core.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-core.js +13 -1
- package/dist/src/cli/connect/tool-call-defs-core.js.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-exchange.d.ts +3 -0
- package/dist/src/cli/connect/tool-call-defs-exchange.d.ts.map +1 -0
- package/dist/src/cli/connect/tool-call-defs-exchange.js +146 -0
- package/dist/src/cli/connect/tool-call-defs-exchange.js.map +1 -0
- package/dist/src/cli/connect/tool-call.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call.js +2 -0
- package/dist/src/cli/connect/tool-call.js.map +1 -1
- package/dist/src/commerce/__tests__/x402-registry.test.d.ts +2 -0
- package/dist/src/commerce/__tests__/x402-registry.test.d.ts.map +1 -0
- package/dist/src/commerce/__tests__/x402-registry.test.js +105 -0
- package/dist/src/commerce/__tests__/x402-registry.test.js.map +1 -0
- package/dist/src/commerce/evm-address.d.ts +21 -0
- package/dist/src/commerce/evm-address.d.ts.map +1 -0
- package/dist/src/commerce/evm-address.js +94 -0
- package/dist/src/commerce/evm-address.js.map +1 -0
- package/dist/src/commerce/money.d.ts +18 -5
- package/dist/src/commerce/money.d.ts.map +1 -1
- package/dist/src/commerce/money.js +27 -6
- package/dist/src/commerce/money.js.map +1 -1
- package/dist/src/commerce/session-service.d.ts +14 -0
- package/dist/src/commerce/session-service.d.ts.map +1 -1
- package/dist/src/commerce/session-service.js +1 -1
- package/dist/src/commerce/session-service.js.map +1 -1
- package/dist/src/commerce/x402-facilitator.d.ts +64 -13
- package/dist/src/commerce/x402-facilitator.d.ts.map +1 -1
- package/dist/src/commerce/x402-facilitator.js +71 -19
- package/dist/src/commerce/x402-facilitator.js.map +1 -1
- package/dist/src/commerce/x402-handler.d.ts +13 -7
- package/dist/src/commerce/x402-handler.d.ts.map +1 -1
- package/dist/src/commerce/x402-handler.js +23 -10
- package/dist/src/commerce/x402-handler.js.map +1 -1
- package/dist/src/commerce/x402.d.ts +11 -6
- package/dist/src/commerce/x402.d.ts.map +1 -1
- package/dist/src/commerce/x402.js +10 -7
- package/dist/src/commerce/x402.js.map +1 -1
- package/dist/src/config-types.d.ts +12 -0
- package/dist/src/config-types.d.ts.map +1 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +8 -0
- package/dist/src/config.js.map +1 -1
- package/dist/src/data/app-templates/shells.d.ts +15 -3
- package/dist/src/data/app-templates/shells.d.ts.map +1 -1
- package/dist/src/data/app-templates/shells.js +97 -12
- package/dist/src/data/app-templates/shells.js.map +1 -1
- package/dist/src/data/app-templates.js +2 -2
- package/dist/src/data/app-templates.js.map +1 -1
- package/dist/src/data/appdev-pitfalls.d.ts +2 -0
- package/dist/src/data/appdev-pitfalls.d.ts.map +1 -1
- package/dist/src/data/appdev-pitfalls.js +24 -1
- package/dist/src/data/appdev-pitfalls.js.map +1 -1
- package/dist/src/data/library-packs/cortex.d.ts.map +1 -1
- package/dist/src/data/library-packs/cortex.js +108 -5
- package/dist/src/data/library-packs/cortex.js.map +1 -1
- package/dist/src/data/library-packs/sdk.d.ts.map +1 -1
- package/dist/src/data/library-packs/sdk.js +32 -8
- package/dist/src/data/library-packs/sdk.js.map +1 -1
- package/dist/src/data/library-packs/vendored.d.ts.map +1 -1
- package/dist/src/data/library-packs/vendored.js +83 -6
- package/dist/src/data/library-packs/vendored.js.map +1 -1
- package/dist/src/generated/api-types.d.ts +2039 -24
- package/dist/src/generated/api-types.d.ts.map +1 -1
- package/dist/src/mcp/agent-tasks.d.ts +4 -0
- package/dist/src/mcp/agent-tasks.d.ts.map +1 -1
- package/dist/src/mcp/agent-tasks.js +20 -2
- package/dist/src/mcp/agent-tasks.js.map +1 -1
- package/dist/src/mcp/annotations.d.ts.map +1 -1
- package/dist/src/mcp/annotations.js +20 -0
- package/dist/src/mcp/annotations.js.map +1 -1
- package/dist/src/mcp/apps.d.ts.map +1 -1
- package/dist/src/mcp/apps.js +8 -4
- package/dist/src/mcp/apps.js.map +1 -1
- package/dist/src/mcp/capabilities.d.ts +7 -1
- package/dist/src/mcp/capabilities.d.ts.map +1 -1
- package/dist/src/mcp/capabilities.js +5 -2
- package/dist/src/mcp/capabilities.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/commerce.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/commerce.js +4 -2
- package/dist/src/mcp/catalog/definitions/commerce.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.js +4 -3
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/exchange.d.ts +18 -0
- package/dist/src/mcp/catalog/definitions/exchange.d.ts.map +1 -0
- package/dist/src/mcp/catalog/definitions/exchange.js +182 -0
- package/dist/src/mcp/catalog/definitions/exchange.js.map +1 -0
- package/dist/src/mcp/catalog/definitions/organisms-workspaces-apps.js +1 -1
- package/dist/src/mcp/catalog/definitions/organisms-workspaces-apps.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js +3 -2
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js.map +1 -1
- package/dist/src/mcp/catalog/definitions.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions.js +2 -0
- package/dist/src/mcp/catalog/definitions.js.map +1 -1
- package/dist/src/mcp/catalog/output-schemas.d.ts +6 -1
- package/dist/src/mcp/catalog/output-schemas.d.ts.map +1 -1
- package/dist/src/mcp/catalog/output-schemas.js +6 -1
- package/dist/src/mcp/catalog/output-schemas.js.map +1 -1
- package/dist/src/mcp/catalog/scopes.d.ts.map +1 -1
- package/dist/src/mcp/catalog/scopes.js +22 -0
- package/dist/src/mcp/catalog/scopes.js.map +1 -1
- package/dist/src/mcp/catalog/surfaces.d.ts.map +1 -1
- package/dist/src/mcp/catalog/surfaces.js +14 -0
- package/dist/src/mcp/catalog/surfaces.js.map +1 -1
- package/dist/src/mcp/commerce.d.ts.map +1 -1
- package/dist/src/mcp/commerce.js +15 -3
- package/dist/src/mcp/commerce.js.map +1 -1
- package/dist/src/mcp/core-storage.d.ts +23 -0
- package/dist/src/mcp/core-storage.d.ts.map +1 -0
- package/dist/src/mcp/core-storage.js +157 -0
- package/dist/src/mcp/core-storage.js.map +1 -0
- package/dist/src/mcp/core.d.ts +16 -0
- package/dist/src/mcp/core.d.ts.map +1 -1
- package/dist/src/mcp/core.js +75 -119
- package/dist/src/mcp/core.js.map +1 -1
- package/dist/src/mcp/dm-messages.d.ts +4 -0
- package/dist/src/mcp/dm-messages.d.ts.map +1 -1
- package/dist/src/mcp/dm-messages.js +43 -2
- package/dist/src/mcp/dm-messages.js.map +1 -1
- package/dist/src/mcp/exchange-run.d.ts +5 -0
- package/dist/src/mcp/exchange-run.d.ts.map +1 -0
- package/dist/src/mcp/exchange-run.js +226 -0
- package/dist/src/mcp/exchange-run.js.map +1 -0
- package/dist/src/mcp/exchange.d.ts +5 -0
- package/dist/src/mcp/exchange.d.ts.map +1 -0
- package/dist/src/mcp/exchange.js +352 -0
- package/dist/src/mcp/exchange.js.map +1 -0
- package/dist/src/mcp/extensions.d.ts.map +1 -1
- package/dist/src/mcp/extensions.js +17 -2
- package/dist/src/mcp/extensions.js.map +1 -1
- package/dist/src/mcp/index.d.ts +5 -0
- package/dist/src/mcp/index.d.ts.map +1 -1
- package/dist/src/mcp/index.js +26 -3
- package/dist/src/mcp/index.js.map +1 -1
- package/dist/src/mcp/memory-namespace-hints.d.ts +33 -0
- package/dist/src/mcp/memory-namespace-hints.d.ts.map +1 -0
- package/dist/src/mcp/memory-namespace-hints.js +60 -0
- package/dist/src/mcp/memory-namespace-hints.js.map +1 -0
- package/dist/src/mcp/workspaces.d.ts +5 -0
- package/dist/src/mcp/workspaces.d.ts.map +1 -1
- package/dist/src/mcp/workspaces.js +5 -3
- package/dist/src/mcp/workspaces.js.map +1 -1
- package/dist/src/models/agent-task-schemas.d.ts +25 -3
- package/dist/src/models/agent-task-schemas.d.ts.map +1 -1
- package/dist/src/models/agent-task-schemas.js +16 -0
- package/dist/src/models/agent-task-schemas.js.map +1 -1
- package/dist/src/models/app-tool-schemas.d.ts +573 -2
- package/dist/src/models/app-tool-schemas.d.ts.map +1 -1
- package/dist/src/models/app-tool-schemas.js +73 -2
- package/dist/src/models/app-tool-schemas.js.map +1 -1
- package/dist/src/models/odps-schemas.d.ts +305 -0
- package/dist/src/models/odps-schemas.d.ts.map +1 -0
- package/dist/src/models/odps-schemas.js +182 -0
- package/dist/src/models/odps-schemas.js.map +1 -0
- package/dist/src/models/offer-schemas.d.ts +359 -4
- package/dist/src/models/offer-schemas.d.ts.map +1 -1
- package/dist/src/models/offer-schemas.js +37 -0
- package/dist/src/models/offer-schemas.js.map +1 -1
- package/dist/src/models/schemas.d.ts +7 -3
- package/dist/src/models/schemas.d.ts.map +1 -1
- package/dist/src/models/schemas.js +13 -1
- package/dist/src/models/schemas.js.map +1 -1
- package/dist/src/models/webhook-schemas.d.ts +8 -8
- package/dist/src/routes/agent-tasks/create-read.d.ts +4 -0
- package/dist/src/routes/agent-tasks/create-read.d.ts.map +1 -1
- package/dist/src/routes/agent-tasks/create-read.js +20 -1
- package/dist/src/routes/agent-tasks/create-read.js.map +1 -1
- package/dist/src/routes/agent-tasks/lifecycle.d.ts.map +1 -1
- package/dist/src/routes/agent-tasks/lifecycle.js +10 -0
- package/dist/src/routes/agent-tasks/lifecycle.js.map +1 -1
- package/dist/src/routes/agents/device-auth.d.ts +4 -0
- package/dist/src/routes/agents/device-auth.d.ts.map +1 -1
- package/dist/src/routes/agents/device-auth.js +19 -4
- package/dist/src/routes/agents/device-auth.js.map +1 -1
- package/dist/src/routes/agents/offers.d.ts +2 -0
- package/dist/src/routes/agents/offers.d.ts.map +1 -1
- package/dist/src/routes/agents/offers.js +0 -0
- package/dist/src/routes/agents/offers.js.map +1 -1
- package/dist/src/routes/app-grants.d.ts +12 -0
- package/dist/src/routes/app-grants.d.ts.map +1 -1
- package/dist/src/routes/app-grants.js +90 -27
- package/dist/src/routes/app-grants.js.map +1 -1
- package/dist/src/routes/apps/drafts.d.ts +3 -0
- package/dist/src/routes/apps/drafts.d.ts.map +1 -1
- package/dist/src/routes/apps/drafts.js +63 -1
- package/dist/src/routes/apps/drafts.js.map +1 -1
- package/dist/src/routes/apps/fork-manage.d.ts.map +1 -1
- package/dist/src/routes/apps/fork-manage.js +24 -1
- package/dist/src/routes/apps/fork-manage.js.map +1 -1
- package/dist/src/routes/apps/publish.d.ts +4 -0
- package/dist/src/routes/apps/publish.d.ts.map +1 -1
- package/dist/src/routes/apps/publish.js +44 -3
- package/dist/src/routes/apps/publish.js.map +1 -1
- package/dist/src/routes/apps-cost.d.ts +25 -0
- package/dist/src/routes/apps-cost.d.ts.map +1 -0
- package/dist/src/routes/apps-cost.js +107 -0
- package/dist/src/routes/apps-cost.js.map +1 -0
- package/dist/src/routes/commerce.d.ts.map +1 -1
- package/dist/src/routes/commerce.js +122 -2
- package/dist/src/routes/commerce.js.map +1 -1
- package/dist/src/routes/exchange-market.d.ts +32 -0
- package/dist/src/routes/exchange-market.d.ts.map +1 -0
- package/dist/src/routes/exchange-market.js +580 -0
- package/dist/src/routes/exchange-market.js.map +1 -0
- package/dist/src/routes/exchange.d.ts +33 -0
- package/dist/src/routes/exchange.d.ts.map +1 -0
- package/dist/src/routes/exchange.js +398 -0
- package/dist/src/routes/exchange.js.map +1 -0
- package/dist/src/routes/extensions/actions.d.ts.map +1 -1
- package/dist/src/routes/extensions/actions.js +18 -0
- package/dist/src/routes/extensions/actions.js.map +1 -1
- package/dist/src/routes/extensions/crud.d.ts.map +1 -1
- package/dist/src/routes/extensions/crud.js +36 -3
- package/dist/src/routes/extensions/crud.js.map +1 -1
- package/dist/src/routes/extensions/entitlement-gate.d.ts +33 -0
- package/dist/src/routes/extensions/entitlement-gate.d.ts.map +1 -0
- package/dist/src/routes/extensions/entitlement-gate.js +156 -0
- package/dist/src/routes/extensions/entitlement-gate.js.map +1 -0
- package/dist/src/routes/extensions/manifest.d.ts +15 -0
- package/dist/src/routes/extensions/manifest.d.ts.map +1 -1
- package/dist/src/routes/extensions/manifest.js +101 -2
- package/dist/src/routes/extensions/manifest.js.map +1 -1
- package/dist/src/routes/extensions/pacing.d.ts +31 -0
- package/dist/src/routes/extensions/pacing.d.ts.map +1 -0
- package/dist/src/routes/extensions/pacing.js +73 -0
- package/dist/src/routes/extensions/pacing.js.map +1 -0
- package/dist/src/routes/extensions/paywall.d.ts.map +1 -1
- package/dist/src/routes/extensions/paywall.js +20 -11
- package/dist/src/routes/extensions/paywall.js.map +1 -1
- package/dist/src/routes/federation-sync/messaging.d.ts.map +1 -1
- package/dist/src/routes/federation-sync/messaging.js +3 -1
- package/dist/src/routes/federation-sync/messaging.js.map +1 -1
- package/dist/src/routes/ghii/recovery.d.ts +2 -0
- package/dist/src/routes/ghii/recovery.d.ts.map +1 -1
- package/dist/src/routes/ghii/recovery.js +7 -0
- package/dist/src/routes/ghii/recovery.js.map +1 -1
- package/dist/src/routes/ghii/register-login.d.ts +4 -0
- package/dist/src/routes/ghii/register-login.d.ts.map +1 -1
- package/dist/src/routes/ghii/register-login.js +45 -22
- package/dist/src/routes/ghii/register-login.js.map +1 -1
- package/dist/src/routes/ghii/web-verify.d.ts +5 -0
- package/dist/src/routes/ghii/web-verify.d.ts.map +1 -1
- package/dist/src/routes/ghii/web-verify.js +24 -3
- package/dist/src/routes/ghii/web-verify.js.map +1 -1
- package/dist/src/routes/libs/sdk-serve.d.ts +11 -0
- package/dist/src/routes/libs/sdk-serve.d.ts.map +1 -0
- package/dist/src/routes/libs/sdk-serve.js +53 -0
- package/dist/src/routes/libs/sdk-serve.js.map +1 -0
- package/dist/src/routes/libs.d.ts +7 -1
- package/dist/src/routes/libs.d.ts.map +1 -1
- package/dist/src/routes/libs.js +65 -146
- package/dist/src/routes/libs.js.map +1 -1
- package/dist/src/routes/memory/crud.d.ts.map +1 -1
- package/dist/src/routes/memory/crud.js +10 -0
- package/dist/src/routes/memory/crud.js.map +1 -1
- package/dist/src/routes/messages.d.ts +3 -0
- package/dist/src/routes/messages.d.ts.map +1 -1
- package/dist/src/routes/messages.js +9 -0
- package/dist/src/routes/messages.js.map +1 -1
- package/dist/src/routes/notifications.d.ts +6 -3
- package/dist/src/routes/notifications.d.ts.map +1 -1
- package/dist/src/routes/notifications.js +32 -3
- package/dist/src/routes/notifications.js.map +1 -1
- package/dist/src/routes/organisms/crud.d.ts +3 -0
- package/dist/src/routes/organisms/crud.d.ts.map +1 -1
- package/dist/src/routes/organisms/crud.js +5 -2
- package/dist/src/routes/organisms/crud.js.map +1 -1
- package/dist/src/routes/organisms/workspace-access.d.ts.map +1 -1
- package/dist/src/routes/organisms/workspace-access.js +38 -20
- package/dist/src/routes/organisms/workspace-access.js.map +1 -1
- package/dist/src/routes/organisms/workspace-read.d.ts.map +1 -1
- package/dist/src/routes/organisms/workspace-read.js +7 -2
- package/dist/src/routes/organisms/workspace-read.js.map +1 -1
- package/dist/src/routes/public-stats.d.ts +7 -0
- package/dist/src/routes/public-stats.d.ts.map +1 -1
- package/dist/src/routes/public-stats.js +28 -7
- package/dist/src/routes/public-stats.js.map +1 -1
- package/dist/src/routes/sse.d.ts +7 -0
- package/dist/src/routes/sse.d.ts.map +1 -1
- package/dist/src/routes/sse.js +36 -6
- package/dist/src/routes/sse.js.map +1 -1
- package/dist/src/routes/storage-files.d.ts +11 -0
- package/dist/src/routes/storage-files.d.ts.map +1 -1
- package/dist/src/routes/storage-files.js +58 -51
- package/dist/src/routes/storage-files.js.map +1 -1
- package/dist/src/routes/subdomains.d.ts +4 -0
- package/dist/src/routes/subdomains.d.ts.map +1 -1
- package/dist/src/routes/subdomains.js +42 -5
- package/dist/src/routes/subdomains.js.map +1 -1
- package/dist/src/routes/unfurl.d.ts +27 -0
- package/dist/src/routes/unfurl.d.ts.map +1 -0
- package/dist/src/routes/unfurl.js +180 -0
- package/dist/src/routes/unfurl.js.map +1 -0
- package/dist/src/routes/upload.d.ts +13 -0
- package/dist/src/routes/upload.d.ts.map +1 -1
- package/dist/src/routes/upload.js +115 -28
- package/dist/src/routes/upload.js.map +1 -1
- package/dist/src/routes/webmcp.d.ts +3 -0
- package/dist/src/routes/webmcp.d.ts.map +1 -1
- package/dist/src/routes/webmcp.js +59 -0
- package/dist/src/routes/webmcp.js.map +1 -1
- package/dist/src/schemas/knowledge-package.d.ts +1 -1
- package/dist/src/server-bootstrap/routes-loader.d.ts +1 -0
- package/dist/src/server-bootstrap/routes-loader.d.ts.map +1 -1
- package/dist/src/server-bootstrap/routes-loader.js +8 -0
- package/dist/src/server-bootstrap/routes-loader.js.map +1 -1
- package/dist/src/server-bootstrap/static-files.d.ts +4 -0
- package/dist/src/server-bootstrap/static-files.d.ts.map +1 -1
- package/dist/src/server-bootstrap/static-files.js +11 -0
- package/dist/src/server-bootstrap/static-files.js.map +1 -1
- package/dist/src/services/agent-face.d.ts +10 -2
- package/dist/src/services/agent-face.d.ts.map +1 -1
- package/dist/src/services/agent-face.js +10 -4
- package/dist/src/services/agent-face.js.map +1 -1
- package/dist/src/services/app-tool-interfaces.d.ts +37 -0
- package/dist/src/services/app-tool-interfaces.d.ts.map +1 -0
- package/dist/src/services/app-tool-interfaces.js +101 -0
- package/dist/src/services/app-tool-interfaces.js.map +1 -0
- package/dist/src/services/build-app-prompt.d.ts +22 -0
- package/dist/src/services/build-app-prompt.d.ts.map +1 -1
- package/dist/src/services/build-app-prompt.js +108 -11
- package/dist/src/services/build-app-prompt.js.map +1 -1
- package/dist/src/services/call-timing.d.ts +51 -0
- package/dist/src/services/call-timing.d.ts.map +1 -0
- package/dist/src/services/call-timing.js +91 -0
- package/dist/src/services/call-timing.js.map +1 -0
- package/dist/src/services/capability-invoke.d.ts +2 -0
- package/dist/src/services/capability-invoke.d.ts.map +1 -1
- package/dist/src/services/capability-invoke.js +10 -0
- package/dist/src/services/capability-invoke.js.map +1 -1
- package/dist/src/services/config-schema.d.ts.map +1 -1
- package/dist/src/services/config-schema.js +6 -0
- package/dist/src/services/config-schema.js.map +1 -1
- package/dist/src/services/contacts.d.ts +25 -1
- package/dist/src/services/contacts.d.ts.map +1 -1
- package/dist/src/services/contacts.js +30 -0
- package/dist/src/services/contacts.js.map +1 -1
- package/dist/src/services/draft-token.d.ts +22 -2
- package/dist/src/services/draft-token.d.ts.map +1 -1
- package/dist/src/services/draft-token.js +52 -3
- package/dist/src/services/draft-token.js.map +1 -1
- package/dist/src/services/entitlement-money.d.ts +55 -0
- package/dist/src/services/entitlement-money.d.ts.map +1 -0
- package/dist/src/services/entitlement-money.js +68 -0
- package/dist/src/services/entitlement-money.js.map +1 -0
- package/dist/src/services/exchange-market.d.ts +280 -0
- package/dist/src/services/exchange-market.d.ts.map +1 -0
- package/dist/src/services/exchange-market.js +276 -0
- package/dist/src/services/exchange-market.js.map +1 -0
- package/dist/src/services/exchange-odps.d.ts +58 -0
- package/dist/src/services/exchange-odps.d.ts.map +1 -0
- package/dist/src/services/exchange-odps.js +400 -0
- package/dist/src/services/exchange-odps.js.map +1 -0
- package/dist/src/services/exchange-projection.d.ts +61 -0
- package/dist/src/services/exchange-projection.d.ts.map +1 -0
- package/dist/src/services/exchange-projection.js +504 -0
- package/dist/src/services/exchange-projection.js.map +1 -0
- package/dist/src/services/exchange-proposals.d.ts +47 -0
- package/dist/src/services/exchange-proposals.d.ts.map +1 -0
- package/dist/src/services/exchange-proposals.js +73 -0
- package/dist/src/services/exchange-proposals.js.map +1 -0
- package/dist/src/services/exchange-work.d.ts +30 -0
- package/dist/src/services/exchange-work.d.ts.map +1 -0
- package/dist/src/services/exchange-work.js +43 -0
- package/dist/src/services/exchange-work.js.map +1 -0
- package/dist/src/services/extension-files.d.ts +64 -0
- package/dist/src/services/extension-files.d.ts.map +1 -0
- package/dist/src/services/extension-files.js +88 -0
- package/dist/src/services/extension-files.js.map +1 -0
- package/dist/src/services/extension-runtime.d.ts +33 -0
- package/dist/src/services/extension-runtime.d.ts.map +1 -1
- package/dist/src/services/extension-runtime.js +52 -0
- package/dist/src/services/extension-runtime.js.map +1 -1
- package/dist/src/services/file-refs.d.ts +105 -0
- package/dist/src/services/file-refs.d.ts.map +1 -0
- package/dist/src/services/file-refs.js +106 -0
- package/dist/src/services/file-refs.js.map +1 -0
- package/dist/src/services/message-send.d.ts.map +1 -1
- package/dist/src/services/message-send.js +4 -1
- package/dist/src/services/message-send.js.map +1 -1
- package/dist/src/services/metered-entitlements.d.ts +210 -0
- package/dist/src/services/metered-entitlements.d.ts.map +1 -0
- package/dist/src/services/metered-entitlements.js +268 -0
- package/dist/src/services/metered-entitlements.js.map +1 -0
- package/dist/src/services/notify.d.ts +7 -0
- package/dist/src/services/notify.d.ts.map +1 -1
- package/dist/src/services/notify.js +35 -0
- package/dist/src/services/notify.js.map +1 -1
- package/dist/src/services/owner-memory.d.ts +30 -1
- package/dist/src/services/owner-memory.d.ts.map +1 -1
- package/dist/src/services/owner-memory.js +31 -14
- package/dist/src/services/owner-memory.js.map +1 -1
- package/dist/src/services/owner-provisioning.d.ts +5 -0
- package/dist/src/services/owner-provisioning.d.ts.map +1 -1
- package/dist/src/services/owner-provisioning.js +20 -2
- package/dist/src/services/owner-provisioning.js.map +1 -1
- package/dist/src/services/task-files.d.ts +51 -0
- package/dist/src/services/task-files.d.ts.map +1 -0
- package/dist/src/services/task-files.js +58 -0
- package/dist/src/services/task-files.js.map +1 -0
- package/dist/src/services/upload-token.d.ts +29 -0
- package/dist/src/services/upload-token.d.ts.map +1 -1
- package/dist/src/services/upload-token.js +37 -0
- package/dist/src/services/upload-token.js.map +1 -1
- package/dist/src/services/upload-zip.d.ts +2 -0
- package/dist/src/services/upload-zip.d.ts.map +1 -1
- package/dist/src/services/upload-zip.js +5 -1
- package/dist/src/services/upload-zip.js.map +1 -1
- package/dist/src/services/workspace-meta.d.ts +15 -0
- package/dist/src/services/workspace-meta.d.ts.map +1 -1
- package/dist/src/services/workspace-meta.js +17 -0
- package/dist/src/services/workspace-meta.js.map +1 -1
- package/dist/src/services/workspace-provision.d.ts +3 -0
- package/dist/src/services/workspace-provision.d.ts.map +1 -1
- package/dist/src/services/workspace-provision.js +5 -3
- package/dist/src/services/workspace-provision.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.d.ts +1 -0
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.js +10 -0
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/apps.d.ts +1 -0
- package/dist/src/storage/providers/postgres-kysely/methods/apps.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/apps.js +2 -0
- package/dist/src/storage/providers/postgres-kysely/methods/apps.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/identity.d.ts +1 -0
- package/dist/src/storage/providers/postgres-kysely/methods/identity.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/identity.js +4 -0
- package/dist/src/storage/providers/postgres-kysely/methods/identity.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/memory.d.ts +2 -0
- package/dist/src/storage/providers/postgres-kysely/methods/memory.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/memory.js +12 -1
- package/dist/src/storage/providers/postgres-kysely/methods/memory.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/organisms.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/organisms.js +5 -1
- package/dist/src/storage/providers/postgres-kysely/methods/organisms.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/migrations/0011_unique_verified_email.sql +25 -0
- package/dist/src/storage/providers/postgres-kysely/migrations/0012_unique_live_app_grant.sql +29 -0
- package/dist/src/storage/providers/sqlite/methods/apps.d.ts +4 -0
- package/dist/src/storage/providers/sqlite/methods/apps.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/apps.js +9 -0
- package/dist/src/storage/providers/sqlite/methods/apps.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/governance.d.ts +1 -0
- package/dist/src/storage/providers/sqlite/methods/governance.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/governance.js +4 -1
- package/dist/src/storage/providers/sqlite/methods/governance.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.d.ts +1 -0
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.js +4 -0
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/owner.d.ts +5 -0
- package/dist/src/storage/providers/sqlite/methods/owner.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/owner.js +8 -0
- package/dist/src/storage/providers/sqlite/methods/owner.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.d.ts +3 -0
- package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.js +40 -0
- package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
- package/dist/src/storage/repositories/app-grant.repository.d.ts +9 -1
- package/dist/src/storage/repositories/app-grant.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/app.repository.d.ts +0 -0
- package/dist/src/storage/repositories/app.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/identity.repository.d.ts +6 -0
- package/dist/src/storage/repositories/identity.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/memory.repository.d.ts +14 -0
- package/dist/src/storage/repositories/memory.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories-impl/memory-repository.d.ts +8 -1
- package/dist/src/storage/repositories-impl/memory-repository.d.ts.map +1 -1
- package/dist/src/storage/repositories-impl/memory-repository.js +15 -4
- package/dist/src/storage/repositories-impl/memory-repository.js.map +1 -1
- package/dist/src/storage/types/agents-messaging.d.ts +19 -0
- package/dist/src/storage/types/agents-messaging.d.ts.map +1 -1
- package/dist/src/storage/types/agents-messaging.js.map +1 -1
- package/dist/src/storage/types/apps.d.ts +1 -0
- package/dist/src/storage/types/apps.d.ts.map +1 -1
- package/dist/src/storage/types/organisms-federation.d.ts +50 -0
- package/dist/src/storage/types/organisms-federation.d.ts.map +1 -1
- package/dist/src/utils/app-badge.d.ts.map +1 -1
- package/dist/src/utils/app-badge.js +7 -3
- package/dist/src/utils/app-badge.js.map +1 -1
- package/dist/src/utils/app-mobile-lint.d.ts +17 -0
- package/dist/src/utils/app-mobile-lint.d.ts.map +1 -0
- package/dist/src/utils/app-mobile-lint.js +40 -0
- package/dist/src/utils/app-mobile-lint.js.map +1 -0
- package/dist/static/app-catalog/_template.html +18 -82
- package/dist/static/app-catalog/js/apps-io.js +51 -165
- package/dist/static/app-catalog/js/cortex.js +3 -1
- package/dist/static/app-catalog/js/cost.js +100 -0
- package/dist/static/app-catalog/js/db.js +23 -93
- package/dist/static/app-catalog/js/detail.js +568 -59
- package/dist/static/app-catalog/js/favorites.js +71 -0
- package/dist/static/app-catalog/js/i18n-data.js +369 -19
- package/dist/static/app-catalog/js/main.js +50 -139
- package/dist/static/app-catalog/js/migrate.js +88 -0
- package/dist/static/app-catalog/js/monetize.js +205 -17
- package/dist/static/app-catalog/js/odps.js +489 -0
- package/dist/static/app-catalog/js/promote.js +70 -0
- package/dist/static/app-catalog/js/render.js +29 -139
- package/dist/static/app-catalog/js/server-io.js +126 -223
- package/dist/static/app-catalog/js/settings.js +11 -204
- package/dist/static/app-catalog/js/workcopy.js +198 -0
- package/dist/static/app-catalog/styles/app-catalog.css +100 -0
- package/dist/static/app-catalog.html +2220 -1029
- package/dist/static/sdk-libs/_core/config.js +52 -0
- package/dist/static/sdk-libs/_core/http.js +52 -0
- package/dist/static/sdk-libs/_core/namespace.js +33 -0
- package/dist/static/sdk-libs/_core/sdk-globals.d.ts +50 -0
- package/dist/static/sdk-libs/_core/session.js +66 -0
- package/dist/static/sdk-libs/agentface/index.js +102 -0
- package/dist/static/sdk-libs/agents/index.js +305 -0
- package/dist/static/sdk-libs/ai/index.js +153 -0
- package/dist/static/sdk-libs/audio/core.js +111 -0
- package/dist/static/sdk-libs/audio/index.js +380 -0
- package/dist/static/sdk-libs/audio/instruments.js +369 -0
- package/dist/static/sdk-libs/auth/cluster.js +97 -0
- package/dist/static/sdk-libs/auth/config.js +46 -0
- package/dist/static/sdk-libs/auth/crypto.js +166 -0
- package/dist/static/sdk-libs/auth/events.js +27 -0
- package/dist/static/sdk-libs/auth/i18n.js +64 -0
- package/dist/static/sdk-libs/auth/index.js +61 -0
- package/dist/static/sdk-libs/auth/locale.js +151 -0
- package/dist/static/sdk-libs/auth/modal.js +554 -0
- package/dist/static/sdk-libs/auth/palette.js +172 -0
- package/dist/static/sdk-libs/auth/pill.js +198 -0
- package/dist/static/sdk-libs/auth/session.js +792 -0
- package/dist/static/sdk-libs/auth/signup.js +232 -0
- package/dist/static/sdk-libs/auth/theme.js +137 -0
- package/dist/static/sdk-libs/capabilities/index.js +179 -0
- package/dist/static/sdk-libs/commerce/index.js +243 -0
- package/dist/static/sdk-libs/data/index.js +250 -0
- package/dist/static/sdk-libs/dist/aimeat-agentface.js +91 -0
- package/dist/static/sdk-libs/dist/aimeat-agents.js +348 -0
- package/dist/static/sdk-libs/dist/aimeat-ai.js +168 -0
- package/dist/static/sdk-libs/dist/aimeat-audio.js +979 -0
- package/dist/static/sdk-libs/dist/aimeat-auth.js +2232 -0
- package/dist/static/sdk-libs/dist/aimeat-capabilities.js +177 -0
- package/dist/static/sdk-libs/dist/aimeat-commerce.js +265 -0
- package/dist/static/sdk-libs/dist/aimeat-data.js +247 -0
- package/dist/static/sdk-libs/dist/aimeat-editor.js +299 -0
- package/dist/static/sdk-libs/dist/aimeat-header.js +270 -0
- package/dist/static/sdk-libs/dist/aimeat-intake.js +94 -0
- package/dist/static/sdk-libs/dist/aimeat-live.js +317 -0
- package/dist/static/sdk-libs/dist/aimeat-markdown.js +633 -0
- package/dist/static/sdk-libs/dist/aimeat-organism.js +394 -0
- package/dist/static/sdk-libs/dist/aimeat-portfolio-standalone.js +90 -0
- package/dist/static/sdk-libs/dist/aimeat-social.js +157 -0
- package/dist/static/sdk-libs/dist/aimeat-speech.js +300 -0
- package/dist/static/sdk-libs/dist/aimeat-storage.js +210 -0
- package/dist/static/sdk-libs/dist/aimeat-tunnel.js +383 -0
- package/dist/static/sdk-libs/dist/aimeat-wallet.js +118 -0
- package/dist/static/sdk-libs/dist/aimeat-webmcp.js +187 -0
- package/dist/static/sdk-libs/dist/aimeat-work.js +213 -0
- package/dist/static/sdk-libs/dist/aimeat-workflows.js +147 -0
- package/dist/static/sdk-libs/editor/index.js +229 -0
- package/dist/static/sdk-libs/header/index.js +249 -0
- package/dist/static/sdk-libs/intake/index.js +75 -0
- package/dist/static/sdk-libs/live/index.js +223 -0
- package/dist/static/sdk-libs/markdown/index.js +570 -0
- package/dist/static/sdk-libs/organism/index.js +381 -0
- package/dist/static/sdk-libs/portfolio-standalone/index.js +78 -0
- package/dist/static/sdk-libs/social/index.js +140 -0
- package/dist/static/sdk-libs/speech/index.js +321 -0
- package/dist/static/sdk-libs/storage/index.js +189 -0
- package/dist/static/sdk-libs/tunnel/index.js +428 -0
- package/dist/static/sdk-libs/wallet/index.js +115 -0
- package/dist/static/sdk-libs/webmcp/index.js +185 -0
- package/dist/static/sdk-libs/work/index.js +191 -0
- package/dist/static/sdk-libs/workflows/index.js +113 -0
- package/package.json +10 -3
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file apps-io.js
|
|
3
|
-
* @description Getting apps INTO the catalog: creation from
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
3
|
+
* @description Getting apps INTO the catalog. Server-only: creation from an uploaded HTML file, a
|
|
4
|
+
* pasted source, or a ZIP bundle builds a TRANSIENT record and hands it straight to the publish
|
|
5
|
+
* flow — it is published to the owner's account (UNLISTED) on the server. There is no browser-local
|
|
6
|
+
* catalog anymore, so there is no "add a URL bookmark" and nothing is persisted in the browser.
|
|
7
|
+
* Owns the Add-app modal (open/close/tabs/file-drop/save, sign-in gate) + editingAppId. Shared
|
|
8
|
+
* modules by import; main-local fns injected via initAppsIo(deps). Carved from main.js.
|
|
9
|
+
* @usage import { initAppsIo, showModal, setEditingAppId } from './apps-io.js'; initAppsIo({...})
|
|
9
10
|
* @version-history
|
|
10
11
|
* v1.0.0 — 2026-07-10 — Initial extraction (TARGET-021 Aalto 3 modularization, phase 10).
|
|
12
|
+
* v2.0.0 — 2026-07-20 — Server-only cutover: drop the local writers (URL/file/paste/zip → IndexedDB);
|
|
13
|
+
* creation now builds a transient record and publishes it to the server as an unlisted app.
|
|
11
14
|
*/
|
|
12
15
|
import { saveApp } from './db.js';
|
|
13
16
|
import { showNotice } from './ui.js';
|
|
@@ -15,106 +18,36 @@ import { t } from './i18n.js';
|
|
|
15
18
|
import { extractZip, bundleZip } from './zip.js';
|
|
16
19
|
import { getCortexOwnerToken } from './cortex.js'; // sign-in gate in requireSignInThen (runtime-only call, no import cycle)
|
|
17
20
|
|
|
18
|
-
// Injected once at bootstrap by main.js (main-local fns + the live
|
|
19
|
-
|
|
21
|
+
// Injected once at bootstrap by main.js (main-local fns + the live working-set getter + the publish
|
|
22
|
+
// modal opener from server-io, injected to avoid an apps-io ↔ server-io import cycle).
|
|
23
|
+
let generateId, readFileAsText, renderApps, getMainApps, showPublishModal;
|
|
20
24
|
export function initAppsIo(deps) {
|
|
21
|
-
({ generateId, readFileAsText, renderApps, getMainApps } = deps);
|
|
25
|
+
({ generateId, readFileAsText, renderApps, getMainApps, showPublishModal } = deps);
|
|
22
26
|
}
|
|
23
27
|
|
|
24
|
-
// ──
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var encoded = btoa(unescape(encodeURIComponent(
|
|
30
|
-
var app = {
|
|
31
|
-
id: generateId(),
|
|
32
|
-
name: name,
|
|
33
|
-
description: '',
|
|
34
|
-
source: 'zip',
|
|
35
|
-
url: null,
|
|
36
|
-
blob: encoded,
|
|
37
|
-
tags: tags,
|
|
38
|
-
openMode: openMode,
|
|
39
|
-
icon: icon || '\u{1F4E6}',
|
|
40
|
-
screenshot: null,
|
|
41
|
-
favorite: false,
|
|
42
|
-
addedAt: new Date().toISOString(),
|
|
43
|
-
lastOpenedAt: null
|
|
44
|
-
};
|
|
45
|
-
await saveApp(app);
|
|
46
|
-
return app;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// ── App Creation from URL ───────────────────────
|
|
50
|
-
|
|
51
|
-
function addAppFromUrl(name, url, icon, tags, openMode) {
|
|
52
|
-
var app = {
|
|
53
|
-
id: generateId(),
|
|
54
|
-
name: name,
|
|
55
|
-
description: '',
|
|
56
|
-
source: 'url',
|
|
57
|
-
url: url,
|
|
58
|
-
blob: null,
|
|
59
|
-
tags: tags,
|
|
60
|
-
openMode: openMode,
|
|
61
|
-
icon: icon || '\u{1F4DD}',
|
|
62
|
-
screenshot: null,
|
|
63
|
-
favorite: false,
|
|
64
|
-
addedAt: new Date().toISOString(),
|
|
65
|
-
lastOpenedAt: null
|
|
66
|
-
};
|
|
67
|
-
return saveApp(app).then(function () {
|
|
68
|
-
return app;
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// ── App Creation from File ──────────────────────
|
|
73
|
-
|
|
74
|
-
function addAppFromFile(name, file, icon, tags, openMode) {
|
|
75
|
-
return readFileAsText(file).then(function (content) {
|
|
76
|
-
var encoded = btoa(unescape(encodeURIComponent(content)));
|
|
77
|
-
var app = {
|
|
78
|
-
id: generateId(),
|
|
79
|
-
name: name,
|
|
80
|
-
description: '',
|
|
81
|
-
source: 'local',
|
|
82
|
-
url: null,
|
|
83
|
-
blob: encoded,
|
|
84
|
-
tags: tags,
|
|
85
|
-
openMode: openMode,
|
|
86
|
-
icon: icon || '\u{1F4DD}',
|
|
87
|
-
screenshot: null,
|
|
88
|
-
favorite: false,
|
|
89
|
-
addedAt: new Date().toISOString(),
|
|
90
|
-
lastOpenedAt: null
|
|
91
|
-
};
|
|
92
|
-
return saveApp(app).then(function () {
|
|
93
|
-
return app;
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// ── App Creation from Pasted Source ─────────────
|
|
99
|
-
|
|
100
|
-
function addAppFromSource(name, sourceCode, icon, tags, openMode) {
|
|
101
|
-
var encoded = btoa(unescape(encodeURIComponent(sourceCode)));
|
|
28
|
+
// ── Create → publish straight to the server (unlisted) ─────────────────────────
|
|
29
|
+
// Build a transient in-memory record from raw HTML and open the publish modal for it. The publish
|
|
30
|
+
// modal collects filename/description/access-code and POSTs to /v1/apps; the create flow parks the
|
|
31
|
+
// result so the new app lands UNLISTED (on the server, not yet public). Nothing is stored locally.
|
|
32
|
+
function createAppFromHtml(name, html, icon, tags, description) {
|
|
33
|
+
var encoded = btoa(unescape(encodeURIComponent(html)));
|
|
102
34
|
var app = {
|
|
103
35
|
id: generateId(),
|
|
104
36
|
name: name,
|
|
105
|
-
description:
|
|
106
|
-
source: '
|
|
37
|
+
description: description || '',
|
|
38
|
+
source: 'create',
|
|
107
39
|
url: null,
|
|
108
40
|
blob: encoded,
|
|
109
|
-
tags: tags,
|
|
110
|
-
openMode: openMode,
|
|
41
|
+
tags: tags || [],
|
|
111
42
|
icon: icon || '\u{1F4DD}',
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
addedAt: new Date().toISOString(),
|
|
115
|
-
lastOpenedAt: null
|
|
43
|
+
published: false,
|
|
44
|
+
addedAt: new Date().toISOString()
|
|
116
45
|
};
|
|
117
46
|
return saveApp(app).then(function () {
|
|
47
|
+
// showPublishModal resolves the app from the main working-set (getMainApps), so make the
|
|
48
|
+
// transient record visible there too before opening it (same pattern as openPublishedDetail).
|
|
49
|
+
try { getMainApps().push(app); } catch (e) { /* getter optional */ }
|
|
50
|
+
if (typeof showPublishModal === 'function') showPublishModal(app.id, { unlisted: true });
|
|
118
51
|
return app;
|
|
119
52
|
});
|
|
120
53
|
}
|
|
@@ -127,8 +60,8 @@ var editingAppId = null;
|
|
|
127
60
|
function showModal() {
|
|
128
61
|
document.getElementById('modal-overlay').hidden = false;
|
|
129
62
|
document.getElementById('modal-title').textContent = t('addModal.title');
|
|
130
|
-
//
|
|
131
|
-
switchTab('
|
|
63
|
+
// Server-only: there is no URL-bookmark tab — default to pasting source.
|
|
64
|
+
switchTab('paste');
|
|
132
65
|
}
|
|
133
66
|
|
|
134
67
|
// Step 0 for not-yet-signed-in users: adding/publishing an app needs an account, so
|
|
@@ -173,7 +106,6 @@ function parseAppMeta(html) {
|
|
|
173
106
|
function closeModal() {
|
|
174
107
|
document.getElementById('modal-overlay').hidden = true;
|
|
175
108
|
// Reset form
|
|
176
|
-
document.getElementById('app-url').value = '';
|
|
177
109
|
document.getElementById('app-name').value = '';
|
|
178
110
|
document.getElementById('app-icon').value = '';
|
|
179
111
|
document.getElementById('app-tags').value = '';
|
|
@@ -233,30 +165,19 @@ function handleSave() {
|
|
|
233
165
|
var name = document.getElementById('app-name').value.trim();
|
|
234
166
|
var icon = document.getElementById('app-icon').value.trim();
|
|
235
167
|
var tagsRaw = document.getElementById('app-tags').value.trim();
|
|
236
|
-
// Apps open TOP-LEVEL on a real origin (published) or in the sandbox (local); there is no
|
|
237
|
-
// user-facing open-mode choice anymore, so new/edited apps default to 'tab'.
|
|
238
|
-
var openMode = 'tab';
|
|
239
|
-
|
|
240
168
|
var tags = tagsRaw ? tagsRaw.split(',').map(function (t) { return t.trim(); }).filter(Boolean) : [];
|
|
241
169
|
|
|
242
|
-
// ── Edit mode: update
|
|
170
|
+
// ── Edit mode: update a transient record's display metadata in place ──
|
|
243
171
|
if (editingAppId) {
|
|
244
172
|
var app = null;
|
|
245
173
|
for (var i = 0; i < getMainApps().length; i++) {
|
|
246
174
|
if (getMainApps()[i].id === editingAppId) { app = getMainApps()[i]; break; }
|
|
247
175
|
}
|
|
248
|
-
if (!app) {
|
|
249
|
-
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
if (!name) {
|
|
253
|
-
showNotice('Please enter a name');
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
176
|
+
if (!app) { closeModal(); return; }
|
|
177
|
+
if (!name) { showNotice('Please enter a name'); return; }
|
|
256
178
|
app.name = name;
|
|
257
179
|
app.icon = icon || app.icon;
|
|
258
180
|
app.tags = tags;
|
|
259
|
-
app.openMode = openMode;
|
|
260
181
|
saveApp(app).then(function () {
|
|
261
182
|
closeModal();
|
|
262
183
|
renderApps();
|
|
@@ -264,69 +185,38 @@ function handleSave() {
|
|
|
264
185
|
return;
|
|
265
186
|
}
|
|
266
187
|
|
|
267
|
-
// ── Create mode ──
|
|
188
|
+
// ── Create mode → publish to the server (unlisted) ──
|
|
268
189
|
var activeTab = document.querySelector('.modal-tab.active');
|
|
269
|
-
var tabName = activeTab ? activeTab.getAttribute('data-tab') : '
|
|
190
|
+
var tabName = activeTab ? activeTab.getAttribute('data-tab') : 'paste';
|
|
270
191
|
|
|
271
|
-
if (tabName === '
|
|
272
|
-
var url = document.getElementById('app-url').value.trim();
|
|
273
|
-
if (!url) {
|
|
274
|
-
showNotice('Please enter a URL');
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
if (!name) {
|
|
278
|
-
// Derive name from URL
|
|
279
|
-
try {
|
|
280
|
-
name = new URL(url).hostname;
|
|
281
|
-
} catch (e) {
|
|
282
|
-
name = url;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
addAppFromUrl(name, url, icon, tags, openMode).then(function () {
|
|
286
|
-
closeModal();
|
|
287
|
-
renderApps();
|
|
288
|
-
});
|
|
289
|
-
} else if (tabName === 'paste') {
|
|
192
|
+
if (tabName === 'paste') {
|
|
290
193
|
var pastedCode = document.getElementById('app-paste-code').value.trim();
|
|
291
194
|
if (!pastedCode) {
|
|
292
195
|
showNotice('Please paste your HTML source code');
|
|
293
196
|
return;
|
|
294
197
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
addAppFromSource(name, pastedCode, icon, tags, openMode).then(function () {
|
|
301
|
-
closeModal();
|
|
302
|
-
renderApps();
|
|
303
|
-
});
|
|
198
|
+
var meta = parseAppMeta(pastedCode);
|
|
199
|
+
if (!name) name = meta.name || 'Pasted App';
|
|
200
|
+
closeModal();
|
|
201
|
+
createAppFromHtml(name, pastedCode, icon, tags, meta.description);
|
|
304
202
|
} else if (tabName === 'file') {
|
|
305
203
|
if (!selectedFile) {
|
|
306
204
|
showNotice('Please select a file');
|
|
307
205
|
return;
|
|
308
206
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
if (!name)
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
return
|
|
316
|
-
|
|
317
|
-
closeModal();
|
|
318
|
-
renderApps();
|
|
319
|
-
}).catch(function (err) {
|
|
320
|
-
showNotice('ZIP import failed: ' + (err.message || err));
|
|
321
|
-
});
|
|
207
|
+
var file = selectedFile;
|
|
208
|
+
if (file.name.toLowerCase().endsWith('.zip')) {
|
|
209
|
+
if (!name) name = file.name.replace(/\.zip$/i, '');
|
|
210
|
+
file.arrayBuffer()
|
|
211
|
+
.then(function (arrayBuffer) { return extractZip(arrayBuffer); })
|
|
212
|
+
.then(function (files) { return bundleZip(files); })
|
|
213
|
+
.then(function (html) { closeModal(); return createAppFromHtml(name, html, icon, tags, parseAppMeta(html).description); })
|
|
214
|
+
.catch(function (err) { showNotice('ZIP import failed: ' + (err.message || err)); });
|
|
322
215
|
} else {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
name = selectedFile.name.replace(/\.html?$/i, '');
|
|
326
|
-
}
|
|
327
|
-
addAppFromFile(name, selectedFile, icon, tags, openMode).then(function () {
|
|
216
|
+
if (!name) name = file.name.replace(/\.html?$/i, '');
|
|
217
|
+
readFileAsText(file).then(function (html) {
|
|
328
218
|
closeModal();
|
|
329
|
-
|
|
219
|
+
createAppFromHtml(name, html, icon, tags, parseAppMeta(html).description);
|
|
330
220
|
});
|
|
331
221
|
}
|
|
332
222
|
}
|
|
@@ -336,10 +226,6 @@ function handleSave() {
|
|
|
336
226
|
export function setEditingAppId(v) { editingAppId = v; }
|
|
337
227
|
|
|
338
228
|
export {
|
|
339
|
-
addAppFromZip,
|
|
340
|
-
addAppFromUrl,
|
|
341
|
-
addAppFromFile,
|
|
342
|
-
addAppFromSource,
|
|
343
229
|
showModal,
|
|
344
230
|
requireSignInThen,
|
|
345
231
|
parseAppMeta,
|
|
@@ -492,7 +492,9 @@ function loadPbPacks() {
|
|
|
492
492
|
if (p.modelTier) {
|
|
493
493
|
var badge = document.createElement('span');
|
|
494
494
|
badge.className = 'pb-pack-tier pb-tier-' + p.modelTier;
|
|
495
|
-
|
|
495
|
+
// The label is the INSTRUCTION, not the raw key: `needs-doc` reads as
|
|
496
|
+
// "documentation missing" when it means "no priors — the AI must read the doc".
|
|
497
|
+
badge.textContent = t('pb.tier.' + p.modelTier) || p.modelTier;
|
|
496
498
|
var proven = (p.proofs || []).map(function (pr) { return pr.model + '→' + pr.verdict; }).join(', ');
|
|
497
499
|
badge.title = 'AEB reliability tier: ' + p.modelTier
|
|
498
500
|
+ (proven ? ' · proven on ' + proven : ' · not yet AEB-run')
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file cost.js
|
|
3
|
+
* @description The Cost & Contracts section of the App Detail view (EXCHANGE G3 / TARGET-045): a
|
|
4
|
+
* read-only per-app surface of the EXCHANGE contracts (metered entitlements) an app sources, with
|
|
5
|
+
* live spend against each budget and the platform rake. Data comes from GET /v1/apps/cost?app_id=,
|
|
6
|
+
* which returns only entitlements whose consumer is the signed-in owner (strictly cross-owner).
|
|
7
|
+
* Rendering mirrors monetize.js: detail.js renders the shell for OWN published apps and calls
|
|
8
|
+
* costOnOpen; this module async-loads and re-renders #detail-cost in place.
|
|
9
|
+
* @structure costOnOpen · costSectionInner
|
|
10
|
+
* @usage import { costSectionInner, costOnOpen } from './cost.js'
|
|
11
|
+
* @version-history
|
|
12
|
+
* v1.0.0 — 2026-07-20 — Initial per-app cost & contracts surface (EXCHANGE G3).
|
|
13
|
+
*/
|
|
14
|
+
import { escapeHtml } from './util.js';
|
|
15
|
+
import { loadConfig } from './config.js';
|
|
16
|
+
import { t } from './i18n.js';
|
|
17
|
+
import { getCortexOwnerToken } from './cortex.js';
|
|
18
|
+
|
|
19
|
+
var cState = 'off'; // 'off' | 'loading' | 'ready' | 'error'
|
|
20
|
+
var cData = null; // the /v1/apps/cost data payload, or null
|
|
21
|
+
var cAppId = ''; // full app id "owner/filename"
|
|
22
|
+
|
|
23
|
+
function apiBase() {
|
|
24
|
+
var cfg = loadConfig();
|
|
25
|
+
return (cfg.aimeatUrl || '').replace(/\/+$/, '');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function rerender() {
|
|
29
|
+
var el = document.getElementById('detail-cost');
|
|
30
|
+
if (el) el.innerHTML = costSectionInner();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Reset + async-load the cost surface when a detail view opens. No-op for non-own / unpublished apps. */
|
|
34
|
+
export function costOnOpen(owner, appId, isOwn) {
|
|
35
|
+
cData = null;
|
|
36
|
+
if (!isOwn || !owner || !appId) { cState = 'off'; cAppId = ''; return; }
|
|
37
|
+
cAppId = owner + '/' + appId;
|
|
38
|
+
cState = 'loading';
|
|
39
|
+
var token = getCortexOwnerToken();
|
|
40
|
+
if (!token) { cState = 'error'; cData = { _needLogin: true }; return; }
|
|
41
|
+
fetch(apiBase() + '/v1/apps/cost?app_id=' + encodeURIComponent(cAppId), {
|
|
42
|
+
headers: { 'Authorization': 'Bearer ' + token },
|
|
43
|
+
})
|
|
44
|
+
.then(function (r) { return r.json(); })
|
|
45
|
+
.then(function (res) {
|
|
46
|
+
if (!res || !res.ok || !res.data) throw new Error('bad response');
|
|
47
|
+
cData = res.data;
|
|
48
|
+
cState = 'ready';
|
|
49
|
+
rerender();
|
|
50
|
+
})
|
|
51
|
+
.catch(function () { cState = 'error'; cData = null; rerender(); });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function stateBadge(state) {
|
|
55
|
+
// Reuse the sync-chip colours: ok (active), diff (paused), none (revoked/exhausted).
|
|
56
|
+
var cls = state === 'active' ? 'ok' : (state === 'paused' ? 'diff' : 'none');
|
|
57
|
+
return '<span class="dtl-sync ' + cls + '" style="margin:0">' + escapeHtml(state) + '</span>';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function contractRow(c) {
|
|
61
|
+
var b = c.budget || {};
|
|
62
|
+
var cap = (b.cap_units === null || b.cap_units === undefined) ? t('cost.uncapped') : (b.spent_units + ' / ' + b.cap_units);
|
|
63
|
+
var remaining = (b.remaining_units === null || b.remaining_units === undefined) ? ''
|
|
64
|
+
: ' <span class="dtl-stat-label">(' + t('cost.remaining').replace('{n}', b.remaining_units) + ')</span>';
|
|
65
|
+
var providerShort = String(c.provider || '').split('@')[0];
|
|
66
|
+
return '<div class="dtl-status-row" style="align-items:center;gap:10px;flex-wrap:wrap">' +
|
|
67
|
+
'<div class="dtl-stat" style="flex:1;min-width:150px">' +
|
|
68
|
+
'<span class="dtl-stat-val">' + escapeHtml(c.capability || '') + '</span>' +
|
|
69
|
+
'<span class="dtl-stat-label">' + escapeHtml(t('cost.providerCol')) + ': ' + escapeHtml(providerShort) + '</span>' +
|
|
70
|
+
'</div>' +
|
|
71
|
+
'<div class="dtl-stat"><span class="dtl-stat-label">' + t('cost.priceCol') + '</span><span class="dtl-stat-val">' + escapeHtml(String(c.price_per_call)) + ' morsels</span></div>' +
|
|
72
|
+
'<div class="dtl-stat"><span class="dtl-stat-label">' + t('cost.rakeCol') + '</span><span class="dtl-stat-val">' + escapeHtml(String(c.rake_per_call)) + ' morsels (' + escapeHtml(String(c.rake_percent)) + '%)</span></div>' +
|
|
73
|
+
'<div class="dtl-stat"><span class="dtl-stat-label">' + t('cost.budgetCol') + '</span><span class="dtl-stat-val">' + escapeHtml(cap) + remaining + '</span></div>' +
|
|
74
|
+
'<div class="dtl-stat">' + stateBadge(c.state) + '</div>' +
|
|
75
|
+
'</div>';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Inner HTML of the section — detail.js wraps it in <div class="dtl-section" id="detail-cost">. */
|
|
79
|
+
export function costSectionInner() {
|
|
80
|
+
if (cState === 'off') return '';
|
|
81
|
+
var html = '<h3>' + t('cost.title') + '</h3>' +
|
|
82
|
+
'<p class="dtl-desc">' + t('cost.hint') + '</p>';
|
|
83
|
+
if (cState === 'loading') {
|
|
84
|
+
return html + '<span style="color:var(--text-muted);font-size:.85rem">…</span>';
|
|
85
|
+
}
|
|
86
|
+
if (cState === 'error') {
|
|
87
|
+
var msg = (cData && cData._needLogin) ? t('cost.needLogin') : t('cost.loadFailed');
|
|
88
|
+
return html + '<span class="dtl-sync none">' + escapeHtml(msg) + '</span>';
|
|
89
|
+
}
|
|
90
|
+
var contracts = (cData && cData.contracts) || [];
|
|
91
|
+
if (!contracts.length) {
|
|
92
|
+
return html + '<span class="dtl-sync none">' + t('cost.empty') + '</span>';
|
|
93
|
+
}
|
|
94
|
+
var m = (cData.totals && cData.totals.morsels) || { spent_units: 0, calls: 0 };
|
|
95
|
+
html += '<div class="dtl-sync ok" style="margin:0 0 10px">' +
|
|
96
|
+
t('cost.summary').replace('{n}', cData.total_contracts).replace('{spent}', m.spent_units).replace('{calls}', m.calls) +
|
|
97
|
+
'</div>';
|
|
98
|
+
for (var i = 0; i < contracts.length; i++) html += contractRow(contracts[i]);
|
|
99
|
+
return html;
|
|
100
|
+
}
|
|
@@ -1,108 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file db.js
|
|
3
|
-
* @description
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
3
|
+
* @description Transient in-memory working-set for the catalog. The catalog is SERVER-ONLY —
|
|
4
|
+
* there is no browser persistence (no IndexedDB). This module holds a page-session array of
|
|
5
|
+
* app records that the detail view materializes on demand for editing (downloaded from the
|
|
6
|
+
* server, edited in memory, then published back). The set is empty on every load and rebuilt
|
|
7
|
+
* from the server; nothing here survives a reload. Keeps the getAllApps/saveApp/deleteApp
|
|
8
|
+
* surface the rest of the catalog imports, so callers are unchanged.
|
|
9
|
+
* @usage import { getAllApps, saveApp, deleteApp } from './db.js'
|
|
8
10
|
* @version-history
|
|
9
11
|
* v1.0.0 — 2026-07-10 — Initial extraction (TARGET-021 Aalto 3 modularization, phase 2).
|
|
12
|
+
* v2.0.0 — 2026-07-20 — Server-only catalog: drop IndexedDB + the Shared/Mine DB-mode entirely;
|
|
13
|
+
* back the same CRUD surface with a transient in-memory working-set (no browser persistence).
|
|
10
14
|
*/
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let dbInstance = null;
|
|
17
|
-
let currentDbMode = localStorage.getItem('appCatalogMode') || 'global';
|
|
18
|
-
|
|
19
|
-
export function getDbMode() { return currentDbMode; }
|
|
20
|
-
|
|
21
|
-
export function setDbMode(mode) {
|
|
22
|
-
currentDbMode = mode;
|
|
23
|
-
try { localStorage.setItem('appCatalogMode', mode); } catch (e) { /* private mode */ }
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function closeDbInstance() {
|
|
27
|
-
if (dbInstance) { try { dbInstance.close(); } catch (e) {} dbInstance = null; }
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** DB name is per-account in Personal mode (falls back to the shared Global DB otherwise). */
|
|
31
|
-
export function getDbName() {
|
|
32
|
-
if (currentDbMode === 'personal') {
|
|
33
|
-
var owner = null;
|
|
34
|
-
try {
|
|
35
|
-
if (window.AIMEAT && window.AIMEAT.auth && window.AIMEAT.auth.getSession()) {
|
|
36
|
-
owner = window.AIMEAT.auth.getSession().owner || null;
|
|
37
|
-
}
|
|
38
|
-
if (!owner) {
|
|
39
|
-
var stored = localStorage.getItem('aimeat_session');
|
|
40
|
-
if (stored) owner = JSON.parse(stored).owner || null;
|
|
41
|
-
}
|
|
42
|
-
} catch (e) {}
|
|
43
|
-
if (owner) return DB_NAME_GLOBAL + '_' + owner;
|
|
44
|
-
}
|
|
45
|
-
return DB_NAME_GLOBAL;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function openDB() {
|
|
49
|
-
var name = getDbName();
|
|
50
|
-
if (dbInstance && dbInstance.name === name) return Promise.resolve(dbInstance);
|
|
51
|
-
if (dbInstance) { dbInstance.close(); dbInstance = null; }
|
|
52
|
-
return new Promise(function (resolve, reject) {
|
|
53
|
-
const request = indexedDB.open(name, DB_VERSION);
|
|
54
|
-
request.onupgradeneeded = function (event) {
|
|
55
|
-
const db = event.target.result;
|
|
56
|
-
var store;
|
|
57
|
-
if (!db.objectStoreNames.contains(STORE_NAME)) {
|
|
58
|
-
store = db.createObjectStore(STORE_NAME, { keyPath: 'id' });
|
|
59
|
-
store.createIndex('tags', 'tags', { multiEntry: true });
|
|
60
|
-
store.createIndex('source', 'source', { unique: false });
|
|
61
|
-
store.createIndex('favorite', 'favorite', { unique: false });
|
|
62
|
-
store.createIndex('sortOrder', 'sortOrder', { unique: false });
|
|
63
|
-
} else {
|
|
64
|
-
store = event.target.transaction.objectStore(STORE_NAME);
|
|
65
|
-
if (!store.indexNames.contains('sortOrder')) {
|
|
66
|
-
store.createIndex('sortOrder', 'sortOrder', { unique: false });
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
request.onsuccess = function (event) { dbInstance = event.target.result; resolve(dbInstance); };
|
|
71
|
-
request.onerror = function (event) { reject(event.target.error); };
|
|
72
|
-
});
|
|
73
|
-
}
|
|
16
|
+
// Page-session working set. Holds only transient records the detail view materialized for editing;
|
|
17
|
+
// empty on load, discarded on unload. NOT a store — the server is the sole source of truth.
|
|
18
|
+
let workingSet = [];
|
|
74
19
|
|
|
20
|
+
/** Resolve the current working set (a copy so callers can't mutate our array by reference). */
|
|
75
21
|
export function getAllApps() {
|
|
76
|
-
return
|
|
77
|
-
return new Promise(function (resolve, reject) {
|
|
78
|
-
const tx = db.transaction(STORE_NAME, 'readonly');
|
|
79
|
-
const request = tx.objectStore(STORE_NAME).getAll();
|
|
80
|
-
request.onsuccess = function () { resolve(request.result); };
|
|
81
|
-
request.onerror = function () { reject(request.error); };
|
|
82
|
-
});
|
|
83
|
-
});
|
|
22
|
+
return Promise.resolve(workingSet.slice());
|
|
84
23
|
}
|
|
85
24
|
|
|
25
|
+
/** Upsert a transient record by id (in memory only — persistence is publishing to the server). */
|
|
86
26
|
export function saveApp(app) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
tx.onerror = function () { reject(tx.error); };
|
|
93
|
-
tx.onabort = function () { reject(tx.error); };
|
|
94
|
-
});
|
|
95
|
-
});
|
|
27
|
+
if (app && app.id) {
|
|
28
|
+
var idx = workingSet.findIndex(function (a) { return a.id === app.id; });
|
|
29
|
+
if (idx >= 0) workingSet[idx] = app; else workingSet.push(app);
|
|
30
|
+
}
|
|
31
|
+
return Promise.resolve();
|
|
96
32
|
}
|
|
97
33
|
|
|
34
|
+
/** Drop a transient record by id (does NOT delete the server app — that is deleteServerApp). */
|
|
98
35
|
export function deleteApp(id) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const tx = db.transaction(STORE_NAME, 'readwrite');
|
|
102
|
-
tx.objectStore(STORE_NAME).delete(id);
|
|
103
|
-
tx.oncomplete = function () { resolve(); };
|
|
104
|
-
tx.onerror = function () { reject(tx.error); };
|
|
105
|
-
tx.onabort = function () { reject(tx.error); };
|
|
106
|
-
});
|
|
107
|
-
});
|
|
36
|
+
workingSet = workingSet.filter(function (a) { return a.id !== id; });
|
|
37
|
+
return Promise.resolve();
|
|
108
38
|
}
|