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
|
@@ -10,11 +10,17 @@
|
|
|
10
10
|
* @structure mountPill(auth, selector, opts) → render() + event wiring.
|
|
11
11
|
* @usage import { mountPill } from './pill.js'; (auth.mountLoginButton delegates here)
|
|
12
12
|
* @version-history
|
|
13
|
+
* v1.1.0 — 2026-07-25 — The in-pill controls become the platform control cluster (segmented
|
|
14
|
+
* language switch + segmented ☀|☾ mode switch + palette swatch picker, styled by cluster.js),
|
|
15
|
+
* with outside-click/Escape closers for the cluster popovers.
|
|
13
16
|
* v1.0.0 — 2026-07-19 — Extracted from src/routes/libs/auth-lib-part2.ts (SDK-libs migration Phase 3).
|
|
14
17
|
*/
|
|
15
18
|
import { isAppOrigin, restoreSessionFromAppOrigin } from './session.js';
|
|
16
19
|
import { showLoginModal } from './modal.js';
|
|
17
|
-
import { escHtml,
|
|
20
|
+
import { escHtml, modeSwitchHtml, wireModeSwitch, ensureAuthPillStyles, pillInitials } from './theme.js';
|
|
21
|
+
import { readLocales, langSwitchHtml, wireLangSwitch } from './locale.js';
|
|
22
|
+
import { paletteControlHtml, wirePaletteControl } from './palette.js';
|
|
23
|
+
import { ensureClusterStyles, clampPopover } from './cluster.js';
|
|
18
24
|
import { load, remove } from './crypto.js';
|
|
19
25
|
import { emit } from './events.js';
|
|
20
26
|
|
|
@@ -34,6 +40,9 @@ export function mountPill(auth, selector, opts = {}) {
|
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
const i = opts.i18n || {};
|
|
43
|
+
// Languages the APP says it has: opts.locales, else <meta name="aimeat-locales" content="en fi">.
|
|
44
|
+
// Empty when the app declares none or only one, and then no language control renders at all.
|
|
45
|
+
const locales = readLocales(opts);
|
|
37
46
|
// Compact pill (account button + popover on ≤600px) is the mobile-safe DEFAULT on app origins.
|
|
38
47
|
const useCompact = opts.compact !== undefined ? !!opts.compact : isAppOrigin();
|
|
39
48
|
|
|
@@ -66,8 +75,9 @@ export function mountPill(auth, selector, opts = {}) {
|
|
|
66
75
|
+ 'background:rgba(90,65,20,.18);color:#5a4114;border:1px solid rgba(120,85,20,.35);'
|
|
67
76
|
+ 'border-radius:6px;padding:3px 8px;cursor:pointer;font-size:13px;line-height:1">⚙️</button>'
|
|
68
77
|
: '')
|
|
69
|
-
//
|
|
70
|
-
|
|
78
|
+
// The control cluster — language, light/dark mode, palette — inside the pill so every
|
|
79
|
+
// embedding app inherits the SAME three controls for free.
|
|
80
|
+
+ '<span class="aimeat-ctl">' + langSwitchHtml(i, locales) + modeSwitchHtml(i) + paletteControlHtml(i) + '</span>'
|
|
71
81
|
+ '<button id="aimeat-logout-btn" class="aimeat-auth-logout" style="'
|
|
72
82
|
+ 'background:radial-gradient(ellipse at 50% 30%,#ff6b6b 0%,#dc2626 35%,#991b1b 70%,#7f1d1d 100%);'
|
|
73
83
|
+ 'color:#ffd7d7;border:1px solid rgba(220,38,38,.6);border-top-color:rgba(255,130,130,.4);border-bottom-color:rgba(100,20,20,.8);'
|
|
@@ -121,9 +131,9 @@ export function mountPill(auth, selector, opts = {}) {
|
|
|
121
131
|
+ 'transition:transform .15s,box-shadow .15s}'
|
|
122
132
|
+ '.aimeat-sign-btn:hover{transform:translateY(-1px);box-shadow:0 1px 0 rgba(245,230,163,.3) inset,0 -1px 0 rgba(75,53,32,.5) inset,0 5px 16px rgba(0,0,0,.5),0 0 30px rgba(201,168,76,.3)}'
|
|
123
133
|
+ '</style>'
|
|
124
|
-
// Keep the
|
|
134
|
+
// Keep the whole cluster (language + mode + palette) reachable even when signed out.
|
|
125
135
|
+ '<span style="display:inline-flex;align-items:center;gap:10px">'
|
|
126
|
-
+
|
|
136
|
+
+ '<span class="aimeat-ctl">' + langSwitchHtml(i, locales) + modeSwitchHtml(i) + paletteControlHtml(i) + '</span>'
|
|
127
137
|
+ '<button id="aimeat-login-btn" class="aimeat-sign-btn">'
|
|
128
138
|
+ (opts.buttonText || i.signInBtn || '❤️ Sign In') + '</button>'
|
|
129
139
|
+ '</span>';
|
|
@@ -134,9 +144,30 @@ export function mountPill(auth, selector, opts = {}) {
|
|
|
134
144
|
else { showLoginModal(opts, render); }
|
|
135
145
|
});
|
|
136
146
|
}
|
|
137
|
-
|
|
147
|
+
wireModeSwitch(container); // the cluster is present in both signed-in and signed-out markup
|
|
148
|
+
wireLangSwitch(container, i, locales);
|
|
149
|
+
wirePaletteControl(container, clampPopover);
|
|
138
150
|
}
|
|
151
|
+
ensureClusterStyles();
|
|
139
152
|
render();
|
|
153
|
+
// Close any open cluster popover (palette / language list) on an outside click or Escape.
|
|
154
|
+
document.addEventListener('click', (ev) => {
|
|
155
|
+
container.querySelectorAll('.aimeat-pop-wrap.aimeat-open').forEach((w) => {
|
|
156
|
+
if (!w.contains(/** @type {Node} */ (ev.target))) {
|
|
157
|
+
w.classList.remove('aimeat-open');
|
|
158
|
+
var b = w.querySelector('.aimeat-pop-btn');
|
|
159
|
+
if (b) b.setAttribute('aria-expanded', 'false');
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
document.addEventListener('keydown', (ev) => {
|
|
164
|
+
if (ev.key !== 'Escape') return;
|
|
165
|
+
container.querySelectorAll('.aimeat-pop-wrap.aimeat-open').forEach((w) => {
|
|
166
|
+
w.classList.remove('aimeat-open');
|
|
167
|
+
var b = w.querySelector('.aimeat-pop-btn');
|
|
168
|
+
if (b) b.setAttribute('aria-expanded', 'false');
|
|
169
|
+
});
|
|
170
|
+
});
|
|
140
171
|
// Close the compact popover on an outside click or Escape (registered ONCE per mount).
|
|
141
172
|
if (useCompact) {
|
|
142
173
|
var closeCompact = () => {
|
|
@@ -5,10 +5,15 @@
|
|
|
5
5
|
* writes the same 'aimeat-theme' localStorage key + <html data-theme> the SPA uses, and fires an
|
|
6
6
|
* 'aimeat-theme-change' window event), plus escHtml, the compact-pill CSS injector, and the
|
|
7
7
|
* two-letter pill initials. Extracted from auth-lib-part2.ts.
|
|
8
|
-
* @structure escHtml · aimeatReadTheme/aimeatApplyTheme ·
|
|
8
|
+
* @structure escHtml · aimeatReadTheme/aimeatApplyTheme · modeSwitchHtml/wireModeSwitch ·
|
|
9
9
|
* ensureAuthPillStyles · pillInitials.
|
|
10
|
-
* @usage import { escHtml,
|
|
10
|
+
* @usage import { escHtml, modeSwitchHtml, wireModeSwitch } from './theme.js';
|
|
11
11
|
* @version-history
|
|
12
|
+
* v1.2.0 — 2026-07-26 — ?mode= is read first and applied at parse time (aimeatRestoreMode), the
|
|
13
|
+
* same door ?palette= and ?lang= use, so an embedded app follows the embedding page's light/
|
|
14
|
+
* dark instead of its own origin's storage. Not persisted.
|
|
15
|
+
* v1.1.0 — 2026-07-25 — The lone ☾/☀ toggle becomes a segmented ☀|☾ mode switch (both options
|
|
16
|
+
* visible, active marked), styled by cluster.js instead of inline styles.
|
|
12
17
|
* v1.0.0 — 2026-07-19 — Extracted from src/routes/libs/auth-lib-part2.ts (SDK-libs migration Phase 3).
|
|
13
18
|
*/
|
|
14
19
|
|
|
@@ -18,6 +23,13 @@ export function escHtml(s) { const d = document.createElement('div'); d.textCont
|
|
|
18
23
|
var AIMEAT_THEME_KEY = 'aimeat-theme';
|
|
19
24
|
|
|
20
25
|
export function aimeatReadTheme() {
|
|
26
|
+
// ?mode= first, the same door ?palette= and ?lang= use: an app embedded by another page cannot
|
|
27
|
+
// read the choice made on the embedder's origin, so the embedder says it and the app follows.
|
|
28
|
+
// Deliberately not persisted — being embedded in a dark page is not a decision about the app.
|
|
29
|
+
try {
|
|
30
|
+
var u = new URLSearchParams(location.search).get('mode');
|
|
31
|
+
if (u === 'light' || u === 'dark') return u;
|
|
32
|
+
} catch { /* no location */ }
|
|
21
33
|
try { var s = localStorage.getItem(AIMEAT_THEME_KEY); if (s === 'light' || s === 'dark') return s; } catch { /* storage blocked */ }
|
|
22
34
|
var attr = document.documentElement.dataset.theme;
|
|
23
35
|
if (attr === 'light' || attr === 'dark') return attr;
|
|
@@ -30,26 +42,55 @@ export function aimeatApplyTheme(t) {
|
|
|
30
42
|
try { window.dispatchEvent(new CustomEvent('aimeat-theme-change', { detail: { theme: t } })); } catch { /* no window */ }
|
|
31
43
|
}
|
|
32
44
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Adopt an embedder's ?mode= onto <html> at parse time, without persisting it. The app's own
|
|
47
|
+
* light/dark snippet reads localStorage and cannot know it is inside someone else's page; this
|
|
48
|
+
* runs after it and lets the embedding page win for as long as the embed lasts. No URL param
|
|
49
|
+
* means no opinion, so a normally-opened app is untouched.
|
|
50
|
+
*/
|
|
51
|
+
export function aimeatRestoreMode() {
|
|
52
|
+
try {
|
|
53
|
+
var u = new URLSearchParams(location.search).get('mode');
|
|
54
|
+
if (u === 'light' || u === 'dark') document.documentElement.dataset.theme = u;
|
|
55
|
+
} catch { /* no location */ }
|
|
41
56
|
}
|
|
42
57
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
58
|
+
/**
|
|
59
|
+
* The MODE control: a segmented ☀ | ☾ where both options are visible and the active one is
|
|
60
|
+
* marked — the same pattern as the language switch, so the cluster reads as one instrument.
|
|
61
|
+
* Cluster classes come from cluster.js (ensureClusterStyles).
|
|
62
|
+
*/
|
|
63
|
+
export function modeSwitchHtml(i) {
|
|
64
|
+
var cur = aimeatReadTheme();
|
|
65
|
+
var light = i.lightMode || 'Light mode';
|
|
66
|
+
var dark = i.darkMode || 'Dark mode';
|
|
67
|
+
return '<span id="aimeat-mode-switch" class="aimeat-seg" role="group" aria-label="' + escHtml(i.themeLabel || 'Theme') + '">'
|
|
68
|
+
+ '<button type="button" data-mode="light" aria-pressed="' + (cur === 'light') + '" title="' + escHtml(light) + '" aria-label="' + escHtml(light) + '">'
|
|
69
|
+
+ '<span class="seg-ico" aria-hidden="true">☀</span></button>'
|
|
70
|
+
+ '<button type="button" data-mode="dark" aria-pressed="' + (cur === 'dark') + '" title="' + escHtml(dark) + '" aria-label="' + escHtml(dark) + '">'
|
|
71
|
+
+ '<span class="seg-ico" aria-hidden="true">☾</span></button>'
|
|
72
|
+
+ '</span>';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function wireModeSwitch(container) {
|
|
76
|
+
var root = container.querySelector('#aimeat-mode-switch');
|
|
77
|
+
if (!root) return;
|
|
78
|
+
function sync(cur) {
|
|
79
|
+
root.querySelectorAll('button[data-mode]').forEach(function (b) {
|
|
80
|
+
b.setAttribute('aria-pressed', String(b.getAttribute('data-mode') === cur));
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
root.querySelectorAll('button[data-mode]').forEach(function (b) {
|
|
84
|
+
b.addEventListener('click', function () {
|
|
85
|
+
var m = b.getAttribute('data-mode');
|
|
86
|
+
aimeatApplyTheme(m);
|
|
87
|
+
sync(m);
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
// Follow out-of-band changes (the app's own logic, another control instance, the SPA).
|
|
91
|
+
window.addEventListener('aimeat-theme-change', function (ev) {
|
|
92
|
+
var e = /** @type {CustomEvent} */ (ev);
|
|
93
|
+
if (e && e.detail && e.detail.theme) sync(e.detail.theme);
|
|
53
94
|
});
|
|
54
95
|
}
|
|
55
96
|
|
|
@@ -13,12 +13,44 @@
|
|
|
13
13
|
* await AIMEAT.data.set('key', { value }); await AIMEAT.data.get('key');
|
|
14
14
|
* @version-history
|
|
15
15
|
* v1.0.0 — 2026-07-19 — Migrated from src/routes/lib-data.ts; NODE_URL/NODE_ID now from _core/config.
|
|
16
|
+
* v1.1.0 — 2026-07-25 — Cross-namespace reads: get/getEntry/list/search take { agent, ownerScope };
|
|
17
|
+
* list takes { meta, count } (+ data.count()). Agent-published keys live under the agent's GAII,
|
|
18
|
+
* and an app-grant token gets no automatic owner-scope broadening, so apps had to bypass this
|
|
19
|
+
* library entirely to read their own owner's fleet output. All options are additive.
|
|
16
20
|
*/
|
|
17
21
|
import { NODE_URL, NODE_ID } from '../_core/config.js';
|
|
18
22
|
import { makeSession } from '../_core/session.js';
|
|
19
23
|
const { authFetch } = makeSession('aimeat-data.js');
|
|
20
24
|
import { attach } from '../_core/namespace.js';
|
|
21
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Cross-namespace read scoping, shared by get/getEntry/list/search.
|
|
28
|
+
*
|
|
29
|
+
* Agents publish under their OWN namespace (`name#owner@node`), not the owner's GHII.
|
|
30
|
+
* An owner SESSION gets owner-scope broadening automatically server-side, but an
|
|
31
|
+
* app-grant token (roles:['app']) does not — so an app reading its owner's fleet
|
|
32
|
+
* output must say so explicitly. Before these options the only way to do that was
|
|
33
|
+
* to bypass this library and hand-roll session.fetch calls.
|
|
34
|
+
*
|
|
35
|
+
* @param {{agent?: string, ownerScope?: boolean}} [opts]
|
|
36
|
+
* @returns {URLSearchParams}
|
|
37
|
+
*/
|
|
38
|
+
function scopeParams(opts) {
|
|
39
|
+
const p = new URLSearchParams();
|
|
40
|
+
if (opts?.agent) p.set('agent', opts.agent);
|
|
41
|
+
// `agent` already targets one namespace; sending both is contradictory (the server
|
|
42
|
+
// ignores owner_scope when agent is present), so only one goes on the wire.
|
|
43
|
+
else if (opts?.ownerScope) p.set('owner_scope', 'true');
|
|
44
|
+
return p;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Append params to a path, preserving any query string already on it. */
|
|
48
|
+
function withParams(path, params) {
|
|
49
|
+
const qs = params.toString();
|
|
50
|
+
if (!qs) return path;
|
|
51
|
+
return path + (path.indexOf('?') >= 0 ? '&' : '?') + qs;
|
|
52
|
+
}
|
|
53
|
+
|
|
22
54
|
// ── Memory API (Tier 1, JWT auth) ──
|
|
23
55
|
|
|
24
56
|
const data = {
|
|
@@ -33,11 +65,17 @@ const data = {
|
|
|
33
65
|
// Read a single entry (falls back to public read from app creator if not found or empty).
|
|
34
66
|
// Uses ?soft=1 so a missing key is a clean 200 (value null) — no browser-console 404 noise;
|
|
35
67
|
// the contract is unchanged: resolves null when the key does not exist.
|
|
36
|
-
|
|
37
|
-
|
|
68
|
+
// opts: { agent, ownerScope } — read from one of the owner's agents' namespaces, or
|
|
69
|
+
// across the owner's whole set (GHII + agents). Omitted → unchanged behaviour.
|
|
70
|
+
async get(key, opts) {
|
|
71
|
+
const res = await authFetch(withParams(
|
|
72
|
+
'/v1/memory/' + encodeURIComponent(key) + '?soft=1', scopeParams(opts)));
|
|
38
73
|
var val = res.ok ? res.data.value : null;
|
|
39
74
|
var isEmpty = val == null || (typeof val === 'object' && Object.keys(val).length === 0);
|
|
40
75
|
if (!isEmpty) return val;
|
|
76
|
+
// A scoped read is explicit about where to look; do not silently widen it to the
|
|
77
|
+
// app-creator's public namespace.
|
|
78
|
+
if (opts?.agent || opts?.ownerScope) return val;
|
|
41
79
|
// Fallback: try public read from app creator's namespace
|
|
42
80
|
var creator = document.querySelector('meta[name="aimeat-creator"]')?.getAttribute('content');
|
|
43
81
|
if (!creator) {
|
|
@@ -56,9 +94,10 @@ const data = {
|
|
|
56
94
|
return val;
|
|
57
95
|
},
|
|
58
96
|
|
|
59
|
-
// Read full entry metadata
|
|
60
|
-
async getEntry(key) {
|
|
61
|
-
const res = await authFetch(
|
|
97
|
+
// Read full entry metadata. opts: { agent, ownerScope } as in get().
|
|
98
|
+
async getEntry(key, opts) {
|
|
99
|
+
const res = await authFetch(withParams(
|
|
100
|
+
'/v1/memory/' + encodeURIComponent(key), scopeParams(opts)));
|
|
62
101
|
if (!res.ok) {
|
|
63
102
|
if (res.error?.code === 'NOT_FOUND') return null;
|
|
64
103
|
throw new Error(res.error?.message || 'Failed to get memory');
|
|
@@ -83,21 +122,44 @@ const data = {
|
|
|
83
122
|
return res.data;
|
|
84
123
|
},
|
|
85
124
|
|
|
86
|
-
|
|
125
|
+
/**
|
|
126
|
+
* List memory keys.
|
|
127
|
+
*
|
|
128
|
+
* opts:
|
|
129
|
+
* prefix, visibility, tags — as before
|
|
130
|
+
* agent — list ONE of the owner's agents' namespaces (full GAII `name#owner@node`)
|
|
131
|
+
* ownerScope — list across the owner's GHII + every same-owner agent. An owner session
|
|
132
|
+
* already gets this server-side; an app-grant token needs it stated.
|
|
133
|
+
* meta — omit every `value` and report each entry's `bytes` instead. Use this for
|
|
134
|
+
* any listing you render as a table/board: the default response inlines
|
|
135
|
+
* every value, so a fleet-wide prefix can be megabytes per call.
|
|
136
|
+
* count — return only `{ count }` (server-side COUNT, no values). A cheap
|
|
137
|
+
* "did anything change?" probe; its cache is dropped by any memory write.
|
|
138
|
+
*/
|
|
87
139
|
async list(opts) {
|
|
88
|
-
const params =
|
|
140
|
+
const params = scopeParams(opts);
|
|
89
141
|
if (opts?.prefix) params.set('prefix', opts.prefix);
|
|
90
142
|
if (opts?.visibility) params.set('visibility', opts.visibility);
|
|
91
143
|
if (opts?.tags) params.set('tags', opts.tags.join(','));
|
|
144
|
+
if (opts?.meta) params.set('include', 'meta');
|
|
145
|
+
if (opts?.count) params.set('count', 'true');
|
|
92
146
|
const qs = params.toString();
|
|
93
147
|
const res = await authFetch('/v1/memory' + (qs ? '?' + qs : ''));
|
|
94
148
|
if (!res.ok) throw new Error(res.error?.message || 'Failed to list memory');
|
|
95
149
|
return res.data;
|
|
96
150
|
},
|
|
97
151
|
|
|
152
|
+
/** Cheap change probe: the number of keys under a prefix, no values transferred. */
|
|
153
|
+
async count(opts) {
|
|
154
|
+
const d = await data.list({ ...(opts || {}), count: true });
|
|
155
|
+
return (d && typeof d.count === 'number') ? d.count : null;
|
|
156
|
+
},
|
|
157
|
+
|
|
98
158
|
// Search memory entries
|
|
159
|
+
// opts: { visibility, agent, ownerScope } — scoping as in list().
|
|
99
160
|
async search(query, opts) {
|
|
100
|
-
const params =
|
|
161
|
+
const params = scopeParams(opts);
|
|
162
|
+
params.set('q', query);
|
|
101
163
|
if (opts?.visibility) params.set('visibility', opts.visibility);
|
|
102
164
|
const res = await authFetch('/v1/memory/search?' + params.toString());
|
|
103
165
|
if (!res.ok) throw new Error(res.error?.message || 'Failed to search memory');
|
|
@@ -70,7 +70,14 @@
|
|
|
70
70
|
}) || null;
|
|
71
71
|
},
|
|
72
72
|
/** Commission a task for an agent. Returns the created task ({ id, status, ... }).
|
|
73
|
-
* Created 'queued' by default; task-runner agents auto-activate it.
|
|
73
|
+
* Created 'queued' by default; task-runner agents auto-activate it.
|
|
74
|
+
*
|
|
75
|
+
* task.scope: [{ name, value, type }] — app-defined tags stored ON the task. This is how
|
|
76
|
+
* an app finds its own runs again later: filter `tasks({status:'done'})` on a tag you set,
|
|
77
|
+
* instead of trying to parse the agent's memory-key slug. Pass the same array in a
|
|
78
|
+
* schedule's `task_template.scope` so scheduled runs carry it too.
|
|
79
|
+
* task.verification: { user_expects, technical_checks } — what a good result looks like.
|
|
80
|
+
* Both were silently dropped before v1.1.0. */
|
|
74
81
|
async createTask(name, task) {
|
|
75
82
|
if (!task || !task.description) throw new Error("createTask requires { description }");
|
|
76
83
|
var body = {
|
|
@@ -78,6 +85,25 @@
|
|
|
78
85
|
description: task.description,
|
|
79
86
|
status: task.status || "queued"
|
|
80
87
|
};
|
|
88
|
+
if (Array.isArray(task.scope) && task.scope.length) {
|
|
89
|
+
body.scope = task.scope.map(function(s) {
|
|
90
|
+
return {
|
|
91
|
+
name: s.name,
|
|
92
|
+
value: String(s.value),
|
|
93
|
+
type: s.type || "text",
|
|
94
|
+
...s.description ? { description: s.description } : {}
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (task.verification) {
|
|
99
|
+
var v = task.verification;
|
|
100
|
+
body.verification = {
|
|
101
|
+
user_expects: v.user_expects != null ? v.user_expects : v.userExpects || "",
|
|
102
|
+
technical_checks: v.technical_checks || v.technicalChecks || []
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
if (task.rules) body.rules = task.rules;
|
|
106
|
+
if (task.resources) body.resources = task.resources;
|
|
81
107
|
var data = unwrap(await authFetch2("/v1/agents/" + enc(name) + "/tasks", {
|
|
82
108
|
method: "POST",
|
|
83
109
|
body: JSON.stringify(body)
|
|
@@ -143,14 +169,21 @@
|
|
|
143
169
|
* agent's memory. Returns { key, value } | { key, gone:true } | null. */
|
|
144
170
|
async deliverable(name, id) {
|
|
145
171
|
var task = await agents.getTask(name, id);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
172
|
+
if (!task) return null;
|
|
173
|
+
var key = task.deliverableKey;
|
|
174
|
+
if (key) {
|
|
175
|
+
var data = unwrap(await authFetch2("/v1/memory?agent=" + enc(task.agentGaii) + "&prefix=" + enc(key) + "&per_page=20"), "read deliverable");
|
|
176
|
+
var found = (data.items || []).find(function(i) {
|
|
177
|
+
return i.key === key;
|
|
178
|
+
});
|
|
179
|
+
return found ? { key, value: found.value } : { key, gone: true };
|
|
180
|
+
}
|
|
181
|
+
var byTag = unwrap(await authFetch2("/v1/memory?agent=" + enc(task.agentGaii) + "&tags=" + enc("task:" + id) + "&per_page=20"), "read deliverable by tag");
|
|
182
|
+
var items = (byTag.items || []).slice().sort(function(a, b) {
|
|
183
|
+
return String(b.updated_at || "").localeCompare(String(a.updated_at || ""));
|
|
152
184
|
});
|
|
153
|
-
|
|
185
|
+
if (items.length) return { key: items[0].key, value: items[0].value, viaTag: true };
|
|
186
|
+
return null;
|
|
154
187
|
},
|
|
155
188
|
/** Read a specific memory entry under an agent's namespace (or null). */
|
|
156
189
|
async memory(name, key) {
|