@xopcai/xopc 0.0.344 → 0.0.345
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-BsvblhQz.js → auth-CFiOJ_rf.js} +1 -1
- 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 +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DRFs0Jjv.js → agent-avatar-dicebear-DzTpItp_.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-C9J-ILd0.js → agent-defaults-settings-panel-B1al6YWa.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-CGstiK5S.js → agent-plugin-dialog-DSoB0gnd.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-DS-CV-xB.js → agents-CwRQCefk.js} +6 -6
- package/dist/gateway/static/root/assets/{agents-admin-api-BTYHoqlW.js → agents-admin-api-Dlw9XxYa.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-znCRRKVF.js → app-management-settings-panel-CLHHHWYO.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DSUujN-S.js → appearance-settings-CDHVSJLa.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-7uOjQp30.js → apps-page-d6fHnMl5.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-DV01jcWu.js → archive-plugin-D_nLN0ho.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-D_Ts5PDI.js → automations-page-CU8i_OF1.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-Dg7IuWeB.js → automations-workspace-FUZW78oM.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-CEoIySYJ.js → binary-plugins-cOFd2Nir.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-4bv_tjfg.js → block-editor-BJiU5Z4T.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-UYRx7nE_.js → browser-automation-inputs-C9W2EklQ.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-EtXgro_V.js → browser-automations-page-Ccv2YZy3.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-Bf45sjmd.js → browser-settings-page-Da1ldGha.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-B-2wxCUQ.js → capabilities-Co9ZxHHB.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-YjIv97Sw.js → capabilities-page-DVg7nuOv.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-Ch2iNnfI.js → capabilities-settings-panel-C5pn_cxD.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-header-actions-DJKC0sss.js → capability-header-actions-BTKmmXDt.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-BWZmepe_.js → channels-DW8nOovI.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DLBqdgS-.js → chat-terminal-dock-CP8Y9yw4.js} +1 -1
- package/dist/gateway/static/root/assets/computer-settings-page-d2HeneXw.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-CYE4gX1g.js → connector-service-page-DurvkNyY.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-dJDZx96_.js → connectors-page-InzpTQdx.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-BM9HDlUj.js → date-picker-C66v8-Yb.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-BybqITjG.js → dependency-picker-DdI7qT11.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CYoJiTna.js → desktop-pet-BNApFzEs.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CXcTdFHs.js → desktop-pet-settings-CzlyUvVW.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-DnkRc3SQ.js → device-pairing-wizard-kGWh--bQ.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BNC2UnEM.js → directory-picker-path-field-C_dseFuW.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CHU0dr2j.js → extension-debug-page-Bm_VpS_w.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DXjPSQIh.js → extension-page-BwoZPA_b.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DqFNPQsx.js → extension-settings-page-zk5g1zeU.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-DcE8n_ZS.js → gateway-config-swr-ukBQYwfH.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-DvNfXjan.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-DGQMXjfI.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-BJVKTwIx.js → gateway-settings-ys3GodI9.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CCPlq9Lk.js → gateway-startup-retry-CVpOj205.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-B2imtrmi.js → home-page-DCch7Wli.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-D1Uh-05P.js → image-generation-api-zxx0qG9z.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-CsypWC3J.js → imports-page-B_FXRx3e.js} +1 -1
- package/dist/gateway/static/root/assets/index-CmBebI78.js +106 -0
- package/dist/gateway/static/root/assets/index-y6kxoLV2.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CSzm05SM.js → keyboard-shortcuts-settings-G6jipaPk.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-BulzWHzC.js → local-app-workbench-page-DBk6VCUD.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BQ2QlJNH.js → local-apps-page-JTCwJwFQ.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-D9DeB55u.js → local-session-drafts-Dt_Yx7kq.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-B0WmWiCo.js → locale-store-B008NR-f.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-harzpOPJ.js → logs-page-BSY86BVu.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BXKeyT_O.js → management-settings-DVawGOeE.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-CSADmLmZ.js → markdown-view-BjDzimRP.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CMe8YQ8l.js → media-plugins-CkAqQ2Tl.js} +1 -1
- package/dist/gateway/static/root/assets/messages-aVTaD9Mj.js +3 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-DD9n9tnf.js → note-detail-panel-Cm-tLgD2.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-page-B5NcvMau.js → notes-page-CYI52sAi.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-BwFIuZqk.js → page-context-capture-button-DZEkVWnp.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-DH4JI3t_.js → page-tabs-CDZsjC4h.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-D3Wsh5jh.js → preview-open-alternatives-Cx5BFcNM.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-iigCUM2g.js → product-open-page-B-5PABzZ.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-C19aDnSV.js → project-detail-page-cDOhoUoN.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-aWOL4_py.js → projects-page-CiM0TnYn.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-Bw0ZkSav.js → registry-api-EPj5O77m.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-CGLJFrLG.js → remote-access-hub-CieyswCw.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-ArGdQMYT.js → runtime-tools-settings-panel-AVqU_pNz.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-WB5cZttQ.js → scenes-page-CRoeeOsQ.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-Bzga2Tq0.js → schema-form-6rX3xac-.js} +1 -1
- package/dist/gateway/static/root/assets/session-api-D5BlAIge.js +1 -0
- package/dist/gateway/static/root/assets/session-manager-DcFS0yfO.js +16 -0
- package/dist/gateway/static/root/assets/{sessions-page-DCs83Gg-.js → sessions-page-CcLgWmnz.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-t9xHuUNo.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-DMchToFl.js → settings-form-section-D4yLlpSo.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-Dh-S9_GO.js → settings-page-CiuxRfw3.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-kFPkdt3z.js → setup-status-panel-C5mzr9U_.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CrVC0BzQ.js → share-preview-page-sZ5BzkSM.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-ZesbsEGA.js → shares-settings-Hk3h-pmX.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-Deb8HqtR.js → skill-api-D7yidXQV.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-hmT7uaZI.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-Bgs9jaCc.js → skills-page-D2ABIJZ8.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CwD47-_i.js → system-settings-panel-DlmGH7bX.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-CB-LT_2z.js +1 -0
- package/dist/gateway/static/root/assets/{tasks-QQJXsiER.js → tasks-BH8_WMUF.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-DtL__Vgg.js → tunnel-api-D3M3MUBJ.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DZ01CsLl.js → usage-page-YtsLilis.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-XBFnwLd0.js → use-autosave-CWMidLRt.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-ByACaDBG.js → user-model-page-Cjy2mA_0.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-NaIj9rQC.js → voice-api-key-field-C4OR4RzY.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-st1q4lqP.js → voice-config-api-BnnUzr07.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-D418eqa5.js → work-discovery-overlay-C53YDtCc.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CSXIidqw.js → workflow-run-setup-panel-CoaJDAAq.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-nGttfQ1r.js → workflows-page-EQdAkdTP.js} +1 -1
- package/dist/gateway/static/root/index.html +16 -16
- package/dist/package.js +1 -1
- package/dist/packages/endpoint-tools-protocol/src/index.js +2 -1
- package/dist/packages/gateway-contract/src/sessions.js +11 -0
- package/dist/packages/gateway-contract/src/tasks.js +1 -0
- package/dist/src/agent/agent-manager.js +4 -4
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +2 -2
- package/dist/src/agent/service/process-direct-streaming.js +16 -2
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/tasks/task-judge-service.d.ts +1 -0
- package/dist/src/agent/tasks/task-judge-service.js +55 -33
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +2 -2
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +28 -2
- package/dist/src/agent/tools/computer-use-tool.d.ts +0 -2
- package/dist/src/agent/tools/computer-use-tool.js +31 -19
- package/dist/src/agent/tools/factory.js +2 -3
- package/dist/src/agent/tools/xopc-use-tool.js +180 -9
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.d.ts +2 -0
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/computer/broker.d.ts +6 -0
- package/dist/src/computer/broker.js +14 -0
- package/dist/src/computer/errors.js +2 -1
- package/dist/src/computer/model-adapter.js +3 -3
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/chat-stream/mapper.d.ts +3 -0
- package/dist/src/gateway/chat-stream/mapper.js +5 -1
- package/dist/src/gateway/chat-stream/protocol.d.ts +3 -0
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +19 -2
- package/dist/src/gateway/hono/routes/tasks.js +94 -1
- package/dist/src/gateway/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/service/active-execution.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +5 -1
- package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -1
- package/dist/src/gateway/service.d.ts +2 -1
- package/dist/src/gateway/service.js +72 -8
- package/dist/src/gateway/session-context-summary.js +17 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/session/client-history.d.ts +7 -1
- package/dist/src/session/client-history.js +51 -1
- package/dist/src/session/store.js +10 -2
- package/dist/src/session/types.d.ts +1 -0
- package/dist/src/storage/sqlite/index.d.ts +1 -1
- package/dist/src/storage/sqlite/index.js +2 -2
- package/dist/src/storage/sqlite/migrations/224_task_origin_links.sql +8 -0
- package/dist/src/storage/sqlite/migrations/225_task_collaboration.sql +32 -0
- package/dist/src/storage/sqlite/migrations/226_task_main_updates.sql +9 -0
- package/dist/src/storage/sqlite/migrations/227_task_main_update_decisions.sql +8 -0
- package/dist/src/storage/sqlite/migrations/228_task_main_agent_links.sql +14 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.d.ts +9 -0
- package/dist/src/storage/sqlite/session-input-repository.js +28 -1
- package/dist/src/storage/sqlite/session-repository.js +11 -0
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +2 -0
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/task-application-service.js +19 -1
- package/dist/src/tasks/task-collaboration-delivery.d.ts +9 -0
- package/dist/src/tasks/task-collaboration-delivery.js +100 -0
- package/dist/src/tasks/task-collaboration-repository.d.ts +52 -0
- package/dist/src/tasks/task-collaboration-repository.js +151 -0
- package/dist/src/tasks/task-context-assembler.d.ts +2 -0
- package/dist/src/tasks/task-context-assembler.js +23 -1
- package/dist/src/tasks/task-main-agent-repository.d.ts +10 -0
- package/dist/src/tasks/task-main-agent-repository.js +30 -0
- package/dist/src/tasks/task-main-update-decision-service.d.ts +21 -0
- package/dist/src/tasks/task-main-update-decision-service.js +118 -0
- package/dist/src/tasks/task-main-update-delivery.d.ts +16 -0
- package/dist/src/tasks/task-main-update-delivery.js +64 -0
- package/dist/src/tasks/task-main-update-input.d.ts +20 -0
- package/dist/src/tasks/task-main-update-input.js +37 -0
- package/dist/src/tasks/task-orchestration-metrics.d.ts +17 -0
- package/dist/src/tasks/task-orchestration-metrics.js +61 -0
- package/dist/src/tasks/task-origin-repository.d.ts +14 -0
- package/dist/src/tasks/task-origin-repository.js +29 -0
- package/dist/src/tasks/task-run-dispatcher.d.ts +3 -0
- package/dist/src/tasks/task-run-dispatcher.js +65 -7
- package/dist/src/tasks/task-run-repository.d.ts +2 -0
- package/dist/src/tasks/task-run-repository.js +12 -1
- package/dist/src/tasks/task-sidebar-hierarchy.d.ts +14 -0
- package/dist/src/tasks/task-sidebar-hierarchy.js +49 -0
- package/dist/src/tui/backends/embedded-backend.js +3 -3
- package/dist/src/tui/chat-history.js +8 -0
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-session-snapshot.js +4 -3
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/voice/realtime/agentBroker.d.ts +4 -0
- package/dist/src/voice/realtime/agentBroker.js +9 -3
- package/dist/src/voice/realtime/agentEngine.js +47 -13
- package/dist/src/voice/realtime/engine.d.ts +5 -0
- package/dist/src/voice/realtime/omniEngine.js +66 -12
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/playback-echo.js +2 -0
- package/dist/src/voice/realtime/runtime.d.ts +6 -0
- package/dist/src/voice/realtime/runtime.js +12 -0
- package/dist/src/voice/realtime/turnPolicy.d.ts +1 -0
- package/dist/src/voice/realtime/turnPolicy.js +3 -0
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/computer-settings-page-CciQtKpz.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-BeUJkjA3.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-C-8wwbt_.js +0 -1
- package/dist/gateway/static/root/assets/index-Ca6iqaCn.css +0 -1
- package/dist/gateway/static/root/assets/index-DqQgdJHd.js +0 -106
- package/dist/gateway/static/root/assets/messages-CTKYRqR-.js +0 -3
- package/dist/gateway/static/root/assets/session-api-BY3dAGBn.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-D10sD8IN.js +0 -16
- package/dist/gateway/static/root/assets/settings-advanced-gate-yIwyFL-A.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DvWOrc3C.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DFEM3Xbj.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { init_paths, resolveModelsJsonPath } from "./paths.js";
|
|
3
|
-
import { init_write_file_atomic, writeTextAtomicSync } from "../infra/write-file-atomic.js";
|
|
4
3
|
import { ComputerProfileSchema, init_src } from "../../packages/computer-control-contract/src/index.js";
|
|
4
|
+
import { init_write_file_atomic, writeTextAtomicSync } from "../infra/write-file-atomic.js";
|
|
5
5
|
import { init_model_policy, isComputerModel } from "../computer/model-policy.js";
|
|
6
6
|
import { existsSync, readFileSync } from "fs";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { ComputerConfigSchema, init_config } from "../computer/config.js";
|
|
2
3
|
import { AgentModelsOverrideSchema, ImageGenerationRouteSchema, ModelRouteSchema } from "../agent-config/schema.js";
|
|
3
4
|
import { resolveEffectiveAgentConfig } from "../agent-config/resolver.js";
|
|
4
5
|
import { init_agent_config } from "../agent-config/index.js";
|
|
5
6
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
6
|
-
import { ComputerConfigSchema, init_config } from "../computer/config.js";
|
|
7
7
|
import { DEFAULT_CONTEXT_COMPACTION_POLICY, UserContextConfigSchema, init_config as init_config$1 } from "../user-context/config.js";
|
|
8
8
|
import { init_public_url, validatePublicUrl } from "./public-url.js";
|
|
9
9
|
import { PlatformConfigSchema, init_contracts } from "../platform/contracts.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
2
2
|
import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import yaml from "js-yaml";
|
|
5
4
|
import { validateHeaderName, validateHeaderValue } from "node:http";
|
|
5
|
+
import yaml from "js-yaml";
|
|
6
6
|
//#region src/extensions/agent-plugins/validation.ts
|
|
7
7
|
const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
8
8
|
const MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { normalizeAgentId, validateAgentIdForNewAgent } from "../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
3
|
import { init_agent_scope, listAgentEntries, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath } from "../agent/agent-scope.js";
|
|
4
|
+
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
4
5
|
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
5
6
|
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
6
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
7
|
-
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
8
7
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
8
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
9
9
|
import { GATEWAY_BUILTIN_TOOL_IDS } from "./agent-builtin-tools.js";
|
|
10
10
|
import { join, resolve } from "node:path";
|
|
11
11
|
import { mkdir, readFile, realpath, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EmbeddedStreamEvent } from '../../agent/embedded/types.js';
|
|
2
2
|
import type { ChatStreamEvent, ChatStreamStatus } from './protocol.js';
|
|
3
|
+
import type { TaskUpdateTrigger } from '../../storage/sqlite/session-input-repository.js';
|
|
3
4
|
export type RuntimeStreamEvent = EmbeddedStreamEvent | {
|
|
4
5
|
type: string;
|
|
5
6
|
[key: string]: unknown;
|
|
@@ -8,6 +9,8 @@ export interface ChatStreamMapperOptions {
|
|
|
8
9
|
runId: string;
|
|
9
10
|
conversationId: string;
|
|
10
11
|
channel: string;
|
|
12
|
+
startsNewBubble?: boolean;
|
|
13
|
+
taskTrigger?: TaskUpdateTrigger;
|
|
11
14
|
}
|
|
12
15
|
export declare class ChatStreamMapper {
|
|
13
16
|
private readonly opts;
|
|
@@ -124,7 +124,11 @@ var ChatStreamMapper = class {
|
|
|
124
124
|
start() {
|
|
125
125
|
if (this.started) return [];
|
|
126
126
|
this.started = true;
|
|
127
|
-
return [this.make("run_start", {
|
|
127
|
+
return [this.make("run_start", {
|
|
128
|
+
channel: this.opts.channel,
|
|
129
|
+
...this.opts.startsNewBubble ? { startsNewBubble: true } : {},
|
|
130
|
+
...this.opts.taskTrigger ? { taskTrigger: this.opts.taskTrigger } : {}
|
|
131
|
+
})];
|
|
128
132
|
}
|
|
129
133
|
end(status, summary) {
|
|
130
134
|
if (this.ended) return [];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ToolActivity, TurnOutcome } from '@xopcai/gateway-contract';
|
|
2
|
+
import type { TaskUpdateTrigger } from '../../storage/sqlite/session-input-repository.js';
|
|
2
3
|
export type ChatStreamStatus = 'success' | 'error' | 'cancelled' | 'suspended';
|
|
3
4
|
export type PetFeedbackTaskState = 'working' | 'waiting' | 'success' | 'error';
|
|
4
5
|
export type PetFeedbackSensitivity = 'public' | 'private';
|
|
@@ -31,6 +32,8 @@ export interface ChatStreamEnvelope<TType extends string, TPayload> {
|
|
|
31
32
|
}
|
|
32
33
|
export type RunStartEvent = ChatStreamEnvelope<'run_start', {
|
|
33
34
|
channel: string;
|
|
35
|
+
startsNewBubble?: boolean;
|
|
36
|
+
taskTrigger?: TaskUpdateTrigger;
|
|
34
37
|
}>;
|
|
35
38
|
export type UserMessageEvent = ChatStreamEnvelope<'user_message', {
|
|
36
39
|
message: unknown;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../config/paths-state.js";
|
|
2
2
|
import { init_agent_scope, resolveAgentProfileDir } from "../agent/agent-scope.js";
|
|
3
|
-
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
4
3
|
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
4
|
+
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
5
5
|
import { isBareProfileMarkdownFileName, resolveProfileMarkdownPathIfBareName } from "../agent/tools/tool-paths.js";
|
|
6
6
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
7
|
import { basename, isAbsolute, resolve } from "node:path";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { normalizeAgentId } from "../../../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../../../agent-catalog/repository.js";
|
|
3
|
+
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
3
4
|
import { init_agent_scope, listAgentEntries, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
4
5
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
5
|
-
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
6
6
|
import { init_models_json, loadModelsJson } from "../../../config/models-json.js";
|
|
7
7
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
8
8
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { BindingsSchema, init_binding_schema } from "../../../../routing/binding-schema.js";
|
|
2
|
-
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
3
1
|
import { ComputerConfigSchema, init_config } from "../../../../computer/config.js";
|
|
2
|
+
import { BindingsSchema, init_binding_schema } from "../../../../routing/binding-schema.js";
|
|
4
3
|
import { ContextPlanningConfigSchema, HomeIntelligenceConfigSchema, KnowledgeMemoryConfigSchema, UserContextConfigSchema, UserModelConfigSchema, init_config as init_config$1 } from "../../../../user-context/config.js";
|
|
5
4
|
import { BrowserConfigSchema, McpConfigSchema, VoiceConfigSchema, init_schema } from "../../../../config/schema.js";
|
|
6
5
|
import { CredentialResolver, init_credentials } from "../../../../auth/credentials.js";
|
|
7
6
|
import { canonicalizeConfiguredMcpServer } from "../../../../config/mcp-config-normalize.js";
|
|
7
|
+
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
8
8
|
import { mergeGatewaySkillsMarketplacePatch, mergeSessionConfigPatch, mergeUpdateConfigPatch } from "../../../../config/web-patch.js";
|
|
9
9
|
import { assertGatewayAuthConfigured, resolveGatewayAuth } from "../../../auth.js";
|
|
10
10
|
import { isMaskedSecretPatchValue } from "../../lib/mask-secret-length.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
2
1
|
import { resolveEffectiveAgentConfigForAgent } from "../../../config/agent-profile.js";
|
|
2
|
+
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
3
3
|
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
4
4
|
import { computerModelProfile, init_model_policy, isDedicatedComputerModel } from "../../../computer/model-policy.js";
|
|
5
5
|
import { init_models_json, loadModelsJson, saveModelsJson, validateModelsConfig } from "../../../config/models-json.js";
|
|
@@ -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 { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
4
|
-
import "../../../capabilities/runtime/dispatcher.js";
|
|
5
3
|
import { init_session_key, resolveConversationId } from "../../../routing/session-key.js";
|
|
6
4
|
import { agentExists, getDefaultAgentId, init_resolve_route } from "../../../routing/resolve-route.js";
|
|
5
|
+
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
6
|
+
import "../../../capabilities/runtime/dispatcher.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";
|
|
@@ -7,12 +7,12 @@ import { loadTranscriptRowsForSession } from "../../../storage/sqlite/transcript
|
|
|
7
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";
|
|
12
10
|
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
13
11
|
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
14
12
|
import { listKnowledgeItems, writeKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
15
13
|
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";
|
|
@@ -127,7 +127,7 @@ export declare function submitSessionInput(c: Context, deps: AuthenticatedRouteD
|
|
|
127
127
|
channel: string;
|
|
128
128
|
} | {
|
|
129
129
|
type: "system";
|
|
130
|
-
source: "automation" | "cli" | "workflow" | "heartbeat" | "internal";
|
|
130
|
+
source: "automation" | "cli" | "workflow" | "heartbeat" | "internal" | "task_update";
|
|
131
131
|
};
|
|
132
132
|
position: number;
|
|
133
133
|
targetRunId?: string;
|
|
@@ -271,7 +271,7 @@ export declare function replaceLatestSessionTurn(c: Context, deps: Authenticated
|
|
|
271
271
|
channel: string;
|
|
272
272
|
} | {
|
|
273
273
|
type: "system";
|
|
274
|
-
source: "automation" | "cli" | "workflow" | "heartbeat" | "internal";
|
|
274
|
+
source: "automation" | "cli" | "workflow" | "heartbeat" | "internal" | "task_update";
|
|
275
275
|
};
|
|
276
276
|
position: number;
|
|
277
277
|
targetRunId?: string;
|
|
@@ -4,9 +4,9 @@ import { browserPageContextsInputSchema } from "../../../../packages/gateway-con
|
|
|
4
4
|
import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packages/gateway-contract/src/user-turn-document.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";
|
|
7
8
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
8
9
|
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";
|
|
@@ -13,6 +13,8 @@ import { createGatewayRouteLogger, logRouteError } from "../lib/route-logger.js"
|
|
|
13
13
|
import { patchChatModelConfig } from "./chat-model-config.js";
|
|
14
14
|
import { getSessionContextSummary } from "../../session-context-summary.js";
|
|
15
15
|
import { respondStartupUnavailable } from "../lib/startup-unavailable.js";
|
|
16
|
+
import { listSidebarTaskGroups } from "../../../tasks/task-sidebar-hierarchy.js";
|
|
17
|
+
import { createHash } from "node:crypto";
|
|
16
18
|
//#region src/gateway/hono/routes/sessions.ts
|
|
17
19
|
init_src();
|
|
18
20
|
init_browser_tab_binding_repository();
|
|
@@ -122,6 +124,7 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
122
124
|
updatedAfter,
|
|
123
125
|
includePinned: true,
|
|
124
126
|
includeConversationId,
|
|
127
|
+
rootConversationsOnly: true,
|
|
125
128
|
sortBy: "updatedAt",
|
|
126
129
|
sortOrder: "desc"
|
|
127
130
|
});
|
|
@@ -140,6 +143,7 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
140
143
|
updatedAfter,
|
|
141
144
|
includePinned: true,
|
|
142
145
|
includeConversationId,
|
|
146
|
+
rootConversationsOnly: true,
|
|
143
147
|
sortBy: "updatedAt",
|
|
144
148
|
sortOrder: "desc"
|
|
145
149
|
});
|
|
@@ -156,6 +160,10 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
156
160
|
status: "pinned",
|
|
157
161
|
limit: 5e3,
|
|
158
162
|
offset: 0,
|
|
163
|
+
updatedAfter,
|
|
164
|
+
includePinned: true,
|
|
165
|
+
includeConversationId,
|
|
166
|
+
rootConversationsOnly: true,
|
|
159
167
|
sortBy: "updatedAt",
|
|
160
168
|
sortOrder: "desc"
|
|
161
169
|
})).items, pinnedLayout, (session) => session.key);
|
|
@@ -168,6 +176,11 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
168
176
|
itemIds: layout.itemIds,
|
|
169
177
|
revision: layout.revision
|
|
170
178
|
}]));
|
|
179
|
+
const parentIds = [
|
|
180
|
+
...projectItems.flatMap((entry) => entry.sessions.map((session) => session.key)),
|
|
181
|
+
...inbox.items.map((session) => session.key),
|
|
182
|
+
...pinned.map((session) => session.key)
|
|
183
|
+
];
|
|
171
184
|
return c.json({
|
|
172
185
|
ok: true,
|
|
173
186
|
projects: {
|
|
@@ -179,7 +192,8 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
179
192
|
},
|
|
180
193
|
inbox,
|
|
181
194
|
pinned,
|
|
182
|
-
layouts
|
|
195
|
+
layouts,
|
|
196
|
+
childrenByConversationId: listSidebarTaskGroups(parentIds)
|
|
183
197
|
});
|
|
184
198
|
});
|
|
185
199
|
authenticated.put("/api/sidebar/layouts/:containerId", async (c) => {
|
|
@@ -284,12 +298,14 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
284
298
|
updatedAfter: query.updatedAfter ? parseInt(query.updatedAfter) : void 0,
|
|
285
299
|
includePinned: query.includePinned === "true",
|
|
286
300
|
includeConversationId: query.includeConversationId,
|
|
301
|
+
rootConversationsOnly: query.rootConversationsOnly === "true",
|
|
287
302
|
limit: query.limit ? parseInt(query.limit) : void 0,
|
|
288
303
|
offset: query.offset ? parseInt(query.offset) : void 0
|
|
289
304
|
});
|
|
290
305
|
const usageByConversation = summarizeAiUsageByConversations(result.items.map((item) => item.key));
|
|
291
306
|
return c.json({
|
|
292
307
|
...result,
|
|
308
|
+
...query.rootConversationsOnly === "true" ? { childrenByConversationId: listSidebarTaskGroups(result.items.map((item) => item.key)) } : {},
|
|
293
309
|
items: result.items.map((item) => ({
|
|
294
310
|
...item,
|
|
295
311
|
usage: usageByConversation.get(item.key) ?? {
|
|
@@ -430,7 +446,8 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
430
446
|
if (!result) return c.json({ error: "Session not found" }, 404);
|
|
431
447
|
const revision = result.pagination.revision;
|
|
432
448
|
if (typeof revision === "number") {
|
|
433
|
-
const
|
|
449
|
+
const contentHash = createHash("sha256").update(JSON.stringify(result)).digest("base64url");
|
|
450
|
+
const etag = `"${result.session.transcriptId ?? key}:${revision}:${compact ? "compact" : "full"}:${before ?? offset}:${limit}:${contentHash}"`;
|
|
434
451
|
c.header("ETag", etag);
|
|
435
452
|
if (c.req.header("If-None-Match") === etag) return c.body(null, 304);
|
|
436
453
|
}
|
|
@@ -2,22 +2,26 @@ import { init_transaction, runSqliteWriteTransaction } from "../../../storage/sq
|
|
|
2
2
|
import { TaskCommandRequestSchema, TaskCreateRequestSchema, TaskHandoffRequestSchema } from "../../../../packages/gateway-contract/src/tasks.js";
|
|
3
3
|
import { ProductReadContracts, TaskRunCancelOutputSchema, TaskRunFeedbackOutputSchema } from "../../../../packages/gateway-contract/src/capabilities.js";
|
|
4
4
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
5
|
+
import { hasGatewayScope, init_gateway_scopes } from "../../security/gateway-scopes.js";
|
|
5
6
|
import { enqueueTaskChangedEvent, init_task_change_events } from "../../../tasks/task-change-events.js";
|
|
6
7
|
import { TaskRepository, init_task_repository } from "../../../tasks/task-repository.js";
|
|
7
8
|
import { TaskRunRepository, init_task_run_repository } from "../../../tasks/task-run-repository.js";
|
|
9
|
+
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
8
10
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
9
11
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
10
|
-
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
11
12
|
import { TaskContextMutationOutputSchema } from "../../../tasks/capabilities/relations.js";
|
|
12
13
|
import { TaskDeleteOutputSchema } from "../../../tasks/capabilities/management.js";
|
|
14
|
+
import { TaskCollaborationRepository } from "../../../tasks/task-collaboration-repository.js";
|
|
13
15
|
import { TaskMutationOutputSchema } from "../../../tasks/capabilities/write.js";
|
|
14
16
|
import { createProductDispatcher } from "../../../capabilities/runtime/product.js";
|
|
15
17
|
import { ProjectOperatingViewService } from "../../../tasks/project-operating-view-service.js";
|
|
16
18
|
import { TaskHandoffService } from "../../../tasks/task-handoff-service.js";
|
|
19
|
+
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
17
20
|
import { submitSessionInput } from "./session-input-handler.js";
|
|
18
21
|
import { patchChatModelConfig } from "./chat-model-config.js";
|
|
19
22
|
import { capabilityHttpContext, capabilityHttpError } from "../../../capabilities/adapters/http.js";
|
|
20
23
|
import { TaskConversationQueryService } from "../../service/task-conversation-query-service.js";
|
|
24
|
+
import { getTaskOrchestrationMetrics } from "../../../tasks/task-orchestration-metrics.js";
|
|
21
25
|
import { randomUUID } from "node:crypto";
|
|
22
26
|
//#region src/gateway/hono/routes/tasks.ts
|
|
23
27
|
init_src();
|
|
@@ -25,6 +29,7 @@ init_transaction();
|
|
|
25
29
|
init_task_change_events();
|
|
26
30
|
init_task_repository();
|
|
27
31
|
init_task_run_repository();
|
|
32
|
+
init_gateway_scopes();
|
|
28
33
|
function registerTaskRoutes(authenticated, deps) {
|
|
29
34
|
const capabilities = createProductDispatcher(() => deps.service.notesServiceInstance, {
|
|
30
35
|
getConfig: () => deps.service.currentConfig,
|
|
@@ -47,6 +52,7 @@ function registerTaskRoutes(authenticated, deps) {
|
|
|
47
52
|
const tasks = new TaskRepository();
|
|
48
53
|
const runs = new TaskRunRepository();
|
|
49
54
|
const conversations = new TaskConversationRepository();
|
|
55
|
+
const collaboration = new TaskCollaborationRepository();
|
|
50
56
|
const conversationQuery = new TaskConversationQueryService(deps.service.sessions);
|
|
51
57
|
const handoffs = new TaskHandoffService({
|
|
52
58
|
sessionIndex: deps.service.sessionIndexInstance,
|
|
@@ -102,6 +108,21 @@ function registerTaskRoutes(authenticated, deps) {
|
|
|
102
108
|
return capabilityHttpError(c, error);
|
|
103
109
|
}
|
|
104
110
|
});
|
|
111
|
+
authenticated.get("/api/tasks/orchestration-metrics", async (c) => {
|
|
112
|
+
if (!hasGatewayScope(getGatewayPrincipal(c).scopes, "tasks.read")) return c.json({
|
|
113
|
+
ok: false,
|
|
114
|
+
error: "Forbidden"
|
|
115
|
+
}, 403);
|
|
116
|
+
const since = c.req.query("since") === void 0 ? void 0 : Number(c.req.query("since"));
|
|
117
|
+
if (since !== void 0 && (!Number.isInteger(since) || since < 0)) return c.json({
|
|
118
|
+
ok: false,
|
|
119
|
+
error: "Invalid since timestamp"
|
|
120
|
+
}, 400);
|
|
121
|
+
return c.json({
|
|
122
|
+
ok: true,
|
|
123
|
+
metrics: getTaskOrchestrationMetrics(since)
|
|
124
|
+
});
|
|
125
|
+
});
|
|
105
126
|
authenticated.get("/api/tasks/:id", async (c) => {
|
|
106
127
|
try {
|
|
107
128
|
return c.json(await capabilities.call("xopc.tasks.get", { id: c.req.param("id") }, capabilityHttpContext(c)));
|
|
@@ -109,6 +130,78 @@ function registerTaskRoutes(authenticated, deps) {
|
|
|
109
130
|
return capabilityHttpError(c, error);
|
|
110
131
|
}
|
|
111
132
|
});
|
|
133
|
+
authenticated.get("/api/tasks/:id/collaboration", async (c) => {
|
|
134
|
+
if (!hasGatewayScope(getGatewayPrincipal(c).scopes, "tasks.read")) return c.json({
|
|
135
|
+
ok: false,
|
|
136
|
+
error: "Forbidden"
|
|
137
|
+
}, 403);
|
|
138
|
+
const taskId = c.req.param("id");
|
|
139
|
+
if (!tasks.get(taskId)) return c.json({
|
|
140
|
+
ok: false,
|
|
141
|
+
error: "Task not found"
|
|
142
|
+
}, 404);
|
|
143
|
+
const afterSequence = Number(c.req.query("afterSequence") ?? 0);
|
|
144
|
+
const beforeSequence = c.req.query("beforeSequence") === void 0 ? void 0 : Number(c.req.query("beforeSequence"));
|
|
145
|
+
const limit = Number(c.req.query("limit") ?? 50);
|
|
146
|
+
if (!Number.isInteger(afterSequence) || afterSequence < 0 || !Number.isInteger(limit) || limit < 1 || beforeSequence !== void 0 && (!Number.isInteger(beforeSequence) || beforeSequence < 1)) return c.json({
|
|
147
|
+
ok: false,
|
|
148
|
+
error: "Invalid cursor or limit"
|
|
149
|
+
}, 400);
|
|
150
|
+
return c.json({
|
|
151
|
+
ok: true,
|
|
152
|
+
items: c.req.query("recent") === "1" ? collaboration.recent(taskId, beforeSequence, limit) : collaboration.list(taskId, afterSequence, limit)
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
authenticated.post("/api/tasks/:id/collaboration", taskRateLimit, async (c) => {
|
|
156
|
+
const principal = getGatewayPrincipal(c);
|
|
157
|
+
if (!hasGatewayScope(principal.scopes, "tasks.write")) return c.json({
|
|
158
|
+
ok: false,
|
|
159
|
+
error: "Forbidden"
|
|
160
|
+
}, 403);
|
|
161
|
+
const body = await c.req.json().catch(() => null);
|
|
162
|
+
const kind = body?.kind;
|
|
163
|
+
const content = body?.body;
|
|
164
|
+
if (kind !== "instruction" && kind !== "question" && kind !== "answer" || typeof content !== "string" || !content.trim() || content.length > 8e3) return c.json({
|
|
165
|
+
ok: false,
|
|
166
|
+
error: "Invalid collaboration message"
|
|
167
|
+
}, 400);
|
|
168
|
+
const causationId = typeof body?.causationId === "string" ? body.causationId : void 0;
|
|
169
|
+
if (kind === "answer" && (!causationId || collaboration.get(causationId)?.taskId !== c.req.param("id") || collaboration.get(causationId)?.kind !== "question")) return c.json({
|
|
170
|
+
ok: false,
|
|
171
|
+
error: "Answer must reference a question on this Task"
|
|
172
|
+
}, 400);
|
|
173
|
+
try {
|
|
174
|
+
const task = tasks.get(c.req.param("id"));
|
|
175
|
+
if (!task) return c.json({
|
|
176
|
+
ok: false,
|
|
177
|
+
error: "Task not found"
|
|
178
|
+
}, 404);
|
|
179
|
+
if (task.phase === "closed") return c.json({
|
|
180
|
+
ok: false,
|
|
181
|
+
error: "Task is closed"
|
|
182
|
+
}, 409);
|
|
183
|
+
const entry = collaboration.append({
|
|
184
|
+
taskId: c.req.param("id"),
|
|
185
|
+
authorKind: "user",
|
|
186
|
+
authorId: principal.principalId,
|
|
187
|
+
kind,
|
|
188
|
+
body: content,
|
|
189
|
+
...causationId ? { causationId } : {},
|
|
190
|
+
idempotencyKey: c.req.header("idempotency-key") ?? randomUUID(),
|
|
191
|
+
deliverToWorker: true
|
|
192
|
+
});
|
|
193
|
+
deps.service.dispatchTaskRuns();
|
|
194
|
+
return c.json({
|
|
195
|
+
ok: true,
|
|
196
|
+
entry
|
|
197
|
+
}, 201);
|
|
198
|
+
} catch (error) {
|
|
199
|
+
return c.json({
|
|
200
|
+
ok: false,
|
|
201
|
+
error: error instanceof Error ? error.message : String(error)
|
|
202
|
+
}, 409);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
112
205
|
authenticated.post("/api/tasks/:id/conversation", taskRateLimit, async (c) => {
|
|
113
206
|
try {
|
|
114
207
|
const result = await deps.service.ensureTaskConversation(c.req.param("id"));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
|
-
import { init_agent_scope } from "../agent/agent-scope.js";
|
|
4
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
5
3
|
import { ConfigSchema, init_schema } from "../config/schema.js";
|
|
4
|
+
import { init_agent_scope } from "../agent/agent-scope.js";
|
|
6
5
|
import { resolveEffectiveAgentConfigForAgent } from "../config/agent-profile.js";
|
|
7
6
|
import { fetchWithTimeoutGuarded } from "../media-shared/http/provider-http.js";
|
|
8
7
|
import "../media-shared/http/index.js";
|
|
8
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
9
9
|
import { getImageGenerationProvider, listImageGenerationProvidersSummary } from "../agent/image/generation/provider-registry.js";
|
|
10
10
|
//#region src/gateway/image-generation-setup.ts
|
|
11
11
|
init_repository();
|
package/dist/src/gateway/lock.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
|
-
import fs$1 from "node:fs/promises";
|
|
5
4
|
import net from "node:net";
|
|
5
|
+
import fs$1 from "node:fs/promises";
|
|
6
6
|
import { homedir } from "os";
|
|
7
7
|
//#region src/gateway/lock.ts
|
|
8
8
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/gateway/service/active-execution.ts
|
|
2
2
|
function describeActiveExecution(input) {
|
|
3
3
|
const { origin } = input;
|
|
4
|
-
const background = origin.type === "system" && (origin.source === "automation" || origin.source === "heartbeat" || origin.source === "internal");
|
|
4
|
+
const background = origin.type === "system" && (origin.source === "automation" || origin.source === "heartbeat" || origin.source === "internal" || origin.source === "task_update");
|
|
5
5
|
const kind = input.kind ?? (origin.type === "system" && origin.source === "automation" ? "automation" : origin.type === "system" && origin.source === "workflow" ? "workflow" : input.taskRunId ? "task" : "chat");
|
|
6
6
|
return {
|
|
7
7
|
conversationId: input.conversationId,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { inboundCorrelationMetadataFromAsyncLogContext, updateAsyncLogContext } from "../../utils/logger/context.js";
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
|
+
import { init_session_input_repository, listTaskUpdateTriggers } from "../../storage/sqlite/session-input-repository.js";
|
|
4
5
|
import { init_clarification_wait_repository, isClarificationSuspended } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
5
6
|
import { updateInteractionStateFromMessage } from "../../storage/sqlite/interaction-state-repository.js";
|
|
6
7
|
import { getConnectionResumeInput, init_connection_wait_repository, isConnectionSuspended } from "../../storage/sqlite/connection-wait-repository.js";
|
|
@@ -25,6 +26,7 @@ init_clarification_wait_repository();
|
|
|
25
26
|
init_logger();
|
|
26
27
|
init_session_key();
|
|
27
28
|
init_sqlite();
|
|
29
|
+
init_session_input_repository();
|
|
28
30
|
const log = createLogger("Gateway:Service");
|
|
29
31
|
/**
|
|
30
32
|
* @param runOptions.signal — When set (e.g. client disconnect), aborts in-flight generation and persists partial output.
|
|
@@ -85,7 +87,9 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
85
87
|
const mapper = new ChatStreamMapper({
|
|
86
88
|
runId,
|
|
87
89
|
conversationId: streamConversationId,
|
|
88
|
-
channel
|
|
90
|
+
channel,
|
|
91
|
+
startsNewBubble: origin.type === "system" && origin.source === "task_update",
|
|
92
|
+
...origin.type === "system" && origin.source === "task_update" && webchatConversationId ? { taskTrigger: listTaskUpdateTriggers(webchatConversationId).get(runId) } : {}
|
|
89
93
|
});
|
|
90
94
|
let registeredActiveWebchatRun = false;
|
|
91
95
|
const captureTaskEvent = (event) => {
|
|
@@ -61,7 +61,7 @@ export declare class SessionInputCoordinator {
|
|
|
61
61
|
channel: string;
|
|
62
62
|
} | {
|
|
63
63
|
type: "system";
|
|
64
|
-
source: "automation" | "cli" | "workflow" | "heartbeat" | "internal";
|
|
64
|
+
source: "automation" | "cli" | "workflow" | "heartbeat" | "internal" | "task_update";
|
|
65
65
|
};
|
|
66
66
|
}>;
|
|
67
67
|
dispatchAcceptedInput(conversationId: string, inputId: string): Promise<void>;
|
|
@@ -126,6 +126,7 @@ export declare class GatewayService {
|
|
|
126
126
|
private createTaskRunDispatcher;
|
|
127
127
|
private createNotificationService;
|
|
128
128
|
private readonly taskRunDispatch;
|
|
129
|
+
private readonly taskMainUpdateDispatch;
|
|
129
130
|
dispatchTaskRuns(): void;
|
|
130
131
|
ensureTaskConversation(taskId: string, options?: {
|
|
131
132
|
runId?: string;
|
|
@@ -164,7 +165,7 @@ export declare class GatewayService {
|
|
|
164
165
|
channel: string;
|
|
165
166
|
} | {
|
|
166
167
|
type: "system";
|
|
167
|
-
source: "automation" | "cli" | "workflow" | "heartbeat" | "internal";
|
|
168
|
+
source: "automation" | "cli" | "workflow" | "heartbeat" | "internal" | "task_update";
|
|
168
169
|
};
|
|
169
170
|
}>;
|
|
170
171
|
drainSessionInputs(conversationId: string): Promise<void>;
|