aimeat 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.env.example +9 -4
- package/dist/locales/en.json +28 -0
- package/dist/locales/fi.json +28 -0
- 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/views/inbox.css +1 -1
- package/dist/public/css/views/profile.css +9 -0
- package/dist/public/lib/VENDORED.md +6 -3
- package/dist/public/lib/aimeat-daisyui-bridge.css +39 -2
- package/dist/public/lib/aimeat-theme.css +538 -0
- package/dist/public/lib/fonts/LICENSE.md +11 -4
- package/dist/public/lib/fonts/fraunces-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/fraunces-var-latin.woff2 +0 -0
- package/dist/public/lib/fonts/inter-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/inter-var-latin.woff2 +0 -0
- package/dist/public/lib/fonts/jetbrains-mono-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/jetbrains-mono-var-latin.woff2 +0 -0
- package/dist/public/lib/fonts/space-grotesk-var-latin-ext.woff2 +0 -0
- package/dist/public/lib/fonts/space-grotesk-var-latin.woff2 +0 -0
- package/dist/public/lib/samples/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/views/profile/access-tab/connected-apps.js +81 -5
- package/dist/public/views/profile/extensions-tab.maturity.js +4 -1
- package/dist/public/views/profile/inbox-tab/components.js +17 -1
- package/dist/public/views/profile/inbox-tab/use-thread-ux.js +29 -2
- package/dist/public/views/profile/libraries-tab.js +10 -2
- package/dist/public/views/profile/wallet-tab.js +64 -0
- package/dist/scripts/check-openapi.d.ts +2 -0
- package/dist/scripts/check-openapi.d.ts.map +1 -0
- package/dist/scripts/check-openapi.js +139 -0
- package/dist/scripts/check-openapi.js.map +1 -0
- package/dist/scripts/embed-viewport.d.ts +23 -0
- package/dist/scripts/embed-viewport.d.ts.map +1 -0
- package/dist/scripts/embed-viewport.js +116 -0
- package/dist/scripts/embed-viewport.js.map +1 -0
- package/dist/src/auth/sse-domain-scopes.d.ts +50 -0
- package/dist/src/auth/sse-domain-scopes.d.ts.map +1 -0
- package/dist/src/auth/sse-domain-scopes.js +111 -0
- package/dist/src/auth/sse-domain-scopes.js.map +1 -0
- package/dist/src/cli/connect/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 +4 -2
- package/dist/src/cli/connect/mcp/tools/workspaces.js.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-core.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-core.js +13 -1
- package/dist/src/cli/connect/tool-call-defs-core.js.map +1 -1
- package/dist/src/commerce/__tests__/x402-registry.test.d.ts +2 -0
- package/dist/src/commerce/__tests__/x402-registry.test.d.ts.map +1 -0
- package/dist/src/commerce/__tests__/x402-registry.test.js +105 -0
- package/dist/src/commerce/__tests__/x402-registry.test.js.map +1 -0
- package/dist/src/commerce/evm-address.d.ts +21 -0
- package/dist/src/commerce/evm-address.d.ts.map +1 -0
- package/dist/src/commerce/evm-address.js +94 -0
- package/dist/src/commerce/evm-address.js.map +1 -0
- package/dist/src/commerce/money.d.ts +18 -5
- package/dist/src/commerce/money.d.ts.map +1 -1
- package/dist/src/commerce/money.js +27 -6
- package/dist/src/commerce/money.js.map +1 -1
- package/dist/src/commerce/x402-facilitator.d.ts +64 -13
- package/dist/src/commerce/x402-facilitator.d.ts.map +1 -1
- package/dist/src/commerce/x402-facilitator.js +71 -19
- package/dist/src/commerce/x402-facilitator.js.map +1 -1
- package/dist/src/commerce/x402-handler.d.ts +13 -7
- package/dist/src/commerce/x402-handler.d.ts.map +1 -1
- package/dist/src/commerce/x402-handler.js +23 -10
- package/dist/src/commerce/x402-handler.js.map +1 -1
- package/dist/src/commerce/x402.d.ts +11 -6
- package/dist/src/commerce/x402.d.ts.map +1 -1
- package/dist/src/commerce/x402.js +10 -7
- package/dist/src/commerce/x402.js.map +1 -1
- package/dist/src/config-types.d.ts +12 -0
- package/dist/src/config-types.d.ts.map +1 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +8 -0
- package/dist/src/config.js.map +1 -1
- package/dist/src/data/app-templates/shells.d.ts +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.map +1 -1
- package/dist/src/data/library-packs/sdk.js +32 -8
- package/dist/src/data/library-packs/sdk.js.map +1 -1
- package/dist/src/data/library-packs/vendored.d.ts.map +1 -1
- package/dist/src/data/library-packs/vendored.js +83 -6
- package/dist/src/data/library-packs/vendored.js.map +1 -1
- package/dist/src/generated/api-types.d.ts +478 -19
- package/dist/src/generated/api-types.d.ts.map +1 -1
- package/dist/src/mcp/agent-tasks.d.ts +4 -0
- package/dist/src/mcp/agent-tasks.d.ts.map +1 -1
- package/dist/src/mcp/agent-tasks.js +20 -2
- package/dist/src/mcp/agent-tasks.js.map +1 -1
- package/dist/src/mcp/capabilities.d.ts +7 -1
- package/dist/src/mcp/capabilities.d.ts.map +1 -1
- package/dist/src/mcp/capabilities.js +5 -2
- package/dist/src/mcp/capabilities.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/commerce.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/commerce.js +4 -2
- package/dist/src/mcp/catalog/definitions/commerce.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.js +4 -3
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/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/commerce.d.ts.map +1 -1
- package/dist/src/mcp/commerce.js +15 -3
- package/dist/src/mcp/commerce.js.map +1 -1
- package/dist/src/mcp/core-storage.d.ts +23 -0
- package/dist/src/mcp/core-storage.d.ts.map +1 -0
- package/dist/src/mcp/core-storage.js +157 -0
- package/dist/src/mcp/core-storage.js.map +1 -0
- package/dist/src/mcp/core.d.ts +16 -0
- package/dist/src/mcp/core.d.ts.map +1 -1
- package/dist/src/mcp/core.js +75 -119
- package/dist/src/mcp/core.js.map +1 -1
- package/dist/src/mcp/dm-messages.d.ts +4 -0
- package/dist/src/mcp/dm-messages.d.ts.map +1 -1
- package/dist/src/mcp/dm-messages.js +43 -2
- package/dist/src/mcp/dm-messages.js.map +1 -1
- package/dist/src/mcp/exchange.d.ts.map +1 -1
- package/dist/src/mcp/exchange.js +3 -2
- 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 +6 -2
- package/dist/src/mcp/extensions.js.map +1 -1
- package/dist/src/mcp/index.d.ts +5 -0
- package/dist/src/mcp/index.d.ts.map +1 -1
- package/dist/src/mcp/index.js +23 -4
- package/dist/src/mcp/index.js.map +1 -1
- package/dist/src/mcp/memory-namespace-hints.d.ts +33 -0
- package/dist/src/mcp/memory-namespace-hints.d.ts.map +1 -0
- package/dist/src/mcp/memory-namespace-hints.js +60 -0
- package/dist/src/mcp/memory-namespace-hints.js.map +1 -0
- package/dist/src/mcp/workspaces.d.ts +5 -0
- package/dist/src/mcp/workspaces.d.ts.map +1 -1
- package/dist/src/mcp/workspaces.js +5 -3
- package/dist/src/mcp/workspaces.js.map +1 -1
- package/dist/src/models/agent-task-schemas.d.ts +25 -3
- package/dist/src/models/agent-task-schemas.d.ts.map +1 -1
- package/dist/src/models/agent-task-schemas.js +16 -0
- package/dist/src/models/agent-task-schemas.js.map +1 -1
- package/dist/src/models/app-tool-schemas.d.ts +518 -1
- package/dist/src/models/app-tool-schemas.d.ts.map +1 -1
- package/dist/src/models/app-tool-schemas.js +53 -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/agent-tasks/create-read.d.ts +4 -0
- package/dist/src/routes/agent-tasks/create-read.d.ts.map +1 -1
- package/dist/src/routes/agent-tasks/create-read.js +20 -1
- package/dist/src/routes/agent-tasks/create-read.js.map +1 -1
- package/dist/src/routes/agent-tasks/lifecycle.d.ts.map +1 -1
- package/dist/src/routes/agent-tasks/lifecycle.js +10 -0
- package/dist/src/routes/agent-tasks/lifecycle.js.map +1 -1
- package/dist/src/routes/agents/offers.d.ts +2 -0
- package/dist/src/routes/agents/offers.d.ts.map +1 -1
- package/dist/src/routes/agents/offers.js +0 -0
- package/dist/src/routes/agents/offers.js.map +1 -1
- package/dist/src/routes/app-grants.d.ts +6 -0
- package/dist/src/routes/app-grants.d.ts.map +1 -1
- package/dist/src/routes/app-grants.js +55 -25
- package/dist/src/routes/app-grants.js.map +1 -1
- package/dist/src/routes/apps/drafts.d.ts +3 -0
- package/dist/src/routes/apps/drafts.d.ts.map +1 -1
- package/dist/src/routes/apps/drafts.js +63 -1
- package/dist/src/routes/apps/drafts.js.map +1 -1
- package/dist/src/routes/apps/publish.d.ts +2 -0
- package/dist/src/routes/apps/publish.d.ts.map +1 -1
- package/dist/src/routes/apps/publish.js +17 -2
- package/dist/src/routes/apps/publish.js.map +1 -1
- package/dist/src/routes/commerce.d.ts.map +1 -1
- package/dist/src/routes/commerce.js +122 -2
- package/dist/src/routes/commerce.js.map +1 -1
- package/dist/src/routes/exchange-market.d.ts +6 -2
- package/dist/src/routes/exchange-market.d.ts.map +1 -1
- package/dist/src/routes/exchange-market.js +154 -28
- package/dist/src/routes/exchange-market.js.map +1 -1
- package/dist/src/routes/exchange.d.ts.map +1 -1
- package/dist/src/routes/exchange.js +5 -2
- package/dist/src/routes/exchange.js.map +1 -1
- package/dist/src/routes/extensions/actions.d.ts.map +1 -1
- package/dist/src/routes/extensions/actions.js +18 -0
- package/dist/src/routes/extensions/actions.js.map +1 -1
- package/dist/src/routes/extensions/crud.d.ts.map +1 -1
- package/dist/src/routes/extensions/crud.js +36 -3
- package/dist/src/routes/extensions/crud.js.map +1 -1
- package/dist/src/routes/extensions/entitlement-gate.d.ts.map +1 -1
- package/dist/src/routes/extensions/entitlement-gate.js +13 -0
- package/dist/src/routes/extensions/entitlement-gate.js.map +1 -1
- package/dist/src/routes/extensions/manifest.d.ts +6 -0
- package/dist/src/routes/extensions/manifest.d.ts.map +1 -1
- package/dist/src/routes/extensions/manifest.js +68 -1
- package/dist/src/routes/extensions/manifest.js.map +1 -1
- package/dist/src/routes/extensions/pacing.d.ts +31 -0
- package/dist/src/routes/extensions/pacing.d.ts.map +1 -0
- package/dist/src/routes/extensions/pacing.js +73 -0
- package/dist/src/routes/extensions/pacing.js.map +1 -0
- package/dist/src/routes/extensions/paywall.d.ts.map +1 -1
- package/dist/src/routes/extensions/paywall.js +17 -17
- package/dist/src/routes/extensions/paywall.js.map +1 -1
- package/dist/src/routes/memory/crud.d.ts.map +1 -1
- package/dist/src/routes/memory/crud.js +10 -0
- package/dist/src/routes/memory/crud.js.map +1 -1
- package/dist/src/routes/organisms/crud.d.ts +3 -0
- package/dist/src/routes/organisms/crud.d.ts.map +1 -1
- package/dist/src/routes/organisms/crud.js +5 -2
- package/dist/src/routes/organisms/crud.js.map +1 -1
- package/dist/src/routes/organisms/workspace-read.d.ts.map +1 -1
- package/dist/src/routes/organisms/workspace-read.js +7 -2
- package/dist/src/routes/organisms/workspace-read.js.map +1 -1
- package/dist/src/routes/public-stats.d.ts +7 -0
- package/dist/src/routes/public-stats.d.ts.map +1 -1
- package/dist/src/routes/public-stats.js +28 -7
- package/dist/src/routes/public-stats.js.map +1 -1
- package/dist/src/routes/sse.d.ts +7 -0
- package/dist/src/routes/sse.d.ts.map +1 -1
- package/dist/src/routes/sse.js +36 -6
- package/dist/src/routes/sse.js.map +1 -1
- package/dist/src/routes/storage-files.d.ts +11 -0
- package/dist/src/routes/storage-files.d.ts.map +1 -1
- package/dist/src/routes/storage-files.js +58 -51
- package/dist/src/routes/storage-files.js.map +1 -1
- package/dist/src/routes/subdomains.d.ts +4 -0
- package/dist/src/routes/subdomains.d.ts.map +1 -1
- package/dist/src/routes/subdomains.js +42 -5
- package/dist/src/routes/subdomains.js.map +1 -1
- package/dist/src/routes/upload.d.ts +11 -0
- package/dist/src/routes/upload.d.ts.map +1 -1
- package/dist/src/routes/upload.js +108 -28
- package/dist/src/routes/upload.js.map +1 -1
- package/dist/src/routes/webmcp.d.ts.map +1 -1
- package/dist/src/routes/webmcp.js +4 -0
- package/dist/src/routes/webmcp.js.map +1 -1
- package/dist/src/schemas/knowledge-package.d.ts +1 -1
- package/dist/src/server-bootstrap/static-files.d.ts +4 -0
- package/dist/src/server-bootstrap/static-files.d.ts.map +1 -1
- package/dist/src/server-bootstrap/static-files.js +11 -0
- package/dist/src/server-bootstrap/static-files.js.map +1 -1
- package/dist/src/services/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/call-timing.d.ts +51 -0
- package/dist/src/services/call-timing.d.ts.map +1 -0
- package/dist/src/services/call-timing.js +91 -0
- package/dist/src/services/call-timing.js.map +1 -0
- package/dist/src/services/capability-invoke.d.ts +2 -0
- package/dist/src/services/capability-invoke.d.ts.map +1 -1
- package/dist/src/services/capability-invoke.js +10 -0
- package/dist/src/services/capability-invoke.js.map +1 -1
- package/dist/src/services/config-schema.d.ts.map +1 -1
- package/dist/src/services/config-schema.js +6 -0
- package/dist/src/services/config-schema.js.map +1 -1
- package/dist/src/services/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/exchange-market.d.ts +41 -8
- package/dist/src/services/exchange-market.d.ts.map +1 -1
- package/dist/src/services/exchange-market.js +24 -2
- 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 +61 -0
- package/dist/src/services/exchange-projection.d.ts.map +1 -0
- package/dist/src/services/exchange-projection.js +504 -0
- package/dist/src/services/exchange-projection.js.map +1 -0
- package/dist/src/services/exchange-proposals.d.ts.map +1 -1
- package/dist/src/services/exchange-proposals.js +2 -0
- 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-runtime.d.ts +33 -0
- package/dist/src/services/extension-runtime.d.ts.map +1 -1
- package/dist/src/services/extension-runtime.js +52 -0
- package/dist/src/services/extension-runtime.js.map +1 -1
- package/dist/src/services/file-refs.d.ts +105 -0
- package/dist/src/services/file-refs.d.ts.map +1 -0
- package/dist/src/services/file-refs.js +106 -0
- package/dist/src/services/file-refs.js.map +1 -0
- package/dist/src/services/metered-entitlements.d.ts +7 -0
- package/dist/src/services/metered-entitlements.d.ts.map +1 -1
- package/dist/src/services/metered-entitlements.js +4 -0
- package/dist/src/services/metered-entitlements.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/task-files.d.ts +51 -0
- package/dist/src/services/task-files.d.ts.map +1 -0
- package/dist/src/services/task-files.js +58 -0
- package/dist/src/services/task-files.js.map +1 -0
- package/dist/src/services/upload-token.d.ts +29 -0
- package/dist/src/services/upload-token.d.ts.map +1 -1
- package/dist/src/services/upload-token.js +37 -0
- package/dist/src/services/upload-token.js.map +1 -1
- package/dist/src/services/upload-zip.d.ts +2 -0
- package/dist/src/services/upload-zip.d.ts.map +1 -1
- package/dist/src/services/upload-zip.js +5 -1
- package/dist/src/services/upload-zip.js.map +1 -1
- package/dist/src/services/workspace-meta.d.ts +15 -0
- package/dist/src/services/workspace-meta.d.ts.map +1 -1
- package/dist/src/services/workspace-meta.js +17 -0
- package/dist/src/services/workspace-meta.js.map +1 -1
- package/dist/src/services/workspace-provision.d.ts +3 -0
- package/dist/src/services/workspace-provision.d.ts.map +1 -1
- package/dist/src/services/workspace-provision.js +5 -3
- package/dist/src/services/workspace-provision.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.d.ts +1 -0
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.js +10 -0
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/memory.d.ts +2 -0
- package/dist/src/storage/providers/postgres-kysely/methods/memory.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/memory.js +12 -1
- package/dist/src/storage/providers/postgres-kysely/methods/memory.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/organisms.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/organisms.js +5 -1
- package/dist/src/storage/providers/postgres-kysely/methods/organisms.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/migrations/0012_unique_live_app_grant.sql +29 -0
- package/dist/src/storage/providers/sqlite/methods/apps.d.ts +3 -0
- package/dist/src/storage/providers/sqlite/methods/apps.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/apps.js +7 -0
- package/dist/src/storage/providers/sqlite/methods/apps.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/governance.d.ts +1 -0
- package/dist/src/storage/providers/sqlite/methods/governance.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/governance.js +4 -1
- package/dist/src/storage/providers/sqlite/methods/governance.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/owner.d.ts +5 -0
- package/dist/src/storage/providers/sqlite/methods/owner.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/owner.js +8 -0
- package/dist/src/storage/providers/sqlite/methods/owner.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.d.ts +3 -0
- package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.js +20 -0
- package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
- package/dist/src/storage/repositories/app-grant.repository.d.ts +9 -1
- package/dist/src/storage/repositories/app-grant.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/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/organisms-federation.d.ts +29 -0
- package/dist/src/storage/types/organisms-federation.d.ts.map +1 -1
- package/dist/src/utils/app-badge.d.ts.map +1 -1
- package/dist/src/utils/app-badge.js +7 -3
- package/dist/src/utils/app-badge.js.map +1 -1
- package/dist/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/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 +422 -21
- package/dist/static/sdk-libs/dist/aimeat-data.js +50 -8
- 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/live/index.js +71 -4
- package/dist/static/sdk-libs/markdown/index.js +49 -1
- package/package.json +6 -2
package/dist/.env.example
CHANGED
|
@@ -315,10 +315,15 @@ AIMEAT_PORT=40050
|
|
|
315
315
|
# AIMEAT_VAT_RATE_PERCENT=25.5 # Default ALV/VAT rate for money-sale bookings (Finland standard 25.5%); overridable per company.
|
|
316
316
|
# AIMEAT_PLATFORM_STRIPE_KEY= # Legacy alias for AIMEAT_STRIPE_SECRET_KEY (only used if the latter is unset).
|
|
317
317
|
|
|
318
|
-
# ── x402 stablecoin settlement (TARGET-042) — NON-CUSTODIAL
|
|
319
|
-
#
|
|
320
|
-
#
|
|
321
|
-
#
|
|
318
|
+
# ── x402 stablecoin settlement (TARGET-042) — NON-CUSTODIAL stablecoin on a fiat price ──
|
|
319
|
+
# The token follows the price: a USD session settles in USDC, a EUR session in EURC. One seller payout
|
|
320
|
+
# address receives both. The currencies the node advertises are DERIVED from the assets the configured
|
|
321
|
+
# network has, so a currency is never offered unless it can really settle.
|
|
322
|
+
# AIMEAT_PACING_TOLL_DEFAULT=0 # Morsels burned per METERED call when the capability declares no toll of its own. Morsels replenish daily with a hard ceiling, so a non-zero value puts an absolute RATE floor under every capability - including money-priced ones, whose only other brake is the buyer's total budget. Applies on every metered path (app tools, exchange runs, agent work, raw extension invokes). 0 = off (existing billing unchanged).
|
|
323
|
+
# AIMEAT_X402_ENABLED=false # Register the x402 PaymentHandler (settles money sessions via the exact scheme + facilitator). OFF by default: advertise the exact scheme only when the node can settle it.
|
|
324
|
+
# AIMEAT_X402_NETWORK=base-sepolia # Network id in the accepts[] exact scheme: base-sepolia (testnet) | base (mainnet). Both carry USDC + EURC. A parameter, not hardcoded — Solana etc. drop in via the network registry (src/commerce/x402-facilitator.ts).
|
|
325
|
+
# AIMEAT_X402_FACILITATOR_URL=https://x402.org/facilitator # Facilitator /verify + /settle base URL (all calls go through safeFetch). The public x402.org one covers Base Sepolia (USDC and EURC alike) but NOT Base mainnet — mainnet needs a facilitator that serves it, e.g. Coinbase CDP.
|
|
326
|
+
# AIMEAT_X402_RPC_URL= # OPTIONAL read-only JSON-RPC (e.g. https://mainnet.base.org). Used ONLY to check that a seller's payout address is an account, not a contract, before it is saved. Empty = check skipped; a payout setting must not depend on a third party being up.
|
|
322
327
|
# AIMEAT_X402_TEST_FACILITATOR=false # TEST ONLY: an off-chain facilitator double so the x402 chain is E2E-provable without a testnet wallet. NEVER in prod (real settlement = the real facilitator).
|
|
323
328
|
|
|
324
329
|
# ── Crawlers / Content Signals / Web Bot Auth ──────────────────
|
package/dist/locales/en.json
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
"inbox.sending": "Sending…",
|
|
11
11
|
"inbox.reply": "Reply",
|
|
12
12
|
"inbox.quoteReply": "Reply to this message",
|
|
13
|
+
"inbox.copyMessage": "Copy this message to the clipboard",
|
|
14
|
+
"inbox.copied": "Copied",
|
|
13
15
|
"inbox.quoteJump": "Show the original message",
|
|
14
16
|
"inbox.quoteYou": "You",
|
|
15
17
|
"inbox.replyingTo": "Replying to",
|
|
@@ -2538,6 +2540,16 @@
|
|
|
2538
2540
|
"pspRemove": "Remove",
|
|
2539
2541
|
"pspSaved": "Payment key saved",
|
|
2540
2542
|
"pspRemoved": "Payment key removed",
|
|
2543
|
+
"x402Title": "Stablecoin payouts (x402)",
|
|
2544
|
+
"x402Desc": "A different rail from Stripe: a buyer signs a stablecoin payment and the facilitator settles it on-chain straight to this address. The token follows the price — a dollar price settles in USDC, a euro price in EURC — and the same address receives both. Non-custodial: the node holds no key and no funds. Without an address, a stablecoin sale of yours fails.",
|
|
2545
|
+
"x402Configured": "Payout address set",
|
|
2546
|
+
"x402Missing": "No payout address",
|
|
2547
|
+
"x402Save": "Save address",
|
|
2548
|
+
"x402Remove": "Remove",
|
|
2549
|
+
"x402Saved": "Payout address saved",
|
|
2550
|
+
"x402Removed": "Payout address removed. Card and invoice settlement is unaffected.",
|
|
2551
|
+
"x402Invalid": "An address is 0x followed by 40 hex characters.",
|
|
2552
|
+
"x402Testnet": "test network",
|
|
2541
2553
|
"moneyTitle": "Money purchases & sales",
|
|
2542
2554
|
"moneyDesc": "Real-money (EUR/USD) checkout activity — separate from morsels. Funds move through the seller's own payment provider, never the node.",
|
|
2543
2555
|
"moneyPurchases": "Purchases",
|
|
@@ -3035,6 +3047,12 @@
|
|
|
3035
3047
|
"agConfirmRevoke": "Revoke access for \"{name}\"? It loses access immediately.",
|
|
3036
3048
|
"agRevoked": "App access revoked",
|
|
3037
3049
|
"agRevoke": "Revoke",
|
|
3050
|
+
"agScopesToggle": "Show or hide the granted permissions",
|
|
3051
|
+
"agUnusedNote": "{count} of these have not been used in over {days} days.",
|
|
3052
|
+
"agRevokeUnused": "Revoke {count} unused",
|
|
3053
|
+
"agConfirmRevokeUnused": "Revoke access for {count} apps unused for over {days} days? They lose access immediately.",
|
|
3054
|
+
"agRevokedCount": "{count} app grants revoked",
|
|
3055
|
+
"agRevokedSome": "{done} revoked, {failed} failed",
|
|
3038
3056
|
"patTitle": "Agent Access Tokens",
|
|
3039
3057
|
"patDesc": "Create a revocable token an agent can use (as a Bearer header) to log in and test your apps. One token can be shared across all your agents.",
|
|
3040
3058
|
"patLabelRequired": "Give the token a name",
|
|
@@ -3385,6 +3403,11 @@
|
|
|
3385
3403
|
"frontier": "Frontier-safe — a version-drift trap for weaker models; they must read its doc",
|
|
3386
3404
|
"needs-doc": "AIMEAT-authored wrapper — the AI must fetch its doc to use it (no priors)"
|
|
3387
3405
|
},
|
|
3406
|
+
"tierLabel": {
|
|
3407
|
+
"any": "ANY MODEL",
|
|
3408
|
+
"frontier": "VERSION TRAP",
|
|
3409
|
+
"needs-doc": "READ THE DOC"
|
|
3410
|
+
},
|
|
3388
3411
|
"heroDesc": "Get more done with less. AI Chat can handle bigger apps when you hand it ready-made cortex building blocks — reusable UI libraries, schemas, and prompts. Use the same cortex across multiple apps.",
|
|
3389
3412
|
"visibility": {
|
|
3390
3413
|
"private": "Private",
|
|
@@ -4507,6 +4530,11 @@
|
|
|
4507
4530
|
"errFederatedLogin": "Could not reach home node {remoteNode} for federated login.",
|
|
4508
4531
|
"loggedIn": "logged in",
|
|
4509
4532
|
"logoutBtn": "Logout",
|
|
4533
|
+
"switchLanguage": "Language",
|
|
4534
|
+
"themeLabel": "Theme",
|
|
4535
|
+
"lightMode": "Light mode",
|
|
4536
|
+
"darkMode": "Dark mode",
|
|
4537
|
+
"chooseLook": "Choose look",
|
|
4510
4538
|
"usernameLabel": "Username",
|
|
4511
4539
|
"passwordLabel": "Password",
|
|
4512
4540
|
"displayNameLabel": "Display Name",
|
package/dist/locales/fi.json
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
"inbox.sending": "Lähetetään…",
|
|
11
11
|
"inbox.reply": "Vastaa",
|
|
12
12
|
"inbox.quoteReply": "Vastaa tähän viestiin",
|
|
13
|
+
"inbox.copyMessage": "Kopioi tämä viesti leikepöydälle",
|
|
14
|
+
"inbox.copied": "Kopioitu",
|
|
13
15
|
"inbox.quoteJump": "Näytä alkuperäinen viesti",
|
|
14
16
|
"inbox.quoteYou": "Sinä",
|
|
15
17
|
"inbox.replyingTo": "Vastataan:",
|
|
@@ -2538,6 +2540,16 @@
|
|
|
2538
2540
|
"pspRemove": "Poista",
|
|
2539
2541
|
"pspSaved": "Maksuavain tallennettu",
|
|
2540
2542
|
"pspRemoved": "Maksuavain poistettu",
|
|
2543
|
+
"x402Title": "Stablecoin-tilitykset (x402)",
|
|
2544
|
+
"x402Desc": "Eri raide kuin Stripe: ostaja allekirjoittaa stablecoin-maksun ja fasilitaattori tilittää sen ketjussa suoraan tähän osoitteeseen. Rahake määräytyy hinnan mukaan: dollarihinta tilittyy USDC:nä ja eurohinta EURC:nä, ja sama osoite ottaa vastaan molemmat. Ei-säilytyksellinen: noodi ei pidä avainta eikä varoja. Ilman osoitetta stablecoin-myyntisi kaatuu.",
|
|
2545
|
+
"x402Configured": "Tilitysosoite asetettu",
|
|
2546
|
+
"x402Missing": "Ei tilitysosoitetta",
|
|
2547
|
+
"x402Save": "Tallenna osoite",
|
|
2548
|
+
"x402Remove": "Poista",
|
|
2549
|
+
"x402Saved": "Tilitysosoite tallennettu",
|
|
2550
|
+
"x402Removed": "Tilitysosoite poistettu. Kortti- ja laskutilitys ei muutu.",
|
|
2551
|
+
"x402Invalid": "Osoite on 0x ja 40 heksamerkkiä.",
|
|
2552
|
+
"x402Testnet": "testiverkko",
|
|
2541
2553
|
"moneyTitle": "Rahaostot ja -myynnit",
|
|
2542
2554
|
"moneyDesc": "Rahamaksut (EUR/USD) — erillään murusista. Varat liikkuvat myyjän oman maksupalvelun kautta, ei koskaan noodin.",
|
|
2543
2555
|
"moneyPurchases": "Ostot",
|
|
@@ -3035,6 +3047,12 @@
|
|
|
3035
3047
|
"agConfirmRevoke": "Peruutetaanko sovelluksen \"{name}\" pääsy? Se menettää pääsyn välittömästi.",
|
|
3036
3048
|
"agRevoked": "Sovelluksen pääsy peruutettu",
|
|
3037
3049
|
"agRevoke": "Peruuta",
|
|
3050
|
+
"agScopesToggle": "Näytä tai piilota myönnetyt oikeudet",
|
|
3051
|
+
"agUnusedNote": "Näistä {count} on ollut käyttämättä yli {days} päivää.",
|
|
3052
|
+
"agRevokeUnused": "Peruuta {count} käyttämätöntä",
|
|
3053
|
+
"agConfirmRevokeUnused": "Peruutetaanko pääsy {count} sovellukselta, joita ei ole käytetty yli {days} päivään? Ne menettävät pääsyn välittömästi.",
|
|
3054
|
+
"agRevokedCount": "{count} sovelluksen pääsy peruutettu",
|
|
3055
|
+
"agRevokedSome": "{done} peruutettu, {failed} epäonnistui",
|
|
3038
3056
|
"patTitle": "Agenttien käyttötokenit",
|
|
3039
3057
|
"patDesc": "Luo peruutettava token, jota agentti voi käyttää (Bearer-headerina) kirjautuakseen ja testatakseen appejasi. Yhtä tokenia voi jakaa kaikille agenteillesi.",
|
|
3040
3058
|
"patLabelRequired": "Anna tokenille nimi",
|
|
@@ -3385,6 +3403,11 @@
|
|
|
3385
3403
|
"frontier": "Vahvoille malleille turvallinen — versioansa heikommille; niiden on luettava dokumentaatio",
|
|
3386
3404
|
"needs-doc": "AIMEAT:n oma wrapper — tekoälyn on haettava dokumentaatio käyttääkseen sitä (ei ennakkotietoa)"
|
|
3387
3405
|
},
|
|
3406
|
+
"tierLabel": {
|
|
3407
|
+
"any": "KAIKILLE MALLEILLE",
|
|
3408
|
+
"frontier": "VERSIOANSA",
|
|
3409
|
+
"needs-doc": "LUE DOKUMENTTI"
|
|
3410
|
+
},
|
|
3388
3411
|
"heroDesc": "Cortexeilla saat enemmän aikaiseksi vähemmällä. AI Chat suoriutuu isommista sovelluksista kun annat sille valmiita cortex-rakennuspalikoita — uudelleenkäytettäviä UI-kirjastoja, skeemoja ja prompteja. Voit käyttää samaa cortexia useassa sovelluksessa.",
|
|
3389
3412
|
"visibility": {
|
|
3390
3413
|
"private": "Yksityinen",
|
|
@@ -4507,6 +4530,11 @@
|
|
|
4507
4530
|
"errFederatedLogin": "Kotisolmuun {remoteNode} ei saatu yhteyttä federoitua kirjautumista varten.",
|
|
4508
4531
|
"loggedIn": "kirjautuneena",
|
|
4509
4532
|
"logoutBtn": "Kirjaudu ulos",
|
|
4533
|
+
"switchLanguage": "Kieli",
|
|
4534
|
+
"themeLabel": "Teema",
|
|
4535
|
+
"lightMode": "Vaalea tila",
|
|
4536
|
+
"darkMode": "Tumma tila",
|
|
4537
|
+
"chooseLook": "Valitse tyyli",
|
|
4510
4538
|
"usernameLabel": "Käyttäjänimi",
|
|
4511
4539
|
"passwordLabel": "Salasana",
|
|
4512
4540
|
"displayNameLabel": "Näyttönimi",
|
|
@@ -11,6 +11,30 @@
|
|
|
11
11
|
* Usage:
|
|
12
12
|
* AIMEAT.charts.ChartBuilder({ elementId: 'my-chart', type: 'bar', data: {...} })
|
|
13
13
|
* AIMEAT.charts.ChartPanel({ elementId: 'my-chart', chartKey: 'chart:sales-2024', nodeUrl: '...' })
|
|
14
|
+
*
|
|
15
|
+
* @version-history
|
|
16
|
+
* v1.1.2 — 2026-07-25 — One observer, not two. This lib attached its own ResizeObserver that
|
|
17
|
+
* called `chart.resize()` with no arguments; Chart.js already watches the same container and
|
|
18
|
+
* already resizes from the observer entry's contentRect. The two disagree wherever an
|
|
19
|
+
* ancestor carries `transform: scale(k)` — the no-argument call measures with
|
|
20
|
+
* getBoundingClientRect(), which is k times the layout size. Measured while dragging a frame
|
|
21
|
+
* on a zoomable board: 30 canvas style writes for 15 pointer moves, alternating between the
|
|
22
|
+
* right height and exactly k x it (k = 0.31, 0.99, 1.87 all reproduce); a chart left holding
|
|
23
|
+
* the scaled answer stayed at 31% of its box for good. Now the observer exists only for
|
|
24
|
+
* non-responsive charts, and it passes layout pixels instead of re-measuring.
|
|
25
|
+
* v1.1.1 — 2026-07-25 — Give the canvas size back to Chart.js. The injected
|
|
26
|
+
* `.aimeat-chart-container canvas { width:100%!important; height:auto!important }` overrode the
|
|
27
|
+
* inline height Chart.js writes and then watches, so in any height-constrained container the
|
|
28
|
+
* two fought: measured 14 distinct canvas sizes in 3 seconds, visible as a fast flicker between
|
|
29
|
+
* two renderings. Only display:block and max-width remain.
|
|
30
|
+
* v1.1.0 — 2026-07-25 — Charts follow the theme. The palette is resolved from the theme tokens
|
|
31
|
+
* when a chart is drawn, and every chart this lib owns is repainted when the palette or the
|
|
32
|
+
* light/dark mode changes. The old list called itself "the AIMEAT brand palette" and was
|
|
33
|
+
* Tailwind's indigo/violet default: it was neither the house coral nor aware of the five
|
|
34
|
+
* palettes the theme system ships, so every chart in every app was off-brand and stayed that
|
|
35
|
+
* way when the reader switched look. A canvas cannot inherit a CSS variable the way a div can,
|
|
36
|
+
* which is why this needs resolving at draw time plus a repaint, not a stylesheet rule.
|
|
37
|
+
* Datasets that carry their own colours are still left alone.
|
|
14
38
|
*/
|
|
15
39
|
(function (AIMEAT) {
|
|
16
40
|
'use strict';
|
|
@@ -22,13 +46,48 @@
|
|
|
22
46
|
/** Supported Chart.js chart types. */
|
|
23
47
|
var TYPES = ['bar', 'line', 'pie', 'doughnut', 'radar', 'scatter', 'bubble'];
|
|
24
48
|
|
|
25
|
-
/**
|
|
26
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Used when the page has no AIMEAT theme loaded, so a bare Chart.js page still gets a chart
|
|
51
|
+
* with distinguishable series rather than ten black bars.
|
|
52
|
+
*/
|
|
53
|
+
var FALLBACK_PALETTE = [
|
|
27
54
|
'#6366f1', '#8b5cf6', '#a78bfa', '#c4b5fd',
|
|
28
55
|
'#f59e0b', '#10b981', '#ef4444', '#3b82f6',
|
|
29
56
|
'#ec4899', '#14b8a6'
|
|
30
57
|
];
|
|
31
58
|
|
|
59
|
+
/** The theme tokens a chart draws from, in the order a reader should see them. */
|
|
60
|
+
var PALETTE_TOKENS = [
|
|
61
|
+
'--color-primary', '--color-secondary', '--color-accent', '--color-info',
|
|
62
|
+
'--color-success', '--color-warning', '--color-error'
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The palette in effect right now, read from the theme.
|
|
67
|
+
*
|
|
68
|
+
* Resolved per draw rather than once at load: the theme has two axes (light/dark and five
|
|
69
|
+
* palettes) and both can change while the page is open.
|
|
70
|
+
*
|
|
71
|
+
* @param {Element=} host element to resolve against — the tokens live on :root, but resolving
|
|
72
|
+
* against the chart's own container lets a scoped override win.
|
|
73
|
+
* @returns {string[]} colours, or FALLBACK_PALETTE when no theme is present.
|
|
74
|
+
*/
|
|
75
|
+
function themePalette(host) {
|
|
76
|
+
try {
|
|
77
|
+
var cs = window.getComputedStyle(host || document.documentElement);
|
|
78
|
+
var out = [];
|
|
79
|
+
PALETTE_TOKENS.forEach(function (name) {
|
|
80
|
+
var v = String(cs.getPropertyValue(name) || '').trim();
|
|
81
|
+
if (v && out.indexOf(v) === -1) out.push(v);
|
|
82
|
+
});
|
|
83
|
+
/* Two colours cannot carry a multi-series chart, so a half-defined theme falls back whole
|
|
84
|
+
rather than mixing house colours with Tailwind defaults. */
|
|
85
|
+
return out.length >= 3 ? out : FALLBACK_PALETTE;
|
|
86
|
+
} catch (_e) {
|
|
87
|
+
return FALLBACK_PALETTE;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
32
91
|
/** Chart types where each data-point gets its own colour slice. */
|
|
33
92
|
var SLICE_TYPES = ['pie', 'doughnut'];
|
|
34
93
|
|
|
@@ -53,10 +112,15 @@
|
|
|
53
112
|
' max-width: 100%;' +
|
|
54
113
|
' box-sizing: border-box;' +
|
|
55
114
|
'}' +
|
|
115
|
+
/* Chart.js owns the canvas size in responsive mode: it writes style.width/height inline
|
|
116
|
+
and watches the result. These two !important rules overrode that inline height, so the
|
|
117
|
+
canvas rendered at the backing store's own ratio instead, Chart.js's ResizeObserver saw a
|
|
118
|
+
different size and wrote the height again — a two-state oscillation, several times a
|
|
119
|
+
second, whenever the container height was constrained. Two authorities for one value.
|
|
120
|
+
display:block stays (it removes the inline-element baseline gap); the sizing is Chart.js's. */
|
|
56
121
|
'.aimeat-chart-container canvas {' +
|
|
57
122
|
' display: block;' +
|
|
58
|
-
' width: 100
|
|
59
|
-
' height: auto !important;' +
|
|
123
|
+
' max-width: 100%;' +
|
|
60
124
|
'}' +
|
|
61
125
|
'.aimeat-chart-error {' +
|
|
62
126
|
' padding: 20px;' +
|
|
@@ -132,11 +196,13 @@
|
|
|
132
196
|
*
|
|
133
197
|
* @param {object} data Chart.js data object ({ labels, datasets }).
|
|
134
198
|
* @param {string} type Chart type string (e.g. 'bar', 'pie').
|
|
199
|
+
* @param {Element=} host container to resolve the theme against.
|
|
135
200
|
* @returns {object} Cloned data with palette applied.
|
|
136
201
|
*/
|
|
137
|
-
function applyPalette(data, type) {
|
|
202
|
+
function applyPalette(data, type, host) {
|
|
138
203
|
var d = JSON.parse(JSON.stringify(data));
|
|
139
204
|
var isSlice = SLICE_TYPES.indexOf(type) !== -1;
|
|
205
|
+
var PALETTE = themePalette(host);
|
|
140
206
|
|
|
141
207
|
d.datasets.forEach(function (ds, i) {
|
|
142
208
|
if (!ds.backgroundColor) {
|
|
@@ -160,6 +226,65 @@
|
|
|
160
226
|
return d;
|
|
161
227
|
}
|
|
162
228
|
|
|
229
|
+
// ---------------------------------------------------------------------------
|
|
230
|
+
// Following the theme
|
|
231
|
+
// ---------------------------------------------------------------------------
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Every chart this lib currently owns, with the data the CALLER passed.
|
|
235
|
+
*
|
|
236
|
+
* The caller's data is what gets kept, not the drawn data: applyPalette fills in a colour where
|
|
237
|
+
* one was missing, so re-applying it to already-drawn data would find every dataset "already
|
|
238
|
+
* coloured" and change nothing. Recolouring has to start from the original each time, which
|
|
239
|
+
* also keeps the promise that a dataset with its own colour is never overridden.
|
|
240
|
+
*/
|
|
241
|
+
var live = [];
|
|
242
|
+
var watching = false;
|
|
243
|
+
|
|
244
|
+
/** Drop charts whose canvas has left the document, so a long-lived page does not accumulate. */
|
|
245
|
+
function pruneLive() {
|
|
246
|
+
live = live.filter(function (rec) {
|
|
247
|
+
var c = rec.chart;
|
|
248
|
+
return c && c.canvas && c.canvas.isConnected;
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** Repaint every live chart against the theme as it is now. */
|
|
253
|
+
function repaintAll() {
|
|
254
|
+
pruneLive();
|
|
255
|
+
live.forEach(function (rec) {
|
|
256
|
+
try {
|
|
257
|
+
var next = applyPalette(rec.data, rec.type, rec.el);
|
|
258
|
+
rec.chart.data.datasets.forEach(function (ds, i) {
|
|
259
|
+
var src = next.datasets[i];
|
|
260
|
+
if (!src) return;
|
|
261
|
+
ds.backgroundColor = src.backgroundColor;
|
|
262
|
+
ds.borderColor = src.borderColor;
|
|
263
|
+
});
|
|
264
|
+
/* A plain update(), not update('none'): the 'none' mode skips the element style cache
|
|
265
|
+
as well as the animation, so a bar chart kept its old fill while its own legend showed
|
|
266
|
+
the new one. Measured on canvas pixels, not inferred. The colour transition it animates
|
|
267
|
+
instead is the right feel for a palette change. */
|
|
268
|
+
rec.chart.update();
|
|
269
|
+
} catch (_e) { /* one bad chart must not stop the rest */ }
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Watch the theme. A MutationObserver on the two attributes rather than the
|
|
275
|
+
* 'aimeat-palette-change' event, because light/dark has no event of its own and an app is free
|
|
276
|
+
* to set either attribute directly — the attribute is the thing that is actually true.
|
|
277
|
+
*/
|
|
278
|
+
function watchTheme() {
|
|
279
|
+
if (watching || typeof MutationObserver === 'undefined') return;
|
|
280
|
+
watching = true;
|
|
281
|
+
try {
|
|
282
|
+
new MutationObserver(repaintAll).observe(document.documentElement, {
|
|
283
|
+
attributes: true, attributeFilter: ['data-theme', 'data-palette']
|
|
284
|
+
});
|
|
285
|
+
} catch (_e) { watching = false; }
|
|
286
|
+
}
|
|
287
|
+
|
|
163
288
|
/**
|
|
164
289
|
* Create a <canvas> inside the given container, wrapped in the standard
|
|
165
290
|
* .aimeat-chart-container div.
|
|
@@ -178,18 +303,35 @@
|
|
|
178
303
|
}
|
|
179
304
|
|
|
180
305
|
/**
|
|
181
|
-
*
|
|
182
|
-
*
|
|
306
|
+
* Keep a chart sized to its container.
|
|
307
|
+
*
|
|
308
|
+
* A responsive chart is already watched by Chart.js itself, and Chart.js measures the right
|
|
309
|
+
* thing: its own ResizeObserver hands `resize()` the entry's contentRect, which is layout
|
|
310
|
+
* pixels. `chart.resize()` with no arguments measures the container with
|
|
311
|
+
* getBoundingClientRect() instead — and inside an ancestor carrying `transform: scale(k)`, as
|
|
312
|
+
* every zoomable board has, that rect is k times the layout size. Two observers, two answers,
|
|
313
|
+
* one canvas: measured on ORIGAMI while dragging a frame's resize grip, the canvas got two
|
|
314
|
+
* style writes per pointer move, one correct and one exactly k x correct — 30 writes for 15
|
|
315
|
+
* moves at k=0.31, k=0.99 and k=1.87 alike. Without this second observer: 15 writes, one size.
|
|
316
|
+
* A chart left holding the scaled answer stayed at 31% of its box and never recovered.
|
|
317
|
+
*
|
|
318
|
+
* So the observer is only for the non-responsive case, where Chart.js watches nothing — and
|
|
319
|
+
* even there it passes layout pixels explicitly rather than asking for a fresh measurement.
|
|
183
320
|
*
|
|
184
321
|
* @param {object} chart Chart.js instance.
|
|
185
322
|
* @param {HTMLElement} el The outer container element.
|
|
186
323
|
*/
|
|
187
324
|
function observeResize(chart, el) {
|
|
188
325
|
if (typeof ResizeObserver === 'undefined') return;
|
|
326
|
+
if (!chart.options || chart.options.responsive !== false) return;
|
|
189
327
|
|
|
190
328
|
var observer = new ResizeObserver(function () {
|
|
191
329
|
try {
|
|
192
|
-
|
|
330
|
+
/* clientWidth/clientHeight, never the no-argument resize(): these are layout pixels and
|
|
331
|
+
stay true inside a scaled ancestor. The box is the canvas's own parent, which is what
|
|
332
|
+
Chart.js measures. */
|
|
333
|
+
var box = chart.canvas && chart.canvas.parentElement;
|
|
334
|
+
if (box) chart.resize(box.clientWidth, box.clientHeight);
|
|
193
335
|
} catch (_e) {
|
|
194
336
|
// Chart may have been destroyed — silently ignore.
|
|
195
337
|
}
|
|
@@ -293,7 +435,7 @@
|
|
|
293
435
|
|
|
294
436
|
try {
|
|
295
437
|
var canvas = createCanvas(el);
|
|
296
|
-
var chartData = applyPalette(opts.data, opts.type);
|
|
438
|
+
var chartData = applyPalette(opts.data, opts.type, el);
|
|
297
439
|
var chartOptions = buildOptions(opts.title, opts.options);
|
|
298
440
|
|
|
299
441
|
var chart = new window.Chart(canvas, {
|
|
@@ -303,6 +445,9 @@
|
|
|
303
445
|
});
|
|
304
446
|
|
|
305
447
|
observeResize(chart, el);
|
|
448
|
+
pruneLive();
|
|
449
|
+
live.push({ chart: chart, el: el, data: opts.data, type: opts.type });
|
|
450
|
+
watchTheme();
|
|
306
451
|
return chart;
|
|
307
452
|
} catch (err) {
|
|
308
453
|
showError(el, 'Failed to render chart: ' + (err.message || String(err)));
|
|
@@ -441,7 +586,10 @@
|
|
|
441
586
|
var exports = {
|
|
442
587
|
ChartPanel: ChartPanel,
|
|
443
588
|
ChartBuilder: ChartBuilder,
|
|
444
|
-
TYPES: TYPES
|
|
589
|
+
TYPES: TYPES,
|
|
590
|
+
VERSION: '1.1.2',
|
|
591
|
+
/** The palette a chart would draw with right now, for legends and non-canvas visuals. */
|
|
592
|
+
palette: themePalette
|
|
445
593
|
};
|
|
446
594
|
|
|
447
595
|
AIMEAT.register('aimeat-charts', exports);
|