aimeat 2.2.0 → 2.3.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/README.md +110 -84
- package/dist/.env.example +47 -11
- package/dist/locales/en.json +251 -371
- package/dist/locales/fi.json +255 -375
- package/dist/public/components/ContactCard.js +30 -5
- package/dist/public/components/ContactPicker.js +3 -2
- package/dist/public/components/ImageDeliverable.js +2 -1
- package/dist/public/components/JsonView.js +1 -0
- package/dist/public/components/LinkPreview.js +1 -1
- package/dist/public/components/NotificationBell.js +6 -4
- package/dist/public/components/UsageChart.js +2 -1
- package/dist/public/css/theme.css +1516 -1432
- package/dist/public/css/views/app-grant.css +95 -36
- package/dist/public/css/views/help.css +28 -0
- package/dist/public/css/views/landing.css +20 -0
- package/dist/public/css/views/members.css +40 -10
- package/dist/public/css/views/portal-dev.css +64 -45
- package/dist/public/css/views/profile.css +8 -0
- package/dist/public/js/api.js +1 -0
- package/dist/public/js/app-sandbox.js +1 -0
- package/dist/public/js/components/auth-image.js +3 -1
- package/dist/public/js/i18n.js +3 -1
- package/dist/public/js/presence-store.js +3 -1
- package/dist/public/js/recents.js +2 -0
- package/dist/public/js/services/agent-activity.js +2 -1
- package/dist/public/js/services/agent-directives.js +2 -1
- package/dist/public/js/services/agent-integration.js +2 -1
- package/dist/public/js/services/agent-messages.js +2 -1
- package/dist/public/js/services/agent-tasks.js +2 -1
- package/dist/public/js/services/agents.js +3 -2
- package/dist/public/js/services/calibrator.js +2 -1
- package/dist/public/js/services/consent.js +2 -1
- package/dist/public/js/services/contacts.js +2 -1
- package/dist/public/js/services/cortex.js +5 -4
- package/dist/public/js/services/ecosystem.js +2 -1
- package/dist/public/js/services/knowledge.js +2 -1
- package/dist/public/js/services/ledger.js +2 -1
- package/dist/public/js/services/living.js +10 -9
- package/dist/public/js/services/memory.js +2 -1
- package/dist/public/js/services/messages.js +53 -8
- package/dist/public/js/services/nodes.js +3 -2
- package/dist/public/js/services/notebook-plan.js +2 -1
- package/dist/public/js/services/notebook.js +6 -5
- package/dist/public/js/services/offers.js +6 -5
- package/dist/public/js/services/organisms.js +26 -25
- package/dist/public/js/services/organisms.prompts.js +3 -2
- package/dist/public/js/services/organisms.shared.js +2 -1
- package/dist/public/js/services/organisms.workspace-gen.js +3 -2
- package/dist/public/js/services/packages.js +1 -0
- package/dist/public/js/services/schedules.js +2 -1
- package/dist/public/js/services/security.js +3 -2
- package/dist/public/js/services/skills.js +1 -0
- package/dist/public/js/services/tracked-responses.js +4 -3
- package/dist/public/js/services/unfurl.js +4 -4
- package/dist/public/js/services/work.js +2 -1
- package/dist/public/js/site.js +74 -0
- package/dist/public/js/swallowed.js +69 -0
- package/dist/public/js/theme.js +2 -1
- package/dist/public/js/utils.js +3 -1
- package/dist/public/lib/VENDORED.md +1 -0
- package/dist/public/lib/aimeat-game/board.css +262 -0
- package/dist/public/lib/aimeat-game/progress.css +406 -0
- package/dist/public/lib/aimeat-game/shell.css +388 -0
- package/dist/public/lib/aimeat-game.css +394 -0
- package/dist/public/lib/pdfjs@6/pdf.min.mjs +29 -0
- package/dist/public/lib/pdfjs@6/pdf.worker.min.mjs +29 -0
- package/dist/public/privacy.fi.html +1 -1
- package/dist/public/privacy.html +1 -1
- package/dist/public/spa.html +885 -793
- package/dist/public/sw.js +4 -2
- package/dist/public/views/admin/agent-integration-tab.js +7 -6
- package/dist/public/views/admin/ai-usage-tab.js +2 -1
- package/dist/public/views/admin/cortex-tab.js +2 -1
- package/dist/public/views/admin/economy-tab.js +0 -1
- package/dist/public/views/admin/email-tab.js +4 -2
- package/dist/public/views/admin/federation-tab.js +3 -2
- package/dist/public/views/admin/feedback-tab.js +2 -1
- package/dist/public/views/admin/knowledge-tab.js +2 -1
- package/dist/public/views/admin/messages-tab.js +2 -1
- package/dist/public/views/admin/msm-tab.js +2 -1
- package/dist/public/views/admin/packages-tab.js +3 -2
- package/dist/public/views/admin/portal-tab.js +7 -2
- package/dist/public/views/admin/push-tab.js +9 -4
- package/dist/public/views/admin/stats-tab.js +2 -1
- package/dist/public/views/admin/usage-tab.js +4 -3
- package/dist/public/views/admin.js +6 -4
- package/dist/public/views/agent-solo.js +4 -3
- package/dist/public/views/app-grant.js +105 -32
- package/dist/public/views/business.js +139 -55
- package/dist/public/views/command-palette.js +5 -3
- package/dist/public/views/companies.js +3 -2
- package/dist/public/views/doc-solo.js +2 -1
- package/dist/public/views/help.js +95 -15
- package/dist/public/views/how-it-works.js +41 -8
- package/dist/public/views/invite-accept.js +3 -2
- package/dist/public/views/landing-activity.js +3 -2
- package/dist/public/views/landing-node-totals.js +2 -1
- package/dist/public/views/landing.js +75 -152
- package/dist/public/views/members.js +29 -2
- package/dist/public/views/my-company.js +9 -7
- package/dist/public/views/my-company.payments.js +2 -1
- package/dist/public/views/portal-classic.js +2 -1
- package/dist/public/views/portal-dev.js +64 -35
- package/dist/public/views/portal-dev.panels.js +39 -2
- package/dist/public/views/portal-dev.upload.js +25 -196
- package/dist/public/views/portal.components.js +4 -3
- package/dist/public/views/portfolio.js +5 -4
- package/dist/public/views/profile/access-tab/access-tokens.js +2 -1
- package/dist/public/views/profile/access-tab/agent-defaults.js +3 -1
- package/dist/public/views/profile/access-tab/connected-apps.js +72 -3
- package/dist/public/views/profile/access-tab/sharing-groups.js +4 -1
- package/dist/public/views/profile/access-tab.js +3 -1
- package/dist/public/views/profile/agents/agent-card.js +6 -5
- package/dist/public/views/profile/agents/tab-activity.js +10 -8
- package/dist/public/views/profile/agents/tab-agent-config.js +3 -1
- package/dist/public/views/profile/agents/tab-contracts.js +2 -1
- package/dist/public/views/profile/agents/tab-data-access.js +10 -7
- package/dist/public/views/profile/agents/tab-helpers.js +5 -0
- package/dist/public/views/profile/agents/tab-integration.js +12 -9
- package/dist/public/views/profile/agents/tab-messages.js +6 -4
- package/dist/public/views/profile/agents/tab-quality.js +3 -2
- package/dist/public/views/profile/agents/tab-usage.js +5 -3
- package/dist/public/views/profile/agents/task-item.js +12 -7
- package/dist/public/views/profile/agents-activity-subtab.js +5 -2
- package/dist/public/views/profile/agents-capabilities-subtab.js +4 -2
- package/dist/public/views/profile/agents-messages-subtab.js +5 -2
- package/dist/public/views/profile/agents-services-subtab.js +1 -0
- package/dist/public/views/profile/agents-tab.js +11 -7
- package/dist/public/views/profile/appdev-tab.js +3 -2
- package/dist/public/views/profile/apps-tab.js +10 -8
- package/dist/public/views/profile/boards-tab.js +5 -4
- package/dist/public/views/profile/calibrator-batch.helpers.js +3 -2
- package/dist/public/views/profile/calibrator-batch.js +3 -1
- package/dist/public/views/profile/calibrator-llm-editor.js +3 -2
- package/dist/public/views/profile/calibrator-tab.js +5 -4
- package/dist/public/views/profile/capabilities-tab.js +2 -1
- package/dist/public/views/profile/chat-sessions-tab.js +6 -3
- package/dist/public/views/profile/contacts-tab.js +2 -1
- package/dist/public/views/profile/data-wallet-tab.js +5 -4
- package/dist/public/views/profile/discover-tab.js +4 -1
- package/dist/public/views/profile/ecosystem-tab.automation.js +13 -9
- package/dist/public/views/profile/ecosystem-tab.cards.js +3 -2
- package/dist/public/views/profile/ecosystem-tab.js +10 -7
- package/dist/public/views/profile/email-tab.js +2 -1
- package/dist/public/views/profile/extensions-tab.js +7 -6
- package/dist/public/views/profile/extensions-tab.maturity.js +2 -1
- package/dist/public/views/profile/extensions-tab.prompts.js +24 -0
- package/dist/public/views/profile/federation-tab.js +2 -1
- package/dist/public/views/profile/inbox-tab/components.js +13 -10
- package/dist/public/views/profile/inbox-tab/helpers.js +15 -1
- package/dist/public/views/profile/inbox-tab/use-thread-ux.js +1 -1
- package/dist/public/views/profile/inbox-tab.js +33 -30
- package/dist/public/views/profile/inline-panels.js +5 -4
- package/dist/public/views/profile/knowledge-tab.js +15 -13
- package/dist/public/views/profile/landing-page.cards.js +14 -9
- package/dist/public/views/profile/landing-page.helpers.js +5 -2
- package/dist/public/views/profile/landing-page.js +11 -7
- package/dist/public/views/profile/landing-page.modals.js +8 -5
- package/dist/public/views/profile/living-tab.js +3 -2
- package/dist/public/views/profile/mcp-tab.js +4 -2
- package/dist/public/views/profile/memory-tab/browse-view.js +3 -2
- package/dist/public/views/profile/memory-tab/components.js +4 -3
- package/dist/public/views/profile/memory-tab/entries-view.js +3 -2
- package/dist/public/views/profile/memory-tab.js +18 -16
- package/dist/public/views/profile/nodes-tab.js +2 -1
- package/dist/public/views/profile/notebook-card.js +4 -3
- package/dist/public/views/profile/notebook-tab.js +7 -5
- package/dist/public/views/profile/notifications-tab.js +9 -5
- package/dist/public/views/profile/offers-tab.js +5 -4
- package/dist/public/views/profile/openrouter-settings.js +5 -4
- package/dist/public/views/profile/organisms/activity-panel.js +2 -1
- package/dist/public/views/profile/organisms/agents.js +2 -1
- package/dist/public/views/profile/organisms/document.js +13 -12
- package/dist/public/views/profile/organisms/helpers.js +2 -1
- package/dist/public/views/profile/organisms/home.js +7 -6
- package/dist/public/views/profile/organisms/invite-panel.js +1 -1
- package/dist/public/views/profile/organisms/members.js +7 -6
- package/dist/public/views/profile/organisms/mindmap.js +1 -1
- package/dist/public/views/profile/organisms/panels.js +4 -3
- package/dist/public/views/profile/organisms/participants-panel.js +11 -10
- package/dist/public/views/profile/organisms/readme-panel.js +1 -0
- package/dist/public/views/profile/organisms/sources-panel.js +2 -1
- package/dist/public/views/profile/organisms/workspace/doc-space.js +2 -1
- package/dist/public/views/profile/organisms/workspace/model.js +1 -0
- package/dist/public/views/profile/organisms/workspace-apps.js +4 -2
- package/dist/public/views/profile/organisms/workspace-comments.js +3 -2
- package/dist/public/views/profile/organisms/workspace-list.js +5 -4
- package/dist/public/views/profile/organisms/workspace.js +19 -16
- package/dist/public/views/profile/organisms-tab.js +20 -12
- package/dist/public/views/profile/packages-tab.js +6 -4
- package/dist/public/views/profile/portfolio-tab.js +1 -1
- package/dist/public/views/profile/scheduler-calendar.js +2 -1
- package/dist/public/views/profile/scheduler-tab.js +2 -1
- package/dist/public/views/profile/security-tab.js +2 -1
- package/dist/public/views/profile/services-tab.js +4 -3
- package/dist/public/views/profile/wallet-tab.js +90 -84
- package/dist/public/views/profile/work-tab.js +3 -2
- package/dist/public/views/profile/workflows-form.js +2 -1
- package/dist/public/views/profile/workflows-tab.js +3 -2
- package/dist/public/views/public-workspace-viewer.js +7 -4
- package/dist/scripts/build-sdk-libs.d.ts.map +1 -1
- package/dist/scripts/build-sdk-libs.js +4 -0
- package/dist/scripts/build-sdk-libs.js.map +1 -1
- package/dist/scripts/check-silent-catch.d.ts +2 -0
- package/dist/scripts/check-silent-catch.d.ts.map +1 -0
- package/dist/scripts/check-silent-catch.js +159 -0
- package/dist/scripts/check-silent-catch.js.map +1 -0
- package/dist/src/auth/jwt.d.ts +2 -0
- package/dist/src/auth/jwt.d.ts.map +1 -1
- package/dist/src/auth/jwt.js +15 -3
- package/dist/src/auth/jwt.js.map +1 -1
- package/dist/src/auth/keypair.d.ts.map +1 -1
- package/dist/src/auth/keypair.js +3 -0
- package/dist/src/auth/keypair.js.map +1 -1
- package/dist/src/auth/middleware.d.ts +2 -0
- package/dist/src/auth/middleware.d.ts.map +1 -1
- package/dist/src/auth/middleware.js +33 -14
- package/dist/src/auth/middleware.js.map +1 -1
- package/dist/src/auth/node-keys.d.ts.map +1 -1
- package/dist/src/auth/node-keys.js +59 -16
- package/dist/src/auth/node-keys.js.map +1 -1
- package/dist/src/cli/config-import.d.ts.map +1 -1
- package/dist/src/cli/config-import.js +3 -1
- package/dist/src/cli/config-import.js.map +1 -1
- package/dist/src/cli/connect/auth.d.ts.map +1 -1
- package/dist/src/cli/connect/auth.js +1 -0
- package/dist/src/cli/connect/auth.js.map +1 -1
- package/dist/src/cli/connect/config.d.ts.map +1 -1
- package/dist/src/cli/connect/config.js +3 -1
- package/dist/src/cli/connect/config.js.map +1 -1
- package/dist/src/cli/connect/keychain.d.ts.map +1 -1
- package/dist/src/cli/connect/keychain.js +6 -2
- package/dist/src/cli/connect/keychain.js.map +1 -1
- package/dist/src/cli/connect/mcp/local-server.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/local-server.js +9 -2
- package/dist/src/cli/connect/mcp/local-server.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/workspaces.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/workspaces.js +2 -0
- package/dist/src/cli/connect/mcp/tools/workspaces.js.map +1 -1
- package/dist/src/cli/connect/task-runner.d.ts.map +1 -1
- package/dist/src/cli/connect/task-runner.js +11 -4
- package/dist/src/cli/connect/task-runner.js.map +1 -1
- package/dist/src/cli/connect/tool-call-helpers.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call-helpers.js +1 -0
- package/dist/src/cli/connect/tool-call-helpers.js.map +1 -1
- package/dist/src/cli/connect/tunnel-client.d.ts.map +1 -1
- package/dist/src/cli/connect/tunnel-client.js +26 -8
- package/dist/src/cli/connect/tunnel-client.js.map +1 -1
- package/dist/src/cli/federation-join.d.ts.map +1 -1
- package/dist/src/cli/federation-join.js +7 -3
- package/dist/src/cli/federation-join.js.map +1 -1
- package/dist/src/cli/init-wizard/presets.d.ts.map +1 -1
- package/dist/src/cli/init-wizard/presets.js +21 -0
- package/dist/src/cli/init-wizard/presets.js.map +1 -1
- package/dist/src/cli/init-wizard/steps-advanced.d.ts.map +1 -1
- package/dist/src/cli/init-wizard/steps-advanced.js +2 -0
- package/dist/src/cli/init-wizard/steps-advanced.js.map +1 -1
- package/dist/src/cli/init-wizard/steps-operator.d.ts.map +1 -1
- package/dist/src/cli/init-wizard/steps-operator.js +10 -0
- package/dist/src/cli/init-wizard/steps-operator.js.map +1 -1
- package/dist/src/commerce/invoice-handler.d.ts +5 -0
- package/dist/src/commerce/invoice-handler.d.ts.map +1 -0
- package/dist/src/commerce/invoice-handler.js +41 -0
- package/dist/src/commerce/invoice-handler.js.map +1 -0
- package/dist/src/commerce/payable-book.d.ts +31 -0
- package/dist/src/commerce/payable-book.d.ts.map +1 -0
- package/dist/src/commerce/payable-book.js +27 -0
- package/dist/src/commerce/payable-book.js.map +1 -0
- package/dist/src/commerce/payment-handlers.d.ts.map +1 -1
- package/dist/src/commerce/payment-handlers.js +8 -4
- package/dist/src/commerce/payment-handlers.js.map +1 -1
- package/dist/src/commerce/sellable-resolvers.d.ts +6 -6
- package/dist/src/commerce/sellable-resolvers.d.ts.map +1 -1
- package/dist/src/commerce/sellable-resolvers.js +17 -4
- package/dist/src/commerce/sellable-resolvers.js.map +1 -1
- package/dist/src/commerce/session-service.js +2 -2
- package/dist/src/commerce/session-service.js.map +1 -1
- package/dist/src/commerce/stripe-handler.d.ts +33 -0
- package/dist/src/commerce/stripe-handler.d.ts.map +1 -0
- package/dist/src/commerce/stripe-handler.js +108 -0
- package/dist/src/commerce/stripe-handler.js.map +1 -0
- package/dist/src/commerce/types.d.ts +10 -12
- package/dist/src/commerce/types.d.ts.map +1 -1
- package/dist/src/commerce/x402-facilitator.d.ts.map +1 -1
- package/dist/src/commerce/x402-facilitator.js +1 -0
- package/dist/src/commerce/x402-facilitator.js.map +1 -1
- package/dist/src/config-types.d.ts +66 -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 +62 -1
- package/dist/src/config.js.map +1 -1
- package/dist/src/data/library-packs/sdk.d.ts +4 -0
- package/dist/src/data/library-packs/sdk.d.ts.map +1 -1
- package/dist/src/data/library-packs/sdk.js +46 -0
- 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 +88 -0
- package/dist/src/data/library-packs/vendored.js.map +1 -1
- package/dist/src/generated/api-types.d.ts +472 -26
- package/dist/src/generated/api-types.d.ts.map +1 -1
- package/dist/src/index-connect.d.ts.map +1 -1
- package/dist/src/index-connect.js +4 -1
- package/dist/src/index-connect.js.map +1 -1
- package/dist/src/index-start.d.ts.map +1 -1
- package/dist/src/index-start.js +10 -6
- package/dist/src/index-start.js.map +1 -1
- package/dist/src/mcp/app-template-proposals.d.ts.map +1 -1
- package/dist/src/mcp/app-template-proposals.js +2 -1
- package/dist/src/mcp/app-template-proposals.js.map +1 -1
- package/dist/src/mcp/apps.d.ts.map +1 -1
- package/dist/src/mcp/apps.js +4 -3
- package/dist/src/mcp/apps.js.map +1 -1
- package/dist/src/mcp/capabilities.d.ts.map +1 -1
- package/dist/src/mcp/capabilities.js +3 -2
- package/dist/src/mcp/capabilities.js.map +1 -1
- package/dist/src/mcp/catalog/scopes.d.ts +0 -1
- package/dist/src/mcp/catalog/scopes.d.ts.map +1 -1
- package/dist/src/mcp/catalog/scopes.js +2 -11
- package/dist/src/mcp/catalog/scopes.js.map +1 -1
- package/dist/src/mcp/catalog/surfaces.d.ts +1 -7
- package/dist/src/mcp/catalog/surfaces.d.ts.map +1 -1
- package/dist/src/mcp/catalog/surfaces.js +10 -16
- 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 +35 -3
- package/dist/src/mcp/commerce.js.map +1 -1
- package/dist/src/mcp/core.d.ts.map +1 -1
- package/dist/src/mcp/core.js +3 -2
- package/dist/src/mcp/core.js.map +1 -1
- package/dist/src/mcp/exchange-run.d.ts +28 -0
- package/dist/src/mcp/exchange-run.d.ts.map +1 -1
- package/dist/src/mcp/exchange-run.js +58 -37
- package/dist/src/mcp/exchange-run.js.map +1 -1
- package/dist/src/mcp/exchange.d.ts.map +1 -1
- package/dist/src/mcp/exchange.js +9 -7
- package/dist/src/mcp/exchange.js.map +1 -1
- package/dist/src/mcp/extensions.d.ts.map +1 -1
- package/dist/src/mcp/extensions.js +60 -106
- package/dist/src/mcp/extensions.js.map +1 -1
- package/dist/src/mcp/index.d.ts.map +1 -1
- package/dist/src/mcp/index.js +1 -5
- package/dist/src/mcp/index.js.map +1 -1
- package/dist/src/mcp/knowledge.d.ts.map +1 -1
- package/dist/src/mcp/knowledge.js +1 -0
- package/dist/src/mcp/knowledge.js.map +1 -1
- package/dist/src/mcp/oauth.d.ts +3 -0
- package/dist/src/mcp/oauth.d.ts.map +1 -1
- package/dist/src/mcp/oauth.js +13 -8
- package/dist/src/mcp/oauth.js.map +1 -1
- package/dist/src/mcp/workspaces.d.ts.map +1 -1
- package/dist/src/mcp/workspaces.js +7 -4
- package/dist/src/mcp/workspaces.js.map +1 -1
- package/dist/src/middleware/cors.d.ts.map +1 -1
- package/dist/src/middleware/cors.js +3 -1
- package/dist/src/middleware/cors.js.map +1 -1
- package/dist/src/middleware/subdomain.d.ts +4 -0
- package/dist/src/middleware/subdomain.d.ts.map +1 -1
- package/dist/src/middleware/subdomain.js +23 -2
- package/dist/src/middleware/subdomain.js.map +1 -1
- package/dist/src/models/app-tool-schemas.d.ts +35 -0
- package/dist/src/models/app-tool-schemas.d.ts.map +1 -1
- package/dist/src/models/app-tool-schemas.js +44 -0
- package/dist/src/models/app-tool-schemas.js.map +1 -1
- package/dist/src/routes/admin-config.d.ts.map +1 -1
- package/dist/src/routes/admin-config.js +4 -1
- package/dist/src/routes/admin-config.js.map +1 -1
- package/dist/src/routes/admin-extensions.d.ts.map +1 -1
- package/dist/src/routes/admin-extensions.js +2 -1
- package/dist/src/routes/admin-extensions.js.map +1 -1
- package/dist/src/routes/admin-monitoring.js +14 -5
- package/dist/src/routes/admin-monitoring.js.map +1 -1
- package/dist/src/routes/admin-security.d.ts.map +1 -1
- package/dist/src/routes/admin-security.js +4 -1
- package/dist/src/routes/admin-security.js.map +1 -1
- package/dist/src/routes/admin.d.ts.map +1 -1
- package/dist/src/routes/admin.js +6 -4
- package/dist/src/routes/admin.js.map +1 -1
- package/dist/src/routes/agent-activity.d.ts.map +1 -1
- package/dist/src/routes/agent-activity.js +4 -1
- package/dist/src/routes/agent-activity.js.map +1 -1
- package/dist/src/routes/agent-directives.d.ts +3 -10
- package/dist/src/routes/agent-directives.d.ts.map +1 -1
- package/dist/src/routes/agent-directives.js +7 -12
- package/dist/src/routes/agent-directives.js.map +1 -1
- package/dist/src/routes/agent-integration.d.ts.map +1 -1
- package/dist/src/routes/agent-integration.js +3 -1
- package/dist/src/routes/agent-integration.js.map +1 -1
- package/dist/src/routes/agent-messages.d.ts.map +1 -1
- package/dist/src/routes/agent-messages.js +5 -2
- package/dist/src/routes/agent-messages.js.map +1 -1
- package/dist/src/routes/agent-onboarding.d.ts.map +1 -1
- package/dist/src/routes/agent-onboarding.js +19 -6
- package/dist/src/routes/agent-onboarding.js.map +1 -1
- package/dist/src/routes/agent-skills-discovery.d.ts.map +1 -1
- package/dist/src/routes/agent-skills-discovery.js +2 -1
- package/dist/src/routes/agent-skills-discovery.js.map +1 -1
- package/dist/src/routes/agent-tasks/completion.js +1 -1
- package/dist/src/routes/agent-tasks/completion.js.map +1 -1
- package/dist/src/routes/agent-tasks/create-read.js +3 -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 +28 -9
- package/dist/src/routes/agent-tasks/lifecycle.js.map +1 -1
- package/dist/src/routes/agents/management.d.ts.map +1 -1
- package/dist/src/routes/agents/management.js +4 -1
- package/dist/src/routes/agents/management.js.map +1 -1
- 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/agents/profile-metadata.d.ts.map +1 -1
- package/dist/src/routes/agents/profile-metadata.js +2 -1
- package/dist/src/routes/agents/profile-metadata.js.map +1 -1
- package/dist/src/routes/app-grants.d.ts +7 -0
- package/dist/src/routes/app-grants.d.ts.map +1 -1
- package/dist/src/routes/app-grants.js +69 -4
- package/dist/src/routes/app-grants.js.map +1 -1
- package/dist/src/routes/appdev-overview.d.ts.map +1 -1
- package/dist/src/routes/appdev-overview.js +2 -1
- package/dist/src/routes/appdev-overview.js.map +1 -1
- package/dist/src/routes/apps/catalogue-admin.d.ts.map +1 -1
- package/dist/src/routes/apps/catalogue-admin.js +2 -1
- package/dist/src/routes/apps/catalogue-admin.js.map +1 -1
- package/dist/src/routes/apps/drafts.d.ts.map +1 -1
- package/dist/src/routes/apps/drafts.js +2 -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 +6 -3
- package/dist/src/routes/apps/fork-manage.js.map +1 -1
- package/dist/src/routes/apps/helpers.d.ts.map +1 -1
- package/dist/src/routes/apps/helpers.js +5 -1
- package/dist/src/routes/apps/helpers.js.map +1 -1
- package/dist/src/routes/apps/publish.d.ts.map +1 -1
- package/dist/src/routes/apps/publish.js +8 -3
- package/dist/src/routes/apps/publish.js.map +1 -1
- package/dist/src/routes/apps/read.d.ts.map +1 -1
- package/dist/src/routes/apps/read.js +2 -1
- package/dist/src/routes/apps/read.js.map +1 -1
- package/dist/src/routes/auth.d.ts.map +1 -1
- package/dist/src/routes/auth.js +2 -1
- package/dist/src/routes/auth.js.map +1 -1
- package/dist/src/routes/boards.js +1 -1
- package/dist/src/routes/boards.js.map +1 -1
- package/dist/src/routes/bootstrap.d.ts.map +1 -1
- package/dist/src/routes/bootstrap.js +8 -3
- package/dist/src/routes/bootstrap.js.map +1 -1
- package/dist/src/routes/capabilities.d.ts.map +1 -1
- package/dist/src/routes/capabilities.js +4 -3
- package/dist/src/routes/capabilities.js.map +1 -1
- package/dist/src/routes/commerce-acp.js +1 -1
- package/dist/src/routes/commerce-acp.js.map +1 -1
- package/dist/src/routes/commerce-ucp.d.ts +2 -3
- package/dist/src/routes/commerce-ucp.d.ts.map +1 -1
- package/dist/src/routes/commerce-ucp.js +6 -12
- package/dist/src/routes/commerce-ucp.js.map +1 -1
- package/dist/src/routes/commerce.d.ts +7 -1
- package/dist/src/routes/commerce.d.ts.map +1 -1
- package/dist/src/routes/commerce.js +65 -15
- package/dist/src/routes/commerce.js.map +1 -1
- package/dist/src/routes/csm.d.ts.map +1 -1
- package/dist/src/routes/csm.js +3 -1
- package/dist/src/routes/csm.js.map +1 -1
- package/dist/src/routes/ecosystem-apps.d.ts.map +1 -1
- package/dist/src/routes/ecosystem-apps.js +7 -6
- package/dist/src/routes/ecosystem-apps.js.map +1 -1
- package/dist/src/routes/exchange-market.d.ts.map +1 -1
- package/dist/src/routes/exchange-market.js +10 -6
- package/dist/src/routes/exchange-market.js.map +1 -1
- package/dist/src/routes/exchange.d.ts +10 -1
- package/dist/src/routes/exchange.d.ts.map +1 -1
- package/dist/src/routes/exchange.js +344 -9
- package/dist/src/routes/exchange.js.map +1 -1
- package/dist/src/routes/extensions/actions.d.ts +2 -0
- package/dist/src/routes/extensions/actions.d.ts.map +1 -1
- package/dist/src/routes/extensions/actions.js +47 -8
- package/dist/src/routes/extensions/actions.js.map +1 -1
- package/dist/src/routes/extensions/entitlement-gate.d.ts +44 -7
- package/dist/src/routes/extensions/entitlement-gate.d.ts.map +1 -1
- package/dist/src/routes/extensions/entitlement-gate.js +21 -142
- package/dist/src/routes/extensions/entitlement-gate.js.map +1 -1
- package/dist/src/routes/extensions/internal-pass.d.ts +23 -0
- package/dist/src/routes/extensions/internal-pass.d.ts.map +1 -0
- package/dist/src/routes/extensions/internal-pass.js +70 -0
- package/dist/src/routes/extensions/internal-pass.js.map +1 -0
- package/dist/src/routes/extensions/manifest.d.ts +4 -0
- package/dist/src/routes/extensions/manifest.d.ts.map +1 -1
- package/dist/src/routes/extensions/manifest.js +68 -4
- package/dist/src/routes/extensions/manifest.js.map +1 -1
- package/dist/src/routes/extensions/metered-response.d.ts +37 -0
- package/dist/src/routes/extensions/metered-response.d.ts.map +1 -0
- package/dist/src/routes/extensions/metered-response.js +60 -0
- package/dist/src/routes/extensions/metered-response.js.map +1 -0
- package/dist/src/routes/extensions/pacing.d.ts +31 -0
- package/dist/src/routes/extensions/pacing.d.ts.map +1 -1
- package/dist/src/routes/extensions/pacing.js +5 -33
- package/dist/src/routes/extensions/pacing.js.map +1 -1
- package/dist/src/routes/extensions/paywall.d.ts +16 -0
- package/dist/src/routes/extensions/paywall.d.ts.map +1 -1
- package/dist/src/routes/extensions/paywall.js +157 -8
- package/dist/src/routes/extensions/paywall.js.map +1 -1
- package/dist/src/routes/extensions/priced-binding.d.ts +50 -0
- package/dist/src/routes/extensions/priced-binding.d.ts.map +1 -0
- package/dist/src/routes/extensions/priced-binding.js +46 -0
- package/dist/src/routes/extensions/priced-binding.js.map +1 -0
- package/dist/src/routes/federation-genesis.d.ts.map +1 -1
- package/dist/src/routes/federation-genesis.js +14 -5
- package/dist/src/routes/federation-genesis.js.map +1 -1
- package/dist/src/routes/federation-peer/introduce.d.ts.map +1 -1
- package/dist/src/routes/federation-peer/introduce.js +3 -1
- package/dist/src/routes/federation-peer/introduce.js.map +1 -1
- package/dist/src/routes/federation-peer/lifecycle.d.ts.map +1 -1
- package/dist/src/routes/federation-peer/lifecycle.js +3 -2
- package/dist/src/routes/federation-peer/lifecycle.js.map +1 -1
- package/dist/src/routes/federation-peer/peers.d.ts.map +1 -1
- package/dist/src/routes/federation-peer/peers.js +5 -3
- package/dist/src/routes/federation-peer/peers.js.map +1 -1
- package/dist/src/routes/federation-peer/policy-book.d.ts.map +1 -1
- package/dist/src/routes/federation-peer/policy-book.js +2 -1
- package/dist/src/routes/federation-peer/policy-book.js.map +1 -1
- package/dist/src/routes/federation-peer/promotion.d.ts.map +1 -1
- package/dist/src/routes/federation-peer/promotion.js +4 -1
- package/dist/src/routes/federation-peer/promotion.js.map +1 -1
- package/dist/src/routes/federation-settlements.js +2 -2
- package/dist/src/routes/federation-settlements.js.map +1 -1
- package/dist/src/routes/federation-sync/catalogue-trust.js +5 -3
- package/dist/src/routes/federation-sync/catalogue-trust.js.map +1 -1
- package/dist/src/routes/federation-sync/messaging.js +5 -3
- package/dist/src/routes/federation-sync/messaging.js.map +1 -1
- package/dist/src/routes/federation-sync/routing.d.ts.map +1 -1
- package/dist/src/routes/federation-sync/routing.js +7 -5
- package/dist/src/routes/federation-sync/routing.js.map +1 -1
- package/dist/src/routes/flags.d.ts.map +1 -1
- package/dist/src/routes/flags.js +3 -1
- package/dist/src/routes/flags.js.map +1 -1
- package/dist/src/routes/ghii/register-login.js +1 -1
- package/dist/src/routes/ghii/register-login.js.map +1 -1
- package/dist/src/routes/instances/install.d.ts.map +1 -1
- package/dist/src/routes/instances/install.js +2 -1
- package/dist/src/routes/instances/install.js.map +1 -1
- package/dist/src/routes/instances/manage.d.ts.map +1 -1
- package/dist/src/routes/instances/manage.js +2 -1
- package/dist/src/routes/instances/manage.js.map +1 -1
- package/dist/src/routes/knowledge/packages-core.d.ts.map +1 -1
- package/dist/src/routes/knowledge/packages-core.js +2 -1
- package/dist/src/routes/knowledge/packages-core.js.map +1 -1
- package/dist/src/routes/knowledge/sharing.d.ts.map +1 -1
- package/dist/src/routes/knowledge/sharing.js +2 -1
- package/dist/src/routes/knowledge/sharing.js.map +1 -1
- package/dist/src/routes/library-packs.d.ts.map +1 -1
- package/dist/src/routes/library-packs.js +10 -3
- package/dist/src/routes/library-packs.js.map +1 -1
- package/dist/src/routes/libs.d.ts +9 -0
- package/dist/src/routes/libs.d.ts.map +1 -1
- package/dist/src/routes/libs.js +11 -2
- package/dist/src/routes/libs.js.map +1 -1
- package/dist/src/routes/matches.d.ts.map +1 -1
- package/dist/src/routes/matches.js +7 -3
- package/dist/src/routes/matches.js.map +1 -1
- package/dist/src/routes/memory/bulk.d.ts.map +1 -1
- package/dist/src/routes/memory/bulk.js +3 -1
- package/dist/src/routes/memory/bulk.js.map +1 -1
- package/dist/src/routes/memory/crud.d.ts.map +1 -1
- package/dist/src/routes/memory/crud.js +4 -2
- package/dist/src/routes/memory/crud.js.map +1 -1
- package/dist/src/routes/memory/federation.d.ts.map +1 -1
- package/dist/src/routes/memory/federation.js +5 -0
- package/dist/src/routes/memory/federation.js.map +1 -1
- package/dist/src/routes/memory/key.d.ts.map +1 -1
- package/dist/src/routes/memory/key.js +9 -4
- package/dist/src/routes/memory/key.js.map +1 -1
- package/dist/src/routes/messages.d.ts.map +1 -1
- package/dist/src/routes/messages.js +2 -1
- package/dist/src/routes/messages.js.map +1 -1
- package/dist/src/routes/msm.d.ts.map +1 -1
- package/dist/src/routes/msm.js +3 -1
- package/dist/src/routes/msm.js.map +1 -1
- package/dist/src/routes/oauth-login.d.ts.map +1 -1
- package/dist/src/routes/oauth-login.js +1 -0
- package/dist/src/routes/oauth-login.js.map +1 -1
- package/dist/src/routes/openrouter.js +2 -2
- package/dist/src/routes/openrouter.js.map +1 -1
- package/dist/src/routes/organisms/crud.d.ts.map +1 -1
- package/dist/src/routes/organisms/crud.js +3 -2
- package/dist/src/routes/organisms/crud.js.map +1 -1
- package/dist/src/routes/organisms/gates.d.ts.map +1 -1
- package/dist/src/routes/organisms/gates.js +3 -2
- package/dist/src/routes/organisms/gates.js.map +1 -1
- package/dist/src/routes/organisms/intake.d.ts.map +1 -1
- package/dist/src/routes/organisms/intake.js +13 -1
- package/dist/src/routes/organisms/intake.js.map +1 -1
- package/dist/src/routes/organisms/shared.d.ts.map +1 -1
- package/dist/src/routes/organisms/shared.js +7 -3
- package/dist/src/routes/organisms/shared.js.map +1 -1
- package/dist/src/routes/organisms/workspace-ops.d.ts.map +1 -1
- package/dist/src/routes/organisms/workspace-ops.js +6 -5
- package/dist/src/routes/organisms/workspace-ops.js.map +1 -1
- package/dist/src/routes/organisms/workspace-read.d.ts.map +1 -1
- package/dist/src/routes/organisms/workspace-read.js +4 -2
- package/dist/src/routes/organisms/workspace-read.js.map +1 -1
- package/dist/src/routes/owners.d.ts.map +1 -1
- package/dist/src/routes/owners.js +37 -12
- package/dist/src/routes/owners.js.map +1 -1
- package/dist/src/routes/personal.js +3 -1
- package/dist/src/routes/personal.js.map +1 -1
- package/dist/src/routes/portal.d.ts +6 -1
- package/dist/src/routes/portal.d.ts.map +1 -1
- package/dist/src/routes/portal.js +75 -10
- package/dist/src/routes/portal.js.map +1 -1
- package/dist/src/routes/portfolio.d.ts.map +1 -1
- package/dist/src/routes/portfolio.js +5 -1
- package/dist/src/routes/portfolio.js.map +1 -1
- package/dist/src/routes/prompts.d.ts.map +1 -1
- package/dist/src/routes/prompts.js +36 -2
- package/dist/src/routes/prompts.js.map +1 -1
- package/dist/src/routes/public-events.d.ts.map +1 -1
- package/dist/src/routes/public-events.js +4 -1
- package/dist/src/routes/public-events.js.map +1 -1
- package/dist/src/routes/public-stats.d.ts.map +1 -1
- package/dist/src/routes/public-stats.js +29 -10
- package/dist/src/routes/public-stats.js.map +1 -1
- package/dist/src/routes/schedules.d.ts +3 -0
- package/dist/src/routes/schedules.d.ts.map +1 -1
- package/dist/src/routes/schedules.js +14 -1
- package/dist/src/routes/schedules.js.map +1 -1
- package/dist/src/routes/stats.d.ts.map +1 -1
- package/dist/src/routes/stats.js +5 -1
- package/dist/src/routes/stats.js.map +1 -1
- package/dist/src/routes/storage-files.d.ts +4 -0
- package/dist/src/routes/storage-files.d.ts.map +1 -1
- package/dist/src/routes/storage-files.js +11 -0
- package/dist/src/routes/storage-files.js.map +1 -1
- package/dist/src/routes/subdomains.d.ts +9 -0
- package/dist/src/routes/subdomains.d.ts.map +1 -1
- package/dist/src/routes/subdomains.js +66 -5
- package/dist/src/routes/subdomains.js.map +1 -1
- package/dist/src/routes/unfurl.d.ts.map +1 -1
- package/dist/src/routes/unfurl.js +13 -3
- package/dist/src/routes/unfurl.js.map +1 -1
- package/dist/src/routes/upload.d.ts +11 -0
- package/dist/src/routes/upload.d.ts.map +1 -1
- package/dist/src/routes/upload.js +99 -9
- package/dist/src/routes/upload.js.map +1 -1
- package/dist/src/routes/wallet.d.ts +3 -0
- package/dist/src/routes/wallet.d.ts.map +1 -1
- package/dist/src/routes/wallet.js +6 -1
- package/dist/src/routes/wallet.js.map +1 -1
- package/dist/src/routes/webmcp.d.ts +8 -0
- package/dist/src/routes/webmcp.d.ts.map +1 -1
- package/dist/src/routes/webmcp.js +96 -49
- package/dist/src/routes/webmcp.js.map +1 -1
- package/dist/src/routes/wellknown.d.ts.map +1 -1
- package/dist/src/routes/wellknown.js +1 -0
- package/dist/src/routes/wellknown.js.map +1 -1
- package/dist/src/server-bootstrap/config-init.d.ts.map +1 -1
- package/dist/src/server-bootstrap/config-init.js +2 -0
- package/dist/src/server-bootstrap/config-init.js.map +1 -1
- package/dist/src/server-bootstrap/routes-loader.d.ts +4 -2
- package/dist/src/server-bootstrap/routes-loader.d.ts.map +1 -1
- package/dist/src/server-bootstrap/routes-loader.js +11 -22
- package/dist/src/server-bootstrap/routes-loader.js.map +1 -1
- package/dist/src/server-bootstrap/service-init.js +3 -1
- package/dist/src/server-bootstrap/service-init.js.map +1 -1
- package/dist/src/server-bootstrap/static-files.d.ts.map +1 -1
- package/dist/src/server-bootstrap/static-files.js +3 -1
- package/dist/src/server-bootstrap/static-files.js.map +1 -1
- package/dist/src/services/agent-statistics.d.ts.map +1 -1
- package/dist/src/services/agent-statistics.js +4 -1
- package/dist/src/services/agent-statistics.js.map +1 -1
- package/dist/src/services/app-agent-deploy.d.ts.map +1 -1
- package/dist/src/services/app-agent-deploy.js +4 -1
- package/dist/src/services/app-agent-deploy.js.map +1 -1
- package/dist/src/services/app-agent-surface.d.ts +78 -0
- package/dist/src/services/app-agent-surface.d.ts.map +1 -0
- package/dist/src/services/app-agent-surface.js +74 -0
- package/dist/src/services/app-agent-surface.js.map +1 -0
- package/dist/src/services/app-tool-names.d.ts +15 -0
- package/dist/src/services/app-tool-names.d.ts.map +1 -0
- package/dist/src/services/app-tool-names.js +24 -0
- package/dist/src/services/app-tool-names.js.map +1 -0
- package/dist/src/services/appdev-overview.d.ts.map +1 -1
- package/dist/src/services/appdev-overview.js +3 -2
- package/dist/src/services/appdev-overview.js.map +1 -1
- package/dist/src/services/attachment-duplication.js +3 -3
- package/dist/src/services/attachment-duplication.js.map +1 -1
- package/dist/src/services/build-extension-prompt.d.ts +40 -0
- package/dist/src/services/build-extension-prompt.d.ts.map +1 -0
- package/dist/src/services/build-extension-prompt.js +253 -0
- package/dist/src/services/build-extension-prompt.js.map +1 -0
- package/dist/src/services/cache-cleanup.d.ts.map +1 -1
- package/dist/src/services/cache-cleanup.js +2 -1
- package/dist/src/services/cache-cleanup.js.map +1 -1
- package/dist/src/services/call-timing.d.ts.map +1 -1
- package/dist/src/services/call-timing.js +2 -1
- package/dist/src/services/call-timing.js.map +1 -1
- package/dist/src/services/capability-invoke.d.ts +6 -1
- package/dist/src/services/capability-invoke.d.ts.map +1 -1
- package/dist/src/services/capability-invoke.js +14 -2
- package/dist/src/services/capability-invoke.js.map +1 -1
- package/dist/src/services/catalogue-sync.d.ts.map +1 -1
- package/dist/src/services/catalogue-sync.js +1 -0
- package/dist/src/services/catalogue-sync.js.map +1 -1
- package/dist/src/services/component-registrar.d.ts.map +1 -1
- package/dist/src/services/component-registrar.js +22 -6
- package/dist/src/services/component-registrar.js.map +1 -1
- package/dist/src/services/config-loader.d.ts.map +1 -1
- package/dist/src/services/config-loader.js +6 -1
- package/dist/src/services/config-loader.js.map +1 -1
- package/dist/src/services/config-schema.d.ts.map +1 -1
- package/dist/src/services/config-schema.js +1 -0
- package/dist/src/services/config-schema.js.map +1 -1
- package/dist/src/services/connect-tunnel.d.ts.map +1 -1
- package/dist/src/services/connect-tunnel.js +17 -6
- package/dist/src/services/connect-tunnel.js.map +1 -1
- package/dist/src/services/consent.d.ts.map +1 -1
- package/dist/src/services/consent.js +3 -1
- package/dist/src/services/consent.js.map +1 -1
- package/dist/src/services/consul-config.d.ts.map +1 -1
- package/dist/src/services/consul-config.js +7 -2
- package/dist/src/services/consul-config.js.map +1 -1
- package/dist/src/services/contacts.js +4 -2
- package/dist/src/services/contacts.js.map +1 -1
- package/dist/src/services/core-jobs.js +1 -1
- package/dist/src/services/core-jobs.js.map +1 -1
- package/dist/src/services/db/agent-messages-overview-db-service.d.ts.map +1 -1
- package/dist/src/services/db/agent-messages-overview-db-service.js +2 -1
- package/dist/src/services/db/agent-messages-overview-db-service.js.map +1 -1
- package/dist/src/services/db/agent-quality-overview-db-service.d.ts.map +1 -1
- package/dist/src/services/db/agent-quality-overview-db-service.js +2 -1
- package/dist/src/services/db/agent-quality-overview-db-service.js.map +1 -1
- package/dist/src/services/db/messages-inbox-db-service.d.ts.map +1 -1
- package/dist/src/services/db/messages-inbox-db-service.js +3 -2
- package/dist/src/services/db/messages-inbox-db-service.js.map +1 -1
- package/dist/src/services/db/messaging-db-service.d.ts.map +1 -1
- package/dist/src/services/db/messaging-db-service.js +3 -2
- package/dist/src/services/db/messaging-db-service.js.map +1 -1
- package/dist/src/services/db/wallet-tab-db-service.d.ts +3 -3
- package/dist/src/services/doc-images.d.ts.map +1 -1
- package/dist/src/services/doc-images.js +7 -4
- package/dist/src/services/doc-images.js.map +1 -1
- package/dist/src/services/ecosystem-automation-notify.d.ts.map +1 -1
- package/dist/src/services/ecosystem-automation-notify.js +10 -4
- package/dist/src/services/ecosystem-automation-notify.js.map +1 -1
- package/dist/src/services/ecosystem-automation.d.ts.map +1 -1
- package/dist/src/services/ecosystem-automation.js +3 -2
- package/dist/src/services/ecosystem-automation.js.map +1 -1
- package/dist/src/services/ecosystem-events.js +1 -1
- package/dist/src/services/ecosystem-events.js.map +1 -1
- package/dist/src/services/entitlement-merge.d.ts +50 -0
- package/dist/src/services/entitlement-merge.d.ts.map +1 -0
- package/dist/src/services/entitlement-merge.js +116 -0
- package/dist/src/services/entitlement-merge.js.map +1 -0
- package/dist/src/services/entitlement-money.d.ts.map +1 -1
- package/dist/src/services/entitlement-money.js +4 -1
- package/dist/src/services/entitlement-money.js.map +1 -1
- package/dist/src/services/exchange-market.d.ts +47 -2
- package/dist/src/services/exchange-market.d.ts.map +1 -1
- package/dist/src/services/exchange-market.js +80 -9
- package/dist/src/services/exchange-market.js.map +1 -1
- package/dist/src/services/exchange-projection.d.ts +8 -2
- package/dist/src/services/exchange-projection.d.ts.map +1 -1
- package/dist/src/services/exchange-projection.js +146 -21
- package/dist/src/services/exchange-projection.js.map +1 -1
- package/dist/src/services/exchange-proposals.d.ts.map +1 -1
- package/dist/src/services/exchange-proposals.js +4 -2
- package/dist/src/services/exchange-proposals.js.map +1 -1
- package/dist/src/services/extension-purchase.d.ts +36 -0
- package/dist/src/services/extension-purchase.d.ts.map +1 -0
- package/dist/src/services/extension-purchase.js +110 -0
- package/dist/src/services/extension-purchase.js.map +1 -0
- package/dist/src/services/extension-runtime.d.ts +23 -1
- package/dist/src/services/extension-runtime.d.ts.map +1 -1
- package/dist/src/services/extension-runtime.js +21 -4
- package/dist/src/services/extension-runtime.js.map +1 -1
- package/dist/src/services/extension-secrets.d.ts +8 -0
- package/dist/src/services/extension-secrets.d.ts.map +1 -1
- package/dist/src/services/extension-secrets.js +14 -0
- package/dist/src/services/extension-secrets.js.map +1 -1
- package/dist/src/services/federation-availability.d.ts.map +1 -1
- package/dist/src/services/federation-availability.js +1 -0
- package/dist/src/services/federation-availability.js.map +1 -1
- package/dist/src/services/federation-book.js +15 -7
- package/dist/src/services/federation-book.js.map +1 -1
- package/dist/src/services/federation-helpers.d.ts.map +1 -1
- package/dist/src/services/federation-helpers.js +1 -0
- package/dist/src/services/federation-helpers.js.map +1 -1
- package/dist/src/services/federation.d.ts.map +1 -1
- package/dist/src/services/federation.js +8 -6
- package/dist/src/services/federation.js.map +1 -1
- package/dist/src/services/gate-expiry.d.ts.map +1 -1
- package/dist/src/services/gate-expiry.js +2 -1
- package/dist/src/services/gate-expiry.js.map +1 -1
- package/dist/src/services/genesis-sync.d.ts.map +1 -1
- package/dist/src/services/genesis-sync.js +9 -4
- package/dist/src/services/genesis-sync.js.map +1 -1
- package/dist/src/services/handbooks/commerce.d.ts +13 -0
- package/dist/src/services/handbooks/commerce.d.ts.map +1 -0
- package/dist/src/services/handbooks/commerce.js +60 -0
- package/dist/src/services/handbooks/commerce.js.map +1 -0
- package/dist/src/services/handbooks/index.d.ts +1 -0
- package/dist/src/services/handbooks/index.d.ts.map +1 -1
- package/dist/src/services/handbooks/index.js +2 -2
- package/dist/src/services/handbooks/index.js.map +1 -1
- package/dist/src/services/hooks.d.ts.map +1 -1
- package/dist/src/services/hooks.js +2 -0
- package/dist/src/services/hooks.js.map +1 -1
- package/dist/src/services/invitations.d.ts.map +1 -1
- package/dist/src/services/invitations.js +2 -0
- package/dist/src/services/invitations.js.map +1 -1
- package/dist/src/services/living-author.d.ts.map +1 -1
- package/dist/src/services/living-author.js +4 -1
- package/dist/src/services/living-author.js.map +1 -1
- package/dist/src/services/living-pulse.js +18 -6
- package/dist/src/services/living-pulse.js.map +1 -1
- package/dist/src/services/mailbox-notification.d.ts.map +1 -1
- package/dist/src/services/mailbox-notification.js +1 -0
- package/dist/src/services/mailbox-notification.js.map +1 -1
- package/dist/src/services/match-notification.d.ts.map +1 -1
- package/dist/src/services/match-notification.js +2 -1
- package/dist/src/services/match-notification.js.map +1 -1
- package/dist/src/services/matching.d.ts.map +1 -1
- package/dist/src/services/matching.js +5 -2
- package/dist/src/services/matching.js.map +1 -1
- package/dist/src/services/memory-replication.d.ts.map +1 -1
- package/dist/src/services/memory-replication.js +3 -1
- package/dist/src/services/memory-replication.js.map +1 -1
- package/dist/src/services/message-broadcast.d.ts.map +1 -1
- package/dist/src/services/message-broadcast.js +2 -1
- package/dist/src/services/message-broadcast.js.map +1 -1
- package/dist/src/services/message-delivery.d.ts.map +1 -1
- package/dist/src/services/message-delivery.js +9 -4
- package/dist/src/services/message-delivery.js.map +1 -1
- package/dist/src/services/metered-access.d.ts +148 -0
- package/dist/src/services/metered-access.d.ts.map +1 -0
- package/dist/src/services/metered-access.js +128 -0
- package/dist/src/services/metered-access.js.map +1 -0
- package/dist/src/services/metered-entitlements.d.ts +140 -5
- package/dist/src/services/metered-entitlements.d.ts.map +1 -1
- package/dist/src/services/metered-entitlements.js +247 -30
- package/dist/src/services/metered-entitlements.js.map +1 -1
- package/dist/src/services/metered-settlement.d.ts +45 -0
- package/dist/src/services/metered-settlement.d.ts.map +1 -0
- package/dist/src/services/metered-settlement.js +117 -0
- package/dist/src/services/metered-settlement.js.map +1 -0
- package/dist/src/services/network-policy.d.ts.map +1 -1
- package/dist/src/services/network-policy.js +6 -2
- package/dist/src/services/network-policy.js.map +1 -1
- package/dist/src/services/notebook-classify.d.ts.map +1 -1
- package/dist/src/services/notebook-classify.js +7 -2
- package/dist/src/services/notebook-classify.js.map +1 -1
- package/dist/src/services/notebook-plan.d.ts.map +1 -1
- package/dist/src/services/notebook-plan.js +4 -1
- package/dist/src/services/notebook-plan.js.map +1 -1
- package/dist/src/services/notify.d.ts.map +1 -1
- package/dist/src/services/notify.js +6 -3
- package/dist/src/services/notify.js.map +1 -1
- package/dist/src/services/openrouter.d.ts.map +1 -1
- package/dist/src/services/openrouter.js +1 -0
- package/dist/src/services/openrouter.js.map +1 -1
- package/dist/src/services/organism-export.d.ts.map +1 -1
- package/dist/src/services/organism-export.js +4 -1
- package/dist/src/services/organism-export.js.map +1 -1
- package/dist/src/services/organism-import.d.ts.map +1 -1
- package/dist/src/services/organism-import.js +5 -1
- package/dist/src/services/organism-import.js.map +1 -1
- package/dist/src/services/perf-trace.js +3 -1
- package/dist/src/services/perf-trace.js.map +1 -1
- package/dist/src/services/personal-tunnel.js +14 -8
- package/dist/src/services/personal-tunnel.js.map +1 -1
- package/dist/src/services/presence.d.ts.map +1 -1
- package/dist/src/services/presence.js +11 -5
- package/dist/src/services/presence.js.map +1 -1
- package/dist/src/services/protected-resource.d.ts +60 -0
- package/dist/src/services/protected-resource.d.ts.map +1 -0
- package/dist/src/services/protected-resource.js +137 -0
- package/dist/src/services/protected-resource.js.map +1 -0
- package/dist/src/services/realtime-manager.d.ts.map +1 -1
- package/dist/src/services/realtime-manager.js +8 -5
- package/dist/src/services/realtime-manager.js.map +1 -1
- package/dist/src/services/safe-zip.d.ts.map +1 -1
- package/dist/src/services/safe-zip.js +4 -1
- package/dist/src/services/safe-zip.js.map +1 -1
- package/dist/src/services/scheduler-extension-job.js +2 -2
- package/dist/src/services/scheduler-extension-job.js.map +1 -1
- package/dist/src/services/scheduler.js +13 -7
- package/dist/src/services/scheduler.js.map +1 -1
- package/dist/src/services/security-incident.d.ts.map +1 -1
- package/dist/src/services/security-incident.js +7 -2
- package/dist/src/services/security-incident.js.map +1 -1
- package/dist/src/services/site-sync.d.ts.map +1 -1
- package/dist/src/services/site-sync.js +1 -0
- package/dist/src/services/site-sync.js.map +1 -1
- package/dist/src/services/site.d.ts +1 -1
- package/dist/src/services/site.d.ts.map +1 -1
- package/dist/src/services/site.js +29 -8
- package/dist/src/services/site.js.map +1 -1
- package/dist/src/services/structure-overview.d.ts.map +1 -1
- package/dist/src/services/structure-overview.js +4 -1
- package/dist/src/services/structure-overview.js.map +1 -1
- package/dist/src/services/structure-snapshot.d.ts.map +1 -1
- package/dist/src/services/structure-snapshot.js +3 -2
- package/dist/src/services/structure-snapshot.js.map +1 -1
- package/dist/src/services/sync-scheduler.js +3 -2
- package/dist/src/services/sync-scheduler.js.map +1 -1
- package/dist/src/services/tracked-response.js +1 -1
- package/dist/src/services/tracked-response.js.map +1 -1
- package/dist/src/services/trust-broadcast.d.ts.map +1 -1
- package/dist/src/services/trust-broadcast.js +1 -0
- package/dist/src/services/trust-broadcast.js.map +1 -1
- package/dist/src/services/upload-zip.d.ts +7 -0
- package/dist/src/services/upload-zip.d.ts.map +1 -1
- package/dist/src/services/upload-zip.js +19 -85
- package/dist/src/services/upload-zip.js.map +1 -1
- package/dist/src/services/web-bot-auth.d.ts.map +1 -1
- package/dist/src/services/web-bot-auth.js +1 -0
- package/dist/src/services/web-bot-auth.js.map +1 -1
- package/dist/src/services/workflow/engine-steps.d.ts.map +1 -1
- package/dist/src/services/workflow/engine-steps.js +12 -6
- package/dist/src/services/workflow/engine-steps.js.map +1 -1
- package/dist/src/services/workspace-export.d.ts.map +1 -1
- package/dist/src/services/workspace-export.js +5 -2
- package/dist/src/services/workspace-export.js.map +1 -1
- package/dist/src/services/workspace-import.d.ts.map +1 -1
- package/dist/src/services/workspace-import.js +2 -1
- package/dist/src/services/workspace-import.js.map +1 -1
- package/dist/src/services/workspace-versions.d.ts.map +1 -1
- package/dist/src/services/workspace-versions.js +0 -0
- package/dist/src/services/workspace-versions.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/db-types.d.ts +5 -0
- package/dist/src/storage/providers/postgres-kysely/db-types.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/helpers.d.ts +11 -0
- package/dist/src/storage/providers/postgres-kysely/helpers.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/helpers.js +14 -0
- package/dist/src/storage/providers/postgres-kysely/helpers.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.d.ts +1 -1
- 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 +6 -0
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/capabilities.js +3 -3
- package/dist/src/storage/providers/postgres-kysely/methods/capabilities.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/ecosystem.js +3 -3
- package/dist/src/storage/providers/postgres-kysely/methods/ecosystem.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/federation.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/federation.js +12 -10
- package/dist/src/storage/providers/postgres-kysely/methods/federation.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/identity.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/identity.js +26 -12
- package/dist/src/storage/providers/postgres-kysely/methods/identity.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/marketplace.js +5 -5
- package/dist/src/storage/providers/postgres-kysely/methods/marketplace.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/node-ext-escrow.d.ts +9 -0
- package/dist/src/storage/providers/postgres-kysely/methods/node-ext-escrow.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/node-ext-escrow.js +31 -27
- package/dist/src/storage/providers/postgres-kysely/methods/node-ext-escrow.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 +10 -14
- package/dist/src/storage/providers/postgres-kysely/methods/organisms.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/otk.js +3 -3
- package/dist/src/storage/providers/postgres-kysely/methods/otk.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/packages.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/packages.js +4 -14
- package/dist/src/storage/providers/postgres-kysely/methods/packages.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/template-listings.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/template-listings.js +11 -10
- package/dist/src/storage/providers/postgres-kysely/methods/template-listings.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/wallet.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/wallet.js +3 -1
- package/dist/src/storage/providers/postgres-kysely/methods/wallet.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/migrate.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/migrate.js +3 -0
- package/dist/src/storage/providers/postgres-kysely/migrate.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/migrations/0013_ghii_password_lockout.sql +12 -0
- package/dist/src/storage/providers/postgres-kysely/migrations/0014_transaction_initiator.sql +6 -0
- package/dist/src/storage/providers/postgres-kysely/migrations/0015_app_grant_spend_cap.sql +5 -0
- package/dist/src/storage/providers/sqlite/methods/apps.d.ts +1 -1
- package/dist/src/storage/providers/sqlite/methods/apps.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/apps.js +12 -2
- package/dist/src/storage/providers/sqlite/methods/apps.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/community.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/community.js +6 -1
- package/dist/src/storage/providers/sqlite/methods/community.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.js +9 -2
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/work.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/work.js +4 -2
- package/dist/src/storage/providers/sqlite/methods/work.js.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/community.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/community.js +6 -1
- package/dist/src/storage/providers/sqlite/repos/community.js.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/identity.d.ts +3 -0
- package/dist/src/storage/providers/sqlite/repos/identity.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/identity.js +13 -4
- package/dist/src/storage/providers/sqlite/repos/identity.js.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/work.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/work.js +4 -2
- package/dist/src/storage/providers/sqlite/repos/work.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-1.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-1.js +1 -0
- package/dist/src/storage/providers/sqlite/schema-tables-1.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-2.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-2.js +2 -0
- package/dist/src/storage/providers/sqlite/schema-tables-2.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.js +14 -1
- package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
- package/dist/src/storage/repositories/app-grant.repository.d.ts +1 -1
- package/dist/src/storage/repositories/app-grant.repository.d.ts.map +1 -1
- package/dist/src/storage/types/auth.d.ts +9 -0
- package/dist/src/storage/types/auth.d.ts.map +1 -1
- package/dist/src/storage/types/commerce.d.ts +13 -0
- package/dist/src/storage/types/commerce.d.ts.map +1 -1
- package/dist/src/utils/app-agent-discovery.d.ts +31 -0
- package/dist/src/utils/app-agent-discovery.d.ts.map +1 -0
- package/dist/src/utils/app-agent-discovery.js +96 -0
- package/dist/src/utils/app-agent-discovery.js.map +1 -0
- package/dist/src/utils/app-protect.d.ts.map +1 -1
- package/dist/src/utils/app-protect.js +1 -0
- package/dist/src/utils/app-protect.js.map +1 -1
- package/dist/src/utils/env-validator.d.ts.map +1 -1
- package/dist/src/utils/env-validator.js +5 -1
- package/dist/src/utils/env-validator.js.map +1 -1
- package/dist/src/utils/gaii.d.ts +50 -0
- package/dist/src/utils/gaii.d.ts.map +1 -1
- package/dist/src/utils/gaii.js +66 -0
- package/dist/src/utils/gaii.js.map +1 -1
- package/dist/src/utils/url-validator.d.ts.map +1 -1
- package/dist/src/utils/url-validator.js +4 -1
- package/dist/src/utils/url-validator.js.map +1 -1
- package/dist/src/utils/version.d.ts.map +1 -1
- package/dist/src/utils/version.js +1 -0
- package/dist/src/utils/version.js.map +1 -1
- package/dist/static/sdk-libs/auth/session.js +7 -3
- package/dist/static/sdk-libs/dist/aimeat-auth.js +1 -1
- package/dist/static/sdk-libs/dist/aimeat-exchange.js +675 -0
- package/dist/static/sdk-libs/dist/aimeat-game.js +1555 -0
- package/dist/static/sdk-libs/dist/aimeat-webmcp.js +46 -0
- package/dist/static/sdk-libs/exchange/browse.js +81 -0
- package/dist/static/sdk-libs/exchange/client.js +131 -0
- package/dist/static/sdk-libs/exchange/contracts.js +228 -0
- package/dist/static/sdk-libs/exchange/demand.js +106 -0
- package/dist/static/sdk-libs/exchange/earnings.js +39 -0
- package/dist/static/sdk-libs/exchange/format.js +51 -0
- package/dist/static/sdk-libs/exchange/index.js +70 -0
- package/dist/static/sdk-libs/exchange/odps-completeness.js +177 -0
- package/dist/static/sdk-libs/exchange/sell.js +253 -0
- package/dist/static/sdk-libs/game/board.js +331 -0
- package/dist/static/sdk-libs/game/dom.js +223 -0
- package/dist/static/sdk-libs/game/i18n.js +201 -0
- package/dist/static/sdk-libs/game/index.js +72 -0
- package/dist/static/sdk-libs/game/markers.js +150 -0
- package/dist/static/sdk-libs/game/menu.js +260 -0
- package/dist/static/sdk-libs/game/overlay.js +193 -0
- package/dist/static/sdk-libs/game/progress.js +280 -0
- package/dist/static/sdk-libs/game/score.js +134 -0
- package/dist/static/sdk-libs/game/screen.js +120 -0
- package/dist/static/sdk-libs/game/units.js +55 -0
- package/dist/static/sdk-libs/webmcp/index.js +63 -0
- package/package.json +2 -1
|
@@ -94,6 +94,27 @@
|
|
|
94
94
|
return asContent(res.ok ? res.data : res);
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
+
function aboutTool(ref, surface, toolCount) {
|
|
98
|
+
const s = surface || {};
|
|
99
|
+
const label = s.name || ref.appId;
|
|
100
|
+
const parts = [];
|
|
101
|
+
if (toolCount) parts.push(toolCount + " callable tool" + (toolCount === 1 ? "" : "s"));
|
|
102
|
+
if ((s.skills || []).length) parts.push(s.skills.length + " bound skill" + (s.skills.length === 1 ? "" : "s"));
|
|
103
|
+
if ((s.bundled_agents || []).length) parts.push(s.bundled_agents.length + " bundled agent" + (s.bundled_agents.length === 1 ? "" : "s"));
|
|
104
|
+
const offers = ((s.exchange || {}).offerings || []).length;
|
|
105
|
+
if (offers) parts.push(offers + " EXCHANGE listing" + (offers === 1 ? "" : "s"));
|
|
106
|
+
const carries = parts.length ? " Carries " + parts.join(", ") + "." : "";
|
|
107
|
+
return {
|
|
108
|
+
name: "about-this-app",
|
|
109
|
+
description: 'What "' + label + '" (' + ref.owner + "/" + ref.appId + ") offers an agent: its app id, declared scopes, the SKILL.md packs bound to it, the agent crews it ships, and what it sells on the AIMEAT EXCHANGE, with prices." + carries,
|
|
110
|
+
inputSchema: { type: "object", properties: {} },
|
|
111
|
+
async execute() {
|
|
112
|
+
if (surface) return asContent(surface);
|
|
113
|
+
const listing = await fetchListing(ref.owner, ref.appId);
|
|
114
|
+
return asContent(listing.app_surface || { app: ref.owner + "/" + ref.appId });
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
97
118
|
var webmcp = {
|
|
98
119
|
/** Every tool descriptor this page has registered (introspection + provideContext resends). */
|
|
99
120
|
tools: [],
|
|
@@ -116,9 +137,15 @@
|
|
|
116
137
|
/**
|
|
117
138
|
* Expose an app's declared tools (apps.{appId}.tools manifest) to the in-browser agent.
|
|
118
139
|
* Descriptions of priced tools carry the price tag so the agent can tell the user the cost.
|
|
140
|
+
*
|
|
141
|
+
* Every app also gets `about-this-app`, built from the listing's `app_surface`: the SKILL.md
|
|
142
|
+
* packs bound to the app, the crew-defs it ships, its declared scopes and its live EXCHANGE
|
|
143
|
+
* listings. An app that sells nothing still exposes that one, so an agent that lands on any
|
|
144
|
+
* app page can ask what it is looking at instead of reading 200 kB of minified source.
|
|
119
145
|
*/
|
|
120
146
|
async exposeAppTools(ref) {
|
|
121
147
|
const listing = await fetchListing(ref.owner, ref.appId);
|
|
148
|
+
const surface = listing.app_surface || null;
|
|
122
149
|
const tools = (listing.tools || []).map(function(entry) {
|
|
123
150
|
let desc = entry.description || entry.name;
|
|
124
151
|
if (entry.payment && entry.payment.required) {
|
|
@@ -135,6 +162,7 @@
|
|
|
135
162
|
execute: buildExecute(ref.owner, ref.appId, entry)
|
|
136
163
|
};
|
|
137
164
|
});
|
|
165
|
+
tools.unshift(aboutTool(ref, surface, tools.length));
|
|
138
166
|
await webmcp.register(tools);
|
|
139
167
|
return { surface: webmcp.surface, tools: tools.map(function(t) {
|
|
140
168
|
return t.name;
|
|
@@ -169,6 +197,18 @@
|
|
|
169
197
|
}
|
|
170
198
|
};
|
|
171
199
|
attach("webmcp", webmcp);
|
|
200
|
+
function appRefFromPage(el) {
|
|
201
|
+
const ds = el && el.dataset || {};
|
|
202
|
+
if (ds.owner && ds.app) return { owner: ds.owner, appId: ds.app };
|
|
203
|
+
try {
|
|
204
|
+
const node = document.getElementById("aimeat-app-ref");
|
|
205
|
+
if (!node) return null;
|
|
206
|
+
const ref = JSON.parse(node.textContent || "{}");
|
|
207
|
+
if (ref.owner && ref.app_id) return { owner: ref.owner, appId: ref.app_id };
|
|
208
|
+
} catch {
|
|
209
|
+
}
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
172
212
|
try {
|
|
173
213
|
const el = (
|
|
174
214
|
/** @type {any} */
|
|
@@ -181,6 +221,12 @@
|
|
|
181
221
|
webmcp.exposeNodeTools().catch(function() {
|
|
182
222
|
});
|
|
183
223
|
}, 0);
|
|
224
|
+
} else if (expose === "app") {
|
|
225
|
+
const ref = appRefFromPage(el);
|
|
226
|
+
if (ref) setTimeout(function() {
|
|
227
|
+
webmcp.exposeAppTools(ref).catch(function() {
|
|
228
|
+
});
|
|
229
|
+
}, 0);
|
|
184
230
|
}
|
|
185
231
|
} catch {
|
|
186
232
|
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file exchange/browse.js
|
|
3
|
+
* @description The BROWSE half of AIMEAT.exchange — reading the market. Every call here maps to a
|
|
4
|
+
* route the node publishes without authentication, so an app can render the catalogue, one
|
|
5
|
+
* listing's full decision context, and its ODPS v4.1 descriptor to a signed-out visitor. The
|
|
6
|
+
* session is sent when there is one (see client.js `maybe`) purely so a seller's own projections
|
|
7
|
+
* are fresh; it changes what is CURRENT, never what is VISIBLE.
|
|
8
|
+
* @structure info() · list(filter) · search(q, filter) · get(id) · odps(id) · odpsYaml(id)
|
|
9
|
+
* @usage const { offerings } = await AIMEAT.exchange.list({ q: 'company', stats: true });
|
|
10
|
+
* @version-history
|
|
11
|
+
* v1.0.0 — 2026-07-28 — Initial (NOSTE prompt 02 — the EXCHANGE browser library, gap G19).
|
|
12
|
+
*/
|
|
13
|
+
import { pub, pubText, maybe, qs } from './client.js';
|
|
14
|
+
|
|
15
|
+
const enc = encodeURIComponent;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The marketplace's public economics: `{ rake_percent, rake_note, units, morsel_note }` — what the
|
|
19
|
+
* platform takes on each metered call, set by the node operator. Show it BEFORE a seller prices
|
|
20
|
+
* something, so the split is stated rather than discovered on the first sale.
|
|
21
|
+
* @returns {Promise<any>}
|
|
22
|
+
*/
|
|
23
|
+
export function info() {
|
|
24
|
+
return pub('/v1/exchange/info', 'Failed to read the EXCHANGE economics');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Browse listed offerings. Every supplied filter NARROWS, independently.
|
|
29
|
+
* @param {{ ext?: string, action?: string, q?: string, stats?: boolean }} [filter]
|
|
30
|
+
* `q` free-text over title/description/coordinate/tags; `stats: true` folds each listing's usage
|
|
31
|
+
* (contracts, calls, consumers, settled units, observed p50/p95) into the row.
|
|
32
|
+
* @returns {Promise<{ offerings: any[], count: number }>}
|
|
33
|
+
*/
|
|
34
|
+
export function list(filter) {
|
|
35
|
+
const f = filter || {};
|
|
36
|
+
const query = qs({ ext: f.ext, action: f.action, q: f.q, stats: f.stats ? '1' : null });
|
|
37
|
+
return maybe('/v1/exchange/offerings' + query, 'Failed to browse the marketplace');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Free-text search — the same route as {@link list}, named for what an app's search box does.
|
|
42
|
+
* @param {string} q
|
|
43
|
+
* @param {{ ext?: string, action?: string, stats?: boolean }} [filter]
|
|
44
|
+
* @returns {Promise<{ offerings: any[], count: number }>}
|
|
45
|
+
*/
|
|
46
|
+
export function search(q, filter) {
|
|
47
|
+
return list({ ...(filter || {}), q });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* One offering in FULL: `{ offering, capability, call_recipe, stats, pacing, odps }` — the I/O
|
|
52
|
+
* schema, how to call it (the contract IS the access; no API key is issued), what it costs per call
|
|
53
|
+
* in morsels burned for pacing on top of the price, the observed usage, and a pointer to the ODPS
|
|
54
|
+
* document. One call, so an app need not stitch four.
|
|
55
|
+
* @param {string} id Offering id (`off-…`).
|
|
56
|
+
* @returns {Promise<any>}
|
|
57
|
+
*/
|
|
58
|
+
export function get(id) {
|
|
59
|
+
return pub('/v1/exchange/offerings/' + enc(id), 'No such offering');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The offering as an Open Data Product Specification v4.1 document (JSON) — the interoperable
|
|
64
|
+
* descriptor an outside catalogue or a negotiating agent reads without knowing anything about
|
|
65
|
+
* AIMEAT. Derived on read, so it cannot drift from the listing it describes.
|
|
66
|
+
* @param {string} id
|
|
67
|
+
* @returns {Promise<{ odps_version: string, odps: any }>}
|
|
68
|
+
*/
|
|
69
|
+
export function odps(id) {
|
|
70
|
+
return pub('/v1/exchange/offerings/' + enc(id) + '/odps', 'No such offering');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The same ODPS v4.1 document in the spec's native YAML, as raw text — what you hand to a catalogue
|
|
75
|
+
* that expects the file, or show in a "copy this descriptor" box.
|
|
76
|
+
* @param {string} id
|
|
77
|
+
* @returns {Promise<string>}
|
|
78
|
+
*/
|
|
79
|
+
export function odpsYaml(id) {
|
|
80
|
+
return pubText('/v1/exchange/offerings/' + enc(id) + '/odps.yaml', 'No such offering');
|
|
81
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file exchange/client.js
|
|
3
|
+
* @description Shared fetch plumbing for the aimeat-exchange library. EXCHANGE is a two-sided market
|
|
4
|
+
* whose read surface is deliberately PUBLIC (browsing a listing, its ODPS document and its stats
|
|
5
|
+
* needs no account) while every write and every "mine" read is authorised. So there are three call
|
|
6
|
+
* shapes rather than one: `pub` (never sends a session), `authed` (requires one — the auth guard
|
|
7
|
+
* names this library in its error) and `maybe` (sends the session when there is one). `maybe` is not
|
|
8
|
+
* a convenience: GET /v1/exchange/offerings reconciles the CALLER's own projections before it
|
|
9
|
+
* answers, so a signed-in seller browsing the market sees their own listings up to date, and a
|
|
10
|
+
* signed-out visitor still gets the market.
|
|
11
|
+
* SECURITY: this file carries no credentials of its own. It sends the aimeat-auth session and
|
|
12
|
+
* renders what comes back — who may see what is the server's decision, never this library's.
|
|
13
|
+
* @structure exchangeError(res, fallback) · qs(params) · pub(path) · authed(path, opts) ·
|
|
14
|
+
* maybe(path) · hasSession()
|
|
15
|
+
* @usage import { authed, pub, qs, exchangeError } from './client.js';
|
|
16
|
+
* @version-history
|
|
17
|
+
* v1.0.0 — 2026-07-28 — Initial (NOSTE prompt 02 — the EXCHANGE browser library, gap G19).
|
|
18
|
+
*/
|
|
19
|
+
import { APEX_URL } from '../_core/config.js';
|
|
20
|
+
import { makeSession } from '../_core/session.js';
|
|
21
|
+
|
|
22
|
+
const NODE_URL = APEX_URL;
|
|
23
|
+
const { authFetch } = makeSession('aimeat-exchange.js');
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Build an Error from a failed envelope, preserving the machine-readable code so callers can branch
|
|
27
|
+
* on it (`SOURCE_MANAGED`, `SCHEMA_REQUIRED`, `USAGE_TERMS_REQUIRED`, `NOT_PRICED`, `BUDGET_TOO_LOW`
|
|
28
|
+
* …) instead of matching on message text. EXCHANGE refusals are mostly *actionable* — they say which
|
|
29
|
+
* field the provider must publish — so the message is kept verbatim.
|
|
30
|
+
* @param {any} res The parsed envelope.
|
|
31
|
+
* @param {string} fallback Message to use when the envelope carries none.
|
|
32
|
+
* @returns {Error & { code?: string, details?: unknown }}
|
|
33
|
+
*/
|
|
34
|
+
export function exchangeError(res, fallback) {
|
|
35
|
+
const e = /** @type {Error & { code?: string, details?: unknown }} */ (
|
|
36
|
+
new Error((res && res.error && res.error.message) || fallback));
|
|
37
|
+
e.code = res && res.error && res.error.code;
|
|
38
|
+
e.details = res && res.error && res.error.details;
|
|
39
|
+
return e;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Serialise a query object, dropping null/undefined/'' so an unset filter is not sent as an empty
|
|
44
|
+
* one (the offerings route treats every supplied filter as a NARROWING term).
|
|
45
|
+
* @param {Record<string, string|number|boolean|null|undefined>} [params]
|
|
46
|
+
* @returns {string} `?a=1&b=2`, or '' when nothing is set.
|
|
47
|
+
*/
|
|
48
|
+
export function qs(params) {
|
|
49
|
+
const parts = [];
|
|
50
|
+
for (const k of Object.keys(params || {})) {
|
|
51
|
+
const v = params[k];
|
|
52
|
+
if (v === null || v === undefined || v === '') continue;
|
|
53
|
+
parts.push(encodeURIComponent(k) + '=' + encodeURIComponent(String(v)));
|
|
54
|
+
}
|
|
55
|
+
return parts.length ? '?' + parts.join('&') : '';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** True when aimeat-auth is loaded AND someone is signed in — never throws. */
|
|
59
|
+
export function hasSession() {
|
|
60
|
+
try {
|
|
61
|
+
const auth = window.AIMEAT && window.AIMEAT.auth;
|
|
62
|
+
return !!(auth && auth.getSession());
|
|
63
|
+
} catch { return false; }
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A PUBLIC read — no session, ever. Used for the browse surface so a signed-out visitor sees the
|
|
68
|
+
* market exactly as the node publishes it.
|
|
69
|
+
* @param {string} path
|
|
70
|
+
* @param {string} fallback Error message when the envelope carries none.
|
|
71
|
+
* @returns {Promise<any>} The envelope's `data`.
|
|
72
|
+
*/
|
|
73
|
+
export async function pub(path, fallback) {
|
|
74
|
+
const r = await fetch(NODE_URL + path);
|
|
75
|
+
const res = await r.json();
|
|
76
|
+
if (!res.ok) throw exchangeError(res, fallback);
|
|
77
|
+
return res.data;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** A PUBLIC read that returns raw text rather than an envelope (the ODPS `.yaml` projection). */
|
|
81
|
+
export async function pubText(path, fallback) {
|
|
82
|
+
const r = await fetch(NODE_URL + path);
|
|
83
|
+
const text = await r.text();
|
|
84
|
+
if (!r.ok) {
|
|
85
|
+
let parsed = null;
|
|
86
|
+
try { parsed = JSON.parse(text); } catch { /* a non-envelope error body — fall through */ }
|
|
87
|
+
throw exchangeError(parsed, fallback);
|
|
88
|
+
}
|
|
89
|
+
return text;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* An AUTHORISED call — the session's own fetch (bearer token, refresh on 401, scope self-heal).
|
|
94
|
+
* @param {string} path
|
|
95
|
+
* @param {RequestInit} [opts]
|
|
96
|
+
* @param {string} [fallback]
|
|
97
|
+
* @returns {Promise<any>} The envelope's `data`.
|
|
98
|
+
*/
|
|
99
|
+
export async function authed(path, opts, fallback) {
|
|
100
|
+
const res = await authFetch(path, opts);
|
|
101
|
+
if (!res.ok) throw exchangeError(res, fallback || 'EXCHANGE request failed');
|
|
102
|
+
return res.data;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* A public read that SENDS the session when there is one. Signed in, the offerings route brings the
|
|
107
|
+
* caller's own projections up to date before answering; signed out, the same call still returns the
|
|
108
|
+
* public market.
|
|
109
|
+
* @param {string} path
|
|
110
|
+
* @param {string} fallback
|
|
111
|
+
* @returns {Promise<any>}
|
|
112
|
+
*/
|
|
113
|
+
export async function maybe(path, fallback) {
|
|
114
|
+
if (!hasSession()) return pub(path, fallback);
|
|
115
|
+
try {
|
|
116
|
+
return await authed(path, undefined, fallback);
|
|
117
|
+
} catch (e) {
|
|
118
|
+
// A stale or scope-short session must never turn a PUBLIC surface into an error page.
|
|
119
|
+
if (e && (e.code === 'UNAUTHORIZED' || e.code === 'FORBIDDEN')) return pub(path, fallback);
|
|
120
|
+
throw e;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** POST/DELETE helper: JSON body, authorised. */
|
|
125
|
+
export function send(path, method, body, fallback) {
|
|
126
|
+
const opts = /** @type {RequestInit} */ ({ method });
|
|
127
|
+
if (body !== undefined) opts.body = JSON.stringify(body);
|
|
128
|
+
return authed(path, opts, fallback);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { NODE_URL };
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file exchange/contracts.js
|
|
3
|
+
* @description The BUY half of AIMEAT.exchange — accepting a contract, seeing what it has consumed,
|
|
4
|
+
* turning it off, renegotiating it, and (for agent-work) starting and receiving a task.
|
|
5
|
+
*
|
|
6
|
+
* A contract here is a metered entitlement: the consumer chooses only their BUDGET, the per-call
|
|
7
|
+
* price is read authoritatively from the provider. That is why `accept` takes an offering id and a
|
|
8
|
+
* cap rather than a price — a price sent from a browser would be a price a buyer set for a seller.
|
|
9
|
+
* @structure contracts() · accept(offeringId, opts) · off(contract, opts) · history() · spend() ·
|
|
10
|
+
* proposals() · propose(spec) · acceptProposal/declineProposal/withdrawProposal ·
|
|
11
|
+
* startWork(spec) · deliverWork(id, spec) · work(opts) · coordinateOf
|
|
12
|
+
* @usage const c = await AIMEAT.exchange.accept('off-abc123', { capUnits: 500 });
|
|
13
|
+
* @version-history
|
|
14
|
+
* v1.0.0 — 2026-07-28 — Initial (NOSTE prompt 02 — the EXCHANGE browser library, gap G19).
|
|
15
|
+
*/
|
|
16
|
+
import { authed, send, qs, exchangeError } from './client.js';
|
|
17
|
+
import { get as getOffering } from './browse.js';
|
|
18
|
+
|
|
19
|
+
const enc = encodeURIComponent;
|
|
20
|
+
|
|
21
|
+
function compact(obj) {
|
|
22
|
+
const out = {};
|
|
23
|
+
for (const k of Object.keys(obj)) if (obj[k] !== undefined) out[k] = obj[k];
|
|
24
|
+
return out;
|
|
25
|
+
}
|
|
26
|
+
function pick(...vals) {
|
|
27
|
+
for (const v of vals) if (v !== undefined && v !== null) return v;
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Every contract the caller's OWNER holds, with what each has consumed: budget cap, spent, calls
|
|
33
|
+
* remaining, the pricing model, the pacing toll it was signed at, the rake, and `callers` — which
|
|
34
|
+
* of the owner's principals ran it up.
|
|
35
|
+
* @returns {Promise<{ entitlements: any[] }>}
|
|
36
|
+
*/
|
|
37
|
+
export function contracts() {
|
|
38
|
+
return authed('/v1/exchange/entitlements', undefined, 'Failed to read your contracts');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Accept a contract for a listed offering → mint the durable entitlement the metered gateway then
|
|
43
|
+
* honours on every call. You choose the budget; the provider's price is authoritative.
|
|
44
|
+
* @param {string} offeringId
|
|
45
|
+
* @param {{ capUnits?: number|null, appId?: string, planId?: string, contractRef?: string,
|
|
46
|
+
* escrowParty?: 'consumer'|'provider' }} [opts]
|
|
47
|
+
* `capUnits` is YOUR spend ceiling in the offering's unit (money micro-units or morsels); omit for
|
|
48
|
+
* uncapped. Below one charge it is refused with `BUDGET_TOO_LOW` rather than minted unusable.
|
|
49
|
+
* `planId` picks a provider-declared bundle/subscription plan.
|
|
50
|
+
* @returns {Promise<any>} The minted contract.
|
|
51
|
+
*/
|
|
52
|
+
export async function accept(offeringId, opts) {
|
|
53
|
+
const o = /** @type {Record<string, any>} */ (opts || {});
|
|
54
|
+
const d = await send('/v1/exchange/entitlements', 'POST', compact({
|
|
55
|
+
offering_id: offeringId,
|
|
56
|
+
cap_units: pick(o.capUnits, o.cap_units),
|
|
57
|
+
app_id: pick(o.appId, o.app_id),
|
|
58
|
+
plan_id: pick(o.planId, o.plan_id),
|
|
59
|
+
contract_ref: pick(o.contractRef, o.contract_ref),
|
|
60
|
+
escrow_party: pick(o.escrowParty, o.escrow_party),
|
|
61
|
+
}), 'Failed to accept the contract');
|
|
62
|
+
return d.entitlement;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Resolve whatever an app is holding — a contract row, an offering detail, an offering id, or a
|
|
67
|
+
* plain `{ ext, action }` — into the metered coordinate the off-switch and proposals key on.
|
|
68
|
+
* @param {any} contract
|
|
69
|
+
* @returns {Promise<{ ext: string, action: string }>}
|
|
70
|
+
*/
|
|
71
|
+
export async function coordinateOf(contract) {
|
|
72
|
+
if (typeof contract === 'string') {
|
|
73
|
+
// An offering id (`off-…`); anything else cannot be resolved without a coordinate.
|
|
74
|
+
const d = await getOffering(contract);
|
|
75
|
+
return { ext: d.offering.ext, action: d.offering.action };
|
|
76
|
+
}
|
|
77
|
+
const c = contract || {};
|
|
78
|
+
const ext = c.ext || (c.offering && c.offering.ext);
|
|
79
|
+
const action = c.action || (c.offering && c.offering.action);
|
|
80
|
+
if (!ext || !action) {
|
|
81
|
+
throw exchangeError({ error: { code: 'BAD_REQUEST', message:
|
|
82
|
+
'Name the contract by its capability coordinate ({ ext, action }), a contract row from contracts(), or an offering id.' } },
|
|
83
|
+
'Unresolvable contract reference');
|
|
84
|
+
}
|
|
85
|
+
return { ext, action };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The consumer's OFF-SWITCH. `pause` is reversible (re-accepting resumes it and carries the spend
|
|
90
|
+
* forward); `revoke` is terminal. Only the contract's own consumer may.
|
|
91
|
+
* @param {any} contract A contract row, an offering id, or `{ ext, action }`.
|
|
92
|
+
* @param {{ mode?: 'pause'|'revoke' }} [opts] Default `pause`.
|
|
93
|
+
* @returns {Promise<any>}
|
|
94
|
+
*/
|
|
95
|
+
export async function off(contract, opts) {
|
|
96
|
+
const { ext, action } = await coordinateOf(contract);
|
|
97
|
+
return send('/v1/exchange/entitlements/off', 'POST', {
|
|
98
|
+
ext, action, mode: (opts && opts.mode) === 'revoke' ? 'revoke' : 'pause',
|
|
99
|
+
}, 'Failed to switch the contract off');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Your PAST (archived / superseded) contracts as a CONSUMER — the terms a renegotiation replaced.
|
|
104
|
+
* @returns {Promise<{ history: any[], count: number }>}
|
|
105
|
+
*/
|
|
106
|
+
export function history() {
|
|
107
|
+
return authed('/v1/exchange/entitlements/history', undefined, 'Failed to read your contract history');
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* What you have spent OUTBOUND, per provider and per unit. DERIVED, not a server endpoint: the node
|
|
112
|
+
* aggregates the SELLER's side (offering stats, consumer lineage, earnings) and exposes the buyer's
|
|
113
|
+
* side only per app (`GET /v1/apps/cost?app_id=…`), so this folds the caller's own contracts — the
|
|
114
|
+
* same records the per-app view reads — into one figure. It therefore counts exactly what the
|
|
115
|
+
* caller's OWNER holds a contract for, and nothing about another of their accounts.
|
|
116
|
+
* @returns {Promise<{ byProvider: any[], byUnit: Record<string, { spentUnits: number, calls: number, contracts: number }>,
|
|
117
|
+
* totalCalls: number, totalContracts: number }>}
|
|
118
|
+
*/
|
|
119
|
+
export async function spend() {
|
|
120
|
+
const { entitlements } = await contracts();
|
|
121
|
+
const byUnit = /** @type {Record<string, { spentUnits: number, calls: number, contracts: number }>} */ ({});
|
|
122
|
+
const providers = /** @type {Record<string, any>} */ ({});
|
|
123
|
+
let totalCalls = 0;
|
|
124
|
+
for (const e of entitlements || []) {
|
|
125
|
+
const rail = e.unit === 'money' ? (e.currency || 'EUR') : 'morsels';
|
|
126
|
+
const u = byUnit[rail] || (byUnit[rail] = { spentUnits: 0, calls: 0, contracts: 0 });
|
|
127
|
+
u.spentUnits += e.budget ? e.budget.spent_units : 0;
|
|
128
|
+
u.calls += e.budget ? e.budget.calls : 0;
|
|
129
|
+
u.contracts += 1;
|
|
130
|
+
totalCalls += e.budget ? e.budget.calls : 0;
|
|
131
|
+
|
|
132
|
+
const key = e.provider + '|' + rail;
|
|
133
|
+
const p = providers[key] || (providers[key] = {
|
|
134
|
+
provider: e.provider, unit: rail, spentUnits: 0, calls: 0, contracts: 0, capabilities: [],
|
|
135
|
+
});
|
|
136
|
+
p.spentUnits += e.budget ? e.budget.spent_units : 0;
|
|
137
|
+
p.calls += e.budget ? e.budget.calls : 0;
|
|
138
|
+
p.contracts += 1;
|
|
139
|
+
if (p.capabilities.indexOf(e.capability) === -1) p.capabilities.push(e.capability);
|
|
140
|
+
}
|
|
141
|
+
const byProvider = Object.keys(providers).map(k => providers[k])
|
|
142
|
+
.sort((a, b) => b.spentUnits - a.spentUnits);
|
|
143
|
+
return { byProvider, byUnit, totalCalls, totalContracts: (entitlements || []).length };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// ── Renegotiation ────────────────────────────────────────────────────────────
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Every contract-change proposal you are party to (incoming and outgoing).
|
|
150
|
+
* @returns {Promise<{ proposals: any[], count: number }>}
|
|
151
|
+
*/
|
|
152
|
+
export function proposals() {
|
|
153
|
+
return authed('/v1/exchange/proposals', undefined, 'Failed to read proposals');
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Propose new terms on a live contract. Either party may: a consumer renegotiates their own, a
|
|
158
|
+
* provider renegotiates a named consumer's (`consumerGaii`). Nothing changes until the counterparty
|
|
159
|
+
* accepts; they are notified in Profile > Messages.
|
|
160
|
+
* @param {{ ext?: string, action?: string, contract?: any, consumerGaii?: string,
|
|
161
|
+
* newPricePerCall?: number, newCapUnits?: number, note?: string }} spec
|
|
162
|
+
* @returns {Promise<any>} The pending proposal.
|
|
163
|
+
*/
|
|
164
|
+
export async function propose(spec) {
|
|
165
|
+
const s = /** @type {Record<string, any>} */ (spec || {});
|
|
166
|
+
const { ext, action } = await coordinateOf(s.contract || { ext: s.ext, action: s.action });
|
|
167
|
+
const d = await send('/v1/exchange/proposals', 'POST', compact({
|
|
168
|
+
ext, action,
|
|
169
|
+
consumer_gaii: pick(s.consumerGaii, s.consumer_gaii),
|
|
170
|
+
new_price_per_call: pick(s.newPricePerCall, s.new_price_per_call),
|
|
171
|
+
new_cap_units: pick(s.newCapUnits, s.new_cap_units),
|
|
172
|
+
note: s.note,
|
|
173
|
+
}), 'Failed to propose new terms');
|
|
174
|
+
return d.proposal;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** The COUNTERPARTY accepts → the old contract is archived and a new one minted at the new terms. */
|
|
178
|
+
export function acceptProposal(id) {
|
|
179
|
+
return send('/v1/exchange/proposals/' + enc(id) + '/accept', 'POST', {}, 'Failed to accept the proposal');
|
|
180
|
+
}
|
|
181
|
+
/** The counterparty declines — the contract is unchanged. */
|
|
182
|
+
export function declineProposal(id) {
|
|
183
|
+
return send('/v1/exchange/proposals/' + enc(id) + '/decline', 'POST', {}, 'Failed to decline the proposal');
|
|
184
|
+
}
|
|
185
|
+
/** The PROPOSER withdraws their own pending proposal. */
|
|
186
|
+
export function withdrawProposal(id) {
|
|
187
|
+
return send('/v1/exchange/proposals/' + enc(id) + '/withdraw', 'POST', {}, 'Failed to withdraw the proposal');
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// ── Agent work (the async surface — settled per delivered task) ───────────────
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Start a task under an agent-work contract. Nothing is charged yet: the per-task price is metered
|
|
194
|
+
* when the provider DELIVERS. Without an active contract this is refused with `NO_CONTRACT` (402).
|
|
195
|
+
* @param {{ offeringId: string, input?: any, note?: string }} spec
|
|
196
|
+
* @returns {Promise<any>} The open work item.
|
|
197
|
+
*/
|
|
198
|
+
export async function startWork(spec) {
|
|
199
|
+
const s = /** @type {Record<string, any>} */ (spec || {});
|
|
200
|
+
const d = await send('/v1/exchange/work', 'POST', compact({
|
|
201
|
+
offering_id: pick(s.offeringId, s.offering_id), input: s.input, note: s.note,
|
|
202
|
+
}), 'Failed to start the work');
|
|
203
|
+
return d.work;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Deliver a task you were commissioned for → settle on delivery (the consumer is charged, you are
|
|
208
|
+
* credited its cut, the rake routed, the budget decremented).
|
|
209
|
+
* @param {string} id
|
|
210
|
+
* @param {{ output?: any, note?: string }} [spec]
|
|
211
|
+
* @returns {Promise<any>} The delivered work item.
|
|
212
|
+
*/
|
|
213
|
+
export async function deliverWork(id, spec) {
|
|
214
|
+
const s = /** @type {Record<string, any>} */ (spec || {});
|
|
215
|
+
const d = await send('/v1/exchange/work/' + enc(id) + '/deliver', 'POST',
|
|
216
|
+
compact({ output: s.output, note: s.note }), 'Failed to deliver the work');
|
|
217
|
+
return d.work;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Your agent-work items. `{ role: 'provider' }` for work commissioned FROM you; default is work you
|
|
222
|
+
* commissioned.
|
|
223
|
+
* @param {{ role?: 'consumer'|'provider' }} [opts]
|
|
224
|
+
* @returns {Promise<{ work: any[], count: number, role: string }>}
|
|
225
|
+
*/
|
|
226
|
+
export function work(opts) {
|
|
227
|
+
return authed('/v1/exchange/work' + qs({ role: opts && opts.role }), undefined, 'Failed to read your work items');
|
|
228
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file exchange/demand.js
|
|
3
|
+
* @description The DEMAND side of AIMEAT.exchange — an app says what it needs and cannot produce
|
|
4
|
+
* itself, providers bid, the requester accepts one and a contract is minted. A need is always
|
|
5
|
+
* posted on behalf of a specific app (`appId`), which is what turns a wish into a request a
|
|
6
|
+
* provider can judge: they can see who they would be serving before offering.
|
|
7
|
+
* @structure needs(opts) · postNeed(spec) · closeNeed(id) · bids(needId) · bid(needId, spec) ·
|
|
8
|
+
* acceptBid(needId, bidId, opts)
|
|
9
|
+
* @usage await AIMEAT.exchange.postNeed({ appId: 'alice/crm', description: '…', spec: { requiredFields: [...] } });
|
|
10
|
+
* @version-history
|
|
11
|
+
* v1.0.0 — 2026-07-28 — Initial (NOSTE prompt 02 — the EXCHANGE browser library, gap G19).
|
|
12
|
+
*/
|
|
13
|
+
import { authed, pub, send, qs } from './client.js';
|
|
14
|
+
|
|
15
|
+
const enc = encodeURIComponent;
|
|
16
|
+
|
|
17
|
+
function compact(obj) {
|
|
18
|
+
const out = {};
|
|
19
|
+
for (const k of Object.keys(obj)) if (obj[k] !== undefined) out[k] = obj[k];
|
|
20
|
+
return out;
|
|
21
|
+
}
|
|
22
|
+
function pick(...vals) {
|
|
23
|
+
for (const v of vals) if (v !== undefined && v !== null) return v;
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Browse needs. Public. Each is enriched with `appContext` — the requesting app's published name
|
|
29
|
+
* and description — so a provider judges the consumer, not just the ask.
|
|
30
|
+
* @param {{ open?: boolean, mine?: boolean }} [opts] `mine` requires a session.
|
|
31
|
+
* @returns {Promise<{ needs: any[], count: number }>}
|
|
32
|
+
*/
|
|
33
|
+
export function needs(opts) {
|
|
34
|
+
const o = opts || {};
|
|
35
|
+
const query = qs({ open: o.open ? '1' : null, mine: o.mine ? '1' : null });
|
|
36
|
+
return o.mine
|
|
37
|
+
? authed('/v1/exchange/needs' + query, undefined, 'Failed to read your needs')
|
|
38
|
+
: pub('/v1/exchange/needs' + query, 'Failed to browse needs');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Post an open need. `appId` is REQUIRED (`NEED_APP_REQUIRED` without it) — a need belongs to the
|
|
43
|
+
* app that will call the answer. The response carries `matches`: offerings that already satisfy it,
|
|
44
|
+
* so the requester can accept one directly instead of waiting for a bid.
|
|
45
|
+
* @param {{ appId: string, description: string, ext?: string, action?: string,
|
|
46
|
+
* spec?: { requiredFields?: string[], format?: string, sample?: string, notes?: string,
|
|
47
|
+
* inputSchema?: object, outputSchema?: object },
|
|
48
|
+
* usageIntent?: string, budgetUnit?: 'money'|'morsels', budgetCap?: number,
|
|
49
|
+
* autonomy?: 'supervised'|'auto' }} spec
|
|
50
|
+
* @returns {Promise<{ need: any, matches: any[] }>}
|
|
51
|
+
*/
|
|
52
|
+
export function postNeed(spec) {
|
|
53
|
+
const s = /** @type {Record<string, any>} */ (spec || {});
|
|
54
|
+
return send('/v1/exchange/needs', 'POST', compact({
|
|
55
|
+
app_id: pick(s.appId, s.app_id),
|
|
56
|
+
description: s.description,
|
|
57
|
+
ext: s.ext,
|
|
58
|
+
action: s.action,
|
|
59
|
+
spec: s.spec,
|
|
60
|
+
usage_intent: pick(s.usageIntent, s.usage_intent),
|
|
61
|
+
budget_unit: pick(s.budgetUnit, s.budget_unit),
|
|
62
|
+
budget_cap: pick(s.budgetCap, s.budget_cap),
|
|
63
|
+
autonomy: s.autonomy,
|
|
64
|
+
}), 'Failed to post the need');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Close one of your own needs. */
|
|
68
|
+
export function closeNeed(id) {
|
|
69
|
+
return send('/v1/exchange/needs/' + enc(id) + '/close', 'POST', {}, 'Failed to close the need');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** The bids on a need. Public — demand and the answers to it are both browsable. */
|
|
73
|
+
export function bids(needId) {
|
|
74
|
+
return pub('/v1/exchange/needs/' + enc(needId) + '/bids', 'Failed to read bids');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Bid on an open need with an action YOUR extension owns (anything else is refused, 403).
|
|
79
|
+
* @param {string} needId
|
|
80
|
+
* @param {{ ext: string, action: string, offeringId?: string, planId?: string, note?: string }} spec
|
|
81
|
+
* @returns {Promise<any>} The open bid.
|
|
82
|
+
*/
|
|
83
|
+
export async function bid(needId, spec) {
|
|
84
|
+
const s = /** @type {Record<string, any>} */ (spec || {});
|
|
85
|
+
const d = await send('/v1/exchange/needs/' + enc(needId) + '/bids', 'POST', compact({
|
|
86
|
+
ext: s.ext, action: s.action,
|
|
87
|
+
offering_id: pick(s.offeringId, s.offering_id),
|
|
88
|
+
plan_id: pick(s.planId, s.plan_id),
|
|
89
|
+
note: s.note,
|
|
90
|
+
}), 'Failed to place the bid');
|
|
91
|
+
return d.bid;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The REQUESTER accepts a bid → the entitlement is minted (consumer = requester, provider = bidder)
|
|
96
|
+
* at the provider's authoritative price, and the need is marked matched.
|
|
97
|
+
* @param {string} needId
|
|
98
|
+
* @param {string} bidId
|
|
99
|
+
* @param {{ capUnits?: number }} [opts] Defaults to the need's own budget cap.
|
|
100
|
+
* @returns {Promise<any>}
|
|
101
|
+
*/
|
|
102
|
+
export function acceptBid(needId, bidId, opts) {
|
|
103
|
+
const o = /** @type {Record<string, any>} */ (opts || {});
|
|
104
|
+
return send('/v1/exchange/needs/' + enc(needId) + '/bids/' + enc(bidId) + '/accept', 'POST',
|
|
105
|
+
compact({ cap_units: pick(o.capUnits, o.cap_units) }), 'Failed to accept the bid');
|
|
106
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file exchange/earnings.js
|
|
3
|
+
* @description What the market OWES the caller. A money-priced metered call settles through the
|
|
4
|
+
* accrual rail: no per-call payment-processor charge and no custodial escrow — each call books the
|
|
5
|
+
* seller's net (price minus the platform rake) as a `pending` payable. This reads that book.
|
|
6
|
+
*
|
|
7
|
+
* What it deliberately is NOT: a payout, an invoice, or a way to mark something settled. The
|
|
8
|
+
* figure is made READABLE here; moving money is a later phase, and a browser library that implied
|
|
9
|
+
* otherwise would be making a promise about money that nothing behind it keeps.
|
|
10
|
+
*
|
|
11
|
+
* SECURITY: no payment credentials pass through here in either direction. A seller's PSP
|
|
12
|
+
* configuration is server-side and never readable; this call returns amounts and buyers, nothing
|
|
13
|
+
* that could be used to charge anyone.
|
|
14
|
+
* @structure earnings(opts)
|
|
15
|
+
* @usage const e = await AIMEAT.exchange.earnings(); // e.currencies.EUR.pending
|
|
16
|
+
* @version-history
|
|
17
|
+
* v1.0.0 — 2026-07-28 — Initial (NOSTE prompt 02 — the EXCHANGE browser library, gap G19).
|
|
18
|
+
*/
|
|
19
|
+
import { authed, qs } from './client.js';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The caller's own accrued earnings, per currency, with the per-entry breakdown behind the figure.
|
|
23
|
+
*
|
|
24
|
+
* Returns `{ seller, currencies: { EUR: { pending, settled, total, entries } }, entries: [{
|
|
25
|
+
* tracking_code, amount, currency, method, status, at, reference, buyer }], count, note }`.
|
|
26
|
+
* Amounts are NET of the platform rake, in the currency's integer micro-units — format them with
|
|
27
|
+
* {@link module:exchange/format.fmtUnit}, never by dividing by hand.
|
|
28
|
+
*
|
|
29
|
+
* `pending` means booked as owed and not yet paid out. Owner-scoped by the server on the money
|
|
30
|
+
* identity, so an owner's agent or a granted app reads the OWNER's earnings and never another
|
|
31
|
+
* seller's; a non-owner principal needs the `wallet:read` scope.
|
|
32
|
+
* @param {{ status?: 'pending'|'settled', currency?: string, limit?: number }} [opts]
|
|
33
|
+
* @returns {Promise<any>}
|
|
34
|
+
*/
|
|
35
|
+
export function earnings(opts) {
|
|
36
|
+
const o = opts || {};
|
|
37
|
+
return authed('/v1/exchange/earnings' + qs({ status: o.status, currency: o.currency, limit: o.limit }),
|
|
38
|
+
undefined, 'Failed to read your earnings');
|
|
39
|
+
}
|