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,213 @@
|
|
|
1
|
+
// GENERATED FILE — do not edit directly. Source: src/static/sdk-libs/work/ (+ _core/).
|
|
2
|
+
// Rebuild: pnpm build:sdk · Served at /v1/libs/aimeat-work.js (with a per-node config prelude).
|
|
3
|
+
"use strict";
|
|
4
|
+
(() => {
|
|
5
|
+
// src/static/sdk-libs/_core/config.js
|
|
6
|
+
function cfg() {
|
|
7
|
+
return window.__AIMEAT_SDK_CFG__ || { nodeId: "", baseUrl: "" };
|
|
8
|
+
}
|
|
9
|
+
function resolveNodeUrl() {
|
|
10
|
+
const meta = document.querySelector('meta[name="aimeat-node"]');
|
|
11
|
+
if (meta) return (meta.getAttribute("content") || "").replace(/\/$/, "");
|
|
12
|
+
if (location.protocol === "http:" || location.protocol === "https:") return location.origin;
|
|
13
|
+
return cfg().baseUrl;
|
|
14
|
+
}
|
|
15
|
+
var NODE_URL = resolveNodeUrl();
|
|
16
|
+
var APEX_URL = cfg().baseUrl;
|
|
17
|
+
var NODE_ID = cfg().nodeId;
|
|
18
|
+
var HEARTBEAT_MS = cfg().heartbeatMs || 3e4;
|
|
19
|
+
|
|
20
|
+
// src/static/sdk-libs/_core/session.js
|
|
21
|
+
function getSession(libLabel) {
|
|
22
|
+
const auth = window.AIMEAT && window.AIMEAT.auth;
|
|
23
|
+
if (!auth) {
|
|
24
|
+
throw new Error("AIMEAT.auth is required. Include aimeat-auth.js before " + (libLabel || "this library"));
|
|
25
|
+
}
|
|
26
|
+
const s = auth.getSession();
|
|
27
|
+
if (!s) throw new Error("Not logged in. Call AIMEAT.auth.login() first.");
|
|
28
|
+
return s;
|
|
29
|
+
}
|
|
30
|
+
function authFetch(path, opts, libLabel) {
|
|
31
|
+
return getSession(libLabel).fetch(path, opts);
|
|
32
|
+
}
|
|
33
|
+
function makeSession(libLabel) {
|
|
34
|
+
return {
|
|
35
|
+
getSession: () => getSession(libLabel),
|
|
36
|
+
authFetch: (path, opts) => authFetch(path, opts, libLabel)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// src/static/sdk-libs/_core/namespace.js
|
|
41
|
+
function namespace() {
|
|
42
|
+
if (!window.AIMEAT) window.AIMEAT = {};
|
|
43
|
+
return window.AIMEAT;
|
|
44
|
+
}
|
|
45
|
+
function attach(key, value) {
|
|
46
|
+
const ns = namespace();
|
|
47
|
+
ns[key] = value;
|
|
48
|
+
return ns;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// src/static/sdk-libs/work/index.js
|
|
52
|
+
var { authFetch: authFetch2 } = makeSession("aimeat-work.js");
|
|
53
|
+
async function publicFetch(path) {
|
|
54
|
+
const r = await fetch(NODE_URL + path);
|
|
55
|
+
return r.json();
|
|
56
|
+
}
|
|
57
|
+
var work = {
|
|
58
|
+
// ── Catalogue (public, no auth) ──
|
|
59
|
+
// Browse action catalogue
|
|
60
|
+
async catalogue(opts) {
|
|
61
|
+
const params = new URLSearchParams();
|
|
62
|
+
if (opts?.search) params.set("search", opts.search);
|
|
63
|
+
if (opts?.category) params.set("category", opts.category);
|
|
64
|
+
if (opts?.page) params.set("page", String(opts.page));
|
|
65
|
+
if (opts?.per_page) params.set("per_page", String(opts.per_page));
|
|
66
|
+
const qs = params.toString();
|
|
67
|
+
const res = await publicFetch("/v1/catalogue" + (qs ? "?" + qs : ""));
|
|
68
|
+
if (!res.ok) throw new Error(res.error?.message || "Failed to browse catalogue");
|
|
69
|
+
return res.data;
|
|
70
|
+
},
|
|
71
|
+
// Get action details
|
|
72
|
+
async getAction(actionId) {
|
|
73
|
+
const res = await publicFetch("/v1/catalogue/" + encodeURIComponent(actionId));
|
|
74
|
+
if (!res.ok) {
|
|
75
|
+
if (res.error?.code === "NOT_FOUND") return null;
|
|
76
|
+
throw new Error(res.error?.message || "Failed to get action");
|
|
77
|
+
}
|
|
78
|
+
return res.data;
|
|
79
|
+
},
|
|
80
|
+
// Browse agent directory
|
|
81
|
+
async agents(opts) {
|
|
82
|
+
const params = new URLSearchParams();
|
|
83
|
+
if (opts?.page) params.set("page", String(opts.page));
|
|
84
|
+
if (opts?.per_page) params.set("per_page", String(opts.per_page));
|
|
85
|
+
const qs = params.toString();
|
|
86
|
+
const res = await publicFetch("/v1/catalogue/agents" + (qs ? "?" + qs : ""));
|
|
87
|
+
if (!res.ok) throw new Error(res.error?.message || "Failed to list agents");
|
|
88
|
+
return res.data;
|
|
89
|
+
},
|
|
90
|
+
// Get node stats
|
|
91
|
+
async stats() {
|
|
92
|
+
const res = await publicFetch("/v1/stats");
|
|
93
|
+
if (!res.ok) throw new Error(res.error?.message || "Failed to get stats");
|
|
94
|
+
return res.data;
|
|
95
|
+
},
|
|
96
|
+
// Catalogue change detection hash
|
|
97
|
+
async hash() {
|
|
98
|
+
const res = await publicFetch("/v1/catalogue/hash");
|
|
99
|
+
if (!res.ok) throw new Error(res.error?.message || "Failed to get hash");
|
|
100
|
+
return res.data;
|
|
101
|
+
},
|
|
102
|
+
// ── Work Requests (Tier 1, JWT auth) ──
|
|
103
|
+
// Submit a work request
|
|
104
|
+
async request(actionId, providerGaii, input, opts) {
|
|
105
|
+
const body = {
|
|
106
|
+
action_id: actionId,
|
|
107
|
+
provider_gaii: providerGaii,
|
|
108
|
+
input,
|
|
109
|
+
...opts
|
|
110
|
+
};
|
|
111
|
+
const res = await authFetch2("/v1/work/request", {
|
|
112
|
+
method: "POST",
|
|
113
|
+
body: JSON.stringify(body)
|
|
114
|
+
});
|
|
115
|
+
if (!res.ok) throw new Error(res.error?.message || "Failed to submit work request");
|
|
116
|
+
return res.data;
|
|
117
|
+
},
|
|
118
|
+
// Submit batch work requests
|
|
119
|
+
async batch(requests) {
|
|
120
|
+
const res = await authFetch2("/v1/work/batch", {
|
|
121
|
+
method: "POST",
|
|
122
|
+
body: JSON.stringify({ requests })
|
|
123
|
+
});
|
|
124
|
+
if (!res.ok) throw new Error(res.error?.message || "Failed to submit batch");
|
|
125
|
+
return res.data;
|
|
126
|
+
},
|
|
127
|
+
// ── Provider Inbox ──
|
|
128
|
+
// Get pending work items (provider perspective)
|
|
129
|
+
async inbox() {
|
|
130
|
+
const res = await authFetch2("/v1/work/inbox");
|
|
131
|
+
if (!res.ok) throw new Error(res.error?.message || "Failed to get inbox");
|
|
132
|
+
return res.data;
|
|
133
|
+
},
|
|
134
|
+
// ── Work Status & Actions ──
|
|
135
|
+
// Get work status by tracking code
|
|
136
|
+
async status(trackingCode) {
|
|
137
|
+
const res = await authFetch2("/v1/work/" + encodeURIComponent(trackingCode));
|
|
138
|
+
if (!res.ok) throw new Error(res.error?.message || "Failed to get work status");
|
|
139
|
+
return res.data;
|
|
140
|
+
},
|
|
141
|
+
// Accept work (provider)
|
|
142
|
+
async accept(trackingCode) {
|
|
143
|
+
const res = await authFetch2("/v1/work/" + encodeURIComponent(trackingCode) + "/accept", {
|
|
144
|
+
method: "POST"
|
|
145
|
+
});
|
|
146
|
+
if (!res.ok) throw new Error(res.error?.message || "Failed to accept work");
|
|
147
|
+
return res.data;
|
|
148
|
+
},
|
|
149
|
+
// Mark work as in_progress (provider)
|
|
150
|
+
async progress(trackingCode) {
|
|
151
|
+
const res = await authFetch2("/v1/work/" + encodeURIComponent(trackingCode) + "/progress", {
|
|
152
|
+
method: "POST"
|
|
153
|
+
});
|
|
154
|
+
if (!res.ok) throw new Error(res.error?.message || "Failed to update progress");
|
|
155
|
+
return res.data;
|
|
156
|
+
},
|
|
157
|
+
// Reject work (provider)
|
|
158
|
+
async reject(trackingCode, reason) {
|
|
159
|
+
const res = await authFetch2("/v1/work/" + encodeURIComponent(trackingCode) + "/reject", {
|
|
160
|
+
method: "POST",
|
|
161
|
+
body: JSON.stringify({ reason })
|
|
162
|
+
});
|
|
163
|
+
if (!res.ok) throw new Error(res.error?.message || "Failed to reject work");
|
|
164
|
+
return res.data;
|
|
165
|
+
},
|
|
166
|
+
// Deliver work output (provider)
|
|
167
|
+
async deliver(trackingCode, output, metadata) {
|
|
168
|
+
const body = (
|
|
169
|
+
/** @type {Record<string, any>} */
|
|
170
|
+
{ output }
|
|
171
|
+
);
|
|
172
|
+
if (metadata) body.metadata = metadata;
|
|
173
|
+
const res = await authFetch2("/v1/work/" + encodeURIComponent(trackingCode) + "/deliver", {
|
|
174
|
+
method: "POST",
|
|
175
|
+
body: JSON.stringify(body)
|
|
176
|
+
});
|
|
177
|
+
if (!res.ok) throw new Error(res.error?.message || "Failed to deliver work");
|
|
178
|
+
return res.data;
|
|
179
|
+
},
|
|
180
|
+
// Rate a delivery (requester)
|
|
181
|
+
async rate(trackingCode, rating, comment) {
|
|
182
|
+
const body = (
|
|
183
|
+
/** @type {Record<string, any>} */
|
|
184
|
+
{ rating }
|
|
185
|
+
);
|
|
186
|
+
if (comment) body.comment = comment;
|
|
187
|
+
const res = await authFetch2("/v1/work/" + encodeURIComponent(trackingCode) + "/rate", {
|
|
188
|
+
method: "POST",
|
|
189
|
+
body: JSON.stringify(body)
|
|
190
|
+
});
|
|
191
|
+
if (!res.ok) throw new Error(res.error?.message || "Failed to rate work");
|
|
192
|
+
return res.data;
|
|
193
|
+
},
|
|
194
|
+
// ── Convenience: Poll for completion ──
|
|
195
|
+
async waitFor(trackingCode, opts) {
|
|
196
|
+
const interval = opts?.interval || 2e3;
|
|
197
|
+
const timeout = opts?.timeout || 6e4;
|
|
198
|
+
const start = Date.now();
|
|
199
|
+
while (Date.now() - start < timeout) {
|
|
200
|
+
const data = await work.status(trackingCode);
|
|
201
|
+
if (data.status === "delivered" || data.status === "rated" || data.status === "completed") {
|
|
202
|
+
return data;
|
|
203
|
+
}
|
|
204
|
+
if (data.status === "rejected" || data.status === "expired" || data.status === "failed") {
|
|
205
|
+
throw new Error("Work " + data.status + ": " + (data.output || trackingCode));
|
|
206
|
+
}
|
|
207
|
+
await new Promise((r) => setTimeout(r, interval));
|
|
208
|
+
}
|
|
209
|
+
throw new Error("Work timed out after " + timeout + "ms");
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
attach("work", work);
|
|
213
|
+
})();
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// GENERATED FILE — do not edit directly. Source: src/static/sdk-libs/workflows/ (+ _core/).
|
|
2
|
+
// Rebuild: pnpm build:sdk · Served at /v1/libs/aimeat-workflows.js (with a per-node config prelude).
|
|
3
|
+
"use strict";
|
|
4
|
+
(() => {
|
|
5
|
+
// src/static/sdk-libs/_core/session.js
|
|
6
|
+
function getSession(libLabel) {
|
|
7
|
+
const auth = window.AIMEAT && window.AIMEAT.auth;
|
|
8
|
+
if (!auth) {
|
|
9
|
+
throw new Error("AIMEAT.auth is required. Include aimeat-auth.js before " + (libLabel || "this library"));
|
|
10
|
+
}
|
|
11
|
+
const s = auth.getSession();
|
|
12
|
+
if (!s) throw new Error("Not logged in. Call AIMEAT.auth.login() first.");
|
|
13
|
+
return s;
|
|
14
|
+
}
|
|
15
|
+
function authFetch(path, opts, libLabel) {
|
|
16
|
+
return getSession(libLabel).fetch(path, opts);
|
|
17
|
+
}
|
|
18
|
+
function makeSession(libLabel) {
|
|
19
|
+
return {
|
|
20
|
+
getSession: () => getSession(libLabel),
|
|
21
|
+
authFetch: (path, opts) => authFetch(path, opts, libLabel)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// src/static/sdk-libs/_core/namespace.js
|
|
26
|
+
function namespace() {
|
|
27
|
+
if (!window.AIMEAT) window.AIMEAT = {};
|
|
28
|
+
return window.AIMEAT;
|
|
29
|
+
}
|
|
30
|
+
function attach(key, value) {
|
|
31
|
+
const ns = namespace();
|
|
32
|
+
ns[key] = value;
|
|
33
|
+
return ns;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/static/sdk-libs/workflows/index.js
|
|
37
|
+
var { authFetch: authFetch2 } = makeSession("aimeat-workflows.js");
|
|
38
|
+
async function call(path, opts) {
|
|
39
|
+
const res = await authFetch2(path, opts);
|
|
40
|
+
if (!res.ok) {
|
|
41
|
+
const err = (
|
|
42
|
+
/** @type {Error & { code?: string, details?: unknown }} */
|
|
43
|
+
new Error(res.error && res.error.message || "Workflow request failed")
|
|
44
|
+
);
|
|
45
|
+
err.code = res.error && res.error.code;
|
|
46
|
+
err.details = res.error && res.error.details;
|
|
47
|
+
throw err;
|
|
48
|
+
}
|
|
49
|
+
return res.data;
|
|
50
|
+
}
|
|
51
|
+
var workflows = {
|
|
52
|
+
// ── definitions ──
|
|
53
|
+
// List the owner's workflow definitions. { includeHealth: true } inlines each workflow's
|
|
54
|
+
// run-health trend (avoids a per-workflow health() fan-out on list views).
|
|
55
|
+
async list(opts) {
|
|
56
|
+
const qs = opts && opts.includeHealth ? "?include=health" : "";
|
|
57
|
+
return call("/v1/workflows" + qs);
|
|
58
|
+
},
|
|
59
|
+
async get(id) {
|
|
60
|
+
return call("/v1/workflows/" + encodeURIComponent(id));
|
|
61
|
+
},
|
|
62
|
+
// Create or update. def = { title, description, trigger, vars, steps, on_step_fail:'inspect', ... }.
|
|
63
|
+
// Rejected (error.details.errors[]) unless the graph is a DAG and every agent step's offer is
|
|
64
|
+
// workflow-compatible. Steps may also be actions: export-out / trigger-geai / human-input.
|
|
65
|
+
async save(id, def) {
|
|
66
|
+
return call("/v1/workflows/" + encodeURIComponent(id), { method: "PUT", body: JSON.stringify(def) });
|
|
67
|
+
},
|
|
68
|
+
async remove(id, opts) {
|
|
69
|
+
const qs = opts && opts.withRuns ? "?withRuns=true" : "";
|
|
70
|
+
return call("/v1/workflows/" + encodeURIComponent(id) + qs, { method: "DELETE" });
|
|
71
|
+
},
|
|
72
|
+
// The derived structural graph (nodes + edges + memory keys each step reads/writes) — feed a canvas.
|
|
73
|
+
async blueprint(id) {
|
|
74
|
+
return call("/v1/workflows/" + encodeURIComponent(id) + "/blueprint");
|
|
75
|
+
},
|
|
76
|
+
async health(id) {
|
|
77
|
+
return call("/v1/workflows/" + encodeURIComponent(id) + "/health");
|
|
78
|
+
},
|
|
79
|
+
// ── runs ──
|
|
80
|
+
// mode: 'signals' (evaluate signals only, no dispatch — instant health check) | 'full' (execute).
|
|
81
|
+
// sandbox: true namespaces every key under wf-test.<runId>. so a test run never clobbers prod.
|
|
82
|
+
async run(id, opts) {
|
|
83
|
+
const body = {
|
|
84
|
+
mode: opts && opts.mode === "full" ? "full" : "signals-only",
|
|
85
|
+
target: opts && opts.sandbox ? "sandbox" : "live",
|
|
86
|
+
vars: opts && opts.vars || void 0
|
|
87
|
+
};
|
|
88
|
+
return call("/v1/workflows/" + encodeURIComponent(id) + "/run", { method: "POST", body: JSON.stringify(body) });
|
|
89
|
+
},
|
|
90
|
+
async runs(id) {
|
|
91
|
+
return call("/v1/workflows/" + encodeURIComponent(id) + "/runs");
|
|
92
|
+
},
|
|
93
|
+
async getRun(id, runId) {
|
|
94
|
+
return call("/v1/workflows/" + encodeURIComponent(id) + "/runs/" + encodeURIComponent(runId));
|
|
95
|
+
},
|
|
96
|
+
async cancel(id, runId) {
|
|
97
|
+
return call("/v1/workflows/" + encodeURIComponent(id) + "/runs/" + encodeURIComponent(runId) + "/cancel", { method: "POST" });
|
|
98
|
+
},
|
|
99
|
+
// ── human-in-the-loop ──
|
|
100
|
+
// Every step across the owner's active runs currently waiting for a human answer:
|
|
101
|
+
// [{ workflowId, runId, stepId, workflowTitle, question:{prompt,options,...}, askedAt, deadline }].
|
|
102
|
+
async pendingInputs() {
|
|
103
|
+
return call("/v1/workflows/pending-inputs");
|
|
104
|
+
},
|
|
105
|
+
// Answer a waiting-human step. answer = { picks: ['option-id'], other?: 'free text' }. 409 when the
|
|
106
|
+
// step is not parked (already answered / timed out); the run advances on success.
|
|
107
|
+
async answer(id, runId, stepId, answer) {
|
|
108
|
+
return call("/v1/workflows/" + encodeURIComponent(id) + "/runs/" + encodeURIComponent(runId) + "/steps/" + encodeURIComponent(stepId) + "/answer", { method: "POST", body: JSON.stringify(answer) });
|
|
109
|
+
},
|
|
110
|
+
// ── live watching ──
|
|
111
|
+
// Re-fetch a run whenever the 'workflows' SSE domain ticks (via aimeat-live when loaded; falls back
|
|
112
|
+
// to polling every pollMs, default 5000). cb(run) fires on every fetch; returns a stop() function.
|
|
113
|
+
// Stops itself automatically when the run reaches a terminal state.
|
|
114
|
+
watchRun(id, runId, cb, opts) {
|
|
115
|
+
let stopped = false;
|
|
116
|
+
let unsub = null;
|
|
117
|
+
let timer = null;
|
|
118
|
+
const TERMINAL = { done: 1, partial: 1, red: 1, cancelled: 1 };
|
|
119
|
+
const pull = async () => {
|
|
120
|
+
if (stopped) return;
|
|
121
|
+
try {
|
|
122
|
+
const run = await workflows.getRun(id, runId);
|
|
123
|
+
cb(run);
|
|
124
|
+
if (run && TERMINAL[run.status]) stop();
|
|
125
|
+
} catch {
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const stop = () => {
|
|
129
|
+
if (stopped) return;
|
|
130
|
+
stopped = true;
|
|
131
|
+
if (unsub) try {
|
|
132
|
+
unsub();
|
|
133
|
+
} catch {
|
|
134
|
+
}
|
|
135
|
+
if (timer) clearInterval(timer);
|
|
136
|
+
};
|
|
137
|
+
if (window.AIMEAT.live && typeof window.AIMEAT.live.subscribe === "function") {
|
|
138
|
+
unsub = window.AIMEAT.live.subscribe(["workflows"], pull);
|
|
139
|
+
} else {
|
|
140
|
+
timer = setInterval(pull, opts && opts.pollMs || 5e3);
|
|
141
|
+
}
|
|
142
|
+
pull();
|
|
143
|
+
return stop;
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
attach("workflows", workflows);
|
|
147
|
+
})();
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file editor/index.js
|
|
3
|
+
* @description The aimeat-editor library (SDK-libs migration Phase 1). Mounts a CodeMirror 6 markdown
|
|
4
|
+
* editor (dynamic esm.sh import, pinned codemirror@6.0.2) with markdown highlighting + a one-dark
|
|
5
|
+
* theme in dark mode, falling back to a plain auto-growing <textarea> when the CDN import fails or
|
|
6
|
+
* times out — so the editor always works. Exposes a uniform adapter (getValue/setValue/wrap/
|
|
7
|
+
* prefixLine/focus) a toolbar + save flows target regardless of engine; split() adds a live preview
|
|
8
|
+
* pane through AIMEAT.md.renderRich. Componentized ESM source esbuild bundles to the IIFE served,
|
|
9
|
+
* unchanged, at /v1/libs/aimeat-editor.js. Ported verbatim from lib-editor.ts; the CDN import
|
|
10
|
+
* specifiers are held in variables so tsc/esbuild leave them as runtime dynamic imports.
|
|
11
|
+
* @structure imports attach (namespace); injectCss/loadCM; mount()/toolbar()/split(); attach('editor', …).
|
|
12
|
+
* @usage <script src="/v1/libs/aimeat-markdown.js"></script><script src="/v1/libs/aimeat-editor.js"></script>
|
|
13
|
+
* const { adapter } = AIMEAT.editor.split(host, { value: md, onChange: t => dirty = true });
|
|
14
|
+
* @version-history
|
|
15
|
+
* v1.0.0 — 2026-07-19 — Migrated from src/routes/lib-editor.ts (SDK-libs migration Phase 1).
|
|
16
|
+
*/
|
|
17
|
+
import { attach } from '../_core/namespace.js';
|
|
18
|
+
|
|
19
|
+
var BT = String.fromCharCode(96); // backtick
|
|
20
|
+
var FENCE = BT + BT + BT;
|
|
21
|
+
|
|
22
|
+
// CDN import specifiers held in variables so tsc can't resolve them (Promise<any>) and esbuild
|
|
23
|
+
// leaves them as runtime dynamic imports (not bundled) — the browser imports them at mount time.
|
|
24
|
+
var CM_URL = 'https://esm.sh/codemirror@6.0.2'; // exact pin — the "@6" range resolves to a CM5 build on esm.sh
|
|
25
|
+
var CM_MD_URL = 'https://esm.sh/@codemirror/lang-markdown@6';
|
|
26
|
+
var CM_DARK_URL = 'https://esm.sh/@codemirror/theme-one-dark@6';
|
|
27
|
+
|
|
28
|
+
var CSS = '.aimeat-ed-host .cm-editor{border:1px solid var(--color-base-300,#3a3a3a);border-radius:8px;font-size:.95rem;background:transparent;}' +
|
|
29
|
+
'.aimeat-ed-host .cm-editor.cm-focused{outline:none;border-color:var(--color-primary,#4f9eff);}' +
|
|
30
|
+
'.aimeat-ed-host .cm-scroller{min-height:280px;max-height:70vh;overflow:auto;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;line-height:1.6;}' +
|
|
31
|
+
'.aimeat-ed-host textarea.aimeat-ed-ta{width:100%;border:1px solid var(--color-base-300,#3a3a3a);border-radius:8px;background:transparent;' +
|
|
32
|
+
'font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.92rem;line-height:1.6;color:inherit;min-height:280px;padding:.7rem;outline:none;resize:vertical;}' +
|
|
33
|
+
'.aimeat-ed-loading{color:var(--color-base-content,#888);opacity:.7;font-size:.85rem;padding:.8rem;border:1px dashed var(--color-base-300,#3a3a3a);border-radius:8px;}' +
|
|
34
|
+
'.aimeat-ed-toolbar{display:flex;gap:.15rem;flex-wrap:wrap;align-items:center;padding:.35rem .4rem;margin:0 0 .8rem;' +
|
|
35
|
+
'border:1px solid var(--color-base-300,#3a3a3a);border-radius:8px;}' +
|
|
36
|
+
'.aimeat-ed-tb{border:none;background:transparent;border-radius:5px;cursor:pointer;padding:.25rem .5rem;font-size:.82rem;color:inherit;min-height:28px;}' +
|
|
37
|
+
'.aimeat-ed-tb:hover{background:var(--color-base-200,rgba(128,128,128,.15));}' +
|
|
38
|
+
'.aimeat-ed-sep{width:1px;align-self:stretch;background:var(--color-base-300,#3a3a3a);margin:.15rem .25rem;}' +
|
|
39
|
+
'.aimeat-ed-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1.2rem;align-items:start;}' +
|
|
40
|
+
'.aimeat-ed-preview{border-left:1px solid var(--color-base-300,#3a3a3a);padding-left:1.2rem;min-height:280px;max-height:70vh;overflow-y:auto;}' +
|
|
41
|
+
'@media (max-width:1099px){.aimeat-ed-split{grid-template-columns:1fr;}' +
|
|
42
|
+
'.aimeat-ed-preview{border-left:none;border-top:1px solid var(--color-base-300,#3a3a3a);padding:1rem 0 0;max-height:none;}}';
|
|
43
|
+
function injectCss() {
|
|
44
|
+
if (document.getElementById('aimeat-editor-styles')) return;
|
|
45
|
+
var s = document.createElement('style');
|
|
46
|
+
s.id = 'aimeat-editor-styles';
|
|
47
|
+
s.textContent = CSS;
|
|
48
|
+
(document.head || document.documentElement).appendChild(s);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var _cmModsP = null;
|
|
52
|
+
function loadCM() {
|
|
53
|
+
if (_cmModsP) return _cmModsP;
|
|
54
|
+
_cmModsP = Promise.race([
|
|
55
|
+
Promise.all([
|
|
56
|
+
import(CM_URL),
|
|
57
|
+
import(CM_MD_URL).catch(function () { return null; }),
|
|
58
|
+
import(CM_DARK_URL).catch(function () { return null; }),
|
|
59
|
+
]),
|
|
60
|
+
new Promise(function (_, rej) { setTimeout(function () { rej(new Error('editor cdn timeout')); }, 10000); }),
|
|
61
|
+
]).catch(function (e) { _cmModsP = null; throw e; });
|
|
62
|
+
return _cmModsP;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function wrapSelTa(ta, before, after, placeholder) {
|
|
66
|
+
var s = ta.selectionStart, e = ta.selectionEnd, val = ta.value;
|
|
67
|
+
var sel = val.slice(s, e) || placeholder || '';
|
|
68
|
+
ta.value = val.slice(0, s) + before + sel + (after || '') + val.slice(e);
|
|
69
|
+
ta.focus(); ta.selectionStart = s + before.length; ta.selectionEnd = s + before.length + sel.length;
|
|
70
|
+
ta.dispatchEvent(new Event('input'));
|
|
71
|
+
}
|
|
72
|
+
function linePrefixTa(ta, prefix) {
|
|
73
|
+
var s = ta.selectionStart, val = ta.value;
|
|
74
|
+
var ls = val.lastIndexOf('\n', s - 1) + 1;
|
|
75
|
+
ta.value = val.slice(0, ls) + prefix + val.slice(ls);
|
|
76
|
+
ta.focus(); ta.selectionStart = ta.selectionEnd = s + prefix.length;
|
|
77
|
+
ta.dispatchEvent(new Event('input'));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Mount an editor into host. Returns an adapter usable before the async CM mount resolves
|
|
81
|
+
// (getValue falls back to the initial text until an engine is live).
|
|
82
|
+
function mount(host, opts) {
|
|
83
|
+
opts = opts || {};
|
|
84
|
+
injectCss();
|
|
85
|
+
host.classList.add('aimeat-ed-host');
|
|
86
|
+
var A = {
|
|
87
|
+
host: host,
|
|
88
|
+
cm: /** @type {any} */ (null),
|
|
89
|
+
ta: /** @type {any} */ (null),
|
|
90
|
+
_initial: opts.value || '',
|
|
91
|
+
getValue: function () {
|
|
92
|
+
if (this.cm) return this.cm.state.doc.toString();
|
|
93
|
+
if (this.ta) return this.ta.value;
|
|
94
|
+
return this._initial;
|
|
95
|
+
},
|
|
96
|
+
setValue: function (text) {
|
|
97
|
+
text = text == null ? '' : String(text);
|
|
98
|
+
if (this.cm) this.cm.dispatch({ changes: { from: 0, to: this.cm.state.doc.length, insert: text } });
|
|
99
|
+
else if (this.ta) { this.ta.value = text; this.ta.dispatchEvent(new Event('input')); }
|
|
100
|
+
else this._initial = text;
|
|
101
|
+
},
|
|
102
|
+
focus: function () { if (this.cm) this.cm.focus(); else if (this.ta) this.ta.focus(); },
|
|
103
|
+
wrap: function (before, after, ph) {
|
|
104
|
+
if (this.cm) {
|
|
105
|
+
var st = this.cm.state, sel = st.selection.main;
|
|
106
|
+
var chosen = st.sliceDoc(sel.from, sel.to) || ph || '';
|
|
107
|
+
this.cm.dispatch({
|
|
108
|
+
changes: { from: sel.from, to: sel.to, insert: before + chosen + (after || '') },
|
|
109
|
+
selection: { anchor: sel.from + before.length, head: sel.from + before.length + chosen.length },
|
|
110
|
+
});
|
|
111
|
+
this.cm.focus();
|
|
112
|
+
} else if (this.ta) wrapSelTa(this.ta, before, after, ph);
|
|
113
|
+
},
|
|
114
|
+
prefixLine: function (prefix) {
|
|
115
|
+
if (this.cm) {
|
|
116
|
+
var st = this.cm.state, line = st.doc.lineAt(st.selection.main.head);
|
|
117
|
+
this.cm.dispatch({ changes: { from: line.from, insert: prefix } });
|
|
118
|
+
this.cm.focus();
|
|
119
|
+
} else if (this.ta) linePrefixTa(this.ta, prefix);
|
|
120
|
+
},
|
|
121
|
+
destroy: function () {
|
|
122
|
+
if (this.cm) { this.cm.destroy(); this.cm = null; }
|
|
123
|
+
this.ta = null;
|
|
124
|
+
host.innerHTML = '';
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
host.innerHTML = '';
|
|
128
|
+
var loading = document.createElement('div');
|
|
129
|
+
loading.className = 'aimeat-ed-loading';
|
|
130
|
+
loading.textContent = 'Loading editor…';
|
|
131
|
+
host.appendChild(loading);
|
|
132
|
+
function emit() { if (opts.onChange) opts.onChange(A.getValue()); }
|
|
133
|
+
function mountTa() {
|
|
134
|
+
if (A.cm || A.ta || !host.isConnected) return;
|
|
135
|
+
var ta = document.createElement('textarea');
|
|
136
|
+
ta.className = 'aimeat-ed-ta';
|
|
137
|
+
ta.placeholder = opts.placeholder || 'Write in markdown…';
|
|
138
|
+
ta.value = A._initial;
|
|
139
|
+
ta.addEventListener('input', emit);
|
|
140
|
+
host.innerHTML = ''; host.appendChild(ta); A.ta = ta;
|
|
141
|
+
}
|
|
142
|
+
loadCM().then(function (mods) {
|
|
143
|
+
if (A.ta || A.cm || !host.isConnected) return;
|
|
144
|
+
var cmr = mods[0], mdm = mods[1], darkm = mods[2];
|
|
145
|
+
var base = [cmr.basicSetup, cmr.EditorView.lineWrapping,
|
|
146
|
+
cmr.EditorView.updateListener.of(function (u) { if (u.docChanged) emit(); })];
|
|
147
|
+
var exts = base.slice();
|
|
148
|
+
try { if (mdm && mdm.markdown) exts.push(mdm.markdown()); } catch { /* markdown ext optional */ }
|
|
149
|
+
if (darkm && darkm.oneDark && document.documentElement.getAttribute('data-theme') === 'dark') exts.push(darkm.oneDark);
|
|
150
|
+
var view;
|
|
151
|
+
try { view = new cmr.EditorView({ doc: A._initial, extensions: exts }); }
|
|
152
|
+
catch { view = new cmr.EditorView({ doc: A._initial, extensions: base }); } // dual-instance ext mismatch → plain setup
|
|
153
|
+
host.innerHTML = ''; host.appendChild(view.dom); A.cm = view;
|
|
154
|
+
}).catch(function () { mountTa(); });
|
|
155
|
+
return A;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function toolbar(A) {
|
|
159
|
+
injectCss();
|
|
160
|
+
function b(label, title, fn) {
|
|
161
|
+
var btn = document.createElement('button');
|
|
162
|
+
btn.type = 'button'; btn.className = 'aimeat-ed-tb'; btn.textContent = label; btn.title = title;
|
|
163
|
+
btn.addEventListener('click', function (ev) { ev.preventDefault(); fn(); });
|
|
164
|
+
return btn;
|
|
165
|
+
}
|
|
166
|
+
function sep() { var s = document.createElement('span'); s.className = 'aimeat-ed-sep'; return s; }
|
|
167
|
+
var bar = document.createElement('div');
|
|
168
|
+
bar.className = 'aimeat-ed-toolbar';
|
|
169
|
+
[
|
|
170
|
+
b('B', 'Bold', function () { A.wrap('**', '**', 'bold'); }),
|
|
171
|
+
b('I', 'Italic', function () { A.wrap('*', '*', 'italic'); }),
|
|
172
|
+
b('S̶', 'Strikethrough', function () { A.wrap('~~', '~~', 'text'); }),
|
|
173
|
+
sep(),
|
|
174
|
+
b('H1', 'Heading 1', function () { A.prefixLine('# '); }),
|
|
175
|
+
b('H2', 'Heading 2', function () { A.prefixLine('## '); }),
|
|
176
|
+
b('H3', 'Heading 3', function () { A.prefixLine('### '); }),
|
|
177
|
+
sep(),
|
|
178
|
+
b('•', 'Bullet list', function () { A.prefixLine('- '); }),
|
|
179
|
+
b('1.', 'Numbered list', function () { A.prefixLine('1. '); }),
|
|
180
|
+
b('☐', 'Todo', function () { A.prefixLine('- [ ] '); }),
|
|
181
|
+
b('❝', 'Quote', function () { A.prefixLine('> '); }),
|
|
182
|
+
sep(),
|
|
183
|
+
b('</>', 'Code block', function () { A.wrap('\n' + FENCE + '\n', '\n' + FENCE + '\n', 'code'); }),
|
|
184
|
+
b('🧜', 'Mermaid diagram', function () { A.wrap('\n' + FENCE + 'mermaid\n', '\n' + FENCE + '\n', 'graph TD\n A[Start] --> B[End]'); }),
|
|
185
|
+
b('🧩', 'Live data (aimeat-memory block)', function () { A.wrap('\n' + FENCE + 'aimeat-memory\nkey: ', '\n' + FENCE + '\n', 'livedata.my-table'); }),
|
|
186
|
+
b('🔗', 'Link', function () { A.wrap('[', '](https://)', 'link text'); }),
|
|
187
|
+
b('―', 'Divider', function () { A.prefixLine('\n---\n'); }),
|
|
188
|
+
].forEach(function (n) { bar.appendChild(n); });
|
|
189
|
+
return bar;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Editor + live preview side by side (stacked below 1100px). The preview renders through
|
|
193
|
+
// AIMEAT.md.renderRich when aimeat-markdown.js is loaded, else AIMEAT.md.render, else plain text.
|
|
194
|
+
function renderPreview(target, text) {
|
|
195
|
+
var md = window.AIMEAT && window.AIMEAT.md;
|
|
196
|
+
if (md && typeof md.renderRich === 'function') { md.renderRich(text, target); return; }
|
|
197
|
+
if (md && typeof md.render === 'function') { md.render(text, target); return; }
|
|
198
|
+
target.innerHTML = '';
|
|
199
|
+
var pre = document.createElement('pre');
|
|
200
|
+
pre.style.whiteSpace = 'pre-wrap';
|
|
201
|
+
pre.textContent = text;
|
|
202
|
+
target.appendChild(pre);
|
|
203
|
+
}
|
|
204
|
+
function split(host, opts) {
|
|
205
|
+
opts = opts || {};
|
|
206
|
+
injectCss();
|
|
207
|
+
host.innerHTML = '';
|
|
208
|
+
var wrap = document.createElement('div');
|
|
209
|
+
wrap.className = 'aimeat-ed-split';
|
|
210
|
+
var edPane = document.createElement('div');
|
|
211
|
+
var pvPane = document.createElement('div');
|
|
212
|
+
pvPane.className = 'aimeat-ed-preview';
|
|
213
|
+
wrap.appendChild(edPane); wrap.appendChild(pvPane);
|
|
214
|
+
host.appendChild(wrap);
|
|
215
|
+
var timer = null;
|
|
216
|
+
var debounce = opts.previewDebounceMs || 350;
|
|
217
|
+
var A = mount(edPane, {
|
|
218
|
+
value: opts.value, placeholder: opts.placeholder,
|
|
219
|
+
onChange: function (t) {
|
|
220
|
+
if (opts.onChange) opts.onChange(t);
|
|
221
|
+
clearTimeout(timer);
|
|
222
|
+
timer = setTimeout(function () { if (pvPane.isConnected) renderPreview(pvPane, t); }, debounce);
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
renderPreview(pvPane, opts.value || '');
|
|
226
|
+
return { adapter: A, editorEl: edPane, previewEl: pvPane };
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
attach('editor', { mount: mount, toolbar: toolbar, split: split });
|