aimeat 3.1.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.env.example +58 -1
- package/dist/build-stamp.json +4 -4
- package/dist/locales/en.json +9225 -9103
- package/dist/locales/es.json +9217 -9095
- package/dist/locales/fi.json +9225 -9103
- package/dist/public/changelog.json +12 -0
- package/dist/public/css/views/admin.css +11 -0
- package/dist/public/css/views/chat.css +388 -0
- package/dist/public/css/views/profile.css +41 -0
- package/dist/public/js/services/admin.js +346 -331
- package/dist/public/js/services/chat.js +190 -0
- package/dist/public/js/services/organism-roles.js +51 -0
- package/dist/public/js/services/organisms.js +5 -25
- package/dist/public/js/services/speech-reader.js +26 -0
- package/dist/public/lib/VENDORED.md +1 -0
- package/dist/public/lib/duckdb-wasm@1.32.0/duckdb-browser-eh.worker.js +14 -0
- package/dist/public/lib/duckdb-wasm@1.32.0/duckdb-browser.js +23 -0
- package/dist/public/lib/duckdb-wasm@1.32.0/duckdb-eh.wasm +0 -0
- package/dist/public/lib/duckdb-wasm@1.32.0/extensions/v1.4.3/wasm_eh/parquet.duckdb_extension.wasm +0 -0
- package/dist/public/lib/vendored-assets.json +19 -0
- package/dist/public/llms-full-template.txt +2706 -0
- package/dist/public/llms-index-template.txt +60 -0
- package/dist/public/robots.node.txt +64 -23
- package/dist/public/spa.html +9 -1
- package/dist/public/views/admin/organism-ownership-tab.js +124 -0
- package/dist/public/views/admin/owners-tab.js +15 -4
- package/dist/public/views/admin/usage-tab.calls.js +120 -0
- package/dist/public/views/admin/usage-tab.js +18 -4
- package/dist/public/views/admin.js +2 -0
- package/dist/public/views/chat/parts.js +257 -0
- package/dist/public/views/chat.js +327 -0
- package/dist/public/views/landing.js +24 -1
- package/dist/public/views/profile/agents/scope-model.js +320 -296
- package/dist/public/views/profile/landing-page.cards.js +1 -0
- package/dist/public/views/profile/organisms/home.js +3 -1
- package/dist/public/views/profile/organisms/members.js +29 -4
- package/dist/public/views/profile/usage-tab.js +204 -0
- package/dist/public/views/profile.js +2 -0
- package/dist/scripts/audit-mcp-schemas.js +41 -0
- package/dist/scripts/audit-mcp-schemas.js.map +1 -1
- package/dist/scripts/build-sdk-libs.d.ts.map +1 -1
- package/dist/scripts/build-sdk-libs.js +1 -0
- package/dist/scripts/build-sdk-libs.js.map +1 -1
- package/dist/scripts/check-ai-disclosure.js +11 -0
- package/dist/scripts/check-ai-disclosure.js.map +1 -1
- package/dist/scripts/check-commit-msg.d.ts +8 -0
- package/dist/scripts/check-commit-msg.d.ts.map +1 -0
- package/dist/scripts/check-commit-msg.js +118 -0
- package/dist/scripts/check-commit-msg.js.map +1 -0
- package/dist/scripts/check-denial-coverage.d.ts +29 -0
- package/dist/scripts/check-denial-coverage.d.ts.map +1 -0
- package/dist/scripts/check-denial-coverage.js +237 -0
- package/dist/scripts/check-denial-coverage.js.map +1 -0
- package/dist/scripts/check-ext-entrypoints.js +14 -2
- package/dist/scripts/check-ext-entrypoints.js.map +1 -1
- package/dist/scripts/check-liaison-surface.js +27 -2
- package/dist/scripts/check-liaison-surface.js.map +1 -1
- package/dist/scripts/check-locales.js +38 -0
- package/dist/scripts/check-locales.js.map +1 -1
- package/dist/scripts/check-outbound-fetch.d.ts.map +1 -1
- package/dist/scripts/check-outbound-fetch.js +16 -2
- package/dist/scripts/check-outbound-fetch.js.map +1 -1
- package/dist/scripts/check-route-scopes.d.ts.map +1 -1
- package/dist/scripts/check-route-scopes.js +33 -4
- package/dist/scripts/check-route-scopes.js.map +1 -1
- package/dist/scripts/check-shared-implementation.js +28 -11
- package/dist/scripts/check-shared-implementation.js.map +1 -1
- package/dist/scripts/check-sse-parity.js +14 -0
- package/dist/scripts/check-sse-parity.js.map +1 -1
- package/dist/scripts/check-trusted-keys.d.ts +90 -1
- package/dist/scripts/check-trusted-keys.d.ts.map +1 -1
- package/dist/scripts/check-trusted-keys.js +521 -52
- package/dist/scripts/check-trusted-keys.js.map +1 -1
- package/dist/scripts/indexnow.js +9 -7
- package/dist/scripts/indexnow.js.map +1 -1
- package/dist/src/auth/middleware.d.ts +69 -6
- package/dist/src/auth/middleware.d.ts.map +1 -1
- package/dist/src/auth/middleware.js +130 -28
- package/dist/src/auth/middleware.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/agent-tasks.d.ts +5 -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 +20 -2
- package/dist/src/cli/connect/mcp/tools/agent-tasks.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/agent-telemetry.d.ts +7 -1
- package/dist/src/cli/connect/mcp/tools/agent-telemetry.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/agent-telemetry.js +24 -0
- package/dist/src/cli/connect/mcp/tools/agent-telemetry.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/apps.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/apps.js +88 -0
- package/dist/src/cli/connect/mcp/tools/apps.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/core.d.ts +7 -0
- package/dist/src/cli/connect/mcp/tools/core.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/core.js +83 -4
- package/dist/src/cli/connect/mcp/tools/core.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/organisms.d.ts +2 -0
- package/dist/src/cli/connect/mcp/tools/organisms.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/organisms.js +16 -0
- package/dist/src/cli/connect/mcp/tools/organisms.js.map +1 -1
- package/dist/src/cli/connect/onboarding-prompt.js +1 -1
- package/dist/src/cli/connect/skill-bundle.js +1 -1
- package/dist/src/cli/connect/tool-call-defs-agent.d.ts +1 -0
- package/dist/src/cli/connect/tool-call-defs-agent.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-agent.js +6 -0
- package/dist/src/cli/connect/tool-call-defs-agent.js.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-app-draft-edit.d.ts +21 -0
- package/dist/src/cli/connect/tool-call-defs-app-draft-edit.d.ts.map +1 -0
- package/dist/src/cli/connect/tool-call-defs-app-draft-edit.js +137 -0
- package/dist/src/cli/connect/tool-call-defs-app-draft-edit.js.map +1 -0
- package/dist/src/cli/connect/tool-call-defs-core.d.ts +1 -0
- package/dist/src/cli/connect/tool-call-defs-core.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-core.js +30 -0
- package/dist/src/cli/connect/tool-call-defs-core.js.map +1 -1
- package/dist/src/cli/connect/tool-call.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call.js +2 -0
- package/dist/src/cli/connect/tool-call.js.map +1 -1
- package/dist/src/config-types-ai.d.ts +76 -0
- package/dist/src/config-types-ai.d.ts.map +1 -0
- package/dist/src/config-types-ai.js +15 -0
- package/dist/src/config-types-ai.js.map +1 -0
- package/dist/src/config-types.d.ts +11 -2
- package/dist/src/config-types.d.ts.map +1 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +25 -4
- package/dist/src/config.js.map +1 -1
- package/dist/src/data/appdev-pitfalls.d.ts +1 -0
- package/dist/src/data/appdev-pitfalls.d.ts.map +1 -1
- package/dist/src/data/appdev-pitfalls.js +11 -0
- package/dist/src/data/appdev-pitfalls.js.map +1 -1
- package/dist/src/data/builtin-skills.d.ts.map +1 -1
- package/dist/src/data/builtin-skills.js +3 -2
- package/dist/src/data/builtin-skills.js.map +1 -1
- package/dist/src/data/digital-signage-package.js +1 -1
- package/dist/src/data/library-packs/sdk.d.ts.map +1 -1
- package/dist/src/data/library-packs/sdk.js +76 -0
- package/dist/src/data/library-packs/sdk.js.map +1 -1
- package/dist/src/data/library-packs/vendored.d.ts.map +1 -1
- package/dist/src/data/library-packs/vendored.js +81 -0
- package/dist/src/data/library-packs/vendored.js.map +1 -1
- package/dist/src/data/library-packs.d.ts +2 -2
- package/dist/src/data/library-packs.js +2 -2
- package/dist/src/data/public-pages.d.ts +13 -0
- package/dist/src/data/public-pages.d.ts.map +1 -1
- package/dist/src/data/public-pages.js +153 -113
- package/dist/src/data/public-pages.js.map +1 -1
- package/dist/src/generated/api-types.d.ts +2251 -102
- package/dist/src/generated/api-types.d.ts.map +1 -1
- package/dist/src/index-start.d.ts.map +1 -1
- package/dist/src/index-start.js +21 -1
- package/dist/src/index-start.js.map +1 -1
- package/dist/src/mcp/agent-tasks.d.ts +16 -0
- package/dist/src/mcp/agent-tasks.d.ts.map +1 -1
- package/dist/src/mcp/agent-tasks.js +84 -54
- package/dist/src/mcp/agent-tasks.js.map +1 -1
- package/dist/src/mcp/agent-telemetry.d.ts +6 -1
- package/dist/src/mcp/agent-telemetry.d.ts.map +1 -1
- package/dist/src/mcp/agent-telemetry.js +37 -1
- package/dist/src/mcp/agent-telemetry.js.map +1 -1
- package/dist/src/mcp/ai-image.d.ts +22 -0
- package/dist/src/mcp/ai-image.d.ts.map +1 -0
- package/dist/src/mcp/ai-image.js +60 -0
- package/dist/src/mcp/ai-image.js.map +1 -0
- package/dist/src/mcp/annotations.d.ts +5 -0
- package/dist/src/mcp/annotations.d.ts.map +1 -1
- package/dist/src/mcp/annotations.js +23 -0
- package/dist/src/mcp/annotations.js.map +1 -1
- package/dist/src/mcp/apps-draft-edit.d.ts +28 -0
- package/dist/src/mcp/apps-draft-edit.d.ts.map +1 -0
- package/dist/src/mcp/apps-draft-edit.js +164 -0
- package/dist/src/mcp/apps-draft-edit.js.map +1 -0
- package/dist/src/mcp/apps-screenshot.d.ts +26 -0
- package/dist/src/mcp/apps-screenshot.d.ts.map +1 -0
- package/dist/src/mcp/apps-screenshot.js +39 -0
- package/dist/src/mcp/apps-screenshot.js.map +1 -0
- package/dist/src/mcp/catalog/definitions/agent-messaging.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/agent-messaging.js +18 -0
- package/dist/src/mcp/catalog/definitions/agent-messaging.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.d.ts +1 -0
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.js +59 -0
- package/dist/src/mcp/catalog/definitions/discovery-work-boards.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/organisms-workspaces-apps.d.ts +3 -0
- package/dist/src/mcp/catalog/definitions/organisms-workspaces-apps.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/organisms-workspaces-apps.js +96 -2
- package/dist/src/mcp/catalog/definitions/organisms-workspaces-apps.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.d.ts +2 -0
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js +7 -3
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js.map +1 -1
- package/dist/src/mcp/catalog/scopes.d.ts.map +1 -1
- package/dist/src/mcp/catalog/scopes.js +34 -1
- package/dist/src/mcp/catalog/scopes.js.map +1 -1
- package/dist/src/mcp/catalog/surfaces.d.ts.map +1 -1
- package/dist/src/mcp/catalog/surfaces.js +26 -7
- package/dist/src/mcp/catalog/surfaces.js.map +1 -1
- package/dist/src/mcp/core-admin.d.ts +7 -3
- package/dist/src/mcp/core-admin.d.ts.map +1 -1
- package/dist/src/mcp/core-admin.js +60 -3
- package/dist/src/mcp/core-admin.js.map +1 -1
- package/dist/src/mcp/core-datapackage.d.ts +32 -0
- package/dist/src/mcp/core-datapackage.d.ts.map +1 -0
- package/dist/src/mcp/core-datapackage.js +188 -0
- package/dist/src/mcp/core-datapackage.js.map +1 -0
- package/dist/src/mcp/core-storage.d.ts +7 -3
- package/dist/src/mcp/core-storage.d.ts.map +1 -1
- package/dist/src/mcp/core-storage.js +27 -4
- package/dist/src/mcp/core-storage.js.map +1 -1
- package/dist/src/mcp/core.d.ts.map +1 -1
- package/dist/src/mcp/core.js +3 -0
- package/dist/src/mcp/core.js.map +1 -1
- package/dist/src/mcp/extensions.d.ts.map +1 -1
- package/dist/src/mcp/extensions.js +11 -1
- package/dist/src/mcp/extensions.js.map +1 -1
- package/dist/src/mcp/index.d.ts +9 -0
- package/dist/src/mcp/index.d.ts.map +1 -1
- package/dist/src/mcp/index.js +43 -2
- package/dist/src/mcp/index.js.map +1 -1
- package/dist/src/mcp/organisms-email-invites.d.ts.map +1 -1
- package/dist/src/mcp/organisms-email-invites.js +2 -1
- package/dist/src/mcp/organisms-email-invites.js.map +1 -1
- package/dist/src/mcp/organisms-name-invites.d.ts.map +1 -1
- package/dist/src/mcp/organisms-name-invites.js +40 -1
- package/dist/src/mcp/organisms-name-invites.js.map +1 -1
- package/dist/src/mcp/organisms.d.ts.map +1 -1
- package/dist/src/mcp/organisms.js +6 -1
- package/dist/src/mcp/organisms.js.map +1 -1
- package/dist/src/mcp/tool-usage-wrap.d.ts +9 -0
- package/dist/src/mcp/tool-usage-wrap.d.ts.map +1 -0
- package/dist/src/mcp/tool-usage-wrap.js +87 -0
- package/dist/src/mcp/tool-usage-wrap.js.map +1 -0
- package/dist/src/mcp/workspaces.d.ts.map +1 -1
- package/dist/src/mcp/workspaces.js +9 -0
- package/dist/src/mcp/workspaces.js.map +1 -1
- package/dist/src/middleware/idempotency.d.ts +6 -0
- package/dist/src/middleware/idempotency.d.ts.map +1 -1
- package/dist/src/middleware/idempotency.js +23 -2
- package/dist/src/middleware/idempotency.js.map +1 -1
- package/dist/src/models/agent-task-schemas.d.ts.map +1 -1
- package/dist/src/models/agent-task-schemas.js +12 -1
- package/dist/src/models/agent-task-schemas.js.map +1 -1
- package/dist/src/models/webhook-schemas.d.ts +2 -2
- package/dist/src/models/workflow-schemas.d.ts +178 -1
- package/dist/src/models/workflow-schemas.d.ts.map +1 -1
- package/dist/src/models/workflow-schemas.js +75 -0
- package/dist/src/models/workflow-schemas.js.map +1 -1
- package/dist/src/routes/admin-extensions.d.ts +4 -0
- package/dist/src/routes/admin-extensions.d.ts.map +1 -1
- package/dist/src/routes/admin-extensions.js +135 -142
- package/dist/src/routes/admin-extensions.js.map +1 -1
- package/dist/src/routes/admin-monitoring.d.ts +2 -0
- package/dist/src/routes/admin-monitoring.d.ts.map +1 -1
- package/dist/src/routes/admin-monitoring.js +32 -0
- package/dist/src/routes/admin-monitoring.js.map +1 -1
- package/dist/src/routes/admin-organisms.d.ts +28 -0
- package/dist/src/routes/admin-organisms.d.ts.map +1 -0
- package/dist/src/routes/admin-organisms.js +99 -0
- package/dist/src/routes/admin-organisms.js.map +1 -0
- package/dist/src/routes/admin-usage.d.ts +33 -0
- package/dist/src/routes/admin-usage.d.ts.map +1 -0
- package/dist/src/routes/admin-usage.js +198 -0
- package/dist/src/routes/admin-usage.js.map +1 -0
- package/dist/src/routes/agent-conventions.d.ts.map +1 -1
- package/dist/src/routes/agent-conventions.js +4 -2
- package/dist/src/routes/agent-conventions.js.map +1 -1
- package/dist/src/routes/agent-docs.d.ts +4 -4
- package/dist/src/routes/agent-docs.js +145 -145
- package/dist/src/routes/agent-docs.js.map +1 -1
- package/dist/src/routes/agent-messages.d.ts +6 -0
- package/dist/src/routes/agent-messages.d.ts.map +1 -1
- package/dist/src/routes/agent-messages.js +23 -1
- package/dist/src/routes/agent-messages.js.map +1 -1
- package/dist/src/routes/agent-tasks/completion.d.ts +5 -0
- package/dist/src/routes/agent-tasks/completion.d.ts.map +1 -1
- package/dist/src/routes/agent-tasks/completion.js +35 -54
- package/dist/src/routes/agent-tasks/completion.js.map +1 -1
- package/dist/src/routes/agent-tasks/create-read.d.ts.map +1 -1
- package/dist/src/routes/agent-tasks/create-read.js +8 -1
- package/dist/src/routes/agent-tasks/create-read.js.map +1 -1
- package/dist/src/routes/agent-tasks/lifecycle.d.ts +4 -1
- package/dist/src/routes/agent-tasks/lifecycle.d.ts.map +1 -1
- package/dist/src/routes/agent-tasks/lifecycle.js +80 -2
- package/dist/src/routes/agent-tasks/lifecycle.js.map +1 -1
- package/dist/src/routes/agents/device-auth.d.ts.map +1 -1
- package/dist/src/routes/agents/device-auth.js +27 -4
- package/dist/src/routes/agents/device-auth.js.map +1 -1
- package/dist/src/routes/ai.d.ts +5 -0
- package/dist/src/routes/ai.d.ts.map +1 -1
- package/dist/src/routes/ai.js +51 -1
- package/dist/src/routes/ai.js.map +1 -1
- package/dist/src/routes/app-grants.d.ts.map +1 -1
- package/dist/src/routes/app-grants.js +5 -0
- package/dist/src/routes/app-grants.js.map +1 -1
- package/dist/src/routes/apps/drafts.d.ts +6 -0
- package/dist/src/routes/apps/drafts.d.ts.map +1 -1
- package/dist/src/routes/apps/drafts.js +133 -1
- package/dist/src/routes/apps/drafts.js.map +1 -1
- package/dist/src/routes/apps/read.d.ts +4 -0
- package/dist/src/routes/apps/read.d.ts.map +1 -1
- package/dist/src/routes/apps/read.js +47 -2
- package/dist/src/routes/apps/read.js.map +1 -1
- package/dist/src/routes/auth-otk.d.ts +28 -0
- package/dist/src/routes/auth-otk.d.ts.map +1 -0
- package/dist/src/routes/auth-otk.js +190 -0
- package/dist/src/routes/auth-otk.js.map +1 -0
- package/dist/src/routes/auth.d.ts +17 -0
- package/dist/src/routes/auth.d.ts.map +1 -1
- package/dist/src/routes/auth.js +44 -153
- package/dist/src/routes/auth.js.map +1 -1
- package/dist/src/routes/bootstrap.d.ts +6 -0
- package/dist/src/routes/bootstrap.d.ts.map +1 -1
- package/dist/src/routes/bootstrap.js +47 -20
- package/dist/src/routes/bootstrap.js.map +1 -1
- package/dist/src/routes/capabilities.d.ts +17 -0
- package/dist/src/routes/capabilities.d.ts.map +1 -1
- package/dist/src/routes/capabilities.js +187 -4
- package/dist/src/routes/capabilities.js.map +1 -1
- package/dist/src/routes/chat.d.ts +23 -0
- package/dist/src/routes/chat.d.ts.map +1 -0
- package/dist/src/routes/chat.js +165 -0
- package/dist/src/routes/chat.js.map +1 -0
- package/dist/src/routes/commerce.js +4 -4
- package/dist/src/routes/commerce.js.map +1 -1
- package/dist/src/routes/datapackages.d.ts +35 -0
- package/dist/src/routes/datapackages.d.ts.map +1 -0
- package/dist/src/routes/datapackages.js +217 -0
- package/dist/src/routes/datapackages.js.map +1 -0
- package/dist/src/routes/disputes.d.ts +27 -0
- package/dist/src/routes/disputes.d.ts.map +1 -1
- package/dist/src/routes/disputes.js +74 -79
- package/dist/src/routes/disputes.js.map +1 -1
- package/dist/src/routes/ecosystem-apps-advisories.d.ts +16 -0
- package/dist/src/routes/ecosystem-apps-advisories.d.ts.map +1 -0
- package/dist/src/routes/ecosystem-apps-advisories.js +104 -0
- package/dist/src/routes/ecosystem-apps-advisories.js.map +1 -0
- package/dist/src/routes/ecosystem-apps.d.ts +6 -0
- package/dist/src/routes/ecosystem-apps.d.ts.map +1 -1
- package/dist/src/routes/ecosystem-apps.js +31 -99
- package/dist/src/routes/ecosystem-apps.js.map +1 -1
- package/dist/src/routes/extensions/actions.d.ts.map +1 -1
- package/dist/src/routes/extensions/actions.js +29 -1
- package/dist/src/routes/extensions/actions.js.map +1 -1
- package/dist/src/routes/federation-sync/messaging.d.ts +6 -0
- package/dist/src/routes/federation-sync/messaging.d.ts.map +1 -1
- package/dist/src/routes/federation-sync/messaging.js +22 -1
- package/dist/src/routes/federation-sync/messaging.js.map +1 -1
- package/dist/src/routes/federation-sync/routing.d.ts.map +1 -1
- package/dist/src/routes/federation-sync/routing.js +12 -3
- package/dist/src/routes/federation-sync/routing.js.map +1 -1
- package/dist/src/routes/glossary.js +1 -1
- package/dist/src/routes/glossary.js.map +1 -1
- package/dist/src/routes/home/track.d.ts +5 -1
- package/dist/src/routes/home/track.d.ts.map +1 -1
- package/dist/src/routes/home/track.js +20 -6
- package/dist/src/routes/home/track.js.map +1 -1
- package/dist/src/routes/instances/install.d.ts +7 -0
- package/dist/src/routes/instances/install.d.ts.map +1 -1
- package/dist/src/routes/instances/install.js +31 -24
- package/dist/src/routes/instances/install.js.map +1 -1
- package/dist/src/routes/library-packs.d.ts +7 -0
- package/dist/src/routes/library-packs.d.ts.map +1 -1
- package/dist/src/routes/library-packs.js +32 -8
- package/dist/src/routes/library-packs.js.map +1 -1
- package/dist/src/routes/libs.js +1 -1
- package/dist/src/routes/libs.js.map +1 -1
- package/dist/src/routes/markdown-mirrors.js +1 -1
- package/dist/src/routes/markdown-mirrors.js.map +1 -1
- package/dist/src/routes/messages.d.ts +6 -0
- package/dist/src/routes/messages.d.ts.map +1 -1
- package/dist/src/routes/messages.js +15 -3
- package/dist/src/routes/messages.js.map +1 -1
- package/dist/src/routes/odata.d.ts +36 -0
- package/dist/src/routes/odata.d.ts.map +1 -0
- package/dist/src/routes/odata.js +143 -0
- package/dist/src/routes/odata.js.map +1 -0
- package/dist/src/routes/openrouter.d.ts +4 -0
- package/dist/src/routes/openrouter.d.ts.map +1 -1
- package/dist/src/routes/openrouter.js +10 -1
- package/dist/src/routes/openrouter.js.map +1 -1
- package/dist/src/routes/organisms/crud.d.ts +4 -0
- package/dist/src/routes/organisms/crud.d.ts.map +1 -1
- package/dist/src/routes/organisms/crud.js +25 -7
- package/dist/src/routes/organisms/crud.js.map +1 -1
- package/dist/src/routes/organisms/gates.d.ts.map +1 -1
- package/dist/src/routes/organisms/gates.js +19 -2
- package/dist/src/routes/organisms/gates.js.map +1 -1
- package/dist/src/routes/organisms/membership.d.ts +4 -0
- package/dist/src/routes/organisms/membership.d.ts.map +1 -1
- package/dist/src/routes/organisms/membership.js +88 -36
- package/dist/src/routes/organisms/membership.js.map +1 -1
- package/dist/src/routes/organisms/shared.d.ts.map +1 -1
- package/dist/src/routes/organisms/shared.js +2 -1
- package/dist/src/routes/organisms/shared.js.map +1 -1
- package/dist/src/routes/organisms/workspace-access.d.ts +5 -0
- package/dist/src/routes/organisms/workspace-access.d.ts.map +1 -1
- package/dist/src/routes/organisms/workspace-access.js +41 -2
- package/dist/src/routes/organisms/workspace-access.js.map +1 -1
- package/dist/src/routes/organisms/workspace-ops.d.ts +2 -0
- package/dist/src/routes/organisms/workspace-ops.d.ts.map +1 -1
- package/dist/src/routes/organisms/workspace-ops.js +10 -6
- package/dist/src/routes/organisms/workspace-ops.js.map +1 -1
- package/dist/src/routes/organisms/workspace-read.d.ts +3 -0
- package/dist/src/routes/organisms/workspace-read.d.ts.map +1 -1
- package/dist/src/routes/organisms/workspace-read.js +13 -7
- package/dist/src/routes/organisms/workspace-read.js.map +1 -1
- package/dist/src/routes/portal.d.ts +1 -0
- package/dist/src/routes/portal.d.ts.map +1 -1
- package/dist/src/routes/portal.js +13 -0
- package/dist/src/routes/portal.js.map +1 -1
- package/dist/src/routes/schedules.d.ts +4 -0
- package/dist/src/routes/schedules.d.ts.map +1 -1
- package/dist/src/routes/schedules.js +9 -1
- package/dist/src/routes/schedules.js.map +1 -1
- package/dist/src/routes/storage-files.d.ts +23 -0
- package/dist/src/routes/storage-files.d.ts.map +1 -1
- package/dist/src/routes/storage-files.js +103 -82
- package/dist/src/routes/storage-files.js.map +1 -1
- package/dist/src/routes/subdomains.d.ts +9 -1
- package/dist/src/routes/subdomains.d.ts.map +1 -1
- package/dist/src/routes/subdomains.js +55 -1
- package/dist/src/routes/subdomains.js.map +1 -1
- package/dist/src/routes/usage-reports.d.ts +31 -0
- package/dist/src/routes/usage-reports.d.ts.map +1 -0
- package/dist/src/routes/usage-reports.js +107 -0
- package/dist/src/routes/usage-reports.js.map +1 -0
- package/dist/src/routes/validate.d.ts.map +1 -1
- package/dist/src/routes/validate.js +1 -0
- package/dist/src/routes/validate.js.map +1 -1
- package/dist/src/routes/workflows.d.ts.map +1 -1
- package/dist/src/routes/workflows.js +9 -1
- package/dist/src/routes/workflows.js.map +1 -1
- package/dist/src/server-bootstrap/routes-loader.d.ts +2 -0
- package/dist/src/server-bootstrap/routes-loader.d.ts.map +1 -1
- package/dist/src/server-bootstrap/routes-loader.js +32 -2
- package/dist/src/server-bootstrap/routes-loader.js.map +1 -1
- package/dist/src/server-bootstrap/service-init.d.ts.map +1 -1
- package/dist/src/server-bootstrap/service-init.js +12 -7
- package/dist/src/server-bootstrap/service-init.js.map +1 -1
- package/dist/src/server-bootstrap/static-files.d.ts.map +1 -1
- package/dist/src/server-bootstrap/static-files.js +44 -10
- package/dist/src/server-bootstrap/static-files.js.map +1 -1
- package/dist/src/services/agent-task-fanout.d.ts +61 -0
- package/dist/src/services/agent-task-fanout.d.ts.map +1 -1
- package/dist/src/services/agent-task-fanout.js +114 -2
- package/dist/src/services/agent-task-fanout.js.map +1 -1
- package/dist/src/services/agent-task-write.d.ts.map +1 -1
- package/dist/src/services/agent-task-write.js +6 -0
- package/dist/src/services/agent-task-write.js.map +1 -1
- package/dist/src/services/ai-allowance.d.ts +82 -0
- package/dist/src/services/ai-allowance.d.ts.map +1 -0
- package/dist/src/services/ai-allowance.js +117 -0
- package/dist/src/services/ai-allowance.js.map +1 -0
- package/dist/src/services/ai-completion.d.ts +39 -0
- package/dist/src/services/ai-completion.d.ts.map +1 -1
- package/dist/src/services/ai-completion.js +77 -10
- package/dist/src/services/ai-completion.js.map +1 -1
- package/dist/src/services/ai-image.d.ts +70 -0
- package/dist/src/services/ai-image.d.ts.map +1 -0
- package/dist/src/services/ai-image.js +104 -0
- package/dist/src/services/ai-image.js.map +1 -0
- package/dist/src/services/ai-model-defaults.d.ts +45 -0
- package/dist/src/services/ai-model-defaults.d.ts.map +1 -0
- package/dist/src/services/ai-model-defaults.js +42 -0
- package/dist/src/services/ai-model-defaults.js.map +1 -0
- package/dist/src/services/ai-tool-setup.d.ts +5 -1
- package/dist/src/services/ai-tool-setup.d.ts.map +1 -1
- package/dist/src/services/ai-tool-setup.js +36 -0
- package/dist/src/services/ai-tool-setup.js.map +1 -1
- package/dist/src/services/ai-transcription.d.ts +5 -0
- package/dist/src/services/ai-transcription.d.ts.map +1 -1
- package/dist/src/services/ai-transcription.js +10 -2
- package/dist/src/services/ai-transcription.js.map +1 -1
- package/dist/src/services/ai-usage-admin.d.ts +19 -8
- package/dist/src/services/ai-usage-admin.d.ts.map +1 -1
- package/dist/src/services/ai-usage-admin.js +30 -35
- package/dist/src/services/ai-usage-admin.js.map +1 -1
- package/dist/src/services/app-agent-surfaces.js +4 -4
- package/dist/src/services/app-agent-surfaces.js.map +1 -1
- package/dist/src/services/app-artifact-lint.d.ts +4 -0
- package/dist/src/services/app-artifact-lint.d.ts.map +1 -1
- package/dist/src/services/app-artifact-lint.js +49 -0
- package/dist/src/services/app-artifact-lint.js.map +1 -1
- package/dist/src/services/app-draft-edit.d.ts +144 -0
- package/dist/src/services/app-draft-edit.d.ts.map +1 -0
- package/dist/src/services/app-draft-edit.js +203 -0
- package/dist/src/services/app-draft-edit.js.map +1 -0
- package/dist/src/services/app-spec-gate.d.ts +4 -0
- package/dist/src/services/app-spec-gate.d.ts.map +1 -1
- package/dist/src/services/app-spec-gate.js +16 -1
- package/dist/src/services/app-spec-gate.js.map +1 -1
- package/dist/src/services/attachment-duplication.d.ts +4 -0
- package/dist/src/services/attachment-duplication.d.ts.map +1 -1
- package/dist/src/services/attachment-duplication.js +15 -0
- package/dist/src/services/attachment-duplication.js.map +1 -1
- package/dist/src/services/auth-md.js +2 -2
- package/dist/src/services/auth-md.js.map +1 -1
- package/dist/src/services/board-write.d.ts +11 -3
- package/dist/src/services/board-write.d.ts.map +1 -1
- package/dist/src/services/board-write.js +24 -3
- package/dist/src/services/board-write.js.map +1 -1
- package/dist/src/services/capability-record.d.ts.map +1 -1
- package/dist/src/services/capability-record.js +22 -9
- package/dist/src/services/capability-record.js.map +1 -1
- package/dist/src/services/chat-agent.d.ts +36 -0
- package/dist/src/services/chat-agent.d.ts.map +1 -0
- package/dist/src/services/chat-agent.js +123 -0
- package/dist/src/services/chat-agent.js.map +1 -0
- package/dist/src/services/chat-session.d.ts +58 -0
- package/dist/src/services/chat-session.d.ts.map +1 -0
- package/dist/src/services/chat-session.js +151 -0
- package/dist/src/services/chat-session.js.map +1 -0
- package/dist/src/services/chat-threads.d.ts +61 -0
- package/dist/src/services/chat-threads.d.ts.map +1 -0
- package/dist/src/services/chat-threads.js +137 -0
- package/dist/src/services/chat-threads.js.map +1 -0
- package/dist/src/services/config-schema.d.ts.map +1 -1
- package/dist/src/services/config-schema.js +2 -1
- package/dist/src/services/config-schema.js.map +1 -1
- package/dist/src/services/core-jobs.d.ts +2 -0
- package/dist/src/services/core-jobs.d.ts.map +1 -1
- package/dist/src/services/core-jobs.js +11 -0
- package/dist/src/services/core-jobs.js.map +1 -1
- package/dist/src/services/datapackage/contract.d.ts +198 -0
- package/dist/src/services/datapackage/contract.d.ts.map +1 -0
- package/dist/src/services/datapackage/contract.js +140 -0
- package/dist/src/services/datapackage/contract.js.map +1 -0
- package/dist/src/services/datapackage/ext-capability.d.ts +85 -0
- package/dist/src/services/datapackage/ext-capability.d.ts.map +1 -0
- package/dist/src/services/datapackage/ext-capability.js +72 -0
- package/dist/src/services/datapackage/ext-capability.js.map +1 -0
- package/dist/src/services/datapackage/odata.d.ts +92 -0
- package/dist/src/services/datapackage/odata.d.ts.map +1 -0
- package/dist/src/services/datapackage/odata.js +256 -0
- package/dist/src/services/datapackage/odata.js.map +1 -0
- package/dist/src/services/datapackage/odps.d.ts +24 -0
- package/dist/src/services/datapackage/odps.d.ts.map +1 -0
- package/dist/src/services/datapackage/odps.js +183 -0
- package/dist/src/services/datapackage/odps.js.map +1 -0
- package/dist/src/services/datapackage/store.d.ts +143 -0
- package/dist/src/services/datapackage/store.d.ts.map +1 -0
- package/dist/src/services/datapackage/store.js +533 -0
- package/dist/src/services/datapackage/store.js.map +1 -0
- package/dist/src/services/datapackage/table.d.ts +67 -0
- package/dist/src/services/datapackage/table.d.ts.map +1 -0
- package/dist/src/services/datapackage/table.js +0 -0
- package/dist/src/services/datapackage/table.js.map +1 -0
- package/dist/src/services/extension-ctx.d.ts +1 -0
- package/dist/src/services/extension-ctx.d.ts.map +1 -1
- package/dist/src/services/extension-ctx.js +31 -6
- package/dist/src/services/extension-ctx.js.map +1 -1
- package/dist/src/services/extension-files.d.ts +20 -0
- package/dist/src/services/extension-files.d.ts.map +1 -1
- package/dist/src/services/extension-files.js +9 -2
- package/dist/src/services/extension-files.js.map +1 -1
- package/dist/src/services/extension-lifecycle.d.ts +3 -0
- package/dist/src/services/extension-lifecycle.d.ts.map +1 -1
- package/dist/src/services/extension-lifecycle.js +2 -26
- package/dist/src/services/extension-lifecycle.js.map +1 -1
- package/dist/src/services/extension-runtime.d.ts +28 -2
- package/dist/src/services/extension-runtime.d.ts.map +1 -1
- package/dist/src/services/extension-runtime.js +22 -0
- package/dist/src/services/extension-runtime.js.map +1 -1
- package/dist/src/services/extension-schedules.d.ts +90 -0
- package/dist/src/services/extension-schedules.d.ts.map +1 -0
- package/dist/src/services/extension-schedules.js +123 -0
- package/dist/src/services/extension-schedules.js.map +1 -0
- package/dist/src/services/extension-system-run.d.ts +91 -0
- package/dist/src/services/extension-system-run.d.ts.map +1 -0
- package/dist/src/services/extension-system-run.js +100 -0
- package/dist/src/services/extension-system-run.js.map +1 -0
- package/dist/src/services/extension-upsert.d.ts +2 -0
- package/dist/src/services/extension-upsert.d.ts.map +1 -1
- package/dist/src/services/extension-upsert.js +6 -24
- package/dist/src/services/extension-upsert.js.map +1 -1
- package/dist/src/services/goose-acp.d.ts +84 -0
- package/dist/src/services/goose-acp.d.ts.map +1 -0
- package/dist/src/services/goose-acp.js +304 -0
- package/dist/src/services/goose-acp.js.map +1 -0
- package/dist/src/services/invitations.d.ts +0 -20
- package/dist/src/services/invitations.d.ts.map +1 -1
- package/dist/src/services/invitations.js +30 -0
- package/dist/src/services/invitations.js.map +1 -1
- package/dist/src/services/job-seeding.d.ts +1 -0
- package/dist/src/services/job-seeding.d.ts.map +1 -1
- package/dist/src/services/job-seeding.js +6 -0
- package/dist/src/services/job-seeding.js.map +1 -1
- package/dist/src/services/ledger-admin.d.ts +18 -4
- package/dist/src/services/ledger-admin.d.ts.map +1 -1
- package/dist/src/services/ledger-admin.js +47 -33
- package/dist/src/services/ledger-admin.js.map +1 -1
- package/dist/src/services/markdown-negotiation.js +1 -1
- package/dist/src/services/markdown-negotiation.js.map +1 -1
- package/dist/src/services/message-broadcast.d.ts.map +1 -1
- package/dist/src/services/message-broadcast.js +29 -1
- package/dist/src/services/message-broadcast.js.map +1 -1
- package/dist/src/services/metered-access.d.ts +9 -2
- package/dist/src/services/metered-access.d.ts.map +1 -1
- package/dist/src/services/metered-access.js +92 -12
- package/dist/src/services/metered-access.js.map +1 -1
- package/dist/src/services/openrouter.d.ts +20 -1
- package/dist/src/services/openrouter.d.ts.map +1 -1
- package/dist/src/services/openrouter.js +66 -0
- package/dist/src/services/openrouter.js.map +1 -1
- package/dist/src/services/organism-import.d.ts.map +1 -1
- package/dist/src/services/organism-import.js +4 -1
- package/dist/src/services/organism-import.js.map +1 -1
- package/dist/src/services/organism-lifecycle.d.ts.map +1 -1
- package/dist/src/services/organism-lifecycle.js +5 -1
- package/dist/src/services/organism-lifecycle.js.map +1 -1
- package/dist/src/services/organism-ownership.d.ts +56 -0
- package/dist/src/services/organism-ownership.d.ts.map +1 -0
- package/dist/src/services/organism-ownership.js +174 -0
- package/dist/src/services/organism-ownership.js.map +1 -0
- package/dist/src/services/organism-privacy.d.ts.map +1 -1
- package/dist/src/services/organism-privacy.js +2 -1
- package/dist/src/services/organism-privacy.js.map +1 -1
- package/dist/src/services/prompt-defaults/tiers-core.js +4 -4
- package/dist/src/services/scheduler-extension-job.d.ts +29 -6
- package/dist/src/services/scheduler-extension-job.d.ts.map +1 -1
- package/dist/src/services/scheduler-extension-job.js +29 -75
- package/dist/src/services/scheduler-extension-job.js.map +1 -1
- package/dist/src/services/scope-vocabulary-migration.d.ts +54 -1
- package/dist/src/services/scope-vocabulary-migration.d.ts.map +1 -1
- package/dist/src/services/scope-vocabulary-migration.js +101 -6
- package/dist/src/services/scope-vocabulary-migration.js.map +1 -1
- package/dist/src/services/screenshot-capture.d.ts +40 -1
- package/dist/src/services/screenshot-capture.d.ts.map +1 -1
- package/dist/src/services/screenshot-capture.js +142 -60
- package/dist/src/services/screenshot-capture.js.map +1 -1
- package/dist/src/services/skill-bundle/generator.js +1 -1
- package/dist/src/services/skill-bundle/generic-adapter.js +1 -1
- package/dist/src/services/skill-bundle/hermes-adapter.js +1 -1
- package/dist/src/services/storage-file-write.d.ts +36 -1
- package/dist/src/services/storage-file-write.d.ts.map +1 -1
- package/dist/src/services/storage-file-write.js +49 -3
- package/dist/src/services/storage-file-write.js.map +1 -1
- package/dist/src/services/task-outcome.d.ts +53 -0
- package/dist/src/services/task-outcome.d.ts.map +1 -0
- package/dist/src/services/task-outcome.js +28 -0
- package/dist/src/services/task-outcome.js.map +1 -0
- package/dist/src/services/usage/archive-job.d.ts +25 -0
- package/dist/src/services/usage/archive-job.d.ts.map +1 -0
- package/dist/src/services/usage/archive-job.js +36 -0
- package/dist/src/services/usage/archive-job.js.map +1 -0
- package/dist/src/services/usage/record-app-open.d.ts +8 -0
- package/dist/src/services/usage/record-app-open.d.ts.map +1 -0
- package/dist/src/services/usage/record-app-open.js +52 -0
- package/dist/src/services/usage/record-app-open.js.map +1 -0
- package/dist/src/services/usage/rollup-cuts.d.ts +44 -0
- package/dist/src/services/usage/rollup-cuts.d.ts.map +1 -0
- package/dist/src/services/usage/rollup-cuts.js +81 -0
- package/dist/src/services/usage/rollup-cuts.js.map +1 -0
- package/dist/src/services/usage/rollup-engine.d.ts +71 -0
- package/dist/src/services/usage/rollup-engine.d.ts.map +1 -0
- package/dist/src/services/usage/rollup-engine.js +237 -0
- package/dist/src/services/usage/rollup-engine.js.map +1 -0
- package/dist/src/services/usage/usage-buffer.d.ts +25 -0
- package/dist/src/services/usage/usage-buffer.d.ts.map +1 -0
- package/dist/src/services/usage/usage-buffer.js +146 -0
- package/dist/src/services/usage/usage-buffer.js.map +1 -0
- package/dist/src/services/usage/usage-read.d.ts +115 -0
- package/dist/src/services/usage/usage-read.d.ts.map +1 -0
- package/dist/src/services/usage/usage-read.js +246 -0
- package/dist/src/services/usage/usage-read.js.map +1 -0
- package/dist/src/services/usage-metering.d.ts +5 -0
- package/dist/src/services/usage-metering.d.ts.map +1 -1
- package/dist/src/services/usage-metering.js +7 -0
- package/dist/src/services/usage-metering.js.map +1 -1
- package/dist/src/services/workflow/engine-human.d.ts +15 -0
- package/dist/src/services/workflow/engine-human.d.ts.map +1 -1
- package/dist/src/services/workflow/engine-human.js +10 -1
- package/dist/src/services/workflow/engine-human.js.map +1 -1
- package/dist/src/services/workflow/engine-steps.d.ts +48 -3
- package/dist/src/services/workflow/engine-steps.d.ts.map +1 -1
- package/dist/src/services/workflow/engine-steps.js +361 -0
- package/dist/src/services/workflow/engine-steps.js.map +1 -1
- package/dist/src/services/workflow/engine.d.ts +1 -0
- package/dist/src/services/workflow/engine.d.ts.map +1 -1
- package/dist/src/services/workflow/engine.js +2 -1
- package/dist/src/services/workflow/engine.js.map +1 -1
- package/dist/src/services/workflow/store.d.ts.map +1 -1
- package/dist/src/services/workflow/store.js +60 -4
- package/dist/src/services/workflow/store.js.map +1 -1
- package/dist/src/services/write-guards.d.ts +27 -1
- package/dist/src/services/write-guards.d.ts.map +1 -1
- package/dist/src/services/write-guards.js +39 -9
- package/dist/src/services/write-guards.js.map +1 -1
- package/dist/src/storage/interface.d.ts +4 -1
- package/dist/src/storage/interface.d.ts.map +1 -1
- package/dist/src/storage/interface.js +1 -0
- package/dist/src/storage/interface.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/db-types.d.ts +119 -0
- package/dist/src/storage/providers/postgres-kysely/db-types.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/index.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/index.js +2 -1
- package/dist/src/storage/providers/postgres-kysely/index.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/agent-tasks.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/agent-tasks.js +3 -0
- package/dist/src/storage/providers/postgres-kysely/methods/agent-tasks.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/agent-usage.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/agent-usage.js +4 -0
- package/dist/src/storage/providers/postgres-kysely/methods/agent-usage.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 +3 -0
- package/dist/src/storage/providers/postgres-kysely/methods/app-grants.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/files.d.ts +2 -0
- package/dist/src/storage/providers/postgres-kysely/methods/files.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/files.js +34 -2
- package/dist/src/storage/providers/postgres-kysely/methods/files.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 +11 -2
- package/dist/src/storage/providers/postgres-kysely/methods/organisms.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/usage.d.ts +32 -0
- package/dist/src/storage/providers/postgres-kysely/methods/usage.d.ts.map +1 -0
- package/dist/src/storage/providers/postgres-kysely/methods/usage.js +336 -0
- package/dist/src/storage/providers/postgres-kysely/methods/usage.js.map +1 -0
- package/dist/src/storage/providers/postgres-kysely/migrations/0036_usage_telemetry.sql +181 -0
- package/dist/src/storage/providers/postgres-kysely/migrations/0037_task_created_by.sql +18 -0
- package/dist/src/storage/providers/postgres-kysely/migrations/0038_organism_owners.sql +31 -0
- package/dist/src/storage/providers/postgres-kysely/migrations/0039_storage_file_utf8_verified.sql +19 -0
- package/dist/src/storage/providers/sqlite/index.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/index.js +3 -1
- package/dist/src/storage/providers/sqlite/index.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/apps.d.ts +1 -0
- package/dist/src/storage/providers/sqlite/methods/apps.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/apps.js +33 -28
- package/dist/src/storage/providers/sqlite/methods/apps.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/governance.d.ts +2 -0
- package/dist/src/storage/providers/sqlite/methods/governance.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/governance.js +25 -4
- package/dist/src/storage/providers/sqlite/methods/governance.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.d.ts +1 -12
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.js +28 -135
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/storage-files.d.ts +38 -0
- package/dist/src/storage/providers/sqlite/methods/storage-files.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/methods/storage-files.js +109 -0
- package/dist/src/storage/providers/sqlite/methods/storage-files.js.map +1 -0
- package/dist/src/storage/providers/sqlite/methods/usage.d.ts +43 -0
- package/dist/src/storage/providers/sqlite/methods/usage.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/methods/usage.js +37 -0
- package/dist/src/storage/providers/sqlite/methods/usage.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/agent-task.d.ts +1 -0
- package/dist/src/storage/providers/sqlite/repos/agent-task.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/agent-task.js +4 -2
- package/dist/src/storage/providers/sqlite/repos/agent-task.js.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/agent-usage.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/agent-usage.js +4 -2
- package/dist/src/storage/providers/sqlite/repos/agent-usage.js.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/community.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/community.js +20 -0
- package/dist/src/storage/providers/sqlite/repos/community.js.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/usage.d.ts +35 -0
- package/dist/src/storage/providers/sqlite/repos/usage.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/usage.js +352 -0
- package/dist/src/storage/providers/sqlite/repos/usage.js.map +1 -0
- package/dist/src/storage/providers/sqlite/schema-tables-1.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-1.js +2 -0
- package/dist/src/storage/providers/sqlite/schema-tables-1.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-3.d.ts +1 -0
- package/dist/src/storage/providers/sqlite/schema-tables-3.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-3.js +1 -0
- package/dist/src/storage/providers/sqlite/schema-tables-3.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-4.d.ts +2 -0
- package/dist/src/storage/providers/sqlite/schema-tables-4.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-4.js +131 -0
- package/dist/src/storage/providers/sqlite/schema-tables-4.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.d.ts +2 -0
- package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.js +155 -130
- package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
- package/dist/src/storage/repositories/app-grant.repository.d.ts +11 -0
- package/dist/src/storage/repositories/app-grant.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/file.repository.d.ts +13 -0
- package/dist/src/storage/repositories/file.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/usage.repository.d.ts +80 -0
- package/dist/src/storage/repositories/usage.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/usage.repository.js +23 -0
- package/dist/src/storage/repositories/usage.repository.js.map +1 -0
- package/dist/src/storage/types/agents-messaging.d.ts +24 -0
- package/dist/src/storage/types/agents-messaging.d.ts.map +1 -1
- package/dist/src/storage/types/agents-messaging.js +1 -0
- package/dist/src/storage/types/agents-messaging.js.map +1 -1
- package/dist/src/storage/types/commerce.d.ts +6 -0
- package/dist/src/storage/types/commerce.d.ts.map +1 -1
- package/dist/src/storage/types/organisms-federation.d.ts +21 -0
- package/dist/src/storage/types/organisms-federation.d.ts.map +1 -1
- package/dist/src/storage/types/usage.d.ts +186 -0
- package/dist/src/storage/types/usage.d.ts.map +1 -0
- package/dist/src/storage/types/usage.js +24 -0
- package/dist/src/storage/types/usage.js.map +1 -0
- package/dist/src/utils/agent-footer.d.ts.map +1 -1
- package/dist/src/utils/agent-footer.js +1 -0
- package/dist/src/utils/agent-footer.js.map +1 -1
- package/dist/src/utils/app-content-type.d.ts +57 -3
- package/dist/src/utils/app-content-type.d.ts.map +1 -1
- package/dist/src/utils/app-content-type.js +81 -12
- package/dist/src/utils/app-content-type.js.map +1 -1
- package/dist/src/utils/env-config/sections-features.d.ts.map +1 -1
- package/dist/src/utils/env-config/sections-features.js +9 -3
- package/dist/src/utils/env-config/sections-features.js.map +1 -1
- package/dist/src/utils/file-download-headers.d.ts +5 -3
- package/dist/src/utils/file-download-headers.d.ts.map +1 -1
- package/dist/src/utils/file-download-headers.js +18 -5
- package/dist/src/utils/file-download-headers.js.map +1 -1
- package/dist/src/utils/http-range.d.ts +151 -0
- package/dist/src/utils/http-range.d.ts.map +1 -0
- package/dist/src/utils/http-range.js +190 -0
- package/dist/src/utils/http-range.js.map +1 -0
- package/dist/src/utils/page-head.d.ts +5 -0
- package/dist/src/utils/page-head.d.ts.map +1 -1
- package/dist/src/utils/page-head.js +10 -1
- package/dist/src/utils/page-head.js.map +1 -1
- package/dist/src/utils/reserved-keys.d.ts +4 -1
- package/dist/src/utils/reserved-keys.d.ts.map +1 -1
- package/dist/src/utils/reserved-keys.js +4 -1
- package/dist/src/utils/reserved-keys.js.map +1 -1
- package/dist/src/utils/scope-coverage.d.ts +21 -0
- package/dist/src/utils/scope-coverage.d.ts.map +1 -1
- package/dist/src/utils/scope-coverage.js +22 -1
- package/dist/src/utils/scope-coverage.js.map +1 -1
- package/dist/static/sdk-libs/datapackage/index.js +336 -0
- package/dist/static/sdk-libs/dist/aimeat-datapackage.js +305 -0
- package/package.json +13 -2
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file public/views/chat/parts.js
|
|
3
|
+
* @description What the chat page is made of: the conversation list, one turn, the work log, and
|
|
4
|
+
* the box a person types into.
|
|
5
|
+
*
|
|
6
|
+
* Two registers share one column. The conversation is what was said; the work log is what was
|
|
7
|
+
* actually done, one line per tool call, and it is shown by default rather than folded away. A
|
|
8
|
+
* chat that reports "done" without showing the calls asks to be believed; this one can be checked.
|
|
9
|
+
* @structure
|
|
10
|
+
* - ThreadList — the person's conversations
|
|
11
|
+
* - Turn — one thing said, with the tools that ran while it was said
|
|
12
|
+
* - WorkLine — one tool call, its status, and what it was
|
|
13
|
+
* - Composer — the box, Enter to send, Shift+Enter for a newline, and a recorder beside it
|
|
14
|
+
* - StatusBar — which agent, what is left to spend, and what is wrong when something is
|
|
15
|
+
* @usage import { ThreadList, Turn, Composer, StatusBar } from './chat/parts.js';
|
|
16
|
+
* @version-history
|
|
17
|
+
* v1.1.0 — 2026-08-16 — Speech both ways: a recording becomes text in the box, which the person
|
|
18
|
+
* reads before sending, and an agent turn can be read aloud.
|
|
19
|
+
* v1.0.0 — 2026-08-16 — Initial.
|
|
20
|
+
*/
|
|
21
|
+
import { h } from 'preact';
|
|
22
|
+
import { useRef, useEffect, useState } from 'preact/hooks';
|
|
23
|
+
import htm from 'htm';
|
|
24
|
+
import { t } from '/js/i18n.js';
|
|
25
|
+
import { Markdown } from '/components/Markdown.js';
|
|
26
|
+
import { VoiceRecorder } from '/components/VoiceRecorder.js';
|
|
27
|
+
import { speak, stop as stopSpeaking, isSpeechSupported, textToParagraphs } from '/js/services/speech-reader.js';
|
|
28
|
+
|
|
29
|
+
const html = htm.bind(h);
|
|
30
|
+
const tr = (key, fallback) => { const v = t(key); return v && v !== key ? v : fallback; };
|
|
31
|
+
|
|
32
|
+
/** hh:mm in the reader's own locale, which is all a turn needs. */
|
|
33
|
+
function timeShort(iso) {
|
|
34
|
+
if (!iso) return '';
|
|
35
|
+
const d = new Date(iso);
|
|
36
|
+
return Number.isNaN(d.getTime()) ? '' : d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* One tool call, as a line in the work log.
|
|
41
|
+
*
|
|
42
|
+
* The status is a word rather than a colour alone: a person who cannot see the difference between
|
|
43
|
+
* two greens still has to be able to tell a call that finished from one that failed.
|
|
44
|
+
*/
|
|
45
|
+
export function WorkLine({ tool }) {
|
|
46
|
+
const status = String(tool.status || 'pending');
|
|
47
|
+
const label = tr(`chat.work.${status}`, status);
|
|
48
|
+
return html`
|
|
49
|
+
<li class="chat-work-line chat-work-line--${status}">
|
|
50
|
+
<span class="chat-work-status">${label}</span>
|
|
51
|
+
<span class="chat-work-title">${tool.title || tr('chat.work.untitled', 'a tool call')}</span>
|
|
52
|
+
</li>
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** The work log for one turn: every tool call it made, in the order it made them. */
|
|
57
|
+
export function WorkLog({ tools }) {
|
|
58
|
+
if (!tools || tools.length === 0) return null;
|
|
59
|
+
return html`
|
|
60
|
+
<div class="chat-work">
|
|
61
|
+
<div class="chat-work-head">${tr('chat.work.title', 'What was done')}</div>
|
|
62
|
+
<ul class="chat-work-list">
|
|
63
|
+
${tools.map((tool, i) => html`<${WorkLine} key=${i} tool=${tool} />`)}
|
|
64
|
+
</ul>
|
|
65
|
+
</div>
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* One turn.
|
|
71
|
+
*
|
|
72
|
+
* The agent's words go through the markdown renderer because the agent writes markdown; the
|
|
73
|
+
* person's do not, because what they typed is what they meant.
|
|
74
|
+
*/
|
|
75
|
+
export function Turn({ turn, id }) {
|
|
76
|
+
const mine = turn.role === 'user';
|
|
77
|
+
const [reading, setReading] = useState(false);
|
|
78
|
+
// A turn that failed before the agent said anything leaves an empty record, and an empty bubble
|
|
79
|
+
// on screen reads as a message that arrived blank. Nothing was said, so nothing is drawn; the
|
|
80
|
+
// error above it is what happened.
|
|
81
|
+
if (!mine && !turn.text && !(turn.tools && turn.tools.length)) return null;
|
|
82
|
+
|
|
83
|
+
const listen = () => {
|
|
84
|
+
if (reading) { stopSpeaking(); setReading(false); return; }
|
|
85
|
+
setReading(speak(id, textToParagraphs(turn.text || '')));
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
return html`
|
|
89
|
+
<div class="chat-turn chat-turn--${mine ? 'user' : 'agent'}">
|
|
90
|
+
<div class="chat-bubble">
|
|
91
|
+
${mine
|
|
92
|
+
? html`<p class="chat-said">${turn.text}</p>`
|
|
93
|
+
: html`<${Markdown} text=${turn.text || ''} />`}
|
|
94
|
+
<${WorkLog} tools=${turn.tools} />
|
|
95
|
+
</div>
|
|
96
|
+
<div class="chat-meta">
|
|
97
|
+
<span>${timeShort(turn.at)}</span>
|
|
98
|
+
${turn.model ? html`<span class="chat-model" title=${tr('chat.modelTitle', 'The model that answered this turn')}>${turn.model}</span>` : ''}
|
|
99
|
+
${!mine && turn.text && isSpeechSupported() ? html`
|
|
100
|
+
<button type="button" class="btn-ghost chat-listen" onClick=${listen}>
|
|
101
|
+
${reading ? tr('chat.stopListening', 'Stop') : tr('chat.listen', 'Listen')}
|
|
102
|
+
</button>` : ''}
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
`;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* What the agent is doing right now, before the turn is over.
|
|
110
|
+
*
|
|
111
|
+
* A person watching a spinner for four minutes cannot tell work from a hang, so the live turn shows
|
|
112
|
+
* the words as they are written and each tool call as it starts.
|
|
113
|
+
*/
|
|
114
|
+
export function LiveTurn({ text, thought, tools, busy }) {
|
|
115
|
+
if (!busy && !text && (!tools || tools.length === 0)) return null;
|
|
116
|
+
return html`
|
|
117
|
+
<div class="chat-turn chat-turn--agent chat-turn--live">
|
|
118
|
+
<div class="chat-bubble">
|
|
119
|
+
${text ? html`<${Markdown} text=${text} />` : ''}
|
|
120
|
+
${!text && thought ? html`<p class="chat-thinking">${thought}</p>` : ''}
|
|
121
|
+
${!text && !thought && busy ? html`<p class="chat-thinking">${tr('chat.working', 'Working…')}</p>` : ''}
|
|
122
|
+
<${WorkLog} tools=${tools} />
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
`;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** A turn that could not run, with the reason and a way to try again. */
|
|
129
|
+
export function TurnError({ message, onRetry }) {
|
|
130
|
+
if (!message) return null;
|
|
131
|
+
return html`
|
|
132
|
+
<div class="chat-error" role="alert">
|
|
133
|
+
<p class="chat-error-msg">${message}</p>
|
|
134
|
+
${onRetry && html`
|
|
135
|
+
<button type="button" class="btn-outline chat-error-retry" onClick=${onRetry}>
|
|
136
|
+
${tr('chat.retry', 'Try again')}
|
|
137
|
+
</button>`}
|
|
138
|
+
</div>
|
|
139
|
+
`;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* The person's conversations.
|
|
144
|
+
*
|
|
145
|
+
* `onClose` is the way back on a phone, where this list covers the conversation and the header that
|
|
146
|
+
* would otherwise carry the control is hidden. Without it, opening the list is a room with no door:
|
|
147
|
+
* the only exit is picking a different conversation than the one you were reading.
|
|
148
|
+
*/
|
|
149
|
+
export function ThreadList({ threads, activeId, onOpen, onNew, onDelete, onClose }) {
|
|
150
|
+
return html`
|
|
151
|
+
<aside class="chat-threads">
|
|
152
|
+
<button type="button" class="btn-ghost chat-threads-close" onClick=${onClose}>
|
|
153
|
+
↩ ${tr('chat.backToChat', 'Back to the conversation')}
|
|
154
|
+
</button>
|
|
155
|
+
<button type="button" class="btn-primary chat-new" onClick=${onNew}>
|
|
156
|
+
${tr('chat.new', 'New conversation')}
|
|
157
|
+
</button>
|
|
158
|
+
${threads.length === 0
|
|
159
|
+
? html`<p class="chat-threads-empty">${tr('chat.noThreads', 'Nothing here yet. Say something and this is where it will be.')}</p>`
|
|
160
|
+
: html`
|
|
161
|
+
<ul class="chat-thread-list">
|
|
162
|
+
${threads.map((thread) => html`
|
|
163
|
+
<li key=${thread.id} class="chat-thread ${thread.id === activeId ? 'chat-thread--active' : ''}">
|
|
164
|
+
<button type="button" class="chat-thread-open" onClick=${() => onOpen(thread.id)}>
|
|
165
|
+
<span class="chat-thread-title">${thread.title}</span>
|
|
166
|
+
<span class="chat-thread-sub">${tr('chat.turnCount', '{n} messages').replace('{n}', String(thread.turns ?? 0))}</span>
|
|
167
|
+
</button>
|
|
168
|
+
<button type="button" class="btn-ghost chat-thread-del"
|
|
169
|
+
aria-label=${tr('chat.delete', 'Delete conversation')}
|
|
170
|
+
onClick=${() => onDelete(thread.id)}>✗</button>
|
|
171
|
+
</li>
|
|
172
|
+
`)}
|
|
173
|
+
</ul>`}
|
|
174
|
+
</aside>
|
|
175
|
+
`;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* The box.
|
|
180
|
+
*
|
|
181
|
+
* Enter sends and Shift+Enter opens a line, which is what every chat does and therefore what a
|
|
182
|
+
* person's hands already expect. The field grows with what is in it up to a ceiling, so a long ask
|
|
183
|
+
* is readable while being written without the composer eating the conversation.
|
|
184
|
+
*/
|
|
185
|
+
export function Composer({ value, onInput, onSend, onStop, onSpeak, busy, disabled, note, listening, voiceMaxSeconds = 300 }) {
|
|
186
|
+
const ref = useRef(null);
|
|
187
|
+
|
|
188
|
+
// Re-measured on a resize as well as on every keystroke. Height depends on WIDTH: a line that
|
|
189
|
+
// fits on a desktop wraps on a phone, and a height measured before the turn left the field
|
|
190
|
+
// scrolling by two pixels behind a scrollbar nobody wanted.
|
|
191
|
+
useEffect(() => {
|
|
192
|
+
const fit = () => {
|
|
193
|
+
const el = ref.current;
|
|
194
|
+
if (!el) return;
|
|
195
|
+
el.style.height = 'auto';
|
|
196
|
+
el.style.height = `${Math.min(el.scrollHeight, 200)}px`;
|
|
197
|
+
};
|
|
198
|
+
fit();
|
|
199
|
+
window.addEventListener('resize', fit);
|
|
200
|
+
return () => window.removeEventListener('resize', fit);
|
|
201
|
+
}, [value]);
|
|
202
|
+
|
|
203
|
+
const keydown = (e) => {
|
|
204
|
+
if (e.key === 'Enter' && !e.shiftKey) {
|
|
205
|
+
e.preventDefault();
|
|
206
|
+
if (!busy && !disabled && value.trim()) onSend();
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
return html`
|
|
211
|
+
<div class="chat-composer">
|
|
212
|
+
${note ? html`<p class="chat-composer-note">${note}</p>` : ''}
|
|
213
|
+
${listening ? html`<p class="chat-composer-note">${tr('chat.hearing', 'Working out what you said…')}</p>` : ''}
|
|
214
|
+
<div class="chat-composer-row">
|
|
215
|
+
<textarea ref=${ref} class="chat-input" rows="1"
|
|
216
|
+
value=${value}
|
|
217
|
+
disabled=${disabled}
|
|
218
|
+
placeholder=${disabled
|
|
219
|
+
? tr('chat.disabledPlaceholder', 'This node has no chat agent yet.')
|
|
220
|
+
: tr('chat.placeholder', 'Ask for something, or describe what you want built.')}
|
|
221
|
+
onInput=${(e) => onInput(e.target.value)}
|
|
222
|
+
onKeyDown=${keydown}></textarea>
|
|
223
|
+
${onSpeak && !busy ? html`
|
|
224
|
+
<${VoiceRecorder} maxSeconds=${voiceMaxSeconds} disabled=${disabled || listening}
|
|
225
|
+
className="btn-outline chat-voice" onRecorded=${(file) => onSpeak(file)} />` : ''}
|
|
226
|
+
${busy
|
|
227
|
+
? html`<button type="button" class="btn-outline chat-send" onClick=${onStop}>${tr('chat.stop', 'Stop')}</button>`
|
|
228
|
+
: html`<button type="button" class="btn-primary chat-send"
|
|
229
|
+
disabled=${disabled || !value.trim()}
|
|
230
|
+
onClick=${onSend}>${tr('chat.send', 'Send')}</button>`}
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
`;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Who is answering, and what it costs.
|
|
238
|
+
*
|
|
239
|
+
* The allowance is shown because a person about to fall back to a free model deserves to have seen
|
|
240
|
+
* it coming. It is a line of text, not a gauge: this is not the thing they came here to look at.
|
|
241
|
+
*/
|
|
242
|
+
export function StatusBar({ status, onReset }) {
|
|
243
|
+
if (!status) return null;
|
|
244
|
+
const remaining = Number(status.allowance_remaining_usd ?? 0);
|
|
245
|
+
return html`
|
|
246
|
+
<div class="chat-status">
|
|
247
|
+
<span class="chat-status-agent">${status.agent_name}</span>
|
|
248
|
+
${status.has_own_key
|
|
249
|
+
? html`<span class="chat-status-key">${tr('chat.ownKey', 'Running on your own OpenRouter key.')}</span>`
|
|
250
|
+
: html`<span class="chat-status-key">${tr('chat.allowance', '{n} USD left of your allowance.').replace('{n}', remaining.toFixed(2))}</span>`}
|
|
251
|
+
${onReset && html`
|
|
252
|
+
<button type="button" class="btn-ghost chat-status-reset"
|
|
253
|
+
title=${tr('chat.resetTitle', 'Start a fresh agent session for this conversation. Needed after changing what the agent may do.')}
|
|
254
|
+
onClick=${onReset}>${tr('chat.reset', 'Reset session')}</button>`}
|
|
255
|
+
</div>
|
|
256
|
+
`;
|
|
257
|
+
}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file public/views/chat.js
|
|
3
|
+
* @description The chat page: the person's first agent, reachable without connecting anything.
|
|
4
|
+
*
|
|
5
|
+
* Everything else on this node assumes a person has already wired their own AI tool to it over
|
|
6
|
+
* MCP. This page is the door for the ones who have not, and for the ones who never will. The agent
|
|
7
|
+
* it talks to is a real GAII principal with real scopes, so what happens here is the same work
|
|
8
|
+
* that happens through any other client, under the same permissions, visible in the same places.
|
|
9
|
+
*
|
|
10
|
+
* The tool calls are on screen for every turn. A chat that reports success without showing what it
|
|
11
|
+
* did asks to be believed; this one can be checked, and that is what makes it credible as a first
|
|
12
|
+
* agent rather than a demo.
|
|
13
|
+
* @structure
|
|
14
|
+
* - ChatView — the page: status, conversations, one live turn
|
|
15
|
+
* @usage import ChatView from '/views/chat.js'
|
|
16
|
+
* @version-history
|
|
17
|
+
* v1.1.0 — 2026-08-16 — Speech: a recording becomes text in the box for the person to read before
|
|
18
|
+
* they send it, and the engine is primed inside the tap so reading an answer aloud works on iOS.
|
|
19
|
+
* v1.0.1 — 2026-08-16 — The work log keys tool calls by id rather than title, so a finished call
|
|
20
|
+
* stops reading as "starting".
|
|
21
|
+
* v1.0.0 — 2026-08-16 — Initial.
|
|
22
|
+
*/
|
|
23
|
+
import { h } from 'preact';
|
|
24
|
+
import { useState, useEffect, useRef, useCallback } from 'preact/hooks';
|
|
25
|
+
import htm from 'htm';
|
|
26
|
+
import { t } from '/js/i18n.js';
|
|
27
|
+
import { hasSession } from '/js/services/auth.js';
|
|
28
|
+
import { Spinner } from '/components/Spinner.js';
|
|
29
|
+
import * as chat from '/js/services/chat.js';
|
|
30
|
+
import { primeSpeech } from '/js/services/speech-reader.js';
|
|
31
|
+
import { ThreadList, Turn, LiveTurn, TurnError, Composer, StatusBar } from './chat/parts.js';
|
|
32
|
+
|
|
33
|
+
const html = htm.bind(h);
|
|
34
|
+
const tr = (key, fallback) => { const v = t(key); return v && v !== key ? v : fallback; };
|
|
35
|
+
|
|
36
|
+
export default function ChatView() {
|
|
37
|
+
const [status, setStatus] = useState(null);
|
|
38
|
+
const [threads, setThreads] = useState([]);
|
|
39
|
+
const [thread, setThread] = useState(null);
|
|
40
|
+
const [draft, setDraft] = useState('');
|
|
41
|
+
const [busy, setBusy] = useState(false);
|
|
42
|
+
const [live, setLive] = useState({ text: '', thought: '', tools: [] });
|
|
43
|
+
const [failure, setFailure] = useState('');
|
|
44
|
+
const [loading, setLoading] = useState(true);
|
|
45
|
+
// On a phone the conversation takes the whole screen, so the list is a separate place rather
|
|
46
|
+
// than a column that would leave neither readable.
|
|
47
|
+
const [listOpen, setListOpen] = useState(false);
|
|
48
|
+
const [listening, setListening] = useState(false);
|
|
49
|
+
|
|
50
|
+
const abortRef = useRef(null);
|
|
51
|
+
const bottomRef = useRef(null);
|
|
52
|
+
const lastAskRef = useRef('');
|
|
53
|
+
|
|
54
|
+
const loadThreads = useCallback(async () => {
|
|
55
|
+
const res = await chat.listThreads();
|
|
56
|
+
setThreads(res?.data?.threads ?? []);
|
|
57
|
+
}, []);
|
|
58
|
+
|
|
59
|
+
const openThread = useCallback(async (id) => {
|
|
60
|
+
const res = await chat.getThread(id);
|
|
61
|
+
setThread(res?.data?.thread ?? null);
|
|
62
|
+
setFailure('');
|
|
63
|
+
setLive({ text: '', thought: '', tools: [] });
|
|
64
|
+
setListOpen(false);
|
|
65
|
+
}, []);
|
|
66
|
+
|
|
67
|
+
// First load: what this node offers, and where the person left off.
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (!hasSession()) { setLoading(false); return; }
|
|
70
|
+
(async () => {
|
|
71
|
+
try {
|
|
72
|
+
const [st, list] = await Promise.all([chat.status(), chat.listThreads()]);
|
|
73
|
+
setStatus(st?.data ?? null);
|
|
74
|
+
const found = list?.data?.threads ?? [];
|
|
75
|
+
setThreads(found);
|
|
76
|
+
if (found.length > 0) await openThread(found[0].id);
|
|
77
|
+
} catch (err) {
|
|
78
|
+
setFailure(err.message || tr('chat.loadFailed', 'The chat could not be loaded.'));
|
|
79
|
+
} finally {
|
|
80
|
+
setLoading(false);
|
|
81
|
+
}
|
|
82
|
+
})();
|
|
83
|
+
}, [openThread]);
|
|
84
|
+
|
|
85
|
+
// Keep the newest turn in view, the way a conversation is read.
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
bottomRef.current?.scrollIntoView({ block: 'end' });
|
|
88
|
+
}, [thread?.turns?.length, live.text, live.tools.length]);
|
|
89
|
+
|
|
90
|
+
// The on-screen keyboard, measured rather than calculated.
|
|
91
|
+
//
|
|
92
|
+
// `100dvh − keyboard` double-counts on Android Chrome, where dvh already shrinks for the
|
|
93
|
+
// keyboard, and the composer ends up floating above a dead gap. The visual viewport excludes the
|
|
94
|
+
// keyboard on every platform, so the distance from the top of the page to the bottom of it is
|
|
95
|
+
// the space there actually is. Same approach as the inbox, for the same reason.
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
const vv = window.visualViewport;
|
|
98
|
+
const root = document.documentElement;
|
|
99
|
+
if (!vv) return undefined;
|
|
100
|
+
const sync = () => {
|
|
101
|
+
if (!window.matchMedia('(max-width: 760px)').matches) {
|
|
102
|
+
root.style.removeProperty('--chat-avail');
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
root.style.setProperty('--chat-avail', `${Math.max(220, Math.round(vv.height))}px`);
|
|
106
|
+
};
|
|
107
|
+
sync();
|
|
108
|
+
vv.addEventListener('resize', sync);
|
|
109
|
+
vv.addEventListener('scroll', sync);
|
|
110
|
+
window.addEventListener('orientationchange', sync);
|
|
111
|
+
return () => {
|
|
112
|
+
vv.removeEventListener('resize', sync);
|
|
113
|
+
vv.removeEventListener('scroll', sync);
|
|
114
|
+
window.removeEventListener('orientationchange', sync);
|
|
115
|
+
root.style.removeProperty('--chat-avail');
|
|
116
|
+
};
|
|
117
|
+
}, []);
|
|
118
|
+
|
|
119
|
+
// A change to the agent's permissions is made elsewhere, so the status line refreshes with the
|
|
120
|
+
// rest of the page rather than going stale until a reload.
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
const handler = async () => {
|
|
123
|
+
try {
|
|
124
|
+
setStatus((await chat.status())?.data ?? null);
|
|
125
|
+
} catch (err) {
|
|
126
|
+
// A stale allowance line is not worth interrupting a conversation over, and the
|
|
127
|
+
// next update will correct it. Said out loud so it is not invisible either.
|
|
128
|
+
console.warn('[chat] the status line could not be refreshed:', err.message);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
window.addEventListener('aimeat-live-update', handler);
|
|
132
|
+
return () => window.removeEventListener('aimeat-live-update', handler);
|
|
133
|
+
}, []);
|
|
134
|
+
|
|
135
|
+
const startThread = useCallback(async () => {
|
|
136
|
+
const res = await chat.createThread();
|
|
137
|
+
const created = res?.data?.thread;
|
|
138
|
+
if (!created) return null;
|
|
139
|
+
setThread(created);
|
|
140
|
+
setFailure('');
|
|
141
|
+
setListOpen(false);
|
|
142
|
+
await loadThreads();
|
|
143
|
+
return created;
|
|
144
|
+
}, [loadThreads]);
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Send one message and read the answer as it is written.
|
|
148
|
+
*
|
|
149
|
+
* The person's words appear immediately rather than after the round trip: the node has already
|
|
150
|
+
* written them down by the time the first event arrives, and waiting to show them would make a
|
|
151
|
+
* slow turn look like a lost one.
|
|
152
|
+
*/
|
|
153
|
+
const send = useCallback(async (retryText) => {
|
|
154
|
+
const text = (retryText ?? draft).trim();
|
|
155
|
+
if (!text || busy) return;
|
|
156
|
+
// Inside the tap, because that is the only moment iOS will accept it. Without this, reading
|
|
157
|
+
// an answer aloud later is a silent no-op with nothing in the console to find.
|
|
158
|
+
primeSpeech();
|
|
159
|
+
|
|
160
|
+
let target = thread;
|
|
161
|
+
if (!target) {
|
|
162
|
+
target = await startThread();
|
|
163
|
+
if (!target) return;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
lastAskRef.current = text;
|
|
167
|
+
setDraft('');
|
|
168
|
+
setFailure('');
|
|
169
|
+
setBusy(true);
|
|
170
|
+
setLive({ text: '', thought: '', tools: [] });
|
|
171
|
+
setThread((prev) => (prev ? {
|
|
172
|
+
...prev,
|
|
173
|
+
turns: [...(prev.turns ?? []), { role: 'user', text, at: new Date().toISOString() }],
|
|
174
|
+
} : prev));
|
|
175
|
+
|
|
176
|
+
const controller = new AbortController();
|
|
177
|
+
abortRef.current = controller;
|
|
178
|
+
|
|
179
|
+
let answer = '';
|
|
180
|
+
const tools = new Map();
|
|
181
|
+
try {
|
|
182
|
+
for await (const update of chat.streamTurn(target.id, text, controller.signal)) {
|
|
183
|
+
if (update.kind === 'text') {
|
|
184
|
+
answer += update.text;
|
|
185
|
+
setLive((l) => ({ ...l, text: answer }));
|
|
186
|
+
} else if (update.kind === 'thought') {
|
|
187
|
+
setLive((l) => ({ ...l, thought: update.text }));
|
|
188
|
+
} else if (update.kind === 'tool_call') {
|
|
189
|
+
// By id, not title: a call arrives once as it starts and once as it finishes,
|
|
190
|
+
// and only the first carries a title.
|
|
191
|
+
const key = update.id || update.title;
|
|
192
|
+
const seen = tools.get(key);
|
|
193
|
+
if (seen) {
|
|
194
|
+
seen.status = update.status;
|
|
195
|
+
if (update.title) seen.title = update.title;
|
|
196
|
+
} else {
|
|
197
|
+
tools.set(key, { title: update.title, status: update.status });
|
|
198
|
+
}
|
|
199
|
+
setLive((l) => ({ ...l, tools: [...tools.values()] }));
|
|
200
|
+
} else if (update.kind === 'error') {
|
|
201
|
+
setFailure(update.message || tr('chat.turnFailed', 'The turn could not be completed.'));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
} catch (err) {
|
|
205
|
+
// An abort is the person's own decision, and half an answer is still an answer.
|
|
206
|
+
if (err.name !== 'AbortError') {
|
|
207
|
+
setFailure(err.message || tr('chat.turnFailed', 'The turn could not be completed.'));
|
|
208
|
+
}
|
|
209
|
+
} finally {
|
|
210
|
+
abortRef.current = null;
|
|
211
|
+
setBusy(false);
|
|
212
|
+
setLive({ text: '', thought: '', tools: [] });
|
|
213
|
+
// Read the conversation back from the node: it is the record, and what it holds is what
|
|
214
|
+
// was actually saved rather than what this page happened to see.
|
|
215
|
+
try {
|
|
216
|
+
const fresh = await chat.getThread(target.id);
|
|
217
|
+
if (fresh?.data?.thread) setThread(fresh.data.thread);
|
|
218
|
+
await loadThreads();
|
|
219
|
+
} catch (err) {
|
|
220
|
+
// The turn ran; a failed re-read leaves the optimistic copy on screen, which is the
|
|
221
|
+
// same text, and the next open corrects it.
|
|
222
|
+
console.warn('[chat] the conversation could not be re-read:', err.message);
|
|
223
|
+
if (answer) {
|
|
224
|
+
setThread((prev) => (prev ? {
|
|
225
|
+
...prev,
|
|
226
|
+
turns: [...(prev.turns ?? []), { role: 'agent', text: answer, at: new Date().toISOString(), tools: [...tools.values()] }],
|
|
227
|
+
} : prev));
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}, [draft, busy, thread, startThread, loadThreads]);
|
|
232
|
+
|
|
233
|
+
const stop = useCallback(() => { abortRef.current?.abort(); }, []);
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* A recording becomes text in the box, not a sent message.
|
|
237
|
+
*
|
|
238
|
+
* Speech recognition is wrong often enough that sending what it heard would make the person
|
|
239
|
+
* argue with a machine about what they said. They read it first, and edit it if it is wrong.
|
|
240
|
+
*/
|
|
241
|
+
const speakToText = useCallback(async (file) => {
|
|
242
|
+
setListening(true);
|
|
243
|
+
setFailure('');
|
|
244
|
+
try {
|
|
245
|
+
const heard = await chat.speakToText(file);
|
|
246
|
+
if (heard) setDraft((d) => (d ? `${d} ${heard}` : heard));
|
|
247
|
+
else setFailure(tr('chat.heardNothing', 'Nothing was heard in that recording.'));
|
|
248
|
+
} catch (err) {
|
|
249
|
+
setFailure(err.message || tr('chat.transcribeFailed', 'That recording could not be turned into text.'));
|
|
250
|
+
} finally {
|
|
251
|
+
setListening(false);
|
|
252
|
+
}
|
|
253
|
+
}, []);
|
|
254
|
+
|
|
255
|
+
const removeThread = useCallback(async (id) => {
|
|
256
|
+
await chat.deleteThread(id);
|
|
257
|
+
if (thread?.id === id) setThread(null);
|
|
258
|
+
await loadThreads();
|
|
259
|
+
}, [thread, loadThreads]);
|
|
260
|
+
|
|
261
|
+
const resetSession = useCallback(async () => {
|
|
262
|
+
if (!thread) return;
|
|
263
|
+
await chat.resetThread(thread.id);
|
|
264
|
+
}, [thread]);
|
|
265
|
+
|
|
266
|
+
if (!hasSession()) {
|
|
267
|
+
return html`
|
|
268
|
+
<div class="chat-view chat-view--signin">
|
|
269
|
+
<h1>${tr('chat.title', 'Chat')}</h1>
|
|
270
|
+
<p>${tr('chat.signIn', 'Sign in and your first agent is waiting here.')}</p>
|
|
271
|
+
</div>`;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (loading) return html`<div class="chat-view"><${Spinner} /></div>`;
|
|
275
|
+
|
|
276
|
+
const turns = thread?.turns ?? [];
|
|
277
|
+
const disabled = status ? !status.enabled : false;
|
|
278
|
+
|
|
279
|
+
return html`
|
|
280
|
+
<div class="chat-view ${listOpen ? 'chat-view--list' : ''}">
|
|
281
|
+
<${ThreadList}
|
|
282
|
+
threads=${threads}
|
|
283
|
+
activeId=${thread?.id}
|
|
284
|
+
onOpen=${openThread}
|
|
285
|
+
onNew=${startThread}
|
|
286
|
+
onDelete=${removeThread}
|
|
287
|
+
onClose=${() => setListOpen(false)} />
|
|
288
|
+
|
|
289
|
+
<section class="chat-main">
|
|
290
|
+
<header class="chat-head">
|
|
291
|
+
<button type="button" class="btn-ghost chat-list-toggle"
|
|
292
|
+
onClick=${() => setListOpen((o) => !o)}>
|
|
293
|
+
${listOpen ? tr('chat.closeList', 'Close') : tr('chat.openList', 'Conversations')}
|
|
294
|
+
</button>
|
|
295
|
+
<h1 class="chat-title">${thread?.title ?? tr('chat.title', 'Chat')}</h1>
|
|
296
|
+
</header>
|
|
297
|
+
|
|
298
|
+
<${StatusBar} status=${status} onReset=${thread ? resetSession : null} />
|
|
299
|
+
|
|
300
|
+
<div class="chat-scroll">
|
|
301
|
+
${turns.length === 0 && !busy ? html`
|
|
302
|
+
<div class="chat-welcome">
|
|
303
|
+
<h2>${tr('chat.welcomeTitle', 'Your first agent')}</h2>
|
|
304
|
+
<p>${tr('chat.welcomeBody', 'It works here the way your own AI tool would, with the same permissions and the same record of what it did. Ask it for something.')}</p>
|
|
305
|
+
</div>` : ''}
|
|
306
|
+
|
|
307
|
+
${turns.map((turn, i) => html`<${Turn} key=${i} id=${`${thread?.id}-${i}`} turn=${turn} />`)}
|
|
308
|
+
<${LiveTurn} text=${live.text} thought=${live.thought} tools=${live.tools} busy=${busy} />
|
|
309
|
+
<${TurnError} message=${failure}
|
|
310
|
+
onRetry=${lastAskRef.current && !busy ? () => send(lastAskRef.current) : null} />
|
|
311
|
+
<div ref=${bottomRef}></div>
|
|
312
|
+
</div>
|
|
313
|
+
|
|
314
|
+
<${Composer}
|
|
315
|
+
value=${draft}
|
|
316
|
+
onInput=${setDraft}
|
|
317
|
+
onSend=${() => send()}
|
|
318
|
+
onStop=${stop}
|
|
319
|
+
onSpeak=${speakToText}
|
|
320
|
+
listening=${listening}
|
|
321
|
+
busy=${busy}
|
|
322
|
+
disabled=${disabled}
|
|
323
|
+
note=${disabled ? (status?.note ?? '') : ''} />
|
|
324
|
+
</section>
|
|
325
|
+
</div>
|
|
326
|
+
`;
|
|
327
|
+
}
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
* @structure default export Landing({ navigate }) + BuildHero/Gallery(live wall)/StatsPanel/BuildAppPrompt/BuildAgentPrompt/AskYourAI
|
|
10
10
|
* @usage routed at /v1/portal (and '/' for browsers) by spa.html
|
|
11
11
|
* @version-history
|
|
12
|
+
* v5.2.0 — 2026-08-16 — The arrival redirect asks the node where this account lands instead of
|
|
13
|
+
* sending everyone to /v1/profile. The server has decided that since the remake, and this page
|
|
14
|
+
* ignored it, so an account created on the new path still arrived at the old one.
|
|
12
15
|
* v5.1.0 — 2026-08-01 — One line above the footer about how this node marks AI-generated
|
|
13
16
|
* content, linking /v1/transparency (TARGET-058 Phase 10). One line and no more: the page
|
|
14
17
|
* that states the limits properly is the one it links to.
|
|
@@ -70,6 +73,7 @@ import htm from 'htm';
|
|
|
70
73
|
const html = htm.bind(h);
|
|
71
74
|
import { t, getLocale } from '/js/i18n.js';
|
|
72
75
|
import { escHtml } from '/js/utils.js';
|
|
76
|
+
import { apiGet } from '/js/api.js';
|
|
73
77
|
import { openAppSandboxed } from '/js/app-sandbox.js';
|
|
74
78
|
import { siteLink, hasSite } from '/js/site.js';
|
|
75
79
|
import { Collapsible } from '/components/Collapsible.js';
|
|
@@ -600,11 +604,30 @@ export default function Landing({ navigate }) {
|
|
|
600
604
|
// The flag suppresses ONLY the arrival redirect. Signing in while standing on this page
|
|
601
605
|
// always moves on to Home: without that, the sign-in modal closed and the visitor was left
|
|
602
606
|
// looking at the same marketing page with no sign that anything had happened.
|
|
607
|
+
//
|
|
608
|
+
// WHERE it forwards to is the node's answer, not this file's. The server has decided since the
|
|
609
|
+
// remake which side an account lands on, and this page sent everyone to /v1/profile regardless —
|
|
610
|
+
// so a new account created on the new path still arrived at the old one. It asks now, and falls
|
|
611
|
+
// back to the profile only when the answer does not arrive.
|
|
603
612
|
useEffect(() => {
|
|
613
|
+
const landingFor = async () => {
|
|
614
|
+
try {
|
|
615
|
+
const res = await apiGet('/v1/home/ui-track');
|
|
616
|
+
return res?.data?.landing || '/v1/profile';
|
|
617
|
+
} catch (err) {
|
|
618
|
+
// Not knowing where to send someone is not a reason to leave them on the marketing page.
|
|
619
|
+
// The old landing is where everyone went until now, so it is the safe answer.
|
|
620
|
+
console.warn('[landing] could not read where this account lands:', err.message);
|
|
621
|
+
return '/v1/profile';
|
|
622
|
+
}
|
|
623
|
+
};
|
|
604
624
|
const check = () => {
|
|
605
625
|
try {
|
|
606
626
|
const raw = localStorage.getItem('aimeat_session');
|
|
607
|
-
if (raw && JSON.parse(raw)?.jwt) {
|
|
627
|
+
if (raw && JSON.parse(raw)?.jwt) {
|
|
628
|
+
landingFor().then((path) => navigate(path));
|
|
629
|
+
return true;
|
|
630
|
+
}
|
|
608
631
|
// eslint-disable-next-line aimeat/no-silent-catch -- stay on landing
|
|
609
632
|
} catch { /* stay on landing */ }
|
|
610
633
|
return false;
|