@xopcai/xopc 0.0.321 → 0.0.324
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/dist/assets/{auth-DKo-NMUY.js → auth-DocRzRlS.js} +95 -21
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +18 -2
- 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-C69p1Gbr.js → agent-avatar-dicebear-B-Gczr_A.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CxcIHW_Z.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CNuqJcHQ.js +1 -0
- package/dist/gateway/static/root/assets/{agents-CWR3p3t3.js → agents-CPpmkx7O.js} +1 -1
- package/dist/gateway/static/root/assets/{app-link-nL8iPwEr.js → app-link-C6gA5Nck.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-D98bt40S.js → app-management-settings-panel-BwWdVRlb.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-ChMUELAZ.js → appearance-settings-EoXNDO1j.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-6xEgLDv8.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BIIiu6uP.js → archive-plugin-B_T0uMvL.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CDJpcsCp.js → attachment-load-D9DDwxd2.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Cb5a_WOk.js → automations-page-jI9vNr2r.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-rztQnZDk.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-zp55zQPu.js → binary-plugins-Dzsxh9OL.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-B0CTIZb-.js → block-editor-CWUUgWWk.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-Bx3W4J4H.js → browser-automation-inputs-DSWXq9lI.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-D5Lr9b8a.js → browser-automations-page-D96o3bDY.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DUQzQ3ic.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-sAZT4brT.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CKWtXof8.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-C8ducWB7.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-1I1PdIq0.js → chat-terminal-dock-WXZrEB3K.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-BT-EfoI6.js → computer-settings-page-uy9YDwxJ.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-mhQ-19tj.js → connector-service-page-BpF0SjB9.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-eZTfIMWI.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-Do1dl0La.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-DLDLJx3D.js → dependency-picker-BhS8s080.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-kSFeHyrt.js → desktop-pet-DPVPqFlh.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BjY7DqD7.js → desktop-pet-settings-Dv3vG9HZ.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DdvO1O6W.js +1 -0
- package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-DbWJDT4X.js → extension-debug-page-cuG5Lnwf.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-lAC_2xWA.js → extension-page-BCTAXdyE.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-jFy1NJg9.js → extension-settings-page-kadW_icu.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-B7WpH3VW.js → gateway-config-swr-CoQVulMd.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-CLZyN-u9.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-C8F_z865.js → gateway-startup-retry-B5GJ-CQV.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BSqg-JE9.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-Dc7d0_7q.js → image-generation-api-DvWDkbk1.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-_fMvJvzM.js → imports-page-_pddpuej.js} +1 -1
- package/dist/gateway/static/root/assets/index-BKL5tg2f.css +1 -0
- package/dist/gateway/static/root/assets/index-CJuypaNt.js +121 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CHnZYx1U.js → keyboard-shortcuts-settings-C1fKIjz4.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DXFnYiA0.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-Bpja8nC6.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-page-CkXKS5xe.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-D9krC43K.js → locale-store-BPZR8x9b.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-C33z-ife.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-8eDZb0uS.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-CurpvCbB.js → markdown-view-Dft8ASFD.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CYldyH6K.js → media-plugins-Cjj-fidX.js} +1 -1
- package/dist/gateway/static/root/assets/messages-kFWhF6_t.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-C95RtLuL.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-kFxknjMR.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-DZOiI84c.js → page-context-capture-button-OUL3fEYh.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-C-XCf9cR.js → page-tabs-CVbY7_N5.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-CvgeoEU8.js → preview-open-alternatives-CKiIby0r.js} +1 -1
- package/dist/gateway/static/root/assets/product-delivery-bv3z8Xkh.js +1 -0
- package/dist/gateway/static/root/assets/product-open-page-DlpCi5zT.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-LPAxUszX.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-Cbyb4hyy.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-cK-g8BDq.js → registry-api-DWWO6ajd.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BtDFZc6g.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DlUodTo-.js → runtime-tools-settings-panel-BT_ANpaT.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-CJlc-mg1.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-BfboLCeN.js → schema-form-BcqsqSsV.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CUo6-iV2.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-XeSxPjP7.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BytEfCGo.js → settings-form-section-Dol9j_pF.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-Da2ql9KX.js → settings-page-B65vii9U.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-CBfB_7yz.js → settings-page-layout-eqTUTW2L.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BCt__prc.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-B8J0Saj5.js → share-preview-page-BS8o58NJ.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BsjSqEnw.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-evN7gs0S.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-BifYwEhe.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-B53tyGx5.js → skills-page.utils-DOk-iOvN.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-0HAvlVtR.js → system-settings-panel-CcSvoHfY.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-pCRG7Jb3.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-DJsxU6q_.js → tunnel-api-DDGMf44u.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-eIELzAOD.js → use-autosave-DiIkxIq7.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-CvYeM0Ml.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BJ59ZCAn.js → voice-api-key-field-DJV-qERt.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DBXZJWLS.js → voice-config-api-BaxITrwZ.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BpSxdIgB.js → work-discovery-overlay-DcHhy54L.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Bhlv3VUX.js → workflow-run-setup-panel-DbVtLh0R.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CT8ouKcB.js +6 -0
- package/dist/gateway/static/root/index.html +14 -12
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/capabilities.js +4 -110
- package/dist/packages/gateway-contract/src/chat-previews.js +73 -0
- package/dist/packages/gateway-contract/src/home.js +284 -55
- package/dist/packages/gateway-contract/src/index.js +6 -2
- package/dist/packages/gateway-contract/src/local-apps.js +215 -0
- package/dist/packages/gateway-contract/src/notifications.js +3 -10
- package/dist/packages/gateway-contract/src/product-delivery.js +62 -17
- package/dist/packages/gateway-contract/src/user-turn-document.js +60 -0
- package/dist/src/activity/emitter.js +2 -1
- package/dist/src/activity/service.js +2 -1
- package/dist/src/agent/agent-manager.d.ts +4 -2
- package/dist/src/agent/agent-manager.js +37 -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/embedded/transcript-runtime.d.ts +3 -0
- package/dist/src/agent/embedded/transcript-runtime.js +6 -0
- package/dist/src/agent/external-tools/cliProvider.js +6 -2
- package/dist/src/agent/external-tools/composio-provider.js +11 -4
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/external-tools/gateway-tools.js +17 -10
- package/dist/src/agent/external-tools/index.js +2 -3
- package/dist/src/agent/external-tools/mcp-provider.d.ts +3 -1
- package/dist/src/agent/external-tools/mcp-provider.js +93 -8
- package/dist/src/agent/external-tools/service.d.ts +2 -1
- package/dist/src/agent/external-tools/service.js +8 -3
- package/dist/src/agent/external-tools/types.d.ts +9 -0
- 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/mcp/bundle-mcp-config.js +37 -5
- package/dist/src/agent/mcp/bundle-mcp-gateway.d.ts +1 -0
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -0
- package/dist/src/agent/mcp/bundle-mcp-names.js +2 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +33 -1
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +4 -0
- package/dist/src/agent/mcp/index.js +1 -1
- package/dist/src/agent/mcp/mcp-stdio-transport.d.ts +1 -0
- package/dist/src/agent/mcp/mcp-stdio-transport.js +10 -0
- package/dist/src/agent/mcp/mcp-transport.js +12 -8
- package/dist/src/agent/mcp/oauth/index.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.d.ts +6 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +70 -14
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.d.ts +2 -0
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.js +12 -0
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.d.ts +3 -0
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +13 -1
- package/dist/src/agent/mcp/plugin-http-fetch.d.ts +2 -0
- package/dist/src/agent/mcp/plugin-http-fetch.js +56 -0
- 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 +30 -14
- 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 +13 -11
- package/dist/src/agent/service.types.d.ts +4 -0
- package/dist/src/agent/session/session-inspector.js +4 -5
- package/dist/src/agent/skills/hub-pull.js +1 -1
- package/dist/src/agent/skills/index.js +8 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.d.ts +5 -0
- package/dist/src/agent/skills/skill-manager.d.ts +2 -0
- package/dist/src/agent/skills/skill-manager.js +8 -0
- package/dist/src/agent/skills/skill-sources.js +17 -0
- package/dist/src/agent/skills/types.d.ts +3 -1
- package/dist/src/agent/source-context/injector.js +10 -5
- package/dist/src/agent/source-context/types.d.ts +3 -0
- package/dist/src/agent/source-context/types.js +8 -2
- 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 +42 -2
- package/dist/src/agent/tools/automation-tool.js +1 -1
- package/dist/src/agent/tools/delegation-parent-policy.js +2 -3
- package/dist/src/agent/tools/factory.d.ts +3 -0
- package/dist/src/agent/tools/factory.js +12 -10
- package/dist/src/agent/tools/image-generate-tool.js +1 -1
- package/dist/src/agent/tools/workflow-tool.js +3 -4
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.d.ts +5 -2
- package/dist/src/agent/tools/xopc-use-tool.js +171 -15
- 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/index.d.ts +2 -0
- package/dist/src/chat-previews/index.js +3 -0
- package/dist/src/chat-previews/service.d.ts +27 -0
- package/dist/src/chat-previews/service.js +106 -0
- package/dist/src/chat-previews/store.d.ts +28 -0
- package/dist/src/chat-previews/store.js +78 -0
- 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 +1 -0
- 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.d.ts +8 -0
- package/dist/src/cli/commands/extension-agent-plugin.js +81 -0
- package/dist/src/cli/commands/extension-dev.js +2 -4
- package/dist/src/cli/commands/extension-marketplace.js +45 -6
- package/dist/src/cli/commands/extension-pack.js +1 -2
- package/dist/src/cli/commands/extension.js +36 -5
- 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 +17 -25
- 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 +1 -0
- 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/account-selection.js +1 -1
- 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/connection-candidates.d.ts +4 -1
- package/dist/src/connectors/connection-candidates.js +8 -2
- package/dist/src/connectors/connection-capabilities.d.ts +2 -2
- package/dist/src/connectors/connection-capabilities.js +3 -1
- package/dist/src/connectors/connection-recovery-service.d.ts +6 -1
- package/dist/src/connectors/connection-recovery-service.js +138 -26
- package/dist/src/connectors/content-enrichment.js +2 -1
- package/dist/src/connectors/learning-coordinator.js +2 -1
- package/dist/src/connectors/plugin-mcp-recovery.d.ts +28 -0
- package/dist/src/connectors/plugin-mcp-recovery.js +90 -0
- 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/auth.d.ts +39 -0
- package/dist/src/extensions/agent-plugins/auth.js +156 -0
- package/dist/src/extensions/agent-plugins/connection.d.ts +8 -0
- package/dist/src/extensions/agent-plugins/connection.js +41 -0
- package/dist/src/extensions/agent-plugins/health.d.ts +4 -0
- package/dist/src/extensions/agent-plugins/health.js +48 -0
- package/dist/src/extensions/agent-plugins/inventory.d.ts +53 -0
- package/dist/src/extensions/agent-plugins/inventory.js +34 -0
- package/dist/src/extensions/agent-plugins/mcp-adapter.d.ts +3 -0
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +47 -0
- package/dist/src/extensions/agent-plugins/sources.d.ts +5 -0
- package/dist/src/extensions/agent-plugins/sources.js +72 -0
- package/dist/src/extensions/agent-plugins/store.d.ts +61 -0
- package/dist/src/extensions/agent-plugins/store.js +305 -0
- package/dist/src/extensions/agent-plugins/validation.d.ts +59 -0
- package/dist/src/extensions/agent-plugins/validation.js +211 -0
- 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 +2 -3
- 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/chat-stream/mapper.js +10 -3
- 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/agent-plugins.d.ts +3 -0
- package/dist/src/gateway/hono/routes/agent-plugins.js +166 -0
- package/dist/src/gateway/hono/routes/agent-stream.js +14 -0
- package/dist/src/gateway/hono/routes/agents.js +22 -49
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +4 -2
- 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/chat-previews.d.ts +3 -0
- package/dist/src/gateway/hono/routes/chat-previews.js +41 -0
- 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/connection-waits.js +4 -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/index.js +2 -0
- package/dist/src/gateway/hono/routes/interaction-state.js +2 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/local-apps.js +71 -39
- package/dist/src/gateway/hono/routes/mcp.js +48 -21
- 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.d.ts +4 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +23 -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/side-chats.js +11 -0
- 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 +11 -3
- 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.d.ts +1 -0
- package/dist/src/gateway/service/marketplace-service.js +18 -2
- package/dist/src/gateway/service/run-gateway-agent.js +4 -2
- package/dist/src/gateway/service/session-input-coordinator.js +7 -5
- package/dist/src/gateway/service.d.ts +10 -1
- package/dist/src/gateway/service.js +123 -33
- package/dist/src/gateway/session-context-summary.js +4 -2
- package/dist/src/gateway/side-chat/index.d.ts +3 -1
- package/dist/src/gateway/side-chat/index.js +2 -1
- package/dist/src/gateway/side-chat/manager.d.ts +16 -0
- package/dist/src/gateway/side-chat/manager.js +40 -6
- package/dist/src/gateway/side-chat/promotion-service.d.ts +19 -0
- package/dist/src/gateway/side-chat/promotion-service.js +111 -0
- package/dist/src/gateway/side-chat/run-service.js +1 -0
- package/dist/src/gateway/side-chat/types.d.ts +1 -1
- 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/artifact-files.d.ts +3 -0
- package/dist/src/local-apps/artifact-files.js +45 -0
- package/dist/src/local-apps/capabilities/write.js +1 -1
- package/dist/src/local-apps/fix-guidance.d.ts +3 -0
- package/dist/src/local-apps/fix-guidance.js +75 -0
- package/dist/src/local-apps/index.d.ts +2 -1
- package/dist/src/local-apps/scaffold.d.ts +5 -0
- package/dist/src/local-apps/scaffold.js +18 -5
- package/dist/src/local-apps/service.d.ts +18 -3
- package/dist/src/local-apps/service.js +107 -65
- package/dist/src/local-apps/snapshot-store.d.ts +8 -0
- package/dist/src/local-apps/snapshot-store.js +68 -0
- package/dist/src/local-apps/store.js +2 -1
- package/dist/src/local-apps/types.d.ts +4 -87
- 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/client-history.d.ts +3 -1
- package/dist/src/session/client-history.js +10 -3
- package/dist/src/session/config-store.js +2 -1
- package/dist/src/session/index.d.ts +1 -1
- package/dist/src/session/init-session-turn.js +2 -1
- package/dist/src/session/manager.d.ts +4 -0
- package/dist/src/session/manager.js +6 -0
- package/dist/src/session/resolve-session.js +2 -1
- package/dist/src/session/session-context-for-llm.d.ts +12 -1
- package/dist/src/session/session-context-for-llm.js +16 -2
- package/dist/src/session/session-workspace.js +1 -1
- package/dist/src/session/store.d.ts +14 -0
- package/dist/src/session/store.js +20 -2
- package/dist/src/session/stored-rows-to-file-entries.js +10 -1
- package/dist/src/session/transcript-outline.js +10 -3
- 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/connection-wait-repository.js +9 -3
- 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/202_chat_previews.sql +26 -0
- 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/row-mappers.js +6 -1
- 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 +2 -2
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DWLXHWXg.js +0 -1
- package/dist/gateway/static/root/assets/api-Df2D6d3C.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BzytHIn1.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-CtSV8tp-.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-DrvNA-G2.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-D0S3DuAD.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-c0k2virA.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-Bkl9fDHc.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Dw_h-5Qh.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-BqcldZoN.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-C5f4FRpE.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-D7XbH6Hk.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CFJypY6Y.js +0 -1
- package/dist/gateway/static/root/assets/index-B4Vwh0H-.css +0 -1
- package/dist/gateway/static/root/assets/index-BNubE2Zi.js +0 -89
- package/dist/gateway/static/root/assets/local-app-workbench-page-BLKCFXvr.js +0 -2
- package/dist/gateway/static/root/assets/local-apps-page-BNFmOkxs.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-COxOJsgX.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-BX5NtnQ2.js +0 -1
- package/dist/gateway/static/root/assets/messages-B1sTgIrE.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-DZ0IWx1R.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-B9F1uue_.js +0 -8
- package/dist/gateway/static/root/assets/popover-select-B-GDnZO9.js +0 -1
- package/dist/gateway/static/root/assets/product-delivery-chCjIpvu.js +0 -1
- package/dist/gateway/static/root/assets/product-open-page-DEYWx__w.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-9qMDEKVd.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-D4UTOpEm.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CPmOucUB.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-DO8vGorm.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-zu5P0dk5.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-ClEw-i1l.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DElF2sgq.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-MLolJfoV.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DTPsW9TY.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CNQHhsiv.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-Dc30oS9J.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-Bq6ab5WJ.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-Ci-4HAYm.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,9 +1,13 @@
|
|
|
1
|
-
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
1
|
import { init_paths_state, resolveStateDir } from "../../config/paths-state.js";
|
|
3
|
-
import { buildExtensionMetadataSnapshot,
|
|
2
|
+
import { buildExtensionMetadataSnapshot, resolveExtensionLoaderOptionsFromConfig } from "../../extensions/extension-metadata-snapshot.js";
|
|
4
3
|
import { join } from "node:path";
|
|
5
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
6
5
|
//#region src/channels/catalog/channel-catalog-service.ts
|
|
6
|
+
init_paths_state();
|
|
7
|
+
const DEFAULT_CONFIG_SCHEMA = {
|
|
8
|
+
type: "object",
|
|
9
|
+
additionalProperties: true
|
|
10
|
+
};
|
|
7
11
|
function normalizeChannelId(raw) {
|
|
8
12
|
return raw.trim().toLowerCase();
|
|
9
13
|
}
|
|
@@ -282,15 +286,5 @@ function isChannelConfigured(config, channelId) {
|
|
|
282
286
|
function getConfiguredChannelIds(config) {
|
|
283
287
|
return Object.keys(config.channels ?? {}).map(normalizeChannelId).filter((id) => id && isChannelConfigured(config, id));
|
|
284
288
|
}
|
|
285
|
-
var DEFAULT_CONFIG_SCHEMA;
|
|
286
|
-
var init_channel_catalog_service = __esmMin((() => {
|
|
287
|
-
init_paths_state();
|
|
288
|
-
init_extension_metadata_snapshot();
|
|
289
|
-
DEFAULT_CONFIG_SCHEMA = {
|
|
290
|
-
type: "object",
|
|
291
|
-
additionalProperties: true
|
|
292
|
-
};
|
|
293
|
-
}));
|
|
294
289
|
//#endregion
|
|
295
|
-
|
|
296
|
-
export { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, getConfiguredChannelIds, init_channel_catalog_service, isChannelConfigured };
|
|
290
|
+
export { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, getConfiguredChannelIds, isChannelConfigured };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
2
|
+
import { init_agent_scope, resolveAgentProfileDir } from "../agent/agent-scope.js";
|
|
3
3
|
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
4
|
+
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
4
5
|
import { commandRegistry } from "./registry.js";
|
|
5
6
|
import { join } from "node:path";
|
|
6
7
|
import { readFile } from "node:fs/promises";
|
|
@@ -102,7 +103,7 @@ const agentEditCommand = {
|
|
|
102
103
|
success: false
|
|
103
104
|
};
|
|
104
105
|
const agentId = normalizeAgentId(resolveAgentIdFromConversationId(ctx.conversationId));
|
|
105
|
-
const profileDir = resolveAgentProfileDir(
|
|
106
|
+
const profileDir = resolveAgentProfileDir(agentId);
|
|
106
107
|
const namesToShow = fileName ? [fileName] : [WORKSPACE_FILES.SOUL, WORKSPACE_FILES.IDENTITY];
|
|
107
108
|
const sections = [];
|
|
108
109
|
for (const name of namesToShow) {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { ConfigSchema, init_schema } from "../../config/schema.js";
|
|
4
3
|
import { init_paths, resolveConfigPath } from "../../config/paths.js";
|
|
5
|
-
import {
|
|
4
|
+
import { ConfigSchema, init_schema } from "../../config/schema.js";
|
|
6
5
|
import { commandRegistry } from "../registry.js";
|
|
7
6
|
import { parseConfigValue } from "../config-value.js";
|
|
8
7
|
import { getConfigValueAtPath, parseConfigPath, setConfigValueAtPath, unsetConfigValueAtPath } from "../config-paths.js";
|
|
8
|
+
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
9
9
|
import { resolveAllowlistMatchSimple } from "../../channels/security.js";
|
|
10
10
|
//#region src/chat-commands/builtins/config.ts
|
|
11
11
|
init_schema();
|
|
12
|
-
init_loader();
|
|
13
12
|
init_paths();
|
|
14
13
|
init_logger();
|
|
15
14
|
const log = createLogger("ConfigCommand");
|
|
@@ -75,10 +74,9 @@ const configCommand = {
|
|
|
75
74
|
acceptsArgs: true,
|
|
76
75
|
examples: [
|
|
77
76
|
"/config show",
|
|
78
|
-
"/config show
|
|
79
|
-
"/config set
|
|
80
|
-
"/config
|
|
81
|
-
"/config unset tts"
|
|
77
|
+
"/config show gateway.port",
|
|
78
|
+
"/config set commands.restart=false",
|
|
79
|
+
"/config unset tunnel"
|
|
82
80
|
],
|
|
83
81
|
handler: async (ctx, args) => {
|
|
84
82
|
const parts = args.trim().split(/\s+/);
|
|
@@ -180,7 +178,7 @@ const configCommand = {
|
|
|
180
178
|
log.info({ path: rest }, "Config key removed via /config unset");
|
|
181
179
|
return { content: `⚙️ Config updated: \`${rest}\` removed.` };
|
|
182
180
|
}
|
|
183
|
-
return { content: "⚙️ *Config Command*\n\n`/config show [path]` — view config (or a specific path)\n`/config set path=value` — update a config value\n`/config unset path` — remove a config key\n\nExamples:\n`/config show
|
|
181
|
+
return { content: "⚙️ *Config Command*\n\n`/config show [path]` — view config (or a specific path)\n`/config set path=value` — update a config value\n`/config unset path` — remove a config key\n\nExamples:\n`/config show gateway.port`\n`/config set commands.restart=false`\n`/config unset tunnel`" };
|
|
184
182
|
}
|
|
185
183
|
};
|
|
186
184
|
function registerConfigCommand() {
|
|
@@ -135,7 +135,7 @@ async function reviewModelRef(ctx) {
|
|
|
135
135
|
const sessionOverride = await ctx.getSessionConfigStore?.()?.get(ctx.conversationId).then((config) => config?.modelOverride?.trim()).catch(() => void 0);
|
|
136
136
|
if (sessionOverride) return sessionOverride;
|
|
137
137
|
try {
|
|
138
|
-
const profile = resolveEffectiveAgentProfileForSession(ctx.
|
|
138
|
+
const profile = resolveEffectiveAgentProfileForSession(ctx.conversationId);
|
|
139
139
|
return profile.config.models.intents.review?.primary || profile.primaryModelRef;
|
|
140
140
|
} catch {
|
|
141
141
|
return;
|
|
@@ -139,7 +139,7 @@ async function runWorkflowFromCommand(ctx, args) {
|
|
|
139
139
|
success: false
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
const agentId = extractProfileAgentId(ctx.conversationId
|
|
142
|
+
const agentId = extractProfileAgentId(ctx.conversationId);
|
|
143
143
|
const source = ctx.source === "webui" || ctx.channelId === "webchat" ? {
|
|
144
144
|
kind: "webui",
|
|
145
145
|
conversationId: ctx.conversationId
|
|
@@ -3,7 +3,7 @@ function parseConfigPath(raw) {
|
|
|
3
3
|
const parts = raw.trim().split(".").map((p) => p.trim());
|
|
4
4
|
if (parts.some((p) => !p)) return {
|
|
5
5
|
ok: false,
|
|
6
|
-
error: "Invalid path. Use dot notation (e.g.
|
|
6
|
+
error: "Invalid path. Use dot notation (e.g. gateway.port)."
|
|
7
7
|
};
|
|
8
8
|
return {
|
|
9
9
|
ok: true,
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
4
|
-
import { init_loader, saveConfig } from "../config/loader.js";
|
|
5
4
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
6
5
|
import { getProjectForSession } from "../projects/workspace.js";
|
|
7
6
|
import { getSessionDisplayName } from "./session-key.js";
|
|
7
|
+
import { saveConfig } from "../config/loader.js";
|
|
8
8
|
import { wrapMarkdownExportAsHtml } from "../session/chat-export.js";
|
|
9
9
|
import { join } from "path";
|
|
10
10
|
import { mkdir, writeFile } from "fs/promises";
|
|
11
11
|
//#region src/chat-commands/context.ts
|
|
12
12
|
init_schema();
|
|
13
13
|
init_logger();
|
|
14
|
-
init_loader();
|
|
15
14
|
const log = createLogger("CommandContext");
|
|
16
15
|
var CommandContextImpl = class {
|
|
17
16
|
conversationId;
|
|
@@ -141,7 +140,7 @@ var CommandContextImpl = class {
|
|
|
141
140
|
}
|
|
142
141
|
getCurrentModel() {
|
|
143
142
|
if (this.deps.getCurrentModel) return this.deps.getCurrentModel();
|
|
144
|
-
return getAgentDefaultModelRef(
|
|
143
|
+
return getAgentDefaultModelRef();
|
|
145
144
|
}
|
|
146
145
|
async listModels() {
|
|
147
146
|
if (this.deps.listModels) return this.deps.listModels();
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ChatPreviewCreateInput, type ChatPreviewRecord, type ChatPreviewRevision, type ChatPreviewReviseInput, type ChatPreviewDiagnostic, type ChatPreviewFixGuidance, type LocalAppDetail } from '@xopcai/gateway-contract';
|
|
2
|
+
import type { LocalAppService } from '../local-apps/index.js';
|
|
3
|
+
import { ChatPreviewStore } from './store.js';
|
|
4
|
+
export declare class ChatPreviewNotFoundError extends Error {
|
|
5
|
+
}
|
|
6
|
+
export declare class ChatPreviewRevisionConflictError extends Error {
|
|
7
|
+
}
|
|
8
|
+
export declare class ChatPreviewService {
|
|
9
|
+
private readonly store;
|
|
10
|
+
private readonly localApps?;
|
|
11
|
+
constructor(options?: {
|
|
12
|
+
store?: ChatPreviewStore;
|
|
13
|
+
localApps?: LocalAppService;
|
|
14
|
+
});
|
|
15
|
+
create(conversationId: string, rawInput: ChatPreviewCreateInput): {
|
|
16
|
+
preview: ChatPreviewRecord;
|
|
17
|
+
revision: ChatPreviewRevision;
|
|
18
|
+
};
|
|
19
|
+
get(id: string): ChatPreviewRecord;
|
|
20
|
+
getRevision(id: string, revision: string): ChatPreviewRevision;
|
|
21
|
+
revise(id: string, rawInput: ChatPreviewReviseInput): {
|
|
22
|
+
preview: ChatPreviewRecord;
|
|
23
|
+
revision: ChatPreviewRevision;
|
|
24
|
+
};
|
|
25
|
+
getFixGuidance(id: string, sourceHashValue: string, diagnostics: ChatPreviewDiagnostic[], locale: 'en' | 'zh'): ChatPreviewFixGuidance;
|
|
26
|
+
promote(id: string, sourceHashValue: string): LocalAppDetail;
|
|
27
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { ChatPreviewCreateInputSchema, ChatPreviewReviseInputSchema } from "../../packages/gateway-contract/src/chat-previews.js";
|
|
2
|
+
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
3
|
+
import { ChatPreviewStore } from "./store.js";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
5
|
+
//#region src/chat-previews/service.ts
|
|
6
|
+
init_src();
|
|
7
|
+
var ChatPreviewNotFoundError = class extends Error {};
|
|
8
|
+
var ChatPreviewRevisionConflictError = class extends Error {};
|
|
9
|
+
function sourceHash(source) {
|
|
10
|
+
const hash = createHash("sha256");
|
|
11
|
+
for (const value of [
|
|
12
|
+
source.markup,
|
|
13
|
+
source.styles,
|
|
14
|
+
source.script
|
|
15
|
+
]) {
|
|
16
|
+
hash.update(String(Buffer.byteLength(value)));
|
|
17
|
+
hash.update(":");
|
|
18
|
+
hash.update(value);
|
|
19
|
+
}
|
|
20
|
+
return hash.digest("hex");
|
|
21
|
+
}
|
|
22
|
+
var ChatPreviewService = class {
|
|
23
|
+
store;
|
|
24
|
+
localApps;
|
|
25
|
+
constructor(options = {}) {
|
|
26
|
+
this.store = options.store ?? new ChatPreviewStore();
|
|
27
|
+
this.localApps = options.localApps;
|
|
28
|
+
}
|
|
29
|
+
create(conversationId, rawInput) {
|
|
30
|
+
const input = ChatPreviewCreateInputSchema.parse(rawInput);
|
|
31
|
+
const source = {
|
|
32
|
+
markup: input.markup,
|
|
33
|
+
styles: input.styles,
|
|
34
|
+
script: input.script
|
|
35
|
+
};
|
|
36
|
+
return this.store.create({
|
|
37
|
+
conversationId,
|
|
38
|
+
title: input.title,
|
|
39
|
+
preferredHeight: input.preferredHeight,
|
|
40
|
+
sourceHash: sourceHash(source),
|
|
41
|
+
source
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
get(id) {
|
|
45
|
+
const preview = this.store.get(id);
|
|
46
|
+
if (!preview) throw new ChatPreviewNotFoundError("Chat preview not found");
|
|
47
|
+
return preview;
|
|
48
|
+
}
|
|
49
|
+
getRevision(id, revision) {
|
|
50
|
+
const result = this.store.getRevision(id, revision);
|
|
51
|
+
if (!result) throw new ChatPreviewNotFoundError("Chat preview revision not found");
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
revise(id, rawInput) {
|
|
55
|
+
this.get(id);
|
|
56
|
+
const input = ChatPreviewReviseInputSchema.parse(rawInput);
|
|
57
|
+
const source = {
|
|
58
|
+
markup: input.markup,
|
|
59
|
+
styles: input.styles,
|
|
60
|
+
script: input.script
|
|
61
|
+
};
|
|
62
|
+
const result = this.store.revise({
|
|
63
|
+
id,
|
|
64
|
+
expectedRevision: input.baseRevision,
|
|
65
|
+
sourceHash: sourceHash(source),
|
|
66
|
+
source,
|
|
67
|
+
title: input.title,
|
|
68
|
+
preferredHeight: input.preferredHeight
|
|
69
|
+
});
|
|
70
|
+
if (!result) throw new ChatPreviewRevisionConflictError("Chat preview changed; revise the latest revision");
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
getFixGuidance(id, sourceHashValue, diagnostics, locale) {
|
|
74
|
+
const preview = this.get(id);
|
|
75
|
+
this.getRevision(id, sourceHashValue);
|
|
76
|
+
const issues = JSON.stringify(diagnostics, null, 2);
|
|
77
|
+
return {
|
|
78
|
+
previewId: id,
|
|
79
|
+
sourceHash: sourceHashValue,
|
|
80
|
+
prompt: locale === "zh" ? `请修复对话预览“${preview.title}”的运行错误。先读取 previewId=${id}、sourceHash=${sourceHashValue} 的不可变版本,分析以下诊断,然后用 xopc_use 的 chat_preview/revise 提交完整 markup、styles、script,并将 baseRevision 设为 ${sourceHashValue}。不要创建 Local App。\n\n诊断:\n${issues}` : `Fix the runtime errors in chat preview "${preview.title}". Read immutable previewId=${id}, sourceHash=${sourceHashValue}, analyze the diagnostics below, then use xopc_use chat_preview/revise with complete markup, styles, and script and baseRevision=${sourceHashValue}. Do not create a Local App.\n\nDiagnostics:\n${issues}`
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
promote(id, sourceHashValue) {
|
|
84
|
+
if (!this.localApps) throw new Error("Local app service is unavailable");
|
|
85
|
+
const preview = this.get(id);
|
|
86
|
+
const revision = this.getRevision(id, sourceHashValue);
|
|
87
|
+
const promotedAppId = this.store.getPromotedAppId(id, sourceHashValue);
|
|
88
|
+
if (promotedAppId) {
|
|
89
|
+
const existing = this.localApps.get(promotedAppId);
|
|
90
|
+
if (!existing) throw new Error("Promoted Local App is unavailable");
|
|
91
|
+
return existing;
|
|
92
|
+
}
|
|
93
|
+
const app = this.localApps.createFromPreview({
|
|
94
|
+
name: preview.title,
|
|
95
|
+
idea: `Promoted from chat preview ${preview.id} at revision ${revision.sourceHash}`,
|
|
96
|
+
description: "Created from an immutable chat preview.",
|
|
97
|
+
markup: revision.markup,
|
|
98
|
+
styles: revision.styles,
|
|
99
|
+
script: revision.script
|
|
100
|
+
});
|
|
101
|
+
this.store.setPromotedAppId(id, sourceHashValue, app.id);
|
|
102
|
+
return app;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
//#endregion
|
|
106
|
+
export { ChatPreviewNotFoundError, ChatPreviewRevisionConflictError, ChatPreviewService };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ChatPreviewRecord, ChatPreviewRevision, ChatPreviewSource } from '@xopcai/gateway-contract';
|
|
2
|
+
export declare class ChatPreviewStore {
|
|
3
|
+
create(input: {
|
|
4
|
+
conversationId: string;
|
|
5
|
+
title: string;
|
|
6
|
+
preferredHeight: number;
|
|
7
|
+
sourceHash: string;
|
|
8
|
+
source: ChatPreviewSource;
|
|
9
|
+
}): {
|
|
10
|
+
preview: ChatPreviewRecord;
|
|
11
|
+
revision: ChatPreviewRevision;
|
|
12
|
+
};
|
|
13
|
+
get(id: string): ChatPreviewRecord | null;
|
|
14
|
+
getRevision(id: string, sourceHash: string): ChatPreviewRevision | null;
|
|
15
|
+
getPromotedAppId(id: string, sourceHash: string): string | null;
|
|
16
|
+
setPromotedAppId(id: string, sourceHash: string, appId: string): void;
|
|
17
|
+
revise(input: {
|
|
18
|
+
id: string;
|
|
19
|
+
expectedRevision: string;
|
|
20
|
+
sourceHash: string;
|
|
21
|
+
source: ChatPreviewSource;
|
|
22
|
+
title?: string;
|
|
23
|
+
preferredHeight?: number;
|
|
24
|
+
}): {
|
|
25
|
+
preview: ChatPreviewRecord;
|
|
26
|
+
revision: ChatPreviewRevision;
|
|
27
|
+
} | null;
|
|
28
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { getSqliteDatabase, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
//#region src/chat-previews/store.ts
|
|
5
|
+
init_sqlite();
|
|
6
|
+
function previewFromRow(row) {
|
|
7
|
+
return {
|
|
8
|
+
id: row.preview_id,
|
|
9
|
+
conversationId: row.conversation_id,
|
|
10
|
+
title: row.title,
|
|
11
|
+
preferredHeight: row.preferred_height,
|
|
12
|
+
latestRevision: row.latest_revision,
|
|
13
|
+
createdAt: row.created_at,
|
|
14
|
+
updatedAt: row.updated_at
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function revisionFromRow(row) {
|
|
18
|
+
return {
|
|
19
|
+
previewId: row.preview_id,
|
|
20
|
+
sourceHash: row.source_hash,
|
|
21
|
+
markup: row.markup,
|
|
22
|
+
styles: row.styles,
|
|
23
|
+
script: row.script,
|
|
24
|
+
createdAt: row.created_at
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
var ChatPreviewStore = class {
|
|
28
|
+
create(input) {
|
|
29
|
+
const id = randomUUID();
|
|
30
|
+
const now = Date.now();
|
|
31
|
+
runSqliteWriteTransaction((db) => {
|
|
32
|
+
db.prepare(`INSERT INTO chat_previews (
|
|
33
|
+
preview_id, conversation_id, title, preferred_height, latest_revision, created_at, updated_at
|
|
34
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?)`).run(id, input.conversationId, input.title, input.preferredHeight, input.sourceHash, now, now);
|
|
35
|
+
db.prepare(`INSERT INTO chat_preview_revisions (
|
|
36
|
+
preview_id, source_hash, markup, styles, script, created_at
|
|
37
|
+
) VALUES (?, ?, ?, ?, ?, ?)`).run(id, input.sourceHash, input.source.markup, input.source.styles, input.source.script, now);
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
preview: this.get(id),
|
|
41
|
+
revision: this.getRevision(id, input.sourceHash)
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
get(id) {
|
|
45
|
+
const row = getSqliteDatabase().prepare("SELECT * FROM chat_previews WHERE preview_id = ?").get(id);
|
|
46
|
+
return row ? previewFromRow(row) : null;
|
|
47
|
+
}
|
|
48
|
+
getRevision(id, sourceHash) {
|
|
49
|
+
const row = getSqliteDatabase().prepare("SELECT * FROM chat_preview_revisions WHERE preview_id = ? AND source_hash = ?").get(id, sourceHash);
|
|
50
|
+
return row ? revisionFromRow(row) : null;
|
|
51
|
+
}
|
|
52
|
+
getPromotedAppId(id, sourceHash) {
|
|
53
|
+
return getSqliteDatabase().prepare("SELECT promoted_app_id FROM chat_preview_revisions WHERE preview_id = ? AND source_hash = ?").get(id, sourceHash)?.promoted_app_id ?? null;
|
|
54
|
+
}
|
|
55
|
+
setPromotedAppId(id, sourceHash, appId) {
|
|
56
|
+
if (getSqliteDatabase().prepare(`UPDATE chat_preview_revisions SET promoted_app_id = ?
|
|
57
|
+
WHERE preview_id = ? AND source_hash = ? AND promoted_app_id IS NULL`).run(appId, id, sourceHash).changes !== 1) throw new Error("Chat preview revision was already promoted or no longer exists");
|
|
58
|
+
}
|
|
59
|
+
revise(input) {
|
|
60
|
+
const now = Date.now();
|
|
61
|
+
return runSqliteWriteTransaction((db) => {
|
|
62
|
+
const current = db.prepare("SELECT * FROM chat_previews WHERE preview_id = ?").get(input.id);
|
|
63
|
+
if (!current || current.latest_revision !== input.expectedRevision) return null;
|
|
64
|
+
db.prepare(`INSERT OR IGNORE INTO chat_preview_revisions (
|
|
65
|
+
preview_id, source_hash, markup, styles, script, created_at
|
|
66
|
+
) VALUES (?, ?, ?, ?, ?, ?)`).run(input.id, input.sourceHash, input.source.markup, input.source.styles, input.source.script, now);
|
|
67
|
+
db.prepare(`UPDATE chat_previews SET
|
|
68
|
+
title = ?, preferred_height = ?, latest_revision = ?, updated_at = ?
|
|
69
|
+
WHERE preview_id = ?`).run(input.title ?? current.title, input.preferredHeight ?? current.preferred_height, input.sourceHash, now, input.id);
|
|
70
|
+
return {
|
|
71
|
+
preview: this.get(input.id),
|
|
72
|
+
revision: this.getRevision(input.id, input.sourceHash)
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
export { ChatPreviewStore };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
4
3
|
import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
4
|
+
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
5
5
|
import { init_agent_session_key, resolveAgentMainConversationId } from "../../routing/agent-session-key.js";
|
|
6
|
-
import { loadConfig } from "../../config/loader.js";
|
|
7
6
|
import { ExtensionLoader } from "../../extensions/loader.js";
|
|
8
7
|
import "../../extensions/index.js";
|
|
8
|
+
import { loadConfig } from "../../config/loader.js";
|
|
9
9
|
import { MessageBus, MessageBusShutdownError } from "../../infra/bus/queue.js";
|
|
10
10
|
import "../../infra/bus/index.js";
|
|
11
11
|
import { AgentService } from "../../agent/service.js";
|
|
@@ -41,7 +41,7 @@ function createAgentCommand(_ctx) {
|
|
|
41
41
|
await listSessions();
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
const modelFromConfig = getAgentDefaultModelRef(
|
|
44
|
+
const modelFromConfig = getAgentDefaultModelRef();
|
|
45
45
|
const modelId = options.model?.trim() || modelFromConfig;
|
|
46
46
|
if (modelId?.startsWith("xopc-cloud/")) {
|
|
47
47
|
const readiness = await getXopcCloudCatalogCoordinator().ensure({
|
|
@@ -57,7 +57,7 @@ function createAgentCommand(_ctx) {
|
|
|
57
57
|
workspace,
|
|
58
58
|
session: options.session
|
|
59
59
|
}, "Starting agent");
|
|
60
|
-
let conversationId = options.session || resolveAgentMainConversationId({ agentId: resolveDefaultAgentId(
|
|
60
|
+
let conversationId = options.session || resolveAgentMainConversationId({ agentId: resolveDefaultAgentId() });
|
|
61
61
|
if (options.session) {
|
|
62
62
|
const { getSessionIndex } = await import("../utils/session.js");
|
|
63
63
|
const session = await (await getSessionIndex()).getSessionMetadata(options.session);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `agents` CLI:
|
|
2
|
+
* `agents` CLI: SQLite is the source of truth for Agent definitions and defaults.
|
|
3
3
|
*/
|
|
4
4
|
import { Command } from 'commander';
|
|
5
5
|
export declare function registerAgentsCli(program: Command): void;
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { normalizeAgentId, validateAgentIdForNewAgent } from "../../agent-catalog/id.js";
|
|
2
|
+
import { AgentCatalogRepository, init_repository } from "../../agent-catalog/repository.js";
|
|
3
|
+
import { init_agent_scope, resolveAgentDir, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
4
|
+
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
5
|
+
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
6
6
|
import { colors } from "../utils/colors.js";
|
|
7
|
-
import { mkdir } from "node:fs/promises";
|
|
8
7
|
//#region src/cli/commands/agents.ts
|
|
9
|
-
|
|
10
|
-
* `agents` CLI: config is the source of truth for multi-agent paths.
|
|
11
|
-
*/
|
|
12
|
-
init_loader();
|
|
13
|
-
init_paths();
|
|
8
|
+
init_repository();
|
|
14
9
|
init_agent_scope();
|
|
15
10
|
function registerAgentsCli(program) {
|
|
16
|
-
const agents = program.command("agents").description("Manage agents
|
|
11
|
+
const agents = program.command("agents").description("Manage agents");
|
|
17
12
|
agents.command("list").description("List configured agents").option("--json", "Output JSON").action(async (opts) => {
|
|
18
|
-
const
|
|
19
|
-
const rows = listAgentEntries(cfg).map((a) => ({
|
|
13
|
+
const rows = new AgentCatalogRepository().snapshot().agents.map((a) => ({
|
|
20
14
|
id: normalizeAgentId(a.id),
|
|
21
15
|
enabled: a.enabled !== false,
|
|
22
16
|
workspace: a.workspace,
|
|
23
|
-
model: a.
|
|
17
|
+
model: resolveEffectiveAgentConfigForAgent(a.id).config.models.chat.primary
|
|
24
18
|
}));
|
|
25
|
-
const def = resolveDefaultAgentId(
|
|
19
|
+
const def = resolveDefaultAgentId();
|
|
26
20
|
if (opts.json) {
|
|
27
21
|
console.log(JSON.stringify({
|
|
28
22
|
defaultAgentId: def,
|
|
@@ -32,7 +26,7 @@ function registerAgentsCli(program) {
|
|
|
32
26
|
}
|
|
33
27
|
console.log(colors.cyan(`Default agent id: ${def}`));
|
|
34
28
|
if (rows.length === 0) {
|
|
35
|
-
console.log("No
|
|
29
|
+
console.log("No configured Agents.");
|
|
36
30
|
return;
|
|
37
31
|
}
|
|
38
32
|
for (const r of rows) {
|
|
@@ -40,28 +34,26 @@ function registerAgentsCli(program) {
|
|
|
40
34
|
console.log(`- ${r.id}${mark}`);
|
|
41
35
|
}
|
|
42
36
|
});
|
|
43
|
-
agents.command("add").description("
|
|
44
|
-
const cfg = loadConfig();
|
|
37
|
+
agents.command("add").description("Create an Agent and its workspace / state directories").argument("<name>", "Agent display name / id seed").option("--workspace <dir>", "Workspace directory for this agent").option("--model <id>", "Model id (e.g. anthropic/claude-sonnet-4-5)").option("--json", "Output JSON summary").action(async (name, opts) => {
|
|
45
38
|
const idRes = validateAgentIdForNewAgent(void 0, name);
|
|
46
39
|
if (idRes.ok === false) {
|
|
47
40
|
console.error(colors.red("Error:"), idRes.error);
|
|
48
41
|
process.exit(1);
|
|
49
42
|
}
|
|
50
43
|
const agentId = idRes.agentId;
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
const workspace = opts.workspace?.trim();
|
|
45
|
+
await new AgentCatalogService().create({
|
|
46
|
+
id: agentId,
|
|
47
|
+
enabled: true,
|
|
48
|
+
...workspace ? { workspace } : {},
|
|
54
49
|
profile: { name: name.trim() },
|
|
55
|
-
...opts.model?.trim() ? {
|
|
50
|
+
...opts.model?.trim() ? { models: { chat: {
|
|
51
|
+
primary: opts.model.trim(),
|
|
52
|
+
fallbacks: []
|
|
53
|
+
} } } : {}
|
|
56
54
|
});
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
const adPath = resolveAgentDir(next, agentId);
|
|
60
|
-
const profilePath = resolveAgentProfileDir(next, agentId);
|
|
61
|
-
await mkdir(wsPath, { recursive: true });
|
|
62
|
-
await mkdir(adPath, { recursive: true });
|
|
63
|
-
await mkdir(profilePath, { recursive: true });
|
|
64
|
-
seedAgentProfileMarkdownFiles(profilePath, wsPath, { displayName: name.trim() });
|
|
55
|
+
const wsPath = resolveAgentWorkspaceDir(agentId);
|
|
56
|
+
const adPath = resolveAgentDir(agentId);
|
|
65
57
|
const payload = {
|
|
66
58
|
agentId,
|
|
67
59
|
workspace: wsPath,
|
|
@@ -75,24 +67,20 @@ function registerAgentsCli(program) {
|
|
|
75
67
|
console.log(` Agent dir: ${adPath}`);
|
|
76
68
|
}
|
|
77
69
|
});
|
|
78
|
-
agents.command("
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
70
|
+
agents.command("default").description("Show or set the default Agent for new Sessions").argument("[id]", "Agent id").option("--json", "Output JSON").action((id, opts) => {
|
|
71
|
+
const defaultAgentId = id ? new AgentCatalogService().setDefault(id).defaultAgentId : resolveDefaultAgentId();
|
|
72
|
+
if (opts.json) console.log(JSON.stringify({ defaultAgentId }, null, 2));
|
|
73
|
+
else console.log(colors.green("✓"), `Default Agent: ${defaultAgentId}`);
|
|
74
|
+
});
|
|
75
|
+
agents.command("delete").description("Remove an Agent from the catalog (optional on-disk cleanup)").argument("<id>", "Agent id").option("--purge", "Also delete workspace and ~/.xopc/agents/<id> data", false).option("--json", "Output JSON summary").action(async (id, opts) => {
|
|
76
|
+
let removedBindings;
|
|
77
|
+
try {
|
|
78
|
+
({removedBindings} = await new AgentCatalogService().delete(id, { purge: opts.purge }));
|
|
79
|
+
} catch (error) {
|
|
80
|
+
console.error(colors.red("Error:"), error instanceof Error ? error.message : String(error));
|
|
87
81
|
process.exit(1);
|
|
88
82
|
}
|
|
89
|
-
const
|
|
90
|
-
await saveConfig(pruned, resolveConfigPath());
|
|
91
|
-
let purged = false;
|
|
92
|
-
if (opts.purge) {
|
|
93
|
-
await removeAgentDirsFromDisk(pruned, id);
|
|
94
|
-
purged = true;
|
|
95
|
-
}
|
|
83
|
+
const purged = opts.purge === true;
|
|
96
84
|
const payload = {
|
|
97
85
|
deleted: id,
|
|
98
86
|
removedBindings,
|
|
@@ -100,7 +88,7 @@ function registerAgentsCli(program) {
|
|
|
100
88
|
};
|
|
101
89
|
if (opts.json) console.log(JSON.stringify(payload, null, 2));
|
|
102
90
|
else {
|
|
103
|
-
console.log(colors.green("✓"), `Removed
|
|
91
|
+
console.log(colors.green("✓"), `Removed Agent "${id}"`);
|
|
104
92
|
if (removedBindings > 0) console.log(` Stripped ${removedBindings} routing binding(s).`);
|
|
105
93
|
if (purged) console.log(" On-disk workspace/state removed.");
|
|
106
94
|
}
|
|
@@ -6,6 +6,7 @@ import { formatExamples, register } from "../registry.js";
|
|
|
6
6
|
import { disconnectProvider } from "../../providers/provider-disconnect.js";
|
|
7
7
|
import { colorizeStatus, colors } from "../utils/colors.js";
|
|
8
8
|
import { listAllProfiles, listProfilesForProvider, removeAuthProfile, upsertAuthProfile } from "../../auth/profiles/profiles.js";
|
|
9
|
+
import "../../auth/profiles/index.js";
|
|
9
10
|
import { getOAuthProvider, getSupportedOAuthProviders } from "../utils/oauth-providers.js";
|
|
10
11
|
import { runCliOAuthLogin } from "../utils/oauth-login.js";
|
|
11
12
|
import { Command } from "commander";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { init_loader, loadConfig } from "../../config/loader.js";
|
|
2
1
|
import { checkBrowserReadiness } from "../../browser/readiness.js";
|
|
2
|
+
import { loadConfig } from "../../config/loader.js";
|
|
3
3
|
//#region src/cli/commands/browser-cli-helpers.ts
|
|
4
|
-
init_loader();
|
|
5
4
|
async function doctorCli() {
|
|
6
5
|
const config = await loadConfig();
|
|
7
6
|
const readiness = await checkBrowserReadiness(config);
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { buildChannelCatalogForConfig
|
|
2
|
-
import {
|
|
1
|
+
import { buildChannelCatalogForConfig } from "../../channels/catalog/channel-catalog-service.js";
|
|
2
|
+
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
3
3
|
import { listChannelPairingState } from "../../channels/pairing/pairing-service.js";
|
|
4
4
|
import { approveChannelPairingFromCli } from "../../channels/pairing/approve-cli.js";
|
|
5
5
|
import { formatExamples, register } from "../registry.js";
|
|
6
6
|
import { colors } from "../utils/colors.js";
|
|
7
7
|
import { Command } from "commander";
|
|
8
8
|
//#region src/cli/commands/channels.ts
|
|
9
|
-
init_channel_catalog_service();
|
|
10
|
-
init_loader();
|
|
11
9
|
function normalizeChannelId(raw) {
|
|
12
10
|
return raw.trim().toLowerCase();
|
|
13
11
|
}
|