@xopcai/xopc 0.0.331 → 0.0.333
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/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-B0BtF24E.js → agent-avatar-dicebear-DiI2O7lC.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CVp3J969.js +1 -0
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-DbvLXQO2.js → agent-plugin-dialog-CacyndrS.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DXYZSuUV.js +70 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-fwzTRJfP.js → app-management-settings-panel-BcszTlqr.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-v_GGe8UZ.js → appearance-settings-B1XPe8qz.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-C9ZMEuuA.js → apps-page-ZqANbUZv.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-B6EgADeH.js → archive-plugin-MjUsJcNb.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-B4H_IFeX.js → attachment-load-DHa-BI9a.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-UlVCvg4r.js → automations-page-Dsjivdxs.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-B37vs5tk.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BxTSx30f.js → binary-plugins-DQYcuBHP.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CVzdrpjl.js → block-editor-Bx0uXbJP.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-C5s1yHOu.js → browser-automation-inputs-1ZIPGDeq.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CBVD8k6O.js → browser-automations-page-CCjYipHc.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-CSv4rvmx.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-BnO9LV7U.js +1 -0
- package/dist/gateway/static/root/assets/{capabilities-page-BAT7Vvb8.js → capabilities-page-BfvDvIY1.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CoW7-ESq.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-EETjXmkG.js → capability-header-actions-D_hbWRRF.js} +1 -1
- package/dist/gateway/static/root/assets/channels-BhMaRh1x.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DCqm9j9W.js → chat-terminal-dock-Fnum_IEm.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-CxFWdovV.js → computer-settings-page-DI1zfCTA.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-wxsEhmlU.js → connector-service-page-CiGDAubm.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-Ono0Pha1.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-h_OS6uBR.js → date-picker-D-JhzZyW.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DNgSSH3z.js → dependency-picker-DpD3xaEB.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CflvPnB-.js → desktop-pet-CCoDxKqh.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CXy0X5Js.js → desktop-pet-settings-GxndKfCx.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-BDMiJcsK.js → device-pairing-wizard-B71w3ptm.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BqkOh13m.js → directory-picker-path-field-CUzjJvjs.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-VT4s-9pK.js → extension-debug-page-BtDY8ntX.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CBSeGhGA.js → extension-page-D9_XF-XC.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DRB6uOo8.js → extension-settings-page-CjhUFAaC.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-cR-tz7-Q.js → gateway-config-swr-CgIjCxM8.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-lF-FpnZy.js → gateway-settings-BWaCnwT1.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-6jLRcQsu.js → gateway-startup-retry-i-1lTrwY.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BTjGLngn.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-CSSkwsyC.js → image-generation-api-gilc-u7M.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DGkOijwE.js → imports-page-BEtq5BRU.js} +1 -1
- package/dist/gateway/static/root/assets/index-DHL16aYZ.js +121 -0
- package/dist/gateway/static/root/assets/index-N1e6PDwx.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-iU6c2zg1.js → keyboard-shortcuts-settings-JUYY_18v.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-uI7mtoVz.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-C0BWC8D2.js → local-apps-page-BlYESNqz.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-wNXWkWu5.js → locale-store-BY30D6tg.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-Dpoi-r-_.js → logs-page-BbLQreeN.js} +2 -2
- package/dist/gateway/static/root/assets/management-settings-c4krhYU7.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-DlT9KqwF.js → markdown-view-BEeXMfDw.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-C8E_F2F_.js → media-plugins-DEFN1I73.js} +1 -1
- package/dist/gateway/static/root/assets/messages-_6IXbP2u.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel--09xGxyE.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-DsxcVBXF.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-qqWG_gs_.js → page-context-capture-button-D43aVpCj.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-b3lheKy4.js → page-tabs-BhYBCqls.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-0Q4rTfGX.js → preview-open-alternatives-CP8agNlc.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-jnJZCrKQ.js → product-open-page-CU7fRhfT.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-U-EdDfAW.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-r96k_2wB.js → projects-page-DUOKZLt7.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-BIpltJ47.js → registry-api-BvVx0G1o.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-B1d8pB_y.js → remote-access-hub-fVPQe5YS.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Do_iF13W.js → runtime-tools-settings-panel-Czvzsuj_.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-C0-WHOY3.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-Cfft26Je.js → schema-form-B9Ni5O93.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-DdXvW09N.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BtF83fBY.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-iI0MTyuU.js → settings-form-section-jquf1P7n.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-C2Ka9oJm.js → settings-page-DPomsvba.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-nnmS_p5h.js → setup-status-panel-BvVlqpHf.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-D0Knvtlp.js → share-preview-page-b9DI0N1J.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-R_qwc4DN.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-BuZKcy9b.js → skill-api-Bu7-3w-L.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CNJAQ_e-.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-DcxWxIrR.js → skills-page-D7XPEQu_.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CMG0ZAsd.js → system-settings-panel-BwFR0Uci.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-PFjGW2g1.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-DGYA6GyO.js → tunnel-api-PfucxMP3.js} +1 -1
- package/dist/gateway/static/root/assets/usage-page-t_zdQHcy.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-CDemMoSX.js → use-autosave-DLyy2wHz.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-OyfPVfB9.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CXArY4t5.js → voice-api-key-field-CQDY5EBK.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-ujEySjyc.js → voice-config-api-Bwy3Al3J.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Dk5KsKOm.js → work-discovery-overlay-CJzqJ47I.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DNpdaI-2.js → workflow-run-setup-panel-sCOk-esV.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DYBGjN7C.js +6 -0
- package/dist/gateway/static/root/index.html +9 -9
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/automations.js +59 -14
- package/dist/packages/gateway-contract/src/capabilities.js +106 -8
- package/dist/packages/gateway-contract/src/index.js +2 -0
- package/dist/packages/gateway-contract/src/scenes.js +7 -6
- package/dist/packages/gateway-contract/src/sessions.js +2 -1
- package/dist/packages/gateway-contract/src/usage.js +6 -0
- package/dist/src/agent/agent-manager.js +13 -7
- package/dist/src/agent/background-review/run-background-review.js +7 -2
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/embedded/run-turn.js +7 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/external-tools/gateway-tools.d.ts +2 -1
- package/dist/src/agent/external-tools/gateway-tools.js +44 -11
- package/dist/src/agent/external-tools/index.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/image/understanding/pi-ai-provider.js +1 -1
- package/dist/src/agent/memory/compaction.js +4 -0
- package/dist/src/agent/orchestration/agent-orchestrator.js +0 -21
- package/dist/src/agent/service/btw-query.js +8 -2
- package/dist/src/agent/service.js +3 -3
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +2 -2
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +4 -0
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +5 -4
- package/dist/src/agent/tools/automation-tool.d.ts +4 -1
- package/dist/src/agent/tools/automation-tool.js +42 -4
- package/dist/src/agent/tools/session-search-tool.js +1 -1
- package/dist/src/agent/tools/web-extract.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +50 -9
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/ai-assist/text-assist.js +5 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/api/routes.js +65 -0
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/read.js +24 -0
- package/dist/src/automations/capabilities/write.d.ts +69 -14
- package/dist/src/automations/capabilities/write.js +78 -5
- package/dist/src/automations/delivery/delivery-router.d.ts +50 -0
- package/dist/src/automations/delivery/delivery-router.js +318 -0
- package/dist/src/automations/delivery/index.d.ts +1 -0
- package/dist/src/automations/delivery/index.js +2 -0
- package/dist/src/automations/domain/defaults.d.ts +0 -1
- package/dist/src/automations/domain/defaults.js +2 -2
- package/dist/src/automations/domain/index.js +2 -2
- package/dist/src/automations/domain/types.d.ts +180 -7
- package/dist/src/automations/domain/validation.d.ts +172 -22
- package/dist/src/automations/domain/validation.js +82 -13
- package/dist/src/automations/draft/automation-draft-prompt.js +3 -4
- package/dist/src/automations/draft/automation-draft-service.js +6 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +31 -3
- package/dist/src/automations/draft/automation-draft-validator.js +5 -4
- package/dist/src/automations/events/event-catalog.d.ts +14 -0
- package/dist/src/automations/events/event-catalog.js +117 -0
- package/dist/src/automations/events/event-dispatcher.d.ts +27 -0
- package/dist/src/automations/events/event-dispatcher.js +140 -0
- package/dist/src/automations/events/event-repository.d.ts +59 -0
- package/dist/src/automations/events/event-repository.js +361 -0
- package/dist/src/automations/events/index.d.ts +3 -0
- package/dist/src/automations/events/index.js +4 -0
- package/dist/src/automations/index.d.ts +3 -1
- package/dist/src/automations/index.js +9 -3
- package/dist/src/automations/service/action-executor.d.ts +20 -1
- package/dist/src/automations/service/action-executor.js +80 -24
- package/dist/src/automations/service/automation-service.d.ts +21 -4
- package/dist/src/automations/service/automation-service.js +150 -100
- package/dist/src/automations/storage/automation-repository.js +7 -7
- package/dist/src/automations/storage/automation-run-repository.d.ts +1 -0
- package/dist/src/automations/storage/automation-run-repository.js +26 -1
- package/dist/src/automations/storage/index.js +2 -2
- package/dist/src/automations/webhook-secrets.d.ts +1 -0
- package/dist/src/automations/webhook-secrets.js +16 -0
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/capabilities/store-connector.d.ts +17 -1
- package/dist/src/capabilities/store-connector.js +69 -3
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/connectors.js +4 -3
- package/dist/src/cli/commands/doctor/checks/automation-integrity.d.ts +2 -0
- package/dist/src/cli/commands/doctor/checks/automation-integrity.js +55 -0
- package/dist/src/cli/commands/doctor/checks/database-relations.d.ts +2 -0
- package/dist/src/cli/commands/doctor/checks/database-relations.js +81 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/flow.js +5 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/commands/skills.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +4 -0
- package/dist/src/config/schema.js +5 -1
- package/dist/src/connectors/approval-resume.js +1 -1
- package/dist/src/connectors/cli/store.js +1 -1
- package/dist/src/connectors/composio-backends.js +14 -4
- package/dist/src/connectors/composio-managed-events.d.ts +5 -2
- package/dist/src/connectors/composio-managed-events.js +4 -1
- package/dist/src/connectors/connection-recovery-service.d.ts +2 -1
- package/dist/src/connectors/connection-recovery-service.js +89 -4
- package/dist/src/discussions/analyzer.js +4 -4
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/home-intelligence-automation-reconciler.d.ts +3 -0
- package/dist/src/gateway/home-intelligence-automation-reconciler.js +52 -0
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/capabilities.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +18 -4
- package/dist/src/gateway/hono/routes/connection-waits.js +3 -2
- package/dist/src/gateway/hono/routes/home.js +0 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +14 -1
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/public-gateway.js +93 -3
- package/dist/src/gateway/hono/routes/scenes.js +57 -41
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +15 -0
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/update.js +6 -1
- package/dist/src/gateway/hono/routes/usage.d.ts +3 -0
- package/dist/src/gateway/hono/routes/usage.js +61 -0
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/memory-maintenance-automation-reconciler.js +21 -15
- package/dist/src/gateway/scenes/host.js +27 -14
- package/dist/src/gateway/scenes/slackThreadSource.d.ts +2 -2
- package/dist/src/gateway/security/gateway-scopes.js +1 -0
- package/dist/src/gateway/service/active-execution.d.ts +19 -0
- package/dist/src/gateway/service/active-execution.js +16 -0
- package/dist/src/gateway/service/agent-runner.d.ts +4 -0
- package/dist/src/gateway/service/agent-runner.js +19 -1
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.d.ts +2 -0
- package/dist/src/gateway/service/run-gateway-agent.js +9 -1
- package/dist/src/gateway/service/sessions-api.d.ts +13 -0
- package/dist/src/gateway/service/sessions-api.js +23 -0
- package/dist/src/gateway/service.d.ts +7 -3
- package/dist/src/gateway/service.js +108 -89
- package/dist/src/gateway/side-chat/run-service.js +10 -7
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/generator.js +4 -1
- package/dist/src/home-intelligence/host.d.ts +1 -1
- package/dist/src/home-intelligence/host.js +2 -10
- package/dist/src/home-intelligence/notification.js +1 -1
- package/dist/src/home-intelligence/repository.d.ts +1 -1
- package/dist/src/infra/domain-outbox-dispatcher.d.ts +0 -3
- package/dist/src/infra/domain-outbox-dispatcher.js +15 -7
- package/dist/src/infra/update-check.d.ts +8 -4
- package/dist/src/infra/update-check.js +43 -41
- package/dist/src/infra/update-startup.d.ts +7 -1
- package/dist/src/infra/update-startup.js +15 -6
- package/dist/src/local-apps/service.js +2 -2
- package/dist/src/memory-maintenance/index.js +2 -2
- package/dist/src/memory-maintenance/schedule.d.ts +0 -3
- package/dist/src/memory-maintenance/schedule.js +1 -8
- package/dist/src/notes/service.js +2 -3
- package/dist/src/projects/project-service.js +1 -2
- package/dist/src/projects/project-skill-service.js +2 -2
- package/dist/src/providers/model-call.d.ts +3 -2
- package/dist/src/providers/model-call.js +30 -5
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/scenes/activationAdapter.d.ts +19 -0
- package/dist/src/scenes/activationAdapter.js +1 -0
- package/dist/src/scenes/agentExecutor.js +3 -10
- package/dist/src/scenes/contracts.d.ts +3 -9
- package/dist/src/scenes/contracts.js +1 -0
- package/dist/src/scenes/execution.d.ts +9 -3
- package/dist/src/scenes/execution.js +12 -11
- package/dist/src/scenes/httpServices.d.ts +5 -2
- package/dist/src/scenes/mailContext.d.ts +4 -0
- package/dist/src/scenes/mailContext.js +9 -0
- package/dist/src/scenes/maintenance.js +1 -5
- package/dist/src/scenes/metrics.d.ts +0 -6
- package/dist/src/scenes/metrics.js +0 -11
- package/dist/src/scenes/registry.d.ts +11 -0
- package/dist/src/scenes/registry.js +28 -0
- package/dist/src/scenes/repository.d.ts +6 -3
- package/dist/src/scenes/repository.js +43 -5
- package/dist/src/scenes/service.d.ts +2 -1
- package/dist/src/scenes/service.js +9 -7
- package/dist/src/scenes/taskFollowUp/contracts.d.ts +37 -7
- package/dist/src/scenes/taskFollowUp/contracts.js +36 -17
- package/dist/src/scenes/taskFollowUp/service.d.ts +35 -7
- package/dist/src/scenes/taskFollowUp/service.js +86 -28
- package/dist/src/scenes/templates.d.ts +2 -2
- package/dist/src/scenes/userNotes.d.ts +3 -0
- package/dist/src/scenes/userNotes.js +6 -0
- package/dist/src/session/client-history.d.ts +3 -0
- package/dist/src/session/client-history.js +10 -5
- package/dist/src/session/manager.d.ts +1 -0
- package/dist/src/session/resolve-session.js +4 -3
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.d.ts +1 -0
- package/dist/src/session/store.js +3 -2
- package/dist/src/storage/sqlite/ai-usage-repository.d.ts +137 -0
- package/dist/src/storage/sqlite/ai-usage-repository.js +175 -0
- package/dist/src/storage/sqlite/connector-account-repository.js +7 -5
- package/dist/src/storage/sqlite/connector-repository.js +36 -34
- package/dist/src/storage/sqlite/index.d.ts +2 -2
- package/dist/src/storage/sqlite/index.js +3 -3
- package/dist/src/storage/sqlite/migrations/208_automation_management.sql +2 -0
- package/dist/src/storage/sqlite/migrations/209_automation_event_hub.sql +48 -0
- package/dist/src/storage/sqlite/migrations/210_remove_legacy_automation_timeout.sql +14 -0
- package/dist/src/storage/sqlite/migrations/211_automation_result_deliveries.sql +16 -0
- package/dist/src/storage/sqlite/migrations/212_automation_delivery_policy.sql +30 -0
- package/dist/src/storage/sqlite/migrations/213_automation_reliability_contract.sql +188 -0
- package/dist/src/storage/sqlite/migrations/214_ai_usage_ledger.sql +41 -0
- package/dist/src/storage/sqlite/migrations/215_scene_execution_adapters.sql +6 -0
- package/dist/src/storage/sqlite/migrations/216_remove_scene_model_usage.sql +1 -0
- package/dist/src/storage/sqlite/migrations/217_remove_legacy_memory_tables.sql +4 -0
- package/dist/src/storage/sqlite/migrations/218_core_relation_indexes.sql +26 -0
- package/dist/src/storage/sqlite/migrations/219_json_contracts.sql +123 -0
- package/dist/src/storage/sqlite/migrations/220_normalize_timestamps.sql +339 -0
- package/dist/src/storage/sqlite/migrations/221_ai_usage_retention_index.sql +2 -0
- package/dist/src/storage/sqlite/migrations/222_session_config_authority.sql +13 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +4 -4
- package/dist/src/storage/sqlite/row-mappers.d.ts +3 -7
- package/dist/src/storage/sqlite/row-mappers.js +6 -6
- package/dist/src/storage/sqlite/scenes-schema.d.ts +1 -1
- package/dist/src/storage/sqlite/scenes-schema.js +0 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +0 -52
- package/dist/src/storage/sqlite/schemas/scenes.sql +0 -7
- package/dist/src/storage/sqlite/session-input-repository.d.ts +8 -0
- package/dist/src/storage/sqlite/session-input-repository.js +18 -1
- package/dist/src/storage/sqlite/session-read-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/session-read-repository.js +0 -1
- package/dist/src/storage/sqlite/session-repository.d.ts +0 -4
- package/dist/src/storage/sqlite/session-repository.js +8 -18
- package/dist/src/storage/sqlite/timestamps.d.ts +4 -0
- package/dist/src/storage/sqlite/timestamps.js +20 -0
- package/dist/src/storage/sqlite/transcript-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/transcript-repository.js +23 -15
- package/dist/src/storage/sqlite/user-trust-repository.js +4 -2
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.d.ts +1 -1
- package/dist/src/tasks/home-query-service.js +4 -3
- package/dist/src/tasks/task-contract-planner.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +2 -2
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/usage/cost.d.ts +4 -0
- package/dist/src/usage/cost.js +28 -0
- package/dist/src/usage/recorder.d.ts +13 -0
- package/dist/src/usage/recorder.js +117 -0
- package/dist/src/usage/scenario-registry.d.ts +8 -0
- package/dist/src/usage/scenario-registry.js +117 -0
- package/dist/src/usage/types.d.ts +55 -0
- package/dist/src/usage/types.js +1 -0
- package/dist/src/user-context/config.d.ts +9 -0
- package/dist/src/user-context/config.js +13 -4
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/tts/summarize.js +1 -1
- package/dist/src/work-discovery/analyzer.js +2 -2
- package/dist/src/work-discovery/investigator.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +15 -2
- package/package.json +6 -6
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DgP5DEJF.js +0 -1
- package/dist/gateway/static/root/assets/agents-Bh4XNLyk.js +0 -70
- package/dist/gateway/static/root/assets/automations-workspace-C7VS-yb7.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-CC43CC43.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-sAZT4brT.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DPETQOfF.js +0 -8
- package/dist/gateway/static/root/assets/channels-CwA619os.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-l7goF6QS.js +0 -2
- package/dist/gateway/static/root/assets/home-page-DSaXXoLm.js +0 -1
- package/dist/gateway/static/root/assets/index-BEw0xrde.css +0 -1
- package/dist/gateway/static/root/assets/index-D99vN3es.js +0 -121
- package/dist/gateway/static/root/assets/local-app-workbench-page-rH33N8I9.js +0 -1
- package/dist/gateway/static/root/assets/management-settings-RFDLaquR.js +0 -1
- package/dist/gateway/static/root/assets/messages-fmf0dnr4.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-DI7CIjmM.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BkqnU-Jh.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-BvvcTH2F.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-DK316w9a.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-EIk8iJTK.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DcOsdz78.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BcaxGQLC.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Cb_CUL-U.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-Cvr1qUTW.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-VXfz3rE7.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-DDNDLdId.js +0 -6
- package/dist/src/automations/product-events.d.ts +0 -5
- package/dist/src/automations/product-events.js +0 -19
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../auth/sync-provider-auth.js";
|
|
2
2
|
import { getApiKeySync, init_providers } from "../providers/index.js";
|
|
3
3
|
import { createExtensionAwareStreamFn } from "../providers/extension-stream-bridge.js";
|
|
4
|
+
import { trackAiUsageStream } from "../usage/recorder.js";
|
|
4
5
|
import { readOnlyResultSchema } from "./execution.js";
|
|
5
6
|
import { Agent } from "@earendil-works/pi-agent-core";
|
|
6
7
|
//#region src/scenes/agentExecutor.ts
|
|
@@ -25,10 +26,10 @@ var SceneAgentExecutor = class {
|
|
|
25
26
|
},
|
|
26
27
|
streamFn: (model, context, options) => {
|
|
27
28
|
if (++calls > 1) throw new Error("Scene executor permits one model call");
|
|
28
|
-
return stream(model, context, {
|
|
29
|
+
return trackAiUsageStream(model, input.usage, () => stream(model, context, {
|
|
29
30
|
...options,
|
|
30
31
|
maxTokens: input.template.execution.limits.maxOutputTokens
|
|
31
|
-
});
|
|
32
|
+
}));
|
|
32
33
|
},
|
|
33
34
|
getApiKey: (provider) => resolveProviderApiKeySync(provider) ?? getApiKeySync(provider) ?? ""
|
|
34
35
|
});
|
|
@@ -42,14 +43,6 @@ var SceneAgentExecutor = class {
|
|
|
42
43
|
}));
|
|
43
44
|
input.signal.throwIfAborted();
|
|
44
45
|
const response = agent.state.messages.findLast((message) => message.role === "assistant");
|
|
45
|
-
if (response?.role === "assistant") input.onUsage?.({
|
|
46
|
-
provider: response.provider,
|
|
47
|
-
model: response.model,
|
|
48
|
-
inputTokens: response.usage.input,
|
|
49
|
-
outputTokens: response.usage.output,
|
|
50
|
-
totalTokens: response.usage.totalTokens,
|
|
51
|
-
estimatedCost: response.usage.cost.total
|
|
52
|
-
});
|
|
53
46
|
if (!response || response.role !== "assistant" || response.stopReason !== "stop") throw new Error("Scene model did not complete a read-only result");
|
|
54
47
|
if (response.content.some((block) => block.type === "toolCall")) throw new Error("Scene model attempted an unavailable tool");
|
|
55
48
|
const text = response.content.filter((block) => block.type === "text").map((block) => block.text).join("");
|
|
@@ -2,14 +2,8 @@ export { sceneOutcomeKinds, activationStatuses, sceneScopeSchema, sceneTemplateS
|
|
|
2
2
|
import { type SceneTemplate, type ScenePermission, type ActivationStatus } from '@xopcai/gateway-contract';
|
|
3
3
|
/** Stable JSON hashing binds approvals and immutable versions to exact content. */
|
|
4
4
|
export declare function sceneContentHash(value: unknown): string;
|
|
5
|
-
export declare function validateTemplate(value: unknown, registered: Pick<ScenePermission, 'contextProviders' | 'effectHandlers'>
|
|
5
|
+
export declare function validateTemplate(value: unknown, registered: Pick<ScenePermission, 'contextProviders' | 'effectHandlers'> & {
|
|
6
|
+
executionAdapters?: string[];
|
|
7
|
+
}): SceneTemplate;
|
|
6
8
|
export declare function intersectPermissions(...permissions: ScenePermission[]): ScenePermission;
|
|
7
9
|
export declare function canTransitionActivation(from: ActivationStatus, to: ActivationStatus): boolean;
|
|
8
|
-
export type SceneModelUsage = {
|
|
9
|
-
provider: string;
|
|
10
|
-
model: string;
|
|
11
|
-
inputTokens: number;
|
|
12
|
-
outputTokens: number;
|
|
13
|
-
totalTokens: number;
|
|
14
|
-
estimatedCost: number;
|
|
15
|
-
};
|
|
@@ -18,6 +18,7 @@ function validateTemplate(value, registered) {
|
|
|
18
18
|
const template = sceneTemplateSchema.parse(value);
|
|
19
19
|
for (const provider of template.contextProviders) if (!registered.contextProviders.includes(provider)) throw new Error(`Unknown scene context provider: ${provider}`);
|
|
20
20
|
for (const handler of template.allowedEffectHandlers) if (!registered.effectHandlers.includes(handler)) throw new Error(`Unknown scene effect handler: ${handler}`);
|
|
21
|
+
if (registered.executionAdapters && !registered.executionAdapters.includes(template.execution.kind)) throw new Error(`Unknown scene execution adapter: ${template.execution.kind}`);
|
|
21
22
|
return template;
|
|
22
23
|
}
|
|
23
24
|
function intersectPermissions(...permissions) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import
|
|
2
|
+
import type { AiUsageContext } from '../usage/types.js';
|
|
3
|
+
import { type SceneActivation, type ScenePermission, type SceneTemplate } from './contracts.js';
|
|
3
4
|
import { SceneRepository } from './repository.js';
|
|
5
|
+
import { SceneCapabilityRegistry } from './registry.js';
|
|
4
6
|
export declare const readOnlyResultSchema: z.ZodObject<{
|
|
5
7
|
kind: z.ZodEnum<{
|
|
6
8
|
artifact: "artifact";
|
|
@@ -27,6 +29,10 @@ export interface SceneEvidence {
|
|
|
27
29
|
}
|
|
28
30
|
export interface SceneContextProvider {
|
|
29
31
|
id: string;
|
|
32
|
+
setupIssues?(activation: SceneActivation): string[];
|
|
33
|
+
authorization?(activation: SceneActivation): string[] | null;
|
|
34
|
+
tracksHealth?: boolean;
|
|
35
|
+
requiresAccountIdentity?: boolean;
|
|
30
36
|
read(input: {
|
|
31
37
|
activation: SceneActivation;
|
|
32
38
|
subjectId: string;
|
|
@@ -41,7 +47,7 @@ export interface SceneReadOnlyExecutor {
|
|
|
41
47
|
goal: string;
|
|
42
48
|
evidence: SceneEvidence[];
|
|
43
49
|
signal: AbortSignal;
|
|
44
|
-
|
|
50
|
+
usage: AiUsageContext;
|
|
45
51
|
}): Promise<unknown>;
|
|
46
52
|
}
|
|
47
53
|
/** Runs one durable claim without exposing messaging, filesystem or write tools. */
|
|
@@ -51,6 +57,6 @@ export declare class SceneExecutionService {
|
|
|
51
57
|
private readonly executor;
|
|
52
58
|
private readonly authorize;
|
|
53
59
|
private readonly clock;
|
|
54
|
-
constructor(repository: SceneRepository, providers:
|
|
60
|
+
constructor(repository: SceneRepository, providers: SceneCapabilityRegistry<SceneContextProvider>, executor: SceneReadOnlyExecutor, authorize: (activation: SceneActivation) => Promise<ScenePermission>, clock?: () => number);
|
|
55
61
|
runNext(worker: string, outerSignal?: AbortSignal): Promise<'idle' | 'completed' | 'discarded' | 'failed' | 'deferred'>;
|
|
56
62
|
}
|
|
@@ -36,7 +36,6 @@ var SceneExecutionService = class {
|
|
|
36
36
|
this.executor = executor;
|
|
37
37
|
this.authorize = authorize;
|
|
38
38
|
this.clock = clock;
|
|
39
|
-
if (new Set(providers.map((provider) => provider.id)).size !== providers.length) throw new Error("Duplicate scene context providers");
|
|
40
39
|
}
|
|
41
40
|
async runNext(worker, outerSignal) {
|
|
42
41
|
outerSignal?.throwIfAborted();
|
|
@@ -46,6 +45,7 @@ var SceneExecutionService = class {
|
|
|
46
45
|
if (!runInput) return "discarded";
|
|
47
46
|
const { activation, subjectId, accountId, notBefore } = runInput;
|
|
48
47
|
const template = this.repository.getTemplate(activation.templateKey, activation.templateVersion);
|
|
48
|
+
if (template.execution.kind !== "agent") throw new SceneExecutionRejected("executor_unavailable");
|
|
49
49
|
if (!this.repository.renewLease(claim, this.clock(), template.execution.limits.timeoutSeconds * 1e3 + 5e3)) return "discarded";
|
|
50
50
|
const controller = new AbortController();
|
|
51
51
|
const abort = () => controller.abort(outerSignal?.reason);
|
|
@@ -69,7 +69,7 @@ var SceneExecutionService = class {
|
|
|
69
69
|
try {
|
|
70
70
|
granted = await this.authorize(activation);
|
|
71
71
|
} catch (error) {
|
|
72
|
-
if (template.contextProviders.
|
|
72
|
+
if (template.contextProviders.some((id) => this.providers.get(id).tracksHealth)) this.repository.recordSourceHealth(activation, sceneSourceFailureReason(error), this.clock(), this.clock() + 6e4);
|
|
73
73
|
throw error;
|
|
74
74
|
}
|
|
75
75
|
assertCurrent();
|
|
@@ -80,12 +80,11 @@ var SceneExecutionService = class {
|
|
|
80
80
|
});
|
|
81
81
|
const evidence = [];
|
|
82
82
|
for (const providerId of template.contextProviders) {
|
|
83
|
+
const provider = this.providers.get(providerId);
|
|
83
84
|
if (!permissions.contextProviders.includes(providerId)) {
|
|
84
|
-
if (
|
|
85
|
+
if (provider.tracksHealth) this.repository.recordSourceHealth(activation, "needs_permission", this.clock(), this.clock() + 6e4);
|
|
85
86
|
throw new SceneExecutionRejected("needs_permission");
|
|
86
87
|
}
|
|
87
|
-
const provider = this.providers.find((item) => item.id === providerId);
|
|
88
|
-
if (!provider) throw new SceneExecutionRejected("provider_unavailable");
|
|
89
88
|
let items;
|
|
90
89
|
try {
|
|
91
90
|
items = await provider.read({
|
|
@@ -96,11 +95,11 @@ var SceneExecutionService = class {
|
|
|
96
95
|
signal: controller.signal
|
|
97
96
|
});
|
|
98
97
|
} catch (error) {
|
|
99
|
-
if (
|
|
98
|
+
if (provider.tracksHealth && !outerSignal?.aborted) this.repository.recordSourceHealth(activation, sceneSourceFailureReason(error), this.clock(), this.clock() + 6e4);
|
|
100
99
|
throw error;
|
|
101
100
|
}
|
|
102
101
|
assertCurrent();
|
|
103
|
-
if (
|
|
102
|
+
if (provider.requiresAccountIdentity && items.some((item) => item.accountId === void 0)) throw new SceneExecutionRejected("missing_account_identity");
|
|
104
103
|
if (items.some((item) => !evidenceAllowed(item, activation, permissions, this.clock()))) throw new SceneExecutionRejected("unauthorized_or_stale_evidence");
|
|
105
104
|
evidence.push(...items);
|
|
106
105
|
}
|
|
@@ -108,7 +107,7 @@ var SceneExecutionService = class {
|
|
|
108
107
|
if (new Set(evidence.map((item) => item.id)).size !== evidence.length) throw new SceneExecutionRejected("duplicate_evidence");
|
|
109
108
|
evidence.sort((left, right) => left.id.localeCompare(right.id));
|
|
110
109
|
const fingerprint = sceneContentHash(evidence.map(({ freshUntil: _freshUntil, ...item }) => item));
|
|
111
|
-
if (template.contextProviders.
|
|
110
|
+
if (template.contextProviders.some((id) => this.providers.get(id).tracksHealth)) this.repository.recordSourceHealth(activation, null, this.clock());
|
|
112
111
|
return {
|
|
113
112
|
evidence,
|
|
114
113
|
fingerprint,
|
|
@@ -137,9 +136,11 @@ var SceneExecutionService = class {
|
|
|
137
136
|
goal: activation.goal,
|
|
138
137
|
evidence: snapshot.evidence,
|
|
139
138
|
signal: controller.signal,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
139
|
+
usage: {
|
|
140
|
+
operation: "scene.execute",
|
|
141
|
+
traceId: claim.id,
|
|
142
|
+
runId: claim.id,
|
|
143
|
+
...activation.scope.kind === "conversation" ? { conversationId: activation.scope.id } : {}
|
|
143
144
|
}
|
|
144
145
|
});
|
|
145
146
|
assertCurrent();
|
|
@@ -6,10 +6,13 @@ import type { SceneApplicationService } from './service.js';
|
|
|
6
6
|
import type { SceneMailContextProvider } from './mailContext.js';
|
|
7
7
|
import type { ScenePreferenceService } from './preferences.js';
|
|
8
8
|
import type { SceneMetrics } from './metrics.js';
|
|
9
|
-
import type {
|
|
9
|
+
import type { SceneActivationAdapter } from './activationAdapter.js';
|
|
10
|
+
import type { SceneCapabilityRegistry } from './registry.js';
|
|
11
|
+
import type { SceneSourceRegistry } from './taskFollowUp/contracts.js';
|
|
10
12
|
/** An explicitly installed scene domain; never resolves to the old runtime. */
|
|
11
13
|
export interface SceneHttpServices {
|
|
12
|
-
|
|
14
|
+
activationAdapters: SceneCapabilityRegistry<SceneActivationAdapter>;
|
|
15
|
+
sourceProviders: SceneSourceRegistry;
|
|
13
16
|
repository: SceneRepository;
|
|
14
17
|
application: SceneApplicationService;
|
|
15
18
|
inbox: SceneInboxService;
|
|
@@ -6,7 +6,11 @@ export declare class SceneMailContextProvider implements SceneContextProvider {
|
|
|
6
6
|
private readonly db;
|
|
7
7
|
private readonly clock;
|
|
8
8
|
readonly id = "mail";
|
|
9
|
+
readonly tracksHealth = true;
|
|
10
|
+
readonly requiresAccountIdentity = true;
|
|
9
11
|
constructor(db: DatabaseSync, clock?: () => number);
|
|
12
|
+
setupIssues(activation: SceneActivation): string[];
|
|
13
|
+
authorization(activation: SceneActivation): string[] | null;
|
|
10
14
|
/** Resolve current account grants for the exact delegated source, including reconnects and revocation. */
|
|
11
15
|
authorizedAccounts(activation: SceneActivation): string[];
|
|
12
16
|
/** Picker metadata only; choosing an item still requires explicit activation consent. */
|
|
@@ -11,10 +11,19 @@ const accountPolicy = `a.enabled = 1 AND installation.enabled = 1 AND c.status =
|
|
|
11
11
|
/** Reads a bounded, account-scoped thread from synchronized connector knowledge. */
|
|
12
12
|
var SceneMailContextProvider = class {
|
|
13
13
|
id = "mail";
|
|
14
|
+
tracksHealth = true;
|
|
15
|
+
requiresAccountIdentity = true;
|
|
14
16
|
constructor(db, clock = Date.now) {
|
|
15
17
|
this.db = db;
|
|
16
18
|
this.clock = clock;
|
|
17
19
|
}
|
|
20
|
+
setupIssues(activation) {
|
|
21
|
+
return activation.scope.kind === "objects" && activation.scope.ids.length === 1 && activation.permissions.accountIds.length === 1 ? [] : ["one_mail_thread_and_account"];
|
|
22
|
+
}
|
|
23
|
+
authorization(activation) {
|
|
24
|
+
const accounts = this.authorizedAccounts(activation);
|
|
25
|
+
return accounts.length ? accounts : null;
|
|
26
|
+
}
|
|
18
27
|
/** Resolve current account grants for the exact delegated source, including reconnects and revocation. */
|
|
19
28
|
authorizedAccounts(activation) {
|
|
20
29
|
if (activation.scope.kind !== "objects" || activation.scope.ids.length !== 1) return [];
|
|
@@ -11,11 +11,7 @@ function maintainSceneStorage(db, now = Date.now()) {
|
|
|
11
11
|
db.prepare(`DELETE FROM scene_mail_sources WHERE id IN (SELECT s.id FROM scene_mail_sources s
|
|
12
12
|
WHERE s.selected_at < ? AND NOT EXISTS (SELECT 1 FROM scene_activations a, json_each(a.scope_json, '$.ids') ids WHERE ids.value = s.id)
|
|
13
13
|
ORDER BY selected_at LIMIT 100)`).run(now - 30 * 864e5);
|
|
14
|
-
for (const table of [
|
|
15
|
-
"scene_context_snapshots",
|
|
16
|
-
"scene_model_reservations",
|
|
17
|
-
"scene_model_usage"
|
|
18
|
-
]) db.prepare(`DELETE FROM ${table} WHERE run_id IN (SELECT DISTINCT r.id FROM scene_runs r JOIN ${table} t ON t.run_id = r.id
|
|
14
|
+
for (const table of ["scene_context_snapshots", "scene_model_reservations"]) db.prepare(`DELETE FROM ${table} WHERE run_id IN (SELECT DISTINCT r.id FROM scene_runs r JOIN ${table} t ON t.run_id = r.id
|
|
19
15
|
WHERE r.status NOT IN ('running', 'retry_wait') AND r.created_at < ? ORDER BY r.created_at LIMIT 100)`).run(cutoff);
|
|
20
16
|
db.prepare("DELETE FROM notification_attention_budget WHERE dedupe_key IN (SELECT dedupe_key FROM notification_attention_budget WHERE created_at < ? LIMIT 100)").run(cutoff);
|
|
21
17
|
});
|
|
@@ -11,12 +11,6 @@ export declare class SceneMetrics {
|
|
|
11
11
|
currentModel: string;
|
|
12
12
|
pendingChecks: number;
|
|
13
13
|
oldestDueWaitMs: number;
|
|
14
|
-
lastSevenDays: {
|
|
15
|
-
modelCalls: number;
|
|
16
|
-
connectorReads: number;
|
|
17
|
-
tokens: number;
|
|
18
|
-
estimatedCost: number;
|
|
19
|
-
};
|
|
20
14
|
notifications: Record<string, import("node:sqlite").SQLOutputValue>[];
|
|
21
15
|
activations: Record<string, import("node:sqlite").SQLOutputValue>[];
|
|
22
16
|
};
|
|
@@ -12,11 +12,6 @@ var SceneMetrics = class {
|
|
|
12
12
|
const queue = this.db.prepare(`SELECT COUNT(*) AS depth, MIN(i.due_at) AS oldest
|
|
13
13
|
FROM scene_trigger_intents i JOIN scene_activations a ON a.id = i.activation_id
|
|
14
14
|
WHERE a.owner_id = ? AND a.workspace_id = ? AND i.status = 'pending'`).get(principal.ownerId, principal.workspaceId);
|
|
15
|
-
const usage = this.db.prepare(`SELECT COUNT(*) AS calls, COALESCE(SUM(u.total_tokens), 0) AS tokens,
|
|
16
|
-
COALESCE(SUM(u.estimated_cost), 0) AS cost FROM scene_model_usage u JOIN scene_runs r ON r.id = u.run_id
|
|
17
|
-
JOIN scene_activations a ON a.id = r.activation_id WHERE a.owner_id = ? AND a.workspace_id = ? AND u.recorded_at >= ?`).get(principal.ownerId, principal.workspaceId, now - 7 * 864e5);
|
|
18
|
-
const connectorReads = Number(this.db.prepare(`SELECT COALESCE(SUM(request_count), 0) AS count FROM scene_connector_usage
|
|
19
|
-
WHERE owner_id = ? AND workspace_id = ? AND utc_day >= ?`).get(principal.ownerId, principal.workspaceId, Math.floor(now / 864e5) - 6)?.count);
|
|
20
15
|
const notifications = this.db.prepare(`SELECT status, COUNT(*) AS count FROM notification_dispatches
|
|
21
16
|
WHERE owner_id = ? AND workspace_id = ? GROUP BY status`).all(principal.ownerId, principal.workspaceId);
|
|
22
17
|
const activations = this.db.prepare(`SELECT a.id, a.status,
|
|
@@ -49,12 +44,6 @@ var SceneMetrics = class {
|
|
|
49
44
|
currentModel,
|
|
50
45
|
pendingChecks: Number(queue.depth),
|
|
51
46
|
oldestDueWaitMs: queue.oldest == null ? 0 : Math.max(0, now - Number(queue.oldest)),
|
|
52
|
-
lastSevenDays: {
|
|
53
|
-
modelCalls: Number(usage.calls),
|
|
54
|
-
connectorReads,
|
|
55
|
-
tokens: Number(usage.tokens),
|
|
56
|
-
estimatedCost: Number(usage.cost)
|
|
57
|
-
},
|
|
58
47
|
notifications,
|
|
59
48
|
activations
|
|
60
49
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Small immutable registry used by scene capabilities at the composition root. */
|
|
2
|
+
export declare class SceneCapabilityRegistry<T extends {
|
|
3
|
+
id: string;
|
|
4
|
+
}> {
|
|
5
|
+
private readonly items;
|
|
6
|
+
constructor(items: readonly T[]);
|
|
7
|
+
ids(): string[];
|
|
8
|
+
list(): T[];
|
|
9
|
+
has(id: string): boolean;
|
|
10
|
+
get(id: string): T;
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/scenes/registry.ts
|
|
2
|
+
/** Small immutable registry used by scene capabilities at the composition root. */
|
|
3
|
+
var SceneCapabilityRegistry = class {
|
|
4
|
+
items = /* @__PURE__ */ new Map();
|
|
5
|
+
constructor(items) {
|
|
6
|
+
for (const item of items) {
|
|
7
|
+
if (!item.id.trim()) throw new Error("Scene capability id is required");
|
|
8
|
+
if (this.items.has(item.id)) throw new Error(`Duplicate scene capability: ${item.id}`);
|
|
9
|
+
this.items.set(item.id, item);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
ids() {
|
|
13
|
+
return [...this.items.keys()];
|
|
14
|
+
}
|
|
15
|
+
list() {
|
|
16
|
+
return [...this.items.values()];
|
|
17
|
+
}
|
|
18
|
+
has(id) {
|
|
19
|
+
return this.items.has(id);
|
|
20
|
+
}
|
|
21
|
+
get(id) {
|
|
22
|
+
const item = this.items.get(id);
|
|
23
|
+
if (!item) throw new Error(`Scene capability unavailable: ${id}`);
|
|
24
|
+
return item;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { SceneCapabilityRegistry };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { SceneModelUsage } from './contracts.js';
|
|
2
1
|
import type { DatabaseSync } from 'node:sqlite';
|
|
3
2
|
import { type ActivationStatus, type SceneActivation, type ScenePrincipal, type SceneTemplate } from './contracts.js';
|
|
4
3
|
export interface SceneEventInput {
|
|
@@ -70,8 +69,6 @@ export declare class SceneRepository {
|
|
|
70
69
|
accountId: string;
|
|
71
70
|
dueAt: number;
|
|
72
71
|
}, now: number): SceneWorkItem;
|
|
73
|
-
/** Internal worker scan; identity comes from persisted ownership, never an event payload. */
|
|
74
|
-
recordModelUsage(claim: SceneRunClaim, usage: SceneModelUsage, now: number): void;
|
|
75
72
|
listMailObservationItems(afterId?: string, now?: number): Array<{
|
|
76
73
|
principal: ScenePrincipal;
|
|
77
74
|
item: SceneWorkItem;
|
|
@@ -99,6 +96,7 @@ export declare class SceneRepository {
|
|
|
99
96
|
}, now: number): string;
|
|
100
97
|
acceptManualCheck(principal: ScenePrincipal, activationId: string, triggerKey: string, requestId: string, now: number): string;
|
|
101
98
|
claimNext(worker: string, now: number, leaseMs?: number): SceneRunClaim | null;
|
|
99
|
+
claimIntentForAdapter(principal: ScenePrincipal, activationId: string, intentId: string, adapterId: string, worker: string, now: number, leaseMs: number): SceneRunClaim;
|
|
102
100
|
renewLease(claim: SceneRunClaim, now: number, leaseMs: number): boolean;
|
|
103
101
|
reserveModelCall(claim: SceneRunClaim, now: number, limits?: {
|
|
104
102
|
activation: number;
|
|
@@ -117,6 +115,11 @@ export declare class SceneRepository {
|
|
|
117
115
|
summary: string;
|
|
118
116
|
evidenceIds: string[];
|
|
119
117
|
}, now: number): boolean;
|
|
118
|
+
finishAdapterRun(claim: SceneRunClaim, result: {
|
|
119
|
+
kind: 'artifact' | 'decision' | 'receipt';
|
|
120
|
+
summary: string;
|
|
121
|
+
[key: string]: unknown;
|
|
122
|
+
}, now: number): boolean;
|
|
120
123
|
listInbox(principal: ScenePrincipal, limit?: number, afterId?: string, activationId?: string | null): {
|
|
121
124
|
createdAt: number;
|
|
122
125
|
sources: {
|
|
@@ -238,11 +238,6 @@ var SceneRepository = class {
|
|
|
238
238
|
};
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
|
-
/** Internal worker scan; identity comes from persisted ownership, never an event payload. */
|
|
242
|
-
recordModelUsage(claim, usage, now) {
|
|
243
|
-
if (!this.isCurrentClaim(claim, now)) return;
|
|
244
|
-
this.db.prepare(`INSERT OR IGNORE INTO scene_model_usage VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(claim.id, claim.leaseEpoch, usage.provider, usage.model, usage.inputTokens, usage.outputTokens, usage.totalTokens, usage.estimatedCost, now);
|
|
245
|
-
}
|
|
246
241
|
listMailObservationItems(afterId = "", now = Date.now()) {
|
|
247
242
|
return this.db.prepare(`SELECT w.*, a.owner_id, a.workspace_id FROM scene_work_items w
|
|
248
243
|
JOIN scene_activations a ON a.id = w.activation_id
|
|
@@ -525,7 +520,9 @@ var SceneRepository = class {
|
|
|
525
520
|
this.db.prepare(`UPDATE scene_trigger_intents SET status = 'resolved' WHERE status = 'claimed'
|
|
526
521
|
AND id IN (SELECT intent_id FROM scene_runs WHERE status = 'failed')`).run();
|
|
527
522
|
const retry = this.db.prepare(`SELECT r.* FROM scene_runs r JOIN scene_activations a ON a.id = r.activation_id
|
|
523
|
+
JOIN scene_template_versions t ON t.template_key = a.template_key AND t.version = a.template_version
|
|
528
524
|
WHERE a.status = 'active' AND a.revision = r.activation_revision AND ${checksAllowed}
|
|
525
|
+
AND json_extract(t.manifest_json, '$.execution.kind') = 'agent'
|
|
529
526
|
AND (r.attempt < 3 OR (r.status = 'retry_wait' AND r.reason IN ('source_not_ready', 'daily_budget')))
|
|
530
527
|
AND ((r.status = 'running' AND r.lease_until <= ?) OR (r.status = 'retry_wait' AND r.retry_at <= ?))
|
|
531
528
|
ORDER BY r.created_at, r.id LIMIT 1`).get(now / 1e3, now, now);
|
|
@@ -535,7 +532,9 @@ var SceneRepository = class {
|
|
|
535
532
|
return this.readClaim(String(retry.id));
|
|
536
533
|
}
|
|
537
534
|
const intent = this.db.prepare(`SELECT i.* FROM scene_trigger_intents i JOIN scene_activations a ON a.id = i.activation_id
|
|
535
|
+
JOIN scene_template_versions t ON t.template_key = a.template_key AND t.version = a.template_version
|
|
538
536
|
WHERE i.status = 'pending' AND i.due_at <= ? AND a.status = 'active' AND a.revision = i.activation_revision AND ${checksAllowed}
|
|
537
|
+
AND json_extract(t.manifest_json, '$.execution.kind') = 'agent'
|
|
539
538
|
AND NOT EXISTS (SELECT 1 FROM scene_runs r WHERE r.activation_id = a.id AND r.status IN ('running', 'retry_wait'))
|
|
540
539
|
ORDER BY i.due_at, i.id LIMIT 1`).get(now, now / 1e3);
|
|
541
540
|
if (!intent) return null;
|
|
@@ -546,6 +545,21 @@ var SceneRepository = class {
|
|
|
546
545
|
return this.readClaim(id);
|
|
547
546
|
});
|
|
548
547
|
}
|
|
548
|
+
claimIntentForAdapter(principal, activationId, intentId, adapterId, worker, now, leaseMs) {
|
|
549
|
+
if (!adapterId.trim() || !worker.trim() || !Number.isSafeInteger(now) || now < 0 || !Number.isSafeInteger(leaseMs) || leaseMs < 1) throw new Error("Invalid scene lease");
|
|
550
|
+
return this.transaction(() => {
|
|
551
|
+
const activation = this.getActivation(principal, activationId);
|
|
552
|
+
if (this.getTemplate(activation.templateKey, activation.templateVersion).execution.kind !== adapterId) throw new SceneConflictError("Scene execution adapter changed");
|
|
553
|
+
if (!this.db.prepare(`SELECT * FROM scene_trigger_intents
|
|
554
|
+
WHERE id = ? AND activation_id = ? AND activation_revision = ? AND status = 'pending' AND due_at <= ?`).get(intentId, activationId, activation.revision, now)) throw new SceneConflictError("Scene trigger is no longer available");
|
|
555
|
+
if (this.db.prepare("SELECT 1 FROM scene_runs WHERE activation_id = ? AND status IN ('running', 'retry_wait')").get(activationId)) throw new SceneConflictError("Scene already has an active run");
|
|
556
|
+
const id = randomUUID();
|
|
557
|
+
this.db.prepare(`INSERT INTO scene_runs (id, intent_id, activation_id, activation_revision, status, attempt, lease_epoch, lease_owner, lease_until, created_at)
|
|
558
|
+
VALUES (?, ?, ?, ?, 'running', 1, 1, ?, ?, ?)`).run(id, intentId, activationId, activation.revision, worker, now + leaseMs, now);
|
|
559
|
+
this.db.prepare("UPDATE scene_trigger_intents SET status = 'claimed' WHERE id = ?").run(intentId);
|
|
560
|
+
return this.readClaim(id);
|
|
561
|
+
});
|
|
562
|
+
}
|
|
549
563
|
renewLease(claim, now, leaseMs) {
|
|
550
564
|
if (!Number.isSafeInteger(leaseMs) || leaseMs < 1) throw new Error("Invalid scene lease");
|
|
551
565
|
return this.db.prepare(`UPDATE scene_runs SET lease_until = ? WHERE id = ? AND status = 'running'
|
|
@@ -639,6 +653,30 @@ var SceneRepository = class {
|
|
|
639
653
|
return true;
|
|
640
654
|
});
|
|
641
655
|
}
|
|
656
|
+
finishAdapterRun(claim, result, now) {
|
|
657
|
+
return this.transaction(() => {
|
|
658
|
+
if (!this.isCurrentClaim(claim, now)) return false;
|
|
659
|
+
const row = this.db.prepare(`SELECT t.manifest_json, a.owner_id, a.workspace_id FROM scene_activations a JOIN scene_template_versions t
|
|
660
|
+
ON a.template_key = t.template_key AND a.template_version = t.version WHERE a.id = ?`).get(claim.activationId);
|
|
661
|
+
const template = sceneTemplateSchema.parse(JSON.parse(String(row.manifest_json)));
|
|
662
|
+
if (template.execution.kind === "agent" || !template.allowedOutcomeKinds.includes(result.kind)) throw new Error("Scene result kind is not allowed");
|
|
663
|
+
if (!result.summary.trim()) throw new Error("Scene result needs a summary");
|
|
664
|
+
const outcomeId = randomUUID();
|
|
665
|
+
this.db.prepare(`UPDATE scene_presentations AS p SET status = 'withdrawn', withdrawn_at = ? WHERE p.outcome_id IN (
|
|
666
|
+
SELECT o.id FROM scene_outcomes o JOIN scene_runs r ON r.id = o.run_id
|
|
667
|
+
WHERE r.activation_id = ?
|
|
668
|
+
)`).run(now, claim.activationId);
|
|
669
|
+
this.db.prepare("INSERT INTO scene_outcomes VALUES (?, ?, ?, ?, ?)").run(outcomeId, claim.id, result.kind, JSON.stringify(result), now);
|
|
670
|
+
const presentationId = randomUUID();
|
|
671
|
+
this.db.prepare("INSERT INTO scene_presentations(id, outcome_id, destination, status, created_at) VALUES (?, ?, 'inbox', 'unread', ?)").run(presentationId, outcomeId, now);
|
|
672
|
+
this.db.prepare(`INSERT INTO notification_result_outbox
|
|
673
|
+
(id, owner_id, workspace_id, subject_id, status, attempt, next_attempt_at, created_at, updated_at)
|
|
674
|
+
VALUES (?, ?, ?, ?, 'pending', 0, ?, ?, ?)`).run(presentationId, row.owner_id, row.workspace_id, presentationId, now, now, now);
|
|
675
|
+
this.db.prepare("UPDATE scene_runs SET status = 'succeeded', reason = NULL, lease_owner = NULL, lease_until = NULL WHERE id = ?").run(claim.id);
|
|
676
|
+
this.db.prepare("UPDATE scene_trigger_intents SET status = 'resolved' WHERE id = ?").run(claim.intentId);
|
|
677
|
+
return true;
|
|
678
|
+
});
|
|
679
|
+
}
|
|
642
680
|
listInbox(principal, limit = 50, afterId = "", activationId = null) {
|
|
643
681
|
this.assertPrincipal(principal);
|
|
644
682
|
const now = Date.now();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type SceneActivation, type ScenePermission, type ScenePrincipal } from './contracts.js';
|
|
2
2
|
import type { SceneContextProvider } from './execution.js';
|
|
3
|
+
import { SceneCapabilityRegistry } from './registry.js';
|
|
3
4
|
import { SceneRepository } from './repository.js';
|
|
4
5
|
export declare class SceneSetupError extends Error {
|
|
5
6
|
readonly missing: string[];
|
|
@@ -12,7 +13,7 @@ export declare class SceneApplicationService {
|
|
|
12
13
|
private readonly authorize;
|
|
13
14
|
private readonly clock;
|
|
14
15
|
private readonly modelReadiness;
|
|
15
|
-
constructor(repository: SceneRepository, providers:
|
|
16
|
+
constructor(repository: SceneRepository, providers: SceneCapabilityRegistry<SceneContextProvider>, authorize: (activation: SceneActivation) => Promise<ScenePermission>, clock?: () => number, modelReadiness?: () => string[]);
|
|
16
17
|
get database(): import("node:sqlite").DatabaseSync;
|
|
17
18
|
preflight(principal: ScenePrincipal, value: unknown): Promise<{
|
|
18
19
|
ready: boolean;
|
|
@@ -37,8 +37,9 @@ var SceneApplicationService = class {
|
|
|
37
37
|
async checkReadiness(activation) {
|
|
38
38
|
const input = activation;
|
|
39
39
|
const template = validateTemplate(this.repository.getTemplate(input.templateKey, input.templateVersion), {
|
|
40
|
-
contextProviders: this.providers.
|
|
41
|
-
effectHandlers: []
|
|
40
|
+
contextProviders: this.providers.ids(),
|
|
41
|
+
effectHandlers: [],
|
|
42
|
+
executionAdapters: ["agent"]
|
|
42
43
|
});
|
|
43
44
|
const permissions = intersectPermissions(input.permissions, await this.authorize(activation));
|
|
44
45
|
const missing = template.contextProviders.filter((provider) => !permissions.contextProviders.includes(provider)).map((id) => `context:${id}`);
|
|
@@ -46,8 +47,7 @@ var SceneApplicationService = class {
|
|
|
46
47
|
missing.push(...input.permissions.accountIds.filter((id) => !permissions.accountIds.includes(id)).map((id) => `account:${id}`));
|
|
47
48
|
if (input.permissions.effectHandlers.length > 0) missing.push("read_only_execution");
|
|
48
49
|
if (input.permissions.contextProviders.some((id) => !template.contextProviders.includes(id))) missing.push("unrequested_context");
|
|
49
|
-
|
|
50
|
-
if (template.contextProviders.includes("user_notes") && input.scope.kind !== "personal") missing.push("personal_notes_scope");
|
|
50
|
+
for (const providerId of template.contextProviders) missing.push(...this.providers.get(providerId).setupIssues?.(activation) ?? []);
|
|
51
51
|
return {
|
|
52
52
|
ready: missing.length === 0,
|
|
53
53
|
missing
|
|
@@ -79,7 +79,7 @@ var SceneApplicationService = class {
|
|
|
79
79
|
async prepareTransition(principal, id, value) {
|
|
80
80
|
const input = SceneTransitionSchema.parse(value);
|
|
81
81
|
const activation = this.repository.getActivation(principal, id);
|
|
82
|
-
if (activation.templateKey
|
|
82
|
+
if (this.repository.getTemplate(activation.templateKey, activation.templateVersion).execution.kind !== "agent") throw new SceneConflictError("Use the activation execution adapter");
|
|
83
83
|
if (activation.revision !== input.expectedRevision) throw new SceneConflictError("Scene activation changed");
|
|
84
84
|
if (input.status === "active") {
|
|
85
85
|
const result = await this.checkReadiness(activation);
|
|
@@ -89,11 +89,13 @@ var SceneApplicationService = class {
|
|
|
89
89
|
/** The exact revision fences changes made while asynchronous readiness checks were running. */
|
|
90
90
|
transitionAfterPreflight(principal, id, value) {
|
|
91
91
|
const input = SceneTransitionSchema.parse(value);
|
|
92
|
-
|
|
92
|
+
const activation = this.repository.getActivation(principal, id);
|
|
93
|
+
if (this.repository.getTemplate(activation.templateKey, activation.templateVersion).execution.kind !== "agent") throw new SceneConflictError("Use the activation execution adapter");
|
|
93
94
|
return this.repository.transitionActivation(principal, id, input.expectedRevision, input.status, this.clock());
|
|
94
95
|
}
|
|
95
96
|
configure(principal, id, value) {
|
|
96
|
-
|
|
97
|
+
const activation = this.repository.getActivation(principal, id);
|
|
98
|
+
if (this.repository.getTemplate(activation.templateKey, activation.templateVersion).execution.kind !== "agent") throw new SceneConflictError("Use the activation execution adapter");
|
|
97
99
|
const { expectedRevision, ...input } = SceneConfigureSchema.parse(value);
|
|
98
100
|
return this.repository.configureActivation(principal, id, expectedRevision, input);
|
|
99
101
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type ScenePrincipal } from '../contracts.js';
|
|
3
|
+
import { SceneCapabilityRegistry } from '../registry.js';
|
|
3
4
|
export declare const taskFollowUpTemplate: {
|
|
4
5
|
schemaVersion: 1;
|
|
5
6
|
key: string;
|
|
@@ -20,7 +21,39 @@ export declare const taskFollowUpTemplate: {
|
|
|
20
21
|
type: "schedule";
|
|
21
22
|
})[];
|
|
22
23
|
execution: {
|
|
23
|
-
kind:
|
|
24
|
+
kind: string;
|
|
25
|
+
instruction: string;
|
|
26
|
+
limits: {
|
|
27
|
+
timeoutSeconds: number;
|
|
28
|
+
maxIterations: number;
|
|
29
|
+
maxToolCalls: number;
|
|
30
|
+
maxOutputTokens: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
allowedOutcomeKinds: ("artifact" | "receipt" | "decision" | "observation" | "no_change" | "state_change" | "effect_proposal")[];
|
|
34
|
+
allowedEffectHandlers: string[];
|
|
35
|
+
};
|
|
36
|
+
export declare const decisionLogTemplate: {
|
|
37
|
+
schemaVersion: 1;
|
|
38
|
+
key: string;
|
|
39
|
+
version: string;
|
|
40
|
+
title: string;
|
|
41
|
+
description: string;
|
|
42
|
+
goalMode: "finite" | "ongoing";
|
|
43
|
+
contextProviders: string[];
|
|
44
|
+
triggers: ({
|
|
45
|
+
id: string;
|
|
46
|
+
type: "manual";
|
|
47
|
+
} | {
|
|
48
|
+
id: string;
|
|
49
|
+
type: "event";
|
|
50
|
+
eventType: string;
|
|
51
|
+
} | {
|
|
52
|
+
id: string;
|
|
53
|
+
type: "schedule";
|
|
54
|
+
})[];
|
|
55
|
+
execution: {
|
|
56
|
+
kind: string;
|
|
24
57
|
instruction: string;
|
|
25
58
|
limits: {
|
|
26
59
|
timeoutSeconds: number;
|
|
@@ -43,7 +76,7 @@ export type SourceSnapshot = {
|
|
|
43
76
|
observedAt: number;
|
|
44
77
|
};
|
|
45
78
|
/** Adapters own source syntax and permission checks, never task or execution policy. */
|
|
46
|
-
export interface
|
|
79
|
+
export interface SceneSourceAdapter {
|
|
47
80
|
id: string;
|
|
48
81
|
label: string;
|
|
49
82
|
normalize(reference: Record<string, string>): Record<string, string>;
|
|
@@ -56,14 +89,11 @@ export interface TaskSourceAdapter {
|
|
|
56
89
|
}>;
|
|
57
90
|
resolveLink?(principal: ScenePrincipal, accountId: string, url: string, signal: AbortSignal): Promise<Record<string, string>>;
|
|
58
91
|
}
|
|
59
|
-
export declare class
|
|
60
|
-
|
|
61
|
-
constructor(adapters: TaskSourceAdapter[]);
|
|
62
|
-
list(): {
|
|
92
|
+
export declare class SceneSourceRegistry extends SceneCapabilityRegistry<SceneSourceAdapter> {
|
|
93
|
+
providers(): {
|
|
63
94
|
id: string;
|
|
64
95
|
label: string;
|
|
65
96
|
}[];
|
|
66
|
-
get(id: string): TaskSourceAdapter;
|
|
67
97
|
normalize(source: SourceReference): SourceReference;
|
|
68
98
|
}
|
|
69
99
|
export declare const taskFollowUpInputSchema: z.ZodObject<{
|