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
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file game/i18n.js
|
|
3
|
+
* @description Translation for the aimeat-game kit's OWN handful of strings, and the merge point
|
|
4
|
+
* for the host's. The kit ships English and Finnish for the words it puts on screen itself
|
|
5
|
+
* (Close, Back, Locked, Coming soon, …); everything else — every label in your game — comes from
|
|
6
|
+
* the host, because the kit has no idea what your entries are called.
|
|
7
|
+
*
|
|
8
|
+
* The Finnish is written as Finnish, not as translated English.
|
|
9
|
+
*
|
|
10
|
+
* It follows the PLATFORM language choice rather than inventing a second one: the current
|
|
11
|
+
* language is read from AIMEAT.auth.getLang() when the auth library is present, else the
|
|
12
|
+
* `aimeat-lang` storage key, else the browser, and it re-renders on the platform's
|
|
13
|
+
* `aimeat-lang-change` event. There is no language switch in this kit — the login pill has one.
|
|
14
|
+
* @structure BASE (en/fi) · lang/setLang · use(dict) · t(key, vars) · onChange
|
|
15
|
+
* @usage AIMEAT.game.i18n.use({ fi: { play: 'Pelaa' }, en: { play: 'Play' } });
|
|
16
|
+
* AIMEAT.game.i18n.t('play');
|
|
17
|
+
* @version-history
|
|
18
|
+
* v1.0.0 — 2026-07-28 — Initial (NOSTE prompt 01).
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/** The kit's own strings. A host dictionary of the same shape is merged over this. */
|
|
22
|
+
const BASE = {
|
|
23
|
+
en: {
|
|
24
|
+
close: 'Close',
|
|
25
|
+
back: 'Back',
|
|
26
|
+
cancel: 'Cancel',
|
|
27
|
+
confirm: 'Confirm',
|
|
28
|
+
menu: 'Menu',
|
|
29
|
+
locked: 'Locked',
|
|
30
|
+
done: 'Done',
|
|
31
|
+
open: 'Open',
|
|
32
|
+
now: 'Now',
|
|
33
|
+
later: 'Later',
|
|
34
|
+
comingSoon: 'Coming soon',
|
|
35
|
+
notifyMe: 'Tell me when this opens',
|
|
36
|
+
notified: 'We will tell you',
|
|
37
|
+
eta: 'Expected {when}',
|
|
38
|
+
empty: 'Nothing here yet',
|
|
39
|
+
nobodyYet: 'No one on the board yet — the first entry sets the mark',
|
|
40
|
+
you: 'You',
|
|
41
|
+
total: 'Total',
|
|
42
|
+
points: '{a} / {b}',
|
|
43
|
+
earned: 'Earned',
|
|
44
|
+
notEarned: 'Not earned yet',
|
|
45
|
+
earnedOn: 'Earned {when}',
|
|
46
|
+
best: 'Best {n}',
|
|
47
|
+
inARow: '{n} in a row',
|
|
48
|
+
sortBy: 'Sort by',
|
|
49
|
+
morsels: 'morsels',
|
|
50
|
+
target: 'Target {n}',
|
|
51
|
+
fix: 'Fix this',
|
|
52
|
+
},
|
|
53
|
+
fi: {
|
|
54
|
+
close: 'Sulje',
|
|
55
|
+
back: 'Takaisin',
|
|
56
|
+
cancel: 'Peruuta',
|
|
57
|
+
confirm: 'Vahvista',
|
|
58
|
+
menu: 'Valikko',
|
|
59
|
+
locked: 'Lukossa',
|
|
60
|
+
done: 'Tehty',
|
|
61
|
+
open: 'Auki',
|
|
62
|
+
now: 'Nyt',
|
|
63
|
+
later: 'Myöhemmin',
|
|
64
|
+
comingSoon: 'Tulossa',
|
|
65
|
+
notifyMe: 'Kerro kun tämä aukeaa',
|
|
66
|
+
notified: 'Ilmoitamme sinulle',
|
|
67
|
+
eta: 'Arvio {when}',
|
|
68
|
+
empty: 'Täällä ei ole vielä mitään',
|
|
69
|
+
nobodyYet: 'Taululla ei ole vielä ketään — ensimmäinen asettaa rajan',
|
|
70
|
+
you: 'Sinä',
|
|
71
|
+
total: 'Yhteensä',
|
|
72
|
+
points: '{a} / {b}',
|
|
73
|
+
earned: 'Ansaittu',
|
|
74
|
+
notEarned: 'Vielä ansaitsematta',
|
|
75
|
+
earnedOn: 'Ansaittu {when}',
|
|
76
|
+
best: 'Paras {n}',
|
|
77
|
+
inARow: '{n} peräkkäin',
|
|
78
|
+
sortBy: 'Järjestys',
|
|
79
|
+
morsels: 'morselia',
|
|
80
|
+
target: 'Tavoite {n}',
|
|
81
|
+
fix: 'Korjaa tämä',
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** Host dictionaries merged in by `use()`, keyed by language. */
|
|
86
|
+
const HOST = { en: {}, fi: {} };
|
|
87
|
+
|
|
88
|
+
/** @type {Array<(lang: string) => void>} */
|
|
89
|
+
const listeners = [];
|
|
90
|
+
|
|
91
|
+
let current = detect();
|
|
92
|
+
|
|
93
|
+
/** Resolve the platform language: auth library → storage key → browser → 'en'. */
|
|
94
|
+
function detect() {
|
|
95
|
+
try {
|
|
96
|
+
const ns = /** @type {any} */ (window).AIMEAT;
|
|
97
|
+
if (ns && ns.auth && typeof ns.auth.getLang === 'function') {
|
|
98
|
+
const l = ns.auth.getLang();
|
|
99
|
+
if (l) return String(l).slice(0, 2);
|
|
100
|
+
}
|
|
101
|
+
const stored = localStorage.getItem('aimeat-lang');
|
|
102
|
+
if (stored) return stored.slice(0, 2);
|
|
103
|
+
} catch { /* storage blocked — fall through to the browser */ }
|
|
104
|
+
return (navigator.language || 'en').slice(0, 2);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** @param {string} lang */
|
|
108
|
+
function announce(lang) {
|
|
109
|
+
for (const cb of listeners.slice()) {
|
|
110
|
+
try { cb(lang); } catch { /* one bad listener never stops the rest */ }
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (typeof window !== 'undefined') {
|
|
115
|
+
window.addEventListener('aimeat-lang-change', function (ev) {
|
|
116
|
+
const detail = /** @type {any} */ (ev).detail;
|
|
117
|
+
const lang = (detail && detail.lang) || detect();
|
|
118
|
+
if (lang === current) return;
|
|
119
|
+
current = String(lang).slice(0, 2);
|
|
120
|
+
announce(current);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export const i18n = {
|
|
125
|
+
/** The languages the kit itself ships. A host may add more via `use()`. */
|
|
126
|
+
langs: ['en', 'fi'],
|
|
127
|
+
|
|
128
|
+
/** The language in force right now. @returns {string} */
|
|
129
|
+
lang() { return current; },
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Set the language for the kit AND the platform (one key, `aimeat-lang`, shared with the site).
|
|
133
|
+
* @param {string} lang
|
|
134
|
+
*/
|
|
135
|
+
setLang(lang) {
|
|
136
|
+
const next = String(lang).slice(0, 2);
|
|
137
|
+
if (next === current) return;
|
|
138
|
+
current = next;
|
|
139
|
+
try {
|
|
140
|
+
const ns = /** @type {any} */ (window).AIMEAT;
|
|
141
|
+
if (ns && ns.auth && typeof ns.auth.setLang === 'function') ns.auth.setLang(next);
|
|
142
|
+
else localStorage.setItem('aimeat-lang', next);
|
|
143
|
+
} catch { /* storage blocked — the in-memory language still changed */ }
|
|
144
|
+
announce(current);
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Merge the host's dictionary over the kit's. Either `{ en: {...}, fi: {...} }` or a flat
|
|
149
|
+
* object for the current language.
|
|
150
|
+
* @param {Record<string, any>} dict
|
|
151
|
+
*/
|
|
152
|
+
use(dict) {
|
|
153
|
+
if (!dict) return;
|
|
154
|
+
const looksNested = Object.keys(dict).every(function (k) {
|
|
155
|
+
return dict[k] && typeof dict[k] === 'object' && !Array.isArray(dict[k]);
|
|
156
|
+
});
|
|
157
|
+
if (looksNested) {
|
|
158
|
+
for (const lang in dict) {
|
|
159
|
+
HOST[lang] = Object.assign({}, HOST[lang] || {}, dict[lang]);
|
|
160
|
+
}
|
|
161
|
+
} else {
|
|
162
|
+
HOST[current] = Object.assign({}, HOST[current] || {}, dict);
|
|
163
|
+
}
|
|
164
|
+
announce(current);
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Look up a string: host(current) → kit(current) → kit(en) → the key itself. `{name}` in the
|
|
169
|
+
* text is replaced from `vars`.
|
|
170
|
+
* @param {string} key
|
|
171
|
+
* @param {Record<string, any>} [vars]
|
|
172
|
+
* @returns {string}
|
|
173
|
+
*/
|
|
174
|
+
t(key, vars) {
|
|
175
|
+
const text = (HOST[current] && HOST[current][key])
|
|
176
|
+
|| (BASE[current] && BASE[current][key])
|
|
177
|
+
|| (HOST.en && HOST.en[key])
|
|
178
|
+
|| BASE.en[key]
|
|
179
|
+
|| key;
|
|
180
|
+
if (!vars) return String(text);
|
|
181
|
+
return String(text).replace(/\{(\w+)\}/g, function (whole, name) {
|
|
182
|
+
return vars[name] == null ? whole : String(vars[name]);
|
|
183
|
+
});
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Run a callback whenever the language changes (host `use()` counts — new words arrived).
|
|
188
|
+
* @param {(lang: string) => void} cb
|
|
189
|
+
* @returns {() => void} stop listening
|
|
190
|
+
*/
|
|
191
|
+
onChange(cb) {
|
|
192
|
+
listeners.push(cb);
|
|
193
|
+
return function () {
|
|
194
|
+
const i = listeners.indexOf(cb);
|
|
195
|
+
if (i >= 0) listeners.splice(i, 1);
|
|
196
|
+
};
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
/** Shorthand used inside the kit's own components. @type {(key: string, vars?: any) => string} */
|
|
201
|
+
export const t = i18n.t;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file game/index.js
|
|
3
|
+
* @description The aimeat-game library (NOSTE prompt 01). Exposes AIMEAT.game — a general-purpose
|
|
4
|
+
* gamification UI kit: full-screen menus, screens, overlays, progression rails and meters, the
|
|
5
|
+
* clickable score breakdown, badges, coming-soon cards, counters, streaks, leaderboards, stat
|
|
6
|
+
* grids, tables and showcase cards. Load one script and an app has game-grade UI without
|
|
7
|
+
* writing any of it.
|
|
8
|
+
*
|
|
9
|
+
* IT IS A LIBRARY, NOT A GAME. Nothing here assumes a particular one. The test every component
|
|
10
|
+
* had to pass: would a quiz app, an onboarding streak, a training tracker and a business
|
|
11
|
+
* simulation all use this? Anything only one of them would want lives in that app instead.
|
|
12
|
+
*
|
|
13
|
+
* IT RENDERS; IT DOES NOT FETCH. There is no network call anywhere in this library — it imports
|
|
14
|
+
* neither `_core/session.js` nor `_core/config.js`, holds no state beyond what it was last told,
|
|
15
|
+
* and reports events rather than acting on them. A component that called an API would have the
|
|
16
|
+
* wrong boundary.
|
|
17
|
+
*
|
|
18
|
+
* THE LOOK IS NOT BAKED IN. Every colour, radius, shadow, font, density and motion value is a
|
|
19
|
+
* `--ag-*` custom property declared in /lib/aimeat-game.css, which IS the theming contract. A
|
|
20
|
+
* skin sets those variables and nothing else; switching one changes no JavaScript. Light is the
|
|
21
|
+
* default and `:root[data-theme="dark"]` carries dark, so both work out of the box.
|
|
22
|
+
* @structure imports the component modules (dom · i18n · units · menu · screen · overlay ·
|
|
23
|
+
* progress · score · markers · board), composes the AIMEAT.game surface, attaches it via
|
|
24
|
+
* _core/namespace.
|
|
25
|
+
* @usage
|
|
26
|
+
* <script src="/v1/libs/aimeat-game.js"></script>
|
|
27
|
+
* AIMEAT.game.injectStyle();
|
|
28
|
+
* AIMEAT.game.menu({ title: 'Chapters', entries, onPick(e) { … } });
|
|
29
|
+
* @version-history
|
|
30
|
+
* v1.3.0 — 2026-07-28 — Menu entries are role="menuitem" elements (a <button> box will not grow
|
|
31
|
+
* with a nested multi-line child, so two-line labels spilled over their own border); Enter and
|
|
32
|
+
* Space moved to the list handler; menu({ full, head }) options.
|
|
33
|
+
* v1.0.0 — 2026-07-28 — Initial: the general-purpose gamification UI kit (NOSTE prompt 01 / requirements R-K3).
|
|
34
|
+
*/
|
|
35
|
+
import { attach } from '../_core/namespace.js';
|
|
36
|
+
import { el, append, $, $$, clear, uid, busy, guardButtons, whileBusy, injectStyle, reducedMotion } from './dom.js';
|
|
37
|
+
import { i18n } from './i18n.js';
|
|
38
|
+
import { money, morsels, isMoneyCurrency, MONEY_UNIT } from './units.js';
|
|
39
|
+
import { menu } from './menu.js';
|
|
40
|
+
import { screen } from './screen.js';
|
|
41
|
+
import { modal, toast, confirm } from './overlay.js';
|
|
42
|
+
import { rail, meter, counter, streak } from './progress.js';
|
|
43
|
+
import { scoreBreakdown } from './score.js';
|
|
44
|
+
import { badge, comingSoon } from './markers.js';
|
|
45
|
+
import { leaderboard, statGrid, dataTable, card } from './board.js';
|
|
46
|
+
|
|
47
|
+
const game = {
|
|
48
|
+
/**
|
|
49
|
+
* The library version, so an app can require a floor before using a newer component — and so
|
|
50
|
+
* an app that prints it (EXCHANGE LAB does) is not showing a number from three releases ago.
|
|
51
|
+
* It MUST match the newest entry in the /lib/aimeat-game.css version history; e2e-libs.ts
|
|
52
|
+
* fails when the two drift, because a version string that never moves is worse than none.
|
|
53
|
+
*/
|
|
54
|
+
version: '1.3.0',
|
|
55
|
+
|
|
56
|
+
// ── Shell and navigation ──
|
|
57
|
+
menu, screen, modal, toast, confirm,
|
|
58
|
+
|
|
59
|
+
// ── Progression ──
|
|
60
|
+
rail, meter, scoreBreakdown, badge, comingSoon, counter, streak,
|
|
61
|
+
|
|
62
|
+
// ── Competition and tables ──
|
|
63
|
+
leaderboard, statGrid, dataTable, card,
|
|
64
|
+
|
|
65
|
+
// ── Units (money and morsels never render in one figure) ──
|
|
66
|
+
money, morsels, isMoneyCurrency, MONEY_UNIT,
|
|
67
|
+
|
|
68
|
+
// ── Theme, i18n, helpers ──
|
|
69
|
+
injectStyle, i18n, el, append, $, $$, clear, uid, busy, whileBusy, guardButtons, reducedMotion,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
attach('game', game);
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file game/markers.js
|
|
3
|
+
* @description Two cards that mark a state rather than a value: the badge (a thing earned) and
|
|
4
|
+
* the coming-soon card (a thing deliberately not built yet).
|
|
5
|
+
*
|
|
6
|
+
* AN UNEARNED BADGE IS NOT A FAILURE. It is drawn as an open, dashed seal with no cross and no
|
|
7
|
+
* red — the difference between "not yet" and "you lost" is the whole emotional content of the
|
|
8
|
+
* component, and getting it wrong makes an app feel punishing.
|
|
9
|
+
*
|
|
10
|
+
* COMING SOON MUST READ AS INTENTIONAL. Every product grows a few of these, and the difference
|
|
11
|
+
* between a roadmap and a broken app is entirely in how this behaves: a planned chip, a
|
|
12
|
+
* full-strength card, a real sentence about what it will be — and NO dead link, no clickable
|
|
13
|
+
* path into an empty screen, no greyed-out button that looks like a bug. The only control it
|
|
14
|
+
* ever renders is a genuine "tell me when this opens", and only when the host supplied a
|
|
15
|
+
* handler for it.
|
|
16
|
+
* @structure badge(spec) · comingSoon(spec)
|
|
17
|
+
* @usage AIMEAT.game.comingSoon({ title: 'Agent incubator',
|
|
18
|
+
* description: 'Your agents will run the venture while you sleep.',
|
|
19
|
+
* eta: 'Q4', notify: { onNotify: () => save() } });
|
|
20
|
+
* @version-history
|
|
21
|
+
* v1.0.0 — 2026-07-28 — Initial (NOSTE prompt 01).
|
|
22
|
+
*/
|
|
23
|
+
import { el, clear, whileBusy } from './dom.js';
|
|
24
|
+
import { t, i18n } from './i18n.js';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* An earned marker.
|
|
28
|
+
* @param {{
|
|
29
|
+
* title: string, description?: string, earned?: boolean,
|
|
30
|
+
* earnedAt?: string|number|Date, glyph?: string
|
|
31
|
+
* }} spec
|
|
32
|
+
* @returns {{ el: HTMLElement, set: (patch: any) => void, destroy: () => void }}
|
|
33
|
+
*/
|
|
34
|
+
export function badge(spec) {
|
|
35
|
+
const state = {
|
|
36
|
+
title: spec.title,
|
|
37
|
+
description: spec.description,
|
|
38
|
+
earned: !!spec.earned,
|
|
39
|
+
earnedAt: spec.earnedAt,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const seal = el('span', { class: 'ag-badge__seal', 'aria-hidden': 'true' });
|
|
43
|
+
const name = el('span', { class: 'ag-badge__name' });
|
|
44
|
+
const desc = el('span', { class: 'ag-badge__desc' });
|
|
45
|
+
const when = el('span', { class: 'ag-badge__when' });
|
|
46
|
+
const text = el('span', {}, [name, desc, when]);
|
|
47
|
+
const root = el('div', { class: 'ag-root ag-badge' }, [seal, text]);
|
|
48
|
+
|
|
49
|
+
/** A date the viewer's locale understands, or the string the host already formatted. */
|
|
50
|
+
function whenText() {
|
|
51
|
+
if (!state.earned) return t('notEarned');
|
|
52
|
+
if (state.earnedAt == null) return t('earned');
|
|
53
|
+
const d = state.earnedAt instanceof Date ? state.earnedAt : new Date(state.earnedAt);
|
|
54
|
+
const shown = Number.isNaN(d.getTime()) ? String(state.earnedAt) : d.toLocaleDateString(i18n.lang());
|
|
55
|
+
return t('earnedOn', { when: shown });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function render() {
|
|
59
|
+
root.className = 'ag-root ag-badge' + (state.earned ? ' ag-badge--earned' : '');
|
|
60
|
+
seal.textContent = state.earned ? (spec.glyph || '✓') : '';
|
|
61
|
+
name.textContent = state.title;
|
|
62
|
+
desc.textContent = state.description || '';
|
|
63
|
+
desc.hidden = !state.description;
|
|
64
|
+
when.textContent = whenText();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const stopLang = i18n.onChange(render);
|
|
68
|
+
render();
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
el: root,
|
|
72
|
+
/** @param {{ earned?: boolean, earnedAt?: any, title?: string, description?: string }} patch */
|
|
73
|
+
set(patch) {
|
|
74
|
+
if (!patch) return;
|
|
75
|
+
if (patch.earned != null) state.earned = !!patch.earned;
|
|
76
|
+
if (patch.earnedAt !== undefined) state.earnedAt = patch.earnedAt;
|
|
77
|
+
if (patch.title != null) state.title = patch.title;
|
|
78
|
+
if (patch.description !== undefined) state.description = patch.description;
|
|
79
|
+
render();
|
|
80
|
+
},
|
|
81
|
+
destroy() { stopLang(); if (root.parentNode) root.parentNode.removeChild(root); },
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* A stage that is planned, not broken.
|
|
87
|
+
* @param {{
|
|
88
|
+
* title: string, description: string, eta?: string, chipLabel?: string,
|
|
89
|
+
* notify?: { label?: string, doneLabel?: string, onNotify: () => any, already?: boolean }
|
|
90
|
+
* }} spec
|
|
91
|
+
* @returns {{ el: HTMLElement, set: (patch: any) => void, destroy: () => void }}
|
|
92
|
+
*/
|
|
93
|
+
export function comingSoon(spec) {
|
|
94
|
+
const state = {
|
|
95
|
+
title: spec.title,
|
|
96
|
+
description: spec.description,
|
|
97
|
+
eta: spec.eta,
|
|
98
|
+
notified: !!(spec.notify && spec.notify.already),
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const name = el('h3', { class: 'ag-title' });
|
|
102
|
+
const chip = el('span', { class: 'ag-chip ag-chip--info' });
|
|
103
|
+
const top = el('div', { class: 'ag-soon__top' }, [name, chip]);
|
|
104
|
+
const what = el('p', { class: 'ag-soon__what' });
|
|
105
|
+
const foot = el('div', { class: 'ag-soon__foot' });
|
|
106
|
+
const root = el('div', { class: 'ag-root ag-card ag-soon' }, [top, what, foot]);
|
|
107
|
+
|
|
108
|
+
function render() {
|
|
109
|
+
name.textContent = state.title;
|
|
110
|
+
chip.textContent = spec.chipLabel || t('comingSoon');
|
|
111
|
+
what.textContent = state.description;
|
|
112
|
+
|
|
113
|
+
clear(foot);
|
|
114
|
+
if (state.eta) foot.appendChild(el('span', { class: 'ag-soon__eta', text: t('eta', { when: state.eta }) }));
|
|
115
|
+
if (!spec.notify) return;
|
|
116
|
+
if (state.notified) {
|
|
117
|
+
foot.appendChild(el('span', { class: 'ag-chip ag-chip--ok', text: '✓ ' + (spec.notify.doneLabel || t('notified')) }));
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
foot.appendChild(el('button', {
|
|
121
|
+
type: 'button', class: 'ag-btn',
|
|
122
|
+
on: {
|
|
123
|
+
click: function (ev) {
|
|
124
|
+
const btn = /** @type {HTMLElement} */ (ev.currentTarget);
|
|
125
|
+
whileBusy(btn, spec.notify ? spec.notify.onNotify() : null).then(function () {
|
|
126
|
+
state.notified = true;
|
|
127
|
+
render();
|
|
128
|
+
}).catch(function () { /* the host reports its own failure — the card stays as it was */ });
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
}, spec.notify.label || t('notifyMe')));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const stopLang = i18n.onChange(render);
|
|
135
|
+
render();
|
|
136
|
+
|
|
137
|
+
return {
|
|
138
|
+
el: root,
|
|
139
|
+
/** @param {{ title?: string, description?: string, eta?: string, notified?: boolean }} patch */
|
|
140
|
+
set(patch) {
|
|
141
|
+
if (!patch) return;
|
|
142
|
+
if (patch.title != null) state.title = patch.title;
|
|
143
|
+
if (patch.description != null) state.description = patch.description;
|
|
144
|
+
if (patch.eta !== undefined) state.eta = patch.eta;
|
|
145
|
+
if (patch.notified != null) state.notified = !!patch.notified;
|
|
146
|
+
render();
|
|
147
|
+
},
|
|
148
|
+
destroy() { stopLang(); if (root.parentNode) root.parentNode.removeChild(root); },
|
|
149
|
+
};
|
|
150
|
+
}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file game/menu.js
|
|
3
|
+
* @description The full-screen menu — the shell an app opens on. Entries carry a label, an
|
|
4
|
+
* optional sublabel, a state (`available` / `locked` / `done`), an optional badge and, when
|
|
5
|
+
* locked, a reason the viewer can read instead of guessing.
|
|
6
|
+
*
|
|
7
|
+
* A LOCKED ENTRY IS NOT A DEAD BUTTON. It stays readable, says why it is locked, and still
|
|
8
|
+
* reports the pick so the host can point the player at what unlocks it. That difference is the
|
|
9
|
+
* whole reason this is a component rather than a list of divs.
|
|
10
|
+
*
|
|
11
|
+
* NESTING replaces the list in place and leaves a back affordance (↩ and Escape), rather than
|
|
12
|
+
* stacking overlays — which is what keeps it correct at 1280x460 and on a phone.
|
|
13
|
+
*
|
|
14
|
+
* KEYBOARD: Up/Down/Home/End move, Enter/Space pick, Escape goes back one level and closes at
|
|
15
|
+
* the root. Focus follows navigation but never moves on a `set()`, so a live update cannot
|
|
16
|
+
* snatch the keyboard out of the player's hands.
|
|
17
|
+
* @structure menu(spec) → handle { el, set, open, close, path, destroy }
|
|
18
|
+
* @usage const m = AIMEAT.game.menu({ title: 'Chapters', entries, onPick(e) {…} });
|
|
19
|
+
* m.set({ entries: next }); // updates in place, keeps position and focus
|
|
20
|
+
* @version-history
|
|
21
|
+
* v1.0.0 — 2026-07-28 — Initial (NOSTE prompt 01).
|
|
22
|
+
*/
|
|
23
|
+
import { el, clear, resolve, uid } from './dom.js';
|
|
24
|
+
import { t, i18n } from './i18n.js';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {object} MenuEntry
|
|
28
|
+
* @property {string} id
|
|
29
|
+
* @property {string} label
|
|
30
|
+
* @property {string} [sublabel]
|
|
31
|
+
* @property {'available'|'locked'|'done'} [state]
|
|
32
|
+
* @property {string} [badge] Short marker shown on the right (a count, a level, a tag).
|
|
33
|
+
* @property {string} [lockReason] Shown under a locked entry — say what unlocks it.
|
|
34
|
+
* @property {MenuEntry[]} [entries] Nested submenu.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A full-screen menu.
|
|
39
|
+
* @param {{
|
|
40
|
+
* target?: string|Element, full?: boolean, head?: boolean, title: string, subtitle?: string, entries: MenuEntry[],
|
|
41
|
+
* onPick?: (entry: MenuEntry, path: string[]) => void,
|
|
42
|
+
* onClose?: () => void, closeLabel?: string, open?: boolean
|
|
43
|
+
* }} spec
|
|
44
|
+
* @returns {{ el: HTMLElement, set: (patch: any) => void, open: () => void, close: () => void,
|
|
45
|
+
* path: () => string[], destroy: () => void }}
|
|
46
|
+
*/
|
|
47
|
+
export function menu(spec) {
|
|
48
|
+
const state = {
|
|
49
|
+
title: spec.title,
|
|
50
|
+
subtitle: spec.subtitle,
|
|
51
|
+
entries: spec.entries || [],
|
|
52
|
+
/** @type {MenuEntry[]} the chain of opened submenus */
|
|
53
|
+
trail: [],
|
|
54
|
+
};
|
|
55
|
+
const titleId = uid('ag-menu-title');
|
|
56
|
+
|
|
57
|
+
const heading = el('h2', { class: 'ag-title', id: titleId });
|
|
58
|
+
const sub = el('p', { class: 'ag-menu__sub' });
|
|
59
|
+
const crumb = el('div', { class: 'ag-menu__crumb' });
|
|
60
|
+
const titles = el('div', { class: 'ag-menu__titles' }, [crumb, heading, sub]);
|
|
61
|
+
const closeBtn = el('button', {
|
|
62
|
+
type: 'button', class: 'ag-btn ag-btn--ghost',
|
|
63
|
+
on: { click: function () { api.close(); } },
|
|
64
|
+
}, spec.closeLabel || t('close'));
|
|
65
|
+
// `head: false` drops the title strip, for a host that already draws its own (a hub screen
|
|
66
|
+
// with a logo above the entries). The entries, the keyboard and the nesting are unchanged.
|
|
67
|
+
const head = spec.head === false ? null : el('div', { class: 'ag-menu__head' }, [titles, closeBtn]);
|
|
68
|
+
const list = el('div', {
|
|
69
|
+
class: 'ag-menu__list ag-scroll', role: 'menu', 'aria-labelledby': titleId,
|
|
70
|
+
on: { keydown: onKey },
|
|
71
|
+
});
|
|
72
|
+
// Full-screen by default; `full: false` fills the container it is mounted into instead, which is
|
|
73
|
+
// what a menu living inside a panel (or a documentation page) needs.
|
|
74
|
+
const full = spec.full !== false;
|
|
75
|
+
const root = el('div', {
|
|
76
|
+
class: 'ag-root ag-menu' + (full ? '' : ' ag-menu--inline') + (head ? '' : ' ag-menu--nohead'),
|
|
77
|
+
role: full ? 'dialog' : 'group',
|
|
78
|
+
'aria-modal': full ? 'true' : null,
|
|
79
|
+
'aria-labelledby': titleId,
|
|
80
|
+
}, head ? [head, list] : [list]);
|
|
81
|
+
|
|
82
|
+
const host = resolve(spec.target, document.body);
|
|
83
|
+
host.appendChild(root);
|
|
84
|
+
|
|
85
|
+
const stopLang = i18n.onChange(function () { render(false); });
|
|
86
|
+
|
|
87
|
+
/** The entries at the current depth. @returns {MenuEntry[]} */
|
|
88
|
+
function level() {
|
|
89
|
+
const last = state.trail[state.trail.length - 1];
|
|
90
|
+
return last ? (last.entries || []) : state.entries;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** @returns {string[]} the ids of the opened submenus, outermost first */
|
|
94
|
+
function pathIds() {
|
|
95
|
+
return state.trail.map(function (e) { return e.id; });
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** @param {boolean} moveFocus */
|
|
99
|
+
function render(moveFocus) {
|
|
100
|
+
const depth = state.trail.length;
|
|
101
|
+
const here = state.trail[depth - 1];
|
|
102
|
+
heading.textContent = here ? here.label : state.title;
|
|
103
|
+
const subText = here ? (here.sublabel || '') : (state.subtitle || '');
|
|
104
|
+
sub.textContent = subText;
|
|
105
|
+
sub.hidden = !subText;
|
|
106
|
+
|
|
107
|
+
clear(crumb);
|
|
108
|
+
if (depth) {
|
|
109
|
+
crumb.appendChild(el('button', {
|
|
110
|
+
type: 'button', class: 'ag-btn ag-btn--ghost',
|
|
111
|
+
on: { click: back },
|
|
112
|
+
}, '↩ ' + t('back')));
|
|
113
|
+
crumb.appendChild(el('span', { class: 'ag-label', text: state.title }));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
clear(list);
|
|
117
|
+
// With no head there is no crumb to go back from, so the way out becomes the first entry.
|
|
118
|
+
// Escape works either way, but a pointer user must never be stranded in a submenu.
|
|
119
|
+
if (!head && depth) {
|
|
120
|
+
list.appendChild(el('div', {
|
|
121
|
+
class: 'ag-menu__item ag-menu__item--back', role: 'menuitem', tabindex: '0',
|
|
122
|
+
on: { click: back },
|
|
123
|
+
}, el('div', { class: 'ag-menu__inner' }, el('span', {}, el('span', { class: 'ag-menu__label', text: '↩ ' + t('back') })))));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const entries = level();
|
|
127
|
+
if (!entries.length) {
|
|
128
|
+
list.appendChild(el('p', { class: 'ag-empty', text: t('empty') }));
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
for (const entry of entries) list.appendChild(item(entry));
|
|
132
|
+
if (moveFocus) {
|
|
133
|
+
const first = /** @type {HTMLElement|null} */ (list.querySelector('.ag-menu__item'));
|
|
134
|
+
if (first) first.focus();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @param {MenuEntry} entry
|
|
140
|
+
* @returns {HTMLElement}
|
|
141
|
+
*/
|
|
142
|
+
function item(entry) {
|
|
143
|
+
const st = entry.state || 'available';
|
|
144
|
+
const locked = st === 'locked';
|
|
145
|
+
const nested = !!(entry.entries && entry.entries.length);
|
|
146
|
+
const marks = el('div', { class: 'ag-menu__marks' });
|
|
147
|
+
if (entry.badge) marks.appendChild(el('span', { class: 'ag-chip ag-chip--accent', text: entry.badge }));
|
|
148
|
+
if (st === 'done') marks.appendChild(el('span', { class: 'ag-chip ag-chip--ok', text: '✓ ' + t('done') }));
|
|
149
|
+
if (locked) marks.appendChild(el('span', { class: 'ag-chip', text: t('locked') }));
|
|
150
|
+
if (nested && !locked) marks.appendChild(el('span', { class: 'ag-menu__arrow', text: '→', 'aria-hidden': 'true' }));
|
|
151
|
+
|
|
152
|
+
const body = el('span', {}, [
|
|
153
|
+
el('span', { class: 'ag-menu__label', text: entry.label }),
|
|
154
|
+
entry.sublabel ? el('span', { class: 'ag-menu__sublabel', text: entry.sublabel }) : null,
|
|
155
|
+
locked && entry.lockReason ? el('span', { class: 'ag-menu__reason', text: entry.lockReason }) : null,
|
|
156
|
+
]);
|
|
157
|
+
|
|
158
|
+
// NOT a <button>. A button's box refuses to grow with a nested multi-line child in Chrome,
|
|
159
|
+
// so a two-line entry spills over its own border at any display face the skin picks — which
|
|
160
|
+
// is exactly the kind of thing a library must not leave to the author to discover. A
|
|
161
|
+
// role=menuitem element sizes normally; Enter and Space are handled on the list.
|
|
162
|
+
return el('div', {
|
|
163
|
+
class: 'ag-menu__item' + (locked ? ' ag-menu__item--locked' : '') + (st === 'done' ? ' ag-menu__item--done' : ''),
|
|
164
|
+
role: 'menuitem',
|
|
165
|
+
tabindex: '0',
|
|
166
|
+
'data-ag-id': entry.id,
|
|
167
|
+
'aria-disabled': locked ? 'true' : null,
|
|
168
|
+
on: { click: function () { pick(entry); } },
|
|
169
|
+
}, el('div', { class: 'ag-menu__inner' }, [body, marks]));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** @param {MenuEntry} entry */
|
|
173
|
+
function pick(entry) {
|
|
174
|
+
const path = pathIds();
|
|
175
|
+
if (spec.onPick) spec.onPick(entry, path);
|
|
176
|
+
if ((entry.state || 'available') === 'locked') return;
|
|
177
|
+
if (entry.entries && entry.entries.length) {
|
|
178
|
+
state.trail.push(entry);
|
|
179
|
+
render(true);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function back() {
|
|
184
|
+
if (!state.trail.length) return api.close();
|
|
185
|
+
state.trail.pop();
|
|
186
|
+
render(true);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** @param {KeyboardEvent} ev */
|
|
190
|
+
function onKey(ev) {
|
|
191
|
+
if (ev.key === 'Escape') { ev.preventDefault(); back(); return; }
|
|
192
|
+
if (ev.key === 'Enter' || ev.key === ' ' || ev.key === 'Spacebar') {
|
|
193
|
+
const active = /** @type {HTMLElement|null} */ (document.activeElement);
|
|
194
|
+
if (active && active.classList.contains('ag-menu__item')) { ev.preventDefault(); active.click(); }
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const items = /** @type {HTMLElement[]} */ (Array.prototype.slice.call(list.querySelectorAll('.ag-menu__item')));
|
|
198
|
+
if (!items.length) return;
|
|
199
|
+
const at = items.indexOf(/** @type {HTMLElement} */ (document.activeElement));
|
|
200
|
+
let next = -1;
|
|
201
|
+
if (ev.key === 'ArrowDown' || ev.key === 'ArrowRight') next = at < 0 ? 0 : (at + 1) % items.length;
|
|
202
|
+
else if (ev.key === 'ArrowUp' || ev.key === 'ArrowLeft') next = at < 0 ? items.length - 1 : (at - 1 + items.length) % items.length;
|
|
203
|
+
else if (ev.key === 'Home') next = 0;
|
|
204
|
+
else if (ev.key === 'End') next = items.length - 1;
|
|
205
|
+
if (next < 0) return;
|
|
206
|
+
ev.preventDefault();
|
|
207
|
+
items[next].focus();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const api = {
|
|
211
|
+
el: root,
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Update in place. Position and focus are kept — a live update never moves the player.
|
|
215
|
+
* @param {{ title?: string, subtitle?: string, entries?: MenuEntry[] }} patch
|
|
216
|
+
*/
|
|
217
|
+
set(patch) {
|
|
218
|
+
if (!patch) return;
|
|
219
|
+
if (patch.title != null) state.title = patch.title;
|
|
220
|
+
if (patch.subtitle != null) state.subtitle = patch.subtitle;
|
|
221
|
+
if (patch.entries) {
|
|
222
|
+
state.entries = patch.entries;
|
|
223
|
+
// Re-resolve the open trail against the new data so a submenu survives its own update.
|
|
224
|
+
const ids = pathIds();
|
|
225
|
+
state.trail = [];
|
|
226
|
+
let scope = state.entries;
|
|
227
|
+
for (const id of ids) {
|
|
228
|
+
const found = scope.find(function (e) { return e.id === id; });
|
|
229
|
+
if (!found || !found.entries) break;
|
|
230
|
+
state.trail.push(found);
|
|
231
|
+
scope = found.entries;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
render(false);
|
|
235
|
+
},
|
|
236
|
+
|
|
237
|
+
open() {
|
|
238
|
+
root.hidden = false;
|
|
239
|
+
render(true);
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
close() {
|
|
243
|
+
root.hidden = true;
|
|
244
|
+
if (spec.onClose) spec.onClose();
|
|
245
|
+
},
|
|
246
|
+
|
|
247
|
+
path() { return pathIds(); },
|
|
248
|
+
|
|
249
|
+
destroy() {
|
|
250
|
+
stopLang();
|
|
251
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
root.hidden = spec.open === false;
|
|
256
|
+
// A full-screen menu takes focus on arrival, because it IS the screen. An inline one does not:
|
|
257
|
+
// stealing focus into a panel would scroll the host page out from under the reader.
|
|
258
|
+
render(full && spec.open !== false);
|
|
259
|
+
return api;
|
|
260
|
+
}
|