aimeat 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.env.example +9 -4
- package/dist/locales/en.json +63 -1
- package/dist/locales/fi.json +63 -1
- package/dist/public/components/LinkPreview.js +101 -0
- package/dist/public/components/NotificationBell.js +18 -1
- package/dist/public/cortex-bundled/aimeat-charts.js +158 -10
- package/dist/public/cortex-bundled/aimeat-charts.yaml +1 -1
- package/dist/public/cortex-bundled/aimeat-dag.js +515 -173
- package/dist/public/cortex-bundled/aimeat-dag.yaml +1 -1
- package/dist/public/cortex-bundled/aimeat-i18n.js +6 -1
- package/dist/public/cortex-bundled/aimeat-i18n.yaml +1 -1
- package/dist/public/cortex-bundled/aimeat-surface.js +577 -0
- package/dist/public/cortex-bundled/aimeat-surface.yaml +107 -0
- package/dist/public/cortex-bundled/aimeat-viewport.js +405 -0
- package/dist/public/cortex-bundled/aimeat-viewport.yaml +100 -0
- package/dist/public/css/theme.css +57 -7
- package/dist/public/css/views/admin.css +8 -1
- package/dist/public/css/views/app-grant.css +18 -0
- package/dist/public/css/views/inbox.css +47 -1
- package/dist/public/css/views/portfolio.css +46 -0
- package/dist/public/css/views/profile.css +38 -4
- package/dist/public/js/services/apps.js +19 -3
- package/dist/public/js/services/messages-ai-prompts.js +38 -0
- package/dist/public/js/services/messages.js +26 -4
- package/dist/public/js/services/notebook.js +76 -0
- package/dist/public/js/services/unfurl.js +43 -0
- package/dist/public/lib/VENDORED.md +6 -3
- package/dist/public/lib/aimeat-daisyui-bridge.css +39 -2
- package/dist/public/lib/aimeat-theme.css +538 -0
- package/dist/public/lib/fonts/LICENSE.md +11 -4
- package/dist/public/lib/fonts/fraunces-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/fraunces-var-latin.woff2 +0 -0
- package/dist/public/lib/fonts/inter-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/inter-var-latin.woff2 +0 -0
- package/dist/public/lib/fonts/jetbrains-mono-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/jetbrains-mono-var-latin.woff2 +0 -0
- package/dist/public/lib/fonts/space-grotesk-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/space-grotesk-var-latin.woff2 +0 -0
- package/dist/public/lib/samples/LICENSE.md +11 -0
- package/dist/public/lib/samples/bass/A1.mp3 +0 -0
- package/dist/public/lib/samples/bass/B2.mp3 +0 -0
- package/dist/public/lib/samples/bass/D2.mp3 +0 -0
- package/dist/public/lib/samples/bass/E1.mp3 +0 -0
- package/dist/public/lib/samples/bass/E3.mp3 +0 -0
- package/dist/public/lib/samples/bass/G2.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C2.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C3.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C4.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C5.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C6.mp3 +0 -0
- package/dist/public/lib/samples/epiano/G2.mp3 +0 -0
- package/dist/public/lib/samples/epiano/G3.mp3 +0 -0
- package/dist/public/lib/samples/epiano/G4.mp3 +0 -0
- package/dist/public/lib/samples/epiano/G5.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/A2.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/A4.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/B3.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/D3.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/E2.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/E4.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/E5.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/G3.mp3 +0 -0
- package/dist/public/lib/samples/organ/C2.mp3 +0 -0
- package/dist/public/lib/samples/organ/C3.mp3 +0 -0
- package/dist/public/lib/samples/organ/C4.mp3 +0 -0
- package/dist/public/lib/samples/organ/C5.mp3 +0 -0
- package/dist/public/lib/samples/organ/C6.mp3 +0 -0
- package/dist/public/lib/samples/organ/G2.mp3 +0 -0
- package/dist/public/lib/samples/organ/G3.mp3 +0 -0
- package/dist/public/lib/samples/organ/G4.mp3 +0 -0
- package/dist/public/lib/samples/organ/G5.mp3 +0 -0
- package/dist/public/lib/samples/strings/C2.mp3 +0 -0
- package/dist/public/lib/samples/strings/C3.mp3 +0 -0
- package/dist/public/lib/samples/strings/C4.mp3 +0 -0
- package/dist/public/lib/samples/strings/C5.mp3 +0 -0
- package/dist/public/lib/samples/strings/C6.mp3 +0 -0
- package/dist/public/lib/samples/strings/G2.mp3 +0 -0
- package/dist/public/lib/samples/strings/G3.mp3 +0 -0
- package/dist/public/lib/samples/strings/G4.mp3 +0 -0
- package/dist/public/lib/samples/strings/G5.mp3 +0 -0
- package/dist/public/lib/samples/theme-check.html +92 -0
- package/dist/public/lib/samples/themes-boot.js +20 -0
- package/dist/public/lib/samples/themes.html +154 -0
- package/dist/public/lib/samples/themes.js +60 -0
- package/dist/public/lib/samples/trumpet/A3.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/A4.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/A5.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/C4.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/C5.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/E3.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/E4.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/E5.mp3 +0 -0
- package/dist/public/spa.html +2 -0
- package/dist/public/views/app-grant.js +24 -4
- package/dist/public/views/portfolio.js +61 -6
- package/dist/public/views/profile/access-tab/connected-apps.js +81 -5
- package/dist/public/views/profile/apps-tab.js +18 -1
- package/dist/public/views/profile/extensions-tab.maturity.js +4 -1
- package/dist/public/views/profile/inbox-tab/ai-actions.js +86 -0
- package/dist/public/views/profile/inbox-tab/components.js +141 -10
- package/dist/public/views/profile/inbox-tab/helpers.js +26 -0
- package/dist/public/views/profile/inbox-tab/panels.js +18 -3
- package/dist/public/views/profile/inbox-tab/use-thread-ux.js +47 -3
- package/dist/public/views/profile/inbox-tab.js +46 -49
- package/dist/public/views/profile/landing-page.cards.js +7 -0
- package/dist/public/views/profile/landing-page.js +12 -1
- package/dist/public/views/profile/libraries-tab.js +10 -2
- package/dist/public/views/profile/skills-tab.js +1 -1
- package/dist/public/views/profile/wallet-tab.js +64 -0
- package/dist/public/views/public-workspace-viewer.js +1 -1
- package/dist/public/views/start.js +2 -1
- package/dist/scripts/build-sdk-libs.d.ts +16 -0
- package/dist/scripts/build-sdk-libs.d.ts.map +1 -0
- package/dist/scripts/build-sdk-libs.js +112 -0
- package/dist/scripts/build-sdk-libs.js.map +1 -0
- package/dist/scripts/check-openapi.d.ts +2 -0
- package/dist/scripts/check-openapi.d.ts.map +1 -0
- package/dist/scripts/check-openapi.js +139 -0
- package/dist/scripts/check-openapi.js.map +1 -0
- package/dist/scripts/embed-viewport.d.ts +23 -0
- package/dist/scripts/embed-viewport.d.ts.map +1 -0
- package/dist/scripts/embed-viewport.js +116 -0
- package/dist/scripts/embed-viewport.js.map +1 -0
- package/dist/src/auth/sse-domain-scopes.d.ts +50 -0
- package/dist/src/auth/sse-domain-scopes.d.ts.map +1 -0
- package/dist/src/auth/sse-domain-scopes.js +111 -0
- package/dist/src/auth/sse-domain-scopes.js.map +1 -0
- package/dist/src/cli/connect/auth.d.ts +15 -0
- package/dist/src/cli/connect/auth.d.ts.map +1 -1
- package/dist/src/cli/connect/auth.js +25 -6
- package/dist/src/cli/connect/auth.js.map +1 -1
- package/dist/src/cli/connect/keychain.d.ts +9 -0
- package/dist/src/cli/connect/keychain.d.ts.map +1 -1
- package/dist/src/cli/connect/keychain.js +21 -8
- package/dist/src/cli/connect/keychain.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/agent-tasks.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/agent-tasks.js +4 -1
- package/dist/src/cli/connect/mcp/tools/agent-tasks.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/core.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/core.js +14 -3
- package/dist/src/cli/connect/mcp/tools/core.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/exchange.d.ts +18 -0
- package/dist/src/cli/connect/mcp/tools/exchange.d.ts.map +1 -0
- package/dist/src/cli/connect/mcp/tools/exchange.js +170 -0
- package/dist/src/cli/connect/mcp/tools/exchange.js.map +1 -0
- package/dist/src/cli/connect/mcp/tools/index.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/index.js +2 -0
- package/dist/src/cli/connect/mcp/tools/index.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/workspaces.d.ts +3 -0
- package/dist/src/cli/connect/mcp/tools/workspaces.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/workspaces.js +4 -2
- package/dist/src/cli/connect/mcp/tools/workspaces.js.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-core.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-core.js +13 -1
- package/dist/src/cli/connect/tool-call-defs-core.js.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-exchange.d.ts +3 -0
- package/dist/src/cli/connect/tool-call-defs-exchange.d.ts.map +1 -0
- package/dist/src/cli/connect/tool-call-defs-exchange.js +146 -0
- package/dist/src/cli/connect/tool-call-defs-exchange.js.map +1 -0
- package/dist/src/cli/connect/tool-call.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call.js +2 -0
- package/dist/src/cli/connect/tool-call.js.map +1 -1
- package/dist/src/commerce/__tests__/x402-registry.test.d.ts +2 -0
- package/dist/src/commerce/__tests__/x402-registry.test.d.ts.map +1 -0
- package/dist/src/commerce/__tests__/x402-registry.test.js +105 -0
- package/dist/src/commerce/__tests__/x402-registry.test.js.map +1 -0
- package/dist/src/commerce/evm-address.d.ts +21 -0
- package/dist/src/commerce/evm-address.d.ts.map +1 -0
- package/dist/src/commerce/evm-address.js +94 -0
- package/dist/src/commerce/evm-address.js.map +1 -0
- package/dist/src/commerce/money.d.ts +18 -5
- package/dist/src/commerce/money.d.ts.map +1 -1
- package/dist/src/commerce/money.js +27 -6
- package/dist/src/commerce/money.js.map +1 -1
- package/dist/src/commerce/session-service.d.ts +14 -0
- package/dist/src/commerce/session-service.d.ts.map +1 -1
- package/dist/src/commerce/session-service.js +1 -1
- package/dist/src/commerce/session-service.js.map +1 -1
- package/dist/src/commerce/x402-facilitator.d.ts +64 -13
- package/dist/src/commerce/x402-facilitator.d.ts.map +1 -1
- package/dist/src/commerce/x402-facilitator.js +71 -19
- package/dist/src/commerce/x402-facilitator.js.map +1 -1
- package/dist/src/commerce/x402-handler.d.ts +13 -7
- package/dist/src/commerce/x402-handler.d.ts.map +1 -1
- package/dist/src/commerce/x402-handler.js +23 -10
- package/dist/src/commerce/x402-handler.js.map +1 -1
- package/dist/src/commerce/x402.d.ts +11 -6
- package/dist/src/commerce/x402.d.ts.map +1 -1
- package/dist/src/commerce/x402.js +10 -7
- package/dist/src/commerce/x402.js.map +1 -1
- package/dist/src/config-types.d.ts +12 -0
- package/dist/src/config-types.d.ts.map +1 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +8 -0
- package/dist/src/config.js.map +1 -1
- package/dist/src/data/app-templates/shells.d.ts +15 -3
- package/dist/src/data/app-templates/shells.d.ts.map +1 -1
- package/dist/src/data/app-templates/shells.js +97 -12
- package/dist/src/data/app-templates/shells.js.map +1 -1
- package/dist/src/data/app-templates.js +2 -2
- package/dist/src/data/app-templates.js.map +1 -1
- package/dist/src/data/appdev-pitfalls.d.ts +2 -0
- package/dist/src/data/appdev-pitfalls.d.ts.map +1 -1
- package/dist/src/data/appdev-pitfalls.js +24 -1
- package/dist/src/data/appdev-pitfalls.js.map +1 -1
- package/dist/src/data/library-packs/cortex.d.ts.map +1 -1
- package/dist/src/data/library-packs/cortex.js +108 -5
- package/dist/src/data/library-packs/cortex.js.map +1 -1
- package/dist/src/data/library-packs/sdk.d.ts.map +1 -1
- package/dist/src/data/library-packs/sdk.js +32 -8
- package/dist/src/data/library-packs/sdk.js.map +1 -1
- package/dist/src/data/library-packs/vendored.d.ts.map +1 -1
- package/dist/src/data/library-packs/vendored.js +83 -6
- package/dist/src/data/library-packs/vendored.js.map +1 -1
- package/dist/src/generated/api-types.d.ts +2039 -24
- package/dist/src/generated/api-types.d.ts.map +1 -1
- package/dist/src/mcp/agent-tasks.d.ts +4 -0
- package/dist/src/mcp/agent-tasks.d.ts.map +1 -1
- package/dist/src/mcp/agent-tasks.js +20 -2
- package/dist/src/mcp/agent-tasks.js.map +1 -1
- package/dist/src/mcp/annotations.d.ts.map +1 -1
- package/dist/src/mcp/annotations.js +20 -0
- package/dist/src/mcp/annotations.js.map +1 -1
- package/dist/src/mcp/apps.d.ts.map +1 -1
- package/dist/src/mcp/apps.js +8 -4
- package/dist/src/mcp/apps.js.map +1 -1
- package/dist/src/mcp/capabilities.d.ts +7 -1
- package/dist/src/mcp/capabilities.d.ts.map +1 -1
- package/dist/src/mcp/capabilities.js +5 -2
- package/dist/src/mcp/capabilities.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/commerce.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/commerce.js +4 -2
- package/dist/src/mcp/catalog/definitions/commerce.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.js +4 -3
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/exchange.d.ts +18 -0
- package/dist/src/mcp/catalog/definitions/exchange.d.ts.map +1 -0
- package/dist/src/mcp/catalog/definitions/exchange.js +182 -0
- package/dist/src/mcp/catalog/definitions/exchange.js.map +1 -0
- package/dist/src/mcp/catalog/definitions/organisms-workspaces-apps.js +1 -1
- package/dist/src/mcp/catalog/definitions/organisms-workspaces-apps.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js +3 -2
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js.map +1 -1
- package/dist/src/mcp/catalog/definitions.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions.js +2 -0
- package/dist/src/mcp/catalog/definitions.js.map +1 -1
- package/dist/src/mcp/catalog/output-schemas.d.ts +6 -1
- package/dist/src/mcp/catalog/output-schemas.d.ts.map +1 -1
- package/dist/src/mcp/catalog/output-schemas.js +6 -1
- package/dist/src/mcp/catalog/output-schemas.js.map +1 -1
- package/dist/src/mcp/catalog/scopes.d.ts.map +1 -1
- package/dist/src/mcp/catalog/scopes.js +22 -0
- package/dist/src/mcp/catalog/scopes.js.map +1 -1
- package/dist/src/mcp/catalog/surfaces.d.ts.map +1 -1
- package/dist/src/mcp/catalog/surfaces.js +14 -0
- package/dist/src/mcp/catalog/surfaces.js.map +1 -1
- package/dist/src/mcp/commerce.d.ts.map +1 -1
- package/dist/src/mcp/commerce.js +15 -3
- package/dist/src/mcp/commerce.js.map +1 -1
- package/dist/src/mcp/core-storage.d.ts +23 -0
- package/dist/src/mcp/core-storage.d.ts.map +1 -0
- package/dist/src/mcp/core-storage.js +157 -0
- package/dist/src/mcp/core-storage.js.map +1 -0
- package/dist/src/mcp/core.d.ts +16 -0
- package/dist/src/mcp/core.d.ts.map +1 -1
- package/dist/src/mcp/core.js +75 -119
- package/dist/src/mcp/core.js.map +1 -1
- package/dist/src/mcp/dm-messages.d.ts +4 -0
- package/dist/src/mcp/dm-messages.d.ts.map +1 -1
- package/dist/src/mcp/dm-messages.js +43 -2
- package/dist/src/mcp/dm-messages.js.map +1 -1
- package/dist/src/mcp/exchange-run.d.ts +5 -0
- package/dist/src/mcp/exchange-run.d.ts.map +1 -0
- package/dist/src/mcp/exchange-run.js +226 -0
- package/dist/src/mcp/exchange-run.js.map +1 -0
- package/dist/src/mcp/exchange.d.ts +5 -0
- package/dist/src/mcp/exchange.d.ts.map +1 -0
- package/dist/src/mcp/exchange.js +352 -0
- package/dist/src/mcp/exchange.js.map +1 -0
- package/dist/src/mcp/extensions.d.ts.map +1 -1
- package/dist/src/mcp/extensions.js +17 -2
- package/dist/src/mcp/extensions.js.map +1 -1
- package/dist/src/mcp/index.d.ts +5 -0
- package/dist/src/mcp/index.d.ts.map +1 -1
- package/dist/src/mcp/index.js +26 -3
- package/dist/src/mcp/index.js.map +1 -1
- package/dist/src/mcp/memory-namespace-hints.d.ts +33 -0
- package/dist/src/mcp/memory-namespace-hints.d.ts.map +1 -0
- package/dist/src/mcp/memory-namespace-hints.js +60 -0
- package/dist/src/mcp/memory-namespace-hints.js.map +1 -0
- package/dist/src/mcp/workspaces.d.ts +5 -0
- package/dist/src/mcp/workspaces.d.ts.map +1 -1
- package/dist/src/mcp/workspaces.js +5 -3
- package/dist/src/mcp/workspaces.js.map +1 -1
- package/dist/src/models/agent-task-schemas.d.ts +25 -3
- package/dist/src/models/agent-task-schemas.d.ts.map +1 -1
- package/dist/src/models/agent-task-schemas.js +16 -0
- package/dist/src/models/agent-task-schemas.js.map +1 -1
- package/dist/src/models/app-tool-schemas.d.ts +573 -2
- package/dist/src/models/app-tool-schemas.d.ts.map +1 -1
- package/dist/src/models/app-tool-schemas.js +73 -2
- package/dist/src/models/app-tool-schemas.js.map +1 -1
- package/dist/src/models/odps-schemas.d.ts +305 -0
- package/dist/src/models/odps-schemas.d.ts.map +1 -0
- package/dist/src/models/odps-schemas.js +182 -0
- package/dist/src/models/odps-schemas.js.map +1 -0
- package/dist/src/models/offer-schemas.d.ts +359 -4
- package/dist/src/models/offer-schemas.d.ts.map +1 -1
- package/dist/src/models/offer-schemas.js +37 -0
- package/dist/src/models/offer-schemas.js.map +1 -1
- package/dist/src/models/schemas.d.ts +7 -3
- package/dist/src/models/schemas.d.ts.map +1 -1
- package/dist/src/models/schemas.js +13 -1
- package/dist/src/models/schemas.js.map +1 -1
- package/dist/src/models/webhook-schemas.d.ts +8 -8
- package/dist/src/routes/agent-tasks/create-read.d.ts +4 -0
- package/dist/src/routes/agent-tasks/create-read.d.ts.map +1 -1
- package/dist/src/routes/agent-tasks/create-read.js +20 -1
- package/dist/src/routes/agent-tasks/create-read.js.map +1 -1
- package/dist/src/routes/agent-tasks/lifecycle.d.ts.map +1 -1
- package/dist/src/routes/agent-tasks/lifecycle.js +10 -0
- package/dist/src/routes/agent-tasks/lifecycle.js.map +1 -1
- package/dist/src/routes/agents/device-auth.d.ts +4 -0
- package/dist/src/routes/agents/device-auth.d.ts.map +1 -1
- package/dist/src/routes/agents/device-auth.js +19 -4
- package/dist/src/routes/agents/device-auth.js.map +1 -1
- package/dist/src/routes/agents/offers.d.ts +2 -0
- package/dist/src/routes/agents/offers.d.ts.map +1 -1
- package/dist/src/routes/agents/offers.js +0 -0
- package/dist/src/routes/agents/offers.js.map +1 -1
- package/dist/src/routes/app-grants.d.ts +12 -0
- package/dist/src/routes/app-grants.d.ts.map +1 -1
- package/dist/src/routes/app-grants.js +90 -27
- package/dist/src/routes/app-grants.js.map +1 -1
- package/dist/src/routes/apps/drafts.d.ts +3 -0
- package/dist/src/routes/apps/drafts.d.ts.map +1 -1
- package/dist/src/routes/apps/drafts.js +63 -1
- package/dist/src/routes/apps/drafts.js.map +1 -1
- package/dist/src/routes/apps/fork-manage.d.ts.map +1 -1
- package/dist/src/routes/apps/fork-manage.js +24 -1
- package/dist/src/routes/apps/fork-manage.js.map +1 -1
- package/dist/src/routes/apps/publish.d.ts +4 -0
- package/dist/src/routes/apps/publish.d.ts.map +1 -1
- package/dist/src/routes/apps/publish.js +44 -3
- package/dist/src/routes/apps/publish.js.map +1 -1
- package/dist/src/routes/apps-cost.d.ts +25 -0
- package/dist/src/routes/apps-cost.d.ts.map +1 -0
- package/dist/src/routes/apps-cost.js +107 -0
- package/dist/src/routes/apps-cost.js.map +1 -0
- package/dist/src/routes/commerce.d.ts.map +1 -1
- package/dist/src/routes/commerce.js +122 -2
- package/dist/src/routes/commerce.js.map +1 -1
- package/dist/src/routes/exchange-market.d.ts +32 -0
- package/dist/src/routes/exchange-market.d.ts.map +1 -0
- package/dist/src/routes/exchange-market.js +580 -0
- package/dist/src/routes/exchange-market.js.map +1 -0
- package/dist/src/routes/exchange.d.ts +33 -0
- package/dist/src/routes/exchange.d.ts.map +1 -0
- package/dist/src/routes/exchange.js +398 -0
- package/dist/src/routes/exchange.js.map +1 -0
- package/dist/src/routes/extensions/actions.d.ts.map +1 -1
- package/dist/src/routes/extensions/actions.js +18 -0
- package/dist/src/routes/extensions/actions.js.map +1 -1
- package/dist/src/routes/extensions/crud.d.ts.map +1 -1
- package/dist/src/routes/extensions/crud.js +36 -3
- package/dist/src/routes/extensions/crud.js.map +1 -1
- package/dist/src/routes/extensions/entitlement-gate.d.ts +33 -0
- package/dist/src/routes/extensions/entitlement-gate.d.ts.map +1 -0
- package/dist/src/routes/extensions/entitlement-gate.js +156 -0
- package/dist/src/routes/extensions/entitlement-gate.js.map +1 -0
- package/dist/src/routes/extensions/manifest.d.ts +15 -0
- package/dist/src/routes/extensions/manifest.d.ts.map +1 -1
- package/dist/src/routes/extensions/manifest.js +101 -2
- package/dist/src/routes/extensions/manifest.js.map +1 -1
- package/dist/src/routes/extensions/pacing.d.ts +31 -0
- package/dist/src/routes/extensions/pacing.d.ts.map +1 -0
- package/dist/src/routes/extensions/pacing.js +73 -0
- package/dist/src/routes/extensions/pacing.js.map +1 -0
- package/dist/src/routes/extensions/paywall.d.ts.map +1 -1
- package/dist/src/routes/extensions/paywall.js +20 -11
- package/dist/src/routes/extensions/paywall.js.map +1 -1
- package/dist/src/routes/federation-sync/messaging.d.ts.map +1 -1
- package/dist/src/routes/federation-sync/messaging.js +3 -1
- package/dist/src/routes/federation-sync/messaging.js.map +1 -1
- package/dist/src/routes/ghii/recovery.d.ts +2 -0
- package/dist/src/routes/ghii/recovery.d.ts.map +1 -1
- package/dist/src/routes/ghii/recovery.js +7 -0
- package/dist/src/routes/ghii/recovery.js.map +1 -1
- package/dist/src/routes/ghii/register-login.d.ts +4 -0
- package/dist/src/routes/ghii/register-login.d.ts.map +1 -1
- package/dist/src/routes/ghii/register-login.js +45 -22
- package/dist/src/routes/ghii/register-login.js.map +1 -1
- package/dist/src/routes/ghii/web-verify.d.ts +5 -0
- package/dist/src/routes/ghii/web-verify.d.ts.map +1 -1
- package/dist/src/routes/ghii/web-verify.js +24 -3
- package/dist/src/routes/ghii/web-verify.js.map +1 -1
- package/dist/src/routes/libs/sdk-serve.d.ts +11 -0
- package/dist/src/routes/libs/sdk-serve.d.ts.map +1 -0
- package/dist/src/routes/libs/sdk-serve.js +53 -0
- package/dist/src/routes/libs/sdk-serve.js.map +1 -0
- package/dist/src/routes/libs.d.ts +7 -1
- package/dist/src/routes/libs.d.ts.map +1 -1
- package/dist/src/routes/libs.js +65 -146
- package/dist/src/routes/libs.js.map +1 -1
- package/dist/src/routes/memory/crud.d.ts.map +1 -1
- package/dist/src/routes/memory/crud.js +10 -0
- package/dist/src/routes/memory/crud.js.map +1 -1
- package/dist/src/routes/messages.d.ts +3 -0
- package/dist/src/routes/messages.d.ts.map +1 -1
- package/dist/src/routes/messages.js +9 -0
- package/dist/src/routes/messages.js.map +1 -1
- package/dist/src/routes/notifications.d.ts +6 -3
- package/dist/src/routes/notifications.d.ts.map +1 -1
- package/dist/src/routes/notifications.js +32 -3
- package/dist/src/routes/notifications.js.map +1 -1
- package/dist/src/routes/organisms/crud.d.ts +3 -0
- package/dist/src/routes/organisms/crud.d.ts.map +1 -1
- package/dist/src/routes/organisms/crud.js +5 -2
- package/dist/src/routes/organisms/crud.js.map +1 -1
- package/dist/src/routes/organisms/workspace-access.d.ts.map +1 -1
- package/dist/src/routes/organisms/workspace-access.js +38 -20
- package/dist/src/routes/organisms/workspace-access.js.map +1 -1
- package/dist/src/routes/organisms/workspace-read.d.ts.map +1 -1
- package/dist/src/routes/organisms/workspace-read.js +7 -2
- package/dist/src/routes/organisms/workspace-read.js.map +1 -1
- package/dist/src/routes/public-stats.d.ts +7 -0
- package/dist/src/routes/public-stats.d.ts.map +1 -1
- package/dist/src/routes/public-stats.js +28 -7
- package/dist/src/routes/public-stats.js.map +1 -1
- package/dist/src/routes/sse.d.ts +7 -0
- package/dist/src/routes/sse.d.ts.map +1 -1
- package/dist/src/routes/sse.js +36 -6
- package/dist/src/routes/sse.js.map +1 -1
- package/dist/src/routes/storage-files.d.ts +11 -0
- package/dist/src/routes/storage-files.d.ts.map +1 -1
- package/dist/src/routes/storage-files.js +58 -51
- package/dist/src/routes/storage-files.js.map +1 -1
- package/dist/src/routes/subdomains.d.ts +4 -0
- package/dist/src/routes/subdomains.d.ts.map +1 -1
- package/dist/src/routes/subdomains.js +42 -5
- package/dist/src/routes/subdomains.js.map +1 -1
- package/dist/src/routes/unfurl.d.ts +27 -0
- package/dist/src/routes/unfurl.d.ts.map +1 -0
- package/dist/src/routes/unfurl.js +180 -0
- package/dist/src/routes/unfurl.js.map +1 -0
- package/dist/src/routes/upload.d.ts +13 -0
- package/dist/src/routes/upload.d.ts.map +1 -1
- package/dist/src/routes/upload.js +115 -28
- package/dist/src/routes/upload.js.map +1 -1
- package/dist/src/routes/webmcp.d.ts +3 -0
- package/dist/src/routes/webmcp.d.ts.map +1 -1
- package/dist/src/routes/webmcp.js +59 -0
- package/dist/src/routes/webmcp.js.map +1 -1
- package/dist/src/schemas/knowledge-package.d.ts +1 -1
- package/dist/src/server-bootstrap/routes-loader.d.ts +1 -0
- package/dist/src/server-bootstrap/routes-loader.d.ts.map +1 -1
- package/dist/src/server-bootstrap/routes-loader.js +8 -0
- package/dist/src/server-bootstrap/routes-loader.js.map +1 -1
- package/dist/src/server-bootstrap/static-files.d.ts +4 -0
- package/dist/src/server-bootstrap/static-files.d.ts.map +1 -1
- package/dist/src/server-bootstrap/static-files.js +11 -0
- package/dist/src/server-bootstrap/static-files.js.map +1 -1
- package/dist/src/services/agent-face.d.ts +10 -2
- package/dist/src/services/agent-face.d.ts.map +1 -1
- package/dist/src/services/agent-face.js +10 -4
- package/dist/src/services/agent-face.js.map +1 -1
- package/dist/src/services/app-tool-interfaces.d.ts +37 -0
- package/dist/src/services/app-tool-interfaces.d.ts.map +1 -0
- package/dist/src/services/app-tool-interfaces.js +101 -0
- package/dist/src/services/app-tool-interfaces.js.map +1 -0
- package/dist/src/services/build-app-prompt.d.ts +22 -0
- package/dist/src/services/build-app-prompt.d.ts.map +1 -1
- package/dist/src/services/build-app-prompt.js +108 -11
- package/dist/src/services/build-app-prompt.js.map +1 -1
- package/dist/src/services/call-timing.d.ts +51 -0
- package/dist/src/services/call-timing.d.ts.map +1 -0
- package/dist/src/services/call-timing.js +91 -0
- package/dist/src/services/call-timing.js.map +1 -0
- package/dist/src/services/capability-invoke.d.ts +2 -0
- package/dist/src/services/capability-invoke.d.ts.map +1 -1
- package/dist/src/services/capability-invoke.js +10 -0
- package/dist/src/services/capability-invoke.js.map +1 -1
- package/dist/src/services/config-schema.d.ts.map +1 -1
- package/dist/src/services/config-schema.js +6 -0
- package/dist/src/services/config-schema.js.map +1 -1
- package/dist/src/services/contacts.d.ts +25 -1
- package/dist/src/services/contacts.d.ts.map +1 -1
- package/dist/src/services/contacts.js +30 -0
- package/dist/src/services/contacts.js.map +1 -1
- package/dist/src/services/draft-token.d.ts +22 -2
- package/dist/src/services/draft-token.d.ts.map +1 -1
- package/dist/src/services/draft-token.js +52 -3
- package/dist/src/services/draft-token.js.map +1 -1
- package/dist/src/services/entitlement-money.d.ts +55 -0
- package/dist/src/services/entitlement-money.d.ts.map +1 -0
- package/dist/src/services/entitlement-money.js +68 -0
- package/dist/src/services/entitlement-money.js.map +1 -0
- package/dist/src/services/exchange-market.d.ts +280 -0
- package/dist/src/services/exchange-market.d.ts.map +1 -0
- package/dist/src/services/exchange-market.js +276 -0
- package/dist/src/services/exchange-market.js.map +1 -0
- package/dist/src/services/exchange-odps.d.ts +58 -0
- package/dist/src/services/exchange-odps.d.ts.map +1 -0
- package/dist/src/services/exchange-odps.js +400 -0
- package/dist/src/services/exchange-odps.js.map +1 -0
- package/dist/src/services/exchange-projection.d.ts +61 -0
- package/dist/src/services/exchange-projection.d.ts.map +1 -0
- package/dist/src/services/exchange-projection.js +504 -0
- package/dist/src/services/exchange-projection.js.map +1 -0
- package/dist/src/services/exchange-proposals.d.ts +47 -0
- package/dist/src/services/exchange-proposals.d.ts.map +1 -0
- package/dist/src/services/exchange-proposals.js +73 -0
- package/dist/src/services/exchange-proposals.js.map +1 -0
- package/dist/src/services/exchange-work.d.ts +30 -0
- package/dist/src/services/exchange-work.d.ts.map +1 -0
- package/dist/src/services/exchange-work.js +43 -0
- package/dist/src/services/exchange-work.js.map +1 -0
- package/dist/src/services/extension-files.d.ts +64 -0
- package/dist/src/services/extension-files.d.ts.map +1 -0
- package/dist/src/services/extension-files.js +88 -0
- package/dist/src/services/extension-files.js.map +1 -0
- package/dist/src/services/extension-runtime.d.ts +33 -0
- package/dist/src/services/extension-runtime.d.ts.map +1 -1
- package/dist/src/services/extension-runtime.js +52 -0
- package/dist/src/services/extension-runtime.js.map +1 -1
- package/dist/src/services/file-refs.d.ts +105 -0
- package/dist/src/services/file-refs.d.ts.map +1 -0
- package/dist/src/services/file-refs.js +106 -0
- package/dist/src/services/file-refs.js.map +1 -0
- package/dist/src/services/message-send.d.ts.map +1 -1
- package/dist/src/services/message-send.js +4 -1
- package/dist/src/services/message-send.js.map +1 -1
- package/dist/src/services/metered-entitlements.d.ts +210 -0
- package/dist/src/services/metered-entitlements.d.ts.map +1 -0
- package/dist/src/services/metered-entitlements.js +268 -0
- package/dist/src/services/metered-entitlements.js.map +1 -0
- package/dist/src/services/notify.d.ts +7 -0
- package/dist/src/services/notify.d.ts.map +1 -1
- package/dist/src/services/notify.js +35 -0
- package/dist/src/services/notify.js.map +1 -1
- package/dist/src/services/owner-memory.d.ts +30 -1
- package/dist/src/services/owner-memory.d.ts.map +1 -1
- package/dist/src/services/owner-memory.js +31 -14
- package/dist/src/services/owner-memory.js.map +1 -1
- package/dist/src/services/owner-provisioning.d.ts +5 -0
- package/dist/src/services/owner-provisioning.d.ts.map +1 -1
- package/dist/src/services/owner-provisioning.js +20 -2
- package/dist/src/services/owner-provisioning.js.map +1 -1
- package/dist/src/services/task-files.d.ts +51 -0
- package/dist/src/services/task-files.d.ts.map +1 -0
- package/dist/src/services/task-files.js +58 -0
- package/dist/src/services/task-files.js.map +1 -0
- package/dist/src/services/upload-token.d.ts +29 -0
- package/dist/src/services/upload-token.d.ts.map +1 -1
- package/dist/src/services/upload-token.js +37 -0
- package/dist/src/services/upload-token.js.map +1 -1
- package/dist/src/services/upload-zip.d.ts +2 -0
- package/dist/src/services/upload-zip.d.ts.map +1 -1
- package/dist/src/services/upload-zip.js +5 -1
- package/dist/src/services/upload-zip.js.map +1 -1
- package/dist/src/services/workspace-meta.d.ts +15 -0
- package/dist/src/services/workspace-meta.d.ts.map +1 -1
- package/dist/src/services/workspace-meta.js +17 -0
- package/dist/src/services/workspace-meta.js.map +1 -1
- package/dist/src/services/workspace-provision.d.ts +3 -0
- package/dist/src/services/workspace-provision.d.ts.map +1 -1
- package/dist/src/services/workspace-provision.js +5 -3
- package/dist/src/services/workspace-provision.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.d.ts +1 -0
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.js +10 -0
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/apps.d.ts +1 -0
- package/dist/src/storage/providers/postgres-kysely/methods/apps.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/apps.js +2 -0
- package/dist/src/storage/providers/postgres-kysely/methods/apps.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/identity.d.ts +1 -0
- package/dist/src/storage/providers/postgres-kysely/methods/identity.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/identity.js +4 -0
- package/dist/src/storage/providers/postgres-kysely/methods/identity.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/memory.d.ts +2 -0
- package/dist/src/storage/providers/postgres-kysely/methods/memory.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/memory.js +12 -1
- package/dist/src/storage/providers/postgres-kysely/methods/memory.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/organisms.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/organisms.js +5 -1
- package/dist/src/storage/providers/postgres-kysely/methods/organisms.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/migrations/0011_unique_verified_email.sql +25 -0
- package/dist/src/storage/providers/postgres-kysely/migrations/0012_unique_live_app_grant.sql +29 -0
- package/dist/src/storage/providers/sqlite/methods/apps.d.ts +4 -0
- package/dist/src/storage/providers/sqlite/methods/apps.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/apps.js +9 -0
- package/dist/src/storage/providers/sqlite/methods/apps.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/governance.d.ts +1 -0
- package/dist/src/storage/providers/sqlite/methods/governance.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/governance.js +4 -1
- package/dist/src/storage/providers/sqlite/methods/governance.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.d.ts +1 -0
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.js +4 -0
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/owner.d.ts +5 -0
- package/dist/src/storage/providers/sqlite/methods/owner.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/owner.js +8 -0
- package/dist/src/storage/providers/sqlite/methods/owner.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.d.ts +3 -0
- package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.js +40 -0
- package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
- package/dist/src/storage/repositories/app-grant.repository.d.ts +9 -1
- package/dist/src/storage/repositories/app-grant.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/app.repository.d.ts +0 -0
- package/dist/src/storage/repositories/app.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/identity.repository.d.ts +6 -0
- package/dist/src/storage/repositories/identity.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/memory.repository.d.ts +14 -0
- package/dist/src/storage/repositories/memory.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories-impl/memory-repository.d.ts +8 -1
- package/dist/src/storage/repositories-impl/memory-repository.d.ts.map +1 -1
- package/dist/src/storage/repositories-impl/memory-repository.js +15 -4
- package/dist/src/storage/repositories-impl/memory-repository.js.map +1 -1
- package/dist/src/storage/types/agents-messaging.d.ts +19 -0
- package/dist/src/storage/types/agents-messaging.d.ts.map +1 -1
- package/dist/src/storage/types/agents-messaging.js.map +1 -1
- package/dist/src/storage/types/apps.d.ts +1 -0
- package/dist/src/storage/types/apps.d.ts.map +1 -1
- package/dist/src/storage/types/organisms-federation.d.ts +50 -0
- package/dist/src/storage/types/organisms-federation.d.ts.map +1 -1
- package/dist/src/utils/app-badge.d.ts.map +1 -1
- package/dist/src/utils/app-badge.js +7 -3
- package/dist/src/utils/app-badge.js.map +1 -1
- package/dist/src/utils/app-mobile-lint.d.ts +17 -0
- package/dist/src/utils/app-mobile-lint.d.ts.map +1 -0
- package/dist/src/utils/app-mobile-lint.js +40 -0
- package/dist/src/utils/app-mobile-lint.js.map +1 -0
- package/dist/static/app-catalog/_template.html +18 -82
- package/dist/static/app-catalog/js/apps-io.js +51 -165
- package/dist/static/app-catalog/js/cortex.js +3 -1
- package/dist/static/app-catalog/js/cost.js +100 -0
- package/dist/static/app-catalog/js/db.js +23 -93
- package/dist/static/app-catalog/js/detail.js +568 -59
- package/dist/static/app-catalog/js/favorites.js +71 -0
- package/dist/static/app-catalog/js/i18n-data.js +369 -19
- package/dist/static/app-catalog/js/main.js +50 -139
- package/dist/static/app-catalog/js/migrate.js +88 -0
- package/dist/static/app-catalog/js/monetize.js +205 -17
- package/dist/static/app-catalog/js/odps.js +489 -0
- package/dist/static/app-catalog/js/promote.js +70 -0
- package/dist/static/app-catalog/js/render.js +29 -139
- package/dist/static/app-catalog/js/server-io.js +126 -223
- package/dist/static/app-catalog/js/settings.js +11 -204
- package/dist/static/app-catalog/js/workcopy.js +198 -0
- package/dist/static/app-catalog/styles/app-catalog.css +100 -0
- package/dist/static/app-catalog.html +2220 -1029
- package/dist/static/sdk-libs/_core/config.js +52 -0
- package/dist/static/sdk-libs/_core/http.js +52 -0
- package/dist/static/sdk-libs/_core/namespace.js +33 -0
- package/dist/static/sdk-libs/_core/sdk-globals.d.ts +50 -0
- package/dist/static/sdk-libs/_core/session.js +66 -0
- package/dist/static/sdk-libs/agentface/index.js +102 -0
- package/dist/static/sdk-libs/agents/index.js +305 -0
- package/dist/static/sdk-libs/ai/index.js +153 -0
- package/dist/static/sdk-libs/audio/core.js +111 -0
- package/dist/static/sdk-libs/audio/index.js +380 -0
- package/dist/static/sdk-libs/audio/instruments.js +369 -0
- package/dist/static/sdk-libs/auth/cluster.js +97 -0
- package/dist/static/sdk-libs/auth/config.js +46 -0
- package/dist/static/sdk-libs/auth/crypto.js +166 -0
- package/dist/static/sdk-libs/auth/events.js +27 -0
- package/dist/static/sdk-libs/auth/i18n.js +64 -0
- package/dist/static/sdk-libs/auth/index.js +61 -0
- package/dist/static/sdk-libs/auth/locale.js +151 -0
- package/dist/static/sdk-libs/auth/modal.js +554 -0
- package/dist/static/sdk-libs/auth/palette.js +172 -0
- package/dist/static/sdk-libs/auth/pill.js +198 -0
- package/dist/static/sdk-libs/auth/session.js +792 -0
- package/dist/static/sdk-libs/auth/signup.js +232 -0
- package/dist/static/sdk-libs/auth/theme.js +137 -0
- package/dist/static/sdk-libs/capabilities/index.js +179 -0
- package/dist/static/sdk-libs/commerce/index.js +243 -0
- package/dist/static/sdk-libs/data/index.js +250 -0
- package/dist/static/sdk-libs/dist/aimeat-agentface.js +91 -0
- package/dist/static/sdk-libs/dist/aimeat-agents.js +348 -0
- package/dist/static/sdk-libs/dist/aimeat-ai.js +168 -0
- package/dist/static/sdk-libs/dist/aimeat-audio.js +979 -0
- package/dist/static/sdk-libs/dist/aimeat-auth.js +2232 -0
- package/dist/static/sdk-libs/dist/aimeat-capabilities.js +177 -0
- package/dist/static/sdk-libs/dist/aimeat-commerce.js +265 -0
- package/dist/static/sdk-libs/dist/aimeat-data.js +247 -0
- package/dist/static/sdk-libs/dist/aimeat-editor.js +299 -0
- package/dist/static/sdk-libs/dist/aimeat-header.js +270 -0
- package/dist/static/sdk-libs/dist/aimeat-intake.js +94 -0
- package/dist/static/sdk-libs/dist/aimeat-live.js +317 -0
- package/dist/static/sdk-libs/dist/aimeat-markdown.js +633 -0
- package/dist/static/sdk-libs/dist/aimeat-organism.js +394 -0
- package/dist/static/sdk-libs/dist/aimeat-portfolio-standalone.js +90 -0
- package/dist/static/sdk-libs/dist/aimeat-social.js +157 -0
- package/dist/static/sdk-libs/dist/aimeat-speech.js +300 -0
- package/dist/static/sdk-libs/dist/aimeat-storage.js +210 -0
- package/dist/static/sdk-libs/dist/aimeat-tunnel.js +383 -0
- package/dist/static/sdk-libs/dist/aimeat-wallet.js +118 -0
- package/dist/static/sdk-libs/dist/aimeat-webmcp.js +187 -0
- package/dist/static/sdk-libs/dist/aimeat-work.js +213 -0
- package/dist/static/sdk-libs/dist/aimeat-workflows.js +147 -0
- package/dist/static/sdk-libs/editor/index.js +229 -0
- package/dist/static/sdk-libs/header/index.js +249 -0
- package/dist/static/sdk-libs/intake/index.js +75 -0
- package/dist/static/sdk-libs/live/index.js +223 -0
- package/dist/static/sdk-libs/markdown/index.js +570 -0
- package/dist/static/sdk-libs/organism/index.js +381 -0
- package/dist/static/sdk-libs/portfolio-standalone/index.js +78 -0
- package/dist/static/sdk-libs/social/index.js +140 -0
- package/dist/static/sdk-libs/speech/index.js +321 -0
- package/dist/static/sdk-libs/storage/index.js +189 -0
- package/dist/static/sdk-libs/tunnel/index.js +428 -0
- package/dist/static/sdk-libs/wallet/index.js +115 -0
- package/dist/static/sdk-libs/webmcp/index.js +185 -0
- package/dist/static/sdk-libs/work/index.js +191 -0
- package/dist/static/sdk-libs/workflows/index.js +113 -0
- package/package.json +10 -3
|
@@ -1,38 +1,466 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* aimeat-dag
|
|
2
|
+
* @file aimeat-dag.js
|
|
3
|
+
* @description Generic DAG / graph canvas for AIMEAT apps. Renders a directed acyclic graph
|
|
4
|
+
* (workflow blueprints, pipelines, org charts, crew task graphs) with automatic layered layout,
|
|
5
|
+
* click/tap selection, optional node dragging, and a live state layer (running dash-flow edges,
|
|
6
|
+
* waiting-human pulse, green/red transitions). Zero dependencies; theme-aware via the app's CSS
|
|
7
|
+
* variables (--card/--text/--border/--accent/--bg); honours prefers-reduced-motion.
|
|
3
8
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Since v1.1.0 the camera (pan / zoom-at-cursor / pinch / fit / centre) is NOT implemented here
|
|
10
|
+
* — it is aimeat-viewport, embedded verbatim below so this pack keeps shipping as ONE
|
|
11
|
+
* self-contained script tag with no `requires`. The embedded copy is generated: run
|
|
12
|
+
* `pnpm sync:viewport` after editing aimeat-viewport.js, and `pnpm check:viewport` fails the
|
|
13
|
+
* build if the two ever drift.
|
|
14
|
+
* @structure
|
|
15
|
+
* - embedded aimeat-viewport (generated region — do not hand-edit)
|
|
16
|
+
* - THEME_CSS / injectTheme → dag cosmetics only; the viewport owns structural CSS
|
|
17
|
+
* - layout(nodes, edges, opts) → pure layered layout, also exposed as AIMEAT.dag.layout
|
|
18
|
+
* - Canvas(el, opts) → the graph canvas, mounted on a viewport instance
|
|
19
|
+
* @usage
|
|
11
20
|
* <script src="/v1/cortex/aimeat-dag/libs/aimeat-dag.js"></script>
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
21
|
+
* const dag = AIMEAT.dag.Canvas('#canvas', {
|
|
22
|
+
* nodes: [{ id: 'fetch', label: 'Fetch', sub: 'news-bot' }, { id: 'write', label: 'Write' }],
|
|
23
|
+
* edges: [{ from: 'fetch', to: 'write' }],
|
|
24
|
+
* onSelect: (item) => console.log('selected', item),
|
|
25
|
+
* });
|
|
26
|
+
* dag.setNodeState('fetch', 'running'); // animated dash-flow on incoming edges
|
|
27
|
+
* dag.fit();
|
|
28
|
+
* @version-history
|
|
29
|
+
* v1.0.0 — 2026-07-16 — Initial: layered auto-layout, pan/zoom/pinch, selection, node drag with
|
|
30
|
+
* position persistence, live state layer, prefers-reduced-motion support.
|
|
31
|
+
* v1.0.1 — 2026-07-16 — Fix: setPointerCapture is best-effort (try/catch) — synthetic
|
|
32
|
+
* PointerEvents and pointers released mid-dispatch threw NotFoundError and swallowed the
|
|
33
|
+
* whole pointerdown, breaking selection.
|
|
34
|
+
* v1.1.0 — 2026-07-25 — Camera extracted to aimeat-viewport (TARGET-051) and embedded here.
|
|
35
|
+
* Behaviour-preserving and API-preserving: same public surface, same class names, same
|
|
36
|
+
* gesture semantics, same 0.2–2.5 zoom clamp, same fit padding and easing. Consumers need no
|
|
37
|
+
* change. Dead code removed: clientToWorld was defined and never called — it is now real
|
|
38
|
+
* public API on the viewport.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/* The camera lives in aimeat-viewport.js and is copied in verbatim below so this pack keeps
|
|
42
|
+
* shipping as one script tag with no `requires`. Edit the SOURCE file, then `pnpm sync:viewport`.
|
|
43
|
+
* `pnpm check:viewport` (pre-commit + CI) fails if the copy ever drifts from the source. */
|
|
44
|
+
/* BEGIN embedded aimeat-viewport — GENERATED, DO NOT EDIT (pnpm sync:viewport) */
|
|
45
|
+
/**
|
|
46
|
+
* @file aimeat-viewport.js
|
|
47
|
+
* @description The shared CAMERA primitive for AIMEAT canvas surfaces — pan, zoom-at-cursor,
|
|
48
|
+
* pinch, drag delegation, animated fit/centerOn, and the navigate/interact capture-overlay
|
|
49
|
+
* model that makes panning work over children which swallow pointer events (iframes). It owns
|
|
50
|
+
* the camera and NOTHING about content: what counts as draggable content is answered by the
|
|
51
|
+
* consumer through the `onClaimPointer` hit-test delegate. Extracted verbatim-in-behaviour from
|
|
52
|
+
* aimeat-dag v1.0.1 (TARGET-051) so a second consumer does not mean a third pan/zoom
|
|
53
|
+
* implementation; aimeat-dag now sits on this and embeds a byte-identical copy of this file so
|
|
54
|
+
* it can stay a single self-contained script tag.
|
|
55
|
+
* @structure
|
|
56
|
+
* - injectCss(prefix) → structural CSS for one class prefix (host/world/panning/overlay)
|
|
57
|
+
* - create(hostOrSelector, opts) → the viewport instance
|
|
58
|
+
* - instance: world, cam(), scale(), setCamera(), fit(), centerOn(), clientToWorld(),
|
|
59
|
+
* worldToClient(), setMode(), getMode(), refreshCaptures(), destroy()
|
|
60
|
+
* @usage
|
|
61
|
+
* <script src="/v1/cortex/aimeat-viewport/libs/aimeat-viewport.js"></script>
|
|
62
|
+
* const vp = AIMEAT.viewport.create('#board', {
|
|
63
|
+
* classPrefix: 'og', minZoom: 0.05, maxZoom: 3,
|
|
64
|
+
* captureSelector: '[data-og-frame]', // enables the navigate/interact model
|
|
65
|
+
* contentBBox: () => boundsOfAllFrames(),
|
|
66
|
+
* onClaimPointer: (ev) => { const f = ev.target.closest('[data-og-frame]'); return f ? handleFor(f) : null; },
|
|
67
|
+
* });
|
|
68
|
+
* vp.world.appendChild(frameEl); // children live in world space
|
|
69
|
+
* @version-history
|
|
70
|
+
* v1.0.3 — 2026-07-25 — Report the version the manifest declares; the constant and the
|
|
71
|
+
* manifest had crossed. pnpm check:viewport now asserts they match.
|
|
72
|
+
* v1.0.1 — 2026-07-25 — Fix: do not force position:relative on the host (it beat a consumer's
|
|
73
|
+
* own position:fixed at the same specificity and collapsed a full-screen board to 0px);
|
|
74
|
+
* create() promotes the host only when its computed position is static.
|
|
75
|
+
* v1.0.0 — 2026-07-25 — Initial (TARGET-051 Slice 1): camera extracted from aimeat-dag v1.0.1.
|
|
76
|
+
* Behaviour-preserving for dag (same gesture semantics, same zoom clamps as defaults, same
|
|
77
|
+
* easing and reduced-motion handling); new for other consumers are classPrefix, configurable
|
|
78
|
+
* zoom bounds, the pointer-claim delegate, clientToWorld/worldToClient as public API (it was
|
|
79
|
+
* dead code in dag), and the navigate/interact capture overlays.
|
|
22
80
|
*/
|
|
23
81
|
(function (global) {
|
|
24
82
|
'use strict';
|
|
25
83
|
|
|
26
84
|
var AIMEAT = global.AIMEAT = global.AIMEAT || {};
|
|
27
85
|
|
|
86
|
+
// Idempotent: aimeat-dag embeds a copy of this file so it can ship as one script tag. Loading
|
|
87
|
+
// both the standalone pack and dag must not redefine the namespace.
|
|
88
|
+
if (AIMEAT.viewport) return;
|
|
89
|
+
|
|
28
90
|
var REDUCED = false;
|
|
29
91
|
try { REDUCED = global.matchMedia && global.matchMedia('(prefers-reduced-motion: reduce)').matches; } catch (e) { /* noop */ }
|
|
30
92
|
|
|
93
|
+
var ANIM_MS = 320;
|
|
94
|
+
var ANIM_EASE = 'cubic-bezier(.22,1,.36,1)';
|
|
95
|
+
|
|
96
|
+
// Structural CSS only — the consumer owns cosmetics (size, background, radius). Keeping the two
|
|
97
|
+
// sets disjoint means injection order never matters and no rule fights another.
|
|
98
|
+
var injected = {};
|
|
99
|
+
function injectCss(p) {
|
|
100
|
+
if (injected[p]) return;
|
|
101
|
+
var css = [
|
|
102
|
+
/* NOTE: `position` is deliberately NOT set here. The host only has to be a positioning
|
|
103
|
+
context, and a consumer may already be one in a way that matters — a full-screen board is
|
|
104
|
+
`position: fixed; inset: 0`, and a same-specificity `position: relative` from this
|
|
105
|
+
stylesheet would silently win, collapse the host to zero height and leave every pointer
|
|
106
|
+
event landing on nothing. create() promotes the host only when it is actually static. */
|
|
107
|
+
'.' + p + '-host { overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }',
|
|
108
|
+
'.' + p + '-host.' + p + '-panning { cursor: grabbing; }',
|
|
109
|
+
'.' + p + '-host.' + p + '-interact { cursor: default; }',
|
|
110
|
+
'.' + p + '-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }',
|
|
111
|
+
'.' + p + '-world.' + p + '-animated { transition: transform ' + ANIM_MS + 'ms ' + ANIM_EASE + '; }',
|
|
112
|
+
// The capture overlay: transparent, fills its host child, sits above iframe content so the
|
|
113
|
+
// pointer stream reaches the viewport instead of being swallowed.
|
|
114
|
+
'.' + p + '-capture { position: absolute; inset: 0; z-index: 5; background: transparent; cursor: inherit; }',
|
|
115
|
+
'@media (prefers-reduced-motion: reduce) { .' + p + '-world.' + p + '-animated { transition: none; } }',
|
|
116
|
+
].join('\n');
|
|
117
|
+
var style = document.createElement('style');
|
|
118
|
+
style.setAttribute('data-aimeat-viewport', p);
|
|
119
|
+
style.textContent = css;
|
|
120
|
+
document.head.appendChild(style);
|
|
121
|
+
injected[p] = true;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function resolveEl(elOrSelector) {
|
|
125
|
+
return typeof elOrSelector === 'string' ? document.querySelector(elOrSelector) : elOrSelector;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function dist(a, b) { return Math.hypot(a.x - b.x, a.y - b.y); }
|
|
129
|
+
function mid(a, b) { return { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 }; }
|
|
130
|
+
function clamp(v, lo, hi) { return Math.min(hi, Math.max(lo, v)); }
|
|
131
|
+
|
|
132
|
+
function isTextEntry(el) {
|
|
133
|
+
if (!el) return false;
|
|
134
|
+
var tag = (el.tagName || '').toLowerCase();
|
|
135
|
+
return tag === 'input' || tag === 'textarea' || tag === 'select' || el.isContentEditable === true;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Create a viewport over `host`. The instance creates and owns the `world` element; put your
|
|
140
|
+
* content inside `vp.world` and position it in world coordinates.
|
|
141
|
+
*
|
|
142
|
+
* @param {Element|string} hostOrSelector clipping host (the consumer gives it a size)
|
|
143
|
+
* @param {Object} [opts]
|
|
144
|
+
* @param {string} [opts.classPrefix='av'] prefix for host/world/panning/capture classes — a
|
|
145
|
+
* consumer that already ships CSS selectors passes its own so nothing renames.
|
|
146
|
+
* @param {number} [opts.minZoom=0.2] @param {number} [opts.maxZoom=2.5]
|
|
147
|
+
* @param {Object} [opts.initial={x:40,y:40,k:1}] starting camera
|
|
148
|
+
* @param {number} [opts.fitPadding=36] @param {number} [opts.fitMaxZoom=1.4]
|
|
149
|
+
* @param {number} [opts.centerMinZoom=1] centerOn() zooms in to at least this
|
|
150
|
+
* @param {number} [opts.dragThreshold=4] client px before a claimed pointer counts as moved
|
|
151
|
+
* @param {Function} [opts.contentBBox] () → {x,y,w,h} in world units; required for fit()
|
|
152
|
+
* @param {Function} [opts.onClaimPointer] (ev) → null (viewport pans) | drag handle
|
|
153
|
+
* { onMove(worldDx, worldDy, ev, cam), onEnd(movedPastThreshold, ev) }
|
|
154
|
+
* @param {Function} [opts.onTap] (ev) fired when a pan gesture ends without moving
|
|
155
|
+
* @param {Function} [opts.onCameraChange] (cam) after any camera change
|
|
156
|
+
* @param {string} [opts.captureSelector] children matching this get a capture overlay in
|
|
157
|
+
* navigate mode. Supplying it OPTS IN to the two-mode model (space-hold, middle-mouse pan,
|
|
158
|
+
* Esc). Omit it and no window listeners are attached at all.
|
|
159
|
+
* @param {string} [opts.mode='navigate']
|
|
160
|
+
*/
|
|
161
|
+
function create(hostOrSelector, opts) {
|
|
162
|
+
opts = opts || {};
|
|
163
|
+
var host = resolveEl(hostOrSelector);
|
|
164
|
+
if (!host) throw new Error('aimeat-viewport: host element not found');
|
|
165
|
+
|
|
166
|
+
var P = opts.classPrefix || 'av';
|
|
167
|
+
var minZoom = opts.minZoom != null ? opts.minZoom : 0.2;
|
|
168
|
+
var maxZoom = opts.maxZoom != null ? opts.maxZoom : 2.5;
|
|
169
|
+
var fitPadding = opts.fitPadding != null ? opts.fitPadding : 36;
|
|
170
|
+
var fitMaxZoom = opts.fitMaxZoom != null ? opts.fitMaxZoom : 1.4;
|
|
171
|
+
var centerMinZoom = opts.centerMinZoom != null ? opts.centerMinZoom : 1;
|
|
172
|
+
var dragThreshold = opts.dragThreshold != null ? opts.dragThreshold : 4;
|
|
173
|
+
var twoMode = !!opts.captureSelector;
|
|
174
|
+
|
|
175
|
+
injectCss(P);
|
|
176
|
+
host.classList.add(P + '-host');
|
|
177
|
+
/* The world is absolutely positioned, so the host must be a positioning context — but only
|
|
178
|
+
promote it when it is static. Overwriting an existing fixed/absolute/sticky host is how a
|
|
179
|
+
full-screen board ends up 0px tall. */
|
|
180
|
+
if (global.getComputedStyle(host).position === 'static') host.style.position = 'relative';
|
|
181
|
+
|
|
182
|
+
var world = document.createElement('div');
|
|
183
|
+
world.className = P + '-world';
|
|
184
|
+
host.appendChild(world);
|
|
185
|
+
|
|
186
|
+
var init = opts.initial || {};
|
|
187
|
+
var cam = { x: init.x != null ? init.x : 40, y: init.y != null ? init.y : 40, k: init.k != null ? init.k : 1 };
|
|
188
|
+
var mode = opts.mode === 'interact' ? 'interact' : 'navigate';
|
|
189
|
+
var spaceHeld = false;
|
|
190
|
+
var destroyed = false;
|
|
191
|
+
|
|
192
|
+
function emitCam() { if (opts.onCameraChange) opts.onCameraChange({ x: cam.x, y: cam.y, k: cam.k }); }
|
|
193
|
+
|
|
194
|
+
function applyCam(animated) {
|
|
195
|
+
if (animated && !REDUCED) {
|
|
196
|
+
world.classList.add(P + '-animated');
|
|
197
|
+
setTimeout(function () { world.classList.remove(P + '-animated'); }, ANIM_MS + 40);
|
|
198
|
+
}
|
|
199
|
+
world.style.transform = 'translate(' + cam.x + 'px,' + cam.y + 'px) scale(' + cam.k + ')';
|
|
200
|
+
emitCam();
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// ── capture overlays ──────────────────────────────────────────────────────
|
|
204
|
+
// Children that handle their own pointer events (iframes above all) swallow the stream and
|
|
205
|
+
// panning over them silently stops working. In navigate mode each one gets a transparent
|
|
206
|
+
// overlay; in interact mode the overlays come off and the child behaves normally.
|
|
207
|
+
function refreshCaptures() {
|
|
208
|
+
if (!twoMode) return;
|
|
209
|
+
var wants = (mode === 'navigate') || spaceHeld;
|
|
210
|
+
/* Sweep first. The selector decides WHO gets an overlay, so an element that has left the set
|
|
211
|
+
must lose the one it already has. Only matching elements were visited, so a consumer that
|
|
212
|
+
excludes a frame at runtime — "let me use just this one" — kept a dead overlay sitting on
|
|
213
|
+
top of it and the frame stayed unclickable with no way to tell why. */
|
|
214
|
+
var stale = world.querySelectorAll('.' + P + '-capture');
|
|
215
|
+
for (var k = 0; k < stale.length; k++) {
|
|
216
|
+
var owner = stale[k].parentElement;
|
|
217
|
+
if (owner && owner.matches && !owner.matches(opts.captureSelector)) stale[k].remove();
|
|
218
|
+
}
|
|
219
|
+
var targets = world.querySelectorAll(opts.captureSelector);
|
|
220
|
+
for (var i = 0; i < targets.length; i++) {
|
|
221
|
+
var el = targets[i];
|
|
222
|
+
var existing = el.querySelector(':scope > .' + P + '-capture');
|
|
223
|
+
if (wants && !existing) {
|
|
224
|
+
var ov = document.createElement('div');
|
|
225
|
+
ov.className = P + '-capture';
|
|
226
|
+
ov.setAttribute('aria-hidden', 'true');
|
|
227
|
+
el.appendChild(ov);
|
|
228
|
+
} else if (!wants && existing) {
|
|
229
|
+
existing.remove();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function setMode(next) {
|
|
235
|
+
var m = next === 'interact' ? 'interact' : 'navigate';
|
|
236
|
+
if (m === mode) return;
|
|
237
|
+
mode = m;
|
|
238
|
+
host.classList.toggle(P + '-interact', mode === 'interact');
|
|
239
|
+
refreshCaptures();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// ── pointer interactions ──────────────────────────────────────────────────
|
|
243
|
+
var pointers = {}; // pointerId → {x,y}
|
|
244
|
+
var gesture = null; // {mode:'pan'|'pinch'|'claim', ...}
|
|
245
|
+
|
|
246
|
+
function clientToWorld(cx, cy) {
|
|
247
|
+
var r = host.getBoundingClientRect();
|
|
248
|
+
return { x: (cx - r.left - cam.x) / cam.k, y: (cy - r.top - cam.y) / cam.k };
|
|
249
|
+
}
|
|
250
|
+
function worldToClient(wx, wy) {
|
|
251
|
+
var r = host.getBoundingClientRect();
|
|
252
|
+
return { x: wx * cam.k + cam.x + r.left, y: wy * cam.k + cam.y + r.top };
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function beginPan(ev) {
|
|
256
|
+
gesture = { mode: 'pan', sx: ev.clientX, sy: ev.clientY, cam0: { x: cam.x, y: cam.y }, moved: false };
|
|
257
|
+
host.classList.add(P + '-panning');
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function onPointerDown(ev) {
|
|
261
|
+
// Capture is best-effort: synthetic PointerEvents (tests, automation) and pointers released
|
|
262
|
+
// mid-dispatch have no active pointer and would throw NotFoundError, swallowing the whole
|
|
263
|
+
// pointerdown. (aimeat-dag v1.0.1 shipped this as a real bug fix.)
|
|
264
|
+
try { host.setPointerCapture && host.setPointerCapture(ev.pointerId); } catch (e) { /* noop */ }
|
|
265
|
+
pointers[ev.pointerId] = { x: ev.clientX, y: ev.clientY };
|
|
266
|
+
|
|
267
|
+
if (Object.keys(pointers).length === 2) {
|
|
268
|
+
var pts = Object.keys(pointers).map(function (id) { return pointers[id]; });
|
|
269
|
+
gesture = {
|
|
270
|
+
mode: 'pinch', d0: dist(pts[0], pts[1]), k0: cam.k,
|
|
271
|
+
mid0: mid(pts[0], pts[1]), cam0: { x: cam.x, y: cam.y },
|
|
272
|
+
};
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Middle mouse always pans, and holding space is a temporary navigate — both are the
|
|
277
|
+
// conventions users bring from other canvas tools.
|
|
278
|
+
if (twoMode && (ev.button === 1 || spaceHeld)) { beginPan(ev); return; }
|
|
279
|
+
|
|
280
|
+
var handle = opts.onClaimPointer ? opts.onClaimPointer(ev) : null;
|
|
281
|
+
if (handle) {
|
|
282
|
+
gesture = { mode: 'claim', handle: handle, sx: ev.clientX, sy: ev.clientY, moved: false };
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
beginPan(ev);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
function onPointerMove(ev) {
|
|
289
|
+
if (!pointers[ev.pointerId]) return;
|
|
290
|
+
pointers[ev.pointerId] = { x: ev.clientX, y: ev.clientY };
|
|
291
|
+
if (!gesture) return;
|
|
292
|
+
|
|
293
|
+
if (gesture.mode === 'pinch') {
|
|
294
|
+
var pts = Object.keys(pointers).map(function (id) { return pointers[id]; });
|
|
295
|
+
if (pts.length < 2) return;
|
|
296
|
+
var k = clamp(gesture.k0 * dist(pts[0], pts[1]) / Math.max(1, gesture.d0), minZoom, maxZoom);
|
|
297
|
+
var m = mid(pts[0], pts[1]);
|
|
298
|
+
var r = host.getBoundingClientRect();
|
|
299
|
+
// keep the world point under the pinch midpoint stationary
|
|
300
|
+
var wx = (gesture.mid0.x - r.left - gesture.cam0.x) / gesture.k0;
|
|
301
|
+
var wy = (gesture.mid0.y - r.top - gesture.cam0.y) / gesture.k0;
|
|
302
|
+
cam.k = k;
|
|
303
|
+
cam.x = (m.x - r.left) - wx * k;
|
|
304
|
+
cam.y = (m.y - r.top) - wy * k;
|
|
305
|
+
applyCam(false);
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (gesture.mode === 'pan') {
|
|
310
|
+
gesture.moved = gesture.moved || Math.abs(ev.clientX - gesture.sx) + Math.abs(ev.clientY - gesture.sy) > 3;
|
|
311
|
+
cam.x = gesture.cam0.x + (ev.clientX - gesture.sx);
|
|
312
|
+
cam.y = gesture.cam0.y + (ev.clientY - gesture.sy);
|
|
313
|
+
applyCam(false);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (gesture.mode === 'claim') {
|
|
318
|
+
var dx = (ev.clientX - gesture.sx) / cam.k;
|
|
319
|
+
var dy = (ev.clientY - gesture.sy) / cam.k;
|
|
320
|
+
if (!gesture.moved && Math.abs(dx) + Math.abs(dy) < dragThreshold / cam.k) return;
|
|
321
|
+
gesture.moved = true;
|
|
322
|
+
if (gesture.handle.onMove) gesture.handle.onMove(dx, dy, ev, { x: cam.x, y: cam.y, k: cam.k });
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function onPointerUp(ev) {
|
|
327
|
+
delete pointers[ev.pointerId];
|
|
328
|
+
host.classList.remove(P + '-panning');
|
|
329
|
+
if (!gesture) return;
|
|
330
|
+
var g = gesture;
|
|
331
|
+
// A pinch that lost one finger keeps waiting for the other to lift.
|
|
332
|
+
if (Object.keys(pointers).length > 0 && g.mode === 'pinch') return;
|
|
333
|
+
gesture = null;
|
|
334
|
+
if (g.mode === 'claim') {
|
|
335
|
+
if (g.handle.onEnd) g.handle.onEnd(g.moved, ev);
|
|
336
|
+
} else if (g.mode === 'pan' && !g.moved) {
|
|
337
|
+
if (opts.onTap) opts.onTap(ev);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function onWheel(ev) {
|
|
342
|
+
ev.preventDefault();
|
|
343
|
+
var factor = Math.pow(1.0015, -ev.deltaY);
|
|
344
|
+
var k = clamp(cam.k * factor, minZoom, maxZoom);
|
|
345
|
+
var r = host.getBoundingClientRect();
|
|
346
|
+
var wx = (ev.clientX - r.left - cam.x) / cam.k;
|
|
347
|
+
var wy = (ev.clientY - r.top - cam.y) / cam.k;
|
|
348
|
+
cam.k = k;
|
|
349
|
+
cam.x = (ev.clientX - r.left) - wx * k;
|
|
350
|
+
cam.y = (ev.clientY - r.top) - wy * k;
|
|
351
|
+
applyCam(false);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function onKeyDown(ev) {
|
|
355
|
+
if (ev.code !== 'Space' || spaceHeld || isTextEntry(ev.target)) return;
|
|
356
|
+
spaceHeld = true;
|
|
357
|
+
host.classList.add(P + '-panning');
|
|
358
|
+
refreshCaptures();
|
|
359
|
+
ev.preventDefault(); // stop the page from scrolling under a held space
|
|
360
|
+
}
|
|
361
|
+
function onKeyUp(ev) {
|
|
362
|
+
if (ev.code === 'Escape') { setMode('navigate'); return; }
|
|
363
|
+
if (ev.code !== 'Space' || !spaceHeld) return;
|
|
364
|
+
spaceHeld = false;
|
|
365
|
+
if (!gesture) host.classList.remove(P + '-panning');
|
|
366
|
+
refreshCaptures();
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
host.addEventListener('pointerdown', onPointerDown);
|
|
370
|
+
host.addEventListener('pointermove', onPointerMove);
|
|
371
|
+
host.addEventListener('pointerup', onPointerUp);
|
|
372
|
+
host.addEventListener('pointercancel', onPointerUp);
|
|
373
|
+
host.addEventListener('wheel', onWheel, { passive: false });
|
|
374
|
+
if (twoMode) {
|
|
375
|
+
global.addEventListener('keydown', onKeyDown);
|
|
376
|
+
global.addEventListener('keyup', onKeyUp);
|
|
377
|
+
host.classList.toggle(P + '-interact', mode === 'interact');
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// ── camera moves ──────────────────────────────────────────────────────────
|
|
381
|
+
function setCamera(next, animated) {
|
|
382
|
+
if (next.k != null) cam.k = clamp(next.k, minZoom, maxZoom);
|
|
383
|
+
if (next.x != null) cam.x = next.x;
|
|
384
|
+
if (next.y != null) cam.y = next.y;
|
|
385
|
+
applyCam(!!animated);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function fit(animated) {
|
|
389
|
+
var b = opts.contentBBox ? opts.contentBBox() : null;
|
|
390
|
+
if (!b || !(b.w > 0) || !(b.h > 0)) return;
|
|
391
|
+
var k = clamp(Math.min(
|
|
392
|
+
(host.clientWidth - fitPadding * 2) / b.w,
|
|
393
|
+
(host.clientHeight - fitPadding * 2) / b.h,
|
|
394
|
+
fitMaxZoom,
|
|
395
|
+
), minZoom, maxZoom);
|
|
396
|
+
cam.k = k;
|
|
397
|
+
cam.x = (host.clientWidth - b.w * k) / 2 - b.x * k;
|
|
398
|
+
cam.y = (host.clientHeight - b.h * k) / 2 - b.y * k;
|
|
399
|
+
applyCam(animated !== false);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/** Centre the camera on a world-space rect {x,y,w,h}, zooming in to at least centerMinZoom. */
|
|
403
|
+
function centerOn(rect, animated) {
|
|
404
|
+
if (!rect) return;
|
|
405
|
+
var k = clamp(Math.max(cam.k, centerMinZoom), minZoom, maxZoom);
|
|
406
|
+
cam.k = k;
|
|
407
|
+
cam.x = host.clientWidth / 2 - (rect.x + rect.w / 2) * k;
|
|
408
|
+
cam.y = host.clientHeight / 2 - (rect.y + rect.h / 2) * k;
|
|
409
|
+
applyCam(animated !== false);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
function destroy() {
|
|
413
|
+
if (destroyed) return;
|
|
414
|
+
destroyed = true;
|
|
415
|
+
host.removeEventListener('pointerdown', onPointerDown);
|
|
416
|
+
host.removeEventListener('pointermove', onPointerMove);
|
|
417
|
+
host.removeEventListener('pointerup', onPointerUp);
|
|
418
|
+
host.removeEventListener('pointercancel', onPointerUp);
|
|
419
|
+
host.removeEventListener('wheel', onWheel);
|
|
420
|
+
if (twoMode) {
|
|
421
|
+
global.removeEventListener('keydown', onKeyDown);
|
|
422
|
+
global.removeEventListener('keyup', onKeyUp);
|
|
423
|
+
}
|
|
424
|
+
host.classList.remove(P + '-host', P + '-panning', P + '-interact');
|
|
425
|
+
world.remove();
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
applyCam(false);
|
|
429
|
+
|
|
430
|
+
return {
|
|
431
|
+
host: host,
|
|
432
|
+
world: world,
|
|
433
|
+
cam: function () { return { x: cam.x, y: cam.y, k: cam.k }; },
|
|
434
|
+
scale: function () { return cam.k; },
|
|
435
|
+
setCamera: setCamera,
|
|
436
|
+
fit: fit,
|
|
437
|
+
centerOn: centerOn,
|
|
438
|
+
clientToWorld: clientToWorld,
|
|
439
|
+
worldToClient: worldToClient,
|
|
440
|
+
setMode: setMode,
|
|
441
|
+
getMode: function () { return spaceHeld ? 'navigate' : mode; },
|
|
442
|
+
refreshCaptures: refreshCaptures,
|
|
443
|
+
destroy: destroy,
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
AIMEAT.viewport = { create: create, VERSION: '1.0.4' };
|
|
448
|
+
|
|
449
|
+
})(typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : this);
|
|
450
|
+
/* END embedded aimeat-viewport */
|
|
451
|
+
|
|
452
|
+
(function (global) {
|
|
453
|
+
'use strict';
|
|
454
|
+
|
|
455
|
+
var AIMEAT = global.AIMEAT = global.AIMEAT || {};
|
|
456
|
+
|
|
457
|
+
if (!AIMEAT.viewport) throw new Error('aimeat-dag: aimeat-viewport missing (embed out of sync)');
|
|
458
|
+
|
|
459
|
+
// Cosmetics only. The viewport owns the structural rules for .ad-host and .ad-world
|
|
460
|
+
// (position, overflow, touch-action, cursor, transform, transition) — the two sets are kept
|
|
461
|
+
// disjoint so injection order never matters and no rule fights another.
|
|
31
462
|
var THEME_CSS = [
|
|
32
|
-
'.ad-host {
|
|
33
|
-
'.ad-host.ad-panning { cursor: grabbing; }',
|
|
34
|
-
'.ad-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }',
|
|
35
|
-
'.ad-world.ad-animated { transition: transform 320ms cubic-bezier(.22,1,.36,1); }',
|
|
463
|
+
'.ad-host { width: 100%; height: 100%; min-height: 320px; background: var(--bg, transparent); border-radius: 12px; }',
|
|
36
464
|
'.ad-edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }',
|
|
37
465
|
'.ad-edge { fill: none; stroke: var(--border, #94a3b8); stroke-width: 2; pointer-events: stroke; cursor: pointer; transition: stroke 200ms; }',
|
|
38
466
|
'.ad-edge.ad-selected { stroke: var(--accent, #e8564a); stroke-width: 2.5; }',
|
|
@@ -60,7 +488,6 @@
|
|
|
60
488
|
'.ad-node.ad-pop { animation: ad-pop 420ms cubic-bezier(.22,1.4,.36,1); }',
|
|
61
489
|
'@keyframes ad-pop { 0% { transform: scale(.94); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }',
|
|
62
490
|
'@media (prefers-reduced-motion: reduce) {',
|
|
63
|
-
' .ad-world.ad-animated { transition: none; }',
|
|
64
491
|
' .ad-edge.ad-edge-active { animation: none; }',
|
|
65
492
|
' .ad-node.ad-state-waiting-human { animation: none; box-shadow: 0 0 0 3px rgba(245,158,11,.35); }',
|
|
66
493
|
' .ad-node.ad-pop { animation: none; }',
|
|
@@ -201,24 +628,12 @@
|
|
|
201
628
|
var host = resolveEl(elOrSelector);
|
|
202
629
|
if (!host) throw new Error('aimeat-dag: host element not found');
|
|
203
630
|
injectTheme();
|
|
204
|
-
host.classList.add('ad-host');
|
|
205
|
-
|
|
206
|
-
var world = document.createElement('div');
|
|
207
|
-
world.className = 'ad-world';
|
|
208
|
-
var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
209
|
-
svg.setAttribute('class', 'ad-edges');
|
|
210
|
-
svg.setAttribute('width', '1'); svg.setAttribute('height', '1');
|
|
211
|
-
var nodeLayer = document.createElement('div');
|
|
212
|
-
world.appendChild(svg);
|
|
213
|
-
world.appendChild(nodeLayer);
|
|
214
|
-
host.appendChild(world);
|
|
215
631
|
|
|
216
632
|
var state = {
|
|
217
633
|
nodes: [], edges: [], byId: {}, els: {}, paths: [],
|
|
218
634
|
positions: {}, // manual overrides (id → {x,y})
|
|
219
635
|
computed: {}, // effective positions after layout
|
|
220
636
|
sizes: {},
|
|
221
|
-
cam: { x: 40, y: 40, k: 1 },
|
|
222
637
|
selected: null,
|
|
223
638
|
direction: opts.direction === 'TB' ? 'TB' : 'LR',
|
|
224
639
|
draggable: opts.draggable !== false,
|
|
@@ -226,13 +641,28 @@
|
|
|
226
641
|
};
|
|
227
642
|
if (opts.positions) for (var k in opts.positions) state.positions[k] = { x: opts.positions[k].x, y: opts.positions[k].y };
|
|
228
643
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
644
|
+
// The camera. classPrefix 'ad' keeps every existing .ad-host / .ad-world selector an app may
|
|
645
|
+
// have styled; the zoom clamp and fit padding are the values this pack has always used.
|
|
646
|
+
var vp = AIMEAT.viewport.create(host, {
|
|
647
|
+
classPrefix: 'ad',
|
|
648
|
+
minZoom: 0.2,
|
|
649
|
+
maxZoom: 2.5,
|
|
650
|
+
initial: { x: 40, y: 40, k: 1 },
|
|
651
|
+
fitPadding: 36,
|
|
652
|
+
fitMaxZoom: 1.4,
|
|
653
|
+
centerMinZoom: 1,
|
|
654
|
+
contentBBox: function () { return bbox(); },
|
|
655
|
+
onClaimPointer: function (ev) { return claimPointer(ev); },
|
|
656
|
+
onTap: function () { select(null); },
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
var world = vp.world;
|
|
660
|
+
var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
661
|
+
svg.setAttribute('class', 'ad-edges');
|
|
662
|
+
svg.setAttribute('width', '1'); svg.setAttribute('height', '1');
|
|
663
|
+
var nodeLayer = document.createElement('div');
|
|
664
|
+
world.appendChild(svg);
|
|
665
|
+
world.appendChild(nodeLayer);
|
|
236
666
|
|
|
237
667
|
// ── rendering ──
|
|
238
668
|
function renderNodes() {
|
|
@@ -332,124 +762,51 @@
|
|
|
332
762
|
if (opts.onSelect) opts.onSelect(item ? (item.type === 'node' ? { type: 'node', node: state.byId[item.id] } : { type: 'edge', edge: item.edge }) : null);
|
|
333
763
|
}
|
|
334
764
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
return { x: (cx - r.left - state.cam.x) / state.cam.k, y: (cy - r.top - state.cam.y) / state.cam.k };
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
function onPointerDown(ev) {
|
|
345
|
-
// Capture is best-effort: synthetic PointerEvents (tests, automation) and pointers
|
|
346
|
-
// released mid-dispatch have no active pointer and would throw NotFoundError.
|
|
347
|
-
try { host.setPointerCapture && host.setPointerCapture(ev.pointerId); } catch (e) { /* noop */ }
|
|
348
|
-
pointers[ev.pointerId] = { x: ev.clientX, y: ev.clientY };
|
|
349
|
-
var count = Object.keys(pointers).length;
|
|
350
|
-
if (count === 2) {
|
|
351
|
-
var pts = Object.keys(pointers).map(function (id) { return pointers[id]; });
|
|
352
|
-
gesture = { mode: 'pinch', d0: dist(pts[0], pts[1]), k0: state.cam.k, mid0: mid(pts[0], pts[1]), cam0: { x: state.cam.x, y: state.cam.y } };
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
765
|
+
/**
|
|
766
|
+
* The viewport's hit-test delegate: claim nodes and edges, let everything else pan.
|
|
767
|
+
* `dragged` lives in the handle closure rather than using the viewport's threshold flag
|
|
768
|
+
* because a NON-draggable node that the pointer moved over must still count as a click.
|
|
769
|
+
*/
|
|
770
|
+
function claimPointer(ev) {
|
|
355
771
|
var nodeEl = ev.target.closest ? ev.target.closest('.ad-node') : null;
|
|
356
772
|
if (nodeEl) {
|
|
357
773
|
var id = nodeEl.getAttribute('data-ad-id');
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
var
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
state.cam.k = k;
|
|
382
|
-
state.cam.x = (m.x - r.left) - wx * k;
|
|
383
|
-
state.cam.y = (m.y - r.top) - wy * k;
|
|
384
|
-
applyCam(false);
|
|
385
|
-
return;
|
|
774
|
+
var from = state.computed[id];
|
|
775
|
+
if (!from) return null;
|
|
776
|
+
var start = { x: from.x, y: from.y };
|
|
777
|
+
var dragged = false;
|
|
778
|
+
return {
|
|
779
|
+
onMove: function (dx, dy) {
|
|
780
|
+
if (!state.draggable) return;
|
|
781
|
+
dragged = true;
|
|
782
|
+
state.els[id].classList.add('ad-dragging');
|
|
783
|
+
state.computed[id] = { x: start.x + dx, y: start.y + dy };
|
|
784
|
+
place(id);
|
|
785
|
+
redrawEdgesFor(id);
|
|
786
|
+
},
|
|
787
|
+
onEnd: function () {
|
|
788
|
+
if (dragged) {
|
|
789
|
+
state.els[id].classList.remove('ad-dragging');
|
|
790
|
+
state.positions[id] = { x: state.computed[id].x, y: state.computed[id].y };
|
|
791
|
+
if (opts.onLayoutChange) opts.onLayoutChange(getPositions());
|
|
792
|
+
} else {
|
|
793
|
+
select({ type: 'node', id: id });
|
|
794
|
+
}
|
|
795
|
+
},
|
|
796
|
+
};
|
|
386
797
|
}
|
|
387
|
-
if (
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
var dx = (ev.clientX - gesture.sx) / state.cam.k;
|
|
396
|
-
var dy = (ev.clientY - gesture.sy) / state.cam.k;
|
|
397
|
-
if (!gesture.moved && Math.abs(dx) + Math.abs(dy) < 4 / state.cam.k) return;
|
|
398
|
-
if (!state.draggable) return;
|
|
399
|
-
gesture.moved = true;
|
|
400
|
-
state.els[gesture.id].classList.add('ad-dragging');
|
|
401
|
-
state.computed[gesture.id] = { x: gesture.start.x + dx, y: gesture.start.y + dy };
|
|
402
|
-
place(gesture.id);
|
|
403
|
-
redrawEdgesFor(gesture.id);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
function onPointerUp(ev) {
|
|
408
|
-
delete pointers[ev.pointerId];
|
|
409
|
-
host.classList.remove('ad-panning');
|
|
410
|
-
if (!gesture) return;
|
|
411
|
-
var g = gesture;
|
|
412
|
-
if (Object.keys(pointers).length > 0 && g.mode === 'pinch') return; // wait for the second finger
|
|
413
|
-
gesture = null;
|
|
414
|
-
if (g.mode === 'node') {
|
|
415
|
-
if (g.moved) {
|
|
416
|
-
state.els[g.id].classList.remove('ad-dragging');
|
|
417
|
-
state.positions[g.id] = { x: state.computed[g.id].x, y: state.computed[g.id].y };
|
|
418
|
-
if (opts.onLayoutChange) opts.onLayoutChange(getPositions());
|
|
419
|
-
} else {
|
|
420
|
-
select({ type: 'node', id: g.id });
|
|
421
|
-
}
|
|
422
|
-
} else if (g.mode === 'edgeclick') {
|
|
423
|
-
var p = state.paths[g.idx];
|
|
424
|
-
if (p) select({ type: 'edge', edge: p.edge });
|
|
425
|
-
} else if (g.mode === 'pan' && !g.moved) {
|
|
426
|
-
select(null);
|
|
798
|
+
if (ev.target.classList && ev.target.classList.contains('ad-edge')) {
|
|
799
|
+
var idx = Number(ev.target.getAttribute('data-ad-edge'));
|
|
800
|
+
return {
|
|
801
|
+
onEnd: function () {
|
|
802
|
+
var p = state.paths[idx];
|
|
803
|
+
if (p) select({ type: 'edge', edge: p.edge });
|
|
804
|
+
},
|
|
805
|
+
};
|
|
427
806
|
}
|
|
807
|
+
return null;
|
|
428
808
|
}
|
|
429
809
|
|
|
430
|
-
function onWheel(ev) {
|
|
431
|
-
ev.preventDefault();
|
|
432
|
-
var factor = Math.pow(1.0015, -ev.deltaY);
|
|
433
|
-
var k = clamp(state.cam.k * factor, 0.2, 2.5);
|
|
434
|
-
var r = host.getBoundingClientRect();
|
|
435
|
-
var wx = (ev.clientX - r.left - state.cam.x) / state.cam.k;
|
|
436
|
-
var wy = (ev.clientY - r.top - state.cam.y) / state.cam.k;
|
|
437
|
-
state.cam.k = k;
|
|
438
|
-
state.cam.x = (ev.clientX - r.left) - wx * k;
|
|
439
|
-
state.cam.y = (ev.clientY - r.top) - wy * k;
|
|
440
|
-
applyCam(false);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
function dist(a, b) { return Math.hypot(a.x - b.x, a.y - b.y); }
|
|
444
|
-
function mid(a, b) { return { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 }; }
|
|
445
|
-
function clamp(v, lo, hi) { return Math.min(hi, Math.max(lo, v)); }
|
|
446
|
-
|
|
447
|
-
host.addEventListener('pointerdown', onPointerDown);
|
|
448
|
-
host.addEventListener('pointermove', onPointerMove);
|
|
449
|
-
host.addEventListener('pointerup', onPointerUp);
|
|
450
|
-
host.addEventListener('pointercancel', onPointerUp);
|
|
451
|
-
host.addEventListener('wheel', onWheel, { passive: false });
|
|
452
|
-
|
|
453
810
|
// ── public surface ──
|
|
454
811
|
function bbox() {
|
|
455
812
|
var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
|
|
@@ -464,23 +821,13 @@
|
|
|
464
821
|
}
|
|
465
822
|
|
|
466
823
|
function fit(animated) {
|
|
467
|
-
|
|
468
|
-
var pad = 36;
|
|
469
|
-
var k = clamp(Math.min((host.clientWidth - pad * 2) / b.w, (host.clientHeight - pad * 2) / b.h, 1.4), 0.2, 2.5);
|
|
470
|
-
state.cam.k = k;
|
|
471
|
-
state.cam.x = (host.clientWidth - b.w * k) / 2 - b.x * k;
|
|
472
|
-
state.cam.y = (host.clientHeight - b.h * k) / 2 - b.y * k;
|
|
473
|
-
applyCam(animated !== false);
|
|
824
|
+
vp.fit(animated);
|
|
474
825
|
}
|
|
475
826
|
|
|
476
827
|
function zoomTo(id, animated) {
|
|
477
828
|
var p = state.computed[id]; var s = state.sizes[id];
|
|
478
829
|
if (!p || !s) return;
|
|
479
|
-
|
|
480
|
-
state.cam.k = k;
|
|
481
|
-
state.cam.x = host.clientWidth / 2 - (p.x + s.w / 2) * k;
|
|
482
|
-
state.cam.y = host.clientHeight / 2 - (p.y + s.h / 2) * k;
|
|
483
|
-
applyCam(animated !== false);
|
|
830
|
+
vp.centerOn({ x: p.x, y: p.y, w: s.w, h: s.h }, animated);
|
|
484
831
|
}
|
|
485
832
|
|
|
486
833
|
function getPositions() {
|
|
@@ -518,18 +865,11 @@
|
|
|
518
865
|
|
|
519
866
|
function destroy() {
|
|
520
867
|
state.destroyed = true;
|
|
521
|
-
|
|
522
|
-
host.removeEventListener('pointermove', onPointerMove);
|
|
523
|
-
host.removeEventListener('pointerup', onPointerUp);
|
|
524
|
-
host.removeEventListener('pointercancel', onPointerUp);
|
|
525
|
-
host.removeEventListener('wheel', onWheel);
|
|
526
|
-
host.classList.remove('ad-host');
|
|
527
|
-
world.remove();
|
|
868
|
+
vp.destroy();
|
|
528
869
|
}
|
|
529
870
|
|
|
530
871
|
// initial render
|
|
531
872
|
setData({ nodes: opts.nodes || [], edges: opts.edges || [] });
|
|
532
|
-
applyCam(false);
|
|
533
873
|
if (opts.fit !== false) {
|
|
534
874
|
// fit after layout has real sizes (next frame — the host may have just been inserted)
|
|
535
875
|
requestAnimationFrame(function () { if (!state.destroyed) fit(false); });
|
|
@@ -545,6 +885,8 @@
|
|
|
545
885
|
getPositions: getPositions,
|
|
546
886
|
relayout: function () { state.positions = {}; renderNodes(); fit(); },
|
|
547
887
|
destroy: destroy,
|
|
888
|
+
/** The underlying camera (aimeat-viewport). Read-only in spirit — prefer fit/zoomTo. */
|
|
889
|
+
viewport: vp,
|
|
548
890
|
};
|
|
549
891
|
}
|
|
550
892
|
|