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,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file commerce/index.js
|
|
3
|
+
* @description The aimeat-commerce library (SDK-libs migration Phase 2, TARGET-033/034). Exposes
|
|
4
|
+
* AIMEAT.commerce — checkout sessions over /v1/commerce/*, offer price reading, money formatting in
|
|
5
|
+
* 6-decimal micro-units, the x402-style 402 `accepts` surface, and the app-tool convention (manifest
|
|
6
|
+
* read + one-call buy). Authenticated calls go through the AIMEAT.auth session; feed/getAppTools are
|
|
7
|
+
* public. Componentized ESM source esbuild bundles to the IIFE served, unchanged, at
|
|
8
|
+
* /v1/libs/aimeat-commerce.js. Ported verbatim from lib-commerce.ts. SECURITY: carries NO secrets —
|
|
9
|
+
* seller PSP credentials are server-side only; NODE_URL is the apex base (APEX_URL from _core/config).
|
|
10
|
+
* @structure imports APEX_URL (config) + authFetch (session) + attach (namespace); commerceError/
|
|
11
|
+
* normalizeItems; money helpers; checkout lifecycle; offer discovery; app-tools; attach('commerce', …).
|
|
12
|
+
* @usage <script src="/v1/libs/aimeat-auth.js"></script><script src="/v1/libs/aimeat-commerce.js"></script>
|
|
13
|
+
* const s = await AIMEAT.commerce.buyOffer('vendor#alice@node', 'translate-doc');
|
|
14
|
+
* @version-history
|
|
15
|
+
* v1.0.0 — 2026-07-19 — Migrated from src/routes/lib-commerce.ts (SDK-libs migration Phase 2).
|
|
16
|
+
*/
|
|
17
|
+
import { APEX_URL } from '../_core/config.js';
|
|
18
|
+
import { makeSession } from '../_core/session.js';
|
|
19
|
+
const { authFetch } = makeSession('aimeat-commerce.js');
|
|
20
|
+
import { attach } from '../_core/namespace.js';
|
|
21
|
+
|
|
22
|
+
const NODE_URL = APEX_URL;
|
|
23
|
+
|
|
24
|
+
/** Micros per whole currency unit — money amounts are 6-decimal micro-units (matches USDC/x402). */
|
|
25
|
+
const MONEY_UNIT = 1000000;
|
|
26
|
+
|
|
27
|
+
/** Build an Error from a failed envelope; 402 responses carry the x402-style accepts block. */
|
|
28
|
+
function commerceError(res, fallback) {
|
|
29
|
+
const e = /** @type {Error & { code?: string, paymentRequired?: boolean, accepts?: unknown, x402Version?: unknown }} */ (new Error((res.error && res.error.message) || fallback));
|
|
30
|
+
e.code = res.error && res.error.code;
|
|
31
|
+
if (res.accepts) {
|
|
32
|
+
e.paymentRequired = true;
|
|
33
|
+
e.accepts = res.accepts; // [{ scheme, handler, currencies, description, resource }]
|
|
34
|
+
e.x402Version = res.x402Version;
|
|
35
|
+
}
|
|
36
|
+
return e;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Normalize line items: accept offerId or offer_id, default kind 'offer', quantity 1. */
|
|
40
|
+
function normalizeItems(items) {
|
|
41
|
+
const arr = Array.isArray(items) ? items : [items];
|
|
42
|
+
return arr.map(function (i) {
|
|
43
|
+
const out = /** @type {Record<string, any>} */ ({ offer_id: i.offer_id || i.offerId });
|
|
44
|
+
if (i.kind) out.kind = i.kind;
|
|
45
|
+
if (i.agent) out.agent = i.agent;
|
|
46
|
+
if (i.org) out.org = i.org;
|
|
47
|
+
if (i.app) out.app = i.app; // app-tool items (TARGET-034)
|
|
48
|
+
if (i.tool) out.tool = i.tool;
|
|
49
|
+
if (i.input) out.input = i.input; // app-tool: buyer input for the capability invoke
|
|
50
|
+
if (i.quantity) out.quantity = i.quantity;
|
|
51
|
+
return out;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const commerce = {
|
|
56
|
+
MONEY_UNIT: MONEY_UNIT,
|
|
57
|
+
|
|
58
|
+
// ── Money formatting (same convention as the portal's utils.js fmtMoney) ──
|
|
59
|
+
|
|
60
|
+
/** Format money micro-units as "1.50 EUR" / "0.002 USD" (≥2 decimals, up to 6 when sub-cent). */
|
|
61
|
+
fmtMoney(micros, currency) {
|
|
62
|
+
const s = ((Number(micros) || 0) / MONEY_UNIT).toFixed(6).replace(/(\.\d{2}\d*?)0+$/, '$1');
|
|
63
|
+
return currency ? s + ' ' + currency : s;
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
/** Format any session/offer amount currency-aware: morsels are integers, money is micro-units. */
|
|
67
|
+
fmtAmount(amount, currency) {
|
|
68
|
+
if (!currency || currency === 'morsel' || currency === 'MORSEL') {
|
|
69
|
+
return (Number(amount) || 0) + ' morsels';
|
|
70
|
+
}
|
|
71
|
+
return commerce.fmtMoney(amount, currency);
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
/** Parse a major-unit input ("1.50", "0,002") into integer money micro-units; null if not positive. */
|
|
75
|
+
microsFromInput(str) {
|
|
76
|
+
const n = parseFloat(String(str).replace(',', '.'));
|
|
77
|
+
if (!Number.isFinite(n) || n <= 0) return null;
|
|
78
|
+
return Math.round(n * MONEY_UNIT);
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
// ── Offer discovery + price reading ──
|
|
82
|
+
|
|
83
|
+
/** Public product feed: every PUBLIC, priced agent offer on the node (no login needed). */
|
|
84
|
+
async feed() {
|
|
85
|
+
const r = await fetch(NODE_URL + '/v1/commerce/feed');
|
|
86
|
+
const res = await r.json();
|
|
87
|
+
if (res.error) throw commerceError(res, 'Failed to read the commerce feed');
|
|
88
|
+
return res; // { products: [{ id: "offer:<agentGaii>:<offerId>", title, price, seller }], total }
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
/** Read one offer (with price/priceMoney) from an agent's published offers. */
|
|
92
|
+
async getOffer(agent, offerId) {
|
|
93
|
+
const res = await authFetch('/v1/agents/' + encodeURIComponent(agent) + '/offers');
|
|
94
|
+
if (!res.ok) throw commerceError(res, 'Failed to read offers');
|
|
95
|
+
const offers = (res.data && res.data.offers) || [];
|
|
96
|
+
return offers.find(function (o) { return o.id === offerId; }) || null;
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The price of an offer or app-tool entry in one currency.
|
|
101
|
+
* → { amount, currency, formatted } or null when it has no price in that currency.
|
|
102
|
+
* currency omitted/'morsel' → price.morsels; 'EUR'/'USD' → priceMoney micro-units.
|
|
103
|
+
*/
|
|
104
|
+
priceOf(offer, currency) {
|
|
105
|
+
if (!offer) return null;
|
|
106
|
+
if (!currency || currency === 'morsel') {
|
|
107
|
+
const m = offer.price && Number(offer.price.morsels);
|
|
108
|
+
if (!m || m <= 0) return null;
|
|
109
|
+
return { amount: m, currency: 'morsel', formatted: commerce.fmtAmount(m, 'morsel') };
|
|
110
|
+
}
|
|
111
|
+
const pm = offer.priceMoney;
|
|
112
|
+
if (!pm || pm.currency !== currency) return null;
|
|
113
|
+
return { amount: pm.amount, currency: currency, formatted: commerce.fmtMoney(pm.amount, currency) };
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
// ── Checkout sessions (/v1/commerce/checkout-sessions) ──
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Open a checkout session. items: [{ agent, offer_id, quantity? }] (kind defaults to 'offer').
|
|
120
|
+
* opts: { note?, currency? } — currency 'EUR'/'USD' needs a money price + a settling handler.
|
|
121
|
+
*/
|
|
122
|
+
async openCheckout(items, opts) {
|
|
123
|
+
const body = /** @type {Record<string, any>} */ ({ items: normalizeItems(items) });
|
|
124
|
+
if (opts && opts.note) body.note = opts.note;
|
|
125
|
+
if (opts && opts.currency) body.currency = opts.currency;
|
|
126
|
+
const res = await authFetch('/v1/commerce/checkout-sessions', {
|
|
127
|
+
method: 'POST', body: JSON.stringify(body),
|
|
128
|
+
});
|
|
129
|
+
if (!res.ok) throw commerceError(res, 'Failed to open checkout');
|
|
130
|
+
return res.data.session;
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
/** Read one of the buyer's checkout sessions. */
|
|
134
|
+
async getCheckout(id) {
|
|
135
|
+
const res = await authFetch('/v1/commerce/checkout-sessions/' + encodeURIComponent(id));
|
|
136
|
+
if (!res.ok) throw commerceError(res, 'Failed to read checkout');
|
|
137
|
+
return res.data.session;
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
/** The buyer's checkout sessions (purchases), newest first. */
|
|
141
|
+
async listCheckouts(opts) {
|
|
142
|
+
const qs = opts && opts.limit ? '?limit=' + opts.limit : '';
|
|
143
|
+
const res = await authFetch('/v1/commerce/checkout-sessions' + qs);
|
|
144
|
+
if (!res.ok) throw commerceError(res, 'Failed to list checkouts');
|
|
145
|
+
return res.data.sessions;
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
/** Replace the cart of an open session. */
|
|
149
|
+
async updateCheckout(id, items) {
|
|
150
|
+
const res = await authFetch('/v1/commerce/checkout-sessions/' + encodeURIComponent(id), {
|
|
151
|
+
method: 'PATCH', body: JSON.stringify({ items: normalizeItems(items) }),
|
|
152
|
+
});
|
|
153
|
+
if (!res.ok) throw commerceError(res, 'Failed to update checkout');
|
|
154
|
+
return res.data.session;
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
/** Cancel an open session. */
|
|
158
|
+
async cancelCheckout(id) {
|
|
159
|
+
const res = await authFetch('/v1/commerce/checkout-sessions/' + encodeURIComponent(id), {
|
|
160
|
+
method: 'PATCH', body: JSON.stringify({ cancel: true }),
|
|
161
|
+
});
|
|
162
|
+
if (!res.ok) throw commerceError(res, 'Failed to cancel checkout');
|
|
163
|
+
return res.data.session;
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Complete (pay + fulfill) a session. payment: { handler?, instrument? } — omit for the
|
|
168
|
+
* node default (morsels). On 402 the thrown error has err.paymentRequired + err.accepts.
|
|
169
|
+
* Returns the completed session: session.receipt { handler, charged, fee }, session.fulfillment.
|
|
170
|
+
*/
|
|
171
|
+
async completeCheckout(id, payment) {
|
|
172
|
+
const res = await authFetch('/v1/commerce/checkout-sessions/' + encodeURIComponent(id) + '/complete', {
|
|
173
|
+
method: 'POST', body: JSON.stringify(payment ? { payment: payment } : {}),
|
|
174
|
+
});
|
|
175
|
+
if (!res.ok) throw commerceError(res, 'Failed to complete checkout');
|
|
176
|
+
return res.data.session;
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
/** One-call purchase: open a session for one offer and complete it immediately. */
|
|
180
|
+
async buyOffer(agent, offerId, opts) {
|
|
181
|
+
const session = await commerce.openCheckout(
|
|
182
|
+
[{ agent: agent, offer_id: offerId, quantity: (opts && opts.quantity) || 1 }], opts);
|
|
183
|
+
return commerce.completeCheckout(session.id, opts && opts.payment);
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
/** The seller's received orders (completed sessions where you are the seller). */
|
|
187
|
+
async listOrders(opts) {
|
|
188
|
+
const qs = opts && opts.limit ? '?limit=' + opts.limit : '';
|
|
189
|
+
const res = await authFetch('/v1/commerce/orders' + qs);
|
|
190
|
+
if (!res.ok) throw commerceError(res, 'Failed to list orders');
|
|
191
|
+
return res.data.orders;
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
// ── App tools (TARGET-034 — priced tool calls on agent-faced apps) ──
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Read an app's declared tool manifest: the public memory record apps.{appId}.tools under the
|
|
198
|
+
* app owner's GHII — { tools: [{ name, description, inputSchema, action_id?, agent?, price?, priceMoney? }] }.
|
|
199
|
+
* Returns null when the app declares no tools. Works logged out (public read).
|
|
200
|
+
*/
|
|
201
|
+
async getAppTools(ownerGhii, appId) {
|
|
202
|
+
const url = NODE_URL + '/v1/memory/' + encodeURIComponent(ownerGhii) + '/'
|
|
203
|
+
+ encodeURIComponent('apps.' + appId + '.tools');
|
|
204
|
+
const r = await fetch(url);
|
|
205
|
+
const res = await r.json();
|
|
206
|
+
if (!res.ok) {
|
|
207
|
+
if (res.error && res.error.code === 'NOT_FOUND') return null;
|
|
208
|
+
throw commerceError(res, 'Failed to read app tools');
|
|
209
|
+
}
|
|
210
|
+
return res.data.value;
|
|
211
|
+
},
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Buy + invoke a priced app-tool through the checkout core (TARGET-034):
|
|
215
|
+
* one { kind:'app-tool', app:'ownerName/appId', tool, input } line item, opened and
|
|
216
|
+
* completed in one call. A tool bound to a capability (action_id) runs with your input and
|
|
217
|
+
* the result comes back on session.fulfillment.results[0].result; an unbound tool queues an
|
|
218
|
+
* agent TASK for the app owner instead — session.fulfillment.taskIds[0] (the deliverable
|
|
219
|
+
* arrives via the seller's task flow). The receipt shows the charge either way.
|
|
220
|
+
* One call per invocation. On a node without the resolver this throws
|
|
221
|
+
* with code 'APP_TOOL_NOT_AVAILABLE'.
|
|
222
|
+
*/
|
|
223
|
+
async invokeAppTool(ref, opts) {
|
|
224
|
+
try {
|
|
225
|
+
const session = await commerce.openCheckout(
|
|
226
|
+
[{ kind: 'app-tool', app: ref.app, tool: ref.tool, input: ref.input }], opts);
|
|
227
|
+
return commerce.completeCheckout(session.id, opts && opts.payment);
|
|
228
|
+
} catch (e) {
|
|
229
|
+
// Older nodes reject the kind at validation (zod enum error naming "kind"); a node with the
|
|
230
|
+
// widened schema but no resolver answers UNKNOWN_ITEM_KIND. Both mean: not sellable here.
|
|
231
|
+
if (e.code === 'UNKNOWN_ITEM_KIND' || (e.code === 'INVALID_CHECKOUT' && /invalid enum|"kind"/i.test(String(e.message)))) {
|
|
232
|
+
const err = /** @type {Error & { code?: string, cause?: unknown }} */ (new Error('This node does not sell app-tools (app-tool resolver not enabled)'));
|
|
233
|
+
err.code = 'APP_TOOL_NOT_AVAILABLE';
|
|
234
|
+
err.cause = e;
|
|
235
|
+
throw err;
|
|
236
|
+
}
|
|
237
|
+
throw e;
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// ── Expose globally ──
|
|
243
|
+
attach('commerce', commerce);
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file data/index.js
|
|
3
|
+
* @description The aimeat-data library (SDK-libs migration — config-path proof lib). Exposes
|
|
4
|
+
* AIMEAT.data: the Memory API (Tier 1, JWT auth via AIMEAT.auth) with an app-creator public-read
|
|
5
|
+
* fallback, and Micro-Memory (Tier 0.5, GET-based). This is the componentized ESM source esbuild
|
|
6
|
+
* bundles to the IIFE served, unchanged, at /v1/libs/aimeat-data.js. It is the first migrated lib
|
|
7
|
+
* that actually CONSUMES the shared config: `NODE_URL` (direct public/micro fetches) and `NODE_ID`
|
|
8
|
+
* (the `creator@node` construction in get()'s fallback) come from _core/config — the exact values
|
|
9
|
+
* the legacy string form baked in via `${config.baseUrl}` / `${config.nodeId}`.
|
|
10
|
+
* @structure imports NODE_URL/NODE_ID (config), authFetch (session), attach (namespace); data.set/
|
|
11
|
+
* get/getEntry/update/delete/list/search/getPublic; data.micro()/microSets(); attach('data', …).
|
|
12
|
+
* @usage <script src="/v1/libs/aimeat-auth.js"></script><script src="/v1/libs/aimeat-data.js"></script>
|
|
13
|
+
* await AIMEAT.data.set('key', { value }); await AIMEAT.data.get('key');
|
|
14
|
+
* @version-history
|
|
15
|
+
* v1.0.0 — 2026-07-19 — Migrated from src/routes/lib-data.ts; NODE_URL/NODE_ID now from _core/config.
|
|
16
|
+
* v1.1.0 — 2026-07-25 — Cross-namespace reads: get/getEntry/list/search take { agent, ownerScope };
|
|
17
|
+
* list takes { meta, count } (+ data.count()). Agent-published keys live under the agent's GAII,
|
|
18
|
+
* and an app-grant token gets no automatic owner-scope broadening, so apps had to bypass this
|
|
19
|
+
* library entirely to read their own owner's fleet output. All options are additive.
|
|
20
|
+
*/
|
|
21
|
+
import { NODE_URL, NODE_ID } from '../_core/config.js';
|
|
22
|
+
import { makeSession } from '../_core/session.js';
|
|
23
|
+
const { authFetch } = makeSession('aimeat-data.js');
|
|
24
|
+
import { attach } from '../_core/namespace.js';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Cross-namespace read scoping, shared by get/getEntry/list/search.
|
|
28
|
+
*
|
|
29
|
+
* Agents publish under their OWN namespace (`name#owner@node`), not the owner's GHII.
|
|
30
|
+
* An owner SESSION gets owner-scope broadening automatically server-side, but an
|
|
31
|
+
* app-grant token (roles:['app']) does not — so an app reading its owner's fleet
|
|
32
|
+
* output must say so explicitly. Before these options the only way to do that was
|
|
33
|
+
* to bypass this library and hand-roll session.fetch calls.
|
|
34
|
+
*
|
|
35
|
+
* @param {{agent?: string, ownerScope?: boolean}} [opts]
|
|
36
|
+
* @returns {URLSearchParams}
|
|
37
|
+
*/
|
|
38
|
+
function scopeParams(opts) {
|
|
39
|
+
const p = new URLSearchParams();
|
|
40
|
+
if (opts?.agent) p.set('agent', opts.agent);
|
|
41
|
+
// `agent` already targets one namespace; sending both is contradictory (the server
|
|
42
|
+
// ignores owner_scope when agent is present), so only one goes on the wire.
|
|
43
|
+
else if (opts?.ownerScope) p.set('owner_scope', 'true');
|
|
44
|
+
return p;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Append params to a path, preserving any query string already on it. */
|
|
48
|
+
function withParams(path, params) {
|
|
49
|
+
const qs = params.toString();
|
|
50
|
+
if (!qs) return path;
|
|
51
|
+
return path + (path.indexOf('?') >= 0 ? '&' : '?') + qs;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ── Memory API (Tier 1, JWT auth) ──
|
|
55
|
+
|
|
56
|
+
const data = {
|
|
57
|
+
// Write or upsert a memory entry
|
|
58
|
+
async set(key, value, opts) {
|
|
59
|
+
const body = { key, value, visibility: 'private', ...opts };
|
|
60
|
+
const res = await authFetch('/v1/memory', { method: 'POST', body: JSON.stringify(body) });
|
|
61
|
+
if (!res.ok) throw new Error(res.error?.message || 'Failed to set memory');
|
|
62
|
+
return res.data;
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
// Read a single entry (falls back to public read from app creator if not found or empty).
|
|
66
|
+
// Uses ?soft=1 so a missing key is a clean 200 (value null) — no browser-console 404 noise;
|
|
67
|
+
// the contract is unchanged: resolves null when the key does not exist.
|
|
68
|
+
// opts: { agent, ownerScope } — read from one of the owner's agents' namespaces, or
|
|
69
|
+
// across the owner's whole set (GHII + agents). Omitted → unchanged behaviour.
|
|
70
|
+
async get(key, opts) {
|
|
71
|
+
const res = await authFetch(withParams(
|
|
72
|
+
'/v1/memory/' + encodeURIComponent(key) + '?soft=1', scopeParams(opts)));
|
|
73
|
+
var val = res.ok ? res.data.value : null;
|
|
74
|
+
var isEmpty = val == null || (typeof val === 'object' && Object.keys(val).length === 0);
|
|
75
|
+
if (!isEmpty) return val;
|
|
76
|
+
// A scoped read is explicit about where to look; do not silently widen it to the
|
|
77
|
+
// app-creator's public namespace.
|
|
78
|
+
if (opts?.agent || opts?.ownerScope) return val;
|
|
79
|
+
// Fallback: try public read from app creator's namespace
|
|
80
|
+
var creator = document.querySelector('meta[name="aimeat-creator"]')?.getAttribute('content');
|
|
81
|
+
if (!creator) {
|
|
82
|
+
var m = location.pathname.match(/\/v1\/apps\/([^/]+)\//);
|
|
83
|
+
if (m) {
|
|
84
|
+
creator = decodeURIComponent(m[1]);
|
|
85
|
+
if (creator && !creator.includes('@')) creator = creator + '@' + NODE_ID;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (creator) {
|
|
89
|
+
try {
|
|
90
|
+
var pub = await data.getPublic(creator, key);
|
|
91
|
+
if (pub != null) return pub;
|
|
92
|
+
} catch { /* public-read fallback is best-effort */ }
|
|
93
|
+
}
|
|
94
|
+
return val;
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
// Read full entry metadata. opts: { agent, ownerScope } as in get().
|
|
98
|
+
async getEntry(key, opts) {
|
|
99
|
+
const res = await authFetch(withParams(
|
|
100
|
+
'/v1/memory/' + encodeURIComponent(key), scopeParams(opts)));
|
|
101
|
+
if (!res.ok) {
|
|
102
|
+
if (res.error?.code === 'NOT_FOUND') return null;
|
|
103
|
+
throw new Error(res.error?.message || 'Failed to get memory');
|
|
104
|
+
}
|
|
105
|
+
return res.data;
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
// Update with optimistic locking
|
|
109
|
+
async update(key, value, version, opts) {
|
|
110
|
+
const body = { value, version, ...opts };
|
|
111
|
+
const res = await authFetch('/v1/memory/' + encodeURIComponent(key), {
|
|
112
|
+
method: 'PUT', body: JSON.stringify(body),
|
|
113
|
+
});
|
|
114
|
+
if (!res.ok) throw new Error(res.error?.message || 'Failed to update memory');
|
|
115
|
+
return res.data;
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
// Delete an entry
|
|
119
|
+
async delete(key) {
|
|
120
|
+
const res = await authFetch('/v1/memory/' + encodeURIComponent(key), { method: 'DELETE' });
|
|
121
|
+
if (!res.ok) throw new Error(res.error?.message || 'Failed to delete memory');
|
|
122
|
+
return res.data;
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* List memory keys.
|
|
127
|
+
*
|
|
128
|
+
* opts:
|
|
129
|
+
* prefix, visibility, tags — as before
|
|
130
|
+
* agent — list ONE of the owner's agents' namespaces (full GAII `name#owner@node`)
|
|
131
|
+
* ownerScope — list across the owner's GHII + every same-owner agent. An owner session
|
|
132
|
+
* already gets this server-side; an app-grant token needs it stated.
|
|
133
|
+
* meta — omit every `value` and report each entry's `bytes` instead. Use this for
|
|
134
|
+
* any listing you render as a table/board: the default response inlines
|
|
135
|
+
* every value, so a fleet-wide prefix can be megabytes per call.
|
|
136
|
+
* count — return only `{ count }` (server-side COUNT, no values). A cheap
|
|
137
|
+
* "did anything change?" probe; its cache is dropped by any memory write.
|
|
138
|
+
*/
|
|
139
|
+
async list(opts) {
|
|
140
|
+
const params = scopeParams(opts);
|
|
141
|
+
if (opts?.prefix) params.set('prefix', opts.prefix);
|
|
142
|
+
if (opts?.visibility) params.set('visibility', opts.visibility);
|
|
143
|
+
if (opts?.tags) params.set('tags', opts.tags.join(','));
|
|
144
|
+
if (opts?.meta) params.set('include', 'meta');
|
|
145
|
+
if (opts?.count) params.set('count', 'true');
|
|
146
|
+
const qs = params.toString();
|
|
147
|
+
const res = await authFetch('/v1/memory' + (qs ? '?' + qs : ''));
|
|
148
|
+
if (!res.ok) throw new Error(res.error?.message || 'Failed to list memory');
|
|
149
|
+
return res.data;
|
|
150
|
+
},
|
|
151
|
+
|
|
152
|
+
/** Cheap change probe: the number of keys under a prefix, no values transferred. */
|
|
153
|
+
async count(opts) {
|
|
154
|
+
const d = await data.list({ ...(opts || {}), count: true });
|
|
155
|
+
return (d && typeof d.count === 'number') ? d.count : null;
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
// Search memory entries
|
|
159
|
+
// opts: { visibility, agent, ownerScope } — scoping as in list().
|
|
160
|
+
async search(query, opts) {
|
|
161
|
+
const params = scopeParams(opts);
|
|
162
|
+
params.set('q', query);
|
|
163
|
+
if (opts?.visibility) params.set('visibility', opts.visibility);
|
|
164
|
+
const res = await authFetch('/v1/memory/search?' + params.toString());
|
|
165
|
+
if (!res.ok) throw new Error(res.error?.message || 'Failed to search memory');
|
|
166
|
+
return res.data;
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
// Read another agent's public memory (no auth needed). ?soft=1: missing (or hidden)
|
|
170
|
+
// keys resolve null via a clean 200 instead of logging a console 404.
|
|
171
|
+
async getPublic(gaii, key) {
|
|
172
|
+
const url = NODE_URL + '/v1/memory/' + encodeURIComponent(gaii) + '/' + encodeURIComponent(key) + '?soft=1';
|
|
173
|
+
const r = await fetch(url);
|
|
174
|
+
const res = await r.json();
|
|
175
|
+
if (!res.ok) {
|
|
176
|
+
if (res.error?.code === 'NOT_FOUND') return null;
|
|
177
|
+
throw new Error(res.error?.message || 'Failed to read public memory');
|
|
178
|
+
}
|
|
179
|
+
return res.data.value;
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
// ── Micro-Memory (Tier 0.5, GET-based) ──
|
|
183
|
+
micro(setName, accessCode) {
|
|
184
|
+
const base = NODE_URL + '/v1/mm';
|
|
185
|
+
|
|
186
|
+
function mmUrl(params) {
|
|
187
|
+
const p = new URLSearchParams(params);
|
|
188
|
+
if (accessCode) p.set('access_code', accessCode);
|
|
189
|
+
return base + '?' + p.toString();
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
async function mmFetch(params) {
|
|
193
|
+
const r = await fetch(mmUrl(params));
|
|
194
|
+
const res = await r.json();
|
|
195
|
+
if (!res.ok) throw new Error(res.error?.message || 'Micro-memory operation failed');
|
|
196
|
+
return res.data;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return {
|
|
200
|
+
// Add or overwrite a key
|
|
201
|
+
async add(key, value) {
|
|
202
|
+
return mmFetch({ op: 'add', set: setName, key, value: typeof value === 'object' ? JSON.stringify(value) : String(value) });
|
|
203
|
+
},
|
|
204
|
+
// Modify existing key
|
|
205
|
+
async mod(key, value) {
|
|
206
|
+
return mmFetch({ op: 'mod', set: setName, key, value: typeof value === 'object' ? JSON.stringify(value) : String(value) });
|
|
207
|
+
},
|
|
208
|
+
// Delete a key
|
|
209
|
+
async del(key) {
|
|
210
|
+
return mmFetch({ op: 'del', set: setName, key });
|
|
211
|
+
},
|
|
212
|
+
// List all entries in this set
|
|
213
|
+
async list() {
|
|
214
|
+
return mmFetch({ op: 'list', set: setName });
|
|
215
|
+
},
|
|
216
|
+
// Batch add multiple key-value pairs
|
|
217
|
+
async batch(entries) {
|
|
218
|
+
const params = { op: 'batch', set: setName };
|
|
219
|
+
Object.keys(entries).forEach((k, i) => {
|
|
220
|
+
params['key' + i] = k;
|
|
221
|
+
const v = entries[k];
|
|
222
|
+
params['value' + i] = typeof v === 'object' ? JSON.stringify(v) : String(v);
|
|
223
|
+
});
|
|
224
|
+
return mmFetch(params);
|
|
225
|
+
},
|
|
226
|
+
// Configure visibility
|
|
227
|
+
async config(visibility) {
|
|
228
|
+
const params = { op: 'config', set: setName, access: visibility };
|
|
229
|
+
return mmFetch(params);
|
|
230
|
+
},
|
|
231
|
+
// Get a single key value
|
|
232
|
+
async get(key) {
|
|
233
|
+
const d = await mmFetch({ op: 'list', set: setName });
|
|
234
|
+
return d.entries?.[key] ?? null;
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
// List all micro-memory sets
|
|
240
|
+
async microSets() {
|
|
241
|
+
const url = NODE_URL + '/v1/mm?op=list';
|
|
242
|
+
const r = await fetch(url);
|
|
243
|
+
const res = await r.json();
|
|
244
|
+
if (!res.ok) throw new Error(res.error?.message || 'Failed to list micro-memory sets');
|
|
245
|
+
return res.data;
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
// ── Expose globally ──
|
|
250
|
+
attach('data', data);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// GENERATED FILE — do not edit directly. Source: src/static/sdk-libs/agentface/ (+ _core/).
|
|
2
|
+
// Rebuild: pnpm build:sdk · Served at /v1/libs/aimeat-agentface.js (with a per-node config prelude).
|
|
3
|
+
"use strict";
|
|
4
|
+
(() => {
|
|
5
|
+
// src/static/sdk-libs/_core/namespace.js
|
|
6
|
+
function namespace() {
|
|
7
|
+
if (!window.AIMEAT) window.AIMEAT = {};
|
|
8
|
+
return window.AIMEAT;
|
|
9
|
+
}
|
|
10
|
+
function attach(key, value) {
|
|
11
|
+
const ns = namespace();
|
|
12
|
+
ns[key] = value;
|
|
13
|
+
return ns;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// src/static/sdk-libs/agentface/index.js
|
|
17
|
+
var MAX_BYTES = 256 * 1024;
|
|
18
|
+
function getSession() {
|
|
19
|
+
const auth = window.AIMEAT && window.AIMEAT.auth;
|
|
20
|
+
if (!auth) {
|
|
21
|
+
throw new Error("AIMEAT.auth is required. Include aimeat-auth.js before aimeat-agentface.js");
|
|
22
|
+
}
|
|
23
|
+
const s = auth.getSession();
|
|
24
|
+
if (!s) {
|
|
25
|
+
throw new Error("Not signed in. AIMEATAgentFace.publish writes the face as the signed-in user — call AIMEAT.auth.login() first. Note: the node serves only the record written by the APP OWNER; another user's publish lands in their own namespace and is never served.");
|
|
26
|
+
}
|
|
27
|
+
return s;
|
|
28
|
+
}
|
|
29
|
+
function compose(doc) {
|
|
30
|
+
if (!doc || typeof doc !== "object") {
|
|
31
|
+
throw new Error("compose expects { title, sections: [{ heading, body }] }");
|
|
32
|
+
}
|
|
33
|
+
const parts = [];
|
|
34
|
+
if (doc.title) parts.push("# " + String(doc.title).trim());
|
|
35
|
+
const sections = Array.isArray(doc.sections) ? doc.sections : [];
|
|
36
|
+
for (const s of sections) {
|
|
37
|
+
if (!s || typeof s.heading !== "string" || !s.heading.trim()) {
|
|
38
|
+
throw new Error("Every section needs a non-empty string heading");
|
|
39
|
+
}
|
|
40
|
+
parts.push("## " + s.heading.trim() + "\n\n" + (typeof s.body === "string" ? s.body.trim() : ""));
|
|
41
|
+
}
|
|
42
|
+
if (parts.length === 0) throw new Error("Nothing to compose — provide a title and/or sections");
|
|
43
|
+
return parts.join("\n\n") + "\n";
|
|
44
|
+
}
|
|
45
|
+
function inferFilename() {
|
|
46
|
+
const meta = typeof document !== "undefined" && document.querySelector('meta[name="aimeat-app"]');
|
|
47
|
+
const fromMeta = meta && meta.getAttribute("content");
|
|
48
|
+
if (fromMeta && fromMeta.trim()) return fromMeta.trim();
|
|
49
|
+
const m = typeof location !== "undefined" && location.pathname.match(/\/v1\/apps\/[^/]+\/([^/?#]+\.html?)$/i);
|
|
50
|
+
if (m) return decodeURIComponent(m[1]);
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
var agentface = {
|
|
54
|
+
/** The convention memory key the face lives under. */
|
|
55
|
+
key(filename) {
|
|
56
|
+
return "apps." + filename + ".agentface";
|
|
57
|
+
},
|
|
58
|
+
/** The markdown composer (exposed so an app can preview what publish() will write). */
|
|
59
|
+
compose,
|
|
60
|
+
/**
|
|
61
|
+
* Publish this app's agent face: a markdown string, or { title, sections: [{ heading, body }] }.
|
|
62
|
+
* opts.app names the app filename explicitly (e.g. 'my-app.html') and overrides inference —
|
|
63
|
+
* pass it on per-app subdomain origins, where the filename is not derivable from the URL.
|
|
64
|
+
* Writes the public record apps.{filename}.agentface via the authenticated memory API.
|
|
65
|
+
*/
|
|
66
|
+
async publish(input, opts) {
|
|
67
|
+
opts = opts || {};
|
|
68
|
+
const markdown = typeof input === "string" ? input : compose(input);
|
|
69
|
+
if (!markdown.trim()) throw new Error("AIMEATAgentFace.publish: the markdown content is empty");
|
|
70
|
+
if (new TextEncoder().encode(markdown).length > MAX_BYTES) {
|
|
71
|
+
throw new Error("Agent face exceeds the 256 KB cap — the node would treat it as absent. Publish a summary and link out to records instead.");
|
|
72
|
+
}
|
|
73
|
+
const filename = typeof opts.app === "string" && opts.app.trim() ? opts.app.trim() : inferFilename();
|
|
74
|
+
if (!filename) {
|
|
75
|
+
throw new Error('Cannot derive the app filename on this origin — pass { app: "your-file.html" } or add <meta name="aimeat-app" content="your-file.html"> to the page');
|
|
76
|
+
}
|
|
77
|
+
const session = getSession();
|
|
78
|
+
const key = agentface.key(filename);
|
|
79
|
+
const res = await session.fetch("/v1/memory", {
|
|
80
|
+
method: "POST",
|
|
81
|
+
body: JSON.stringify({ key, value: markdown, visibility: "public" })
|
|
82
|
+
});
|
|
83
|
+
if (!res.ok) {
|
|
84
|
+
throw new Error(res.error && res.error.message || "Failed to publish the agent face");
|
|
85
|
+
}
|
|
86
|
+
return { key, app: filename, version: res.data && res.data.version, visibility: "public" };
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
attach("agentface", agentface);
|
|
90
|
+
window.AIMEATAgentFace = agentface;
|
|
91
|
+
})();
|