@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
|
@@ -1,15 +1,104 @@
|
|
|
1
|
+
import { HomeAdviceMetricsSchema, HomeAdvisorRefreshRequestSchema, HomeOpportunityActionRequestSchema, HomeOpportunityFeedbackRequestSchema, HomeOpportunityFeedbackUndoRequestSchema, HomeOpportunityHistoryResponseSchema } from "../../../../packages/gateway-contract/src/home.js";
|
|
2
|
+
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
1
3
|
import { acknowledgeHomeAttention } from "../../../storage/sqlite/home-attention-repository.js";
|
|
2
4
|
import { decideConnectorApproval } from "../../../storage/sqlite/connector-repository.js";
|
|
3
|
-
import "../../../storage/sqlite/index.js";
|
|
5
|
+
import { init_sqlite } from "../../../storage/sqlite/index.js";
|
|
4
6
|
import { listGatewayAgents } from "../../agents-admin.js";
|
|
5
7
|
import { HomeQueryService, buildHomeWorkbench, decisionFromTask } from "../../../tasks/home-query-service.js";
|
|
6
8
|
import { resumeApprovedConnectorAction } from "../../../connectors/approval-resume.js";
|
|
9
|
+
import { HomeOpportunityActionError, HomeOpportunityNotFoundError } from "../../../home-intelligence/application-service.js";
|
|
7
10
|
//#region src/gateway/hono/routes/home.ts
|
|
11
|
+
init_src();
|
|
12
|
+
init_sqlite();
|
|
8
13
|
/** Register the unified work-home read model and its decision actions. */
|
|
9
14
|
function registerHomeRoutes(authenticated, deps) {
|
|
10
15
|
const { service } = deps;
|
|
11
|
-
const home = new HomeQueryService(service);
|
|
12
|
-
authenticated.get("/api/home", async (c) =>
|
|
16
|
+
const home = new HomeQueryService(service, () => service.homeIntelligence.getAdvisor());
|
|
17
|
+
authenticated.get("/api/home", async (c) => {
|
|
18
|
+
const locale = c.req.query("locale");
|
|
19
|
+
service.homeIntelligence.requestRefresh("home_opened", void 0, locale);
|
|
20
|
+
return c.json(await home.getSnapshot(locale));
|
|
21
|
+
});
|
|
22
|
+
authenticated.get("/api/home/advisor/metrics", (c) => {
|
|
23
|
+
const rawSince = c.req.query("since");
|
|
24
|
+
const since = rawSince === void 0 ? void 0 : Number(rawSince);
|
|
25
|
+
if (since !== void 0 && (!Number.isSafeInteger(since) || since < 0)) return c.json({
|
|
26
|
+
ok: false,
|
|
27
|
+
error: "since must be a non-negative integer timestamp"
|
|
28
|
+
}, 400);
|
|
29
|
+
return c.json(HomeAdviceMetricsSchema.parse(service.homeIntelligence.getMetrics(since)));
|
|
30
|
+
});
|
|
31
|
+
authenticated.get("/api/home/advisor/history", (c) => c.json(HomeOpportunityHistoryResponseSchema.parse({ items: service.homeIntelligence.getHistory() })));
|
|
32
|
+
authenticated.post("/api/home/advisor/refresh", deps.strictRateLimitMiddleware, async (c) => {
|
|
33
|
+
const parsed = HomeAdvisorRefreshRequestSchema.safeParse(await c.req.json().catch(() => ({})));
|
|
34
|
+
if (!parsed.success) return c.json({
|
|
35
|
+
ok: false,
|
|
36
|
+
error: "Invalid refresh request"
|
|
37
|
+
}, 400);
|
|
38
|
+
const generationId = service.homeIntelligence.requestRefresh("manual_refresh", parsed.data.idempotencyKey, parsed.data.locale);
|
|
39
|
+
return c.json({
|
|
40
|
+
ok: true,
|
|
41
|
+
generationId
|
|
42
|
+
}, 202);
|
|
43
|
+
});
|
|
44
|
+
authenticated.post("/api/home/opportunities/:id/action", deps.strictRateLimitMiddleware, async (c) => {
|
|
45
|
+
const parsed = HomeOpportunityActionRequestSchema.safeParse(await c.req.json().catch(() => ({})));
|
|
46
|
+
if (!parsed.success) return c.json({
|
|
47
|
+
ok: false,
|
|
48
|
+
error: "Invalid opportunity action"
|
|
49
|
+
}, 400);
|
|
50
|
+
try {
|
|
51
|
+
return c.json(service.homeIntelligence.act(c.req.param("id"), parsed.data));
|
|
52
|
+
} catch (error) {
|
|
53
|
+
if (error instanceof HomeOpportunityNotFoundError) return c.json({
|
|
54
|
+
ok: false,
|
|
55
|
+
error: error.message
|
|
56
|
+
}, 404);
|
|
57
|
+
if (error instanceof HomeOpportunityActionError || error instanceof Error && error.message.includes("stale")) return c.json({
|
|
58
|
+
ok: false,
|
|
59
|
+
error: error.message
|
|
60
|
+
}, 409);
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
authenticated.post("/api/home/opportunities/:id/feedback", deps.strictRateLimitMiddleware, async (c) => {
|
|
65
|
+
const parsed = HomeOpportunityFeedbackRequestSchema.safeParse(await c.req.json().catch(() => ({})));
|
|
66
|
+
if (!parsed.success) return c.json({
|
|
67
|
+
ok: false,
|
|
68
|
+
error: "Invalid opportunity feedback"
|
|
69
|
+
}, 400);
|
|
70
|
+
try {
|
|
71
|
+
service.homeIntelligence.feedback(c.req.param("id"), parsed.data);
|
|
72
|
+
return c.json({ ok: true });
|
|
73
|
+
} catch (error) {
|
|
74
|
+
if (error instanceof HomeOpportunityNotFoundError) return c.json({
|
|
75
|
+
ok: false,
|
|
76
|
+
error: error.message
|
|
77
|
+
}, 404);
|
|
78
|
+
if (error instanceof Error && (error.message.includes("stale") || error.message.includes("snoozedUntil"))) return c.json({
|
|
79
|
+
ok: false,
|
|
80
|
+
error: error.message
|
|
81
|
+
}, 409);
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
authenticated.post("/api/home/opportunities/:id/feedback/undo", deps.strictRateLimitMiddleware, async (c) => {
|
|
86
|
+
const parsed = HomeOpportunityFeedbackUndoRequestSchema.safeParse(await c.req.json().catch(() => ({})));
|
|
87
|
+
if (!parsed.success) return c.json({
|
|
88
|
+
ok: false,
|
|
89
|
+
error: "Invalid feedback undo request"
|
|
90
|
+
}, 400);
|
|
91
|
+
try {
|
|
92
|
+
service.homeIntelligence.undoFeedback(c.req.param("id"), parsed.data.idempotencyKey);
|
|
93
|
+
return c.json({ ok: true });
|
|
94
|
+
} catch (error) {
|
|
95
|
+
if (error instanceof Error) return c.json({
|
|
96
|
+
ok: false,
|
|
97
|
+
error: error.message
|
|
98
|
+
}, 409);
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
13
102
|
authenticated.post("/api/home/decisions/respond", deps.strictRateLimitMiddleware, async (c) => {
|
|
14
103
|
const body = await c.req.json().catch(() => ({}));
|
|
15
104
|
const decision = body.decision === "approve" ? "approve" : body.decision === "deny" ? "deny" : void 0;
|
|
@@ -74,7 +163,7 @@ function registerHomeRoutes(authenticated, deps) {
|
|
|
74
163
|
error: error instanceof Error ? error.message : "Failed to retry automation"
|
|
75
164
|
}, 400);
|
|
76
165
|
}
|
|
77
|
-
const agents = await listGatewayAgents(
|
|
166
|
+
const agents = await listGatewayAgents();
|
|
78
167
|
const result = await service.createWorkflowRunService().retryWorkflowRun({
|
|
79
168
|
agentId: agents.defaultId,
|
|
80
169
|
runId
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getInteractionState, setInteractionState } from "../../../storage/sqlite/interaction-state-repository.js";
|
|
2
|
-
import "../../../storage/sqlite/index.js";
|
|
2
|
+
import { init_sqlite } from "../../../storage/sqlite/index.js";
|
|
3
3
|
//#region src/gateway/hono/routes/interaction-state.ts
|
|
4
|
+
init_sqlite();
|
|
4
5
|
const SUPPORT_NEEDS = new Set([
|
|
5
6
|
"listen",
|
|
6
7
|
"clarify",
|
|
@@ -14,7 +14,7 @@ import { getImageGenerationProvider, reloadImageGenerationProviders, resolveImag
|
|
|
14
14
|
import { SessionConfigStore } from "../../../session/config-store.js";
|
|
15
15
|
import { getModelThinking } from "../../../providers/model-thinking.js";
|
|
16
16
|
import { deleteCustomImageProvider, listCustomImageProviders, upsertCustomImageProvider } from "../../custom-image-providers.js";
|
|
17
|
-
import { getAgentImageGenerationConfig, getDefaultImageGenerationConfig, getImageGenerationCatalog, prepareDefaultImageGenerationSetup, prepareImageGenerationSetup, verifyImageGenerationCredential } from "../../image-generation-setup.js";
|
|
17
|
+
import { applyImageGenerationCatalogUpdate, getAgentImageGenerationConfig, getDefaultImageGenerationConfig, getImageGenerationCatalog, prepareDefaultImageGenerationSetup, prepareImageGenerationSetup, verifyImageGenerationCredential } from "../../image-generation-setup.js";
|
|
18
18
|
import { discoverProviderModels, isProviderApiDiscoverable } from "../../../providers/model-discovery.js";
|
|
19
19
|
import { getXopcCloudCatalogCoordinator } from "../../../providers/xopc-cloud-catalog-coordinator.js";
|
|
20
20
|
import { respondStartupUnavailable } from "../lib/startup-unavailable.js";
|
|
@@ -141,8 +141,7 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
141
141
|
});
|
|
142
142
|
authenticated.get("/api/models/catalog", async (c) => {
|
|
143
143
|
const catalog = getModelCatalogStore().load();
|
|
144
|
-
const
|
|
145
|
-
const references = auditModelReferences(service.currentConfig, sessionConfigs, { catalog });
|
|
144
|
+
const references = auditModelReferences(await new SessionConfigStore("").getAll(), { catalog });
|
|
146
145
|
return c.json({
|
|
147
146
|
ok: true,
|
|
148
147
|
payload: {
|
|
@@ -515,7 +514,7 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
515
514
|
});
|
|
516
515
|
authenticated.get("/api/image-generation/default", (c) => c.json({
|
|
517
516
|
ok: true,
|
|
518
|
-
payload: getDefaultImageGenerationConfig(
|
|
517
|
+
payload: getDefaultImageGenerationConfig()
|
|
519
518
|
}));
|
|
520
519
|
authenticated.post("/api/image-generation/default/setup", strictRateLimitMiddleware, async (c) => {
|
|
521
520
|
const body = await c.req.json().catch(() => null);
|
|
@@ -563,10 +562,11 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
563
562
|
error: { message: saved.error ?? "Failed to save configuration" }
|
|
564
563
|
}, 500);
|
|
565
564
|
}
|
|
565
|
+
await applyImageGenerationCatalogUpdate(prepared.catalogUpdate);
|
|
566
566
|
return c.json({
|
|
567
567
|
ok: true,
|
|
568
568
|
payload: {
|
|
569
|
-
default: getDefaultImageGenerationConfig(
|
|
569
|
+
default: getDefaultImageGenerationConfig(),
|
|
570
570
|
providers: getImageGenerationCatalog(service.currentConfig),
|
|
571
571
|
verification
|
|
572
572
|
}
|
|
@@ -576,7 +576,7 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
576
576
|
try {
|
|
577
577
|
return c.json({
|
|
578
578
|
ok: true,
|
|
579
|
-
payload: getAgentImageGenerationConfig(
|
|
579
|
+
payload: getAgentImageGenerationConfig(c.req.param("agentId"))
|
|
580
580
|
});
|
|
581
581
|
} catch (error) {
|
|
582
582
|
return c.json({
|
|
@@ -631,10 +631,11 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
631
631
|
error: { message: saved.error ?? "Failed to save configuration" }
|
|
632
632
|
}, 500);
|
|
633
633
|
}
|
|
634
|
+
await applyImageGenerationCatalogUpdate(prepared.catalogUpdate);
|
|
634
635
|
return c.json({
|
|
635
636
|
ok: true,
|
|
636
637
|
payload: {
|
|
637
|
-
agent: getAgentImageGenerationConfig(
|
|
638
|
+
agent: getAgentImageGenerationConfig(c.req.param("agentId")),
|
|
638
639
|
providers: getImageGenerationCatalog(service.currentConfig),
|
|
639
640
|
verification
|
|
640
641
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { NoteDeleteOutputSchema, NoteGetOutputSchema, ProductReadContracts } from "../../../../packages/gateway-contract/src/capabilities.js";
|
|
2
2
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { init_session_key, resolveConversationId } from "../../../routing/session-key.js";
|
|
4
|
-
import { agentExists, getDefaultAgentId, init_resolve_route } from "../../../routing/resolve-route.js";
|
|
5
3
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
6
4
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
5
|
+
import { init_session_key, resolveConversationId } from "../../../routing/session-key.js";
|
|
6
|
+
import { agentExists, getDefaultAgentId, init_resolve_route } from "../../../routing/resolve-route.js";
|
|
7
7
|
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
8
8
|
import { getShareStore } from "../../../share/share-store.js";
|
|
9
9
|
import { resolveShareUrl } from "../../../share/share-url.js";
|
|
@@ -248,12 +248,11 @@ function registerNotesRoutes(authenticated, deps) {
|
|
|
248
248
|
const note = await service.notesServiceInstance.getNote(noteId);
|
|
249
249
|
if (!note) return c.json(noteNotFound(), 404);
|
|
250
250
|
const body = await c.req.json().catch(() => ({}));
|
|
251
|
-
const routingCfg = service.currentConfig;
|
|
252
251
|
const projectId = typeof body.projectId === "string" ? body.projectId.trim() : void 0;
|
|
253
252
|
const project = projectId ? service.projects.get(projectId) : void 0;
|
|
254
253
|
if (projectId && !project) return c.json({ error: "Project not found" }, 400);
|
|
255
|
-
let agentId = typeof body.agentId === "string" && body.agentId.trim() ? body.agentId.trim().toLowerCase() : project?.defaultAgentId ?? getDefaultAgentId(
|
|
256
|
-
if (!agentExists(agentId
|
|
254
|
+
let agentId = typeof body.agentId === "string" && body.agentId.trim() ? body.agentId.trim().toLowerCase() : project?.defaultAgentId ?? getDefaultAgentId();
|
|
255
|
+
if (!agentExists(agentId)) agentId = getDefaultAgentId();
|
|
257
256
|
const sourceBinding = {
|
|
258
257
|
kind: "note",
|
|
259
258
|
sourceId: noteId,
|
|
@@ -4,15 +4,15 @@ import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
|
4
4
|
import { TaskRepository } from "../../../tasks/task-repository.js";
|
|
5
5
|
import { getSessionMetadata } from "../../../storage/sqlite/session-read-repository.js";
|
|
6
6
|
import { loadTranscriptRowsForSession } from "../../../storage/sqlite/transcript-repository.js";
|
|
7
|
-
import "../../../storage/sqlite/index.js";
|
|
7
|
+
import { init_sqlite } from "../../../storage/sqlite/index.js";
|
|
8
8
|
import { ActivityService } from "../../../activity/service.js";
|
|
9
9
|
import "../../../activity/index.js";
|
|
10
|
+
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
11
|
+
import "../../../capabilities/runtime/dispatcher.js";
|
|
10
12
|
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
11
13
|
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
12
14
|
import { listKnowledgeItems, writeKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
13
15
|
import "../../../knowledge-memory/index.js";
|
|
14
|
-
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
15
|
-
import "../../../capabilities/runtime/dispatcher.js";
|
|
16
16
|
import { ProjectWorkspaceConflictError, ProjectWorkspaceMissingError } from "../../../projects/workspace-project.js";
|
|
17
17
|
import { inferProjectExecutionMode, inferProjectKind } from "../../../projects/project-kind.js";
|
|
18
18
|
import { ProjectDeletionBlockedError, ProjectWorkspaceInUseError } from "../../../projects/project-service.js";
|
|
@@ -30,6 +30,7 @@ import { capabilityHttpContext, capabilityHttpError } from "../../../capabilitie
|
|
|
30
30
|
import { randomUUID } from "node:crypto";
|
|
31
31
|
//#region src/gateway/hono/routes/projects.ts
|
|
32
32
|
init_src();
|
|
33
|
+
init_sqlite();
|
|
33
34
|
function projectWriteError(c, error) {
|
|
34
35
|
const cause = error instanceof CapabilityError ? error.cause : error;
|
|
35
36
|
if (cause instanceof ProjectWorkspaceConflictError) return c.json({
|
|
@@ -63,12 +64,11 @@ function textField(body, key) {
|
|
|
63
64
|
function resolveEffectiveWorkspaceRoot(service, project) {
|
|
64
65
|
const fixedRoot = project.workspaceRoot?.trim();
|
|
65
66
|
if (fixedRoot) return fixedRoot;
|
|
66
|
-
|
|
67
|
+
return resolveEffectiveAgentProfile(resolveProjectAgentId({
|
|
67
68
|
config: service.currentConfig,
|
|
68
69
|
projects: service.projects,
|
|
69
70
|
projectId: project.id
|
|
70
|
-
});
|
|
71
|
-
return resolveEffectiveAgentProfile(service.currentConfig, agentId).resolvedWorkspacePath;
|
|
71
|
+
})).resolvedWorkspacePath;
|
|
72
72
|
}
|
|
73
73
|
function enrichProjectWorkspace(service, project) {
|
|
74
74
|
return {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, init_package_version } from "../../../package-version.js";
|
|
2
2
|
import { claimConnectorWebhookDelivery, completeConnectorWebhookDelivery, releaseConnectorWebhookDelivery } from "../../../storage/sqlite/connector-repository.js";
|
|
3
|
-
import "../../../storage/sqlite/index.js";
|
|
3
|
+
import { init_sqlite } from "../../../storage/sqlite/index.js";
|
|
4
4
|
import { composioLogoResponse } from "../../../connectors/composio-logo.js";
|
|
5
5
|
import { appendComposioTriggerEvent, applyComposioConnectionLifecycleEvent, normalizeComposioTriggerPayload, verifyComposioWebhook } from "../../../connectors/composio-triggers.js";
|
|
6
6
|
import { serveStaticFile } from "../lib/static-ui.js";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
//#region src/gateway/hono/routes/public-gateway.ts
|
|
9
9
|
init_package_version();
|
|
10
|
+
init_sqlite();
|
|
10
11
|
const PUBLIC_UI_ROOT_ASSETS = [
|
|
11
12
|
"apple-touch-icon.png",
|
|
12
13
|
"favicon-16x16.png",
|
|
@@ -4,9 +4,9 @@ import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packa
|
|
|
4
4
|
import { browserPageContextsInputSchema } from "../../../../packages/gateway-contract/src/browser-page-context.js";
|
|
5
5
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
6
6
|
import { endpointTurnClaimSchema, init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
7
|
-
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
8
7
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
9
8
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
9
|
+
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
10
10
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
11
11
|
import { isTaskDestructiveCommand } from "../../../session/reset-triggers.js";
|
|
12
12
|
import { parseSlashCommand } from "../../../chat-commands/command-parse.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { deleteBrowserTabBinding } from "../../../storage/sqlite/browser-tab-binding-repository.js";
|
|
1
|
+
import { deleteBrowserTabBinding, init_browser_tab_binding_repository } from "../../../storage/sqlite/browser-tab-binding-repository.js";
|
|
2
2
|
import { conversationIdSchema } from "../../../../packages/gateway-contract/src/conversation-identity.js";
|
|
3
3
|
import { SessionDiscoveryQuerySchema } from "../../../../packages/gateway-contract/src/session-identity.js";
|
|
4
4
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
5
5
|
import "../../../session/types.js";
|
|
6
6
|
import { deleteSessionRecord, init_session_repository } from "../../../storage/sqlite/session-repository.js";
|
|
7
|
-
import { SidebarLayoutConflictError, getSidebarLayout, replaceSidebarLayout, sortBySidebarLayout } from "../../../storage/sqlite/sidebar-layout-repository.js";
|
|
7
|
+
import { SidebarLayoutConflictError, getSidebarLayout, init_sidebar_layout_repository, replaceSidebarLayout, sortBySidebarLayout } from "../../../storage/sqlite/sidebar-layout-repository.js";
|
|
8
8
|
import { ConversationAlreadyExistsError, createConversation, init_conversation_repository } from "../../../storage/sqlite/conversation-repository.js";
|
|
9
9
|
import { resolveProjectAgentId } from "../../../projects/project-agent.js";
|
|
10
10
|
import "../../../projects/index.js";
|
|
@@ -22,6 +22,8 @@ import { randomUUID } from "node:crypto";
|
|
|
22
22
|
init_src();
|
|
23
23
|
init_conversation_repository();
|
|
24
24
|
init_session_repository();
|
|
25
|
+
init_browser_tab_binding_repository();
|
|
26
|
+
init_sidebar_layout_repository();
|
|
25
27
|
const log = createGatewayRouteLogger("Sessions");
|
|
26
28
|
const SESSION_TYPES = new Set([
|
|
27
29
|
"chat",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { loadCompactionSourceSnapshot } from "../../../storage/sqlite/transcript-repository.js";
|
|
2
|
-
import "../../../storage/sqlite/index.js";
|
|
2
|
+
import { init_sqlite } from "../../../storage/sqlite/index.js";
|
|
3
3
|
import { FileServiceError } from "../../../files/file-service.js";
|
|
4
4
|
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
5
5
|
import { SHARE_CONFIG_DEFAULTS } from "../../../share/share-types.js";
|
|
@@ -31,6 +31,7 @@ import { createHash } from "node:crypto";
|
|
|
31
31
|
import { stat } from "node:fs/promises";
|
|
32
32
|
import { Readable } from "node:stream";
|
|
33
33
|
//#region src/gateway/hono/routes/shares.ts
|
|
34
|
+
init_sqlite();
|
|
34
35
|
function getShareUrlContext(service) {
|
|
35
36
|
const gateway = service.currentConfig.gateway;
|
|
36
37
|
return {
|
|
@@ -1894,10 +1895,10 @@ async function resolveWorkspaceRootForShare(service, conversationId, agentId) {
|
|
|
1894
1895
|
} catch {}
|
|
1895
1896
|
const { getWorkspacePath } = await import("../../../config/workspace-path-helpers.js");
|
|
1896
1897
|
const { resolveAgentWorkspaceDir, normalizeAgentId, resolveDefaultAgentId } = await import("../../../agent/agent-scope.js");
|
|
1897
|
-
if (agentId) return resolveAgentWorkspaceDir(
|
|
1898
|
+
if (agentId) return resolveAgentWorkspaceDir(normalizeAgentId(agentId));
|
|
1898
1899
|
const root = getWorkspacePath(cfg);
|
|
1899
1900
|
if (root) return root;
|
|
1900
|
-
return resolveAgentWorkspaceDir(
|
|
1901
|
+
return resolveAgentWorkspaceDir(resolveDefaultAgentId());
|
|
1901
1902
|
}
|
|
1902
1903
|
async function handleFileDownload(c, store, record, clientIp, inline = false) {
|
|
1903
1904
|
if (!acquireDownloadSlot(record.token)) return new Response("Too many concurrent downloads for this share", { status: 429 });
|
|
@@ -36,10 +36,10 @@ function registerSiteShareRoutes(authenticated, deps) {
|
|
|
36
36
|
} catch {}
|
|
37
37
|
const { getWorkspacePath } = await import("../../../config/workspace-path-helpers.js");
|
|
38
38
|
const { resolveAgentWorkspaceDir, normalizeAgentId, resolveDefaultAgentId } = await import("../../../agent/agent-scope.js");
|
|
39
|
-
if (agentId) return resolveAgentWorkspaceDir(
|
|
39
|
+
if (agentId) return resolveAgentWorkspaceDir(normalizeAgentId(agentId));
|
|
40
40
|
const root = getWorkspacePath(cfg);
|
|
41
41
|
if (root) return root;
|
|
42
|
-
return resolveAgentWorkspaceDir(
|
|
42
|
+
return resolveAgentWorkspaceDir(resolveDefaultAgentId());
|
|
43
43
|
}
|
|
44
44
|
authenticated.post("/api/site-shares", async (c) => {
|
|
45
45
|
const principalId = getGatewayPrincipal(c).principalId;
|
|
@@ -15,13 +15,12 @@ function contentHash(value) {
|
|
|
15
15
|
return createHash("sha256").update(JSON.stringify(stableValue(value))).digest("hex");
|
|
16
16
|
}
|
|
17
17
|
function buildEvalRuntimeIdentity(service, agentId) {
|
|
18
|
-
|
|
19
|
-
if (!config) return {
|
|
18
|
+
if (!service.currentConfig) return {
|
|
20
19
|
ok: false,
|
|
21
20
|
error: "Gateway configuration is unavailable",
|
|
22
21
|
status: 503
|
|
23
22
|
};
|
|
24
|
-
const effective = getGatewayAgentEffectiveConfig(
|
|
23
|
+
const effective = getGatewayAgentEffectiveConfig(agentId);
|
|
25
24
|
if ("error" in effective) return {
|
|
26
25
|
ok: false,
|
|
27
26
|
error: effective.error,
|
|
@@ -5,9 +5,9 @@ import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
|
5
5
|
import { enqueueTaskChangedEvent, init_task_change_events } from "../../../tasks/task-change-events.js";
|
|
6
6
|
import { TaskRepository, init_task_repository } from "../../../tasks/task-repository.js";
|
|
7
7
|
import { TaskRunRepository, init_task_run_repository } from "../../../tasks/task-run-repository.js";
|
|
8
|
-
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
9
8
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
10
9
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
10
|
+
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
11
11
|
import { TaskContextMutationOutputSchema } from "../../../tasks/capabilities/relations.js";
|
|
12
12
|
import { TaskDeleteOutputSchema } from "../../../tasks/capabilities/management.js";
|
|
13
13
|
import { TaskMutationOutputSchema } from "../../../tasks/capabilities/write.js";
|
|
@@ -49,7 +49,6 @@ function registerTaskRoutes(authenticated, deps) {
|
|
|
49
49
|
const conversations = new TaskConversationRepository();
|
|
50
50
|
const conversationQuery = new TaskConversationQueryService(deps.service.sessions);
|
|
51
51
|
const handoffs = new TaskHandoffService({
|
|
52
|
-
getConfig: () => deps.service.currentConfig,
|
|
53
52
|
sessionIndex: deps.service.sessionIndexInstance,
|
|
54
53
|
getActiveRunId: (conversationId) => deps.service.getActiveWebchatRunId(conversationId),
|
|
55
54
|
abortRun: (runId) => deps.service.abortAgentRun(runId)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { listConnectorLearningJobs } from "../../../storage/sqlite/connector-learning-repository.js";
|
|
2
2
|
import { getConnectorAccount } from "../../../storage/sqlite/connector-account-repository.js";
|
|
3
|
-
import "../../../storage/sqlite/index.js";
|
|
3
|
+
import { init_sqlite } from "../../../storage/sqlite/index.js";
|
|
4
4
|
import { getWorkDiscoveryRun } from "../../../work-discovery/repository.js";
|
|
5
5
|
import { getConnectorUnderstandingSourceRun } from "../../../user-context/sources/repository.js";
|
|
6
6
|
import { isLocalUnderstandingSourceId } from "../../../user-context/sources/local-source-contract.js";
|
|
@@ -8,6 +8,7 @@ import { normalizeUnderstandingSourceItems } from "../../../work-discovery/servi
|
|
|
8
8
|
import { UnderstandingRefreshService } from "../../../user-context/sources/refresh-service.js";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
10
|
//#region src/gateway/hono/routes/user-model-refresh.ts
|
|
11
|
+
init_sqlite();
|
|
11
12
|
function createUnderstandingRefreshService(deps) {
|
|
12
13
|
const service = deps.service;
|
|
13
14
|
return new UnderstandingRefreshService({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { init_transaction, runSqliteWriteTransaction } from "../../../storage/sqlite/transaction.js";
|
|
2
|
-
import { createCollaborationRule, getCollaborationRule, listCollaborationRules, setCollaborationRuleStatus } from "../../../storage/sqlite/collaboration-rule-repository.js";
|
|
2
|
+
import { createCollaborationRule, getCollaborationRule, init_collaboration_rule_repository, listCollaborationRules, setCollaborationRuleStatus } from "../../../storage/sqlite/collaboration-rule-repository.js";
|
|
3
3
|
import { KnowledgeReviewConflictError, deleteKnowledgeItem, getKnowledgeItem, listKnowledgeItems, reviewKnowledgeItem, searchKnowledgeItems } from "../../../knowledge-memory/repository.js";
|
|
4
4
|
import "../../../knowledge-memory/index.js";
|
|
5
5
|
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus, updatePriorityWindow, updateUserGoal } from "../../../user-model/goals.js";
|
|
@@ -15,6 +15,7 @@ import { listUnderstandingSourceGrants } from "../../../user-context/sources/rep
|
|
|
15
15
|
import { userInfo } from "node:os";
|
|
16
16
|
//#region src/gateway/hono/routes/user-model.ts
|
|
17
17
|
init_transaction();
|
|
18
|
+
init_collaboration_rule_repository();
|
|
18
19
|
function object(value) {
|
|
19
20
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
20
21
|
}
|
|
@@ -105,7 +106,7 @@ const RULE_CATEGORIES = new Set([
|
|
|
105
106
|
"execution",
|
|
106
107
|
"boundary",
|
|
107
108
|
"routine",
|
|
108
|
-
"
|
|
109
|
+
"initiative"
|
|
109
110
|
]);
|
|
110
111
|
const RULE_STATUSES = new Set([
|
|
111
112
|
"active",
|
|
@@ -39,7 +39,7 @@ function registerWorkDiscoveryRoutes(authenticated, deps) {
|
|
|
39
39
|
}, 400);
|
|
40
40
|
try {
|
|
41
41
|
const preview = await previewWorkDiscoveryRoot(rootPath);
|
|
42
|
-
const modelRef = getAgentDefaultModelRef(
|
|
42
|
+
const modelRef = getAgentDefaultModelRef();
|
|
43
43
|
if (!modelRef) return c.json({
|
|
44
44
|
ok: false,
|
|
45
45
|
error: "No default model configured"
|
|
@@ -514,10 +514,10 @@ function buildWorkflowRunComparison(sourceView, replayView) {
|
|
|
514
514
|
targetAgents
|
|
515
515
|
};
|
|
516
516
|
}
|
|
517
|
-
function getAgentId(rawAgentId,
|
|
517
|
+
function getAgentId(rawAgentId, _config) {
|
|
518
518
|
const trimmed = rawAgentId?.trim();
|
|
519
519
|
if (trimmed) return trimmed;
|
|
520
|
-
return resolveDefaultAgentId(
|
|
520
|
+
return resolveDefaultAgentId();
|
|
521
521
|
}
|
|
522
522
|
function buildWorkflowStats(runs) {
|
|
523
523
|
const activeStatuses = new Set(["queued", "running"]);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { listImageGenerationProvidersSummary } from '../agent/image/generation/provider-registry.js';
|
|
2
|
+
import type { AgentModelsDefaults } from '../agent-config/index.js';
|
|
2
3
|
import { type Config } from '../config/schema.js';
|
|
3
4
|
export type ImageGenerationSetupInput = {
|
|
4
5
|
providerId: string;
|
|
@@ -10,7 +11,7 @@ export type ImageGenerationCatalogItem = ReturnType<typeof listImageGenerationPr
|
|
|
10
11
|
config: Record<string, string>;
|
|
11
12
|
};
|
|
12
13
|
export declare function getImageGenerationCatalog(config: Config): ImageGenerationCatalogItem[];
|
|
13
|
-
export declare function getAgentImageGenerationConfig(
|
|
14
|
+
export declare function getAgentImageGenerationConfig(agentIdRaw: string): {
|
|
14
15
|
agentId: string;
|
|
15
16
|
model: {
|
|
16
17
|
primary: string;
|
|
@@ -19,7 +20,7 @@ export declare function getAgentImageGenerationConfig(config: Config, agentIdRaw
|
|
|
19
20
|
timeoutMs?: number;
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
|
-
export declare function getDefaultImageGenerationConfig(
|
|
23
|
+
export declare function getDefaultImageGenerationConfig(): {
|
|
23
24
|
model: {
|
|
24
25
|
primary: string;
|
|
25
26
|
fallbacks: string[];
|
|
@@ -27,24 +28,31 @@ export declare function getDefaultImageGenerationConfig(config: Config): {
|
|
|
27
28
|
timeoutMs?: number;
|
|
28
29
|
};
|
|
29
30
|
};
|
|
30
|
-
|
|
31
|
+
type ImageGenerationModel = NonNullable<AgentModelsDefaults['imageGeneration']>;
|
|
32
|
+
export type ImageGenerationCatalogUpdate = {
|
|
33
|
+
target: 'defaults';
|
|
34
|
+
model: ImageGenerationModel;
|
|
35
|
+
} | {
|
|
36
|
+
target: 'agent';
|
|
37
|
+
agentId: string;
|
|
38
|
+
model: ImageGenerationModel;
|
|
39
|
+
};
|
|
40
|
+
type PreparedImageGenerationSetup = {
|
|
31
41
|
ok: true;
|
|
32
42
|
config: Config;
|
|
33
43
|
providerId: string;
|
|
34
44
|
modelId: string;
|
|
35
|
-
|
|
45
|
+
catalogUpdate: ImageGenerationCatalogUpdate;
|
|
46
|
+
};
|
|
47
|
+
export declare function prepareDefaultImageGenerationSetup(config: Config, input: ImageGenerationSetupInput): PreparedImageGenerationSetup | {
|
|
36
48
|
ok: false;
|
|
37
49
|
error: string;
|
|
38
50
|
};
|
|
39
|
-
export declare function prepareImageGenerationSetup(config: Config, agentIdRaw: string, input: ImageGenerationSetupInput): {
|
|
40
|
-
ok: true;
|
|
41
|
-
config: Config;
|
|
42
|
-
providerId: string;
|
|
43
|
-
modelId: string;
|
|
44
|
-
} | {
|
|
51
|
+
export declare function prepareImageGenerationSetup(config: Config, agentIdRaw: string, input: ImageGenerationSetupInput): PreparedImageGenerationSetup | {
|
|
45
52
|
ok: false;
|
|
46
53
|
error: string;
|
|
47
54
|
};
|
|
55
|
+
export declare function applyImageGenerationCatalogUpdate(update: ImageGenerationCatalogUpdate): Promise<void>;
|
|
48
56
|
export declare function verifyImageGenerationCredential(input: {
|
|
49
57
|
providerId: string;
|
|
50
58
|
apiKey: string;
|
|
@@ -54,3 +62,4 @@ export declare function verifyImageGenerationCredential(input: {
|
|
|
54
62
|
supported: boolean;
|
|
55
63
|
message?: string;
|
|
56
64
|
}>;
|
|
65
|
+
export {};
|