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
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file auth/signup.js
|
|
3
|
+
* @description aimeat-auth first-time social-signup flow (SDK-libs migration Phase 3). After a first
|
|
4
|
+
* Google/OIDC sign-in the server does NOT auto-create the account — it bounces back with
|
|
5
|
+
* ?aimeat_signup=1 + a short-lived signed cookie. showGoogleSignupModal prompts for a permanent
|
|
6
|
+
* username (live availability check) + display name, then POSTs finalize (creates account +
|
|
7
|
+
* session). showSignupNoticeModal handles the link-existing / expired-pending explanations.
|
|
8
|
+
* maybeShowGoogleSignup runs on load. Extracted from auth-lib-part3.ts.
|
|
9
|
+
* @structure USERNAME_RE · fillTemplate · cleanSignupParam · showSignupNoticeModal ·
|
|
10
|
+
* showGoogleSignupModal · maybeShowGoogleSignup.
|
|
11
|
+
* @usage import { maybeShowGoogleSignup } from './signup.js'; (boot calls it on load)
|
|
12
|
+
* @version-history
|
|
13
|
+
* v1.0.0 — 2026-07-19 — Extracted from src/routes/libs/auth-lib-part3.ts (SDK-libs migration Phase 3).
|
|
14
|
+
*/
|
|
15
|
+
import { api } from './session.js';
|
|
16
|
+
import { escHtml } from './theme.js';
|
|
17
|
+
import { currentModalLang, loadModalI18n } from './i18n.js';
|
|
18
|
+
import { NODE_URL } from './config.js';
|
|
19
|
+
import { showLoginModal } from './modal.js';
|
|
20
|
+
|
|
21
|
+
var USERNAME_RE = new RegExp('^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$');
|
|
22
|
+
|
|
23
|
+
function fillTemplate(str, vars) {
|
|
24
|
+
return String(str || '').replace(/\{(\w+)\}/g, function (_, k) { return vars[k] != null ? vars[k] : ''; });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Drop ?aimeat_signup=1 from the address bar so a reload doesn't re-open the modal.
|
|
28
|
+
function cleanSignupParam() {
|
|
29
|
+
try {
|
|
30
|
+
var url = new URL(location.href);
|
|
31
|
+
if (!url.searchParams.has('aimeat_signup')) return;
|
|
32
|
+
url.searchParams.delete('aimeat_signup');
|
|
33
|
+
history.replaceState(null, '', url.pathname + (url.search ? url.search : '') + url.hash);
|
|
34
|
+
} catch { /* URL/history unavailable */ }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Minimal notice modal sharing the signup modal's chrome — used when the username-choice step is
|
|
38
|
+
// replaced by an explanation (existing unverified-email account; expired pending sign-up).
|
|
39
|
+
function showSignupNoticeModal(i, opts) {
|
|
40
|
+
var old = document.getElementById('aimeat-modal');
|
|
41
|
+
if (old) old.remove();
|
|
42
|
+
var modal = document.createElement('div');
|
|
43
|
+
modal.id = 'aimeat-modal';
|
|
44
|
+
document.body.appendChild(modal);
|
|
45
|
+
modal.innerHTML = '<style>'
|
|
46
|
+
+ '.aimeat-go{flex:1;padding:12px;background:linear-gradient(135deg,#E8564A,#D4493F);color:#fff;border:none;border-radius:10px;cursor:pointer;font-weight:700;font-size:15px;font-family:DM Sans,system-ui,sans-serif;box-shadow:0 2px 8px rgba(232,86,74,.25);transition:transform .15s,box-shadow .15s}'
|
|
47
|
+
+ '.aimeat-cancel{padding:12px 20px;background:none;color:#1A1A2E;border:1px solid #E5E7EB;border-radius:10px;cursor:pointer;font-size:15px;font-weight:500;font-family:DM Sans,system-ui,sans-serif;transition:background .15s}'
|
|
48
|
+
+ '.aimeat-cancel:hover{background:#F3F4F6}'
|
|
49
|
+
+ '</style>'
|
|
50
|
+
+ '<div style="position:fixed;inset:0;background:rgba(26,26,46,.4);backdrop-filter:blur(8px);display:flex;align-items:flex-start;justify-content:center;overflow-y:auto;z-index:99999;font-family:DM Sans,system-ui,sans-serif;padding:24px">'
|
|
51
|
+
+ '<div style="background:#FFFFFF;border-radius:16px;max-width:440px;width:100%;margin:auto;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.15),0 0 0 1px rgba(0,0,0,.05)">'
|
|
52
|
+
+ '<div style="padding:28px 32px 24px">'
|
|
53
|
+
+ '<h2 style="margin:0 0 8px;font-size:21px;font-weight:800;color:#1A1A2E">' + escHtml(opts.title || '') + '</h2>'
|
|
54
|
+
+ '<p style="margin:0 0 18px;font-size:14px;color:#6B7280;line-height:1.55">' + escHtml(opts.body || '') + '</p>'
|
|
55
|
+
+ '<div style="display:flex;gap:10px">'
|
|
56
|
+
+ '<button id="aimeat-sn-primary" class="aimeat-go">' + escHtml(opts.primaryLabel || 'OK') + '</button>'
|
|
57
|
+
+ (opts.showCancel ? '<button id="aimeat-sn-cancel" class="aimeat-cancel">' + escHtml(i.signupCancelBtn || 'Cancel') + '</button>' : '')
|
|
58
|
+
+ '</div>'
|
|
59
|
+
+ '</div></div></div>';
|
|
60
|
+
function close() { modal.remove(); cleanSignupParam(); }
|
|
61
|
+
document.getElementById('aimeat-sn-primary').addEventListener('click', function () {
|
|
62
|
+
close();
|
|
63
|
+
if (opts.onPrimary) opts.onPrimary();
|
|
64
|
+
});
|
|
65
|
+
var cancelEl = document.getElementById('aimeat-sn-cancel');
|
|
66
|
+
if (cancelEl) cancelEl.addEventListener('click', close);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function showGoogleSignupModal(pending, i) {
|
|
70
|
+
i = i || {};
|
|
71
|
+
|
|
72
|
+
// An account already claims this email but never verified it — explain the one-time password
|
|
73
|
+
// sign-in path instead of dead-ending at "username taken".
|
|
74
|
+
if (pending && pending.mode === 'link_existing') {
|
|
75
|
+
var hint = pending.existing_hint
|
|
76
|
+
? ' ' + fillTemplate(i.signupLinkHint || '(Username hint: {hint}.)', { hint: pending.existing_hint })
|
|
77
|
+
: '';
|
|
78
|
+
showSignupNoticeModal(i, {
|
|
79
|
+
title: i.signupLinkTitle || 'This email already has an account',
|
|
80
|
+
body: fillTemplate(i.signupLinkIntro || 'An AIMEAT account already uses {email}, but its email has not been verified yet. Sign in with your username and password once — that verifies your email, and after that this sign-in connects to your account automatically.', { email: pending.email || '' }) + hint,
|
|
81
|
+
primaryLabel: i.signupLinkSignInBtn || 'Sign in with password',
|
|
82
|
+
showCancel: true,
|
|
83
|
+
onPrimary: function () { showLoginModal({ i18n: i }, function () {}); },
|
|
84
|
+
});
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
var old = document.getElementById('aimeat-modal');
|
|
89
|
+
if (old) old.remove();
|
|
90
|
+
var modal = document.createElement('div');
|
|
91
|
+
modal.id = 'aimeat-modal';
|
|
92
|
+
document.body.appendChild(modal);
|
|
93
|
+
|
|
94
|
+
var emailNote = pending.email
|
|
95
|
+
? '<p style="margin:0 0 14px;font-size:13px;color:#6B7280">' + escHtml(fillTemplate(i.signupEmailNote || 'Signing up as {email}', { email: pending.email })) + '</p>'
|
|
96
|
+
: '';
|
|
97
|
+
|
|
98
|
+
modal.innerHTML = '<style>'
|
|
99
|
+
+ '.aimeat-inp{width:100%;padding:11px 14px;border:1.5px solid #E5E7EB;border-radius:10px;font-family:DM Sans,system-ui,sans-serif;font-size:15px;color:#1A1A2E;background:#FAFAF8;box-sizing:border-box;transition:all .15s;outline:none}'
|
|
100
|
+
+ '.aimeat-inp:focus{border-color:#E8564A;box-shadow:0 0 0 3px rgba(232,86,74,.1)}'
|
|
101
|
+
+ '.aimeat-go{flex:1;padding:12px;background:linear-gradient(135deg,#E8564A,#D4493F);color:#fff;border:none;border-radius:10px;cursor:pointer;font-weight:700;font-size:15px;font-family:DM Sans,system-ui,sans-serif;box-shadow:0 2px 8px rgba(232,86,74,.25);transition:transform .15s,box-shadow .15s}'
|
|
102
|
+
+ '.aimeat-go:disabled{opacity:.55;cursor:not-allowed;box-shadow:none}'
|
|
103
|
+
+ '.aimeat-label{display:block;margin-bottom:5px;font-size:12px;font-weight:600;letter-spacing:.5px;text-transform:uppercase;color:#6B7280}'
|
|
104
|
+
+ '.aimeat-cancel{padding:12px 20px;background:none;color:#1A1A2E;border:1px solid #E5E7EB;border-radius:10px;cursor:pointer;font-size:15px;font-weight:500;font-family:DM Sans,system-ui,sans-serif;transition:background .15s}'
|
|
105
|
+
+ '.aimeat-cancel:hover{background:#F3F4F6}'
|
|
106
|
+
+ '</style>'
|
|
107
|
+
+ '<div style="position:fixed;inset:0;background:rgba(26,26,46,.4);backdrop-filter:blur(8px);display:flex;align-items:flex-start;justify-content:center;overflow-y:auto;z-index:99999;font-family:DM Sans,system-ui,sans-serif;padding:24px">'
|
|
108
|
+
+ '<div style="background:#FFFFFF;border-radius:16px;max-width:440px;width:100%;margin:auto;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.15),0 0 0 1px rgba(0,0,0,.05)">'
|
|
109
|
+
+ '<div style="padding:28px 32px 24px">'
|
|
110
|
+
+ '<h2 style="margin:0 0 8px;font-size:21px;font-weight:800;color:#1A1A2E">' + escHtml(i.signupTitle || 'Choose your username') + '</h2>'
|
|
111
|
+
+ '<p style="margin:0 0 6px;font-size:14px;color:#6B7280;line-height:1.5">' + escHtml(i.signupIntro || "You're signing in for the first time. Pick the username for your AIMEAT account.") + '</p>'
|
|
112
|
+
+ emailNote
|
|
113
|
+
+ '<label class="aimeat-label" for="aimeat-su-name">' + escHtml(i.signupUsernameLabel || 'Username') + '</label>'
|
|
114
|
+
+ '<input id="aimeat-su-name" class="aimeat-inp" autocomplete="off" autocapitalize="none" spellcheck="false" value="' + escHtml(pending.suggested || '') + '">'
|
|
115
|
+
+ '<p id="aimeat-su-status" style="margin:6px 0 0;font-size:13px;min-height:18px"></p>'
|
|
116
|
+
+ '<p style="margin:8px 0 0;font-size:12px;color:#9CA3AF;line-height:1.45">' + escHtml(i.signupSuggestedHint || 'We suggested one from your account — change it to anything you like.') + '</p>'
|
|
117
|
+
+ '<div style="margin:16px 0 0;padding:12px 14px;background:#FFF7ED;border:1px solid #FED7AA;border-radius:10px;font-size:13px;color:#9A3412;line-height:1.5">' + escHtml(i.signupPermanentWarning || 'This username is permanent. It identifies you across AIMEAT and cannot be changed later — the only way to change it is to delete your account and create a new one.') + '</div>'
|
|
118
|
+
+ '<label class="aimeat-label" for="aimeat-su-display" style="margin-top:16px">' + escHtml(i.signupDisplayNameLabel || 'Display name') + '</label>'
|
|
119
|
+
+ '<input id="aimeat-su-display" class="aimeat-inp" autocomplete="off" maxlength="80" value="' + escHtml(pending.displayName || '') + '">'
|
|
120
|
+
+ '<p style="margin:6px 0 0;font-size:12px;color:#9CA3AF;line-height:1.45">' + escHtml(i.signupDisplayNameHint || 'Shown to others — not permanent, you can change it anytime later.') + '</p>'
|
|
121
|
+
+ '<div style="display:flex;gap:10px;margin-top:20px">'
|
|
122
|
+
+ '<button id="aimeat-su-create" class="aimeat-go">' + escHtml(i.signupCreateBtn || 'Create my account') + '</button>'
|
|
123
|
+
+ '<button id="aimeat-su-cancel" class="aimeat-cancel">' + escHtml(i.signupCancelBtn || 'Cancel') + '</button>'
|
|
124
|
+
+ '</div>'
|
|
125
|
+
+ '<p id="aimeat-su-err" style="margin:10px 0 0;font-size:13px;color:#ef4444;display:none"></p>'
|
|
126
|
+
+ '</div></div></div>';
|
|
127
|
+
|
|
128
|
+
var input = /** @type {any} */ (document.getElementById('aimeat-su-name'));
|
|
129
|
+
var statusEl = document.getElementById('aimeat-su-status');
|
|
130
|
+
var createBtn = /** @type {any} */ (document.getElementById('aimeat-su-create'));
|
|
131
|
+
var cancelBtn = document.getElementById('aimeat-su-cancel');
|
|
132
|
+
var errEl = document.getElementById('aimeat-su-err');
|
|
133
|
+
var checkTimer = null;
|
|
134
|
+
var lastChecked = '';
|
|
135
|
+
|
|
136
|
+
function setStatus(text, color) {
|
|
137
|
+
statusEl.textContent = text || '';
|
|
138
|
+
statusEl.style.color = color || '#6B7280';
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Validate format locally, then confirm availability against the node (debounced).
|
|
142
|
+
function evaluate() {
|
|
143
|
+
errEl.style.display = 'none';
|
|
144
|
+
var name = (input.value || '').trim().toLowerCase();
|
|
145
|
+
if (!USERNAME_RE.test(name)) {
|
|
146
|
+
createBtn.disabled = true;
|
|
147
|
+
setStatus(i.signupInvalid || 'Username must be 3–64 characters: lowercase letters, numbers and hyphens.', '#ef4444');
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
createBtn.disabled = true; // until availability confirms
|
|
151
|
+
setStatus('…', '#9CA3AF');
|
|
152
|
+
if (checkTimer) clearTimeout(checkTimer);
|
|
153
|
+
checkTimer = setTimeout(function () {
|
|
154
|
+
lastChecked = name;
|
|
155
|
+
api('/v1/ghii/username-available?name=' + encodeURIComponent(name))
|
|
156
|
+
.then(function (res) {
|
|
157
|
+
var d = res && res.data;
|
|
158
|
+
if (!d || (input.value || '').trim().toLowerCase() !== lastChecked) return; // stale
|
|
159
|
+
if (d.valid && d.available) { createBtn.disabled = false; setStatus(i.signupAvailable || '✓ Available', '#16a34a'); }
|
|
160
|
+
else if (!d.valid) { createBtn.disabled = true; setStatus(i.signupInvalid || d.reason || 'Invalid username', '#ef4444'); }
|
|
161
|
+
else { createBtn.disabled = true; setStatus(i.signupTaken || 'That username is already taken — pick another.', '#ef4444'); }
|
|
162
|
+
})
|
|
163
|
+
.catch(function () { /* network blip — allow submit; finalize re-validates */ createBtn.disabled = false; setStatus('', '#6B7280'); });
|
|
164
|
+
}, 350);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
input.addEventListener('input', evaluate);
|
|
168
|
+
input.addEventListener('keydown', function (e) { if (e.key === 'Enter' && !createBtn.disabled) { e.preventDefault(); createBtn.click(); } });
|
|
169
|
+
|
|
170
|
+
function close() { if (checkTimer) clearTimeout(checkTimer); modal.remove(); cleanSignupParam(); }
|
|
171
|
+
cancelBtn.addEventListener('click', close);
|
|
172
|
+
|
|
173
|
+
createBtn.addEventListener('click', async function () {
|
|
174
|
+
var name = (input.value || '').trim().toLowerCase();
|
|
175
|
+
if (!USERNAME_RE.test(name)) { evaluate(); return; }
|
|
176
|
+
var displayEl = /** @type {any} */ (document.getElementById('aimeat-su-display'));
|
|
177
|
+
var displayName = displayEl ? (displayEl.value || '').trim() : '';
|
|
178
|
+
createBtn.disabled = true;
|
|
179
|
+
createBtn.textContent = i.signupCreating || 'Creating account...';
|
|
180
|
+
errEl.style.display = 'none';
|
|
181
|
+
try {
|
|
182
|
+
var res = await api('/v1/ghii/login/' + (pending.provider || 'google') + '/finalize', {
|
|
183
|
+
method: 'POST',
|
|
184
|
+
credentials: 'include',
|
|
185
|
+
body: JSON.stringify({ username: name, displayName: displayName }),
|
|
186
|
+
});
|
|
187
|
+
cleanSignupParam();
|
|
188
|
+
var redirect = (res && res.data && res.data.redirect) || pending.redirect || '/';
|
|
189
|
+
// Full navigation to the post-login target — the page boots logged-in from the new refresh cookie.
|
|
190
|
+
location.href = NODE_URL + redirect;
|
|
191
|
+
} catch (e) {
|
|
192
|
+
var msg = e && e.message ? e.message : 'Could not create account';
|
|
193
|
+
if (msg.indexOf('already registered') >= 0 || msg.indexOf('NAME_TAKEN') >= 0) msg = i.signupTaken || msg;
|
|
194
|
+
errEl.textContent = msg;
|
|
195
|
+
errEl.style.display = 'block';
|
|
196
|
+
createBtn.textContent = i.signupCreateBtn || 'Create my account';
|
|
197
|
+
evaluate();
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// Confirm the pre-filled suggestion's availability on open.
|
|
202
|
+
evaluate();
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// On load, if the OIDC callback flagged a pending sign-up, fetch it and prompt. If the signed cookie
|
|
206
|
+
// is missing/expired the pending fetch 404s — explain that (retry, no password needed) instead of
|
|
207
|
+
// doing nothing.
|
|
208
|
+
export function maybeShowGoogleSignup() {
|
|
209
|
+
var params;
|
|
210
|
+
try { params = new URLSearchParams(location.search); } catch { return; }
|
|
211
|
+
if (params.get('aimeat_signup') !== '1') return;
|
|
212
|
+
function showExpired() {
|
|
213
|
+
function open(i) {
|
|
214
|
+
showSignupNoticeModal(i || {}, {
|
|
215
|
+
title: (i && i.signupExpiredTitle) || 'Sign-in session expired',
|
|
216
|
+
body: (i && i.signupExpiredBody) || 'Your sign-in session expired or was interrupted. No password is needed — just click “Continue with Google” again to restart.',
|
|
217
|
+
primaryLabel: (i && i.signupExpiredOkBtn) || 'OK',
|
|
218
|
+
showCancel: false,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
loadModalI18n(currentModalLang()).then(open).catch(function () { open({}); });
|
|
222
|
+
}
|
|
223
|
+
api('/v1/ghii/login/pending', { credentials: 'include' })
|
|
224
|
+
.then(function (res) {
|
|
225
|
+
var pending = res && res.data;
|
|
226
|
+
if (!pending) { showExpired(); return; }
|
|
227
|
+
loadModalI18n(currentModalLang())
|
|
228
|
+
.then(function (i) { showGoogleSignupModal(pending, i || {}); })
|
|
229
|
+
.catch(function () { showGoogleSignupModal(pending, {}); });
|
|
230
|
+
})
|
|
231
|
+
.catch(function () { showExpired(); });
|
|
232
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file auth/theme.js
|
|
3
|
+
* @description aimeat-auth presentation helpers (SDK-libs migration Phase 3): the light/dark theme
|
|
4
|
+
* toggle that travels INSIDE the login pill (so every embedding app inherits it for free — reads/
|
|
5
|
+
* writes the same 'aimeat-theme' localStorage key + <html data-theme> the SPA uses, and fires an
|
|
6
|
+
* 'aimeat-theme-change' window event), plus escHtml, the compact-pill CSS injector, and the
|
|
7
|
+
* two-letter pill initials. Extracted from auth-lib-part2.ts.
|
|
8
|
+
* @structure escHtml · aimeatReadTheme/aimeatApplyTheme · modeSwitchHtml/wireModeSwitch ·
|
|
9
|
+
* ensureAuthPillStyles · pillInitials.
|
|
10
|
+
* @usage import { escHtml, modeSwitchHtml, wireModeSwitch } from './theme.js';
|
|
11
|
+
* @version-history
|
|
12
|
+
* v1.2.0 — 2026-07-26 — ?mode= is read first and applied at parse time (aimeatRestoreMode), the
|
|
13
|
+
* same door ?palette= and ?lang= use, so an embedded app follows the embedding page's light/
|
|
14
|
+
* dark instead of its own origin's storage. Not persisted.
|
|
15
|
+
* v1.1.0 — 2026-07-25 — The lone ☾/☀ toggle becomes a segmented ☀|☾ mode switch (both options
|
|
16
|
+
* visible, active marked), styled by cluster.js instead of inline styles.
|
|
17
|
+
* v1.0.0 — 2026-07-19 — Extracted from src/routes/libs/auth-lib-part2.ts (SDK-libs migration Phase 3).
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export function escHtml(s) { const d = document.createElement('div'); d.textContent = s; return d.innerHTML; }
|
|
21
|
+
|
|
22
|
+
// ── Theme toggle (travels with the login pill) ──
|
|
23
|
+
var AIMEAT_THEME_KEY = 'aimeat-theme';
|
|
24
|
+
|
|
25
|
+
export function aimeatReadTheme() {
|
|
26
|
+
// ?mode= first, the same door ?palette= and ?lang= use: an app embedded by another page cannot
|
|
27
|
+
// read the choice made on the embedder's origin, so the embedder says it and the app follows.
|
|
28
|
+
// Deliberately not persisted — being embedded in a dark page is not a decision about the app.
|
|
29
|
+
try {
|
|
30
|
+
var u = new URLSearchParams(location.search).get('mode');
|
|
31
|
+
if (u === 'light' || u === 'dark') return u;
|
|
32
|
+
} catch { /* no location */ }
|
|
33
|
+
try { var s = localStorage.getItem(AIMEAT_THEME_KEY); if (s === 'light' || s === 'dark') return s; } catch { /* storage blocked */ }
|
|
34
|
+
var attr = document.documentElement.dataset.theme;
|
|
35
|
+
if (attr === 'light' || attr === 'dark') return attr;
|
|
36
|
+
return (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) ? 'dark' : 'light';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function aimeatApplyTheme(t) {
|
|
40
|
+
document.documentElement.dataset.theme = t;
|
|
41
|
+
try { localStorage.setItem(AIMEAT_THEME_KEY, t); } catch { /* storage blocked */ }
|
|
42
|
+
try { window.dispatchEvent(new CustomEvent('aimeat-theme-change', { detail: { theme: t } })); } catch { /* no window */ }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Adopt an embedder's ?mode= onto <html> at parse time, without persisting it. The app's own
|
|
47
|
+
* light/dark snippet reads localStorage and cannot know it is inside someone else's page; this
|
|
48
|
+
* runs after it and lets the embedding page win for as long as the embed lasts. No URL param
|
|
49
|
+
* means no opinion, so a normally-opened app is untouched.
|
|
50
|
+
*/
|
|
51
|
+
export function aimeatRestoreMode() {
|
|
52
|
+
try {
|
|
53
|
+
var u = new URLSearchParams(location.search).get('mode');
|
|
54
|
+
if (u === 'light' || u === 'dark') document.documentElement.dataset.theme = u;
|
|
55
|
+
} catch { /* no location */ }
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The MODE control: a segmented ☀ | ☾ where both options are visible and the active one is
|
|
60
|
+
* marked — the same pattern as the language switch, so the cluster reads as one instrument.
|
|
61
|
+
* Cluster classes come from cluster.js (ensureClusterStyles).
|
|
62
|
+
*/
|
|
63
|
+
export function modeSwitchHtml(i) {
|
|
64
|
+
var cur = aimeatReadTheme();
|
|
65
|
+
var light = i.lightMode || 'Light mode';
|
|
66
|
+
var dark = i.darkMode || 'Dark mode';
|
|
67
|
+
return '<span id="aimeat-mode-switch" class="aimeat-seg" role="group" aria-label="' + escHtml(i.themeLabel || 'Theme') + '">'
|
|
68
|
+
+ '<button type="button" data-mode="light" aria-pressed="' + (cur === 'light') + '" title="' + escHtml(light) + '" aria-label="' + escHtml(light) + '">'
|
|
69
|
+
+ '<span class="seg-ico" aria-hidden="true">☀</span></button>'
|
|
70
|
+
+ '<button type="button" data-mode="dark" aria-pressed="' + (cur === 'dark') + '" title="' + escHtml(dark) + '" aria-label="' + escHtml(dark) + '">'
|
|
71
|
+
+ '<span class="seg-ico" aria-hidden="true">☾</span></button>'
|
|
72
|
+
+ '</span>';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function wireModeSwitch(container) {
|
|
76
|
+
var root = container.querySelector('#aimeat-mode-switch');
|
|
77
|
+
if (!root) return;
|
|
78
|
+
function sync(cur) {
|
|
79
|
+
root.querySelectorAll('button[data-mode]').forEach(function (b) {
|
|
80
|
+
b.setAttribute('aria-pressed', String(b.getAttribute('data-mode') === cur));
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
root.querySelectorAll('button[data-mode]').forEach(function (b) {
|
|
84
|
+
b.addEventListener('click', function () {
|
|
85
|
+
var m = b.getAttribute('data-mode');
|
|
86
|
+
aimeatApplyTheme(m);
|
|
87
|
+
sync(m);
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
// Follow out-of-band changes (the app's own logic, another control instance, the SPA).
|
|
91
|
+
window.addEventListener('aimeat-theme-change', function (ev) {
|
|
92
|
+
var e = /** @type {CustomEvent} */ (ev);
|
|
93
|
+
if (e && e.detail && e.detail.theme) sync(e.detail.theme);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// ── Compact login pill styles (default ON on app origins) ──
|
|
98
|
+
// On viewports ≤600px the full gold pill is replaced by a small gold "account" button (green dot +
|
|
99
|
+
// initials + caret); tapping it opens the full pill as an anchored popover. Styles are injected once;
|
|
100
|
+
// the show/hide is pure CSS media so it reflows on rotation.
|
|
101
|
+
export function ensureAuthPillStyles() {
|
|
102
|
+
if (document.getElementById('aimeat-auth-pill-css')) return;
|
|
103
|
+
var st = document.createElement('style');
|
|
104
|
+
st.id = 'aimeat-auth-pill-css';
|
|
105
|
+
st.textContent = [
|
|
106
|
+
'.aimeat-auth-wrap{position:relative;display:inline-flex;align-items:center}',
|
|
107
|
+
'.aimeat-auth-compact{display:none;align-items:center;gap:7px;padding:5px 11px 5px 9px;cursor:pointer;',
|
|
108
|
+
'background:linear-gradient(160deg,#3d2e1a 0%,#6b4c2a 15%,#c9a84c 30%,#f5e6a3 45%,#c9a84c 55%,#8b6914 70%,#4a3520 100%);',
|
|
109
|
+
'border:1px solid rgba(201,168,76,.6);border-top-color:rgba(245,230,163,.5);border-bottom-color:rgba(75,53,32,.8);',
|
|
110
|
+
'border-radius:10px;box-shadow:0 1px 0 rgba(245,230,163,.3) inset,0 -1px 0 rgba(75,53,32,.5) inset,0 3px 10px rgba(0,0,0,.4);',
|
|
111
|
+
'font-family:system-ui;font-size:13px;color:#2a1800;text-shadow:0 1px 0 rgba(245,230,163,.5)}',
|
|
112
|
+
'.aimeat-auth-compact .cdot{width:8px;height:8px;border-radius:50%;flex:0 0 auto;',
|
|
113
|
+
'background:radial-gradient(circle at 35% 35%,#b0ffc8,#00c853 40%,#00802e 80%,#003d15);box-shadow:0 0 5px rgba(0,200,83,.6)}',
|
|
114
|
+
'.aimeat-auth-compact .cini{font-weight:800;letter-spacing:.3px;max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
115
|
+
'.aimeat-auth-compact .ccar{font-size:9px;opacity:.75;transition:transform .18s}',
|
|
116
|
+
'.aimeat-auth-wrap.aimeat-open .aimeat-auth-compact .ccar{transform:rotate(180deg)}',
|
|
117
|
+
'@media (max-width:600px){',
|
|
118
|
+
'.aimeat-auth-compact{display:inline-flex}',
|
|
119
|
+
'.aimeat-auth-wrap>.aimeat-auth-pill{position:absolute;top:calc(100% + 8px);right:0;z-index:1000;',
|
|
120
|
+
'display:none!important;flex-wrap:wrap!important;justify-content:flex-start;row-gap:9px;',
|
|
121
|
+
'min-width:210px;max-width:calc(100vw - 24px)}',
|
|
122
|
+
'.aimeat-auth-wrap.aimeat-open>.aimeat-auth-pill{display:flex!important}',
|
|
123
|
+
'}',
|
|
124
|
+
].join('');
|
|
125
|
+
(document.head || document.documentElement).appendChild(st);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Two-letter initials for the compact button, from a display name / GHII / owner (strips the
|
|
129
|
+
// @node and #owner suffixes so a GAII/GHII shows the person, not the node).
|
|
130
|
+
export function pillInitials(s) {
|
|
131
|
+
s = (s || '').trim();
|
|
132
|
+
if (!s) return '•'; // bullet fallback
|
|
133
|
+
s = s.split('@')[0].split('#')[0].trim();
|
|
134
|
+
var parts = s.split(/\s+/).filter(Boolean);
|
|
135
|
+
if (parts.length >= 2) return (parts[0].charAt(0) + parts[1].charAt(0)).toUpperCase();
|
|
136
|
+
return s.slice(0, 2).toUpperCase();
|
|
137
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file capabilities/index.js
|
|
3
|
+
* @description The aimeat-capabilities library (SDK-libs migration Phase 1). Exposes
|
|
4
|
+
* AIMEAT.capabilities — discovery (list/search/get), invocation (client-side cortex + server-side
|
|
5
|
+
* /v1/capabilities/:id/invoke), management (create/update/delete/mine), testing and vouching, all
|
|
6
|
+
* over the AIMEAT.auth session. Componentized ESM source esbuild bundles to the IIFE served,
|
|
7
|
+
* unchanged, at /v1/libs/aimeat-capabilities.js. Ported verbatim from lib-capabilities.ts.
|
|
8
|
+
* @structure imports getSession/authFetch (session) + attach (namespace); loadCortexLib(); the
|
|
9
|
+
* `capabilities` object; attach('capabilities', …).
|
|
10
|
+
* @usage <script src="/v1/libs/aimeat-auth.js"></script><script src="/v1/libs/aimeat-capabilities.js"></script>
|
|
11
|
+
* await AIMEAT.capabilities.list(); await AIMEAT.capabilities.invoke('id', input);
|
|
12
|
+
* @version-history
|
|
13
|
+
* v1.0.0 — 2026-07-19 — Migrated from src/routes/lib-capabilities.ts (SDK-libs migration Phase 1).
|
|
14
|
+
*/
|
|
15
|
+
import { makeSession } from '../_core/session.js';
|
|
16
|
+
const { getSession, authFetch } = makeSession('aimeat-capabilities.js');
|
|
17
|
+
import { attach } from '../_core/namespace.js';
|
|
18
|
+
|
|
19
|
+
// Cortex library cache (loaded libs stay in memory)
|
|
20
|
+
const _loadedCortex = {};
|
|
21
|
+
|
|
22
|
+
async function loadCortexLib(url) {
|
|
23
|
+
if (_loadedCortex[url]) return;
|
|
24
|
+
return new Promise(function (resolve, reject) {
|
|
25
|
+
var s = document.createElement('script');
|
|
26
|
+
s.src = url;
|
|
27
|
+
s.onload = function () { _loadedCortex[url] = true; resolve(undefined); };
|
|
28
|
+
s.onerror = function () { reject(new Error('Failed to load: ' + url)); };
|
|
29
|
+
document.head.appendChild(s);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const capabilities = {
|
|
34
|
+
|
|
35
|
+
// ── Discovery ──
|
|
36
|
+
|
|
37
|
+
async list(filters) {
|
|
38
|
+
var params = new URLSearchParams();
|
|
39
|
+
if (filters) {
|
|
40
|
+
if (filters.search) params.set('search', filters.search);
|
|
41
|
+
if (filters.tags) params.set('tags', filters.tags.join(','));
|
|
42
|
+
if (filters.callable !== undefined) params.set('callable', String(filters.callable));
|
|
43
|
+
if (filters.authRequired) params.set('authRequired', filters.authRequired);
|
|
44
|
+
if (filters.source_type) params.set('source_type', filters.source_type);
|
|
45
|
+
if (filters.status) params.set('status', filters.status);
|
|
46
|
+
if (filters.page) params.set('page', String(filters.page));
|
|
47
|
+
if (filters.per_page) params.set('per_page', String(filters.per_page));
|
|
48
|
+
}
|
|
49
|
+
var qs = params.toString();
|
|
50
|
+
var res = await authFetch('/v1/capabilities' + (qs ? '?' + qs : ''));
|
|
51
|
+
if (!res.ok) throw new Error(res.error?.message || 'Failed to list capabilities');
|
|
52
|
+
return res.data;
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
async search(query) {
|
|
56
|
+
return capabilities.list({ search: query });
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
async get(id) {
|
|
60
|
+
var res = await authFetch('/v1/capabilities/' + encodeURIComponent(id));
|
|
61
|
+
if (!res.ok) throw new Error(res.error?.message || 'Capability not found');
|
|
62
|
+
return res.data;
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
// ── Invocation ──
|
|
66
|
+
|
|
67
|
+
async invoke(id, input, opts) {
|
|
68
|
+
var cap = await capabilities.get(id);
|
|
69
|
+
var mode = (opts && opts.mode) || 'normal';
|
|
70
|
+
|
|
71
|
+
// Client-side cortex invoke
|
|
72
|
+
if (cap.source && cap.source.type === 'cortex') {
|
|
73
|
+
var usage = cap.usage || '';
|
|
74
|
+
// Try to load the cortex lib
|
|
75
|
+
var libMatch = usage.match(/loadScript\(['"]([^'"]+)['"]/);
|
|
76
|
+
if (libMatch) {
|
|
77
|
+
await loadCortexLib(libMatch[1]);
|
|
78
|
+
}
|
|
79
|
+
// Find the export function
|
|
80
|
+
if (cap.exports && cap.exports.length > 0) {
|
|
81
|
+
// If id contains export name like "cortex:name:funcName"
|
|
82
|
+
var parts = id.split(':');
|
|
83
|
+
var funcName = parts.length >= 3 ? parts[2] : null;
|
|
84
|
+
if (funcName) {
|
|
85
|
+
// Search global scope for the function
|
|
86
|
+
var fn = window[funcName] || (window.AIMEAT && window.AIMEAT[funcName]);
|
|
87
|
+
if (typeof fn === 'function') {
|
|
88
|
+
var start = performance.now();
|
|
89
|
+
var result = await fn(input);
|
|
90
|
+
var duration = Math.round(performance.now() - start);
|
|
91
|
+
// Fire-and-forget telemetry
|
|
92
|
+
try {
|
|
93
|
+
authFetch('/v1/capabilities/' + encodeURIComponent(id) + '/telemetry', {
|
|
94
|
+
method: 'POST',
|
|
95
|
+
body: JSON.stringify({ duration_ms: duration, status: 'success' }),
|
|
96
|
+
}).catch(function () {});
|
|
97
|
+
} catch { /* telemetry is fire-and-forget */ }
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
throw new Error('Cortex capability loaded but export function not found. Use direct loadScript() instead.');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Server-side invoke (extensions, webhooks)
|
|
106
|
+
var res = await authFetch('/v1/capabilities/' + encodeURIComponent(id) + '/invoke' + (mode === 'raw' ? '?mode=raw' : ''), {
|
|
107
|
+
method: 'POST',
|
|
108
|
+
body: JSON.stringify({ input: input || {} }),
|
|
109
|
+
});
|
|
110
|
+
if (!res.ok) throw new Error(res.error?.message || 'Invoke failed');
|
|
111
|
+
return res.data.result !== undefined ? res.data.result : res.data;
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
// ── Management ──
|
|
115
|
+
|
|
116
|
+
async create(record) {
|
|
117
|
+
var res = await authFetch('/v1/capabilities', {
|
|
118
|
+
method: 'POST',
|
|
119
|
+
body: JSON.stringify(record),
|
|
120
|
+
});
|
|
121
|
+
if (!res.ok) throw new Error(res.error?.message || 'Failed to create capability');
|
|
122
|
+
return res.data;
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
async update(id, updates) {
|
|
126
|
+
var res = await authFetch('/v1/capabilities/' + encodeURIComponent(id), {
|
|
127
|
+
method: 'PUT',
|
|
128
|
+
body: JSON.stringify(updates),
|
|
129
|
+
});
|
|
130
|
+
if (!res.ok) throw new Error(res.error?.message || 'Failed to update capability');
|
|
131
|
+
return res.data;
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
async delete(id) {
|
|
135
|
+
var res = await authFetch('/v1/capabilities/' + encodeURIComponent(id), {
|
|
136
|
+
method: 'DELETE',
|
|
137
|
+
});
|
|
138
|
+
if (!res.ok) throw new Error(res.error?.message || 'Failed to delete capability');
|
|
139
|
+
return res.data;
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
async mine() {
|
|
143
|
+
var session = getSession();
|
|
144
|
+
return capabilities.list({ owner: session.ghii || session.owner });
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
// ── Testing ──
|
|
148
|
+
|
|
149
|
+
async test(id, input) {
|
|
150
|
+
var res = await authFetch('/v1/capabilities/' + encodeURIComponent(id) + '/test', {
|
|
151
|
+
method: 'POST',
|
|
152
|
+
body: JSON.stringify({ input: input || {} }),
|
|
153
|
+
});
|
|
154
|
+
if (!res.ok) throw new Error(res.error?.message || 'Test failed');
|
|
155
|
+
return res.data;
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
// ── Vouching ──
|
|
159
|
+
|
|
160
|
+
async vouch(id, comment) {
|
|
161
|
+
var body = comment ? { comment } : {};
|
|
162
|
+
var res = await authFetch('/v1/capabilities/' + encodeURIComponent(id) + '/vouch', {
|
|
163
|
+
method: 'POST',
|
|
164
|
+
body: JSON.stringify(body),
|
|
165
|
+
});
|
|
166
|
+
if (!res.ok) throw new Error(res.error?.message || 'Vouch failed');
|
|
167
|
+
return res.data;
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
async unvouch(id) {
|
|
171
|
+
var res = await authFetch('/v1/capabilities/' + encodeURIComponent(id) + '/vouch', {
|
|
172
|
+
method: 'DELETE',
|
|
173
|
+
});
|
|
174
|
+
if (!res.ok) throw new Error(res.error?.message || 'Unvouch failed');
|
|
175
|
+
return res.data;
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
attach('capabilities', capabilities);
|