@xopcai/xopc 0.0.323 → 0.0.325
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/extensions/weixin/src/plugin.js +1 -9
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DFzmThVi.js → agent-avatar-dicebear-CxfXpPWs.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CDHe8gJf.js +1 -0
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-DYFYiuig.js → agent-plugin-dialog-DMv-udoZ.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-BqIlB5Co.js → agents-D_xOAXgj.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BgvMRGWe.js → app-management-settings-panel-p7fZB4dT.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CliHU03A.js → appearance-settings-C-clVcfp.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-Dz2g7eAN.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DnuPpm0u.js → archive-plugin-Xm6xChUX.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BiwaK0ie.js → attachment-load-Di8kuG4L.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CJSISGQH.js → automations-page-GUZgDhKj.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BUZhG9aJ.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-KDjduQZO.js → binary-plugins-OCrDjC9O.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-bclvgove.js → block-editor-m9tqvu7x.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-CfQ2T9t6.js → browser-automation-inputs-DSWXq9lI.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-Cxq38Nnp.js → browser-automations-page-DuOaridE.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-D2_PgHep.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-sAZT4brT.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-7Y_pJqyt.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-B-Igy1ro.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DKQC62nQ.js → chat-terminal-dock-BfnVh8oo.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-D1whpIqL.js → computer-settings-page-aRG2lU4w.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BAuYTgf5.js → connector-service-page-B5EhnfJH.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-7HfRt1LW.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-CtDyij_x.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-DOuVO2M1.js → dependency-picker-z6ouWxmz.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-D9tu6Bhu.js → desktop-pet-BsIYCAkG.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CQPXub2f.js → desktop-pet-settings-z-0aQ5ct.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-DxkOYSut.js → device-pairing-wizard-DlmhQvY5.js} +1 -1
- package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-CtWClPz-.js → extension-debug-page-Ct9pABNW.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BHh9HLCz.js → extension-page-BktsR4hj.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BdT3v5Uh.js → extension-settings-page-BQJc-vXH.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-1eqyz9vZ.js → gateway-config-swr-CoQVulMd.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CZas_Ekx.js → gateway-settings-BfDVlvy6.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-C4rsW6vJ.js → gateway-startup-retry-B5GJ-CQV.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-CI_eQTPL.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-B5DXMylk.js → image-generation-api-DvWDkbk1.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-B1JH0G5j.js → imports-page-DFpQfHVU.js} +1 -1
- package/dist/gateway/static/root/assets/index-19rMUT3d.js +121 -0
- package/dist/gateway/static/root/assets/{index-CNc4N4TX.css → index-BKL5tg2f.css} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DGrLJ8Yh.js → keyboard-shortcuts-settings-ctJLm8TP.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-C9kaP3Dy.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DqjStqbL.js → local-apps-page-BxC_LTqq.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-BIkcRr3t.js → locale-store-BPZR8x9b.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-Ok5SpG-G.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-gCfH4cwH.js → management-settings-aOzRaQHM.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-Ck_5MADq.js → markdown-view-Dft8ASFD.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DTsZqgo6.js → media-plugins-ni5zJ4Ok.js} +1 -1
- package/dist/gateway/static/root/assets/messages-kFWhF6_t.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-C9OEltN9.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-Dj9rMgdi.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-DTI_g4tz.js → page-context-capture-button-BJA3d8vU.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-CfW_Q-K5.js → page-tabs-Dyc3wKkl.js} +1 -1
- package/dist/gateway/static/root/assets/popover-select-DcsFzD_i.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-CuPN-vAn.js → preview-open-alternatives-tIOIQbNX.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BHjxRz1E.js → product-open-page-DQctU8z3.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-Dy-EwZcc.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-Bk-es4i9.js → projects-page-JaGKa6rM.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-BAAZUGnU.js → registry-api-DWWO6ajd.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Cb8-nd60.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CHJBJKL1.js → runtime-tools-settings-panel-xhOSYfiX.js} +1 -1
- package/dist/gateway/static/root/assets/scenes-page-ClBkFdRY.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-FQAit5HL.js → schema-form-z8IeSdBp.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BYW5l_nY.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CDNwmXuH.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BDc6bw1q.js → settings-form-section-BXTJAser.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DnhxBJjV.js → settings-page-Br9no5e4.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-D3KNSQ5g.js → settings-page-layout-D6745w0p.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-D2N9764S.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DVQCRxwK.js → share-preview-page-CE0SER59.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Dk3_QOKQ.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-CPt61fEv.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-Db6PB2C6.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-mDwC9UJ-.js → skills-page.utils-DrtW5FBy.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Bk7GrMij.js → system-settings-panel-CuY1Zh5s.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-o7RiDUMi.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-D3Aquraj.js → tunnel-api-PGHDgvWb.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-C1xQ-sHn.js → use-autosave-B55oBQUt.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-DspelwAa.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DCNECvcp.js → voice-api-key-field-By6Lgbse.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-B-_niUTU.js → voice-config-api-BaxITrwZ.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BrGx_JS_.js → work-discovery-overlay-DdhgIlyf.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CmmC2Pdr.js → workflow-run-setup-panel-BOJYQaxX.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-6ObD0IQZ.js +6 -0
- package/dist/gateway/static/root/index.html +11 -10
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/home.js +284 -55
- package/dist/packages/gateway-contract/src/index.js +0 -2
- package/dist/packages/gateway-contract/src/notifications.js +3 -10
- package/dist/src/activity/emitter.js +2 -1
- package/dist/src/activity/service.js +2 -1
- package/dist/src/agent/agent-manager.d.ts +3 -2
- package/dist/src/agent/agent-manager.js +36 -44
- package/dist/src/agent/agent-scope.d.ts +19 -48
- package/dist/src/agent/agent-scope.js +47 -169
- package/dist/src/agent/background-review/run-background-review.js +5 -4
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/commands/command-registry.js +7 -3
- package/dist/src/agent/context/coordinator.js +1 -1
- package/dist/src/agent/context/execution-context.js +2 -1
- package/dist/src/agent/context/execution-scope.js +2 -1
- package/dist/src/agent/context/workspace-seed.d.ts +1 -2
- package/dist/src/agent/context/workspace-seed.js +3 -3
- package/dist/src/agent/context/workspace-state.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +2 -2
- package/dist/src/agent/embedded/run-turn.js +2 -1
- package/dist/src/agent/embedded/sqlite-hydrating-session-manager.js +2 -1
- package/dist/src/agent/external-tools/cliProvider.js +2 -1
- package/dist/src/agent/external-tools/composio-provider.js +2 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/external-tools/index.js +2 -3
- package/dist/src/agent/external-tools/mcp-provider.js +2 -2
- package/dist/src/agent/image/tool-model-config.js +4 -5
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/ipc/bus.js +1 -1
- package/dist/src/agent/ipc/socket.js +3 -3
- package/dist/src/agent/media-generation/runtime-shared.d.ts +1 -1
- package/dist/src/agent/media-generation/runtime-shared.js +1 -1
- package/dist/src/agent/memory/plugin-discovery.js +1 -2
- package/dist/src/agent/models/manager.d.ts +1 -1
- package/dist/src/agent/models/manager.js +2 -2
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +1 -1
- package/dist/src/agent/prompt/response-language.js +2 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +6 -3
- package/dist/src/agent/prompt/system-prompt.js +2 -1
- package/dist/src/agent/reply/post-compaction-context.js +2 -2
- package/dist/src/agent/service/build-direct-message-content.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +2 -1
- package/dist/src/agent/service/parse-outbound-session-key.js +2 -1
- package/dist/src/agent/service/process-direct-streaming.js +3 -2
- package/dist/src/agent/service/webchat-tts.js +2 -1
- package/dist/src/agent/service.d.ts +1 -1
- package/dist/src/agent/service.js +12 -11
- package/dist/src/agent/service.types.d.ts +2 -0
- package/dist/src/agent/session/session-inspector.js +4 -5
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.d.ts +5 -0
- package/dist/src/agent/starter-agents.d.ts +4 -5
- package/dist/src/agent/starter-agents.js +21 -20
- package/dist/src/agent/tasks/task-judge-service.js +2 -2
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +31 -1
- package/dist/src/agent/tools/delegation-parent-policy.js +2 -3
- package/dist/src/agent/tools/factory.d.ts +2 -0
- package/dist/src/agent/tools/factory.js +10 -9
- package/dist/src/agent/tools/image-generate-tool.js +1 -1
- package/dist/src/agent/tools/workflow-tool.js +2 -3
- package/dist/src/agent/tools/xopc-use-tool.d.ts +3 -2
- package/dist/src/agent/tools/xopc-use-tool.js +54 -6
- package/dist/src/agent/workflow/workflow-child-tools.js +1 -2
- package/dist/src/agent/workspace-runtime/registry.d.ts +1 -1
- package/dist/src/agent/workspace-runtime/registry.js +2 -2
- package/dist/src/agent-catalog/capabilities.d.ts +3 -0
- package/dist/src/agent-catalog/capabilities.js +238 -0
- package/dist/src/agent-catalog/id.d.ts +15 -0
- package/dist/src/agent-catalog/id.js +101 -0
- package/dist/src/agent-catalog/index.d.ts +6 -0
- package/dist/src/agent-catalog/index.js +10 -0
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.d.ts +11 -0
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +195 -0
- package/dist/src/agent-catalog/repository.d.ts +39 -0
- package/dist/src/agent-catalog/repository.js +319 -0
- package/dist/src/agent-catalog/service.d.ts +33 -0
- package/dist/src/agent-catalog/service.js +202 -0
- package/dist/src/agent-catalog/test-support.d.ts +14 -0
- package/dist/src/agent-catalog/test-support.js +34 -0
- package/dist/src/agent-catalog/types.d.ts +26 -0
- package/dist/src/agent-catalog/types.js +1 -0
- package/dist/src/agent-config/index.js +2 -2
- package/dist/src/agent-config/schema.d.ts +1 -172
- package/dist/src/agent-config/schema.js +2 -41
- package/dist/src/auth/credentials.js +3 -3
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/sync-provider-auth.d.ts +1 -1
- package/dist/src/auth/sync-provider-auth.js +5 -9
- package/dist/src/automations/capabilities/drafts.js +8 -7
- package/dist/src/automations/service/action-executor.js +2 -1
- package/dist/src/bootstrap/application-state.d.ts +10 -0
- package/dist/src/bootstrap/application-state.js +26 -0
- package/dist/src/browser/automations/repository.js +2 -1
- package/dist/src/browser/automations/schema.d.ts +1 -1
- package/dist/src/browser/automations/service.d.ts +1 -1
- package/dist/src/browser/native-messaging-host.js +5 -4
- package/dist/src/browser/providers/extension.js +4 -2
- package/dist/src/browser/providers/realtime-extension.js +2 -1
- package/dist/src/capabilities/readiness/from-config.js +7 -4
- package/dist/src/capabilities/runtime/dispatcher.d.ts +1 -0
- package/dist/src/capabilities/runtime/dispatcher.js +10 -4
- package/dist/src/capabilities/runtime/product.js +2 -0
- package/dist/src/channels/catalog/channel-catalog-service.js +7 -13
- package/dist/src/chat-commands/agent-edit.js +4 -3
- package/dist/src/chat-commands/builtins/config.js +6 -8
- package/dist/src/chat-commands/builtins/review.js +1 -1
- package/dist/src/chat-commands/builtins/workflow.js +1 -1
- package/dist/src/chat-commands/config-paths.js +1 -1
- package/dist/src/chat-commands/context.js +2 -3
- package/dist/src/chat-previews/store.js +2 -1
- package/dist/src/cli/command-manifest.js +1 -1
- package/dist/src/cli/commands/agent.js +4 -4
- package/dist/src/cli/commands/agents.d.ts +1 -1
- package/dist/src/cli/commands/agents.js +36 -48
- package/dist/src/cli/commands/auth.js +2 -1
- package/dist/src/cli/commands/browser-cli-helpers.js +1 -2
- package/dist/src/cli/commands/channels.js +2 -4
- package/dist/src/cli/commands/config.js +4 -5
- package/dist/src/cli/commands/connectors.js +1 -2
- package/dist/src/cli/commands/doctor/checks/channel-config.js +2 -4
- package/dist/src/cli/commands/doctor/checks/channel-pairing-pending.js +1 -2
- package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -2
- package/dist/src/cli/commands/doctor/checks/config-health.js +1 -2
- package/dist/src/cli/commands/doctor/checks/database-schema.js +4 -4
- package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -2
- package/dist/src/cli/commands/doctor/checks/gateway-service.js +1 -2
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +13 -11
- package/dist/src/cli/commands/doctor/checks/security-audit.js +1 -2
- package/dist/src/cli/commands/doctor/checks/session-integrity.js +3 -3
- package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +1 -2
- package/dist/src/cli/commands/doctor/checks/workspace-status.js +5 -7
- package/dist/src/cli/commands/extension-agent-plugin.js +1 -2
- package/dist/src/cli/commands/extension-dev.js +2 -4
- package/dist/src/cli/commands/extension-marketplace.js +1 -2
- package/dist/src/cli/commands/extension-pack.js +1 -2
- package/dist/src/cli/commands/extension.js +1 -2
- package/dist/src/cli/commands/gateway/run-foreground.js +3 -3
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/history.js +2 -1
- package/dist/src/cli/commands/image.js +2 -2
- package/dist/src/cli/commands/init.js +11 -30
- package/dist/src/cli/commands/mcp.js +1 -2
- package/dist/src/cli/commands/models.js +13 -11
- package/dist/src/cli/commands/onboard/channels/registry.js +1 -2
- package/dist/src/cli/commands/onboard/gateway.js +1 -2
- package/dist/src/cli/commands/onboard/model.d.ts +1 -1
- package/dist/src/cli/commands/onboard/model.js +18 -26
- package/dist/src/cli/commands/onboard.js +4 -2
- package/dist/src/cli/commands/platform.js +1 -0
- package/dist/src/cli/commands/project.js +3 -3
- package/dist/src/cli/commands/providers.js +2 -1
- package/dist/src/cli/commands/runtime.js +1 -2
- package/dist/src/cli/commands/search.js +1 -2
- package/dist/src/cli/commands/skills.js +1 -2
- package/dist/src/cli/commands/tui-runner.js +3 -2
- package/dist/src/cli/commands/tui.js +6 -8
- package/dist/src/cli/commands/tunnel.js +1 -1
- package/dist/src/cli/commands/voice.js +1 -2
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/cli/index.js +4 -2
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +15 -16
- package/dist/src/cli/utils/session.js +1 -2
- package/dist/src/computer/model-config.d.ts +3 -3
- package/dist/src/computer/model-config.js +10 -20
- package/dist/src/computer/runtime.js +1 -1
- package/dist/src/config/agent-model-intents.js +2 -2
- package/dist/src/config/agent-profile.d.ts +5 -6
- package/dist/src/config/agent-profile.js +19 -19
- package/dist/src/config/config-surface.d.ts +0 -3
- package/dist/src/config/default-model.js +2 -6
- package/dist/src/config/index.js +7 -8
- package/dist/src/config/loader.js +12 -18
- package/dist/src/config/models-json.d.ts +6 -6
- package/dist/src/config/paths.d.ts +18 -19
- package/dist/src/config/paths.js +35 -35
- package/dist/src/config/reload.d.ts +0 -1
- package/dist/src/config/reload.js +1 -6
- package/dist/src/config/rules.js +0 -15
- package/dist/src/config/schema.d.ts +3 -406
- package/dist/src/config/schema.js +24 -86
- package/dist/src/config/validate-channel-configs.js +8 -14
- package/dist/src/config/workspace-dirs.d.ts +3 -4
- package/dist/src/config/workspace-dirs.js +9 -8
- package/dist/src/config/workspace-path-helpers.d.ts +1 -1
- package/dist/src/config/workspace-path-helpers.js +2 -2
- package/dist/src/connectors/cli/lifecycle.js +2 -1
- package/dist/src/connectors/composio-managed-events.js +2 -1
- package/dist/src/connectors/connected-source-ingestion.js +2 -1
- package/dist/src/connectors/connected-source-understanding.js +4 -2
- package/dist/src/connectors/content-enrichment.js +2 -1
- package/dist/src/connectors/learning-coordinator.js +2 -1
- package/dist/src/connectors/runtime-adapter-registry.js +2 -1
- package/dist/src/connectors/workflow-preflight.d.ts +8 -1
- package/dist/src/connectors/workflow-preflight.js +11 -3
- package/dist/src/discussions/analyzer.js +2 -2
- package/dist/src/endpoint-tools/runtime.js +2 -1
- package/dist/src/execution-environments/subject.js +2 -1
- package/dist/src/extensions/activation-context.js +3 -16
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/discover-extensions.js +9 -15
- package/dist/src/extensions/extension-metadata-snapshot.d.ts +1 -1
- package/dist/src/extensions/extension-metadata-snapshot.js +9 -16
- package/dist/src/extensions/index.js +4 -10
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/loader.js +7 -14
- package/dist/src/extensions/manifest-registry.js +93 -98
- package/dist/src/extensions/marketplace.js +5 -2
- package/dist/src/extensions/normalize-manifest.js +12 -17
- package/dist/src/extensions/update.js +1 -2
- package/dist/src/files/file-service.js +7 -8
- package/dist/src/gateway/agents-admin.d.ts +23 -27
- package/dist/src/gateway/agents-admin.js +109 -130
- package/dist/src/gateway/file-path-classifier.js +3 -3
- package/dist/src/gateway/file-space-service.js +2 -1
- package/dist/src/gateway/global-defaults-admin.d.ts +6 -4
- package/dist/src/gateway/global-defaults-admin.js +21 -20
- package/dist/src/gateway/hono/app.js +2 -1
- package/dist/src/gateway/hono/lib/config-payload.js +12 -9
- package/dist/src/gateway/hono/middleware/auth.js +2 -1
- package/dist/src/gateway/hono/middleware/scopes.js +2 -1
- package/dist/src/gateway/hono/routes/agents.js +22 -49
- package/dist/src/gateway/hono/routes/browser.js +4 -2
- package/dist/src/gateway/hono/routes/channels.js +1 -2
- package/dist/src/gateway/hono/routes/cli-connectors.js +2 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +3 -1
- package/dist/src/gateway/hono/routes/composer-history.js +2 -1
- package/dist/src/gateway/hono/routes/config-patch/index.d.ts +1 -3
- package/dist/src/gateway/hono/routes/config-patch/index.js +1 -2
- package/dist/src/gateway/hono/routes/config-patch/misc.js +18 -11
- package/dist/src/gateway/hono/routes/config.js +0 -2
- package/dist/src/gateway/hono/routes/connectors.js +8 -4
- package/dist/src/gateway/hono/routes/context-sources.js +4 -3
- package/dist/src/gateway/hono/routes/device-pairing-approval.js +2 -1
- package/dist/src/gateway/hono/routes/device-push.js +3 -2
- package/dist/src/gateway/hono/routes/devices.js +6 -3
- package/dist/src/gateway/hono/routes/discussions.js +2 -1
- package/dist/src/gateway/hono/routes/endpoint-tools.js +2 -1
- package/dist/src/gateway/hono/routes/global-defaults.js +8 -16
- package/dist/src/gateway/hono/routes/home.js +93 -4
- package/dist/src/gateway/hono/routes/interaction-state.js +2 -1
- package/dist/src/gateway/hono/routes/models.js +8 -7
- package/dist/src/gateway/hono/routes/notes.js +4 -5
- package/dist/src/gateway/hono/routes/projects.js +6 -6
- package/dist/src/gateway/hono/routes/public-gateway.js +2 -1
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +4 -2
- package/dist/src/gateway/hono/routes/shares.js +4 -3
- package/dist/src/gateway/hono/routes/site-shares.js +2 -2
- package/dist/src/gateway/hono/routes/status.js +2 -3
- package/dist/src/gateway/hono/routes/tasks.js +1 -2
- package/dist/src/gateway/hono/routes/user-model-refresh.js +2 -1
- package/dist/src/gateway/hono/routes/user-model.js +3 -2
- package/dist/src/gateway/hono/routes/work-discovery.js +1 -1
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/image-generation-setup.d.ts +19 -10
- package/dist/src/gateway/image-generation-setup.js +59 -23
- package/dist/src/gateway/index.js +1 -4
- package/dist/src/gateway/lock.js +13 -18
- package/dist/src/gateway/memory-maintenance-automation-reconciler.js +4 -3
- package/dist/src/gateway/run-loop.js +2 -3
- package/dist/src/gateway/security/gateway-scopes.js +6 -2
- package/dist/src/gateway/security/index.js +4 -1
- package/dist/src/gateway/service/agent-runner.js +4 -2
- package/dist/src/gateway/service/app-context-access.js +2 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +0 -1
- package/dist/src/gateway/service/config-coordinator.js +4 -22
- package/dist/src/gateway/service/marketplace-service.js +3 -1
- package/dist/src/gateway/service/run-gateway-agent.js +4 -2
- package/dist/src/gateway/service/session-input-coordinator.js +4 -2
- package/dist/src/gateway/service.d.ts +5 -0
- package/dist/src/gateway/service.js +109 -33
- package/dist/src/gateway/session-context-summary.js +4 -2
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +2 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.js +15 -10
- package/dist/src/home-intelligence/application-service.d.ts +31 -0
- package/dist/src/home-intelligence/application-service.js +134 -0
- package/dist/src/home-intelligence/capability-preflight.d.ts +32 -0
- package/dist/src/home-intelligence/capability-preflight.js +118 -0
- package/dist/src/home-intelligence/evaluation.d.ts +34 -0
- package/dist/src/home-intelligence/evaluation.js +49 -0
- package/dist/src/home-intelligence/generator.d.ts +125 -0
- package/dist/src/home-intelligence/generator.js +227 -0
- package/dist/src/home-intelligence/host.d.ts +53 -0
- package/dist/src/home-intelligence/host.js +257 -0
- package/dist/src/home-intelligence/notification.d.ts +8 -0
- package/dist/src/home-intelligence/notification.js +20 -0
- package/dist/src/home-intelligence/policy.d.ts +16 -0
- package/dist/src/home-intelligence/policy.js +152 -0
- package/dist/src/home-intelligence/repository.d.ts +81 -0
- package/dist/src/home-intelligence/repository.js +495 -0
- package/dist/src/home-intelligence/snapshot.d.ts +43 -0
- package/dist/src/home-intelligence/snapshot.js +133 -0
- package/dist/src/home-intelligence/strategy.d.ts +14 -0
- package/dist/src/home-intelligence/strategy.js +10 -0
- package/dist/src/home-intelligence/types.d.ts +13 -0
- package/dist/src/home-intelligence/types.js +1 -0
- package/dist/src/infra/update-restart.js +4 -2
- package/dist/src/knowledge/connected-knowledge-pipeline.js +2 -1
- package/dist/src/knowledge/ingestion-service.js +2 -1
- package/dist/src/knowledge-memory/repository.js +2 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/local-apps/store.js +2 -1
- package/dist/src/mcp/channel-bridge.js +1 -2
- package/dist/src/mcp/channel-server.js +1 -2
- package/dist/src/mcp/gateway-http-client.js +1 -2
- package/dist/src/media/session-references.js +2 -1
- package/dist/src/memory-maintenance/service.js +2 -1
- package/dist/src/migrations/memory-config.js +1 -2
- package/dist/src/notes/agent-context.js +2 -1
- package/dist/src/notes/attachment-ref.js +8 -4
- package/dist/src/notes/note-attachment-sync.js +2 -1
- package/dist/src/notes/note-index-meta.js +14 -7
- package/dist/src/notes/note-markdown.js +13 -7
- package/dist/src/notes/service.js +6 -3
- package/dist/src/notes/store.js +4 -2
- package/dist/src/notifications/device-store.js +1 -1
- package/dist/src/notifications/planner.js +24 -0
- package/dist/src/notifications/service.d.ts +7 -14
- package/dist/src/notifications/service.js +13 -3
- package/dist/src/notifications/store.js +1 -1
- package/dist/src/notifications/types.d.ts +1 -1
- package/dist/src/notifications/types.js +1 -1
- package/dist/src/projects/capabilities/write.js +2 -1
- package/dist/src/projects/project-agent-suggestion.js +1 -1
- package/dist/src/projects/project-agent.js +4 -4
- package/dist/src/projects/project-service.js +2 -1
- package/dist/src/projects/workspace.js +3 -2
- package/dist/src/providers/index.js +3 -3
- package/dist/src/providers/model-reference-auditor.d.ts +1 -2
- package/dist/src/providers/model-reference-auditor.js +8 -5
- package/dist/src/realtime/runtime.js +2 -1
- package/dist/src/routing/binding-schema.d.ts +41 -0
- package/dist/src/routing/binding-schema.js +26 -0
- package/dist/src/routing/bindings.d.ts +4 -2
- package/dist/src/routing/bindings.js +4 -4
- package/dist/src/routing/index.d.ts +1 -1
- package/dist/src/routing/resolve-route.d.ts +7 -24
- package/dist/src/routing/resolve-route.js +17 -18
- package/dist/src/routing/resolve-tui-session-key.d.ts +1 -4
- package/dist/src/routing/resolve-tui-session-key.js +10 -9
- package/dist/src/scenes/execution.d.ts +1 -1
- package/dist/src/scenes/model.js +1 -1
- package/dist/src/scenes/taskFollowUp/contracts.d.ts +1 -1
- package/dist/src/scenes/taskFollowUp/service.js +6 -4
- package/dist/src/scenes/templates.d.ts +2 -2
- package/dist/src/session/config-store.js +2 -1
- package/dist/src/session/init-session-turn.js +2 -1
- package/dist/src/session/resolve-session.js +2 -1
- package/dist/src/session/session-workspace.js +1 -1
- package/dist/src/session/store.js +3 -2
- package/dist/src/storage/sqlite/activity-repository.js +6 -2
- package/dist/src/storage/sqlite/browser-tab-binding-repository.js +6 -2
- package/dist/src/storage/sqlite/clarification-wait-repository.js +13 -8
- package/dist/src/storage/sqlite/collaboration-rule-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/collaboration-rule-repository.js +8 -3
- package/dist/src/storage/sqlite/composer-input-history-repository.js +8 -3
- package/dist/src/storage/sqlite/config-repository.js +9 -5
- package/dist/src/storage/sqlite/connector-learning-repository.js +6 -2
- package/dist/src/storage/sqlite/connector-sync-policy-repository.js +6 -2
- package/dist/src/storage/sqlite/context-evidence-repository.js +8 -3
- package/dist/src/storage/sqlite/context-extraction-repository.js +8 -3
- package/dist/src/storage/sqlite/device-access-repository.js +15 -9
- package/dist/src/storage/sqlite/device-pairing-approval.js +6 -2
- package/dist/src/storage/sqlite/device-pairing-repository.js +10 -5
- package/dist/src/storage/sqlite/endpoint-principal-repository.js +6 -2
- package/dist/src/storage/sqlite/endpoint-session-binding-repository.js +6 -2
- package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.js +6 -2
- package/dist/src/storage/sqlite/gateway-identity-repository.js +6 -2
- package/dist/src/storage/sqlite/home-attention-repository.js +6 -2
- package/dist/src/storage/sqlite/index.d.ts +0 -1
- package/dist/src/storage/sqlite/index.js +72 -42
- package/dist/src/storage/sqlite/interaction-state-repository.js +10 -4
- package/dist/src/storage/sqlite/knowledge-repository.js +6 -2
- package/dist/src/storage/sqlite/migrations/203_remove_retired_proactive_contracts.sql +70 -0
- package/dist/src/storage/sqlite/migrations/204_home_intelligence.sql +78 -0
- package/dist/src/storage/sqlite/migrations/205_agent_catalog.sql +66 -0
- package/dist/src/storage/sqlite/migrations/206_home_advice_strategy_version.sql +3 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.d.ts +2 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.js +8 -4
- package/dist/src/storage/sqlite/migrations/conversation-windows-owners.d.ts +7 -1
- package/dist/src/storage/sqlite/migrations/conversation-windows-owners.js +2 -2
- 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/note-agent-context-repository.js +6 -2
- package/dist/src/storage/sqlite/notes-repository.js +9 -4
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-task-plan-repository.js +14 -9
- package/dist/src/storage/sqlite/session-turn-replace-repository.js +9 -5
- package/dist/src/storage/sqlite/sidebar-layout-repository.js +14 -9
- package/dist/src/storage/sqlite/transcript-repository.js +10 -6
- package/dist/src/storage/sqlite/user-people-repository.js +8 -3
- package/dist/src/storage/sqlite/user-trust-repository.js +8 -3
- package/dist/src/tasks/attention-governor.d.ts +0 -1
- package/dist/src/tasks/attention-governor.js +1 -7
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.d.ts +1 -1
- package/dist/src/tasks/execution-context.d.ts +2 -2
- package/dist/src/tasks/execution-context.js +6 -5
- package/dist/src/tasks/home-query-service.d.ts +3 -2
- package/dist/src/tasks/home-query-service.js +23 -44
- package/dist/src/tasks/task-context-assembler.js +2 -1
- package/dist/src/tasks/task-context-repository.d.ts +1 -1
- package/dist/src/tasks/task-contract-planner.d.ts +0 -3
- package/dist/src/tasks/task-contract-planner.js +1 -4
- package/dist/src/tasks/task-handoff-service.d.ts +0 -2
- package/dist/src/tasks/task-handoff-service.js +3 -3
- package/dist/src/tasks/task-value-metrics-service.js +2 -1
- package/dist/src/tui/backends/embedded-backend.js +12 -14
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-commands.js +5 -3
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +3 -3
- package/dist/src/tui/tui.js +5 -5
- package/dist/src/tunnel/registration-proof.js +2 -1
- package/dist/src/user-context/access-policy.js +2 -1
- package/dist/src/user-context/domain.d.ts +1 -1
- package/dist/src/user-context/domain.js +18 -13
- package/dist/src/user-context/extraction/registry.js +2 -1
- package/dist/src/user-context/interaction-state.js +4 -1
- package/dist/src/user-context/relationship-continuity.js +2 -1
- package/dist/src/user-context/trust-policy.js +13 -8
- package/dist/src/user-model/bootstrap.js +2 -1
- package/dist/src/user-model/capture/executor.js +4 -2
- package/dist/src/user-model/capture/semantic.d.ts +1 -1
- package/dist/src/user-model/capture/semantic.js +1 -1
- package/dist/src/user-model/domain.js +7 -2
- package/dist/src/user-model/goals.js +2 -1
- package/dist/src/user-model/index.js +4 -1
- package/dist/src/user-model/repository.js +2 -1
- package/dist/src/utils/helpers.js +1 -4
- package/dist/src/utils/index.js +2 -2
- package/dist/src/utils/logger/index.d.ts +1 -1
- package/dist/src/utils/logger/index.js +2 -2
- package/dist/src/utils/logger/redact.d.ts +2 -0
- package/dist/src/utils/logger/redact.js +11 -3
- package/dist/src/utils/logger.js +2 -2
- package/dist/src/voice/realtime/memory-context.js +2 -1
- package/dist/src/voice/realtime/persona-context.js +6 -6
- package/dist/src/voice/tts/audio.js +1 -1
- package/dist/src/work-discovery/analyzer.js +3 -3
- package/dist/src/work-discovery/investigator.js +1 -1
- package/dist/src/work-discovery/service.js +12 -11
- package/dist/src/workflows/draft/workflow-draft-service.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +4 -5
- package/dist/src/workflows/store/paths.js +1 -1
- package/package.json +5 -5
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CAFHadiy.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Drt3Foi9.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-B-Eduqwz.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-Dwgir6mu.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-H5L5vynP.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-uFKh3Hd0.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-RFBRYe5S.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Px-v3Q6Q.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-CfCo3lqh.js +0 -1
- package/dist/gateway/static/root/assets/home-page-w3_aWeNt.js +0 -1
- package/dist/gateway/static/root/assets/index--3c0awkr.js +0 -121
- package/dist/gateway/static/root/assets/local-app-workbench-page-BYKrJpFF.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-Dl4kM4Na.js +0 -2
- package/dist/gateway/static/root/assets/messages-7VAhscYe.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-j6sioeL1.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CMvvHv0f.js +0 -8
- package/dist/gateway/static/root/assets/popover-select-B-GDnZO9.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-C9K_e-EV.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CLGJNA42.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-ClLAD1pz.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-Xj8MkXN1.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DwALV8mi.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-F0rCQ-2a.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-C7hf6Cov.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-xPrFejRE.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-RdDYu7Yj.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-2A966jFY.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-CnBxPBVe.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-BZVpqw4T.js +0 -6
- package/dist/packages/gateway-contract/src/proactive.js +0 -136
- package/dist/src/commands/agents.config.d.ts +0 -31
- package/dist/src/commands/agents.config.js +0 -129
- package/dist/src/gateway/hono/routes/config-patch/agents.d.ts +0 -2
- package/dist/src/gateway/hono/routes/config-patch/agents.js +0 -6
- package/dist/src/storage/sqlite/relationship-settings-repository.d.ts +0 -17
- package/dist/src/storage/sqlite/relationship-settings-repository.js +0 -65
|
@@ -5,31 +5,31 @@ import { init_log_stream, subscribeToLogs } from "../utils/logger/log-stream.js"
|
|
|
5
5
|
import { getRuntimeLogStats } from "../utils/logger/stats.js";
|
|
6
6
|
import { createLogger } from "../utils/logger/index.js";
|
|
7
7
|
import { init_logger } from "../utils/logger.js";
|
|
8
|
-
import { closeXopcDatabase
|
|
8
|
+
import { closeXopcDatabase } from "../storage/sqlite/connection.js";
|
|
9
9
|
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
10
|
-
import { getBrowserTabBindingById } from "../storage/sqlite/browser-tab-binding-repository.js";
|
|
10
|
+
import { getBrowserTabBindingById, init_browser_tab_binding_repository } from "../storage/sqlite/browser-tab-binding-repository.js";
|
|
11
11
|
import { findSessionInput, init_session_input_repository, insertSessionInput } from "../storage/sqlite/session-input-repository.js";
|
|
12
12
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
13
13
|
import { TaskRunRepository, init_task_run_repository } from "../tasks/task-run-repository.js";
|
|
14
14
|
import { init_changes, notifyUserContextChange } from "../user-context/changes.js";
|
|
15
15
|
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
16
|
-
import { init_session_repository, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
17
|
-
import { getSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
18
|
-
import "../storage/sqlite/index.js";
|
|
16
|
+
import { init_session_repository, listSessionMetadata, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
17
|
+
import { getSessionConfig, init_config_repository } from "../storage/sqlite/config-repository.js";
|
|
18
|
+
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
19
|
+
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
20
|
+
import { init_agent_scope, listAgentEntries, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
21
|
+
import { init_paths, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
|
|
22
|
+
import { init_config, resolveKnowledgeReadPolicy } from "../user-context/config.js";
|
|
19
23
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
20
|
-
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
21
24
|
import { init_agent_session_key, resolveAgentMainConversationId } from "../routing/agent-session-key.js";
|
|
22
25
|
import { init_session_key, resolveConversationId, sanitizeSegment } from "../routing/session-key.js";
|
|
23
26
|
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
24
27
|
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
25
|
-
import { init_paths, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
|
|
26
|
-
import { areExtensionsGloballyDisabled } from "../extensions/discover-extensions.js";
|
|
27
|
-
import { buildExtensionMetadataSnapshot } from "../extensions/extension-metadata-snapshot.js";
|
|
28
|
-
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, init_channel_catalog_service } from "../channels/catalog/channel-catalog-service.js";
|
|
29
|
-
import { loadConfig, saveConfig } from "../config/loader.js";
|
|
30
28
|
import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
31
29
|
import { init_providers, providers_exports } from "../providers/index.js";
|
|
32
30
|
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
31
|
+
import { listKnowledgeItems } from "../knowledge-memory/repository.js";
|
|
32
|
+
import "../knowledge-memory/index.js";
|
|
33
33
|
import { getEmbeddedExecutionSession } from "../agent/embedded/execution-context.js";
|
|
34
34
|
import { disposeAllSessionMcpRuntimes } from "../agent/mcp/bundle-mcp-runtime.js";
|
|
35
35
|
import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
|
|
@@ -52,15 +52,19 @@ import "../automations/index.js";
|
|
|
52
52
|
import { TaskRunDispatcher } from "../tasks/task-run-dispatcher.js";
|
|
53
53
|
import "../tasks/index.js";
|
|
54
54
|
import "../agent/mcp/bundle-mcp-tools.js";
|
|
55
|
+
import { areExtensionsGloballyDisabled } from "../extensions/discover-extensions.js";
|
|
55
56
|
import { SessionIndex } from "../session/manager.js";
|
|
56
57
|
import "../session/index.js";
|
|
57
58
|
import { ExtensionLoader } from "../extensions/loader.js";
|
|
59
|
+
import { buildExtensionMetadataSnapshot } from "../extensions/extension-metadata-snapshot.js";
|
|
58
60
|
import "../extensions/index.js";
|
|
61
|
+
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot } from "../channels/catalog/channel-catalog-service.js";
|
|
62
|
+
import { loadConfig, saveConfig } from "../config/loader.js";
|
|
59
63
|
import { MessageBus, MessageBusShutdownError } from "../infra/bus/queue.js";
|
|
60
64
|
import "../infra/bus/index.js";
|
|
61
65
|
import { collectMediaUrisFromMessages, deleteMediaUris } from "../media/session-references.js";
|
|
62
66
|
import { AgentService } from "../agent/service.js";
|
|
63
|
-
import {
|
|
67
|
+
import { bootstrapApplicationStateSync } from "../bootstrap/application-state.js";
|
|
64
68
|
import { setPairingBroadcastSink } from "../channels/pairing/pairing-events.js";
|
|
65
69
|
import { registerClarificationChannelRuntime } from "./clarify-runtime.js";
|
|
66
70
|
import { ChannelManager } from "../channels/manager.js";
|
|
@@ -115,7 +119,6 @@ import { assertGatewayRuntimeConfig } from "./runtime-config.js";
|
|
|
115
119
|
import { auditGatewayConfig } from "./security/audit.js";
|
|
116
120
|
import { getXopcCloudCatalogCoordinator } from "../providers/xopc-cloud-catalog-coordinator.js";
|
|
117
121
|
import { ModelCatalogSyncService } from "../providers/model-catalog-sync-service.js";
|
|
118
|
-
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
119
122
|
import { NotificationService } from "../notifications/service.js";
|
|
120
123
|
import "../local-apps/index.js";
|
|
121
124
|
import { createRuntimeBrowserAutomationService } from "../browser/automations/runtime-service.js";
|
|
@@ -137,14 +140,19 @@ import { createGatewayStartupTrace } from "./startup-trace.js";
|
|
|
137
140
|
import { GatewaySceneHost } from "./scenes/host.js";
|
|
138
141
|
import { checkAppContextAccess, prepareAppContext } from "./service/app-context-access.js";
|
|
139
142
|
import { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults } from "../voice/language-profile.js";
|
|
143
|
+
import { HomeIntelligenceHost } from "../home-intelligence/host.js";
|
|
144
|
+
import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
|
|
145
|
+
import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
|
|
146
|
+
import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
|
|
140
147
|
import crypto from "node:crypto";
|
|
141
148
|
//#region src/gateway/service.ts
|
|
142
149
|
init_session_repository();
|
|
143
150
|
init_agent_session_key();
|
|
151
|
+
init_browser_tab_binding_repository();
|
|
144
152
|
init_session_input_repository();
|
|
153
|
+
init_config_repository();
|
|
145
154
|
init_changes();
|
|
146
155
|
init_agent_scope();
|
|
147
|
-
init_channel_catalog_service();
|
|
148
156
|
init_schema();
|
|
149
157
|
init_providers();
|
|
150
158
|
init_logger();
|
|
@@ -153,8 +161,10 @@ init_paths();
|
|
|
153
161
|
init_package_version();
|
|
154
162
|
init_resolve_route();
|
|
155
163
|
init_session_key();
|
|
164
|
+
init_sqlite();
|
|
156
165
|
init_task_run_repository();
|
|
157
166
|
init_transaction();
|
|
167
|
+
init_config();
|
|
158
168
|
const log = createLogger("Gateway:Service");
|
|
159
169
|
var GatewayService = class {
|
|
160
170
|
bus;
|
|
@@ -168,6 +178,7 @@ var GatewayService = class {
|
|
|
168
178
|
extensionLoader = null;
|
|
169
179
|
extensionMetadataSnapshot = null;
|
|
170
180
|
sceneHost = null;
|
|
181
|
+
homeIntelligenceHost = null;
|
|
171
182
|
sessionIndex;
|
|
172
183
|
running = false;
|
|
173
184
|
startTime = Date.now();
|
|
@@ -195,7 +206,7 @@ var GatewayService = class {
|
|
|
195
206
|
const messages = await this.sessionIndex.loadMessages(conversationId);
|
|
196
207
|
const after = await this.sessionIndex.getSessionMetadata(conversationId);
|
|
197
208
|
if (after?.transcriptId !== expectedTranscriptId) throw new Error("Conversation changed while loading voice context");
|
|
198
|
-
const profile = resolveEffectiveAgentProfileForSession(
|
|
209
|
+
const profile = resolveEffectiveAgentProfileForSession(conversationId);
|
|
199
210
|
const persona = buildVoicePersonaContext({
|
|
200
211
|
getConfig: () => this.config,
|
|
201
212
|
conversationId,
|
|
@@ -348,14 +359,9 @@ var GatewayService = class {
|
|
|
348
359
|
this.serviceConfig = serviceConfig;
|
|
349
360
|
this.bus = new MessageBus();
|
|
350
361
|
this.configPath = serviceConfig.configPath || resolveConfigPath();
|
|
351
|
-
|
|
362
|
+
bootstrapApplicationStateSync(this.configPath);
|
|
352
363
|
this.config = loadConfig(this.configPath);
|
|
353
364
|
let bootstrapConfigChanged = initializeVoiceDefaults(this.config, inferProductLanguageFromEnvironment());
|
|
354
|
-
const starterResult = ensureStarterAgentsInitialized(this.config);
|
|
355
|
-
if (starterResult.changed) {
|
|
356
|
-
this.config = starterResult.config;
|
|
357
|
-
bootstrapConfigChanged = true;
|
|
358
|
-
}
|
|
359
365
|
if (sanitizeTunnelConfig(this.config)) bootstrapConfigChanged = true;
|
|
360
366
|
if (bootstrapConfigChanged) saveConfig(this.config, this.configPath).catch((err) => {
|
|
361
367
|
const em = err instanceof Error ? err.message : String(err);
|
|
@@ -604,11 +610,23 @@ var GatewayService = class {
|
|
|
604
610
|
refreshUserProfileContext() {
|
|
605
611
|
this._agentService?.refreshUserProfileContext();
|
|
606
612
|
}
|
|
613
|
+
/** Refresh long-lived runtime caches after an Agent catalog mutation. */
|
|
614
|
+
refreshAgentCatalog() {
|
|
615
|
+
this._agentService?.applyRuntimeConfiguration(this.config);
|
|
616
|
+
this.reconcileMemoryMaintenanceAutomations().catch((error) => {
|
|
617
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
618
|
+
log.warn({
|
|
619
|
+
err: error,
|
|
620
|
+
errorMessage
|
|
621
|
+
}, `Agent catalog refresh failed: ${errorMessage}`);
|
|
622
|
+
});
|
|
623
|
+
this.emit("agent.catalog", {});
|
|
624
|
+
}
|
|
607
625
|
ensureAgentService() {
|
|
608
626
|
if (this._agentService) return this._agentService;
|
|
609
627
|
this._agentService = new AgentService(this.bus, {
|
|
610
628
|
workspace: this.workspacePath,
|
|
611
|
-
model: getAgentDefaultModelRef(
|
|
629
|
+
model: getAgentDefaultModelRef(),
|
|
612
630
|
config: this.config,
|
|
613
631
|
sessionStore: this.sessionIndex.getStore(),
|
|
614
632
|
onSessionMetadataUpdated: (conversationId, patch) => {
|
|
@@ -643,6 +661,7 @@ var GatewayService = class {
|
|
|
643
661
|
getChatPreviewService: () => this.chatPreviews,
|
|
644
662
|
dispatchTaskEvents: () => this.dispatchTaskEvents(),
|
|
645
663
|
dispatchTaskRuns: () => this.dispatchTaskRuns(),
|
|
664
|
+
onAgentCatalogMutate: () => this.refreshAgentCatalog(),
|
|
646
665
|
getWorkflowRunService: () => this.createWorkflowRunService(),
|
|
647
666
|
sourceContextResolver: async (binding) => {
|
|
648
667
|
if (binding.kind === "note") {
|
|
@@ -676,7 +695,7 @@ var GatewayService = class {
|
|
|
676
695
|
});
|
|
677
696
|
this.automationService.setDeps({
|
|
678
697
|
agentService: this._agentService,
|
|
679
|
-
getDefaultAgentId: () => getDefaultAgentId(
|
|
698
|
+
getDefaultAgentId: () => getDefaultAgentId(),
|
|
680
699
|
prepareAgentSession: (input) => prepareAutomationAgentSession(this.sessionIndex.getStore(), this.projects, input),
|
|
681
700
|
workflowRunService: this.createWorkflowRunService(),
|
|
682
701
|
browserAutomationService: this.browserAutomations,
|
|
@@ -1019,6 +1038,8 @@ var GatewayService = class {
|
|
|
1019
1038
|
await this.stop().catch((cleanupError) => log.error({ err: cleanupError }, "Gateway startup cleanup failed"));
|
|
1020
1039
|
await this.sceneHost?.stop();
|
|
1021
1040
|
this.sceneHost = null;
|
|
1041
|
+
this.homeIntelligenceHost?.stop();
|
|
1042
|
+
this.homeIntelligenceHost = null;
|
|
1022
1043
|
this.stopRealtimeLogBridge?.();
|
|
1023
1044
|
this.stopRealtimeLogBridge = null;
|
|
1024
1045
|
setPairingBroadcastSink(null);
|
|
@@ -1034,7 +1055,42 @@ var GatewayService = class {
|
|
|
1034
1055
|
this.emit(type, payload);
|
|
1035
1056
|
});
|
|
1036
1057
|
log.debug("Starting gateway service...");
|
|
1037
|
-
|
|
1058
|
+
const homeCapabilities = new HomeCapabilityPreflightService({
|
|
1059
|
+
config: () => this.config,
|
|
1060
|
+
agentId: () => resolveDefaultAgentId(),
|
|
1061
|
+
skills: (agentId) => this.agentService.getAgentSkillAvailability(agentId).skills,
|
|
1062
|
+
principalId: "local-owner"
|
|
1063
|
+
});
|
|
1064
|
+
this.homeIntelligenceHost = new HomeIntelligenceHost(getSqliteDatabase(), {
|
|
1065
|
+
principal: {
|
|
1066
|
+
ownerId: "local-owner",
|
|
1067
|
+
workspaceId: this.workspacePath
|
|
1068
|
+
},
|
|
1069
|
+
snapshot: new HomeSnapshotBuilder({
|
|
1070
|
+
projects: () => this.projects.list({ limit: 500 }).items,
|
|
1071
|
+
tasks: () => new TaskRepository().list({ limit: 200 }),
|
|
1072
|
+
knowledge: () => listKnowledgeItems({
|
|
1073
|
+
statuses: ["active"],
|
|
1074
|
+
limit: 200
|
|
1075
|
+
}),
|
|
1076
|
+
knowledgePolicy: () => this.config.userContext.knowledgeMemory.enabled ? resolveKnowledgeReadPolicy(this.config.userContext.knowledgeMemory) : {
|
|
1077
|
+
scopes: [],
|
|
1078
|
+
contentSources: []
|
|
1079
|
+
},
|
|
1080
|
+
sessions: () => listSessionMetadata({
|
|
1081
|
+
limit: 50,
|
|
1082
|
+
excludeArchived: true
|
|
1083
|
+
}).items
|
|
1084
|
+
}),
|
|
1085
|
+
generator: new HomeAdviceGenerator(() => this.config),
|
|
1086
|
+
capabilities: () => homeCapabilities.inventory(),
|
|
1087
|
+
resolveCapabilities: (requirements, options) => homeCapabilities.resolve(requirements, options),
|
|
1088
|
+
publish: (type, payload) => this.realtime.broker.publish("gateway", type, payload),
|
|
1089
|
+
notifyOpportunity: (payload) => this.emit("home.opportunity.ready", payload),
|
|
1090
|
+
locale: () => "en",
|
|
1091
|
+
enabled: () => this.config.userContext.enabled,
|
|
1092
|
+
dispatchTaskRuns: () => this.dispatchTaskRuns()
|
|
1093
|
+
});
|
|
1038
1094
|
await this.localApps.recoverPendingReleases();
|
|
1039
1095
|
const { recoverCapabilityImports } = await import("../imports/runtime.js");
|
|
1040
1096
|
await recoverCapabilityImports();
|
|
@@ -1056,7 +1112,7 @@ var GatewayService = class {
|
|
|
1056
1112
|
const trace = this.startupTrace;
|
|
1057
1113
|
const catalogCoordinator = getXopcCloudCatalogCoordinator();
|
|
1058
1114
|
const catalog = await trace.measure("model-catalog.hydrate", () => catalogCoordinator.hydrate());
|
|
1059
|
-
if (getAgentDefaultModelRef(
|
|
1115
|
+
if (getAgentDefaultModelRef()?.startsWith("xopc-cloud/") && catalog.source === "none") {
|
|
1060
1116
|
const readiness = await trace.measure("model-catalog.initial-refresh", () => catalogCoordinator.ensure({
|
|
1061
1117
|
reason: "startup",
|
|
1062
1118
|
network: "if-empty",
|
|
@@ -1079,7 +1135,7 @@ var GatewayService = class {
|
|
|
1079
1135
|
runMessageSending: (to, content, channel) => this.agentService.outboundCoordinator.invokeOutboundMessageSending(to, content, channel),
|
|
1080
1136
|
runMessageSent: (to, content, success, error, channel) => this.agentService.outboundCoordinator.invokeOutboundMessageSent(to, content, success, error, channel)
|
|
1081
1137
|
});
|
|
1082
|
-
this.channelManager.enableOutboundPersistence(getDefaultAgentId(
|
|
1138
|
+
this.channelManager.enableOutboundPersistence(getDefaultAgentId());
|
|
1083
1139
|
if (this.extensionLoader) this.extensionLoader.setRuntimeContext({
|
|
1084
1140
|
bus: this.bus,
|
|
1085
1141
|
sessionManager: this.sessionIndex,
|
|
@@ -1146,7 +1202,7 @@ var GatewayService = class {
|
|
|
1146
1202
|
log.debug("Session manager initialized");
|
|
1147
1203
|
this.automationService.setDeps({
|
|
1148
1204
|
agentService: this.agentService,
|
|
1149
|
-
getDefaultAgentId: () => getDefaultAgentId(
|
|
1205
|
+
getDefaultAgentId: () => getDefaultAgentId(),
|
|
1150
1206
|
prepareAgentSession: (input) => prepareAutomationAgentSession(this.sessionIndex.getStore(), this.projects, input),
|
|
1151
1207
|
workflowRunService: this.createWorkflowRunService(),
|
|
1152
1208
|
browserAutomationService: this.browserAutomations,
|
|
@@ -1199,7 +1255,7 @@ var GatewayService = class {
|
|
|
1199
1255
|
});
|
|
1200
1256
|
this.connectorLearningCoordinator = startConnectorLearningCoordinator({
|
|
1201
1257
|
getConfig: () => this.config,
|
|
1202
|
-
resolveAgentId: () => resolveDefaultAgentId(
|
|
1258
|
+
resolveAgentId: () => resolveDefaultAgentId(),
|
|
1203
1259
|
emit: (type, payload) => this.emit(type, payload)
|
|
1204
1260
|
});
|
|
1205
1261
|
this.managedComposioEventPoller = new ManagedComposioEventPoller({
|
|
@@ -1214,7 +1270,7 @@ var GatewayService = class {
|
|
|
1214
1270
|
});
|
|
1215
1271
|
this.managedComposioEventPoller.start();
|
|
1216
1272
|
this.connectedKnowledgeCoordinator = startConnectedKnowledgeCoordinator({ resolvePipelineOptions: () => ({
|
|
1217
|
-
agentId: resolveDefaultAgentId(
|
|
1273
|
+
agentId: resolveDefaultAgentId(),
|
|
1218
1274
|
workspaceId: this.currentWorkspacePath
|
|
1219
1275
|
}) });
|
|
1220
1276
|
import("../browser/providers/browser-ext-install.js").then(({ ensureBrowserExtensionOnStartup }) => ensureBrowserExtensionOnStartup(this.config)).catch((err) => log.warn({ err }, "Browser extension artifact ensure failed"));
|
|
@@ -1233,10 +1289,11 @@ var GatewayService = class {
|
|
|
1233
1289
|
triggerInProcessRestart: () => this.triggerGatewayProcessRestart()
|
|
1234
1290
|
});
|
|
1235
1291
|
wireTunnelEventsToGateway(this);
|
|
1236
|
-
import("../share/share-auto.js").then(({ runStagingSweep }) => runStagingSweep([...new Set([getDefaultAgentId(
|
|
1292
|
+
import("../share/share-auto.js").then(({ runStagingSweep }) => runStagingSweep([...new Set([getDefaultAgentId(), ...listAgentEntries().map((entry) => entry.id)])].map((agentId) => resolveAgentWorkspaceDir(agentId)))).catch((err) => log.warn({ err }, "Share staging sweep failed"));
|
|
1237
1293
|
if (this.serviceConfig.deferChannelConnectUntilAfterHttp !== true) this.markGatewayReady();
|
|
1238
1294
|
else trace.mark("service.started-awaiting-http");
|
|
1239
1295
|
this.sceneHost?.start();
|
|
1296
|
+
this.homeIntelligenceHost.start();
|
|
1240
1297
|
log.debug("Gateway service started");
|
|
1241
1298
|
}
|
|
1242
1299
|
/** Called when the HTTP listener is bound (before deferred channel work). */
|
|
@@ -1332,6 +1389,8 @@ var GatewayService = class {
|
|
|
1332
1389
|
await this.sideChats.disposeAll();
|
|
1333
1390
|
await this.sceneHost?.stop();
|
|
1334
1391
|
this.sceneHost = null;
|
|
1392
|
+
this.homeIntelligenceHost?.stop();
|
|
1393
|
+
this.homeIntelligenceHost = null;
|
|
1335
1394
|
this.realtime.close();
|
|
1336
1395
|
this.voiceRealtime.close();
|
|
1337
1396
|
await this.discussionWorker.stop();
|
|
@@ -1619,6 +1678,10 @@ var GatewayService = class {
|
|
|
1619
1678
|
get currentWorkspacePath() {
|
|
1620
1679
|
return this.workspacePath;
|
|
1621
1680
|
}
|
|
1681
|
+
get homeIntelligence() {
|
|
1682
|
+
if (!this.homeIntelligenceHost) throw new Error("Home intelligence is not running");
|
|
1683
|
+
return this.homeIntelligenceHost;
|
|
1684
|
+
}
|
|
1622
1685
|
get messageBusInstance() {
|
|
1623
1686
|
return this.bus;
|
|
1624
1687
|
}
|
|
@@ -1674,15 +1737,15 @@ var GatewayService = class {
|
|
|
1674
1737
|
}
|
|
1675
1738
|
collectWorkflowAgentIds() {
|
|
1676
1739
|
const ids = /* @__PURE__ */ new Set();
|
|
1677
|
-
ids.add(resolveDefaultAgentId(
|
|
1678
|
-
for (const entry of listAgentEntries(
|
|
1740
|
+
ids.add(resolveDefaultAgentId());
|
|
1741
|
+
for (const entry of listAgentEntries()) {
|
|
1679
1742
|
if (entry.enabled === false) continue;
|
|
1680
1743
|
ids.add(normalizeAgentId(entry.id));
|
|
1681
1744
|
}
|
|
1682
1745
|
return [...ids];
|
|
1683
1746
|
}
|
|
1684
1747
|
/** Process a message directly through the agent (for CLI mode). */
|
|
1685
|
-
async processDirect(content, conversationId = resolveAgentMainConversationId({ agentId: getDefaultAgentId(
|
|
1748
|
+
async processDirect(content, conversationId = resolveAgentMainConversationId({ agentId: getDefaultAgentId() })) {
|
|
1686
1749
|
return this.agentService.turnDispatcher.processDirect(content, conversationId, {
|
|
1687
1750
|
type: "system",
|
|
1688
1751
|
source: "internal"
|
|
@@ -1690,6 +1753,13 @@ var GatewayService = class {
|
|
|
1690
1753
|
}
|
|
1691
1754
|
emit(type, payload) {
|
|
1692
1755
|
if (type === "config.reload") notifyUserContextChange({ kind: "policy" });
|
|
1756
|
+
if (type === "connector.learning.updated" && payload && typeof payload === "object") {
|
|
1757
|
+
const job = payload;
|
|
1758
|
+
if (job.status === "completed" && typeof job.sourceInstanceId === "string" && typeof job.updatedAt === "string") this.homeIntelligenceHost?.sourceChanged({
|
|
1759
|
+
sourceInstanceId: job.sourceInstanceId,
|
|
1760
|
+
revision: job.updatedAt
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1693
1763
|
this.realtime.broker.publish("gateway", type, payload);
|
|
1694
1764
|
this.createNotificationService().handleGatewayEvent(type, payload);
|
|
1695
1765
|
}
|
|
@@ -1734,6 +1804,12 @@ var GatewayService = class {
|
|
|
1734
1804
|
});
|
|
1735
1805
|
}
|
|
1736
1806
|
if (event.type.startsWith("task.")) this.emit(event.type, event.payload);
|
|
1807
|
+
if (event.type.startsWith("task.") || event.type.startsWith("project.")) {
|
|
1808
|
+
const payload = event.payload;
|
|
1809
|
+
const objectId = event.type.startsWith("task.") ? payload.taskId : payload.projectId;
|
|
1810
|
+
const revision = payload.version ?? payload.revision ?? "unknown";
|
|
1811
|
+
this.homeIntelligenceHost?.requestRefresh(event.type.startsWith("task.") ? "task_changed" : "project_changed", `domain:${event.type}:${String(objectId)}:${String(revision)}`);
|
|
1812
|
+
}
|
|
1737
1813
|
this.automationService.triggerEvent(event).catch((err) => {
|
|
1738
1814
|
const em = err instanceof Error ? err.message : String(err);
|
|
1739
1815
|
log.warn({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
4
|
-
import { hasGatewayScope } from "./security/gateway-scopes.js";
|
|
4
|
+
import { hasGatewayScope, init_gateway_scopes } from "./security/gateway-scopes.js";
|
|
5
5
|
import { TaskRepository, init_task_repository } from "../tasks/task-repository.js";
|
|
6
6
|
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
7
7
|
import { init_session_repository } from "../storage/sqlite/session-repository.js";
|
|
8
|
-
import { getSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
8
|
+
import { getSessionConfig, init_config_repository } from "../storage/sqlite/config-repository.js";
|
|
9
9
|
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
10
10
|
import { getExecutionEnvironmentForSession } from "../execution-environments/subject.js";
|
|
11
11
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
@@ -14,10 +14,12 @@ import { runExec } from "../infra/exec.js";
|
|
|
14
14
|
import { isSessionSourceBinding } from "../agent/source-context/types.js";
|
|
15
15
|
import { realpath, stat } from "node:fs/promises";
|
|
16
16
|
//#region src/gateway/session-context-summary.ts
|
|
17
|
+
init_config_repository();
|
|
17
18
|
init_session_repository();
|
|
18
19
|
init_transaction();
|
|
19
20
|
init_task_repository();
|
|
20
21
|
init_logger();
|
|
22
|
+
init_gateway_scopes();
|
|
21
23
|
const log = createLogger("SessionContextSummary");
|
|
22
24
|
const SOURCE_LIMIT = 20;
|
|
23
25
|
async function readEnvironment(config, conversationId, projectId) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Config } from '../config/schema.js';
|
|
2
|
+
import type { AgentDefaults } from '../agent-config/index.js';
|
|
2
3
|
import type { CatalogSource } from '../providers/model-catalog-store.js';
|
|
3
4
|
type CloudCapability = 'chat' | 'vision' | 'image-generation' | 'stt' | 'tts';
|
|
4
5
|
export interface XopcCloudCapabilitySelection {
|
|
@@ -12,6 +13,7 @@ export interface XopcCloudCapabilitySelection {
|
|
|
12
13
|
export type PrepareXopcCloudCapabilitySetupResult = {
|
|
13
14
|
ok: true;
|
|
14
15
|
config: Config;
|
|
16
|
+
defaults: AgentDefaults;
|
|
15
17
|
selection: XopcCloudCapabilitySelection;
|
|
16
18
|
} | {
|
|
17
19
|
ok: false;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
2
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
1
3
|
import { getModelCatalogStore, init_model_catalog_store } from "../providers/model-catalog-store.js";
|
|
2
4
|
import { compareCatalogModels } from "../providers/model-catalog-ranking.js";
|
|
3
5
|
import { prepareUpdateGlobalDefaults } from "./global-defaults-admin.js";
|
|
4
6
|
//#region src/gateway/xopc-cloud-capability-setup.ts
|
|
7
|
+
init_repository();
|
|
5
8
|
init_model_catalog_store();
|
|
6
9
|
function supportsCapability(model, capability) {
|
|
7
10
|
if (model.availability !== "available") return false;
|
|
@@ -49,9 +52,10 @@ function prepareXopcCloudCapabilitySetup(config, source) {
|
|
|
49
52
|
missing: selected.missing
|
|
50
53
|
};
|
|
51
54
|
const selection = selected.selection;
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
+
const currentDefaults = new AgentCatalogRepository().getSettings().defaults;
|
|
56
|
+
const currentModels = currentDefaults.models;
|
|
57
|
+
const defaultsUpdate = prepareUpdateGlobalDefaults({ defaults: {
|
|
58
|
+
...currentDefaults,
|
|
55
59
|
models: {
|
|
56
60
|
...currentModels,
|
|
57
61
|
chat: {
|
|
@@ -75,18 +79,18 @@ function prepareXopcCloudCapabilitySetup(config, source) {
|
|
|
75
79
|
error: defaultsUpdate.error,
|
|
76
80
|
missing: []
|
|
77
81
|
};
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
const currentTts = withDefaults.messages?.tts;
|
|
82
|
+
const currentStt = config.tools?.media?.audio;
|
|
83
|
+
const currentTts = config.messages?.tts;
|
|
81
84
|
return {
|
|
82
85
|
ok: true,
|
|
83
86
|
selection,
|
|
87
|
+
defaults: defaultsUpdate.data.defaults,
|
|
84
88
|
config: {
|
|
85
|
-
...
|
|
89
|
+
...config,
|
|
86
90
|
tools: {
|
|
87
|
-
...
|
|
91
|
+
...config.tools,
|
|
88
92
|
media: {
|
|
89
|
-
...
|
|
93
|
+
...config.tools?.media,
|
|
90
94
|
audio: {
|
|
91
95
|
...currentStt,
|
|
92
96
|
enabled: true,
|
|
@@ -106,7 +110,7 @@ function prepareXopcCloudCapabilitySetup(config, source) {
|
|
|
106
110
|
}
|
|
107
111
|
},
|
|
108
112
|
messages: {
|
|
109
|
-
...
|
|
113
|
+
...config.messages,
|
|
110
114
|
tts: {
|
|
111
115
|
...currentTts,
|
|
112
116
|
enabled: true,
|
|
@@ -144,6 +148,7 @@ async function applyXopcCloudCapabilitySetup(service) {
|
|
|
144
148
|
configured: false,
|
|
145
149
|
error: saved.error ?? "Failed to save XOPC Cloud capability configuration"
|
|
146
150
|
};
|
|
151
|
+
new AgentCatalogService().updateDefaults(prepared.defaults);
|
|
147
152
|
return {
|
|
148
153
|
configured: true,
|
|
149
154
|
selection: prepared.selection
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { DatabaseSync } from 'node:sqlite';
|
|
2
|
+
import type { HomeOpportunityActionResponse } from '@xopcai/gateway-contract';
|
|
3
|
+
import { type HomeOpportunityFeedbackInput, type HomePrincipal } from './repository.js';
|
|
4
|
+
export declare class HomeOpportunityNotFoundError extends Error {
|
|
5
|
+
}
|
|
6
|
+
export declare class HomeOpportunityActionError extends Error {
|
|
7
|
+
}
|
|
8
|
+
export declare class HomeOpportunityApplicationService {
|
|
9
|
+
private readonly db;
|
|
10
|
+
private readonly principal;
|
|
11
|
+
private readonly resolveAgentId;
|
|
12
|
+
private readonly repository;
|
|
13
|
+
private readonly tasks;
|
|
14
|
+
private readonly taskApplication;
|
|
15
|
+
constructor(db: DatabaseSync, principal: HomePrincipal, resolveAgentId?: () => string);
|
|
16
|
+
start(input: {
|
|
17
|
+
opportunityId: string;
|
|
18
|
+
expectedRevision: number;
|
|
19
|
+
idempotencyKey: string;
|
|
20
|
+
now: number;
|
|
21
|
+
}, options?: {
|
|
22
|
+
degraded?: boolean;
|
|
23
|
+
}): HomeOpportunityActionResponse;
|
|
24
|
+
discuss(input: {
|
|
25
|
+
opportunityId: string;
|
|
26
|
+
expectedRevision: number;
|
|
27
|
+
idempotencyKey: string;
|
|
28
|
+
now: number;
|
|
29
|
+
}): HomeOpportunityActionResponse;
|
|
30
|
+
feedback(opportunityId: string, input: HomeOpportunityFeedbackInput): void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { TaskRepository, init_task_repository } from "../tasks/task-repository.js";
|
|
3
|
+
import { TaskApplicationService } from "../tasks/task-application-service.js";
|
|
4
|
+
import { HomeIntelligenceRepository } from "./repository.js";
|
|
5
|
+
//#region src/home-intelligence/application-service.ts
|
|
6
|
+
init_task_repository();
|
|
7
|
+
init_transaction();
|
|
8
|
+
var HomeOpportunityNotFoundError = class extends Error {};
|
|
9
|
+
var HomeOpportunityActionError = class extends Error {};
|
|
10
|
+
var HomeOpportunityApplicationService = class {
|
|
11
|
+
repository;
|
|
12
|
+
tasks = new TaskRepository();
|
|
13
|
+
taskApplication = new TaskApplicationService();
|
|
14
|
+
constructor(db, principal, resolveAgentId = () => "main") {
|
|
15
|
+
this.db = db;
|
|
16
|
+
this.principal = principal;
|
|
17
|
+
this.resolveAgentId = resolveAgentId;
|
|
18
|
+
this.repository = new HomeIntelligenceRepository(db);
|
|
19
|
+
}
|
|
20
|
+
start(input, options = {}) {
|
|
21
|
+
return runSqliteWriteTransaction((db) => {
|
|
22
|
+
if (db !== this.db) throw new Error("Home opportunity service database mismatch");
|
|
23
|
+
const taskKey = `home-opportunity:${input.opportunityId}:${input.idempotencyKey}`;
|
|
24
|
+
const existing = this.tasks.getByIdempotencyKey(taskKey);
|
|
25
|
+
if (existing) return {
|
|
26
|
+
outcome: "task",
|
|
27
|
+
taskId: existing.id,
|
|
28
|
+
href: `/tasks/${encodeURIComponent(existing.id)}`
|
|
29
|
+
};
|
|
30
|
+
const opportunity = this.repository.getOpportunity(this.principal, input.opportunityId, input.now);
|
|
31
|
+
if (!opportunity) throw new HomeOpportunityNotFoundError("Home opportunity is unavailable");
|
|
32
|
+
if (opportunity.revision !== input.expectedRevision) throw new HomeOpportunityActionError("Home opportunity changed; refresh before starting");
|
|
33
|
+
if (opportunity.evidence.some((item) => item.freshUntil <= input.now)) throw new HomeOpportunityActionError("Home opportunity evidence expired; refresh before starting");
|
|
34
|
+
const degraded = Boolean(options.degraded);
|
|
35
|
+
if (degraded && !opportunity.degradedActionPrompt) throw new HomeOpportunityActionError("This opportunity has no degraded start path");
|
|
36
|
+
if (!degraded && !opportunity.actions.canStart || opportunity.risk === "external_write") throw new HomeOpportunityActionError("This opportunity must be discussed before it can start");
|
|
37
|
+
const agentId = this.resolveAgentId();
|
|
38
|
+
const created = this.taskApplication.create({
|
|
39
|
+
idempotencyKey: taskKey,
|
|
40
|
+
title: opportunity.title,
|
|
41
|
+
projectId: opportunity.projectId,
|
|
42
|
+
priority: opportunity.urgency === "now" ? "high" : "normal",
|
|
43
|
+
delegateAgentId: agentId,
|
|
44
|
+
contract: {
|
|
45
|
+
objective: degraded ? opportunity.degradedActionPrompt : opportunity.actionPrompt,
|
|
46
|
+
expectedOutputs: [opportunity.outcome],
|
|
47
|
+
acceptanceCriteria: opportunity.verification,
|
|
48
|
+
constraints: degraded ? ["Use only currently available capabilities and the attached evidence."] : [],
|
|
49
|
+
approvalRequired: [],
|
|
50
|
+
assumptions: [],
|
|
51
|
+
risks: [opportunity.risk],
|
|
52
|
+
acceptancePolicy: "verified_then_review",
|
|
53
|
+
outputDestinations: []
|
|
54
|
+
},
|
|
55
|
+
dependencies: [],
|
|
56
|
+
context: opportunity.evidence.map((item) => ({
|
|
57
|
+
targetKind: item.sourceType === "file" ? "file" : "source",
|
|
58
|
+
targetId: item.sourceRef,
|
|
59
|
+
role: "evidence",
|
|
60
|
+
title: item.observation.slice(0, 200),
|
|
61
|
+
pinned: true,
|
|
62
|
+
retrievalPolicy: {},
|
|
63
|
+
metadata: {
|
|
64
|
+
evidenceId: item.id,
|
|
65
|
+
revision: item.revision
|
|
66
|
+
}
|
|
67
|
+
})),
|
|
68
|
+
authorityGrants: [],
|
|
69
|
+
activation: {
|
|
70
|
+
mode: "start",
|
|
71
|
+
executor: {
|
|
72
|
+
kind: "agent",
|
|
73
|
+
agentId
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}, { kind: "user" });
|
|
77
|
+
if (created.ok === false) throw new HomeOpportunityActionError(`Could not start task: ${created.reason}`);
|
|
78
|
+
const task = created.model.task;
|
|
79
|
+
this.repository.recordFeedback(this.principal, input.opportunityId, {
|
|
80
|
+
idempotencyKey: input.idempotencyKey,
|
|
81
|
+
kind: "started",
|
|
82
|
+
expectedRevision: input.expectedRevision,
|
|
83
|
+
createdAt: input.now,
|
|
84
|
+
resolution: {
|
|
85
|
+
kind: "task",
|
|
86
|
+
ref: task.id
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return {
|
|
90
|
+
outcome: "task",
|
|
91
|
+
taskId: task.id,
|
|
92
|
+
href: `/tasks/${encodeURIComponent(task.id)}`
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
discuss(input) {
|
|
97
|
+
const replay = this.repository.isFeedbackRecorded(input.opportunityId, input.idempotencyKey);
|
|
98
|
+
const opportunity = replay ? this.repository.getOpportunitySnapshot(this.principal, input.opportunityId) : this.repository.getOpportunity(this.principal, input.opportunityId, input.now);
|
|
99
|
+
if (!opportunity) throw new HomeOpportunityNotFoundError("Home opportunity is unavailable");
|
|
100
|
+
if (!replay) {
|
|
101
|
+
if (opportunity.revision !== input.expectedRevision) throw new HomeOpportunityActionError("Home opportunity changed; refresh before discussing");
|
|
102
|
+
this.repository.recordFeedback(this.principal, input.opportunityId, {
|
|
103
|
+
idempotencyKey: input.idempotencyKey,
|
|
104
|
+
kind: "discussed",
|
|
105
|
+
expectedRevision: input.expectedRevision,
|
|
106
|
+
createdAt: input.now,
|
|
107
|
+
resolution: {
|
|
108
|
+
kind: "session",
|
|
109
|
+
ref: "draft"
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const query = new URLSearchParams({ draft: opportunity.actionPrompt });
|
|
114
|
+
if (opportunity.projectId) query.set("projectId", opportunity.projectId);
|
|
115
|
+
return {
|
|
116
|
+
outcome: "chat_draft",
|
|
117
|
+
href: `/chat/new?${query.toString()}`
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
feedback(opportunityId, input) {
|
|
121
|
+
if (this.repository.isFeedbackRecorded(opportunityId, input.idempotencyKey)) return;
|
|
122
|
+
const opportunity = this.repository.getOpportunity(this.principal, opportunityId, input.createdAt);
|
|
123
|
+
if (!opportunity) throw new HomeOpportunityNotFoundError("Home opportunity is unavailable");
|
|
124
|
+
this.repository.recordFeedback(this.principal, opportunityId, {
|
|
125
|
+
...input,
|
|
126
|
+
scope: input.scope ?? {
|
|
127
|
+
kind: opportunity.kind,
|
|
128
|
+
projectId: opportunity.projectId
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
//#endregion
|
|
134
|
+
export { HomeOpportunityActionError, HomeOpportunityApplicationService, HomeOpportunityNotFoundError };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { HomeCapabilityPreflight, HomeCapabilityReadiness } from '@xopcai/gateway-contract';
|
|
2
|
+
import type { Config } from '../config/schema.js';
|
|
3
|
+
import type { AgentSkillUnavailableReason } from '../agent/agent-manager.js';
|
|
4
|
+
import type { HomeCapabilityInventory } from './types.js';
|
|
5
|
+
export interface HomeCapabilityRequirement {
|
|
6
|
+
kind: 'connector' | 'skill' | 'agent';
|
|
7
|
+
capability: string;
|
|
8
|
+
required: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface HomeSkillAvailability {
|
|
11
|
+
name: string;
|
|
12
|
+
availableForCurrentAgent: boolean;
|
|
13
|
+
unavailableReason: AgentSkillUnavailableReason | null;
|
|
14
|
+
}
|
|
15
|
+
export interface HomeCapabilityResolution {
|
|
16
|
+
capabilities: HomeCapabilityReadiness[];
|
|
17
|
+
preflight: HomeCapabilityPreflight;
|
|
18
|
+
}
|
|
19
|
+
export interface HomeCapabilityPreflightDeps {
|
|
20
|
+
config(): Config;
|
|
21
|
+
agentId(): string;
|
|
22
|
+
skills(agentId: string): HomeSkillAvailability[];
|
|
23
|
+
principalId: string;
|
|
24
|
+
}
|
|
25
|
+
export declare class HomeCapabilityPreflightService {
|
|
26
|
+
private readonly deps;
|
|
27
|
+
constructor(deps: HomeCapabilityPreflightDeps);
|
|
28
|
+
inventory(): HomeCapabilityInventory;
|
|
29
|
+
resolve(requirements: readonly HomeCapabilityRequirement[], options?: {
|
|
30
|
+
degradedActionAvailable?: boolean;
|
|
31
|
+
}): HomeCapabilityResolution;
|
|
32
|
+
}
|