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,300 @@
|
|
|
1
|
+
// GENERATED FILE — do not edit directly. Source: src/static/sdk-libs/speech/ (+ _core/).
|
|
2
|
+
// Rebuild: pnpm build:sdk · Served at /v1/libs/aimeat-speech.js (with a per-node config prelude).
|
|
3
|
+
"use strict";
|
|
4
|
+
(() => {
|
|
5
|
+
// src/static/sdk-libs/_core/namespace.js
|
|
6
|
+
function namespace() {
|
|
7
|
+
if (!window.AIMEAT) window.AIMEAT = {};
|
|
8
|
+
return window.AIMEAT;
|
|
9
|
+
}
|
|
10
|
+
function attach(key, value) {
|
|
11
|
+
const ns = namespace();
|
|
12
|
+
ns[key] = value;
|
|
13
|
+
return ns;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// src/static/sdk-libs/speech/index.js
|
|
17
|
+
var _listeners = {};
|
|
18
|
+
function emit(event, data) {
|
|
19
|
+
(_listeners[event] || []).forEach(function(fn) {
|
|
20
|
+
fn(data);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
var _supported = {
|
|
24
|
+
get tts() {
|
|
25
|
+
return typeof window !== "undefined" && "speechSynthesis" in window;
|
|
26
|
+
},
|
|
27
|
+
get stt() {
|
|
28
|
+
return typeof window !== "undefined" && ("SpeechRecognition" in window || "webkitSpeechRecognition" in window);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var _ttsProvider = null;
|
|
32
|
+
var _sttProvider = null;
|
|
33
|
+
var _speaking = false;
|
|
34
|
+
var _ttsQueue = [];
|
|
35
|
+
var _listening = false;
|
|
36
|
+
var _recognition = null;
|
|
37
|
+
var _mediaRecorder = null;
|
|
38
|
+
var _voicesLoaded = false;
|
|
39
|
+
var _voicesList = [];
|
|
40
|
+
function loadVoices() {
|
|
41
|
+
if (!_supported.tts) return [];
|
|
42
|
+
_voicesList = speechSynthesis.getVoices().map(function(v) {
|
|
43
|
+
return { name: v.name, lang: v.lang };
|
|
44
|
+
});
|
|
45
|
+
_voicesLoaded = _voicesList.length > 0;
|
|
46
|
+
return _voicesList;
|
|
47
|
+
}
|
|
48
|
+
if (typeof window !== "undefined" && _supported.tts) {
|
|
49
|
+
speechSynthesis.addEventListener("voiceschanged", loadVoices);
|
|
50
|
+
loadVoices();
|
|
51
|
+
}
|
|
52
|
+
function nativeSay(text, opts) {
|
|
53
|
+
return new Promise(function(resolve) {
|
|
54
|
+
const utt = new SpeechSynthesisUtterance(text);
|
|
55
|
+
if (opts && opts.lang) utt.lang = opts.lang;
|
|
56
|
+
if (opts && opts.rate !== void 0) utt.rate = opts.rate;
|
|
57
|
+
if (opts && opts.pitch !== void 0) utt.pitch = opts.pitch;
|
|
58
|
+
if (opts && opts.volume !== void 0) utt.volume = opts.volume;
|
|
59
|
+
if (opts && opts.voice) {
|
|
60
|
+
const voices = speechSynthesis.getVoices();
|
|
61
|
+
const match = voices.find(function(v) {
|
|
62
|
+
return v.name === opts.voice || v.name.indexOf(opts.voice) >= 0;
|
|
63
|
+
});
|
|
64
|
+
if (match) utt.voice = match;
|
|
65
|
+
}
|
|
66
|
+
utt.onstart = function() {
|
|
67
|
+
emit("start", {});
|
|
68
|
+
};
|
|
69
|
+
utt.onend = function() {
|
|
70
|
+
_speaking = false;
|
|
71
|
+
processQueue();
|
|
72
|
+
emit("end", {});
|
|
73
|
+
resolve(void 0);
|
|
74
|
+
};
|
|
75
|
+
utt.onboundary = function(e) {
|
|
76
|
+
if (e.name === "word") emit("word", { word: text.substr(e.charIndex, e.charLength || 10).split(/\s/)[0], index: e.charIndex });
|
|
77
|
+
};
|
|
78
|
+
utt.onerror = function(e) {
|
|
79
|
+
_speaking = false;
|
|
80
|
+
processQueue();
|
|
81
|
+
emit("error", { error: e.error });
|
|
82
|
+
resolve(void 0);
|
|
83
|
+
};
|
|
84
|
+
_speaking = true;
|
|
85
|
+
speechSynthesis.speak(utt);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function cloudSay(text, opts) {
|
|
89
|
+
if (!_ttsProvider || !_ttsProvider.say) return Promise.resolve();
|
|
90
|
+
_speaking = true;
|
|
91
|
+
emit("start", {});
|
|
92
|
+
return _ttsProvider.say(text, opts || {}).then(function(blob) {
|
|
93
|
+
if (!blob) {
|
|
94
|
+
_speaking = false;
|
|
95
|
+
processQueue();
|
|
96
|
+
emit("end", {});
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const ac = new (window.AudioContext || window.webkitAudioContext)();
|
|
100
|
+
return blob.arrayBuffer().then(function(ab) {
|
|
101
|
+
return ac.decodeAudioData(ab);
|
|
102
|
+
}).then(function(buf) {
|
|
103
|
+
const source = ac.createBufferSource();
|
|
104
|
+
source.buffer = buf;
|
|
105
|
+
source.connect(ac.destination);
|
|
106
|
+
source.onended = function() {
|
|
107
|
+
_speaking = false;
|
|
108
|
+
processQueue();
|
|
109
|
+
emit("end", {});
|
|
110
|
+
};
|
|
111
|
+
source.start();
|
|
112
|
+
});
|
|
113
|
+
}).catch(function(e) {
|
|
114
|
+
_speaking = false;
|
|
115
|
+
processQueue();
|
|
116
|
+
emit("error", { error: e.message });
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function processQueue() {
|
|
120
|
+
if (_ttsQueue.length > 0 && !_speaking) {
|
|
121
|
+
const next = _ttsQueue.shift();
|
|
122
|
+
if (next) doSay(next.text, next.opts);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function doSay(text, opts) {
|
|
126
|
+
if (_ttsProvider) return cloudSay(text, opts);
|
|
127
|
+
if (!_supported.tts) {
|
|
128
|
+
console.warn("[aimeat-speech] TTS not supported in this browser");
|
|
129
|
+
return Promise.resolve();
|
|
130
|
+
}
|
|
131
|
+
return nativeSay(text, opts);
|
|
132
|
+
}
|
|
133
|
+
function nativeListen(opts) {
|
|
134
|
+
return new Promise(function(resolve, reject) {
|
|
135
|
+
const SpeechRecog = window.SpeechRecognition || window.webkitSpeechRecognition;
|
|
136
|
+
if (!SpeechRecog) {
|
|
137
|
+
reject(new Error("SpeechRecognition not supported"));
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
_recognition = new SpeechRecog();
|
|
141
|
+
_recognition.lang = opts && opts.lang || "en-US";
|
|
142
|
+
_recognition.continuous = opts && opts.continuous || false;
|
|
143
|
+
_recognition.interimResults = opts && opts.interimResults || false;
|
|
144
|
+
const commands = opts && opts.commands || null;
|
|
145
|
+
_recognition.onstart = function() {
|
|
146
|
+
_listening = true;
|
|
147
|
+
emit("listening", {});
|
|
148
|
+
};
|
|
149
|
+
_recognition.onresult = function(e) {
|
|
150
|
+
for (let i = e.resultIndex; i < e.results.length; i++) {
|
|
151
|
+
const result = e.results[i];
|
|
152
|
+
const text = result[0].transcript.trim();
|
|
153
|
+
const final = result.isFinal;
|
|
154
|
+
const confidence = result[0].confidence;
|
|
155
|
+
emit("result", { text, final, confidence });
|
|
156
|
+
if (final && commands) matchCommand(text, commands);
|
|
157
|
+
if (final && !_recognition.continuous) {
|
|
158
|
+
resolve({ text, confidence, lang: _recognition.lang });
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
_recognition.onerror = function(e) {
|
|
163
|
+
_listening = false;
|
|
164
|
+
emit("error", { error: e.error });
|
|
165
|
+
if (!_recognition.continuous) reject(new Error(e.error));
|
|
166
|
+
};
|
|
167
|
+
_recognition.onend = function() {
|
|
168
|
+
_listening = false;
|
|
169
|
+
emit("stopped", {});
|
|
170
|
+
if (opts && opts.continuous && _recognition) {
|
|
171
|
+
try {
|
|
172
|
+
_recognition.start();
|
|
173
|
+
} catch {
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
_recognition.start();
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function cloudListen(opts) {
|
|
181
|
+
if (!_sttProvider || !_sttProvider.listen) return Promise.reject(new Error("No STT provider configured"));
|
|
182
|
+
return navigator.mediaDevices.getUserMedia({ audio: true }).then(function(stream) {
|
|
183
|
+
return new Promise(function(resolve, reject) {
|
|
184
|
+
const chunks = [];
|
|
185
|
+
_mediaRecorder = new MediaRecorder(stream, { mimeType: "audio/webm" });
|
|
186
|
+
_listening = true;
|
|
187
|
+
emit("listening", {});
|
|
188
|
+
_mediaRecorder.ondataavailable = function(e) {
|
|
189
|
+
if (e.data.size > 0) chunks.push(e.data);
|
|
190
|
+
};
|
|
191
|
+
_mediaRecorder.onstop = function() {
|
|
192
|
+
_listening = false;
|
|
193
|
+
stream.getTracks().forEach(function(t) {
|
|
194
|
+
t.stop();
|
|
195
|
+
});
|
|
196
|
+
emit("stopped", {});
|
|
197
|
+
const blob = new Blob(chunks, { type: "audio/webm" });
|
|
198
|
+
_sttProvider.listen(blob, opts || {}).then(function(result) {
|
|
199
|
+
const text = typeof result === "string" ? result : result.text || result.transcript || "";
|
|
200
|
+
const confidence = typeof result === "object" ? result.confidence || 1 : 1;
|
|
201
|
+
emit("result", { text, final: true, confidence });
|
|
202
|
+
resolve({ text, confidence, lang: opts && opts.lang || "en-US" });
|
|
203
|
+
}).catch(function(e) {
|
|
204
|
+
emit("error", { error: e.message });
|
|
205
|
+
reject(e);
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
_mediaRecorder.start();
|
|
209
|
+
if (!(opts && opts.continuous)) {
|
|
210
|
+
setTimeout(function() {
|
|
211
|
+
if (_mediaRecorder && _mediaRecorder.state === "recording") _mediaRecorder.stop();
|
|
212
|
+
}, opts && opts.timeout || 5e3);
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
function matchCommand(text, commands) {
|
|
218
|
+
const lower = text.toLowerCase();
|
|
219
|
+
Object.keys(commands).forEach(function(pattern) {
|
|
220
|
+
const parts = pattern.toLowerCase().split(/\s+/);
|
|
221
|
+
const regex = "^" + parts.map(function(p) {
|
|
222
|
+
if (p.startsWith("*")) return "(.+)";
|
|
223
|
+
return p.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
224
|
+
}).join("\\s+") + "$";
|
|
225
|
+
const match = lower.match(new RegExp(regex));
|
|
226
|
+
if (match) {
|
|
227
|
+
const captures = match.slice(1);
|
|
228
|
+
commands[pattern].apply(null, captures);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
var speech = {
|
|
233
|
+
say: function(text, opts) {
|
|
234
|
+
if (_speaking) {
|
|
235
|
+
_ttsQueue.push({ text, opts });
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
return doSay(text, opts);
|
|
239
|
+
},
|
|
240
|
+
stop: function() {
|
|
241
|
+
if (_supported.tts) speechSynthesis.cancel();
|
|
242
|
+
_speaking = false;
|
|
243
|
+
_ttsQueue = [];
|
|
244
|
+
},
|
|
245
|
+
get speaking() {
|
|
246
|
+
return _speaking;
|
|
247
|
+
},
|
|
248
|
+
voices: function(opts) {
|
|
249
|
+
if (!_voicesLoaded) loadVoices();
|
|
250
|
+
if (opts && opts.lang) {
|
|
251
|
+
const lang = opts.lang.toLowerCase();
|
|
252
|
+
return _voicesList.filter(function(v) {
|
|
253
|
+
return v.lang.toLowerCase().startsWith(lang);
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
return _voicesList;
|
|
257
|
+
},
|
|
258
|
+
listen: function(opts) {
|
|
259
|
+
if (_sttProvider) return cloudListen(opts);
|
|
260
|
+
return nativeListen(opts);
|
|
261
|
+
},
|
|
262
|
+
stopListening: function() {
|
|
263
|
+
if (_recognition) {
|
|
264
|
+
_recognition.continuous = false;
|
|
265
|
+
try {
|
|
266
|
+
_recognition.stop();
|
|
267
|
+
} catch {
|
|
268
|
+
}
|
|
269
|
+
_recognition = null;
|
|
270
|
+
}
|
|
271
|
+
if (_mediaRecorder && _mediaRecorder.state === "recording") {
|
|
272
|
+
_mediaRecorder.stop();
|
|
273
|
+
_mediaRecorder = null;
|
|
274
|
+
}
|
|
275
|
+
_listening = false;
|
|
276
|
+
},
|
|
277
|
+
get listening() {
|
|
278
|
+
return _listening;
|
|
279
|
+
},
|
|
280
|
+
get supported() {
|
|
281
|
+
return _supported;
|
|
282
|
+
},
|
|
283
|
+
use: function(type, provider) {
|
|
284
|
+
if (type === "tts") _ttsProvider = provider;
|
|
285
|
+
else if (type === "stt") _sttProvider = provider;
|
|
286
|
+
else console.warn("[aimeat-speech] Unknown provider type:", type);
|
|
287
|
+
},
|
|
288
|
+
on: function(event, fn) {
|
|
289
|
+
if (!_listeners[event]) _listeners[event] = [];
|
|
290
|
+
_listeners[event].push(fn);
|
|
291
|
+
},
|
|
292
|
+
off: function(event, fn) {
|
|
293
|
+
if (!_listeners[event]) return;
|
|
294
|
+
_listeners[event] = _listeners[event].filter(function(f) {
|
|
295
|
+
return f !== fn;
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
attach("speech", speech);
|
|
300
|
+
})();
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
// GENERATED FILE — do not edit directly. Source: src/static/sdk-libs/storage/ (+ _core/).
|
|
2
|
+
// Rebuild: pnpm build:sdk · Served at /v1/libs/aimeat-storage.js (with a per-node config prelude).
|
|
3
|
+
"use strict";
|
|
4
|
+
(() => {
|
|
5
|
+
// src/static/sdk-libs/_core/config.js
|
|
6
|
+
function cfg() {
|
|
7
|
+
return window.__AIMEAT_SDK_CFG__ || { nodeId: "", baseUrl: "" };
|
|
8
|
+
}
|
|
9
|
+
function resolveNodeUrl() {
|
|
10
|
+
const meta = document.querySelector('meta[name="aimeat-node"]');
|
|
11
|
+
if (meta) return (meta.getAttribute("content") || "").replace(/\/$/, "");
|
|
12
|
+
if (location.protocol === "http:" || location.protocol === "https:") return location.origin;
|
|
13
|
+
return cfg().baseUrl;
|
|
14
|
+
}
|
|
15
|
+
var NODE_URL = resolveNodeUrl();
|
|
16
|
+
var APEX_URL = cfg().baseUrl;
|
|
17
|
+
var NODE_ID = cfg().nodeId;
|
|
18
|
+
var HEARTBEAT_MS = cfg().heartbeatMs || 3e4;
|
|
19
|
+
|
|
20
|
+
// src/static/sdk-libs/_core/session.js
|
|
21
|
+
function getSession(libLabel) {
|
|
22
|
+
const auth = window.AIMEAT && window.AIMEAT.auth;
|
|
23
|
+
if (!auth) {
|
|
24
|
+
throw new Error("AIMEAT.auth is required. Include aimeat-auth.js before " + (libLabel || "this library"));
|
|
25
|
+
}
|
|
26
|
+
const s = auth.getSession();
|
|
27
|
+
if (!s) throw new Error("Not logged in. Call AIMEAT.auth.login() first.");
|
|
28
|
+
return s;
|
|
29
|
+
}
|
|
30
|
+
function authFetch(path, opts, libLabel) {
|
|
31
|
+
return getSession(libLabel).fetch(path, opts);
|
|
32
|
+
}
|
|
33
|
+
function makeSession(libLabel) {
|
|
34
|
+
return {
|
|
35
|
+
getSession: () => getSession(libLabel),
|
|
36
|
+
authFetch: (path, opts) => authFetch(path, opts, libLabel)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// src/static/sdk-libs/_core/namespace.js
|
|
41
|
+
function namespace() {
|
|
42
|
+
if (!window.AIMEAT) window.AIMEAT = {};
|
|
43
|
+
return window.AIMEAT;
|
|
44
|
+
}
|
|
45
|
+
function attach(key, value) {
|
|
46
|
+
const ns = namespace();
|
|
47
|
+
ns[key] = value;
|
|
48
|
+
return ns;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// src/static/sdk-libs/storage/index.js
|
|
52
|
+
var { getSession: getSession2, authFetch: authFetch2 } = makeSession("aimeat-storage.js");
|
|
53
|
+
var storage = {
|
|
54
|
+
// Upload a file (File object, Blob, or base64 string)
|
|
55
|
+
async upload(fileOrData, opts) {
|
|
56
|
+
let key, data, mime_type, visibility;
|
|
57
|
+
if (fileOrData instanceof File || fileOrData instanceof Blob) {
|
|
58
|
+
const file = (
|
|
59
|
+
/** @type {File} */
|
|
60
|
+
fileOrData
|
|
61
|
+
);
|
|
62
|
+
key = opts?.key || file.name || "file-" + Date.now();
|
|
63
|
+
mime_type = opts?.mime_type || file.type || "application/octet-stream";
|
|
64
|
+
visibility = opts?.visibility || "private";
|
|
65
|
+
const buf = await file.arrayBuffer();
|
|
66
|
+
const bytes = new Uint8Array(buf);
|
|
67
|
+
let binary = "";
|
|
68
|
+
for (let i = 0; i < bytes.length; i += 8192) {
|
|
69
|
+
binary += String.fromCharCode.apply(null, bytes.subarray(i, i + 8192));
|
|
70
|
+
}
|
|
71
|
+
data = btoa(binary);
|
|
72
|
+
} else if (typeof fileOrData === "string") {
|
|
73
|
+
key = opts?.key || "file-" + Date.now();
|
|
74
|
+
data = fileOrData;
|
|
75
|
+
mime_type = opts?.mime_type || "application/octet-stream";
|
|
76
|
+
visibility = opts?.visibility || "private";
|
|
77
|
+
} else {
|
|
78
|
+
throw new Error("upload() expects a File, Blob, or base64 string");
|
|
79
|
+
}
|
|
80
|
+
const res = await authFetch2("/v1/storage", {
|
|
81
|
+
method: "POST",
|
|
82
|
+
body: JSON.stringify({ key, data, mime_type, visibility })
|
|
83
|
+
});
|
|
84
|
+
if (!res.ok) throw new Error(res.error?.message || "Upload failed");
|
|
85
|
+
return res.data;
|
|
86
|
+
},
|
|
87
|
+
// Download a file as Blob
|
|
88
|
+
async download(key) {
|
|
89
|
+
const session = getSession2();
|
|
90
|
+
const jwt = session.jwt;
|
|
91
|
+
const r = await fetch(NODE_URL + "/v1/storage/" + encodeURIComponent(key), {
|
|
92
|
+
headers: { "Authorization": "Bearer " + jwt }
|
|
93
|
+
});
|
|
94
|
+
if (!r.ok) throw new Error("Download failed: " + r.status);
|
|
95
|
+
return r.blob();
|
|
96
|
+
},
|
|
97
|
+
// Get a direct URL for embedding (e.g. in <img src="">)
|
|
98
|
+
// Note: requires auth header, so only works with public files or session.fetch
|
|
99
|
+
publicUrl(key) {
|
|
100
|
+
return NODE_URL + "/v1/storage/" + encodeURIComponent(key);
|
|
101
|
+
},
|
|
102
|
+
// List all files
|
|
103
|
+
async list() {
|
|
104
|
+
const res = await authFetch2("/v1/storage");
|
|
105
|
+
if (!res.ok) throw new Error(res.error?.message || "Failed to list files");
|
|
106
|
+
return res.data;
|
|
107
|
+
},
|
|
108
|
+
// Get file metadata (HEAD request)
|
|
109
|
+
async metadata(key) {
|
|
110
|
+
const session = getSession2();
|
|
111
|
+
const jwt = session.jwt;
|
|
112
|
+
const r = await fetch(NODE_URL + "/v1/storage/" + encodeURIComponent(key), {
|
|
113
|
+
method: "HEAD",
|
|
114
|
+
headers: { "Authorization": "Bearer " + jwt }
|
|
115
|
+
});
|
|
116
|
+
if (!r.ok) throw new Error("Metadata fetch failed: " + r.status);
|
|
117
|
+
return {
|
|
118
|
+
contentType: r.headers.get("Content-Type"),
|
|
119
|
+
contentLength: parseInt(r.headers.get("Content-Length") || "0"),
|
|
120
|
+
visibility: r.headers.get("X-AIMEAT-Visibility"),
|
|
121
|
+
createdAt: r.headers.get("X-AIMEAT-Created")
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
// Delete a file
|
|
125
|
+
async delete(key) {
|
|
126
|
+
const res = await authFetch2("/v1/storage/" + encodeURIComponent(key), { method: "DELETE" });
|
|
127
|
+
if (!res.ok) throw new Error(res.error?.message || "Delete failed");
|
|
128
|
+
return res.data;
|
|
129
|
+
},
|
|
130
|
+
// ── Chunked upload for large files ──
|
|
131
|
+
async uploadChunked(file, opts) {
|
|
132
|
+
const chunkSize = opts?.chunkSize || 1024 * 1024;
|
|
133
|
+
const key = opts?.key || file.name || "file-" + Date.now();
|
|
134
|
+
const mime_type = opts?.mime_type || file.type || "application/octet-stream";
|
|
135
|
+
const visibility = opts?.visibility || "private";
|
|
136
|
+
const totalChunks = Math.ceil(file.size / chunkSize);
|
|
137
|
+
const initRes = await authFetch2("/v1/storage/upload/init", {
|
|
138
|
+
method: "POST",
|
|
139
|
+
body: JSON.stringify({ key, mime_type, visibility, chunk_size: chunkSize, total_chunks: totalChunks })
|
|
140
|
+
});
|
|
141
|
+
if (!initRes.ok) throw new Error(initRes.error?.message || "Chunked upload init failed");
|
|
142
|
+
const uploadId = initRes.data.upload_id;
|
|
143
|
+
const session = getSession2();
|
|
144
|
+
for (let i = 0; i < totalChunks; i++) {
|
|
145
|
+
const start = i * chunkSize;
|
|
146
|
+
const end = Math.min(start + chunkSize, file.size);
|
|
147
|
+
const chunk = file.slice(start, end);
|
|
148
|
+
const buf = await chunk.arrayBuffer();
|
|
149
|
+
const r = await fetch(NODE_URL + "/v1/storage/upload/" + uploadId + "/" + i, {
|
|
150
|
+
method: "PUT",
|
|
151
|
+
headers: {
|
|
152
|
+
"Authorization": "Bearer " + session.jwt,
|
|
153
|
+
"Content-Type": "application/octet-stream"
|
|
154
|
+
},
|
|
155
|
+
body: buf
|
|
156
|
+
});
|
|
157
|
+
if (!r.ok) throw new Error("Chunk " + i + " upload failed: " + r.status);
|
|
158
|
+
if (opts?.onProgress) opts.onProgress({ chunk: i, total: totalChunks, percent: Math.round((i + 1) / totalChunks * 100) });
|
|
159
|
+
}
|
|
160
|
+
const completeRes = await authFetch2("/v1/storage/upload/" + uploadId + "/complete", { method: "POST" });
|
|
161
|
+
if (!completeRes.ok) throw new Error(completeRes.error?.message || "Chunked upload complete failed");
|
|
162
|
+
return completeRes.data;
|
|
163
|
+
},
|
|
164
|
+
// Abort a chunked upload
|
|
165
|
+
async abortUpload(uploadId) {
|
|
166
|
+
const res = await authFetch2("/v1/storage/upload/" + uploadId, { method: "DELETE" });
|
|
167
|
+
if (!res.ok) throw new Error(res.error?.message || "Abort failed");
|
|
168
|
+
return res.data;
|
|
169
|
+
},
|
|
170
|
+
// ── Drag & Drop helper ──
|
|
171
|
+
enableDropZone(selector, opts) {
|
|
172
|
+
const el = (
|
|
173
|
+
/** @type {HTMLElement} */
|
|
174
|
+
typeof selector === "string" ? document.querySelector(selector) : selector
|
|
175
|
+
);
|
|
176
|
+
if (!el) throw new Error("Drop zone element not found: " + selector);
|
|
177
|
+
const accept = opts?.accept || "*/*";
|
|
178
|
+
const maxSize = opts?.maxSize || 10 * 1024 * 1024;
|
|
179
|
+
el.addEventListener("dragover", (e) => {
|
|
180
|
+
e.preventDefault();
|
|
181
|
+
el.style.outline = "2px dashed #38bdf8";
|
|
182
|
+
});
|
|
183
|
+
el.addEventListener("dragleave", () => {
|
|
184
|
+
el.style.outline = "";
|
|
185
|
+
});
|
|
186
|
+
el.addEventListener("drop", async (e) => {
|
|
187
|
+
e.preventDefault();
|
|
188
|
+
el.style.outline = "";
|
|
189
|
+
const files = Array.from(e.dataTransfer.files);
|
|
190
|
+
for (const file of files) {
|
|
191
|
+
if (accept !== "*/*" && !file.type.match(accept.replace("*", ".*"))) {
|
|
192
|
+
if (opts?.onError) opts.onError(new Error("File type not accepted: " + file.type));
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
if (file.size > maxSize) {
|
|
196
|
+
if (opts?.onError) opts.onError(new Error("File too large: " + file.name + " (" + file.size + " bytes)"));
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
try {
|
|
200
|
+
const ref = await storage.upload(file, opts);
|
|
201
|
+
if (opts?.onUpload) opts.onUpload(ref, file);
|
|
202
|
+
} catch (err) {
|
|
203
|
+
if (opts?.onError) opts.onError(err);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
attach("storage", storage);
|
|
210
|
+
})();
|