aimeat 2.1.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 +57 -16
- package/dist/locales/en.json +277 -369
- package/dist/locales/fi.json +281 -373
- 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/cortex-bundled/aimeat-charts.js +158 -10
- package/dist/public/cortex-bundled/aimeat-charts.yaml +1 -1
- package/dist/public/cortex-bundled/aimeat-dag.js +515 -173
- package/dist/public/cortex-bundled/aimeat-dag.yaml +1 -1
- package/dist/public/cortex-bundled/aimeat-i18n.js +6 -1
- package/dist/public/cortex-bundled/aimeat-i18n.yaml +1 -1
- package/dist/public/cortex-bundled/aimeat-surface.js +577 -0
- package/dist/public/cortex-bundled/aimeat-surface.yaml +107 -0
- package/dist/public/cortex-bundled/aimeat-viewport.js +405 -0
- package/dist/public/cortex-bundled/aimeat-viewport.yaml +100 -0
- package/dist/public/css/theme.css +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/inbox.css +1 -1
- 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 +17 -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 +7 -3
- package/dist/public/lib/aimeat-daisyui-bridge.css +39 -2
- 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/aimeat-theme.css +538 -0
- package/dist/public/lib/fonts/LICENSE.md +11 -4
- package/dist/public/lib/fonts/fraunces-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/fraunces-var-latin.woff2 +0 -0
- package/dist/public/lib/fonts/inter-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/inter-var-latin.woff2 +0 -0
- package/dist/public/lib/fonts/jetbrains-mono-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/jetbrains-mono-var-latin.woff2 +0 -0
- package/dist/public/lib/fonts/space-grotesk-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/space-grotesk-var-latin.woff2 +0 -0
- package/dist/public/lib/pdfjs@6/pdf.min.mjs +29 -0
- package/dist/public/lib/pdfjs@6/pdf.worker.min.mjs +29 -0
- package/dist/public/lib/samples/theme-check.html +92 -0
- package/dist/public/lib/samples/themes-boot.js +20 -0
- package/dist/public/lib/samples/themes.html +154 -0
- package/dist/public/lib/samples/themes.js +60 -0
- package/dist/public/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 +152 -7
- 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 +6 -2
- 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 +30 -11
- package/dist/public/views/profile/inbox-tab/helpers.js +15 -1
- package/dist/public/views/profile/inbox-tab/use-thread-ux.js +30 -3
- 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/libraries-tab.js +10 -2
- 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 +106 -36
- 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-openapi.d.ts +2 -0
- package/dist/scripts/check-openapi.d.ts.map +1 -0
- package/dist/scripts/check-openapi.js +139 -0
- package/dist/scripts/check-openapi.js.map +1 -0
- package/dist/scripts/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/scripts/embed-viewport.d.ts +23 -0
- package/dist/scripts/embed-viewport.d.ts.map +1 -0
- package/dist/scripts/embed-viewport.js +116 -0
- package/dist/scripts/embed-viewport.js.map +1 -0
- package/dist/src/auth/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/auth/sse-domain-scopes.d.ts +50 -0
- package/dist/src/auth/sse-domain-scopes.d.ts.map +1 -0
- package/dist/src/auth/sse-domain-scopes.js +111 -0
- package/dist/src/auth/sse-domain-scopes.js.map +1 -0
- package/dist/src/cli/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/agent-tasks.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/agent-tasks.js +4 -1
- package/dist/src/cli/connect/mcp/tools/agent-tasks.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/core.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/core.js +14 -3
- package/dist/src/cli/connect/mcp/tools/core.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/workspaces.d.ts +3 -0
- package/dist/src/cli/connect/mcp/tools/workspaces.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/workspaces.js +6 -2
- 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-defs-core.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-core.js +13 -1
- package/dist/src/cli/connect/tool-call-defs-core.js.map +1 -1
- package/dist/src/cli/connect/tool-call-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/__tests__/x402-registry.test.d.ts +2 -0
- package/dist/src/commerce/__tests__/x402-registry.test.d.ts.map +1 -0
- package/dist/src/commerce/__tests__/x402-registry.test.js +105 -0
- package/dist/src/commerce/__tests__/x402-registry.test.js.map +1 -0
- package/dist/src/commerce/evm-address.d.ts +21 -0
- package/dist/src/commerce/evm-address.d.ts.map +1 -0
- package/dist/src/commerce/evm-address.js +94 -0
- package/dist/src/commerce/evm-address.js.map +1 -0
- package/dist/src/commerce/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/money.d.ts +18 -5
- package/dist/src/commerce/money.d.ts.map +1 -1
- package/dist/src/commerce/money.js +27 -6
- package/dist/src/commerce/money.js.map +1 -1
- package/dist/src/commerce/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 +64 -13
- package/dist/src/commerce/x402-facilitator.d.ts.map +1 -1
- package/dist/src/commerce/x402-facilitator.js +72 -19
- package/dist/src/commerce/x402-facilitator.js.map +1 -1
- package/dist/src/commerce/x402-handler.d.ts +13 -7
- package/dist/src/commerce/x402-handler.d.ts.map +1 -1
- package/dist/src/commerce/x402-handler.js +23 -10
- package/dist/src/commerce/x402-handler.js.map +1 -1
- package/dist/src/commerce/x402.d.ts +11 -6
- package/dist/src/commerce/x402.d.ts.map +1 -1
- package/dist/src/commerce/x402.js +10 -7
- package/dist/src/commerce/x402.js.map +1 -1
- package/dist/src/config-types.d.ts +78 -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 +70 -1
- package/dist/src/config.js.map +1 -1
- package/dist/src/data/app-templates/shells.d.ts +11 -3
- package/dist/src/data/app-templates/shells.d.ts.map +1 -1
- package/dist/src/data/app-templates/shells.js +87 -6
- package/dist/src/data/app-templates/shells.js.map +1 -1
- package/dist/src/data/app-templates.js +2 -2
- package/dist/src/data/app-templates.js.map +1 -1
- package/dist/src/data/library-packs/cortex.d.ts.map +1 -1
- package/dist/src/data/library-packs/cortex.js +108 -5
- package/dist/src/data/library-packs/cortex.js.map +1 -1
- package/dist/src/data/library-packs/sdk.d.ts +4 -0
- package/dist/src/data/library-packs/sdk.d.ts.map +1 -1
- package/dist/src/data/library-packs/sdk.js +78 -8
- package/dist/src/data/library-packs/sdk.js.map +1 -1
- package/dist/src/data/library-packs/vendored.d.ts.map +1 -1
- package/dist/src/data/library-packs/vendored.js +171 -6
- package/dist/src/data/library-packs/vendored.js.map +1 -1
- package/dist/src/generated/api-types.d.ts +949 -44
- 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/agent-tasks.d.ts +4 -0
- package/dist/src/mcp/agent-tasks.d.ts.map +1 -1
- package/dist/src/mcp/agent-tasks.js +20 -2
- package/dist/src/mcp/agent-tasks.js.map +1 -1
- package/dist/src/mcp/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 +7 -1
- package/dist/src/mcp/capabilities.d.ts.map +1 -1
- package/dist/src/mcp/capabilities.js +8 -4
- package/dist/src/mcp/capabilities.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/commerce.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/commerce.js +4 -2
- package/dist/src/mcp/catalog/definitions/commerce.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.js +4 -3
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/organisms-workspaces-apps.js +1 -1
- package/dist/src/mcp/catalog/definitions/organisms-workspaces-apps.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js +3 -2
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js.map +1 -1
- package/dist/src/mcp/catalog/output-schemas.d.ts +6 -1
- package/dist/src/mcp/catalog/output-schemas.d.ts.map +1 -1
- package/dist/src/mcp/catalog/output-schemas.js +6 -1
- package/dist/src/mcp/catalog/output-schemas.js.map +1 -1
- package/dist/src/mcp/catalog/scopes.d.ts +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 +50 -6
- package/dist/src/mcp/commerce.js.map +1 -1
- package/dist/src/mcp/core-storage.d.ts +23 -0
- package/dist/src/mcp/core-storage.d.ts.map +1 -0
- package/dist/src/mcp/core-storage.js +157 -0
- package/dist/src/mcp/core-storage.js.map +1 -0
- package/dist/src/mcp/core.d.ts +16 -0
- package/dist/src/mcp/core.d.ts.map +1 -1
- package/dist/src/mcp/core.js +78 -121
- package/dist/src/mcp/core.js.map +1 -1
- package/dist/src/mcp/dm-messages.d.ts +4 -0
- package/dist/src/mcp/dm-messages.d.ts.map +1 -1
- package/dist/src/mcp/dm-messages.js +43 -2
- package/dist/src/mcp/dm-messages.js.map +1 -1
- package/dist/src/mcp/exchange-run.d.ts +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 +12 -9
- 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 +66 -108
- package/dist/src/mcp/extensions.js.map +1 -1
- package/dist/src/mcp/index.d.ts +5 -0
- package/dist/src/mcp/index.d.ts.map +1 -1
- package/dist/src/mcp/index.js +24 -9
- 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/memory-namespace-hints.d.ts +33 -0
- package/dist/src/mcp/memory-namespace-hints.d.ts.map +1 -0
- package/dist/src/mcp/memory-namespace-hints.js +60 -0
- package/dist/src/mcp/memory-namespace-hints.js.map +1 -0
- package/dist/src/mcp/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 +5 -0
- package/dist/src/mcp/workspaces.d.ts.map +1 -1
- package/dist/src/mcp/workspaces.js +12 -7
- 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/agent-task-schemas.d.ts +25 -3
- package/dist/src/models/agent-task-schemas.d.ts.map +1 -1
- package/dist/src/models/agent-task-schemas.js +16 -0
- package/dist/src/models/agent-task-schemas.js.map +1 -1
- package/dist/src/models/app-tool-schemas.d.ts +553 -1
- package/dist/src/models/app-tool-schemas.d.ts.map +1 -1
- package/dist/src/models/app-tool-schemas.js +97 -1
- package/dist/src/models/app-tool-schemas.js.map +1 -1
- package/dist/src/models/odps-schemas.d.ts +305 -0
- package/dist/src/models/odps-schemas.d.ts.map +1 -0
- package/dist/src/models/odps-schemas.js +182 -0
- package/dist/src/models/odps-schemas.js.map +1 -0
- package/dist/src/models/offer-schemas.d.ts +357 -2
- package/dist/src/models/offer-schemas.d.ts.map +1 -1
- package/dist/src/models/offer-schemas.js +37 -0
- package/dist/src/models/offer-schemas.js.map +1 -1
- package/dist/src/models/schemas.d.ts +6 -3
- package/dist/src/models/schemas.d.ts.map +1 -1
- package/dist/src/models/schemas.js +10 -1
- package/dist/src/models/schemas.js.map +1 -1
- package/dist/src/models/webhook-schemas.d.ts +8 -8
- 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.d.ts +4 -0
- package/dist/src/routes/agent-tasks/create-read.d.ts.map +1 -1
- package/dist/src/routes/agent-tasks/create-read.js +23 -2
- 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 +38 -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 +2 -0
- package/dist/src/routes/agents/offers.d.ts.map +1 -1
- package/dist/src/routes/agents/offers.js +0 -0
- package/dist/src/routes/agents/offers.js.map +1 -1
- package/dist/src/routes/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 +13 -0
- package/dist/src/routes/app-grants.d.ts.map +1 -1
- package/dist/src/routes/app-grants.js +124 -29
- 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 +3 -0
- package/dist/src/routes/apps/drafts.d.ts.map +1 -1
- package/dist/src/routes/apps/drafts.js +65 -2
- 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 +2 -0
- package/dist/src/routes/apps/publish.d.ts.map +1 -1
- package/dist/src/routes/apps/publish.js +25 -5
- 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 +175 -5
- 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 +6 -2
- package/dist/src/routes/exchange-market.d.ts.map +1 -1
- package/dist/src/routes/exchange-market.js +163 -33
- 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 +349 -11
- 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 +65 -8
- package/dist/src/routes/extensions/actions.js.map +1 -1
- package/dist/src/routes/extensions/crud.d.ts.map +1 -1
- package/dist/src/routes/extensions/crud.js +36 -3
- package/dist/src/routes/extensions/crud.js.map +1 -1
- package/dist/src/routes/extensions/entitlement-gate.d.ts +44 -7
- package/dist/src/routes/extensions/entitlement-gate.d.ts.map +1 -1
- package/dist/src/routes/extensions/entitlement-gate.js +22 -130
- 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 +10 -0
- package/dist/src/routes/extensions/manifest.d.ts.map +1 -1
- package/dist/src/routes/extensions/manifest.js +136 -5
- 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 +62 -0
- package/dist/src/routes/extensions/pacing.d.ts.map +1 -0
- package/dist/src/routes/extensions/pacing.js +45 -0
- package/dist/src/routes/extensions/pacing.js.map +1 -0
- 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 +170 -21
- 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 +14 -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 +3 -0
- package/dist/src/routes/organisms/crud.d.ts.map +1 -1
- package/dist/src/routes/organisms/crud.js +8 -4
- 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 +11 -4
- 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 +7 -0
- package/dist/src/routes/public-stats.d.ts.map +1 -1
- package/dist/src/routes/public-stats.js +57 -17
- 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/sse.d.ts +7 -0
- package/dist/src/routes/sse.d.ts.map +1 -1
- package/dist/src/routes/sse.js +36 -6
- package/dist/src/routes/sse.js.map +1 -1
- package/dist/src/routes/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 +15 -0
- package/dist/src/routes/storage-files.d.ts.map +1 -1
- package/dist/src/routes/storage-files.js +69 -51
- package/dist/src/routes/storage-files.js.map +1 -1
- package/dist/src/routes/subdomains.d.ts +13 -0
- package/dist/src/routes/subdomains.d.ts.map +1 -1
- package/dist/src/routes/subdomains.js +106 -8
- 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 +22 -0
- package/dist/src/routes/upload.d.ts.map +1 -1
- package/dist/src/routes/upload.js +204 -34
- 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 +97 -46
- 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/schemas/knowledge-package.d.ts +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 +4 -0
- package/dist/src/server-bootstrap/static-files.d.ts.map +1 -1
- package/dist/src/server-bootstrap/static-files.js +14 -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-app-prompt.d.ts +19 -0
- package/dist/src/services/build-app-prompt.d.ts.map +1 -1
- package/dist/src/services/build-app-prompt.js +97 -11
- package/dist/src/services/build-app-prompt.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 +51 -0
- package/dist/src/services/call-timing.d.ts.map +1 -0
- package/dist/src/services/call-timing.js +92 -0
- package/dist/src/services/call-timing.js.map +1 -0
- package/dist/src/services/capability-invoke.d.ts +8 -1
- package/dist/src/services/capability-invoke.d.ts.map +1 -1
- package/dist/src/services/capability-invoke.js +24 -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 +7 -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/draft-token.d.ts +22 -2
- package/dist/src/services/draft-token.d.ts.map +1 -1
- package/dist/src/services/draft-token.js +52 -3
- package/dist/src/services/draft-token.js.map +1 -1
- package/dist/src/services/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 +88 -10
- package/dist/src/services/exchange-market.d.ts.map +1 -1
- package/dist/src/services/exchange-market.js +104 -11
- package/dist/src/services/exchange-market.js.map +1 -1
- package/dist/src/services/exchange-odps.d.ts +58 -0
- package/dist/src/services/exchange-odps.d.ts.map +1 -0
- package/dist/src/services/exchange-odps.js +400 -0
- package/dist/src/services/exchange-odps.js.map +1 -0
- package/dist/src/services/exchange-projection.d.ts +67 -0
- package/dist/src/services/exchange-projection.d.ts.map +1 -0
- package/dist/src/services/exchange-projection.js +629 -0
- package/dist/src/services/exchange-projection.js.map +1 -0
- package/dist/src/services/exchange-proposals.d.ts.map +1 -1
- package/dist/src/services/exchange-proposals.js +6 -2
- package/dist/src/services/exchange-proposals.js.map +1 -1
- package/dist/src/services/extension-files.d.ts +64 -0
- package/dist/src/services/extension-files.d.ts.map +1 -0
- package/dist/src/services/extension-files.js +88 -0
- package/dist/src/services/extension-files.js.map +1 -0
- package/dist/src/services/extension-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 +56 -1
- package/dist/src/services/extension-runtime.d.ts.map +1 -1
- package/dist/src/services/extension-runtime.js +73 -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/file-refs.d.ts +105 -0
- package/dist/src/services/file-refs.d.ts.map +1 -0
- package/dist/src/services/file-refs.js +106 -0
- package/dist/src/services/file-refs.js.map +1 -0
- package/dist/src/services/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 +147 -5
- package/dist/src/services/metered-entitlements.d.ts.map +1 -1
- package/dist/src/services/metered-entitlements.js +251 -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/owner-memory.d.ts +14 -1
- package/dist/src/services/owner-memory.d.ts.map +1 -1
- package/dist/src/services/owner-memory.js +8 -14
- package/dist/src/services/owner-memory.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/task-files.d.ts +51 -0
- package/dist/src/services/task-files.d.ts.map +1 -0
- package/dist/src/services/task-files.js +58 -0
- package/dist/src/services/task-files.js.map +1 -0
- package/dist/src/services/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-token.d.ts +29 -0
- package/dist/src/services/upload-token.d.ts.map +1 -1
- package/dist/src/services/upload-token.js +37 -0
- package/dist/src/services/upload-token.js.map +1 -1
- package/dist/src/services/upload-zip.d.ts +9 -0
- package/dist/src/services/upload-zip.d.ts.map +1 -1
- package/dist/src/services/upload-zip.js +19 -81
- 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-meta.d.ts +15 -0
- package/dist/src/services/workspace-meta.d.ts.map +1 -1
- package/dist/src/services/workspace-meta.js +17 -0
- package/dist/src/services/workspace-meta.js.map +1 -1
- package/dist/src/services/workspace-provision.d.ts +3 -0
- package/dist/src/services/workspace-provision.d.ts.map +1 -1
- package/dist/src/services/workspace-provision.js +5 -3
- package/dist/src/services/workspace-provision.js.map +1 -1
- package/dist/src/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 +2 -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 +16 -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/memory.d.ts +2 -0
- package/dist/src/storage/providers/postgres-kysely/methods/memory.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/memory.js +12 -1
- package/dist/src/storage/providers/postgres-kysely/methods/memory.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/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 +15 -15
- 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/0012_unique_live_app_grant.sql +29 -0
- 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 +4 -1
- package/dist/src/storage/providers/sqlite/methods/apps.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/apps.js +19 -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/governance.d.ts +1 -0
- package/dist/src/storage/providers/sqlite/methods/governance.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/governance.js +4 -1
- package/dist/src/storage/providers/sqlite/methods/governance.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.d.ts.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/owner.d.ts +5 -0
- package/dist/src/storage/providers/sqlite/methods/owner.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/owner.js +8 -0
- package/dist/src/storage/providers/sqlite/methods/owner.js.map +1 -1
- package/dist/src/storage/providers/sqlite/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 +3 -0
- package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.js +34 -1
- package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
- package/dist/src/storage/repositories/app-grant.repository.d.ts +10 -2
- package/dist/src/storage/repositories/app-grant.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/memory.repository.d.ts +14 -0
- package/dist/src/storage/repositories/memory.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories-impl/memory-repository.d.ts +8 -1
- package/dist/src/storage/repositories-impl/memory-repository.d.ts.map +1 -1
- package/dist/src/storage/repositories-impl/memory-repository.js +15 -4
- package/dist/src/storage/repositories-impl/memory-repository.js.map +1 -1
- package/dist/src/storage/types/agents-messaging.d.ts +19 -0
- package/dist/src/storage/types/agents-messaging.d.ts.map +1 -1
- package/dist/src/storage/types/agents-messaging.js.map +1 -1
- package/dist/src/storage/types/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/storage/types/organisms-federation.d.ts +29 -0
- package/dist/src/storage/types/organisms-federation.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-badge.d.ts.map +1 -1
- package/dist/src/utils/app-badge.js +7 -3
- package/dist/src/utils/app-badge.js.map +1 -1
- package/dist/src/utils/app-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/app-catalog/_template.html +6 -5
- package/dist/static/app-catalog/js/cortex.js +3 -1
- package/dist/static/app-catalog/js/detail.js +411 -36
- package/dist/static/app-catalog/js/i18n-data.js +279 -3
- package/dist/static/app-catalog/js/main.js +28 -37
- package/dist/static/app-catalog/js/monetize.js +204 -16
- package/dist/static/app-catalog/js/odps.js +489 -0
- package/dist/static/app-catalog/js/render.js +3 -0
- package/dist/static/app-catalog/js/workcopy.js +198 -0
- package/dist/static/app-catalog/styles/app-catalog.css +60 -0
- package/dist/static/app-catalog.html +1450 -137
- package/dist/static/sdk-libs/agents/index.js +45 -7
- package/dist/static/sdk-libs/auth/cluster.js +97 -0
- package/dist/static/sdk-libs/auth/index.js +25 -1
- package/dist/static/sdk-libs/auth/locale.js +151 -0
- package/dist/static/sdk-libs/auth/modal.js +11 -2
- package/dist/static/sdk-libs/auth/palette.js +172 -0
- package/dist/static/sdk-libs/auth/pill.js +37 -6
- package/dist/static/sdk-libs/auth/session.js +7 -3
- package/dist/static/sdk-libs/auth/theme.js +61 -20
- package/dist/static/sdk-libs/data/index.js +70 -8
- package/dist/static/sdk-libs/dist/aimeat-agents.js +41 -8
- package/dist/static/sdk-libs/dist/aimeat-auth.js +423 -22
- package/dist/static/sdk-libs/dist/aimeat-data.js +50 -8
- 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-live.js +54 -2
- package/dist/static/sdk-libs/dist/aimeat-markdown.js +32 -1
- 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/live/index.js +71 -4
- package/dist/static/sdk-libs/markdown/index.js +49 -1
- package/dist/static/sdk-libs/webmcp/index.js +63 -0
- package/package.json +7 -2
|
@@ -0,0 +1,1555 @@
|
|
|
1
|
+
// GENERATED FILE — do not edit directly. Source: src/static/sdk-libs/game/ (+ _core/).
|
|
2
|
+
// Rebuild: pnpm build:sdk · Served at /v1/libs/aimeat-game.js (with a per-node config prelude).
|
|
3
|
+
"use strict";
|
|
4
|
+
(() => {
|
|
5
|
+
// src/static/sdk-libs/_core/namespace.js
|
|
6
|
+
function namespace() {
|
|
7
|
+
if (!window.AIMEAT) window.AIMEAT = {};
|
|
8
|
+
return window.AIMEAT;
|
|
9
|
+
}
|
|
10
|
+
function attach(key, value) {
|
|
11
|
+
const ns = namespace();
|
|
12
|
+
ns[key] = value;
|
|
13
|
+
return ns;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// src/static/sdk-libs/game/dom.js
|
|
17
|
+
var SPECIAL = { text: 1, on: 1, vars: 1, children: 1 };
|
|
18
|
+
var seq = 0;
|
|
19
|
+
function el(tag, attrs, kids) {
|
|
20
|
+
const node = document.createElement(tag);
|
|
21
|
+
if (attrs) {
|
|
22
|
+
for (const k in attrs) {
|
|
23
|
+
const v = attrs[k];
|
|
24
|
+
if (v == null || v === false) continue;
|
|
25
|
+
if (k === "text") {
|
|
26
|
+
node.textContent = String(v);
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (k === "on") {
|
|
30
|
+
for (const type in v) node.addEventListener(type, v[type]);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (k === "vars") {
|
|
34
|
+
for (const name in v) node.style.setProperty(name, String(v[name]));
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if (SPECIAL[k]) continue;
|
|
38
|
+
node.setAttribute(k, v === true ? "" : String(v));
|
|
39
|
+
}
|
|
40
|
+
if (attrs.children != null) append(node, attrs.children);
|
|
41
|
+
}
|
|
42
|
+
if (kids != null) append(node, kids);
|
|
43
|
+
return node;
|
|
44
|
+
}
|
|
45
|
+
function append(parent, kids) {
|
|
46
|
+
const list = Array.isArray(kids) ? kids : [kids];
|
|
47
|
+
for (const c of list) {
|
|
48
|
+
if (c == null || c === false) continue;
|
|
49
|
+
parent.appendChild(typeof c === "object" ? (
|
|
50
|
+
/** @type {Node} */
|
|
51
|
+
c
|
|
52
|
+
) : document.createTextNode(String(c)));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function $(sel, root) {
|
|
56
|
+
return (
|
|
57
|
+
/** @type {HTMLElement|null} */
|
|
58
|
+
(root || document).querySelector(sel)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
function $$(sel, root) {
|
|
62
|
+
return Array.prototype.slice.call((root || document).querySelectorAll(sel));
|
|
63
|
+
}
|
|
64
|
+
function clear(node) {
|
|
65
|
+
while (node.firstChild) node.removeChild(node.firstChild);
|
|
66
|
+
return node;
|
|
67
|
+
}
|
|
68
|
+
function uid(prefix) {
|
|
69
|
+
seq += 1;
|
|
70
|
+
return (prefix || "ag") + "-" + seq;
|
|
71
|
+
}
|
|
72
|
+
function reducedMotion() {
|
|
73
|
+
return typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
74
|
+
}
|
|
75
|
+
function resolve(target, fallback) {
|
|
76
|
+
if (!target) return fallback || document.body;
|
|
77
|
+
if (typeof target === "string") return $(target) || fallback || document.body;
|
|
78
|
+
return target;
|
|
79
|
+
}
|
|
80
|
+
function injectStyle(opts) {
|
|
81
|
+
const o = opts || {};
|
|
82
|
+
const head = document.head || document.getElementsByTagName("head")[0];
|
|
83
|
+
let link = (
|
|
84
|
+
/** @type {HTMLLinkElement|null} */
|
|
85
|
+
document.getElementById("ag-style")
|
|
86
|
+
);
|
|
87
|
+
if (!link) {
|
|
88
|
+
link = document.createElement("link");
|
|
89
|
+
link.id = "ag-style";
|
|
90
|
+
link.rel = "stylesheet";
|
|
91
|
+
link.href = o.href || "/lib/aimeat-game.css";
|
|
92
|
+
head.insertBefore(link, head.firstChild);
|
|
93
|
+
}
|
|
94
|
+
let style = (
|
|
95
|
+
/** @type {HTMLStyleElement|null} */
|
|
96
|
+
document.getElementById("ag-style-extra")
|
|
97
|
+
);
|
|
98
|
+
if (o.extraCss) {
|
|
99
|
+
if (!style) {
|
|
100
|
+
style = document.createElement("style");
|
|
101
|
+
style.id = "ag-style-extra";
|
|
102
|
+
head.appendChild(style);
|
|
103
|
+
}
|
|
104
|
+
style.textContent = o.extraCss;
|
|
105
|
+
}
|
|
106
|
+
return { link, style };
|
|
107
|
+
}
|
|
108
|
+
var busyMap = /* @__PURE__ */ new WeakMap();
|
|
109
|
+
function busy(node) {
|
|
110
|
+
if (!node) return function() {
|
|
111
|
+
};
|
|
112
|
+
const known = busyMap.get(node);
|
|
113
|
+
if (known) return known;
|
|
114
|
+
node.classList.add("ag-busy");
|
|
115
|
+
node.setAttribute("aria-busy", "true");
|
|
116
|
+
const wasDisabled = (
|
|
117
|
+
/** @type {HTMLButtonElement} */
|
|
118
|
+
node.disabled
|
|
119
|
+
);
|
|
120
|
+
if ("disabled" in node) node.disabled = true;
|
|
121
|
+
const release = function() {
|
|
122
|
+
busyMap.delete(node);
|
|
123
|
+
node.classList.remove("ag-busy");
|
|
124
|
+
node.removeAttribute("aria-busy");
|
|
125
|
+
if ("disabled" in node) node.disabled = !!wasDisabled;
|
|
126
|
+
};
|
|
127
|
+
busyMap.set(node, release);
|
|
128
|
+
return release;
|
|
129
|
+
}
|
|
130
|
+
function guardButtons(target, opts) {
|
|
131
|
+
const root = resolve(
|
|
132
|
+
/** @type {any} */
|
|
133
|
+
target,
|
|
134
|
+
document.body
|
|
135
|
+
) || document.body;
|
|
136
|
+
const ms = opts && opts.ms || 700;
|
|
137
|
+
const onClick = function(ev) {
|
|
138
|
+
const start = (
|
|
139
|
+
/** @type {Element|null} */
|
|
140
|
+
ev.target
|
|
141
|
+
);
|
|
142
|
+
if (!start || !start.closest) return;
|
|
143
|
+
const btn = start.closest('button, [role="button"], .ag-btn');
|
|
144
|
+
if (!btn || btn.hasAttribute("data-ag-noguard")) return;
|
|
145
|
+
if (busyMap.has(btn)) {
|
|
146
|
+
ev.preventDefault();
|
|
147
|
+
ev.stopImmediatePropagation();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const release = busy(btn);
|
|
151
|
+
setTimeout(release, ms);
|
|
152
|
+
};
|
|
153
|
+
root.addEventListener("click", onClick, true);
|
|
154
|
+
return function() {
|
|
155
|
+
root.removeEventListener("click", onClick, true);
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function whileBusy(node, work) {
|
|
159
|
+
const release = busy(node);
|
|
160
|
+
return Promise.resolve(work).then(
|
|
161
|
+
function(v) {
|
|
162
|
+
release();
|
|
163
|
+
return v;
|
|
164
|
+
},
|
|
165
|
+
function(e) {
|
|
166
|
+
release();
|
|
167
|
+
throw e;
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// src/static/sdk-libs/game/i18n.js
|
|
173
|
+
var BASE = {
|
|
174
|
+
en: {
|
|
175
|
+
close: "Close",
|
|
176
|
+
back: "Back",
|
|
177
|
+
cancel: "Cancel",
|
|
178
|
+
confirm: "Confirm",
|
|
179
|
+
menu: "Menu",
|
|
180
|
+
locked: "Locked",
|
|
181
|
+
done: "Done",
|
|
182
|
+
open: "Open",
|
|
183
|
+
now: "Now",
|
|
184
|
+
later: "Later",
|
|
185
|
+
comingSoon: "Coming soon",
|
|
186
|
+
notifyMe: "Tell me when this opens",
|
|
187
|
+
notified: "We will tell you",
|
|
188
|
+
eta: "Expected {when}",
|
|
189
|
+
empty: "Nothing here yet",
|
|
190
|
+
nobodyYet: "No one on the board yet — the first entry sets the mark",
|
|
191
|
+
you: "You",
|
|
192
|
+
total: "Total",
|
|
193
|
+
points: "{a} / {b}",
|
|
194
|
+
earned: "Earned",
|
|
195
|
+
notEarned: "Not earned yet",
|
|
196
|
+
earnedOn: "Earned {when}",
|
|
197
|
+
best: "Best {n}",
|
|
198
|
+
inARow: "{n} in a row",
|
|
199
|
+
sortBy: "Sort by",
|
|
200
|
+
morsels: "morsels",
|
|
201
|
+
target: "Target {n}",
|
|
202
|
+
fix: "Fix this"
|
|
203
|
+
},
|
|
204
|
+
fi: {
|
|
205
|
+
close: "Sulje",
|
|
206
|
+
back: "Takaisin",
|
|
207
|
+
cancel: "Peruuta",
|
|
208
|
+
confirm: "Vahvista",
|
|
209
|
+
menu: "Valikko",
|
|
210
|
+
locked: "Lukossa",
|
|
211
|
+
done: "Tehty",
|
|
212
|
+
open: "Auki",
|
|
213
|
+
now: "Nyt",
|
|
214
|
+
later: "Myöhemmin",
|
|
215
|
+
comingSoon: "Tulossa",
|
|
216
|
+
notifyMe: "Kerro kun tämä aukeaa",
|
|
217
|
+
notified: "Ilmoitamme sinulle",
|
|
218
|
+
eta: "Arvio {when}",
|
|
219
|
+
empty: "Täällä ei ole vielä mitään",
|
|
220
|
+
nobodyYet: "Taululla ei ole vielä ketään — ensimmäinen asettaa rajan",
|
|
221
|
+
you: "Sinä",
|
|
222
|
+
total: "Yhteensä",
|
|
223
|
+
points: "{a} / {b}",
|
|
224
|
+
earned: "Ansaittu",
|
|
225
|
+
notEarned: "Vielä ansaitsematta",
|
|
226
|
+
earnedOn: "Ansaittu {when}",
|
|
227
|
+
best: "Paras {n}",
|
|
228
|
+
inARow: "{n} peräkkäin",
|
|
229
|
+
sortBy: "Järjestys",
|
|
230
|
+
morsels: "morselia",
|
|
231
|
+
target: "Tavoite {n}",
|
|
232
|
+
fix: "Korjaa tämä"
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
var HOST = { en: {}, fi: {} };
|
|
236
|
+
var listeners = [];
|
|
237
|
+
var current = detect();
|
|
238
|
+
function detect() {
|
|
239
|
+
try {
|
|
240
|
+
const ns = (
|
|
241
|
+
/** @type {any} */
|
|
242
|
+
window.AIMEAT
|
|
243
|
+
);
|
|
244
|
+
if (ns && ns.auth && typeof ns.auth.getLang === "function") {
|
|
245
|
+
const l = ns.auth.getLang();
|
|
246
|
+
if (l) return String(l).slice(0, 2);
|
|
247
|
+
}
|
|
248
|
+
const stored = localStorage.getItem("aimeat-lang");
|
|
249
|
+
if (stored) return stored.slice(0, 2);
|
|
250
|
+
} catch {
|
|
251
|
+
}
|
|
252
|
+
return (navigator.language || "en").slice(0, 2);
|
|
253
|
+
}
|
|
254
|
+
function announce(lang) {
|
|
255
|
+
for (const cb of listeners.slice()) {
|
|
256
|
+
try {
|
|
257
|
+
cb(lang);
|
|
258
|
+
} catch {
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
if (typeof window !== "undefined") {
|
|
263
|
+
window.addEventListener("aimeat-lang-change", function(ev) {
|
|
264
|
+
const detail = (
|
|
265
|
+
/** @type {any} */
|
|
266
|
+
ev.detail
|
|
267
|
+
);
|
|
268
|
+
const lang = detail && detail.lang || detect();
|
|
269
|
+
if (lang === current) return;
|
|
270
|
+
current = String(lang).slice(0, 2);
|
|
271
|
+
announce(current);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
var i18n = {
|
|
275
|
+
/** The languages the kit itself ships. A host may add more via `use()`. */
|
|
276
|
+
langs: ["en", "fi"],
|
|
277
|
+
/** The language in force right now. @returns {string} */
|
|
278
|
+
lang() {
|
|
279
|
+
return current;
|
|
280
|
+
},
|
|
281
|
+
/**
|
|
282
|
+
* Set the language for the kit AND the platform (one key, `aimeat-lang`, shared with the site).
|
|
283
|
+
* @param {string} lang
|
|
284
|
+
*/
|
|
285
|
+
setLang(lang) {
|
|
286
|
+
const next = String(lang).slice(0, 2);
|
|
287
|
+
if (next === current) return;
|
|
288
|
+
current = next;
|
|
289
|
+
try {
|
|
290
|
+
const ns = (
|
|
291
|
+
/** @type {any} */
|
|
292
|
+
window.AIMEAT
|
|
293
|
+
);
|
|
294
|
+
if (ns && ns.auth && typeof ns.auth.setLang === "function") ns.auth.setLang(next);
|
|
295
|
+
else localStorage.setItem("aimeat-lang", next);
|
|
296
|
+
} catch {
|
|
297
|
+
}
|
|
298
|
+
announce(current);
|
|
299
|
+
},
|
|
300
|
+
/**
|
|
301
|
+
* Merge the host's dictionary over the kit's. Either `{ en: {...}, fi: {...} }` or a flat
|
|
302
|
+
* object for the current language.
|
|
303
|
+
* @param {Record<string, any>} dict
|
|
304
|
+
*/
|
|
305
|
+
use(dict) {
|
|
306
|
+
if (!dict) return;
|
|
307
|
+
const looksNested = Object.keys(dict).every(function(k) {
|
|
308
|
+
return dict[k] && typeof dict[k] === "object" && !Array.isArray(dict[k]);
|
|
309
|
+
});
|
|
310
|
+
if (looksNested) {
|
|
311
|
+
for (const lang in dict) {
|
|
312
|
+
HOST[lang] = Object.assign({}, HOST[lang] || {}, dict[lang]);
|
|
313
|
+
}
|
|
314
|
+
} else {
|
|
315
|
+
HOST[current] = Object.assign({}, HOST[current] || {}, dict);
|
|
316
|
+
}
|
|
317
|
+
announce(current);
|
|
318
|
+
},
|
|
319
|
+
/**
|
|
320
|
+
* Look up a string: host(current) → kit(current) → kit(en) → the key itself. `{name}` in the
|
|
321
|
+
* text is replaced from `vars`.
|
|
322
|
+
* @param {string} key
|
|
323
|
+
* @param {Record<string, any>} [vars]
|
|
324
|
+
* @returns {string}
|
|
325
|
+
*/
|
|
326
|
+
t(key, vars) {
|
|
327
|
+
const text = HOST[current] && HOST[current][key] || BASE[current] && BASE[current][key] || HOST.en && HOST.en[key] || BASE.en[key] || key;
|
|
328
|
+
if (!vars) return String(text);
|
|
329
|
+
return String(text).replace(/\{(\w+)\}/g, function(whole, name) {
|
|
330
|
+
return vars[name] == null ? whole : String(vars[name]);
|
|
331
|
+
});
|
|
332
|
+
},
|
|
333
|
+
/**
|
|
334
|
+
* Run a callback whenever the language changes (host `use()` counts — new words arrived).
|
|
335
|
+
* @param {(lang: string) => void} cb
|
|
336
|
+
* @returns {() => void} stop listening
|
|
337
|
+
*/
|
|
338
|
+
onChange(cb) {
|
|
339
|
+
listeners.push(cb);
|
|
340
|
+
return function() {
|
|
341
|
+
const i = listeners.indexOf(cb);
|
|
342
|
+
if (i >= 0) listeners.splice(i, 1);
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
var t = i18n.t;
|
|
347
|
+
|
|
348
|
+
// src/static/sdk-libs/game/units.js
|
|
349
|
+
var MONEY_UNIT = 1e6;
|
|
350
|
+
function money(micros, currency) {
|
|
351
|
+
const s = ((Number(micros) || 0) / MONEY_UNIT).toFixed(6).replace(/(\.\d{2}\d*?)0+$/, "$1");
|
|
352
|
+
return currency ? s + " " + currency : s;
|
|
353
|
+
}
|
|
354
|
+
function morsels(n, opts) {
|
|
355
|
+
const v = Math.round(Number(n) || 0);
|
|
356
|
+
return opts && opts.bare ? String(v) : v + " " + i18n.t("morsels");
|
|
357
|
+
}
|
|
358
|
+
function isMoneyCurrency(currency) {
|
|
359
|
+
return !!currency && currency !== "morsel" && currency !== "MORSEL";
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// src/static/sdk-libs/game/menu.js
|
|
363
|
+
function menu(spec) {
|
|
364
|
+
const state = {
|
|
365
|
+
title: spec.title,
|
|
366
|
+
subtitle: spec.subtitle,
|
|
367
|
+
entries: spec.entries || [],
|
|
368
|
+
/** @type {MenuEntry[]} the chain of opened submenus */
|
|
369
|
+
trail: []
|
|
370
|
+
};
|
|
371
|
+
const titleId = uid("ag-menu-title");
|
|
372
|
+
const heading = el("h2", { class: "ag-title", id: titleId });
|
|
373
|
+
const sub = el("p", { class: "ag-menu__sub" });
|
|
374
|
+
const crumb = el("div", { class: "ag-menu__crumb" });
|
|
375
|
+
const titles = el("div", { class: "ag-menu__titles" }, [crumb, heading, sub]);
|
|
376
|
+
const closeBtn = el("button", {
|
|
377
|
+
type: "button",
|
|
378
|
+
class: "ag-btn ag-btn--ghost",
|
|
379
|
+
on: { click: function() {
|
|
380
|
+
api.close();
|
|
381
|
+
} }
|
|
382
|
+
}, spec.closeLabel || t("close"));
|
|
383
|
+
const head = spec.head === false ? null : el("div", { class: "ag-menu__head" }, [titles, closeBtn]);
|
|
384
|
+
const list = el("div", {
|
|
385
|
+
class: "ag-menu__list ag-scroll",
|
|
386
|
+
role: "menu",
|
|
387
|
+
"aria-labelledby": titleId,
|
|
388
|
+
on: { keydown: onKey }
|
|
389
|
+
});
|
|
390
|
+
const full = spec.full !== false;
|
|
391
|
+
const root = el("div", {
|
|
392
|
+
class: "ag-root ag-menu" + (full ? "" : " ag-menu--inline") + (head ? "" : " ag-menu--nohead"),
|
|
393
|
+
role: full ? "dialog" : "group",
|
|
394
|
+
"aria-modal": full ? "true" : null,
|
|
395
|
+
"aria-labelledby": titleId
|
|
396
|
+
}, head ? [head, list] : [list]);
|
|
397
|
+
const host = resolve(spec.target, document.body);
|
|
398
|
+
host.appendChild(root);
|
|
399
|
+
const stopLang = i18n.onChange(function() {
|
|
400
|
+
render(false);
|
|
401
|
+
});
|
|
402
|
+
function level() {
|
|
403
|
+
const last = state.trail[state.trail.length - 1];
|
|
404
|
+
return last ? last.entries || [] : state.entries;
|
|
405
|
+
}
|
|
406
|
+
function pathIds() {
|
|
407
|
+
return state.trail.map(function(e) {
|
|
408
|
+
return e.id;
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
function render(moveFocus) {
|
|
412
|
+
const depth = state.trail.length;
|
|
413
|
+
const here = state.trail[depth - 1];
|
|
414
|
+
heading.textContent = here ? here.label : state.title;
|
|
415
|
+
const subText = here ? here.sublabel || "" : state.subtitle || "";
|
|
416
|
+
sub.textContent = subText;
|
|
417
|
+
sub.hidden = !subText;
|
|
418
|
+
clear(crumb);
|
|
419
|
+
if (depth) {
|
|
420
|
+
crumb.appendChild(el("button", {
|
|
421
|
+
type: "button",
|
|
422
|
+
class: "ag-btn ag-btn--ghost",
|
|
423
|
+
on: { click: back }
|
|
424
|
+
}, "↩ " + t("back")));
|
|
425
|
+
crumb.appendChild(el("span", { class: "ag-label", text: state.title }));
|
|
426
|
+
}
|
|
427
|
+
clear(list);
|
|
428
|
+
if (!head && depth) {
|
|
429
|
+
list.appendChild(el("div", {
|
|
430
|
+
class: "ag-menu__item ag-menu__item--back",
|
|
431
|
+
role: "menuitem",
|
|
432
|
+
tabindex: "0",
|
|
433
|
+
on: { click: back }
|
|
434
|
+
}, el("div", { class: "ag-menu__inner" }, el("span", {}, el("span", { class: "ag-menu__label", text: "↩ " + t("back") })))));
|
|
435
|
+
}
|
|
436
|
+
const entries = level();
|
|
437
|
+
if (!entries.length) {
|
|
438
|
+
list.appendChild(el("p", { class: "ag-empty", text: t("empty") }));
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
for (const entry of entries) list.appendChild(item(entry));
|
|
442
|
+
if (moveFocus) {
|
|
443
|
+
const first = (
|
|
444
|
+
/** @type {HTMLElement|null} */
|
|
445
|
+
list.querySelector(".ag-menu__item")
|
|
446
|
+
);
|
|
447
|
+
if (first) first.focus();
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
function item(entry) {
|
|
451
|
+
const st = entry.state || "available";
|
|
452
|
+
const locked = st === "locked";
|
|
453
|
+
const nested = !!(entry.entries && entry.entries.length);
|
|
454
|
+
const marks = el("div", { class: "ag-menu__marks" });
|
|
455
|
+
if (entry.badge) marks.appendChild(el("span", { class: "ag-chip ag-chip--accent", text: entry.badge }));
|
|
456
|
+
if (st === "done") marks.appendChild(el("span", { class: "ag-chip ag-chip--ok", text: "✓ " + t("done") }));
|
|
457
|
+
if (locked) marks.appendChild(el("span", { class: "ag-chip", text: t("locked") }));
|
|
458
|
+
if (nested && !locked) marks.appendChild(el("span", { class: "ag-menu__arrow", text: "→", "aria-hidden": "true" }));
|
|
459
|
+
const body = el("span", {}, [
|
|
460
|
+
el("span", { class: "ag-menu__label", text: entry.label }),
|
|
461
|
+
entry.sublabel ? el("span", { class: "ag-menu__sublabel", text: entry.sublabel }) : null,
|
|
462
|
+
locked && entry.lockReason ? el("span", { class: "ag-menu__reason", text: entry.lockReason }) : null
|
|
463
|
+
]);
|
|
464
|
+
return el("div", {
|
|
465
|
+
class: "ag-menu__item" + (locked ? " ag-menu__item--locked" : "") + (st === "done" ? " ag-menu__item--done" : ""),
|
|
466
|
+
role: "menuitem",
|
|
467
|
+
tabindex: "0",
|
|
468
|
+
"data-ag-id": entry.id,
|
|
469
|
+
"aria-disabled": locked ? "true" : null,
|
|
470
|
+
on: { click: function() {
|
|
471
|
+
pick(entry);
|
|
472
|
+
} }
|
|
473
|
+
}, el("div", { class: "ag-menu__inner" }, [body, marks]));
|
|
474
|
+
}
|
|
475
|
+
function pick(entry) {
|
|
476
|
+
const path = pathIds();
|
|
477
|
+
if (spec.onPick) spec.onPick(entry, path);
|
|
478
|
+
if ((entry.state || "available") === "locked") return;
|
|
479
|
+
if (entry.entries && entry.entries.length) {
|
|
480
|
+
state.trail.push(entry);
|
|
481
|
+
render(true);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
function back() {
|
|
485
|
+
if (!state.trail.length) return api.close();
|
|
486
|
+
state.trail.pop();
|
|
487
|
+
render(true);
|
|
488
|
+
}
|
|
489
|
+
function onKey(ev) {
|
|
490
|
+
if (ev.key === "Escape") {
|
|
491
|
+
ev.preventDefault();
|
|
492
|
+
back();
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
if (ev.key === "Enter" || ev.key === " " || ev.key === "Spacebar") {
|
|
496
|
+
const active = (
|
|
497
|
+
/** @type {HTMLElement|null} */
|
|
498
|
+
document.activeElement
|
|
499
|
+
);
|
|
500
|
+
if (active && active.classList.contains("ag-menu__item")) {
|
|
501
|
+
ev.preventDefault();
|
|
502
|
+
active.click();
|
|
503
|
+
}
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
const items = (
|
|
507
|
+
/** @type {HTMLElement[]} */
|
|
508
|
+
Array.prototype.slice.call(list.querySelectorAll(".ag-menu__item"))
|
|
509
|
+
);
|
|
510
|
+
if (!items.length) return;
|
|
511
|
+
const at = items.indexOf(
|
|
512
|
+
/** @type {HTMLElement} */
|
|
513
|
+
document.activeElement
|
|
514
|
+
);
|
|
515
|
+
let next = -1;
|
|
516
|
+
if (ev.key === "ArrowDown" || ev.key === "ArrowRight") next = at < 0 ? 0 : (at + 1) % items.length;
|
|
517
|
+
else if (ev.key === "ArrowUp" || ev.key === "ArrowLeft") next = at < 0 ? items.length - 1 : (at - 1 + items.length) % items.length;
|
|
518
|
+
else if (ev.key === "Home") next = 0;
|
|
519
|
+
else if (ev.key === "End") next = items.length - 1;
|
|
520
|
+
if (next < 0) return;
|
|
521
|
+
ev.preventDefault();
|
|
522
|
+
items[next].focus();
|
|
523
|
+
}
|
|
524
|
+
const api = {
|
|
525
|
+
el: root,
|
|
526
|
+
/**
|
|
527
|
+
* Update in place. Position and focus are kept — a live update never moves the player.
|
|
528
|
+
* @param {{ title?: string, subtitle?: string, entries?: MenuEntry[] }} patch
|
|
529
|
+
*/
|
|
530
|
+
set(patch) {
|
|
531
|
+
if (!patch) return;
|
|
532
|
+
if (patch.title != null) state.title = patch.title;
|
|
533
|
+
if (patch.subtitle != null) state.subtitle = patch.subtitle;
|
|
534
|
+
if (patch.entries) {
|
|
535
|
+
state.entries = patch.entries;
|
|
536
|
+
const ids = pathIds();
|
|
537
|
+
state.trail = [];
|
|
538
|
+
let scope = state.entries;
|
|
539
|
+
for (const id of ids) {
|
|
540
|
+
const found = scope.find(function(e) {
|
|
541
|
+
return e.id === id;
|
|
542
|
+
});
|
|
543
|
+
if (!found || !found.entries) break;
|
|
544
|
+
state.trail.push(found);
|
|
545
|
+
scope = found.entries;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
render(false);
|
|
549
|
+
},
|
|
550
|
+
open() {
|
|
551
|
+
root.hidden = false;
|
|
552
|
+
render(true);
|
|
553
|
+
},
|
|
554
|
+
close() {
|
|
555
|
+
root.hidden = true;
|
|
556
|
+
if (spec.onClose) spec.onClose();
|
|
557
|
+
},
|
|
558
|
+
path() {
|
|
559
|
+
return pathIds();
|
|
560
|
+
},
|
|
561
|
+
destroy() {
|
|
562
|
+
stopLang();
|
|
563
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
root.hidden = spec.open === false;
|
|
567
|
+
render(full && spec.open !== false);
|
|
568
|
+
return api;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// src/static/sdk-libs/game/screen.js
|
|
572
|
+
function screen(spec) {
|
|
573
|
+
const titleId = uid("ag-screen-title");
|
|
574
|
+
const state = {
|
|
575
|
+
title: spec.title,
|
|
576
|
+
subtitle: spec.subtitle,
|
|
577
|
+
actions: spec.actions || []
|
|
578
|
+
};
|
|
579
|
+
const heading = el("h2", { class: "ag-title", id: titleId });
|
|
580
|
+
const sub = el("p", { class: "ag-screen__sub" });
|
|
581
|
+
const titles = el("div", { class: "ag-screen__titles" }, [heading, sub]);
|
|
582
|
+
const backBtn = spec.onBack ? el("button", {
|
|
583
|
+
type: "button",
|
|
584
|
+
class: "ag-btn ag-btn--ghost",
|
|
585
|
+
on: { click: function() {
|
|
586
|
+
if (spec.onBack) spec.onBack();
|
|
587
|
+
} }
|
|
588
|
+
}, "↩ " + (spec.backLabel || t("back"))) : null;
|
|
589
|
+
const head = el("div", {
|
|
590
|
+
class: "ag-screen__head" + (backBtn ? "" : " ag-screen__head--noback")
|
|
591
|
+
}, backBtn ? [backBtn, titles] : [titles]);
|
|
592
|
+
const body = el("div", { class: "ag-screen__body ag-scroll" });
|
|
593
|
+
if (spec.body != null) append(body, spec.body);
|
|
594
|
+
const bar = el("div", { class: "ag-screen__actions" });
|
|
595
|
+
const full = spec.full != null ? spec.full : !spec.target;
|
|
596
|
+
const root = el("div", {
|
|
597
|
+
class: "ag-root ag-screen" + (full ? " ag-screen--full" : ""),
|
|
598
|
+
"aria-labelledby": titleId
|
|
599
|
+
}, [head, body, bar]);
|
|
600
|
+
resolve(spec.target, document.body).appendChild(root);
|
|
601
|
+
const stopLang = i18n.onChange(function() {
|
|
602
|
+
renderHead();
|
|
603
|
+
});
|
|
604
|
+
function renderHead() {
|
|
605
|
+
heading.textContent = state.title;
|
|
606
|
+
sub.textContent = state.subtitle || "";
|
|
607
|
+
sub.hidden = !state.subtitle;
|
|
608
|
+
if (backBtn) backBtn.textContent = "↩ " + (spec.backLabel || t("back"));
|
|
609
|
+
}
|
|
610
|
+
function renderActions() {
|
|
611
|
+
clear(bar);
|
|
612
|
+
for (const action of state.actions) {
|
|
613
|
+
const kind = action.kind || "plain";
|
|
614
|
+
bar.appendChild(el("button", {
|
|
615
|
+
type: "button",
|
|
616
|
+
class: "ag-btn" + (kind === "plain" ? "" : " ag-btn--" + kind),
|
|
617
|
+
disabled: action.disabled ? true : null,
|
|
618
|
+
"data-ag-id": action.id,
|
|
619
|
+
on: { click: function() {
|
|
620
|
+
if (action.onClick) action.onClick(action);
|
|
621
|
+
} }
|
|
622
|
+
}, action.label));
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
renderHead();
|
|
626
|
+
renderActions();
|
|
627
|
+
return {
|
|
628
|
+
el: root,
|
|
629
|
+
body,
|
|
630
|
+
/**
|
|
631
|
+
* @param {{ title?: string, subtitle?: string, body?: any, actions?: ScreenAction[] }} patch
|
|
632
|
+
*/
|
|
633
|
+
set(patch) {
|
|
634
|
+
if (!patch) return;
|
|
635
|
+
if (patch.title != null) state.title = patch.title;
|
|
636
|
+
if (patch.subtitle != null) state.subtitle = patch.subtitle;
|
|
637
|
+
if (patch.title != null || patch.subtitle != null) renderHead();
|
|
638
|
+
if (patch.body !== void 0) {
|
|
639
|
+
clear(body);
|
|
640
|
+
append(body, patch.body);
|
|
641
|
+
}
|
|
642
|
+
if (patch.actions) {
|
|
643
|
+
state.actions = patch.actions;
|
|
644
|
+
renderActions();
|
|
645
|
+
}
|
|
646
|
+
},
|
|
647
|
+
destroy() {
|
|
648
|
+
stopLang();
|
|
649
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// src/static/sdk-libs/game/overlay.js
|
|
655
|
+
var FOCUSABLE = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
656
|
+
var TOAST_MARK = { ok: "✓", err: "✗", warn: "!", info: "i" };
|
|
657
|
+
function modal(spec) {
|
|
658
|
+
const dismissible = spec.dismissible !== false;
|
|
659
|
+
const titleId = uid("ag-modal-title");
|
|
660
|
+
const returnTo = (
|
|
661
|
+
/** @type {HTMLElement|null} */
|
|
662
|
+
document.activeElement
|
|
663
|
+
);
|
|
664
|
+
const heading = el("h2", { class: "ag-title", id: titleId, text: spec.title });
|
|
665
|
+
const closeBtn = el("button", {
|
|
666
|
+
type: "button",
|
|
667
|
+
class: "ag-btn ag-btn--ghost",
|
|
668
|
+
"aria-label": spec.closeLabel || t("close"),
|
|
669
|
+
on: { click: function() {
|
|
670
|
+
api.close();
|
|
671
|
+
} }
|
|
672
|
+
}, "✗");
|
|
673
|
+
const head = el("div", { class: "ag-modal__head" }, [heading, dismissible ? closeBtn : null]);
|
|
674
|
+
const body = el("div", { class: "ag-modal__body ag-scroll" });
|
|
675
|
+
if (spec.body != null) append(body, spec.body);
|
|
676
|
+
const bar = el("div", { class: "ag-modal__actions" });
|
|
677
|
+
const dialog = el("div", {
|
|
678
|
+
class: "ag-modal__dialog",
|
|
679
|
+
role: "dialog",
|
|
680
|
+
"aria-modal": "true",
|
|
681
|
+
"aria-labelledby": titleId,
|
|
682
|
+
tabindex: "-1"
|
|
683
|
+
}, [head, body, bar]);
|
|
684
|
+
const root = el("div", {
|
|
685
|
+
class: "ag-root ag-modal",
|
|
686
|
+
on: {
|
|
687
|
+
mousedown: function(ev) {
|
|
688
|
+
if (dismissible && ev.target === root) api.close();
|
|
689
|
+
},
|
|
690
|
+
keydown: onKey
|
|
691
|
+
}
|
|
692
|
+
}, dialog);
|
|
693
|
+
document.body.appendChild(root);
|
|
694
|
+
dialog.focus();
|
|
695
|
+
function onKey(ev) {
|
|
696
|
+
if (ev.key === "Escape" && dismissible) {
|
|
697
|
+
ev.preventDefault();
|
|
698
|
+
api.close();
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
if (ev.key !== "Tab") return;
|
|
702
|
+
const items = (
|
|
703
|
+
/** @type {HTMLElement[]} */
|
|
704
|
+
Array.prototype.slice.call(dialog.querySelectorAll(FOCUSABLE)).filter(function(n) {
|
|
705
|
+
return !/** @type {HTMLButtonElement} */
|
|
706
|
+
n.disabled;
|
|
707
|
+
})
|
|
708
|
+
);
|
|
709
|
+
if (!items.length) return;
|
|
710
|
+
const first = items[0];
|
|
711
|
+
const last = items[items.length - 1];
|
|
712
|
+
if (ev.shiftKey && document.activeElement === first) {
|
|
713
|
+
ev.preventDefault();
|
|
714
|
+
last.focus();
|
|
715
|
+
} else if (!ev.shiftKey && document.activeElement === last) {
|
|
716
|
+
ev.preventDefault();
|
|
717
|
+
first.focus();
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
function renderActions(actions) {
|
|
721
|
+
clear(bar);
|
|
722
|
+
for (const action of actions) {
|
|
723
|
+
const kind = action.kind || "plain";
|
|
724
|
+
bar.appendChild(el("button", {
|
|
725
|
+
type: "button",
|
|
726
|
+
class: "ag-btn" + (kind === "plain" ? "" : " ag-btn--" + kind),
|
|
727
|
+
"data-ag-id": action.id,
|
|
728
|
+
on: { click: function() {
|
|
729
|
+
if (action.onClick) action.onClick(action);
|
|
730
|
+
} }
|
|
731
|
+
}, action.label));
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
renderActions(spec.actions || []);
|
|
735
|
+
const api = {
|
|
736
|
+
el: root,
|
|
737
|
+
body,
|
|
738
|
+
/** @param {{ title?: string, body?: any, actions?: OverlayAction[] }} patch */
|
|
739
|
+
set(patch) {
|
|
740
|
+
if (!patch) return;
|
|
741
|
+
if (patch.title != null) heading.textContent = patch.title;
|
|
742
|
+
if (patch.body !== void 0) {
|
|
743
|
+
clear(body);
|
|
744
|
+
append(body, patch.body);
|
|
745
|
+
}
|
|
746
|
+
if (patch.actions) renderActions(patch.actions);
|
|
747
|
+
},
|
|
748
|
+
close() {
|
|
749
|
+
api.destroy();
|
|
750
|
+
if (spec.onClose) spec.onClose();
|
|
751
|
+
},
|
|
752
|
+
destroy() {
|
|
753
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
754
|
+
if (returnTo && typeof returnTo.focus === "function") returnTo.focus();
|
|
755
|
+
}
|
|
756
|
+
};
|
|
757
|
+
return api;
|
|
758
|
+
}
|
|
759
|
+
function toastHost() {
|
|
760
|
+
let host = document.getElementById("ag-toasts");
|
|
761
|
+
if (!host) {
|
|
762
|
+
host = el("div", { class: "ag-root ag-toasts", id: "ag-toasts", role: "status", "aria-live": "polite" });
|
|
763
|
+
document.body.appendChild(host);
|
|
764
|
+
}
|
|
765
|
+
return (
|
|
766
|
+
/** @type {HTMLElement} */
|
|
767
|
+
host
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
function toast(msg, kind, opts) {
|
|
771
|
+
const k = kind || "info";
|
|
772
|
+
const node = el("div", { class: "ag-toast ag-toast--" + k }, [
|
|
773
|
+
el("span", { class: "ag-toast__mark", text: TOAST_MARK[k] || "i", "aria-hidden": "true" }),
|
|
774
|
+
el("span", { text: msg })
|
|
775
|
+
]);
|
|
776
|
+
toastHost().appendChild(node);
|
|
777
|
+
const close = function() {
|
|
778
|
+
if (node.parentNode) node.parentNode.removeChild(node);
|
|
779
|
+
};
|
|
780
|
+
const ms = opts && opts.ms != null ? opts.ms : 3200;
|
|
781
|
+
if (ms > 0) setTimeout(close, ms);
|
|
782
|
+
return { el: node, close };
|
|
783
|
+
}
|
|
784
|
+
function confirm(spec) {
|
|
785
|
+
return new Promise(function(resolveWith) {
|
|
786
|
+
let settled = false;
|
|
787
|
+
const finish = function(answer) {
|
|
788
|
+
if (settled) return;
|
|
789
|
+
settled = true;
|
|
790
|
+
resolveWith(answer);
|
|
791
|
+
};
|
|
792
|
+
const dialog = modal({
|
|
793
|
+
title: spec.title,
|
|
794
|
+
body: spec.body,
|
|
795
|
+
onClose: function() {
|
|
796
|
+
finish(false);
|
|
797
|
+
},
|
|
798
|
+
actions: [
|
|
799
|
+
{
|
|
800
|
+
id: "cancel",
|
|
801
|
+
label: spec.cancelLabel || t("cancel"),
|
|
802
|
+
kind: "ghost",
|
|
803
|
+
onClick: function() {
|
|
804
|
+
finish(false);
|
|
805
|
+
dialog.destroy();
|
|
806
|
+
}
|
|
807
|
+
},
|
|
808
|
+
{
|
|
809
|
+
id: "confirm",
|
|
810
|
+
label: spec.confirmLabel || t("confirm"),
|
|
811
|
+
kind: spec.danger ? "danger" : "primary",
|
|
812
|
+
onClick: function() {
|
|
813
|
+
finish(true);
|
|
814
|
+
dialog.destroy();
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
]
|
|
818
|
+
});
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
// src/static/sdk-libs/game/progress.js
|
|
823
|
+
function pct(n) {
|
|
824
|
+
const v = Number(n);
|
|
825
|
+
if (!Number.isFinite(v)) return 0;
|
|
826
|
+
return Math.max(0, Math.min(100, v));
|
|
827
|
+
}
|
|
828
|
+
function rail(spec) {
|
|
829
|
+
const cfg = Array.isArray(spec) ? { steps: spec } : spec || { steps: [] };
|
|
830
|
+
let steps = cfg.steps || [];
|
|
831
|
+
const root = el("div", { class: "ag-root ag-rail", role: "list" });
|
|
832
|
+
function render() {
|
|
833
|
+
clear(root);
|
|
834
|
+
steps.forEach(function(step, i) {
|
|
835
|
+
const st = step.state || "future";
|
|
836
|
+
const mark = st === "done" ? "✓" : String(i + 1);
|
|
837
|
+
const kids = [
|
|
838
|
+
el("span", { class: "ag-rail__dot", "aria-hidden": "true", text: mark }),
|
|
839
|
+
el("span", { class: "ag-rail__name", text: step.label })
|
|
840
|
+
];
|
|
841
|
+
const attrs = {
|
|
842
|
+
class: "ag-rail__step ag-rail__step--" + st,
|
|
843
|
+
role: "listitem",
|
|
844
|
+
"data-ag-id": step.id,
|
|
845
|
+
"aria-current": st === "current" ? "step" : null,
|
|
846
|
+
"aria-label": step.label + " — " + t(st === "done" ? "done" : st === "current" ? "now" : "later")
|
|
847
|
+
};
|
|
848
|
+
if (cfg.onPick) {
|
|
849
|
+
root.appendChild(el("button", Object.assign({ type: "button" }, attrs, {
|
|
850
|
+
on: { click: function() {
|
|
851
|
+
if (cfg.onPick) cfg.onPick(step, i);
|
|
852
|
+
} }
|
|
853
|
+
}), kids));
|
|
854
|
+
} else {
|
|
855
|
+
root.appendChild(el("div", attrs, kids));
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
const stopLang = i18n.onChange(render);
|
|
860
|
+
render();
|
|
861
|
+
return {
|
|
862
|
+
el: root,
|
|
863
|
+
/** @param {RailStep[]} next */
|
|
864
|
+
set(next) {
|
|
865
|
+
if (next) steps = next;
|
|
866
|
+
render();
|
|
867
|
+
},
|
|
868
|
+
destroy() {
|
|
869
|
+
stopLang();
|
|
870
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
871
|
+
}
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
function meter(spec) {
|
|
875
|
+
const state = {
|
|
876
|
+
label: spec.label,
|
|
877
|
+
value: pct(spec.value),
|
|
878
|
+
threshold: spec.threshold,
|
|
879
|
+
hint: spec.hint,
|
|
880
|
+
tone: spec.tone || "accent",
|
|
881
|
+
suffix: spec.suffix != null ? spec.suffix : "%"
|
|
882
|
+
};
|
|
883
|
+
const name = el("span", { class: "ag-label" });
|
|
884
|
+
const value = el("span", { class: "ag-meter__value ag-num" });
|
|
885
|
+
const top = el("div", { class: "ag-meter__top" }, [name, value]);
|
|
886
|
+
const fill = el("div", { class: "ag-meter__fill" });
|
|
887
|
+
const track = el("div", {
|
|
888
|
+
class: "ag-meter__track",
|
|
889
|
+
role: "progressbar",
|
|
890
|
+
"aria-valuemin": "0",
|
|
891
|
+
"aria-valuemax": "100"
|
|
892
|
+
}, fill);
|
|
893
|
+
const hint = el("p", { class: "ag-meter__hint" });
|
|
894
|
+
const root = el("div", { class: "ag-root ag-meter" }, [top, track, hint]);
|
|
895
|
+
function render() {
|
|
896
|
+
root.className = "ag-root ag-meter ag-meter--" + state.tone;
|
|
897
|
+
name.textContent = state.label;
|
|
898
|
+
value.textContent = Math.round(state.value) + state.suffix;
|
|
899
|
+
fill.style.setProperty("--ag-fill", state.value + "%");
|
|
900
|
+
track.setAttribute("aria-valuenow", String(Math.round(state.value)));
|
|
901
|
+
track.setAttribute("aria-label", state.label);
|
|
902
|
+
const existing = track.querySelector(".ag-meter__mark");
|
|
903
|
+
if (existing) track.removeChild(existing);
|
|
904
|
+
if (state.threshold != null) {
|
|
905
|
+
track.appendChild(el("div", {
|
|
906
|
+
class: "ag-meter__mark",
|
|
907
|
+
"aria-hidden": "true",
|
|
908
|
+
vars: { "--ag-at": pct(state.threshold) + "%" }
|
|
909
|
+
}));
|
|
910
|
+
}
|
|
911
|
+
const text = state.hint || (state.threshold != null ? t("target", { n: Math.round(pct(state.threshold)) + state.suffix }) : "");
|
|
912
|
+
hint.textContent = text;
|
|
913
|
+
hint.hidden = !text;
|
|
914
|
+
}
|
|
915
|
+
const stopLang = i18n.onChange(render);
|
|
916
|
+
render();
|
|
917
|
+
return {
|
|
918
|
+
el: root,
|
|
919
|
+
/** @param {{ value?: number, label?: string, threshold?: number, hint?: string, tone?: 'accent'|'ok'|'warn'|'err' }} patch */
|
|
920
|
+
set(patch) {
|
|
921
|
+
if (!patch) return;
|
|
922
|
+
if (patch.value != null) state.value = pct(patch.value);
|
|
923
|
+
if (patch.label != null) state.label = patch.label;
|
|
924
|
+
if (patch.threshold !== void 0) state.threshold = patch.threshold;
|
|
925
|
+
if (patch.hint !== void 0) state.hint = patch.hint;
|
|
926
|
+
if (patch.tone) state.tone = patch.tone;
|
|
927
|
+
render();
|
|
928
|
+
},
|
|
929
|
+
destroy() {
|
|
930
|
+
stopLang();
|
|
931
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
932
|
+
}
|
|
933
|
+
};
|
|
934
|
+
}
|
|
935
|
+
function counter(spec) {
|
|
936
|
+
const format = spec.format || function(n) {
|
|
937
|
+
return String(Math.round(n));
|
|
938
|
+
};
|
|
939
|
+
const duration = spec.durationMs || 900;
|
|
940
|
+
let shown = spec.from != null ? spec.from : 0;
|
|
941
|
+
let target = Number(spec.value) || 0;
|
|
942
|
+
let frame = 0;
|
|
943
|
+
const num = el("span", { class: "ag-counter__n ag-num" });
|
|
944
|
+
const label = el("span", { class: "ag-label" });
|
|
945
|
+
const root = el("div", { class: "ag-root ag-counter" }, [num, label]);
|
|
946
|
+
function paintLabel() {
|
|
947
|
+
label.textContent = spec.label || "";
|
|
948
|
+
label.hidden = !spec.label;
|
|
949
|
+
}
|
|
950
|
+
function animate(to) {
|
|
951
|
+
if (frame) cancelAnimationFrame(frame);
|
|
952
|
+
if (reducedMotion() || duration <= 0) {
|
|
953
|
+
shown = to;
|
|
954
|
+
num.textContent = format(shown);
|
|
955
|
+
return;
|
|
956
|
+
}
|
|
957
|
+
const from = shown;
|
|
958
|
+
const started = performance.now();
|
|
959
|
+
const step = function(now) {
|
|
960
|
+
const p = Math.min(1, (now - started) / duration);
|
|
961
|
+
const eased = 1 - Math.pow(1 - p, 3);
|
|
962
|
+
shown = from + (to - from) * eased;
|
|
963
|
+
num.textContent = format(shown);
|
|
964
|
+
if (p < 1) frame = requestAnimationFrame(step);
|
|
965
|
+
else {
|
|
966
|
+
frame = 0;
|
|
967
|
+
shown = to;
|
|
968
|
+
num.textContent = format(shown);
|
|
969
|
+
}
|
|
970
|
+
};
|
|
971
|
+
frame = requestAnimationFrame(step);
|
|
972
|
+
}
|
|
973
|
+
paintLabel();
|
|
974
|
+
num.textContent = format(shown);
|
|
975
|
+
animate(target);
|
|
976
|
+
return {
|
|
977
|
+
el: root,
|
|
978
|
+
/** @param {number|{ value?: number, label?: string }} next */
|
|
979
|
+
set(next) {
|
|
980
|
+
if (typeof next === "number") {
|
|
981
|
+
target = next;
|
|
982
|
+
animate(target);
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
985
|
+
if (!next) return;
|
|
986
|
+
if (next.label !== void 0) {
|
|
987
|
+
spec.label = next.label;
|
|
988
|
+
paintLabel();
|
|
989
|
+
}
|
|
990
|
+
if (next.value != null) {
|
|
991
|
+
target = next.value;
|
|
992
|
+
animate(target);
|
|
993
|
+
}
|
|
994
|
+
},
|
|
995
|
+
destroy() {
|
|
996
|
+
if (frame) cancelAnimationFrame(frame);
|
|
997
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
998
|
+
}
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
function streak(spec) {
|
|
1002
|
+
const state = {
|
|
1003
|
+
count: Number(spec.count) || 0,
|
|
1004
|
+
periods: spec.periods || [],
|
|
1005
|
+
best: spec.best,
|
|
1006
|
+
unitLabel: spec.unitLabel
|
|
1007
|
+
};
|
|
1008
|
+
const count = el("span", { class: "ag-streak__count ag-num" });
|
|
1009
|
+
const unit = el("span", { class: "ag-label" });
|
|
1010
|
+
const best = el("span", { class: "ag-dim" });
|
|
1011
|
+
const top = el("div", { class: "ag-streak__top" }, [count, unit, best]);
|
|
1012
|
+
const cells = el("div", { class: "ag-streak__cells" });
|
|
1013
|
+
const root = el("div", { class: "ag-root ag-streak" }, [top, cells]);
|
|
1014
|
+
function render() {
|
|
1015
|
+
count.textContent = t("inARow", { n: state.count });
|
|
1016
|
+
unit.textContent = state.unitLabel || "";
|
|
1017
|
+
unit.hidden = !state.unitLabel;
|
|
1018
|
+
best.textContent = state.best != null ? t("best", { n: state.best }) : "";
|
|
1019
|
+
best.hidden = state.best == null;
|
|
1020
|
+
clear(cells);
|
|
1021
|
+
for (const p of state.periods) {
|
|
1022
|
+
cells.appendChild(el("div", {
|
|
1023
|
+
class: "ag-streak__cell" + (p.done ? " ag-streak__cell--done" : ""),
|
|
1024
|
+
title: p.label
|
|
1025
|
+
}, [
|
|
1026
|
+
el("span", { class: "ag-streak__box", "aria-hidden": "true", text: p.done ? "✓" : "" }),
|
|
1027
|
+
el("span", { class: "ag-streak__tick", text: p.label })
|
|
1028
|
+
]));
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
const stopLang = i18n.onChange(render);
|
|
1032
|
+
render();
|
|
1033
|
+
return {
|
|
1034
|
+
el: root,
|
|
1035
|
+
/** @param {{ count?: number, periods?: any[], best?: number, unitLabel?: string }} patch */
|
|
1036
|
+
set(patch) {
|
|
1037
|
+
if (!patch) return;
|
|
1038
|
+
if (patch.count != null) state.count = patch.count;
|
|
1039
|
+
if (patch.periods) state.periods = patch.periods;
|
|
1040
|
+
if (patch.best !== void 0) state.best = patch.best;
|
|
1041
|
+
if (patch.unitLabel !== void 0) state.unitLabel = patch.unitLabel;
|
|
1042
|
+
render();
|
|
1043
|
+
},
|
|
1044
|
+
destroy() {
|
|
1045
|
+
stopLang();
|
|
1046
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
1047
|
+
}
|
|
1048
|
+
};
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
// src/static/sdk-libs/game/score.js
|
|
1052
|
+
function scoreBreakdown(spec) {
|
|
1053
|
+
const state = {
|
|
1054
|
+
title: spec.title,
|
|
1055
|
+
rows: spec.rows || [],
|
|
1056
|
+
total: spec.total,
|
|
1057
|
+
threshold: spec.threshold
|
|
1058
|
+
};
|
|
1059
|
+
const big = el("span", { class: "ag-score__big ag-num" });
|
|
1060
|
+
const bar = meter({
|
|
1061
|
+
label: spec.totalLabel || t("total"),
|
|
1062
|
+
value: 0,
|
|
1063
|
+
threshold: spec.threshold
|
|
1064
|
+
});
|
|
1065
|
+
const totalBox = el("div", { class: "ag-score__total" }, [big, bar.el]);
|
|
1066
|
+
const rows = el("div", { class: "ag-score__rows" });
|
|
1067
|
+
const heading = el("h3", { class: "ag-title" });
|
|
1068
|
+
const root = el("div", { class: "ag-root ag-score" }, [heading, totalBox, rows]);
|
|
1069
|
+
function totals() {
|
|
1070
|
+
if (state.total) return state.total;
|
|
1071
|
+
let points = 0;
|
|
1072
|
+
let max = 0;
|
|
1073
|
+
for (const r of state.rows) {
|
|
1074
|
+
points += Number(r.points) || 0;
|
|
1075
|
+
max += Number(r.max) || 0;
|
|
1076
|
+
}
|
|
1077
|
+
return { points, max };
|
|
1078
|
+
}
|
|
1079
|
+
function toneOf(row) {
|
|
1080
|
+
if (row.tone) return row.tone;
|
|
1081
|
+
const p = Number(row.points) || 0;
|
|
1082
|
+
const m = Number(row.max) || 0;
|
|
1083
|
+
if (m > 0 && p >= m) return "full";
|
|
1084
|
+
return p > 0 ? "part" : "zero";
|
|
1085
|
+
}
|
|
1086
|
+
function render() {
|
|
1087
|
+
heading.textContent = state.title || "";
|
|
1088
|
+
heading.hidden = !state.title;
|
|
1089
|
+
const sum = totals();
|
|
1090
|
+
const share = sum.max > 0 ? sum.points / sum.max * 100 : 0;
|
|
1091
|
+
big.textContent = String(Math.round(sum.points));
|
|
1092
|
+
bar.set({
|
|
1093
|
+
value: share,
|
|
1094
|
+
label: (spec.totalLabel || t("total")) + " · " + t("points", { a: Math.round(sum.points), b: Math.round(sum.max) })
|
|
1095
|
+
});
|
|
1096
|
+
totalBox.hidden = spec.showTotal === false;
|
|
1097
|
+
clear(rows);
|
|
1098
|
+
if (!state.rows.length) {
|
|
1099
|
+
rows.appendChild(el("p", { class: "ag-empty", text: t("empty") }));
|
|
1100
|
+
return;
|
|
1101
|
+
}
|
|
1102
|
+
for (const row of state.rows) {
|
|
1103
|
+
const tone = toneOf(row);
|
|
1104
|
+
rows.appendChild(el("button", {
|
|
1105
|
+
type: "button",
|
|
1106
|
+
class: "ag-score__row ag-score__row--" + tone,
|
|
1107
|
+
"data-ag-id": row.id,
|
|
1108
|
+
"aria-label": row.label + " — " + t("points", { a: row.points, b: row.max }),
|
|
1109
|
+
on: { click: function() {
|
|
1110
|
+
if (spec.onPick) spec.onPick(row);
|
|
1111
|
+
} }
|
|
1112
|
+
}, [
|
|
1113
|
+
el("span", {}, [
|
|
1114
|
+
el("span", { class: "ag-score__name", text: row.label }),
|
|
1115
|
+
row.reason ? el("span", { class: "ag-score__why", text: row.reason }) : null
|
|
1116
|
+
]),
|
|
1117
|
+
el("span", { class: "ag-score__pts" }, [
|
|
1118
|
+
el("span", { text: t("points", { a: row.points, b: row.max }) }),
|
|
1119
|
+
el("span", { class: "ag-score__go", text: "→", "aria-hidden": "true" })
|
|
1120
|
+
])
|
|
1121
|
+
]));
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
const stopLang = i18n.onChange(render);
|
|
1125
|
+
render();
|
|
1126
|
+
return {
|
|
1127
|
+
el: root,
|
|
1128
|
+
/** @param {{ rows?: ScoreRow[], total?: any, title?: string, threshold?: number }} patch */
|
|
1129
|
+
set(patch) {
|
|
1130
|
+
if (!patch) return;
|
|
1131
|
+
if (patch.rows) state.rows = patch.rows;
|
|
1132
|
+
if (patch.total !== void 0) state.total = patch.total;
|
|
1133
|
+
if (patch.title !== void 0) state.title = patch.title;
|
|
1134
|
+
if (patch.threshold !== void 0) {
|
|
1135
|
+
state.threshold = patch.threshold;
|
|
1136
|
+
bar.set({ threshold: patch.threshold });
|
|
1137
|
+
}
|
|
1138
|
+
render();
|
|
1139
|
+
},
|
|
1140
|
+
destroy() {
|
|
1141
|
+
stopLang();
|
|
1142
|
+
bar.destroy();
|
|
1143
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
1144
|
+
}
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
// src/static/sdk-libs/game/markers.js
|
|
1149
|
+
function badge(spec) {
|
|
1150
|
+
const state = {
|
|
1151
|
+
title: spec.title,
|
|
1152
|
+
description: spec.description,
|
|
1153
|
+
earned: !!spec.earned,
|
|
1154
|
+
earnedAt: spec.earnedAt
|
|
1155
|
+
};
|
|
1156
|
+
const seal = el("span", { class: "ag-badge__seal", "aria-hidden": "true" });
|
|
1157
|
+
const name = el("span", { class: "ag-badge__name" });
|
|
1158
|
+
const desc = el("span", { class: "ag-badge__desc" });
|
|
1159
|
+
const when = el("span", { class: "ag-badge__when" });
|
|
1160
|
+
const text = el("span", {}, [name, desc, when]);
|
|
1161
|
+
const root = el("div", { class: "ag-root ag-badge" }, [seal, text]);
|
|
1162
|
+
function whenText() {
|
|
1163
|
+
if (!state.earned) return t("notEarned");
|
|
1164
|
+
if (state.earnedAt == null) return t("earned");
|
|
1165
|
+
const d = state.earnedAt instanceof Date ? state.earnedAt : new Date(state.earnedAt);
|
|
1166
|
+
const shown = Number.isNaN(d.getTime()) ? String(state.earnedAt) : d.toLocaleDateString(i18n.lang());
|
|
1167
|
+
return t("earnedOn", { when: shown });
|
|
1168
|
+
}
|
|
1169
|
+
function render() {
|
|
1170
|
+
root.className = "ag-root ag-badge" + (state.earned ? " ag-badge--earned" : "");
|
|
1171
|
+
seal.textContent = state.earned ? spec.glyph || "✓" : "";
|
|
1172
|
+
name.textContent = state.title;
|
|
1173
|
+
desc.textContent = state.description || "";
|
|
1174
|
+
desc.hidden = !state.description;
|
|
1175
|
+
when.textContent = whenText();
|
|
1176
|
+
}
|
|
1177
|
+
const stopLang = i18n.onChange(render);
|
|
1178
|
+
render();
|
|
1179
|
+
return {
|
|
1180
|
+
el: root,
|
|
1181
|
+
/** @param {{ earned?: boolean, earnedAt?: any, title?: string, description?: string }} patch */
|
|
1182
|
+
set(patch) {
|
|
1183
|
+
if (!patch) return;
|
|
1184
|
+
if (patch.earned != null) state.earned = !!patch.earned;
|
|
1185
|
+
if (patch.earnedAt !== void 0) state.earnedAt = patch.earnedAt;
|
|
1186
|
+
if (patch.title != null) state.title = patch.title;
|
|
1187
|
+
if (patch.description !== void 0) state.description = patch.description;
|
|
1188
|
+
render();
|
|
1189
|
+
},
|
|
1190
|
+
destroy() {
|
|
1191
|
+
stopLang();
|
|
1192
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
1193
|
+
}
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
function comingSoon(spec) {
|
|
1197
|
+
const state = {
|
|
1198
|
+
title: spec.title,
|
|
1199
|
+
description: spec.description,
|
|
1200
|
+
eta: spec.eta,
|
|
1201
|
+
notified: !!(spec.notify && spec.notify.already)
|
|
1202
|
+
};
|
|
1203
|
+
const name = el("h3", { class: "ag-title" });
|
|
1204
|
+
const chip = el("span", { class: "ag-chip ag-chip--info" });
|
|
1205
|
+
const top = el("div", { class: "ag-soon__top" }, [name, chip]);
|
|
1206
|
+
const what = el("p", { class: "ag-soon__what" });
|
|
1207
|
+
const foot = el("div", { class: "ag-soon__foot" });
|
|
1208
|
+
const root = el("div", { class: "ag-root ag-card ag-soon" }, [top, what, foot]);
|
|
1209
|
+
function render() {
|
|
1210
|
+
name.textContent = state.title;
|
|
1211
|
+
chip.textContent = spec.chipLabel || t("comingSoon");
|
|
1212
|
+
what.textContent = state.description;
|
|
1213
|
+
clear(foot);
|
|
1214
|
+
if (state.eta) foot.appendChild(el("span", { class: "ag-soon__eta", text: t("eta", { when: state.eta }) }));
|
|
1215
|
+
if (!spec.notify) return;
|
|
1216
|
+
if (state.notified) {
|
|
1217
|
+
foot.appendChild(el("span", { class: "ag-chip ag-chip--ok", text: "✓ " + (spec.notify.doneLabel || t("notified")) }));
|
|
1218
|
+
return;
|
|
1219
|
+
}
|
|
1220
|
+
foot.appendChild(el("button", {
|
|
1221
|
+
type: "button",
|
|
1222
|
+
class: "ag-btn",
|
|
1223
|
+
on: {
|
|
1224
|
+
click: function(ev) {
|
|
1225
|
+
const btn = (
|
|
1226
|
+
/** @type {HTMLElement} */
|
|
1227
|
+
ev.currentTarget
|
|
1228
|
+
);
|
|
1229
|
+
whileBusy(btn, spec.notify ? spec.notify.onNotify() : null).then(function() {
|
|
1230
|
+
state.notified = true;
|
|
1231
|
+
render();
|
|
1232
|
+
}).catch(function() {
|
|
1233
|
+
});
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
}, spec.notify.label || t("notifyMe")));
|
|
1237
|
+
}
|
|
1238
|
+
const stopLang = i18n.onChange(render);
|
|
1239
|
+
render();
|
|
1240
|
+
return {
|
|
1241
|
+
el: root,
|
|
1242
|
+
/** @param {{ title?: string, description?: string, eta?: string, notified?: boolean }} patch */
|
|
1243
|
+
set(patch) {
|
|
1244
|
+
if (!patch) return;
|
|
1245
|
+
if (patch.title != null) state.title = patch.title;
|
|
1246
|
+
if (patch.description != null) state.description = patch.description;
|
|
1247
|
+
if (patch.eta !== void 0) state.eta = patch.eta;
|
|
1248
|
+
if (patch.notified != null) state.notified = !!patch.notified;
|
|
1249
|
+
render();
|
|
1250
|
+
},
|
|
1251
|
+
destroy() {
|
|
1252
|
+
stopLang();
|
|
1253
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
1254
|
+
}
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
// src/static/sdk-libs/game/board.js
|
|
1259
|
+
function leaderboard(spec) {
|
|
1260
|
+
const metrics = spec.metrics && spec.metrics.length ? spec.metrics : [{ id: "score", label: "Score" }];
|
|
1261
|
+
let active = spec.metric || metrics[0].id;
|
|
1262
|
+
let rows = spec.rows || [];
|
|
1263
|
+
const heading = el("h3", { class: "ag-title" });
|
|
1264
|
+
const tabs = el("div", { class: "ag-lb__metrics", role: "group" });
|
|
1265
|
+
const list = el("div", { class: "ag-lb__rows" });
|
|
1266
|
+
const root = el("div", { class: "ag-root ag-lb" }, [heading, tabs, list]);
|
|
1267
|
+
function current2() {
|
|
1268
|
+
return metrics.find(function(m) {
|
|
1269
|
+
return m.id === active;
|
|
1270
|
+
}) || metrics[0];
|
|
1271
|
+
}
|
|
1272
|
+
function show(v, m) {
|
|
1273
|
+
if (m.format) return m.format(v);
|
|
1274
|
+
if (v == null) return "—";
|
|
1275
|
+
return typeof v === "number" ? String(v) : String(v);
|
|
1276
|
+
}
|
|
1277
|
+
function renderTabs() {
|
|
1278
|
+
clear(tabs);
|
|
1279
|
+
if (metrics.length < 2) return;
|
|
1280
|
+
tabs.setAttribute("aria-label", t("sortBy"));
|
|
1281
|
+
for (const m of metrics) {
|
|
1282
|
+
tabs.appendChild(el("button", {
|
|
1283
|
+
type: "button",
|
|
1284
|
+
class: "ag-lb__metric",
|
|
1285
|
+
"data-ag-id": m.id,
|
|
1286
|
+
"aria-pressed": m.id === active ? "true" : "false",
|
|
1287
|
+
on: {
|
|
1288
|
+
click: function() {
|
|
1289
|
+
active = m.id;
|
|
1290
|
+
if (spec.onSort) spec.onSort(active);
|
|
1291
|
+
renderTabs();
|
|
1292
|
+
renderRows();
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
}, m.label));
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
function renderRows() {
|
|
1299
|
+
clear(list);
|
|
1300
|
+
const m = current2();
|
|
1301
|
+
if (!rows.length) {
|
|
1302
|
+
list.appendChild(el("p", { class: "ag-empty", text: spec.emptyText || t("nobodyYet") }));
|
|
1303
|
+
return;
|
|
1304
|
+
}
|
|
1305
|
+
const dir = m.direction === "asc" ? 1 : -1;
|
|
1306
|
+
const sorted = rows.slice().sort(function(a, b) {
|
|
1307
|
+
const av = Number(a.values ? a.values[m.id] : 0) || 0;
|
|
1308
|
+
const bv = Number(b.values ? b.values[m.id] : 0) || 0;
|
|
1309
|
+
return (av - bv) * dir;
|
|
1310
|
+
});
|
|
1311
|
+
sorted.forEach(function(row, i) {
|
|
1312
|
+
const kids = [
|
|
1313
|
+
el("span", { class: "ag-lb__rank ag-num", text: String(row.rank != null ? row.rank : i + 1) }),
|
|
1314
|
+
el("span", { class: "ag-lb__who" }, [
|
|
1315
|
+
el("span", { class: "ag-lb__name", text: row.name + (row.you ? " · " + t("you") : "") }),
|
|
1316
|
+
row.sublabel ? el("span", { class: "ag-lb__sub", text: row.sublabel }) : null
|
|
1317
|
+
]),
|
|
1318
|
+
el("span", { class: "ag-lb__val", text: show(row.values ? row.values[m.id] : null, m) })
|
|
1319
|
+
];
|
|
1320
|
+
const attrs = {
|
|
1321
|
+
class: "ag-lb__row" + (row.you ? " ag-lb__row--you" : ""),
|
|
1322
|
+
"data-ag-id": row.id
|
|
1323
|
+
};
|
|
1324
|
+
if (spec.onPick) {
|
|
1325
|
+
list.appendChild(el("button", Object.assign({ type: "button" }, attrs, {
|
|
1326
|
+
on: { click: function() {
|
|
1327
|
+
if (spec.onPick) spec.onPick(row);
|
|
1328
|
+
} }
|
|
1329
|
+
}), kids));
|
|
1330
|
+
} else {
|
|
1331
|
+
list.appendChild(el("div", attrs, kids));
|
|
1332
|
+
}
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
function render() {
|
|
1336
|
+
heading.textContent = spec.title || "";
|
|
1337
|
+
heading.hidden = !spec.title;
|
|
1338
|
+
renderTabs();
|
|
1339
|
+
renderRows();
|
|
1340
|
+
}
|
|
1341
|
+
const stopLang = i18n.onChange(render);
|
|
1342
|
+
render();
|
|
1343
|
+
return {
|
|
1344
|
+
el: root,
|
|
1345
|
+
/** @param {{ rows?: BoardRow[], metric?: string, title?: string }} patch */
|
|
1346
|
+
set(patch) {
|
|
1347
|
+
if (!patch) return;
|
|
1348
|
+
if (patch.rows) rows = patch.rows;
|
|
1349
|
+
if (patch.metric) active = patch.metric;
|
|
1350
|
+
if (patch.title !== void 0) spec.title = patch.title;
|
|
1351
|
+
render();
|
|
1352
|
+
},
|
|
1353
|
+
metric() {
|
|
1354
|
+
return active;
|
|
1355
|
+
},
|
|
1356
|
+
destroy() {
|
|
1357
|
+
stopLang();
|
|
1358
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
}
|
|
1362
|
+
function statGrid(spec) {
|
|
1363
|
+
let tiles = Array.isArray(spec) ? spec : spec && spec.tiles || [];
|
|
1364
|
+
const root = el("div", { class: "ag-root ag-stats" });
|
|
1365
|
+
function render() {
|
|
1366
|
+
clear(root);
|
|
1367
|
+
if (!tiles.length) {
|
|
1368
|
+
root.appendChild(el("p", { class: "ag-empty", text: t("empty") }));
|
|
1369
|
+
return;
|
|
1370
|
+
}
|
|
1371
|
+
for (const tile of tiles) {
|
|
1372
|
+
const tone = tile.deltaTone || (tile.delta == null ? "flat" : Number(tile.delta) > 0 ? "up" : Number(tile.delta) < 0 ? "down" : "flat");
|
|
1373
|
+
root.appendChild(el("div", { class: "ag-stat", "data-ag-id": tile.id }, [
|
|
1374
|
+
el("span", { class: "ag-label", text: tile.label }),
|
|
1375
|
+
el("span", { class: "ag-stat__v" }, [
|
|
1376
|
+
el("span", { text: String(tile.value) }),
|
|
1377
|
+
tile.unit ? el("span", { class: "ag-stat__u", text: tile.unit }) : null
|
|
1378
|
+
]),
|
|
1379
|
+
tile.delta != null ? el("span", { class: "ag-stat__d ag-stat__d--" + tone, text: String(tile.delta) }) : null
|
|
1380
|
+
]));
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
const stopLang = i18n.onChange(render);
|
|
1384
|
+
render();
|
|
1385
|
+
return {
|
|
1386
|
+
el: root,
|
|
1387
|
+
/** @param {StatTile[]} next */
|
|
1388
|
+
set(next) {
|
|
1389
|
+
if (next) tiles = next;
|
|
1390
|
+
render();
|
|
1391
|
+
},
|
|
1392
|
+
destroy() {
|
|
1393
|
+
stopLang();
|
|
1394
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
1395
|
+
}
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
function dataTable(spec) {
|
|
1399
|
+
let rows = spec.rows || [];
|
|
1400
|
+
const columns = spec.columns || [];
|
|
1401
|
+
const head = el("thead");
|
|
1402
|
+
const body = el("tbody");
|
|
1403
|
+
const table = el("table", {}, [head, body]);
|
|
1404
|
+
const root = el("div", { class: "ag-root ag-table" }, table);
|
|
1405
|
+
function render() {
|
|
1406
|
+
clear(head);
|
|
1407
|
+
head.appendChild(el("tr", {}, columns.map(function(c) {
|
|
1408
|
+
return el("th", { class: c.num ? "ag-th--num" : null, scope: "col", text: c.label });
|
|
1409
|
+
})));
|
|
1410
|
+
clear(body);
|
|
1411
|
+
if (!rows.length) {
|
|
1412
|
+
body.appendChild(el("tr", {}, el("td", {
|
|
1413
|
+
colspan: String(Math.max(1, columns.length))
|
|
1414
|
+
}, el("p", { class: "ag-empty", text: spec.emptyText || t("empty") }))));
|
|
1415
|
+
return;
|
|
1416
|
+
}
|
|
1417
|
+
for (const row of rows) {
|
|
1418
|
+
const cells = columns.map(function(c) {
|
|
1419
|
+
const raw = row[c.id];
|
|
1420
|
+
const text = c.format ? c.format(raw, row) : raw == null ? "—" : String(raw);
|
|
1421
|
+
return el("td", { class: c.num ? "ag-td--num" : null, text });
|
|
1422
|
+
});
|
|
1423
|
+
const tr = el("tr", { "data-ag-pick": spec.onPick ? "" : null }, cells);
|
|
1424
|
+
if (spec.onPick) tr.addEventListener("click", function() {
|
|
1425
|
+
if (spec.onPick) spec.onPick(row);
|
|
1426
|
+
});
|
|
1427
|
+
body.appendChild(tr);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
const stopLang = i18n.onChange(render);
|
|
1431
|
+
render();
|
|
1432
|
+
return {
|
|
1433
|
+
el: root,
|
|
1434
|
+
/** @param {{ rows?: any[] }} patch */
|
|
1435
|
+
set(patch) {
|
|
1436
|
+
if (!patch) return;
|
|
1437
|
+
if (patch.rows) rows = patch.rows;
|
|
1438
|
+
render();
|
|
1439
|
+
},
|
|
1440
|
+
destroy() {
|
|
1441
|
+
stopLang();
|
|
1442
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
1443
|
+
}
|
|
1444
|
+
};
|
|
1445
|
+
}
|
|
1446
|
+
function card(spec) {
|
|
1447
|
+
const state = {
|
|
1448
|
+
title: spec.title,
|
|
1449
|
+
author: spec.author,
|
|
1450
|
+
metric: spec.metric,
|
|
1451
|
+
image: spec.image,
|
|
1452
|
+
tags: spec.tags || []
|
|
1453
|
+
};
|
|
1454
|
+
const body = el("div", { class: "ag-showcase__body" });
|
|
1455
|
+
const tag = spec.onPick ? "button" : "div";
|
|
1456
|
+
const root = el(tag, Object.assign(
|
|
1457
|
+
{ class: "ag-root ag-card ag-showcase" },
|
|
1458
|
+
spec.onPick ? { type: "button", on: { click: function() {
|
|
1459
|
+
if (spec.onPick) spec.onPick();
|
|
1460
|
+
} } } : {}
|
|
1461
|
+
));
|
|
1462
|
+
function render() {
|
|
1463
|
+
clear(root);
|
|
1464
|
+
if (state.image) {
|
|
1465
|
+
root.appendChild(el("img", {
|
|
1466
|
+
class: "ag-showcase__img",
|
|
1467
|
+
src: state.image,
|
|
1468
|
+
alt: spec.imageAlt || state.title,
|
|
1469
|
+
loading: "lazy"
|
|
1470
|
+
}));
|
|
1471
|
+
}
|
|
1472
|
+
clear(body);
|
|
1473
|
+
body.appendChild(el("span", { class: "ag-showcase__title", text: state.title }));
|
|
1474
|
+
if (state.author) body.appendChild(el("span", { class: "ag-showcase__by", text: state.author }));
|
|
1475
|
+
if (state.metric) {
|
|
1476
|
+
body.appendChild(el("span", { class: "ag-showcase__metric" }, [
|
|
1477
|
+
el("span", { class: "ag-showcase__mv ag-num", text: String(state.metric.value) }),
|
|
1478
|
+
el("span", { class: "ag-label", text: state.metric.label })
|
|
1479
|
+
]));
|
|
1480
|
+
}
|
|
1481
|
+
if (state.tags.length) {
|
|
1482
|
+
body.appendChild(el("span", { class: "ag-showcase__tags" }, state.tags.map(function(x) {
|
|
1483
|
+
return el("span", { class: "ag-chip", text: x });
|
|
1484
|
+
})));
|
|
1485
|
+
}
|
|
1486
|
+
root.appendChild(body);
|
|
1487
|
+
}
|
|
1488
|
+
render();
|
|
1489
|
+
return {
|
|
1490
|
+
el: root,
|
|
1491
|
+
/** @param {{ title?: string, author?: string, metric?: any, image?: string, tags?: string[] }} patch */
|
|
1492
|
+
set(patch) {
|
|
1493
|
+
if (!patch) return;
|
|
1494
|
+
if (patch.title != null) state.title = patch.title;
|
|
1495
|
+
if (patch.author !== void 0) state.author = patch.author;
|
|
1496
|
+
if (patch.metric !== void 0) state.metric = patch.metric;
|
|
1497
|
+
if (patch.image !== void 0) state.image = patch.image;
|
|
1498
|
+
if (patch.tags) state.tags = patch.tags;
|
|
1499
|
+
render();
|
|
1500
|
+
},
|
|
1501
|
+
destroy() {
|
|
1502
|
+
if (root.parentNode) root.parentNode.removeChild(root);
|
|
1503
|
+
}
|
|
1504
|
+
};
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
// src/static/sdk-libs/game/index.js
|
|
1508
|
+
var game = {
|
|
1509
|
+
/**
|
|
1510
|
+
* The library version, so an app can require a floor before using a newer component — and so
|
|
1511
|
+
* an app that prints it (EXCHANGE LAB does) is not showing a number from three releases ago.
|
|
1512
|
+
* It MUST match the newest entry in the /lib/aimeat-game.css version history; e2e-libs.ts
|
|
1513
|
+
* fails when the two drift, because a version string that never moves is worse than none.
|
|
1514
|
+
*/
|
|
1515
|
+
version: "1.3.0",
|
|
1516
|
+
// ── Shell and navigation ──
|
|
1517
|
+
menu,
|
|
1518
|
+
screen,
|
|
1519
|
+
modal,
|
|
1520
|
+
toast,
|
|
1521
|
+
confirm,
|
|
1522
|
+
// ── Progression ──
|
|
1523
|
+
rail,
|
|
1524
|
+
meter,
|
|
1525
|
+
scoreBreakdown,
|
|
1526
|
+
badge,
|
|
1527
|
+
comingSoon,
|
|
1528
|
+
counter,
|
|
1529
|
+
streak,
|
|
1530
|
+
// ── Competition and tables ──
|
|
1531
|
+
leaderboard,
|
|
1532
|
+
statGrid,
|
|
1533
|
+
dataTable,
|
|
1534
|
+
card,
|
|
1535
|
+
// ── Units (money and morsels never render in one figure) ──
|
|
1536
|
+
money,
|
|
1537
|
+
morsels,
|
|
1538
|
+
isMoneyCurrency,
|
|
1539
|
+
MONEY_UNIT,
|
|
1540
|
+
// ── Theme, i18n, helpers ──
|
|
1541
|
+
injectStyle,
|
|
1542
|
+
i18n,
|
|
1543
|
+
el,
|
|
1544
|
+
append,
|
|
1545
|
+
$,
|
|
1546
|
+
$$,
|
|
1547
|
+
clear,
|
|
1548
|
+
uid,
|
|
1549
|
+
busy,
|
|
1550
|
+
whileBusy,
|
|
1551
|
+
guardButtons,
|
|
1552
|
+
reducedMotion
|
|
1553
|
+
};
|
|
1554
|
+
attach("game", game);
|
|
1555
|
+
})();
|