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,107 @@
|
|
|
1
|
+
apiVersion: cortex.aimeat.org/v1
|
|
2
|
+
kind: Extension
|
|
3
|
+
metadata:
|
|
4
|
+
name: aimeat-surface
|
|
5
|
+
namespace: aimeat
|
|
6
|
+
description: "The panel-spec surface engine: turn a plain-language request into ONE panel spec, resolve its data source into rows, and render them through the node's UI packs (stats / table / chart / timeline / brief / options). Data sources are plugins — memory and inline ship built in, the app registers the rest, and the registered sources assemble the composer's own prompt. Renders the panel BODY only; card, frame and persistence belong to the host."
|
|
7
|
+
author: AIMEAT
|
|
8
|
+
tags: [surface, panel, spec, ai, compose, dashboard, living-surface, ui]
|
|
9
|
+
labels:
|
|
10
|
+
domain: ui
|
|
11
|
+
|
|
12
|
+
spec:
|
|
13
|
+
version: "1.1.0"
|
|
14
|
+
license: MIT
|
|
15
|
+
components:
|
|
16
|
+
- type: prompt
|
|
17
|
+
name: surface-assistant
|
|
18
|
+
content: |
|
|
19
|
+
You are a living-surface assistant for an AIMEAT app. The user's node is at {{node_url}}.
|
|
20
|
+
|
|
21
|
+
aimeat-surface turns "show me X" into a rendered panel. The app never hand-builds a
|
|
22
|
+
dashboard: it composes a PANEL SPEC, resolves the spec's source into rows, and renders.
|
|
23
|
+
The same spec can be a card in one product and a frame on a canvas in another, because
|
|
24
|
+
the engine renders the BODY only.
|
|
25
|
+
|
|
26
|
+
Include the packs it renders through, then this one:
|
|
27
|
+
<script src="{{node_url}}/v1/cortex/aimeat-ui-viewers/libs/aimeat-ui-viewers.js"></script>
|
|
28
|
+
<script src="{{node_url}}/v1/cortex/aimeat-ui-motion/libs/aimeat-ui-motion.js"></script>
|
|
29
|
+
<script src="{{node_url}}/lib/chartjs@4.js"></script>
|
|
30
|
+
<script src="{{node_url}}/v1/cortex/aimeat-charts/libs/aimeat-charts.js"></script>
|
|
31
|
+
<script src="{{node_url}}/v1/cortex/aimeat-surface/libs/aimeat-surface.js"></script>
|
|
32
|
+
Every pack call has a plain-DOM fallback, so a missing pack degrades instead of blanking
|
|
33
|
+
the panel — but load them and the surface looks like one product.
|
|
34
|
+
|
|
35
|
+
const surface = AIMEAT.surface.create({ appId: APP_ID, locale: 'fi' });
|
|
36
|
+
|
|
37
|
+
THE PANEL SPEC is the whole contract:
|
|
38
|
+
{ id, title, kind, intent, source, view, needsYou, updatedAt, author }
|
|
39
|
+
kind: stats | table | chart | timeline | brief | options
|
|
40
|
+
source: { type, ... } resolved by a registered source
|
|
41
|
+
view: per kind —
|
|
42
|
+
table {"columns":[{"key","label"}]} (omit and columns are auto-picked)
|
|
43
|
+
chart {"chartType":"bar|line|pie|doughnut","labelKey","valueKeys":[]}
|
|
44
|
+
stats {"tiles":[{"label","key","agg":"count|sum|avg|latest","format":"usd|eur","sparkKey"}]}
|
|
45
|
+
timeline {"tsKey","textKey"}
|
|
46
|
+
brief {"markdown":"…"}
|
|
47
|
+
options {"items":[{"title","body"}],"chosen":{…}}
|
|
48
|
+
|
|
49
|
+
DATA SOURCES ARE PLUGINS. Built in: memory (owner-scope read by key prefix, which also
|
|
50
|
+
picks up what the owner's AGENTS wrote) and inline. Register anything else the app can
|
|
51
|
+
fetch — and note the consequence: a source you do not register is a source the composer
|
|
52
|
+
is never told about, because the registered sources assemble its prompt.
|
|
53
|
+
surface.registerSource('companies', {
|
|
54
|
+
hint: ' {"type":"companies","names":["Nokia"]} Finnish trade-register companies',
|
|
55
|
+
fields: 'name, businessId, form, line, registered, lastChange, website, city',
|
|
56
|
+
resolve: async (src, ctx) => rowsFor(src),
|
|
57
|
+
normalize: (src) => ({ names: src.names || src.companies || [], ids: src.ids || [] }),
|
|
58
|
+
claims: (src) => !!(src.names || src.companies || src.ids),
|
|
59
|
+
})
|
|
60
|
+
`claims` matters: models rename and drop the type field, so each source gets to claim a
|
|
61
|
+
malformed source object by SHAPE before the engine falls back to inline.
|
|
62
|
+
|
|
63
|
+
THE LOOP:
|
|
64
|
+
const spec = await surface.compose(text, { prefixes }); // request → spec
|
|
65
|
+
const rows = await surface.resolve(spec, { session }); // spec → rows
|
|
66
|
+
surface.renderBody(boxEl, spec, rows, { onPick }); // rows → DOM
|
|
67
|
+
const next = await surface.reshape(spec, 'make it a chart by month');
|
|
68
|
+
const better = await surface.refine(spec, rows); // SECOND PASS, see below
|
|
69
|
+
spec.view.markdown = await surface.writeBrief(spec, rows);
|
|
70
|
+
|
|
71
|
+
RUN refine() AFTER THE ROWS ARRIVE when the composer had to guess the data shape blind
|
|
72
|
+
(memory sources above all). It re-picks kind + view against the REAL field names, and it
|
|
73
|
+
is the difference between "my AI spend per day" arriving as a chart of the right column
|
|
74
|
+
and as a table of plumbing. Keep the source pinned — refine() does.
|
|
75
|
+
|
|
76
|
+
writeBrief() runs AFTER resolve() on purpose: the model only ever sees fetched rows, so a
|
|
77
|
+
brief cannot invent data.
|
|
78
|
+
|
|
79
|
+
Helpers you may want directly: AIMEAT.surface.flatten(obj), .autoColumns(rows),
|
|
80
|
+
.agg(rows, key, how), .num(v); on an engine, .fmtNum(n, 'usd'|'eur') and .specHint().
|
|
81
|
+
|
|
82
|
+
The engine does NOT persist anything. Store specs where they belong for your product —
|
|
83
|
+
an app memory key, a workspace record, a board — and pass them back in.
|
|
84
|
+
variables:
|
|
85
|
+
- "{{node_url}}"
|
|
86
|
+
|
|
87
|
+
- type: lib
|
|
88
|
+
name: aimeat-surface
|
|
89
|
+
filename: aimeat-surface.js
|
|
90
|
+
exports:
|
|
91
|
+
- create
|
|
92
|
+
api_surface: |
|
|
93
|
+
AIMEAT.surface.create({ appId?, locale?: 'fi'|'en', strings?, ai?, scrollClass? })
|
|
94
|
+
-> { KINDS, registerSource(type, def), resolve(spec, ctx), renderBody(box, spec, rows, opts?),
|
|
95
|
+
specHint(), normalizeSpec(out, intent), compose(text, ctx), reshape(spec, text),
|
|
96
|
+
refine(spec, rows), writeBrief(spec, rows), autoColumns(rows), fmtNum(n, format), t(key) }
|
|
97
|
+
AIMEAT.surface.{ KINDS, flatten, autoColumns, agg, num, VERSION }
|
|
98
|
+
|
|
99
|
+
Panel spec: { id, title, kind, intent, source, view, needsYou, updatedAt, author }
|
|
100
|
+
kind: stats | table | chart | timeline | brief | options
|
|
101
|
+
Built-in sources: memory ({type,prefix}, owner-scope, includes agent writes) · inline ({type,rows}).
|
|
102
|
+
registerSource def: { resolve(src, ctx), hint, fields?, normalize?(src), claims?(src) }.
|
|
103
|
+
|
|
104
|
+
Renders the panel BODY into the element you pass; chrome and persistence are the host's.
|
|
105
|
+
Rendering degrades gracefully when a UI pack is absent (statTiles → daisyUI stats,
|
|
106
|
+
ChartBuilder → warning, Timeline → list, markdown → escaped text, DataTable → table).
|
|
107
|
+
renderBody opts: { onPick(index, spec), pageSize }.
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file aimeat-viewport.js
|
|
3
|
+
* @description The shared CAMERA primitive for AIMEAT canvas surfaces — pan, zoom-at-cursor,
|
|
4
|
+
* pinch, drag delegation, animated fit/centerOn, and the navigate/interact capture-overlay
|
|
5
|
+
* model that makes panning work over children which swallow pointer events (iframes). It owns
|
|
6
|
+
* the camera and NOTHING about content: what counts as draggable content is answered by the
|
|
7
|
+
* consumer through the `onClaimPointer` hit-test delegate. Extracted verbatim-in-behaviour from
|
|
8
|
+
* aimeat-dag v1.0.1 (TARGET-051) so a second consumer does not mean a third pan/zoom
|
|
9
|
+
* implementation; aimeat-dag now sits on this and embeds a byte-identical copy of this file so
|
|
10
|
+
* it can stay a single self-contained script tag.
|
|
11
|
+
* @structure
|
|
12
|
+
* - injectCss(prefix) → structural CSS for one class prefix (host/world/panning/overlay)
|
|
13
|
+
* - create(hostOrSelector, opts) → the viewport instance
|
|
14
|
+
* - instance: world, cam(), scale(), setCamera(), fit(), centerOn(), clientToWorld(),
|
|
15
|
+
* worldToClient(), setMode(), getMode(), refreshCaptures(), destroy()
|
|
16
|
+
* @usage
|
|
17
|
+
* <script src="/v1/cortex/aimeat-viewport/libs/aimeat-viewport.js"></script>
|
|
18
|
+
* const vp = AIMEAT.viewport.create('#board', {
|
|
19
|
+
* classPrefix: 'og', minZoom: 0.05, maxZoom: 3,
|
|
20
|
+
* captureSelector: '[data-og-frame]', // enables the navigate/interact model
|
|
21
|
+
* contentBBox: () => boundsOfAllFrames(),
|
|
22
|
+
* onClaimPointer: (ev) => { const f = ev.target.closest('[data-og-frame]'); return f ? handleFor(f) : null; },
|
|
23
|
+
* });
|
|
24
|
+
* vp.world.appendChild(frameEl); // children live in world space
|
|
25
|
+
* @version-history
|
|
26
|
+
* v1.0.3 — 2026-07-25 — Report the version the manifest declares; the constant and the
|
|
27
|
+
* manifest had crossed. pnpm check:viewport now asserts they match.
|
|
28
|
+
* v1.0.1 — 2026-07-25 — Fix: do not force position:relative on the host (it beat a consumer's
|
|
29
|
+
* own position:fixed at the same specificity and collapsed a full-screen board to 0px);
|
|
30
|
+
* create() promotes the host only when its computed position is static.
|
|
31
|
+
* v1.0.0 — 2026-07-25 — Initial (TARGET-051 Slice 1): camera extracted from aimeat-dag v1.0.1.
|
|
32
|
+
* Behaviour-preserving for dag (same gesture semantics, same zoom clamps as defaults, same
|
|
33
|
+
* easing and reduced-motion handling); new for other consumers are classPrefix, configurable
|
|
34
|
+
* zoom bounds, the pointer-claim delegate, clientToWorld/worldToClient as public API (it was
|
|
35
|
+
* dead code in dag), and the navigate/interact capture overlays.
|
|
36
|
+
*/
|
|
37
|
+
(function (global) {
|
|
38
|
+
'use strict';
|
|
39
|
+
|
|
40
|
+
var AIMEAT = global.AIMEAT = global.AIMEAT || {};
|
|
41
|
+
|
|
42
|
+
// Idempotent: aimeat-dag embeds a copy of this file so it can ship as one script tag. Loading
|
|
43
|
+
// both the standalone pack and dag must not redefine the namespace.
|
|
44
|
+
if (AIMEAT.viewport) return;
|
|
45
|
+
|
|
46
|
+
var REDUCED = false;
|
|
47
|
+
try { REDUCED = global.matchMedia && global.matchMedia('(prefers-reduced-motion: reduce)').matches; } catch (e) { /* noop */ }
|
|
48
|
+
|
|
49
|
+
var ANIM_MS = 320;
|
|
50
|
+
var ANIM_EASE = 'cubic-bezier(.22,1,.36,1)';
|
|
51
|
+
|
|
52
|
+
// Structural CSS only — the consumer owns cosmetics (size, background, radius). Keeping the two
|
|
53
|
+
// sets disjoint means injection order never matters and no rule fights another.
|
|
54
|
+
var injected = {};
|
|
55
|
+
function injectCss(p) {
|
|
56
|
+
if (injected[p]) return;
|
|
57
|
+
var css = [
|
|
58
|
+
/* NOTE: `position` is deliberately NOT set here. The host only has to be a positioning
|
|
59
|
+
context, and a consumer may already be one in a way that matters — a full-screen board is
|
|
60
|
+
`position: fixed; inset: 0`, and a same-specificity `position: relative` from this
|
|
61
|
+
stylesheet would silently win, collapse the host to zero height and leave every pointer
|
|
62
|
+
event landing on nothing. create() promotes the host only when it is actually static. */
|
|
63
|
+
'.' + p + '-host { overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }',
|
|
64
|
+
'.' + p + '-host.' + p + '-panning { cursor: grabbing; }',
|
|
65
|
+
'.' + p + '-host.' + p + '-interact { cursor: default; }',
|
|
66
|
+
'.' + p + '-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }',
|
|
67
|
+
'.' + p + '-world.' + p + '-animated { transition: transform ' + ANIM_MS + 'ms ' + ANIM_EASE + '; }',
|
|
68
|
+
// The capture overlay: transparent, fills its host child, sits above iframe content so the
|
|
69
|
+
// pointer stream reaches the viewport instead of being swallowed.
|
|
70
|
+
'.' + p + '-capture { position: absolute; inset: 0; z-index: 5; background: transparent; cursor: inherit; }',
|
|
71
|
+
'@media (prefers-reduced-motion: reduce) { .' + p + '-world.' + p + '-animated { transition: none; } }',
|
|
72
|
+
].join('\n');
|
|
73
|
+
var style = document.createElement('style');
|
|
74
|
+
style.setAttribute('data-aimeat-viewport', p);
|
|
75
|
+
style.textContent = css;
|
|
76
|
+
document.head.appendChild(style);
|
|
77
|
+
injected[p] = true;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function resolveEl(elOrSelector) {
|
|
81
|
+
return typeof elOrSelector === 'string' ? document.querySelector(elOrSelector) : elOrSelector;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function dist(a, b) { return Math.hypot(a.x - b.x, a.y - b.y); }
|
|
85
|
+
function mid(a, b) { return { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 }; }
|
|
86
|
+
function clamp(v, lo, hi) { return Math.min(hi, Math.max(lo, v)); }
|
|
87
|
+
|
|
88
|
+
function isTextEntry(el) {
|
|
89
|
+
if (!el) return false;
|
|
90
|
+
var tag = (el.tagName || '').toLowerCase();
|
|
91
|
+
return tag === 'input' || tag === 'textarea' || tag === 'select' || el.isContentEditable === true;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Create a viewport over `host`. The instance creates and owns the `world` element; put your
|
|
96
|
+
* content inside `vp.world` and position it in world coordinates.
|
|
97
|
+
*
|
|
98
|
+
* @param {Element|string} hostOrSelector clipping host (the consumer gives it a size)
|
|
99
|
+
* @param {Object} [opts]
|
|
100
|
+
* @param {string} [opts.classPrefix='av'] prefix for host/world/panning/capture classes — a
|
|
101
|
+
* consumer that already ships CSS selectors passes its own so nothing renames.
|
|
102
|
+
* @param {number} [opts.minZoom=0.2] @param {number} [opts.maxZoom=2.5]
|
|
103
|
+
* @param {Object} [opts.initial={x:40,y:40,k:1}] starting camera
|
|
104
|
+
* @param {number} [opts.fitPadding=36] @param {number} [opts.fitMaxZoom=1.4]
|
|
105
|
+
* @param {number} [opts.centerMinZoom=1] centerOn() zooms in to at least this
|
|
106
|
+
* @param {number} [opts.dragThreshold=4] client px before a claimed pointer counts as moved
|
|
107
|
+
* @param {Function} [opts.contentBBox] () → {x,y,w,h} in world units; required for fit()
|
|
108
|
+
* @param {Function} [opts.onClaimPointer] (ev) → null (viewport pans) | drag handle
|
|
109
|
+
* { onMove(worldDx, worldDy, ev, cam), onEnd(movedPastThreshold, ev) }
|
|
110
|
+
* @param {Function} [opts.onTap] (ev) fired when a pan gesture ends without moving
|
|
111
|
+
* @param {Function} [opts.onCameraChange] (cam) after any camera change
|
|
112
|
+
* @param {string} [opts.captureSelector] children matching this get a capture overlay in
|
|
113
|
+
* navigate mode. Supplying it OPTS IN to the two-mode model (space-hold, middle-mouse pan,
|
|
114
|
+
* Esc). Omit it and no window listeners are attached at all.
|
|
115
|
+
* @param {string} [opts.mode='navigate']
|
|
116
|
+
*/
|
|
117
|
+
function create(hostOrSelector, opts) {
|
|
118
|
+
opts = opts || {};
|
|
119
|
+
var host = resolveEl(hostOrSelector);
|
|
120
|
+
if (!host) throw new Error('aimeat-viewport: host element not found');
|
|
121
|
+
|
|
122
|
+
var P = opts.classPrefix || 'av';
|
|
123
|
+
var minZoom = opts.minZoom != null ? opts.minZoom : 0.2;
|
|
124
|
+
var maxZoom = opts.maxZoom != null ? opts.maxZoom : 2.5;
|
|
125
|
+
var fitPadding = opts.fitPadding != null ? opts.fitPadding : 36;
|
|
126
|
+
var fitMaxZoom = opts.fitMaxZoom != null ? opts.fitMaxZoom : 1.4;
|
|
127
|
+
var centerMinZoom = opts.centerMinZoom != null ? opts.centerMinZoom : 1;
|
|
128
|
+
var dragThreshold = opts.dragThreshold != null ? opts.dragThreshold : 4;
|
|
129
|
+
var twoMode = !!opts.captureSelector;
|
|
130
|
+
|
|
131
|
+
injectCss(P);
|
|
132
|
+
host.classList.add(P + '-host');
|
|
133
|
+
/* The world is absolutely positioned, so the host must be a positioning context — but only
|
|
134
|
+
promote it when it is static. Overwriting an existing fixed/absolute/sticky host is how a
|
|
135
|
+
full-screen board ends up 0px tall. */
|
|
136
|
+
if (global.getComputedStyle(host).position === 'static') host.style.position = 'relative';
|
|
137
|
+
|
|
138
|
+
var world = document.createElement('div');
|
|
139
|
+
world.className = P + '-world';
|
|
140
|
+
host.appendChild(world);
|
|
141
|
+
|
|
142
|
+
var init = opts.initial || {};
|
|
143
|
+
var cam = { x: init.x != null ? init.x : 40, y: init.y != null ? init.y : 40, k: init.k != null ? init.k : 1 };
|
|
144
|
+
var mode = opts.mode === 'interact' ? 'interact' : 'navigate';
|
|
145
|
+
var spaceHeld = false;
|
|
146
|
+
var destroyed = false;
|
|
147
|
+
|
|
148
|
+
function emitCam() { if (opts.onCameraChange) opts.onCameraChange({ x: cam.x, y: cam.y, k: cam.k }); }
|
|
149
|
+
|
|
150
|
+
function applyCam(animated) {
|
|
151
|
+
if (animated && !REDUCED) {
|
|
152
|
+
world.classList.add(P + '-animated');
|
|
153
|
+
setTimeout(function () { world.classList.remove(P + '-animated'); }, ANIM_MS + 40);
|
|
154
|
+
}
|
|
155
|
+
world.style.transform = 'translate(' + cam.x + 'px,' + cam.y + 'px) scale(' + cam.k + ')';
|
|
156
|
+
emitCam();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// ── capture overlays ──────────────────────────────────────────────────────
|
|
160
|
+
// Children that handle their own pointer events (iframes above all) swallow the stream and
|
|
161
|
+
// panning over them silently stops working. In navigate mode each one gets a transparent
|
|
162
|
+
// overlay; in interact mode the overlays come off and the child behaves normally.
|
|
163
|
+
function refreshCaptures() {
|
|
164
|
+
if (!twoMode) return;
|
|
165
|
+
var wants = (mode === 'navigate') || spaceHeld;
|
|
166
|
+
/* Sweep first. The selector decides WHO gets an overlay, so an element that has left the set
|
|
167
|
+
must lose the one it already has. Only matching elements were visited, so a consumer that
|
|
168
|
+
excludes a frame at runtime — "let me use just this one" — kept a dead overlay sitting on
|
|
169
|
+
top of it and the frame stayed unclickable with no way to tell why. */
|
|
170
|
+
var stale = world.querySelectorAll('.' + P + '-capture');
|
|
171
|
+
for (var k = 0; k < stale.length; k++) {
|
|
172
|
+
var owner = stale[k].parentElement;
|
|
173
|
+
if (owner && owner.matches && !owner.matches(opts.captureSelector)) stale[k].remove();
|
|
174
|
+
}
|
|
175
|
+
var targets = world.querySelectorAll(opts.captureSelector);
|
|
176
|
+
for (var i = 0; i < targets.length; i++) {
|
|
177
|
+
var el = targets[i];
|
|
178
|
+
var existing = el.querySelector(':scope > .' + P + '-capture');
|
|
179
|
+
if (wants && !existing) {
|
|
180
|
+
var ov = document.createElement('div');
|
|
181
|
+
ov.className = P + '-capture';
|
|
182
|
+
ov.setAttribute('aria-hidden', 'true');
|
|
183
|
+
el.appendChild(ov);
|
|
184
|
+
} else if (!wants && existing) {
|
|
185
|
+
existing.remove();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function setMode(next) {
|
|
191
|
+
var m = next === 'interact' ? 'interact' : 'navigate';
|
|
192
|
+
if (m === mode) return;
|
|
193
|
+
mode = m;
|
|
194
|
+
host.classList.toggle(P + '-interact', mode === 'interact');
|
|
195
|
+
refreshCaptures();
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// ── pointer interactions ──────────────────────────────────────────────────
|
|
199
|
+
var pointers = {}; // pointerId → {x,y}
|
|
200
|
+
var gesture = null; // {mode:'pan'|'pinch'|'claim', ...}
|
|
201
|
+
|
|
202
|
+
function clientToWorld(cx, cy) {
|
|
203
|
+
var r = host.getBoundingClientRect();
|
|
204
|
+
return { x: (cx - r.left - cam.x) / cam.k, y: (cy - r.top - cam.y) / cam.k };
|
|
205
|
+
}
|
|
206
|
+
function worldToClient(wx, wy) {
|
|
207
|
+
var r = host.getBoundingClientRect();
|
|
208
|
+
return { x: wx * cam.k + cam.x + r.left, y: wy * cam.k + cam.y + r.top };
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function beginPan(ev) {
|
|
212
|
+
gesture = { mode: 'pan', sx: ev.clientX, sy: ev.clientY, cam0: { x: cam.x, y: cam.y }, moved: false };
|
|
213
|
+
host.classList.add(P + '-panning');
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function onPointerDown(ev) {
|
|
217
|
+
// Capture is best-effort: synthetic PointerEvents (tests, automation) and pointers released
|
|
218
|
+
// mid-dispatch have no active pointer and would throw NotFoundError, swallowing the whole
|
|
219
|
+
// pointerdown. (aimeat-dag v1.0.1 shipped this as a real bug fix.)
|
|
220
|
+
try { host.setPointerCapture && host.setPointerCapture(ev.pointerId); } catch (e) { /* noop */ }
|
|
221
|
+
pointers[ev.pointerId] = { x: ev.clientX, y: ev.clientY };
|
|
222
|
+
|
|
223
|
+
if (Object.keys(pointers).length === 2) {
|
|
224
|
+
var pts = Object.keys(pointers).map(function (id) { return pointers[id]; });
|
|
225
|
+
gesture = {
|
|
226
|
+
mode: 'pinch', d0: dist(pts[0], pts[1]), k0: cam.k,
|
|
227
|
+
mid0: mid(pts[0], pts[1]), cam0: { x: cam.x, y: cam.y },
|
|
228
|
+
};
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Middle mouse always pans, and holding space is a temporary navigate — both are the
|
|
233
|
+
// conventions users bring from other canvas tools.
|
|
234
|
+
if (twoMode && (ev.button === 1 || spaceHeld)) { beginPan(ev); return; }
|
|
235
|
+
|
|
236
|
+
var handle = opts.onClaimPointer ? opts.onClaimPointer(ev) : null;
|
|
237
|
+
if (handle) {
|
|
238
|
+
gesture = { mode: 'claim', handle: handle, sx: ev.clientX, sy: ev.clientY, moved: false };
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
beginPan(ev);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function onPointerMove(ev) {
|
|
245
|
+
if (!pointers[ev.pointerId]) return;
|
|
246
|
+
pointers[ev.pointerId] = { x: ev.clientX, y: ev.clientY };
|
|
247
|
+
if (!gesture) return;
|
|
248
|
+
|
|
249
|
+
if (gesture.mode === 'pinch') {
|
|
250
|
+
var pts = Object.keys(pointers).map(function (id) { return pointers[id]; });
|
|
251
|
+
if (pts.length < 2) return;
|
|
252
|
+
var k = clamp(gesture.k0 * dist(pts[0], pts[1]) / Math.max(1, gesture.d0), minZoom, maxZoom);
|
|
253
|
+
var m = mid(pts[0], pts[1]);
|
|
254
|
+
var r = host.getBoundingClientRect();
|
|
255
|
+
// keep the world point under the pinch midpoint stationary
|
|
256
|
+
var wx = (gesture.mid0.x - r.left - gesture.cam0.x) / gesture.k0;
|
|
257
|
+
var wy = (gesture.mid0.y - r.top - gesture.cam0.y) / gesture.k0;
|
|
258
|
+
cam.k = k;
|
|
259
|
+
cam.x = (m.x - r.left) - wx * k;
|
|
260
|
+
cam.y = (m.y - r.top) - wy * k;
|
|
261
|
+
applyCam(false);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (gesture.mode === 'pan') {
|
|
266
|
+
gesture.moved = gesture.moved || Math.abs(ev.clientX - gesture.sx) + Math.abs(ev.clientY - gesture.sy) > 3;
|
|
267
|
+
cam.x = gesture.cam0.x + (ev.clientX - gesture.sx);
|
|
268
|
+
cam.y = gesture.cam0.y + (ev.clientY - gesture.sy);
|
|
269
|
+
applyCam(false);
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (gesture.mode === 'claim') {
|
|
274
|
+
var dx = (ev.clientX - gesture.sx) / cam.k;
|
|
275
|
+
var dy = (ev.clientY - gesture.sy) / cam.k;
|
|
276
|
+
if (!gesture.moved && Math.abs(dx) + Math.abs(dy) < dragThreshold / cam.k) return;
|
|
277
|
+
gesture.moved = true;
|
|
278
|
+
if (gesture.handle.onMove) gesture.handle.onMove(dx, dy, ev, { x: cam.x, y: cam.y, k: cam.k });
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function onPointerUp(ev) {
|
|
283
|
+
delete pointers[ev.pointerId];
|
|
284
|
+
host.classList.remove(P + '-panning');
|
|
285
|
+
if (!gesture) return;
|
|
286
|
+
var g = gesture;
|
|
287
|
+
// A pinch that lost one finger keeps waiting for the other to lift.
|
|
288
|
+
if (Object.keys(pointers).length > 0 && g.mode === 'pinch') return;
|
|
289
|
+
gesture = null;
|
|
290
|
+
if (g.mode === 'claim') {
|
|
291
|
+
if (g.handle.onEnd) g.handle.onEnd(g.moved, ev);
|
|
292
|
+
} else if (g.mode === 'pan' && !g.moved) {
|
|
293
|
+
if (opts.onTap) opts.onTap(ev);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function onWheel(ev) {
|
|
298
|
+
ev.preventDefault();
|
|
299
|
+
var factor = Math.pow(1.0015, -ev.deltaY);
|
|
300
|
+
var k = clamp(cam.k * factor, minZoom, maxZoom);
|
|
301
|
+
var r = host.getBoundingClientRect();
|
|
302
|
+
var wx = (ev.clientX - r.left - cam.x) / cam.k;
|
|
303
|
+
var wy = (ev.clientY - r.top - cam.y) / cam.k;
|
|
304
|
+
cam.k = k;
|
|
305
|
+
cam.x = (ev.clientX - r.left) - wx * k;
|
|
306
|
+
cam.y = (ev.clientY - r.top) - wy * k;
|
|
307
|
+
applyCam(false);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function onKeyDown(ev) {
|
|
311
|
+
if (ev.code !== 'Space' || spaceHeld || isTextEntry(ev.target)) return;
|
|
312
|
+
spaceHeld = true;
|
|
313
|
+
host.classList.add(P + '-panning');
|
|
314
|
+
refreshCaptures();
|
|
315
|
+
ev.preventDefault(); // stop the page from scrolling under a held space
|
|
316
|
+
}
|
|
317
|
+
function onKeyUp(ev) {
|
|
318
|
+
if (ev.code === 'Escape') { setMode('navigate'); return; }
|
|
319
|
+
if (ev.code !== 'Space' || !spaceHeld) return;
|
|
320
|
+
spaceHeld = false;
|
|
321
|
+
if (!gesture) host.classList.remove(P + '-panning');
|
|
322
|
+
refreshCaptures();
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
host.addEventListener('pointerdown', onPointerDown);
|
|
326
|
+
host.addEventListener('pointermove', onPointerMove);
|
|
327
|
+
host.addEventListener('pointerup', onPointerUp);
|
|
328
|
+
host.addEventListener('pointercancel', onPointerUp);
|
|
329
|
+
host.addEventListener('wheel', onWheel, { passive: false });
|
|
330
|
+
if (twoMode) {
|
|
331
|
+
global.addEventListener('keydown', onKeyDown);
|
|
332
|
+
global.addEventListener('keyup', onKeyUp);
|
|
333
|
+
host.classList.toggle(P + '-interact', mode === 'interact');
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// ── camera moves ──────────────────────────────────────────────────────────
|
|
337
|
+
function setCamera(next, animated) {
|
|
338
|
+
if (next.k != null) cam.k = clamp(next.k, minZoom, maxZoom);
|
|
339
|
+
if (next.x != null) cam.x = next.x;
|
|
340
|
+
if (next.y != null) cam.y = next.y;
|
|
341
|
+
applyCam(!!animated);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function fit(animated) {
|
|
345
|
+
var b = opts.contentBBox ? opts.contentBBox() : null;
|
|
346
|
+
if (!b || !(b.w > 0) || !(b.h > 0)) return;
|
|
347
|
+
var k = clamp(Math.min(
|
|
348
|
+
(host.clientWidth - fitPadding * 2) / b.w,
|
|
349
|
+
(host.clientHeight - fitPadding * 2) / b.h,
|
|
350
|
+
fitMaxZoom,
|
|
351
|
+
), minZoom, maxZoom);
|
|
352
|
+
cam.k = k;
|
|
353
|
+
cam.x = (host.clientWidth - b.w * k) / 2 - b.x * k;
|
|
354
|
+
cam.y = (host.clientHeight - b.h * k) / 2 - b.y * k;
|
|
355
|
+
applyCam(animated !== false);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/** Centre the camera on a world-space rect {x,y,w,h}, zooming in to at least centerMinZoom. */
|
|
359
|
+
function centerOn(rect, animated) {
|
|
360
|
+
if (!rect) return;
|
|
361
|
+
var k = clamp(Math.max(cam.k, centerMinZoom), minZoom, maxZoom);
|
|
362
|
+
cam.k = k;
|
|
363
|
+
cam.x = host.clientWidth / 2 - (rect.x + rect.w / 2) * k;
|
|
364
|
+
cam.y = host.clientHeight / 2 - (rect.y + rect.h / 2) * k;
|
|
365
|
+
applyCam(animated !== false);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
function destroy() {
|
|
369
|
+
if (destroyed) return;
|
|
370
|
+
destroyed = true;
|
|
371
|
+
host.removeEventListener('pointerdown', onPointerDown);
|
|
372
|
+
host.removeEventListener('pointermove', onPointerMove);
|
|
373
|
+
host.removeEventListener('pointerup', onPointerUp);
|
|
374
|
+
host.removeEventListener('pointercancel', onPointerUp);
|
|
375
|
+
host.removeEventListener('wheel', onWheel);
|
|
376
|
+
if (twoMode) {
|
|
377
|
+
global.removeEventListener('keydown', onKeyDown);
|
|
378
|
+
global.removeEventListener('keyup', onKeyUp);
|
|
379
|
+
}
|
|
380
|
+
host.classList.remove(P + '-host', P + '-panning', P + '-interact');
|
|
381
|
+
world.remove();
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
applyCam(false);
|
|
385
|
+
|
|
386
|
+
return {
|
|
387
|
+
host: host,
|
|
388
|
+
world: world,
|
|
389
|
+
cam: function () { return { x: cam.x, y: cam.y, k: cam.k }; },
|
|
390
|
+
scale: function () { return cam.k; },
|
|
391
|
+
setCamera: setCamera,
|
|
392
|
+
fit: fit,
|
|
393
|
+
centerOn: centerOn,
|
|
394
|
+
clientToWorld: clientToWorld,
|
|
395
|
+
worldToClient: worldToClient,
|
|
396
|
+
setMode: setMode,
|
|
397
|
+
getMode: function () { return spaceHeld ? 'navigate' : mode; },
|
|
398
|
+
refreshCaptures: refreshCaptures,
|
|
399
|
+
destroy: destroy,
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
AIMEAT.viewport = { create: create, VERSION: '1.0.4' };
|
|
404
|
+
|
|
405
|
+
})(typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : this);
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
apiVersion: cortex.aimeat.org/v1
|
|
2
|
+
kind: Extension
|
|
3
|
+
metadata:
|
|
4
|
+
name: aimeat-viewport
|
|
5
|
+
namespace: aimeat
|
|
6
|
+
description: "The camera primitive for movable surfaces: pan, zoom-at-cursor, pinch, drag delegation, animated fit/centerOn, and the navigate/interact capture-overlay model that keeps panning working over iframes. Owns the camera and nothing about content — the consumer answers what is draggable via a hit-test delegate. Zero dependencies, theme-agnostic, reduced-motion safe."
|
|
7
|
+
author: AIMEAT
|
|
8
|
+
tags: [viewport, camera, canvas, pan, zoom, pinch, surface, ui]
|
|
9
|
+
labels:
|
|
10
|
+
domain: canvas
|
|
11
|
+
|
|
12
|
+
spec:
|
|
13
|
+
version: "1.0.4"
|
|
14
|
+
license: MIT
|
|
15
|
+
components:
|
|
16
|
+
- type: prompt
|
|
17
|
+
name: viewport-assistant
|
|
18
|
+
content: |
|
|
19
|
+
You are a canvas-surface assistant for an AIMEAT app. The user's node is at {{node_url}}.
|
|
20
|
+
|
|
21
|
+
aimeat-viewport is the CAMERA ONLY. Reach for it when the app needs a movable surface of
|
|
22
|
+
its OWN content — arbitrary children, the app's own layout, pan/zoom/pinch. If the app
|
|
23
|
+
wants an auto-laid-out graph to read use aimeat-dag; a user-drawn node-and-wire diagram
|
|
24
|
+
use aimeat-flow; freehand drawing use aimeat-canvas; a static text-defined diagram use
|
|
25
|
+
mermaid. Choosing this pack for those means reimplementing what they already do.
|
|
26
|
+
|
|
27
|
+
Include ONE tag:
|
|
28
|
+
<script src="{{node_url}}/v1/cortex/aimeat-viewport/libs/aimeat-viewport.js"></script>
|
|
29
|
+
|
|
30
|
+
API:
|
|
31
|
+
|
|
32
|
+
const vp = AIMEAT.viewport.create(elOrSelector, {
|
|
33
|
+
classPrefix?: 'av', // host/world/panning/capture class prefix
|
|
34
|
+
minZoom?: 0.2, maxZoom?: 2.5,
|
|
35
|
+
initial?: { x: 40, y: 40, k: 1 },
|
|
36
|
+
fitPadding?: 36, fitMaxZoom?: 1.4, centerMinZoom?: 1, dragThreshold?: 4,
|
|
37
|
+
contentBBox?: () => ({ x, y, w, h }), // world units; fit() asks for this
|
|
38
|
+
onClaimPointer?: (ev) => null | { // null => the viewport pans
|
|
39
|
+
onMove(worldDx, worldDy, ev, cam), onEnd(movedPastThreshold, ev) },
|
|
40
|
+
onTap?: (ev) => {}, // pan gesture that never moved
|
|
41
|
+
onCameraChange?: (cam) => {},
|
|
42
|
+
captureSelector?: '[data-frame]', // opts in to the navigate/interact model
|
|
43
|
+
mode?: 'navigate' | 'interact',
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
vp.world // append your content here; position it in WORLD coordinates
|
|
47
|
+
vp.cam() -> {x,y,k} // copy; vp.scale() -> k
|
|
48
|
+
vp.setCamera({x,y,k}, animated) · vp.fit(animated) · vp.centerOn({x,y,w,h}, animated)
|
|
49
|
+
vp.clientToWorld(cx, cy) · vp.worldToClient(wx, wy)
|
|
50
|
+
vp.setMode('navigate'|'interact') · vp.getMode() · vp.refreshCaptures() · vp.destroy()
|
|
51
|
+
|
|
52
|
+
THE HOST ELEMENT MUST HAVE A SIZE (e.g. style="height:480px" or position:fixed;inset:0).
|
|
53
|
+
A zero-height host silently swallows every pointer event — this is the single most common
|
|
54
|
+
mistake with canvas packs.
|
|
55
|
+
|
|
56
|
+
The viewport supplies only STRUCTURAL css (positioning, transform, cursor, touch-action).
|
|
57
|
+
The app owns cosmetics — size, background, border-radius — so the two never fight.
|
|
58
|
+
|
|
59
|
+
THE POINTER-CLAIM DELEGATE is the whole content contract: on pointerdown the viewport asks
|
|
60
|
+
onClaimPointer whether you claim this event. Return a drag handle and you drive the drag
|
|
61
|
+
(deltas arrive in WORLD units, already divided by the zoom); return null and the viewport
|
|
62
|
+
pans. Keep any "did it actually move" state in the handle closure when your own rule for
|
|
63
|
+
that differs from the viewport's threshold.
|
|
64
|
+
|
|
65
|
+
NAVIGATE VS INTERACT — only needed when children swallow pointer events (iframes, or
|
|
66
|
+
anything with its own handlers). Pass captureSelector and in navigate mode each matching
|
|
67
|
+
child gets a transparent overlay so panning works over it; setMode('interact') removes the
|
|
68
|
+
overlays so the child behaves normally (forms, scroll, microphone). Holding space is a
|
|
69
|
+
temporary navigate, middle-mouse always pans, Escape returns to navigate. Call
|
|
70
|
+
refreshCaptures() after adding or removing children. Omit captureSelector entirely and no
|
|
71
|
+
window listeners are attached at all — plain DOM children you render yourself need none of
|
|
72
|
+
this.
|
|
73
|
+
|
|
74
|
+
Persist the camera from onCameraChange to an app memory key and pass it back as `initial`
|
|
75
|
+
on the next mount, the same way aimeat-dag persists node positions.
|
|
76
|
+
variables:
|
|
77
|
+
- "{{node_url}}"
|
|
78
|
+
|
|
79
|
+
- type: lib
|
|
80
|
+
name: aimeat-viewport
|
|
81
|
+
filename: aimeat-viewport.js
|
|
82
|
+
exports:
|
|
83
|
+
- create
|
|
84
|
+
api_surface: |
|
|
85
|
+
AIMEAT.viewport.create(elOrSelector, { classPrefix?, minZoom?, maxZoom?, initial?,
|
|
86
|
+
fitPadding?, fitMaxZoom?, centerMinZoom?, dragThreshold?, contentBBox?, onClaimPointer?,
|
|
87
|
+
onTap?, onCameraChange?, captureSelector?, mode? })
|
|
88
|
+
-> { host, world, cam(), scale(), setCamera(cam, animated), fit(animated),
|
|
89
|
+
centerOn(rect, animated), clientToWorld(cx,cy), worldToClient(wx,wy),
|
|
90
|
+
setMode('navigate'|'interact'), getMode(), refreshCaptures(), destroy() }
|
|
91
|
+
|
|
92
|
+
The consumer appends content to `world` in world coordinates and answers onClaimPointer
|
|
93
|
+
for anything draggable. Gestures: drag to pan, wheel to zoom at the cursor, two-finger
|
|
94
|
+
pinch to zoom about the midpoint. With captureSelector set, children that swallow pointer
|
|
95
|
+
events get a transparent overlay in navigate mode; space-hold, middle-mouse and Escape
|
|
96
|
+
behave as in other canvas tools.
|
|
97
|
+
|
|
98
|
+
Zero dependencies. Structural CSS only (the app owns cosmetics).
|
|
99
|
+
prefers-reduced-motion safe. Idempotent namespace guard: aimeat-dag embeds a
|
|
100
|
+
byte-identical copy so it can ship as a single script tag, and loading both is safe.
|