@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
|
@@ -9,7 +9,7 @@ import { AppContextEnvelopeSchema, ResolvedAppContextSchema, init_app_context }
|
|
|
9
9
|
import { SceneActivationSchema, SceneConfigureSchema, SceneFeedbackSchema, ScenePreferencePatchSchema, SceneTransitionSchema, SceneWorkItemCreateSchema, SceneWorkItemSchema, SceneWorkItemUpdateSchema, activationInputSchema, init_scenes, sceneNotesSchema, scenePreferencesSchema, sceneScheduleSchema, sceneTemplateSchema } from "./scenes.js";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
//#region packages/gateway-contract/src/capabilities.ts
|
|
12
|
-
var CapabilityErrorCodeSchema, CapabilityCallSchema, AutomationSimulationSchema, AutomationDraftRequestSchema, AutomationDraftOutputSchema, AutomationRepairDraftOutputSchema, CapabilityResourceInputSchema, ScenePageInputSchema, SceneWriteContracts, SceneOutcomeReadSchema, TaskRunCancelInputSchema, TaskRunFeedbackInputSchema, TaskRunFeedbackOutputSchema, TaskRunCancelOutputSchema, AutomationSetEnabledInputSchema, AutomationMutationOutputSchema, AutomationRunMutationOutputSchema, AutomationCancelOutputSchema, AutomationReadOutputSchema, AutomationReadAllInputSchema, AutomationReadAllOutputSchema, AutomationDeleteInputSchema, AutomationDeleteOutputSchema, NoteListInputSchema, NoteRecordSchema, NoteGetOutputSchema, NoteDeleteInputSchema, NoteDeleteOutputSchema, NoteCreateInputSchema, NoteUpdateInputSchema, NoteCaptureInputSchema, NoteAppendInputSchema, NoteRestoreInputSchema, NoteListOutputSchema, TaskListInputSchema, ProjectRecordSchema, ProjectSetPinnedInputSchema, ProjectMutationOutputSchema, ProjectResolveWorkspaceInputSchema, ProjectResolveWorkspaceOutputSchema, ProjectDeleteInputSchema, ProjectDeleteOutputSchema, ProjectFields, ProjectCreateInputSchema, ProjectEditInputSchema, ProjectListInputSchema, ProjectMilestoneSchema, ProjectUpdateSchema, MilestoneFields, ProjectMilestoneCreateInputSchema, ProjectMilestoneUpdateInputSchema, ProjectMilestoneDeleteInputSchema, ProjectMilestoneOutputSchema, ProjectMilestoneDeleteOutputSchema, ProjectUpdateCreateInputSchema, ProjectUpdateOutputSchema, ProductReadContracts;
|
|
12
|
+
var CapabilityErrorCodeSchema, CapabilityCallSchema, AutomationSimulationSchema, AutomationDraftRequestSchema, AutomationDraftOutputSchema, AutomationRepairDraftOutputSchema, CapabilityResourceInputSchema, ScenePageInputSchema, SceneWriteContracts, SceneOutcomeReadSchema, TaskRunCancelInputSchema, TaskRunFeedbackInputSchema, TaskRunFeedbackOutputSchema, TaskRunCancelOutputSchema, AutomationSetEnabledInputSchema, AutomationMutationOutputSchema, AutomationRunMutationOutputSchema, AutomationCancelOutputSchema, AutomationReadOutputSchema, AutomationReadAllInputSchema, AutomationReadAllOutputSchema, AutomationReplayEventInputSchema, AutomationRetryDeliveryInputSchema, AutomationRecoveryOutputSchema, AutomationDeleteInputSchema, AutomationDeleteOutputSchema, NoteListInputSchema, NoteRecordSchema, NoteGetOutputSchema, NoteDeleteInputSchema, NoteDeleteOutputSchema, NoteCreateInputSchema, NoteUpdateInputSchema, NoteCaptureInputSchema, NoteAppendInputSchema, NoteRestoreInputSchema, NoteListOutputSchema, TaskListInputSchema, ProjectRecordSchema, ProjectSetPinnedInputSchema, ProjectMutationOutputSchema, ProjectResolveWorkspaceInputSchema, ProjectResolveWorkspaceOutputSchema, ProjectDeleteInputSchema, ProjectDeleteOutputSchema, ProjectFields, ProjectCreateInputSchema, ProjectEditInputSchema, ProjectListInputSchema, ProjectMilestoneSchema, ProjectUpdateSchema, MilestoneFields, ProjectMilestoneCreateInputSchema, ProjectMilestoneUpdateInputSchema, ProjectMilestoneDeleteInputSchema, ProjectMilestoneOutputSchema, ProjectMilestoneDeleteOutputSchema, ProjectUpdateCreateInputSchema, ProjectUpdateOutputSchema, ProductReadContracts;
|
|
13
13
|
var init_capabilities = __esmMin((() => {
|
|
14
14
|
init_app_context();
|
|
15
15
|
init_task_lifecycle();
|
|
@@ -227,6 +227,16 @@ var init_capabilities = __esmMin((() => {
|
|
|
227
227
|
ok: z.literal(true),
|
|
228
228
|
count: z.number().int().nonnegative()
|
|
229
229
|
});
|
|
230
|
+
AutomationReplayEventInputSchema = CapabilityResourceInputSchema.extend({ reason: z.string().trim().min(1).max(2e3) });
|
|
231
|
+
AutomationRetryDeliveryInputSchema = z.strictObject({
|
|
232
|
+
runId: z.string().trim().min(1).max(200),
|
|
233
|
+
destinationKey: z.string().trim().min(1).max(100),
|
|
234
|
+
reason: z.string().trim().min(1).max(2e3)
|
|
235
|
+
});
|
|
236
|
+
AutomationRecoveryOutputSchema = z.object({
|
|
237
|
+
ok: z.literal(true),
|
|
238
|
+
accepted: z.literal(true)
|
|
239
|
+
});
|
|
230
240
|
AutomationDeleteInputSchema = CapabilityResourceInputSchema.extend({ expectedRevision: z.number().int().nonnegative().nullable() });
|
|
231
241
|
AutomationDeleteOutputSchema = z.object({
|
|
232
242
|
ok: z.literal(true),
|
|
@@ -601,6 +611,100 @@ var init_capabilities = __esmMin((() => {
|
|
|
601
611
|
metrics: AutomationMetricsSchema
|
|
602
612
|
})
|
|
603
613
|
},
|
|
614
|
+
"xopc.automations.events": {
|
|
615
|
+
input: z.strictObject({
|
|
616
|
+
type: z.string().trim().min(1).max(512).optional(),
|
|
617
|
+
source: z.string().trim().min(1).max(512).optional(),
|
|
618
|
+
limit: z.number().int().min(1).max(200).default(50)
|
|
619
|
+
}),
|
|
620
|
+
output: z.object({
|
|
621
|
+
ok: z.literal(true),
|
|
622
|
+
items: z.array(z.object({
|
|
623
|
+
event: z.object({
|
|
624
|
+
id: z.string(),
|
|
625
|
+
type: z.string(),
|
|
626
|
+
schemaVersion: z.number().int(),
|
|
627
|
+
source: z.string(),
|
|
628
|
+
subject: z.object({
|
|
629
|
+
kind: z.string(),
|
|
630
|
+
id: z.string()
|
|
631
|
+
}).optional(),
|
|
632
|
+
payload: z.record(z.string(), z.unknown()),
|
|
633
|
+
occurredAtMs: z.number(),
|
|
634
|
+
ingestedAtMs: z.number(),
|
|
635
|
+
correlationId: z.string(),
|
|
636
|
+
causationId: z.string().optional(),
|
|
637
|
+
rootEventId: z.string(),
|
|
638
|
+
chainDepth: z.number().int(),
|
|
639
|
+
dedupeKey: z.string().optional(),
|
|
640
|
+
trust: z.enum([
|
|
641
|
+
"system",
|
|
642
|
+
"user",
|
|
643
|
+
"connector",
|
|
644
|
+
"untrusted_webhook"
|
|
645
|
+
])
|
|
646
|
+
}),
|
|
647
|
+
projectionStatus: z.enum([
|
|
648
|
+
"pending",
|
|
649
|
+
"projecting",
|
|
650
|
+
"retrying",
|
|
651
|
+
"projected",
|
|
652
|
+
"dead_letter"
|
|
653
|
+
]),
|
|
654
|
+
projectionAttempts: z.number().int(),
|
|
655
|
+
projectionError: z.string().optional(),
|
|
656
|
+
deliveries: z.array(z.object({
|
|
657
|
+
automationId: z.string(),
|
|
658
|
+
status: z.enum([
|
|
659
|
+
"pending",
|
|
660
|
+
"retrying",
|
|
661
|
+
"queued",
|
|
662
|
+
"completed",
|
|
663
|
+
"failed",
|
|
664
|
+
"cancelled",
|
|
665
|
+
"skipped",
|
|
666
|
+
"dead_letter"
|
|
667
|
+
]),
|
|
668
|
+
runId: z.string().optional(),
|
|
669
|
+
attempts: z.number().int(),
|
|
670
|
+
lastError: z.string().optional()
|
|
671
|
+
}))
|
|
672
|
+
}))
|
|
673
|
+
})
|
|
674
|
+
},
|
|
675
|
+
"xopc.automations.deliveries": {
|
|
676
|
+
input: z.strictObject({
|
|
677
|
+
runId: z.string().trim().min(1).max(200).optional(),
|
|
678
|
+
status: z.enum([
|
|
679
|
+
"pending",
|
|
680
|
+
"delivering",
|
|
681
|
+
"retrying",
|
|
682
|
+
"delivered",
|
|
683
|
+
"dead_letter"
|
|
684
|
+
]).optional(),
|
|
685
|
+
limit: z.number().int().min(1).max(200).default(50)
|
|
686
|
+
}),
|
|
687
|
+
output: z.object({
|
|
688
|
+
ok: z.literal(true),
|
|
689
|
+
items: z.array(z.object({
|
|
690
|
+
runId: z.string(),
|
|
691
|
+
destinationKey: z.string(),
|
|
692
|
+
kind: z.string(),
|
|
693
|
+
status: z.enum([
|
|
694
|
+
"pending",
|
|
695
|
+
"delivering",
|
|
696
|
+
"retrying",
|
|
697
|
+
"delivered",
|
|
698
|
+
"dead_letter"
|
|
699
|
+
]),
|
|
700
|
+
attempts: z.number().int(),
|
|
701
|
+
nextAttemptAtMs: z.number(),
|
|
702
|
+
lastError: z.string().optional(),
|
|
703
|
+
createdAtMs: z.number(),
|
|
704
|
+
updatedAtMs: z.number()
|
|
705
|
+
}))
|
|
706
|
+
})
|
|
707
|
+
},
|
|
604
708
|
"xopc.automations.product_events": {
|
|
605
709
|
input: z.strictObject({
|
|
606
710
|
eventType: z.string().trim().min(1).max(512),
|
|
@@ -717,12 +821,6 @@ var init_capabilities = __esmMin((() => {
|
|
|
717
821
|
currentModel: z.string().nullable(),
|
|
718
822
|
pendingChecks: z.number().int().nonnegative(),
|
|
719
823
|
oldestDueWaitMs: z.number().nonnegative(),
|
|
720
|
-
lastSevenDays: z.object({
|
|
721
|
-
modelCalls: z.number().int().nonnegative(),
|
|
722
|
-
connectorReads: z.number().int().nonnegative(),
|
|
723
|
-
tokens: z.number().nonnegative(),
|
|
724
|
-
estimatedCost: z.number().nonnegative()
|
|
725
|
-
}),
|
|
726
824
|
notifications: z.array(z.object({
|
|
727
825
|
status: z.string(),
|
|
728
826
|
count: z.number().int().nonnegative()
|
|
@@ -969,4 +1067,4 @@ var init_capabilities = __esmMin((() => {
|
|
|
969
1067
|
}));
|
|
970
1068
|
//#endregion
|
|
971
1069
|
init_capabilities();
|
|
972
|
-
export { AutomationCancelOutputSchema, AutomationDeleteInputSchema, AutomationDeleteOutputSchema, AutomationDraftOutputSchema, AutomationDraftRequestSchema, AutomationMutationOutputSchema, AutomationReadAllInputSchema, AutomationReadAllOutputSchema, AutomationReadOutputSchema, AutomationRepairDraftOutputSchema, AutomationRunMutationOutputSchema, AutomationSetEnabledInputSchema, AutomationSimulationSchema, CapabilityCallSchema, CapabilityErrorCodeSchema, CapabilityResourceInputSchema, NoteAppendInputSchema, NoteCaptureInputSchema, NoteCreateInputSchema, NoteDeleteInputSchema, NoteDeleteOutputSchema, NoteGetOutputSchema, NoteListInputSchema, NoteListOutputSchema, NoteRecordSchema, NoteRestoreInputSchema, NoteUpdateInputSchema, ProductReadContracts, ProjectCreateInputSchema, ProjectDeleteInputSchema, ProjectDeleteOutputSchema, ProjectEditInputSchema, ProjectListInputSchema, ProjectMilestoneCreateInputSchema, ProjectMilestoneDeleteInputSchema, ProjectMilestoneDeleteOutputSchema, ProjectMilestoneOutputSchema, ProjectMilestoneSchema, ProjectMilestoneUpdateInputSchema, ProjectMutationOutputSchema, ProjectRecordSchema, ProjectResolveWorkspaceInputSchema, ProjectResolveWorkspaceOutputSchema, ProjectSetPinnedInputSchema, ProjectUpdateCreateInputSchema, ProjectUpdateOutputSchema, ProjectUpdateSchema, ScenePageInputSchema, SceneWriteContracts, TaskListInputSchema, TaskRunCancelInputSchema, TaskRunCancelOutputSchema, TaskRunFeedbackInputSchema, TaskRunFeedbackOutputSchema, init_capabilities };
|
|
1070
|
+
export { AutomationCancelOutputSchema, AutomationDeleteInputSchema, AutomationDeleteOutputSchema, AutomationDraftOutputSchema, AutomationDraftRequestSchema, AutomationMutationOutputSchema, AutomationReadAllInputSchema, AutomationReadAllOutputSchema, AutomationReadOutputSchema, AutomationRecoveryOutputSchema, AutomationRepairDraftOutputSchema, AutomationReplayEventInputSchema, AutomationRetryDeliveryInputSchema, AutomationRunMutationOutputSchema, AutomationSetEnabledInputSchema, AutomationSimulationSchema, CapabilityCallSchema, CapabilityErrorCodeSchema, CapabilityResourceInputSchema, NoteAppendInputSchema, NoteCaptureInputSchema, NoteCreateInputSchema, NoteDeleteInputSchema, NoteDeleteOutputSchema, NoteGetOutputSchema, NoteListInputSchema, NoteListOutputSchema, NoteRecordSchema, NoteRestoreInputSchema, NoteUpdateInputSchema, ProductReadContracts, ProjectCreateInputSchema, ProjectDeleteInputSchema, ProjectDeleteOutputSchema, ProjectEditInputSchema, ProjectListInputSchema, ProjectMilestoneCreateInputSchema, ProjectMilestoneDeleteInputSchema, ProjectMilestoneDeleteOutputSchema, ProjectMilestoneOutputSchema, ProjectMilestoneSchema, ProjectMilestoneUpdateInputSchema, ProjectMutationOutputSchema, ProjectRecordSchema, ProjectResolveWorkspaceInputSchema, ProjectResolveWorkspaceOutputSchema, ProjectSetPinnedInputSchema, ProjectUpdateCreateInputSchema, ProjectUpdateOutputSchema, ProjectUpdateSchema, ScenePageInputSchema, SceneWriteContracts, TaskListInputSchema, TaskRunCancelInputSchema, TaskRunCancelOutputSchema, TaskRunFeedbackInputSchema, TaskRunFeedbackOutputSchema, init_capabilities };
|
|
@@ -35,6 +35,7 @@ import { init_app_context } from "./app-context.js";
|
|
|
35
35
|
import { init_scenes } from "./scenes.js";
|
|
36
36
|
import { init_capabilities } from "./capabilities.js";
|
|
37
37
|
import { init_extension_capabilities } from "./extension-capabilities.js";
|
|
38
|
+
import { init_usage } from "./usage.js";
|
|
38
39
|
//#region packages/gateway-contract/src/index.ts
|
|
39
40
|
var init_src = __esmMin((() => {
|
|
40
41
|
init_agent_stream();
|
|
@@ -73,6 +74,7 @@ var init_src = __esmMin((() => {
|
|
|
73
74
|
init_extension_capabilities();
|
|
74
75
|
init_local_apps();
|
|
75
76
|
init_chat_previews();
|
|
77
|
+
init_usage();
|
|
76
78
|
}));
|
|
77
79
|
//#endregion
|
|
78
80
|
init_src();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region packages/gateway-contract/src/scenes.ts
|
|
4
|
-
var identifier, uniqueIds, sceneOutcomeKinds, activationStatuses, sceneScopeSchema, limitsSchema, sceneTemplateSchema, scenePermissionSchema, sceneNotesSchema, activationInputSchema, SceneActivationSchema, SceneConfigureSchema, SceneTransitionSchema, SceneWorkItemCreateSchema, SceneWorkItemUpdateSchema, SceneWorkItemSchema, hour, scenePreferencesSchema, preferenceFields, ScenePreferencePatchSchema, SceneFeedbackSchema, sceneScheduleSchema;
|
|
4
|
+
var identifier, uniqueIds, sceneOutcomeKinds, activationStatuses, sceneScopeSchema, limitsSchema, executionSchema, sceneTemplateSchema, scenePermissionSchema, sceneNotesSchema, activationInputSchema, SceneActivationSchema, SceneConfigureSchema, SceneTransitionSchema, SceneWorkItemCreateSchema, SceneWorkItemUpdateSchema, SceneWorkItemSchema, hour, scenePreferencesSchema, preferenceFields, ScenePreferencePatchSchema, SceneFeedbackSchema, sceneScheduleSchema;
|
|
5
5
|
var init_scenes = __esmMin((() => {
|
|
6
6
|
identifier = z.string().trim().min(1).max(200);
|
|
7
7
|
uniqueIds = z.array(identifier).max(100).refine((items) => new Set(items).size === items.length, "Duplicate identifiers");
|
|
@@ -42,6 +42,11 @@ var init_scenes = __esmMin((() => {
|
|
|
42
42
|
maxToolCalls: z.number().int().min(0).max(100),
|
|
43
43
|
maxOutputTokens: z.number().int().min(1).max(32768)
|
|
44
44
|
});
|
|
45
|
+
executionSchema = z.strictObject({
|
|
46
|
+
kind: z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/),
|
|
47
|
+
instruction: z.string().trim().min(1).max(32e3),
|
|
48
|
+
limits: limitsSchema
|
|
49
|
+
});
|
|
45
50
|
sceneTemplateSchema = z.strictObject({
|
|
46
51
|
schemaVersion: z.literal(1),
|
|
47
52
|
key: z.string().regex(/^[a-z][a-z0-9-]{0,79}$/),
|
|
@@ -65,11 +70,7 @@ var init_scenes = __esmMin((() => {
|
|
|
65
70
|
type: z.literal("schedule")
|
|
66
71
|
})
|
|
67
72
|
])).min(1).max(20).refine((items) => new Set(items.map((item) => item.id)).size === items.length, "Duplicate trigger IDs"),
|
|
68
|
-
execution:
|
|
69
|
-
kind: z.literal("agent"),
|
|
70
|
-
instruction: z.string().trim().min(1).max(32e3),
|
|
71
|
-
limits: limitsSchema
|
|
72
|
-
}),
|
|
73
|
+
execution: executionSchema,
|
|
73
74
|
allowedOutcomeKinds: z.array(z.enum(sceneOutcomeKinds)).min(1),
|
|
74
75
|
allowedEffectHandlers: uniqueIds
|
|
75
76
|
});
|
|
@@ -70,7 +70,8 @@ var init_sessions = __esmMin((() => {
|
|
|
70
70
|
offset: z.number(),
|
|
71
71
|
hasMore: z.boolean(),
|
|
72
72
|
before: z.string().optional(),
|
|
73
|
-
nextBeforeCursor: z.string().optional()
|
|
73
|
+
nextBeforeCursor: z.string().optional(),
|
|
74
|
+
revision: z.number().int().nonnegative().optional()
|
|
74
75
|
}).passthrough()
|
|
75
76
|
}).passthrough();
|
|
76
77
|
z.object({ session: z.object({
|
|
@@ -6,32 +6,33 @@ import { consumeClarificationApproval, init_clarification_wait_repository } from
|
|
|
6
6
|
import { getInteractionState } from "../storage/sqlite/interaction-state-repository.js";
|
|
7
7
|
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
8
8
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
9
|
-
import { expandWorkspacePathString, init_workspace_path } from "../config/workspace-path.js";
|
|
10
|
-
import { init_agent_scope, listAgentEntries, resolveAgentProfileDir } from "./agent-scope.js";
|
|
11
|
-
import { init_paths, resolveBundledSkillsDir } from "../config/paths.js";
|
|
12
|
-
import { extractTextContent } from "./context/workspace.js";
|
|
13
9
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
14
10
|
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
11
|
+
import { expandWorkspacePathString, init_workspace_path } from "../config/workspace-path.js";
|
|
12
|
+
import { init_agent_scope, listAgentEntries, resolveAgentProfileDir } from "./agent-scope.js";
|
|
15
13
|
import { getConversationRouting } from "../storage/sqlite/conversation-repository.js";
|
|
16
14
|
import { init_session_key } from "../routing/session-key.js";
|
|
17
15
|
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
16
|
+
import { init_paths, resolveBundledSkillsDir } from "../config/paths.js";
|
|
18
17
|
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../auth/sync-provider-auth.js";
|
|
19
18
|
import { CredentialResolver, init_credentials } from "../auth/credentials.js";
|
|
20
19
|
import { getApiKeySync, getDefaultModelSync, init_providers, resolveModel } from "../providers/index.js";
|
|
21
20
|
import { createExtensionAwareStreamFn } from "../providers/extension-stream-bridge.js";
|
|
21
|
+
import { continuesAfterTool, trackAiUsageStream } from "../usage/recorder.js";
|
|
22
|
+
import { extractTextContent } from "./context/workspace.js";
|
|
22
23
|
import { buildExecutionScopeContextForPrompt } from "./context/execution-scope.js";
|
|
23
24
|
import { clearBootstrapSnapshot } from "./bootstrap/bootstrap-cache.js";
|
|
24
25
|
import { resolveBootstrapContextSync } from "./bootstrap/bootstrap-files.js";
|
|
25
26
|
import { loadProjectAgentsContextFile } from "./bootstrap/project-agents-context.js";
|
|
26
27
|
import { getEmbeddedExecutionRunId } from "./embedded/execution-context.js";
|
|
27
28
|
import { parseExternalToolRef } from "./external-tools/refs.js";
|
|
29
|
+
import { loadSkillsLock } from "./skills/hub-lock.js";
|
|
30
|
+
import { isUnderManagedSkillsDir } from "./skills/managed-store.js";
|
|
28
31
|
import { mcpToolPolicyId } from "./mcp/bundle-mcp-policy.js";
|
|
29
32
|
import { disposeAllSessionMcpRuntimes, retireSessionMcpRuntimeForConversationId } from "./mcp/bundle-mcp-runtime.js";
|
|
30
33
|
import { createSkillConfigManager, isSkillEnabled, resolveSkillConfig } from "./skills/config.js";
|
|
31
34
|
import { isValidSkillEnvVarName } from "./skills/required-env-vars.js";
|
|
32
35
|
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "./skills/workspace-skills-dir.js";
|
|
33
|
-
import { loadSkillsLock } from "./skills/hub-lock.js";
|
|
34
|
-
import { isUnderManagedSkillsDir } from "./skills/managed-store.js";
|
|
35
36
|
import { replaceAgentSystemPrompt } from "./prompt/agent-system-prompt.js";
|
|
36
37
|
import { evictAllEmbeddedSessionRunners, evictEmbeddedSessionRunner } from "./embedded/session-runner.js";
|
|
37
38
|
import { createAgentTurnPolicy } from "./orchestration/agent-turn-policy.js";
|
|
@@ -1027,6 +1028,7 @@ var AgentManager = class {
|
|
|
1027
1028
|
const registeredToolNames = tools.map((t) => t.name);
|
|
1028
1029
|
const thinkingLevel = this.config.thinkingLevel ?? "medium";
|
|
1029
1030
|
const turnPolicy = this.buildAgentTurnPolicy(conversationId, profile);
|
|
1031
|
+
const providerStreamFn = createExtensionAwareStreamFn();
|
|
1030
1032
|
agent = new Agent({
|
|
1031
1033
|
initialState: {
|
|
1032
1034
|
systemPrompt: rt.systemPromptBuilder.build(contextFiles, {
|
|
@@ -1048,7 +1050,11 @@ var AgentManager = class {
|
|
|
1048
1050
|
messages: []
|
|
1049
1051
|
},
|
|
1050
1052
|
toolExecution: "parallel",
|
|
1051
|
-
streamFn:
|
|
1053
|
+
streamFn: (streamModel, context, options) => trackAiUsageStream(streamModel, {
|
|
1054
|
+
operation: continuesAfterTool(context.messages) ? "agent.continue_after_tool" : "agent.answer",
|
|
1055
|
+
conversationId,
|
|
1056
|
+
agentId: profile.agentId
|
|
1057
|
+
}, () => providerStreamFn(streamModel, context, options)),
|
|
1052
1058
|
getApiKey: (provider) => this.resolveApiKeyWithCache(provider),
|
|
1053
1059
|
finishTurn: (context) => turnPolicy.shouldStopAfterTurn(context) ? { action: "end" } : void 0,
|
|
1054
1060
|
beforeToolCall: turnPolicy.beforeToolCall,
|
|
@@ -4,11 +4,12 @@ import { finishContextExtractionRun } from "../../storage/sqlite/context-extract
|
|
|
4
4
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
5
5
|
import { loadCompactionSourceSnapshot } from "../../storage/sqlite/transcript-repository.js";
|
|
6
6
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
7
|
-
import { extractTextContent } from "../context/workspace.js";
|
|
8
7
|
import { extractProfileAgentId } from "../../config/agent-profile.js";
|
|
9
8
|
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../../auth/sync-provider-auth.js";
|
|
10
9
|
import { getApiKeySync, init_providers, resolveModel } from "../../providers/index.js";
|
|
11
10
|
import { createExtensionAwareStreamFn } from "../../providers/extension-stream-bridge.js";
|
|
11
|
+
import { trackAiUsageStream } from "../../usage/recorder.js";
|
|
12
|
+
import { extractTextContent } from "../context/workspace.js";
|
|
12
13
|
import { getAssertionSlot, listUserAssertions } from "../../user-model/repository.js";
|
|
13
14
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
14
15
|
import { isAssistantTurnAborted, isAssistantTurnFailed } from "../orchestration/llm-turn-retry.js";
|
|
@@ -125,6 +126,7 @@ function resolveInterpreterRuntime(params) {
|
|
|
125
126
|
};
|
|
126
127
|
}
|
|
127
128
|
async function interpret(params) {
|
|
129
|
+
const providerStreamFn = createExtensionAwareStreamFn();
|
|
128
130
|
const reviewAgent = new Agent({
|
|
129
131
|
initialState: {
|
|
130
132
|
systemPrompt: USER_MODEL_MAINTAINER_SYSTEM_PROMPT,
|
|
@@ -133,7 +135,10 @@ async function interpret(params) {
|
|
|
133
135
|
tools: [],
|
|
134
136
|
messages: []
|
|
135
137
|
},
|
|
136
|
-
streamFn:
|
|
138
|
+
streamFn: (model, context, options) => trackAiUsageStream(model, {
|
|
139
|
+
operation: "user_model.interpret",
|
|
140
|
+
conversationId: params.conversationId
|
|
141
|
+
}, () => providerStreamFn(model, context, options)),
|
|
137
142
|
getApiKey: (provider) => resolveProviderApiKeySync(provider) ?? getApiKeySync(provider) ?? ""
|
|
138
143
|
});
|
|
139
144
|
reviewAgent.state.messages = params.evidence.map(tagMessage);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DEFAULT_AGENTS_FILENAME, DEFAULT_IDENTITY_FILENAME, DEFAULT_SOUL_FILENAME, DEFAULT_TOOLS_FILENAME } from "../context/workspace.js";
|
|
2
1
|
import { isCronConversationId, isSubagentConversationId } from "../../routing/agent-session-key.js";
|
|
3
2
|
import { init_session_key } from "../../routing/session-key.js";
|
|
3
|
+
import { DEFAULT_AGENTS_FILENAME, DEFAULT_IDENTITY_FILENAME, DEFAULT_SOUL_FILENAME, DEFAULT_TOOLS_FILENAME } from "../context/workspace.js";
|
|
4
4
|
//#region src/agent/bootstrap/filter-bootstrap-files.ts
|
|
5
5
|
init_session_key();
|
|
6
6
|
const MINIMAL_BOOTSTRAP_ALLOWLIST = new Set([
|
|
@@ -2,6 +2,7 @@ import { createLogger } from "../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { getClarification, getClarificationResumeInput, init_clarification_wait_repository, isClarificationSuspended } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
4
4
|
import { getConnectionResumeInput, init_connection_wait_repository, isConnectionSuspended } from "../../storage/sqlite/connection-wait-repository.js";
|
|
5
|
+
import { continuesAfterTool, trackAiUsageStream } from "../../usage/recorder.js";
|
|
5
6
|
import { runWithEmbeddedExecutionSession } from "./execution-context.js";
|
|
6
7
|
import { isComputerControlActive, isComputerLeaseTool, stopComputerControl } from "../../computer/control-guard.js";
|
|
7
8
|
import { EmbeddedRunConflictError, abortEmbeddedRun, acquireEmbeddedRunLease, queueEmbeddedSteer } from "./runs.js";
|
|
@@ -450,7 +451,12 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
450
451
|
tools: effectiveTools
|
|
451
452
|
} } : {}
|
|
452
453
|
}, "Sending messages to AI");
|
|
453
|
-
return
|
|
454
|
+
return trackAiUsageStream(streamModel, {
|
|
455
|
+
operation: continuesAfterTool(effectiveContext.messages) ? "agent.continue_after_tool" : "agent.answer",
|
|
456
|
+
conversationId,
|
|
457
|
+
runId,
|
|
458
|
+
traceId: runId
|
|
459
|
+
}, () => streamFnWithXopcExtensions(streamModel, effectiveContext, { ...options }));
|
|
454
460
|
};
|
|
455
461
|
session.agent.streamFunction = loggingStreamFn;
|
|
456
462
|
const verification = await RunVerification.open(workspaceDir);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { executeExternalOperation } from "../../capabilities/runtime/external-operations.js";
|
|
2
|
-
import { canonicalCapabilityJson } from "../../capabilities/runtime/dispatcher.js";
|
|
3
1
|
import { COMPUTER_CONTROL_TOOL, init_src } from "../../../packages/computer-control-contract/src/index.js";
|
|
4
2
|
import { BROWSER_CONTROL_ENDPOINT_TOOL_NAME } from "../../../packages/browser-control-contract/src/index.js";
|
|
3
|
+
import { executeExternalOperation } from "../../capabilities/runtime/external-operations.js";
|
|
4
|
+
import { canonicalCapabilityJson } from "../../capabilities/runtime/dispatcher.js";
|
|
5
5
|
import { externalToolRef, parseExternalToolRef } from "./refs.js";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
//#region src/agent/external-tools/endpoint-provider.ts
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
+
import type { Config } from '../../config/schema.js';
|
|
2
3
|
import type { ExternalToolTurnContext } from './types.js';
|
|
3
4
|
import { type ExternalToolProvider } from './types.js';
|
|
4
5
|
export declare const EXTERNAL_TOOL_NAMES: {
|
|
@@ -8,4 +9,4 @@ export declare const EXTERNAL_TOOL_NAMES: {
|
|
|
8
9
|
readonly requireConnection: "xopc_require_connection";
|
|
9
10
|
readonly updateConnectionObjective: "xopc_update_connection_objective";
|
|
10
11
|
};
|
|
11
|
-
export declare function createExternalToolGatewayTools(providers: ExternalToolProvider[], getContext?: () => ExternalToolTurnContext | null): AgentTool[];
|
|
12
|
+
export declare function createExternalToolGatewayTools(providers: ExternalToolProvider[], getContext?: () => ExternalToolTurnContext | null, getConfig?: () => Config | undefined): AgentTool[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { init_connector_repository, listConnectorConnections } from "../../storage/sqlite/connector-repository.js";
|
|
2
2
|
import { connectionBindings, getActiveConnectionWait, init_connection_wait_repository, publishConnectionWait, requireSessionConnection, reviseCurrentConnectionObjective } from "../../storage/sqlite/connection-wait-repository.js";
|
|
3
3
|
import { connectorPrincipalForSession } from "../../connectors/principal.js";
|
|
4
|
+
import { getStoreConnectorInstallPlan, parseStoreConnectorCandidateRef, searchStoreConnectorInstallCandidates } from "../../capabilities/store-connector.js";
|
|
4
5
|
import { connectionCandidates, resolveConnectionCandidate } from "../../connectors/connection-candidates.js";
|
|
5
6
|
import { parsePluginMcpCandidateRef, resolvePluginMcpConnectionCandidate } from "../../extensions/agent-plugins/connection.js";
|
|
6
7
|
import { ExternalToolService } from "./service.js";
|
|
@@ -48,21 +49,31 @@ function textResult(value, details = {}) {
|
|
|
48
49
|
details
|
|
49
50
|
};
|
|
50
51
|
}
|
|
51
|
-
function createExternalToolGatewayTools(providers, getContext) {
|
|
52
|
+
function createExternalToolGatewayTools(providers, getContext, getConfig) {
|
|
52
53
|
const service = new ExternalToolService(providers);
|
|
53
54
|
const searchTool = {
|
|
54
55
|
name: EXTERNAL_TOOL_NAMES.search,
|
|
55
56
|
label: "🔎 External Tool Search",
|
|
56
|
-
description: `Search external tools from these sources: ${EXTERNAL_TOOL_SOURCES.join(", ")}. CLI connectors include Feishu/Lark, WeCom and WPS 365. Omit sources unless intentionally restricting the search; do not guess a source list. Use concise English capability keywords, e.g. "wecom doc.search". Returns
|
|
57
|
+
description: `Search external tools from these sources: ${EXTERNAL_TOOL_SOURCES.join(", ")}. CLI connectors include Feishu/Lark, WeCom and WPS 365. Omit sources unless intentionally restricting the search; do not guess a source list. Use concise English capability keywords, e.g. "wecom doc.search". Returns executable tools, connection candidates, or reviewed Store install candidates. Call xopc_tool_describe before executing a tool. If a source-filtered search finds no relevant tools, retry without sources before concluding a capability is unavailable.`,
|
|
57
58
|
parameters: ToolSearchSchema,
|
|
58
59
|
async execute(_toolCallId, params) {
|
|
59
60
|
const selectedSources = new Set(params.sources ?? []);
|
|
60
61
|
const excludedSources = selectedSources.size ? EXTERNAL_TOOL_SOURCES.filter((source) => !selectedSources.has(source)) : [];
|
|
61
62
|
const result = await service.search(params);
|
|
62
63
|
const candidates = [...result.connectionCandidates, ...connectionCandidates(params.query)].filter((candidate, index, all) => all.findIndex((item) => item.candidateRef === candidate.candidateRef) === index);
|
|
64
|
+
let installCandidates = [];
|
|
65
|
+
let installCatalogError;
|
|
66
|
+
const config = getConfig?.();
|
|
67
|
+
if (!params.sources?.length && result.tools.length === 0 && candidates.length === 0 && config) try {
|
|
68
|
+
installCandidates = await searchStoreConnectorInstallCandidates(config, params.query, params.limit ?? 5);
|
|
69
|
+
} catch (error) {
|
|
70
|
+
installCatalogError = error instanceof Error ? error.message : String(error);
|
|
71
|
+
}
|
|
63
72
|
return textResult({
|
|
64
73
|
...result,
|
|
65
74
|
connectionCandidates: candidates,
|
|
75
|
+
installCandidates,
|
|
76
|
+
...installCatalogError ? { installCatalogError } : {},
|
|
66
77
|
...excludedSources.length ? { searchScope: {
|
|
67
78
|
excludedSources,
|
|
68
79
|
instruction: "This search excluded these sources. Results from other apps do not establish that the requested app is unavailable. Retry without sources before declaring a capability unavailable or requesting authorization. Feishu/Lark, WeCom and WPS 365 connectors use cli."
|
|
@@ -140,7 +151,7 @@ function createExternalToolGatewayTools(providers, getContext) {
|
|
|
140
151
|
name: EXTERNAL_TOOL_NAMES.requireConnection,
|
|
141
152
|
label: "Connect app",
|
|
142
153
|
parameters: requireSchema,
|
|
143
|
-
description: "Request
|
|
154
|
+
description: "Request a connectionCandidates or installCandidates entry returned by xopc_tool_search. Explain the need once before calling. This pauses the current objective and displays one action area above the input. Never invent a candidate reference, return OAuth URLs, or repeat a skipped request. If another objective is waiting, ask the user to continue or cancel it first.",
|
|
144
155
|
async execute(_id, params) {
|
|
145
156
|
const context = getContext?.();
|
|
146
157
|
if (!context) throw new Error("No active conversation.");
|
|
@@ -152,10 +163,15 @@ function createExternalToolGatewayTools(providers, getContext) {
|
|
|
152
163
|
const selected = connectionBindings(context.conversationId);
|
|
153
164
|
if (params.requirements.every((item) => {
|
|
154
165
|
const pluginTarget = parsePluginMcpCandidateRef(item.candidateRef);
|
|
155
|
-
return selected.some((need) =>
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
166
|
+
return selected.some((need) => {
|
|
167
|
+
if (need.target.type === "connector") return need.target.connectorId === item.candidateRef && Boolean(need.connectionId) && (!item.accountId || item.accountId === need.accountId) && (!item.accountSelector || item.accountSelector === need.accountSelector) && listConnectorConnections({
|
|
168
|
+
principalId: principal.principalId,
|
|
169
|
+
connectorId: need.target.connectorId
|
|
170
|
+
}).some((connection) => connection.id === need.connectionId && connection.status === "active");
|
|
171
|
+
if (need.target.type === "plugin-mcp") return Boolean(pluginTarget && need.target.pluginId === pluginTarget.pluginId && need.target.serverName === pluginTarget.serverName && need.connectionId === need.target.serverId);
|
|
172
|
+
const storeTarget = parseStoreConnectorCandidateRef(item.candidateRef);
|
|
173
|
+
return Boolean(storeTarget && need.target.packageName === storeTarget.packageName && need.target.version === storeTarget.version && need.connectionId);
|
|
174
|
+
});
|
|
159
175
|
})) return textResult({
|
|
160
176
|
status: "already_connected",
|
|
161
177
|
selectedConnections: selected,
|
|
@@ -167,9 +183,26 @@ function createExternalToolGatewayTools(providers, getContext) {
|
|
|
167
183
|
agentId: principal.agentId ?? "main",
|
|
168
184
|
summary: params.purpose,
|
|
169
185
|
checkpoint: params.checkpoint,
|
|
170
|
-
needs: params.requirements.map((item) => {
|
|
171
|
-
const
|
|
172
|
-
|
|
186
|
+
needs: await Promise.all(params.requirements.map(async (item) => {
|
|
187
|
+
const storeRef = parseStoreConnectorCandidateRef(item.candidateRef);
|
|
188
|
+
const config = getConfig?.();
|
|
189
|
+
const plan = storeRef && config ? await getStoreConnectorInstallPlan(config, storeRef.packageName, storeRef.version) : void 0;
|
|
190
|
+
if (plan && !plan.definition.provenance) throw new Error("Store Connector provenance is unavailable.");
|
|
191
|
+
const need = plan ? {
|
|
192
|
+
key: item.candidateRef,
|
|
193
|
+
target: {
|
|
194
|
+
type: "store-connector",
|
|
195
|
+
packageName: plan.packageName,
|
|
196
|
+
connectorId: plan.definition.id,
|
|
197
|
+
version: plan.version,
|
|
198
|
+
sha256: plan.definition.provenance.sha256,
|
|
199
|
+
reviewHash: plan.reviewHash,
|
|
200
|
+
description: plan.definition.description
|
|
201
|
+
},
|
|
202
|
+
label: plan.definition.displayName,
|
|
203
|
+
capabilities: plan.definition.capabilities
|
|
204
|
+
} : resolvePluginMcpConnectionCandidate(item.candidateRef) ?? resolveConnectionCandidate(item.candidateRef);
|
|
205
|
+
if (item.accountId && need.target.type !== "connector") throw new Error("This install candidate does not support account selection.");
|
|
173
206
|
if (item.accountId && need.target.type === "connector" && !listConnectorConnections({
|
|
174
207
|
principalId: principal.principalId,
|
|
175
208
|
connectorId: need.target.connectorId
|
|
@@ -180,7 +213,7 @@ function createExternalToolGatewayTools(providers, getContext) {
|
|
|
180
213
|
accountSelector: item.accountSelector,
|
|
181
214
|
key: need.target.type === "connector" ? `${need.target.connectorId}:${item.accountId ?? item.accountSelector ?? "default"}` : need.key
|
|
182
215
|
};
|
|
183
|
-
})
|
|
216
|
+
}))
|
|
184
217
|
});
|
|
185
218
|
publishConnectionWait(context.conversationId);
|
|
186
219
|
return textResult(result);
|
|
@@ -53,7 +53,7 @@ function createDefaultExternalToolGatewayTools(deps) {
|
|
|
53
53
|
if (!deps.getConfig()) return void 0;
|
|
54
54
|
const conversationId = deps.getCurrentContext()?.conversationId;
|
|
55
55
|
return (conversationId ? resolveEffectiveAgentConfigForSession(conversationId) : deps.agentId ? resolveEffectiveAgentConfigForAgent(deps.agentId) : resolveEffectiveAgentConfigForSession(void 0)).config.tools[toolRef];
|
|
56
|
-
})), deps.getCurrentContext);
|
|
56
|
+
})), deps.getCurrentContext, deps.getConfig);
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
59
59
|
export { EXTERNAL_TOOL_NAMES, ExternalToolService, createDefaultExternalToolGatewayTools };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
2
1
|
import { getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "../../config/schema.js";
|
|
2
|
+
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
3
3
|
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
4
4
|
import { getDefaultModelSync, getModelsByProvider, init_providers, isProviderConfiguredSync, resolveModel } from "../../providers/index.js";
|
|
5
5
|
import { resolveAgentModelFallbackValues, resolveAgentModelPrimaryValue } from "../../config/model-input.js";
|
|
@@ -50,7 +50,7 @@ function buildPiAiImageUnderstandingProvider(providerId) {
|
|
|
50
50
|
setTimeout(() => controller.abort(), timeoutMs);
|
|
51
51
|
return controller.signal;
|
|
52
52
|
})()
|
|
53
|
-
}),
|
|
53
|
+
}, void 0, { operation: "media.understand_image" }),
|
|
54
54
|
provider: providerId,
|
|
55
55
|
model: modelId
|
|
56
56
|
}),
|
|
@@ -518,6 +518,10 @@ Return a JSON delta containing only missing facts, using {"upserts":[]}. Include
|
|
|
518
518
|
onPayload: compactionPayloadGuard(requestedMaxTokens, (actual) => {
|
|
519
519
|
actualMaxTokens = actual;
|
|
520
520
|
})
|
|
521
|
+
}, void 0, {
|
|
522
|
+
operation: "session.compact",
|
|
523
|
+
conversationId: callContext.conversationId,
|
|
524
|
+
trigger: attempt === 0 && modelIndex === 0 ? "system" : "retry"
|
|
521
525
|
});
|
|
522
526
|
parentSignal?.throwIfAborted();
|
|
523
527
|
if (linked.timedOut()) throw new CompactionRequestError("timeout", "Compaction handover timed out");
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { parseMaintenanceInstruction } from "../../memory-maintenance/schedule.js";
|
|
4
|
-
import { runMemoryMaintenance } from "../../memory-maintenance/service.js";
|
|
5
|
-
import "../../memory-maintenance/index.js";
|
|
6
3
|
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
7
4
|
import { persistInboundAttachments } from "../../channels/attachments/inbound-persist.js";
|
|
8
5
|
import { buildTranscriptUserMessage, clearPendingTranscriptUserMessage, hydrateUserTurnForLlm, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
@@ -49,24 +46,6 @@ var AgentOrchestrator = class {
|
|
|
49
46
|
const { conversationId } = context;
|
|
50
47
|
log.debug({ conversationId }, "Processing message through agent orchestrator");
|
|
51
48
|
await this.sessionHydrator.workspace(conversationId);
|
|
52
|
-
if (typeof msg.content === "string" && (context.channel === "cron" || context.channel === "automation")) {
|
|
53
|
-
const maintenanceJob = parseMaintenanceInstruction(msg.content);
|
|
54
|
-
if (maintenanceJob) {
|
|
55
|
-
const cfg = this.getConfig?.();
|
|
56
|
-
if (!cfg) {
|
|
57
|
-
log.warn({ conversationId }, "Memory maintenance skipped: config unavailable");
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const maintenance = cfg.userContext.userModel.maintenance;
|
|
61
|
-
runMemoryMaintenance({
|
|
62
|
-
jobType: maintenanceJob,
|
|
63
|
-
limit: maintenance.limit,
|
|
64
|
-
staleRetentionDays: maintenance.staleRetentionDays,
|
|
65
|
-
evidenceThreshold: maintenance.evidenceThreshold
|
|
66
|
-
});
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
49
|
try {
|
|
71
50
|
await this.sessionHydrator.model(conversationId);
|
|
72
51
|
const channelSystemPrompt = typeof context.metadata?.channelSystemPrompt === "string" ? context.metadata.channelSystemPrompt.trim() : "";
|
|
@@ -108,7 +108,10 @@ async function runBtwQuery(opts) {
|
|
|
108
108
|
};
|
|
109
109
|
let streamedText = "";
|
|
110
110
|
const response = opts.onTextDelta ? await (async () => {
|
|
111
|
-
const stream = await createResolvedModelStream(model, { messages: [userMessage] }, modelCallOptions, opts.credentialOptions
|
|
111
|
+
const stream = await createResolvedModelStream(model, { messages: [userMessage] }, modelCallOptions, opts.credentialOptions, {
|
|
112
|
+
operation: "agent.answer",
|
|
113
|
+
conversationId: opts.conversationId
|
|
114
|
+
});
|
|
112
115
|
for await (const event of stream) {
|
|
113
116
|
const streamEvent = event;
|
|
114
117
|
if (streamEvent.type === "text_delta" && typeof streamEvent.delta === "string") {
|
|
@@ -123,7 +126,10 @@ async function runBtwQuery(opts) {
|
|
|
123
126
|
}
|
|
124
127
|
}
|
|
125
128
|
return await stream.result();
|
|
126
|
-
})() : await completeWithResolvedCredentials(model, { messages: [userMessage] }, modelCallOptions, opts.credentialOptions
|
|
129
|
+
})() : await completeWithResolvedCredentials(model, { messages: [userMessage] }, modelCallOptions, opts.credentialOptions, {
|
|
130
|
+
operation: "agent.answer",
|
|
131
|
+
conversationId: opts.conversationId
|
|
132
|
+
});
|
|
127
133
|
const text = (streamedText || textFromCompleteContent(response.content)).trim();
|
|
128
134
|
if (text) return { text };
|
|
129
135
|
const stopReason = typeof response.stopReason === "string" ? response.stopReason : void 0;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { init_attachment_ref, parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
|
|
4
|
-
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
5
|
-
import { extractTextContent } from "./context/workspace.js";
|
|
6
4
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
7
5
|
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
6
|
+
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
8
7
|
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
9
8
|
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
10
9
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
10
|
+
import { extractTextContent } from "./context/workspace.js";
|
|
11
11
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
12
12
|
import { getProjectForSession } from "../projects/workspace.js";
|
|
13
13
|
import { runWithEmbeddedExecutionSession } from "./embedded/execution-context.js";
|
|
14
|
-
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "./skills/workspace-skills-dir.js";
|
|
15
14
|
import { removeSkillsLockEntry } from "./skills/hub-lock.js";
|
|
16
15
|
import { installSkillFromZip } from "./skills/managed-store.js";
|
|
16
|
+
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "./skills/workspace-skills-dir.js";
|
|
17
17
|
import { pullSkillFromSource } from "./skills/hub-pull.js";
|
|
18
18
|
import { getUserTimezone } from "../user-model/repository.js";
|
|
19
19
|
import "../user-model/index.js";
|
|
@@ -2,10 +2,10 @@ import { resolveStateDir } from "../../config/paths-state.js";
|
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
4
|
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
5
|
+
import { isManagedSkillTransientDirName } from "./managed-store.js";
|
|
5
6
|
import { createSkillConfigManager } from "./config.js";
|
|
6
7
|
import { resolveWorkspaceSkillsDir } from "./workspace-skills-dir.js";
|
|
7
8
|
import { resolveAgentsSkillsDir, resolveWorkspaceAgentsSkillsDir } from "./skill-sources.js";
|
|
8
|
-
import { isManagedSkillTransientDirName } from "./managed-store.js";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import chokidar from "chokidar";
|
|
11
11
|
//#region src/agent/skills/filesystem-watcher.ts
|