@xopcai/xopc 0.0.358 → 0.0.360
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/outbound-sender.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +12 -12
- package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
- package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DEs_xwQi.js → agent-avatar-dicebear-CQTERenW.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CPF0lunJ.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-BjDaZlKy.js +1 -0
- package/dist/gateway/static/root/assets/agents-XopBILLB.js +66 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BqyvMQXO.js → app-management-settings-panel-V5QVeMvW.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Cn9qgXLw.js → appearance-settings-BDkRcoI6.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-ChPOmrPa.js → apps-page-DzCyL89L.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-OUapkL2D.js → automations-page-DOu1wMOV.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CiY_2otj.js +7 -0
- package/dist/gateway/static/root/assets/{block-editor-_-QK0EnY.js → block-editor-K6is5GrS.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-CnLQ649y.js → browser-automation-inputs-MmkUGn9W.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-DZlWdikj.js → browser-automations-page-B8IiXEBs.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-settings-page-CEF_LSjz.js → browser-settings-page-Cms2Bu3Q.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-page-BAFRNHQv.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Cws6od1d.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-CA_XNTSW.js → capability-header-actions-wh3Nr0qS.js} +1 -1
- package/dist/gateway/static/root/assets/channels-DxwismTc.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DRV-4qeP.js → chat-terminal-dock-BU-X9nu1.js} +2 -2
- package/dist/gateway/static/root/assets/computer-settings-page-MyXsSqFJ.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-BKAt0jvO.js → connector-service-page-DyxPM_MZ.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-C7-OC3MW.js +2 -0
- package/dist/gateway/static/root/assets/{constants-Co2_smKQ.js → constants-Dy8Gw0sF.js} +1 -1
- package/dist/gateway/static/root/assets/date-picker-WRFvi7Pu.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-D0RWVtBt.js → dependency-picker-CLun5Tst.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-9B1PIjsV.js → desktop-pet-iaVa9vVM.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-cq5n59Pr.js → desktop-pet-settings-0RS3sP3Z.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DVAGb04L.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-C40-GlX1.js → directory-picker-path-field-Btlldlt3.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BodxNAys.js → extension-debug-page-BImQT4PU.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BshgQ_pO.js → extension-page-BmuLv-ET.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-aigS3RJu.js → extension-provider-Dg7cRxDX.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DAJZVzIQ.js → extension-settings-page-7Kr8UJK4.js} +1 -1
- package/dist/gateway/static/root/assets/fallback-models-B0w1lumZ.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-DmPvmwYp.js +1 -0
- package/dist/gateway/static/root/assets/home-page-N0Mp-eTJ.js +1 -0
- package/dist/gateway/static/root/assets/{imports-page-Bsn8Qted.js → imports-page-BLOJY67-.js} +1 -1
- package/dist/gateway/static/root/assets/{index-DUgsBdV3.css → index-B7AHDHSO.css} +1 -1
- package/dist/gateway/static/root/assets/index-BXrBL_Hb.js +106 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DjuXyBbC.js → keyboard-shortcuts-settings-Dlbsip2R.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-D77r2CKa.js → local-app-workbench-page-nyWeTK0r.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-GsohMT3J.js → local-apps-page-CfEpFLs0.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DeBeNPb4.js → logs-page-A38cawkA.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-Di9r7yBX.js → management-settings-Cse9K61x.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-CLq8afeQ.js → note-detail-panel-CUGVyo2V.js} +3 -3
- package/dist/gateway/static/root/assets/notes-page-Dk89l5dC.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-C9H1dHg2.js → page-context-capture-button-C72qIgBg.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-DCtduzh8.js +1 -0
- package/dist/gateway/static/root/assets/popover-select-BgSdSbCL.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-pW662VEC.js → product-open-page-CT98FsVl.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-3_Bqq0OV.js → project-detail-page-BlqOVwKP.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-D85PDbCM.js → projects-page-DVN2q_yR.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BP5kUgIN.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BUgsyhm_.js → runtime-tools-settings-panel-ry0jprz7.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-Bds4V34P.js → scenes-page-CV1GkOj6.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-BQz6ezGe.js → schema-form-C5zMrxgR.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-OaBPDJ9E.js → send-session-input-Dt0t5SoR.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-DDR-gv_e.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-BXtGeOsR.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CvFVkELy.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-CKmMkdPu.js → settings-page-C88fsfZF.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-Cjv6CDgq.js → setup-status-panel-DESlRgZS.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-QAjExHAL.js → share-link-dialog-BvSRHs1P.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-M_rAQR60.js → share-preview-page-D5Gey-6E.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-btoP07Fx.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-BO1b2oYj.js → skill-api-1hbX3qDC.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-DYJbwwBT.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-CIDRPUj4.js → system-settings-panel-DbNk-Jwq.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-ZmkA0E9f.js → task-detail-page-DoLKOJrE.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-BkgD61qc.js → tunnel-api-H3FheXYH.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-BjgYDab4.js → usage-page-DGbqcsV6.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-qK3z-EGz.js → use-composer-attachments-pzPAUV_o.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-D809I8ur.js → use-file-preview-expanded-DNhXjL0W.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-7pW4Pazn.js +2 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Ce3PKQvh.js → work-discovery-overlay-DfyI9kVf.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Dv6xUycS.js → workflow-run-setup-panel-De80GODZ.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BuH3pC1C.js +6 -0
- package/dist/gateway/static/root/assets/{workspace-api-BtXzxf_w.js → workspace-api-Dwa8kHdY.js} +2 -2
- package/dist/gateway/static/root/index.html +11 -12
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/index.js +2 -0
- package/dist/packages/gateway-contract/src/task-result-delivery.js +30 -0
- package/dist/src/agent/agent-manager.js +13 -13
- package/dist/src/agent/agent-scope.js +2 -2
- package/dist/src/agent/background-review/prompts.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +3 -3
- package/dist/src/agent/coding/repository-instructions.js +1 -1
- package/dist/src/agent/context/coordinator.js +2 -2
- package/dist/src/agent/context/execution-context.js +4 -4
- package/dist/src/agent/context/execution-scope.js +2 -2
- package/dist/src/agent/context/project-context.js +3 -3
- package/dist/src/agent/context/workspace-templates/SOUL.md +2 -0
- package/dist/src/agent/data-acquisition/service.js +1 -1
- package/dist/src/agent/embedded/index.js +2 -2
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +4 -4
- package/dist/src/agent/embedded/run-turn.js +5 -5
- package/dist/src/agent/embedded/session-tool-result-guard.js +3 -3
- package/dist/src/agent/embedded/tool-result-truncation.js +1 -1
- package/dist/src/agent/external-tools/cliProvider.js +3 -3
- package/dist/src/agent/external-tools/composio-provider.js +3 -3
- package/dist/src/agent/external-tools/gateway-tools.js +42 -2
- package/dist/src/agent/external-tools/mcp-provider.js +3 -3
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/providers/dashscope.js +1 -1
- package/dist/src/agent/image/generation/providers/fal.js +1 -1
- package/dist/src/agent/image/generation/providers/google.js +1 -1
- package/dist/src/agent/image/generation/runtime.js +1 -1
- package/dist/src/agent/image/index.js +1 -1
- package/dist/src/agent/image/load-image-media.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/index.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-config.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +2 -2
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/agent/mcp/mcp-stdio-transport.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
- package/dist/src/agent/mcp/plugin-http-fetch.js +1 -1
- package/dist/src/agent/memory/context-recovery.js +1 -1
- package/dist/src/agent/memory/index.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
- package/dist/src/agent/prompt/sections/behavior.js +4 -1
- package/dist/src/agent/prompt/sections/memory-skills.js +2 -0
- package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +4 -4
- package/dist/src/agent/service/process-direct-one-shot.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +5 -5
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.js +20 -20
- package/dist/src/agent/session/session-config-service.js +12 -4
- package/dist/src/agent/session/session-hydrator.js +1 -1
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/source-context/index.js +2 -2
- package/dist/src/agent/tasks/task-judge-service.js +4 -4
- package/dist/src/agent/tools/create-share-tool.js +3 -3
- package/dist/src/agent/tools/dataBatch.js +1 -1
- package/dist/src/agent/tools/delegate-tool.js +3 -3
- package/dist/src/agent/tools/delegation-parent-policy.js +1 -1
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.js +48 -22
- package/dist/src/agent/tools/fetch-text.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +3 -3
- package/dist/src/agent/tools/index.js +6 -6
- package/dist/src/agent/tools/list-dir.js +1 -1
- package/dist/src/agent/tools/personal-preference-tool.js +11 -0
- package/dist/src/agent/tools/personal-request-result-tool.d.ts +22 -0
- package/dist/src/agent/tools/personal-request-result-tool.js +84 -0
- package/dist/src/agent/tools/personal-request-tool.d.ts +3 -0
- package/dist/src/agent/tools/personal-request-tool.js +100 -0
- package/dist/src/agent/tools/personal-task-tool.d.ts +6 -0
- package/dist/src/agent/tools/personal-task-tool.js +14 -12
- package/dist/src/agent/tools/publish-artifacts.js +2 -2
- package/dist/src/agent/tools/read.js +2 -2
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/agent/tools/send-media.js +2 -2
- package/dist/src/agent/tools/skills-tools.js +1 -1
- package/dist/src/agent/tools/tool-media.js +2 -3
- package/dist/src/agent/tools/tts-tool.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +1 -1
- package/dist/src/agent/tools/write.js +2 -2
- package/dist/src/agent/tools/xopc-use-tool.js +3 -3
- package/dist/src/agent/workflow/subagent-runner.js +1 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/domain/index.js +2 -2
- package/dist/src/automations/index.js +4 -4
- package/dist/src/automations/service/automation-service.js +2 -2
- package/dist/src/backup/archive.js +1 -1
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
- package/dist/src/channels/index.js +2 -2
- package/dist/src/channels/outbound-sender.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +9 -9
- package/dist/src/channels/pairing/pairing-store.js +6 -6
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +3 -3
- package/dist/src/chat-commands/builtins/review.js +1 -1
- package/dist/src/chat-commands/builtins/session.js +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +1 -1
- package/dist/src/chat-commands/builtins/tts.js +1 -1
- package/dist/src/chat-commands/builtins/understanding.js +1 -1
- package/dist/src/chat-commands/builtins/workflow.js +2 -2
- package/dist/src/chat-commands/context.js +3 -3
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +6 -6
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +2 -2
- package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +2 -2
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +2 -2
- package/dist/src/cli/commands/extension.js +4 -4
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/gateway/token.js +1 -1
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/onboard/channels/registry.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +2 -2
- package/dist/src/cli/commands/runtime.js +1 -1
- package/dist/src/cli/commands/skills.js +2 -2
- package/dist/src/cli/commands/tunnel.js +4 -4
- package/dist/src/cli/extension-cli-register.js +5 -5
- package/dist/src/cli/templates.js +4 -0
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/cli/utils/session.js +1 -1
- package/dist/src/computer/runtime.js +2 -2
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/connectors/cli/authorization.js +1 -1
- package/dist/src/connectors/cli/runtime.js +1 -1
- package/dist/src/connectors/composio-sessions.js +1 -1
- package/dist/src/connectors/composio.js +1 -1
- package/dist/src/connectors/connected-source-understanding.js +3 -3
- package/dist/src/connectors/connection-recovery-service.d.ts +2 -0
- package/dist/src/connectors/connection-recovery-service.js +28 -10
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/connectors/plugin-mcp-recovery.js +1 -1
- package/dist/src/discussions/live-worker.js +1 -1
- package/dist/src/discussions/recording.js +1 -1
- package/dist/src/discussions/sealer.js +1 -1
- package/dist/src/extensions/activation-context.js +3 -3
- package/dist/src/extensions/api.js +4 -4
- package/dist/src/extensions/bundled-extension-activation.js +1 -1
- package/dist/src/extensions/index.js +3 -3
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/loader.js +2 -2
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/extensions/sdk/media.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/device-routes.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +2 -2
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/app.js +3 -3
- package/dist/src/gateway/hono/lib/config-payload.js +3 -3
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/browser.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +4 -4
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
- package/dist/src/gateway/hono/routes/home.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +2 -2
- package/dist/src/gateway/hono/routes/media.js +5 -4
- package/dist/src/gateway/hono/routes/models.js +6 -6
- package/dist/src/gateway/hono/routes/notes.js +1 -1
- package/dist/src/gateway/hono/routes/personal-agent.js +69 -1
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-command-handler.js +1 -1
- package/dist/src/gateway/hono/routes/session-input-handler.js +3 -3
- package/dist/src/gateway/hono/routes/sessions.js +2 -2
- package/dist/src/gateway/hono/routes/shares.js +3 -3
- package/dist/src/gateway/hono/routes/side-chats.js +1 -1
- package/dist/src/gateway/hono/routes/site-shares.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
- package/dist/src/gateway/hono/routes/user-model.js +5 -5
- package/dist/src/gateway/hono/routes/voice.js +7 -7
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/lock.js +11 -11
- package/dist/src/gateway/media-access.js +3 -3
- package/dist/src/gateway/mobile-privacy.js +2 -2
- package/dist/src/gateway/ports.js +6 -6
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/scenes/mailContext.js +1 -1
- package/dist/src/gateway/scenes/slackThreadSource.js +1 -1
- package/dist/src/gateway/server.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +3 -3
- package/dist/src/gateway/service/run-gateway-agent.js +3 -3
- package/dist/src/gateway/service/session-command-service.js +2 -2
- package/dist/src/gateway/service/sessions-api.js +1 -1
- package/dist/src/gateway/service.d.ts +3 -0
- package/dist/src/gateway/service.js +81 -40
- package/dist/src/gateway/session-context-summary.js +2 -2
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/home-intelligence/generator.js +1 -1
- package/dist/src/infra/gateway-processes.js +2 -2
- package/dist/src/infra/path-env.js +3 -3
- package/dist/src/infra/update-global.js +10 -10
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/mcp/gateway-http-client.js +1 -1
- package/dist/src/media/index.js +2 -2
- package/dist/src/media/session-references.d.ts +2 -0
- package/dist/src/media/session-references.js +22 -2
- package/dist/src/media/store.d.ts +1 -0
- package/dist/src/media/store.js +2 -1
- package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
- package/dist/src/notes/agent-context.js +4 -4
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/service.js +1 -1
- package/dist/src/notes/store.js +1 -1
- package/dist/src/personal-agent/capability-service.d.ts +14 -0
- package/dist/src/personal-agent/capability-service.js +63 -0
- package/dist/src/personal-agent/communication.d.ts +4 -0
- package/dist/src/personal-agent/communication.js +24 -0
- package/dist/src/personal-agent/model-config.d.ts +5 -0
- package/dist/src/personal-agent/model-config.js +59 -0
- package/dist/src/personal-agent/policy.d.ts +1 -1
- package/dist/src/personal-agent/policy.js +2 -0
- package/dist/src/personal-agent/repository.d.ts +1 -0
- package/dist/src/personal-agent/repository.js +3 -1
- package/dist/src/personal-agent/request-delivery.d.ts +4 -0
- package/dist/src/personal-agent/request-delivery.js +159 -0
- package/dist/src/personal-agent/request-repository.d.ts +33 -0
- package/dist/src/personal-agent/request-repository.js +71 -0
- package/dist/src/personal-agent/request-result.d.ts +21 -0
- package/dist/src/personal-agent/request-result.js +45 -0
- package/dist/src/personal-agent/request-service.d.ts +18 -0
- package/dist/src/personal-agent/request-service.js +308 -0
- package/dist/src/personal-agent/service.js +30 -7
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/remote-access/exposure-manager.js +1 -1
- package/dist/src/scenes/taskFollowUp/agentExecutor.js +4 -4
- package/dist/src/scenes/taskFollowUp/resources.js +1 -1
- package/dist/src/scenes/taskFollowUp/service.js +4 -4
- package/dist/src/session/client-history.d.ts +2 -1
- package/dist/src/session/client-history.js +40 -0
- package/dist/src/session/compact-history.js +9 -5
- package/dist/src/session/config-store.js +2 -1
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/resolve-session.js +1 -1
- package/dist/src/session/session-context-for-llm.js +55 -0
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +6 -4
- package/dist/src/session/thinking-resolve.js +1 -1
- package/dist/src/session/types.d.ts +2 -0
- package/dist/src/share/share-store.js +1 -1
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/share/site-proxy.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/connection-wait-repository.d.ts +5 -1
- package/dist/src/storage/sqlite/connection-wait-repository.js +38 -8
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/storage/sqlite/migrations/231_task_result_deliveries.sql +32 -0
- package/dist/src/storage/sqlite/migrations/232_personal_requests.sql +28 -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-repository.js +33 -0
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tasks/execution-context.js +1 -1
- package/dist/src/tasks/home-query-service.js +3 -3
- package/dist/src/tasks/index.js +4 -4
- package/dist/src/tasks/task-application-service.d.ts +1 -0
- package/dist/src/tasks/task-application-service.js +10 -3
- package/dist/src/tasks/task-collaboration-delivery.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +2 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-main-update-decision-service.js +1 -1
- package/dist/src/tasks/task-main-update-delivery.js +32 -1
- package/dist/src/tasks/task-result-delivery-repository.d.ts +18 -0
- package/dist/src/tasks/task-result-delivery-repository.js +144 -0
- package/dist/src/tasks/task-result-delivery-service.d.ts +4 -0
- package/dist/src/tasks/task-result-delivery-service.js +128 -0
- package/dist/src/tasks/task-run-coordinator.js +6 -1
- package/dist/src/tasks/task-run-dispatcher.d.ts +1 -0
- package/dist/src/tasks/task-run-dispatcher.js +22 -3
- package/dist/src/tui/backends/embedded-backend.js +10 -10
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-command-formatters.js +1 -1
- package/dist/src/tui/tui-commands.js +6 -6
- package/dist/src/tui/tui-picker-overlay.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +4 -4
- package/dist/src/tui/tui.js +7 -7
- package/dist/src/tunnel/frpc-binary.js +1 -1
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/voice/realtime/memory-context.js +3 -3
- package/dist/src/voice/realtime/runtime.js +4 -4
- package/dist/src/voice/stt/index.js +2 -2
- package/dist/src/voice/stt/preflight.js +1 -1
- package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
- package/dist/src/voice/stt/transcribe-core.js +1 -1
- package/dist/src/voice/tts/index.js +3 -3
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/payload.js +1 -1
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
- package/dist/src/voice/tts/speak-core.js +1 -1
- package/dist/src/work-discovery/incremental-repository.js +1 -1
- package/dist/src/work-discovery/index.js +1 -1
- package/dist/src/work-discovery/service.js +5 -5
- package/dist/src/workflows/engine/workflow-engine.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +8 -8
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-B23VK3UU.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-BuKJ-Ybo.js +0 -1
- package/dist/gateway/static/root/assets/agents-DxH-UFs7.js +0 -66
- package/dist/gateway/static/root/assets/automations-workspace-DMqpfefB.js +0 -7
- package/dist/gateway/static/root/assets/capabilities-page-KUggKcIq.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CD5K7e1B.js +0 -8
- package/dist/gateway/static/root/assets/channels-CG_xCUnf.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-CqY40STw.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Cn14oruE.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-B4jSGi8k.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DKO8iqDJ.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-DAQu7q_Q.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BHS2713D.js +0 -1
- package/dist/gateway/static/root/assets/index-BcTY7RBG.js +0 -106
- package/dist/gateway/static/root/assets/notes-page-FORwlFnt.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-BpTFGG44.js +0 -1
- package/dist/gateway/static/root/assets/popover-select-BNZZDJpO.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CzzTxbhr.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-BK5IvdGz.js +0 -16
- package/dist/gateway/static/root/assets/sessions-page-DkXKhSWK.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-C7ww6VRj.js +0 -1
- package/dist/gateway/static/root/assets/settings-shell-layer-context-BTQUDoJ2.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DXpj-oOC.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-cwXzLyU0.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-DpPGpkkg.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-CgJlVdec.js +0 -6
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { createLogger } from "../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { afterSqliteCommit, getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
4
|
+
import { TurnOutcomeSchema } from "../../packages/gateway-contract/src/turn-outcome.js";
|
|
5
|
+
import { TaskResultDeliverySchema } from "../../packages/gateway-contract/src/task-result-delivery.js";
|
|
6
|
+
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
7
|
+
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
8
|
+
import { init_request_repository, personalRequestForTask } from "../personal-agent/request-repository.js";
|
|
9
|
+
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
10
|
+
import { TaskCollaborationRepository } from "./task-collaboration-repository.js";
|
|
11
|
+
import { randomUUID } from "node:crypto";
|
|
12
|
+
//#region src/tasks/task-result-delivery-repository.ts
|
|
13
|
+
init_src();
|
|
14
|
+
init_transaction();
|
|
15
|
+
init_task_run_repository();
|
|
16
|
+
init_logger();
|
|
17
|
+
init_request_repository();
|
|
18
|
+
const log = createLogger("TaskResultDelivery");
|
|
19
|
+
const queuedListeners = /* @__PURE__ */ new Set();
|
|
20
|
+
function onTaskResultQueued(listener) {
|
|
21
|
+
queuedListeners.add(listener);
|
|
22
|
+
return () => {
|
|
23
|
+
queuedListeners.delete(listener);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
var TaskResultDeliveryRepository = class {
|
|
27
|
+
capture(runId, value) {
|
|
28
|
+
const outcome = TurnOutcomeSchema.parse({
|
|
29
|
+
...value,
|
|
30
|
+
evidence: [],
|
|
31
|
+
changeSet: void 0,
|
|
32
|
+
summary: value.summary.slice(0, 2e3)
|
|
33
|
+
});
|
|
34
|
+
if (outcome.deliverables.length > 50 || JSON.stringify(outcome).length > 256e3) throw new Error("Task outcome exceeds delivery limits");
|
|
35
|
+
const run = new TaskRunRepository().get(runId);
|
|
36
|
+
if (!run || ![
|
|
37
|
+
"running",
|
|
38
|
+
"waiting",
|
|
39
|
+
"verifying"
|
|
40
|
+
].includes(run.status)) return;
|
|
41
|
+
const state = new TaskConversationRepository().getState(run.taskId);
|
|
42
|
+
if (!state || state.activeConversationId !== run.conversationId) return;
|
|
43
|
+
getSqliteDatabase().prepare(`INSERT INTO task_run_outcomes
|
|
44
|
+
(task_run_id, outcome_id, assignment_epoch, outcome_json, created_at)
|
|
45
|
+
VALUES (?, ?, ?, ?, ?) ON CONFLICT(task_run_id, outcome_id) DO NOTHING`).run(runId, outcome.outcomeId, state.assignmentEpoch, JSON.stringify(outcome), Date.now());
|
|
46
|
+
}
|
|
47
|
+
/** Called inside the run completion transaction, after stale receipts are rejected. */
|
|
48
|
+
enqueue(runId, summary, status, resultText) {
|
|
49
|
+
const db = getSqliteDatabase();
|
|
50
|
+
const run = new TaskRunRepository().get(runId);
|
|
51
|
+
if (!run || run.parentRunId) return false;
|
|
52
|
+
const state = new TaskConversationRepository().getState(run.taskId);
|
|
53
|
+
if (!state || state.activeConversationId !== run.conversationId) return false;
|
|
54
|
+
const origin = db.prepare(`SELECT origin.*, task.title FROM task_origin_links origin
|
|
55
|
+
JOIN tasks task ON task.task_id = origin.task_id
|
|
56
|
+
WHERE origin.task_id = ?`).get(run.taskId);
|
|
57
|
+
if (!origin?.origin_transcript_id) return false;
|
|
58
|
+
const outcomes = db.prepare(`SELECT outcome_json FROM task_run_outcomes
|
|
59
|
+
WHERE task_run_id = ? AND assignment_epoch = ? ORDER BY created_at, rowid LIMIT 100`).all(runId, state.assignmentEpoch).map((row) => TurnOutcomeSchema.parse(JSON.parse(row.outcome_json)));
|
|
60
|
+
const latest = outcomes.at(-1);
|
|
61
|
+
if (!latest) return false;
|
|
62
|
+
const artifacts = /* @__PURE__ */ new Map();
|
|
63
|
+
for (const outcome of outcomes) for (const item of outcome.deliverables) artifacts.set(item.sourceFileId ?? item.artifactId, item);
|
|
64
|
+
const deliverables = [...artifacts.values()].slice(-50);
|
|
65
|
+
const text = resultText?.trim() && resultText.trim() !== "NO_REPLY" ? resultText.trim().slice(0, 8e3) : void 0;
|
|
66
|
+
if (!deliverables.length && (!text || status !== "succeeded")) return false;
|
|
67
|
+
if (!deliverables.length && personalRequestForTask(run.taskId)) return false;
|
|
68
|
+
const outcome = {
|
|
69
|
+
...latest,
|
|
70
|
+
deliverables,
|
|
71
|
+
evidence: [],
|
|
72
|
+
changeSet: void 0,
|
|
73
|
+
summary: summary.slice(0, 2e3),
|
|
74
|
+
status: status === "failed" || deliverables.some((item) => item.availability !== "available") ? "partial" : "succeeded"
|
|
75
|
+
};
|
|
76
|
+
const now = Date.now();
|
|
77
|
+
const delivery = TaskResultDeliverySchema.parse({
|
|
78
|
+
version: 1,
|
|
79
|
+
deliveryId: randomUUID(),
|
|
80
|
+
taskId: run.taskId,
|
|
81
|
+
taskRunId: runId,
|
|
82
|
+
taskTitle: origin.title.slice(0, 300),
|
|
83
|
+
conversationId: origin.conversation_id,
|
|
84
|
+
originTranscriptId: origin.origin_transcript_id,
|
|
85
|
+
...origin.request_input_id ? { requestInputId: origin.request_input_id } : {},
|
|
86
|
+
assignmentEpoch: state.assignmentEpoch,
|
|
87
|
+
outcome,
|
|
88
|
+
...text ? { text } : {},
|
|
89
|
+
createdAt: now
|
|
90
|
+
});
|
|
91
|
+
db.prepare(`INSERT INTO task_result_deliveries
|
|
92
|
+
(delivery_id, task_run_id, conversation_id, payload_json, status, next_attempt_at, created_at)
|
|
93
|
+
VALUES (?, ?, ?, ?, 'pending', ?, ?) ON CONFLICT(task_run_id, conversation_id) DO NOTHING`).run(delivery.deliveryId, runId, origin.conversation_id, JSON.stringify(delivery), now, now);
|
|
94
|
+
db.prepare(`UPDATE task_main_update_deliveries SET status = 'delivered', decision = 'silent',
|
|
95
|
+
decision_reason = 'Structured task result delivery', updated_at = ?
|
|
96
|
+
WHERE entry_id IN (SELECT entry_id FROM task_collaboration_entries
|
|
97
|
+
WHERE task_run_id = ? AND kind IN ('result', 'progress'))`).run(now, runId);
|
|
98
|
+
afterSqliteCommit(() => {
|
|
99
|
+
for (const listener of queuedListeners) try {
|
|
100
|
+
listener();
|
|
101
|
+
} catch (err) {
|
|
102
|
+
log.warn({
|
|
103
|
+
err,
|
|
104
|
+
runId
|
|
105
|
+
}, "Task result wake failed; polling will recover");
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
hasForRun(runId) {
|
|
111
|
+
return Boolean(getSqliteDatabase().prepare(`SELECT 1 FROM task_result_deliveries
|
|
112
|
+
WHERE task_run_id = ? AND status IN ('pending', 'delivered')`).get(runId));
|
|
113
|
+
}
|
|
114
|
+
hasCapturedOutcome(runId) {
|
|
115
|
+
return Boolean(getSqliteDatabase().prepare("SELECT 1 FROM task_run_outcomes WHERE task_run_id = ? LIMIT 1").get(runId));
|
|
116
|
+
}
|
|
117
|
+
pending(limit = 20) {
|
|
118
|
+
return getSqliteDatabase().prepare(`SELECT * FROM task_result_deliveries
|
|
119
|
+
WHERE status IN ('pending', 'delivered') AND next_attempt_at <= ? AND notified_at IS NULL
|
|
120
|
+
ORDER BY created_at LIMIT ?`).all(Date.now(), limit);
|
|
121
|
+
}
|
|
122
|
+
retry(id, error) {
|
|
123
|
+
runSqliteWriteTransaction((db) => {
|
|
124
|
+
db.prepare(`UPDATE task_result_deliveries SET attempts = attempts + 1,
|
|
125
|
+
status = CASE WHEN status = 'pending' AND attempts >= 7 THEN 'failed' ELSE status END,
|
|
126
|
+
notified_at = CASE WHEN status = 'delivered' AND attempts >= 7 THEN -1 ELSE notified_at END,
|
|
127
|
+
next_attempt_at = ? + MIN(60000, 1000 * (1 << MIN(attempts, 6))), last_error = ?
|
|
128
|
+
WHERE delivery_id = ? AND status IN ('pending', 'delivered')`).run(Date.now(), error.slice(0, 500), id);
|
|
129
|
+
const row = db.prepare("SELECT task_run_id FROM task_result_deliveries WHERE delivery_id = ? AND status = 'failed'").get(id);
|
|
130
|
+
const run = row ? new TaskRunRepository().get(row.task_run_id) : void 0;
|
|
131
|
+
if (run) new TaskCollaborationRepository().append({
|
|
132
|
+
taskId: run.taskId,
|
|
133
|
+
taskRunId: run.id,
|
|
134
|
+
authorKind: "system",
|
|
135
|
+
authorId: "task-result-delivery",
|
|
136
|
+
kind: "failure",
|
|
137
|
+
body: "The task produced results, but delivery to the main chat failed. Inspect the published artifacts and retry delivery; do not regenerate paid outputs just to send them.",
|
|
138
|
+
idempotencyKey: `task-result-delivery-failed:${id}`
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
//#endregion
|
|
144
|
+
export { TaskResultDeliveryRepository, onTaskResultQueued };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { createLogger } from "../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
4
|
+
import { TaskResultDeliverySchema } from "../../packages/gateway-contract/src/task-result-delivery.js";
|
|
5
|
+
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
6
|
+
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
7
|
+
import { appendTranscriptEntry, init_transcript_repository } from "../storage/sqlite/transcript-repository.js";
|
|
8
|
+
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
9
|
+
import { tryParseMediaUri } from "../media/uri.js";
|
|
10
|
+
import { resolveMediaBufferPath } from "../media/store.js";
|
|
11
|
+
import { emitSessionTranscriptUpdate } from "../session/transcript-events.js";
|
|
12
|
+
import { TaskResultDeliveryRepository } from "./task-result-delivery-repository.js";
|
|
13
|
+
import { lstat } from "node:fs/promises";
|
|
14
|
+
//#region src/tasks/task-result-delivery-service.ts
|
|
15
|
+
init_src();
|
|
16
|
+
init_transcript_repository();
|
|
17
|
+
init_transaction();
|
|
18
|
+
init_logger();
|
|
19
|
+
init_task_run_repository();
|
|
20
|
+
const log = createLogger("TaskResultDelivery");
|
|
21
|
+
async function materializedArtifact(item) {
|
|
22
|
+
const { workspaceRelativePath: _path, thumbnailUrl: _thumbnail, ...artifact } = item;
|
|
23
|
+
if (item.availability !== "available") return {
|
|
24
|
+
...artifact,
|
|
25
|
+
uri: void 0,
|
|
26
|
+
shareUrl: void 0,
|
|
27
|
+
capabilities: []
|
|
28
|
+
};
|
|
29
|
+
const media = item.uri ? tryParseMediaUri(item.uri) : null;
|
|
30
|
+
if (media?.bucket === "outbound" && item.location === "artifact_store") {
|
|
31
|
+
const file = await lstat(resolveMediaBufferPath(media.id, media.bucket)).catch(() => null);
|
|
32
|
+
if (file?.isFile() && file.size <= 52428800) return {
|
|
33
|
+
...artifact,
|
|
34
|
+
sizeBytes: file.size,
|
|
35
|
+
shareUrl: void 0,
|
|
36
|
+
capabilities: item.capabilities.filter((capability) => capability === "preview" || capability === "download")
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
...artifact,
|
|
40
|
+
availability: "missing",
|
|
41
|
+
uri: void 0,
|
|
42
|
+
shareUrl: void 0,
|
|
43
|
+
capabilities: []
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
if (item.kind === "site" && item.location === "external_host") try {
|
|
47
|
+
const url = new URL(item.shareUrl ?? item.uri ?? "");
|
|
48
|
+
if (url.protocol === "https:" && !url.username && !url.password) return {
|
|
49
|
+
...artifact,
|
|
50
|
+
uri: url.href,
|
|
51
|
+
shareUrl: url.href,
|
|
52
|
+
capabilities: ["open"]
|
|
53
|
+
};
|
|
54
|
+
} catch {}
|
|
55
|
+
return {
|
|
56
|
+
...artifact,
|
|
57
|
+
availability: "failed",
|
|
58
|
+
uri: void 0,
|
|
59
|
+
shareUrl: void 0,
|
|
60
|
+
capabilities: []
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
var TaskResultDeliveryService = class {
|
|
64
|
+
#repository = new TaskResultDeliveryRepository();
|
|
65
|
+
async drain(notify, limit = 20) {
|
|
66
|
+
let delivered = 0;
|
|
67
|
+
for (const row of this.#repository.pending(limit)) try {
|
|
68
|
+
const delivery = TaskResultDeliverySchema.parse(JSON.parse(row.payload_json));
|
|
69
|
+
if (row.status === "pending") {
|
|
70
|
+
const deliverables = await Promise.all(delivery.outcome.deliverables.map(materializedArtifact));
|
|
71
|
+
if (!runSqliteWriteTransaction((db) => {
|
|
72
|
+
const current = db.prepare("SELECT status FROM task_result_deliveries WHERE delivery_id = ?").get(row.delivery_id);
|
|
73
|
+
if (current?.status !== "pending") return current?.status === "delivered";
|
|
74
|
+
const run = new TaskRunRepository().get(delivery.taskRunId);
|
|
75
|
+
const state = new TaskConversationRepository().getState(delivery.taskId);
|
|
76
|
+
const session = db.prepare("SELECT active_transcript_id FROM sessions WHERE conversation_id = ?").get(delivery.conversationId);
|
|
77
|
+
const task = db.prepare("SELECT resolution FROM tasks WHERE task_id = ?").get(delivery.taskId);
|
|
78
|
+
if (!session || !run || !["succeeded", "failed"].includes(run.status) || task.resolution && task.resolution !== "done" || new TaskRunRepository().getLatestRoot(delivery.taskId)?.id !== run.id || state?.assignmentEpoch !== delivery.assignmentEpoch || state.activeConversationId !== run.conversationId) {
|
|
79
|
+
db.prepare("UPDATE task_result_deliveries SET status = 'stale' WHERE delivery_id = ?").run(row.delivery_id);
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
const available = deliverables.filter((item) => item.availability === "available").length;
|
|
83
|
+
const outcome = {
|
|
84
|
+
...delivery.outcome,
|
|
85
|
+
deliverables,
|
|
86
|
+
status: deliverables.length > 0 && available === 0 ? "failed" : available < deliverables.length ? "partial" : delivery.outcome.status
|
|
87
|
+
};
|
|
88
|
+
const statusText = db.prepare("SELECT locale FROM tasks WHERE task_id = ?").get(delivery.taskId).locale?.startsWith("zh") === true ? `${delivery.taskTitle}:${available === deliverables.length ? "成果已生成" : available > 0 ? "部分成果已生成" : "成果暂不可用"}。` : `${delivery.taskTitle}: ${available === deliverables.length ? "Results ready" : available > 0 ? "Partial results ready" : "Results unavailable"}.`;
|
|
89
|
+
const content = delivery.text ? `${statusText}\n\n${delivery.text}` : statusText;
|
|
90
|
+
const details = {
|
|
91
|
+
...delivery,
|
|
92
|
+
outcome
|
|
93
|
+
};
|
|
94
|
+
const entry = appendTranscriptEntry(delivery.conversationId, {
|
|
95
|
+
role: "custom",
|
|
96
|
+
customType: "task_result_delivery",
|
|
97
|
+
content,
|
|
98
|
+
display: true,
|
|
99
|
+
details,
|
|
100
|
+
timestamp: Date.now()
|
|
101
|
+
});
|
|
102
|
+
db.prepare(`UPDATE task_result_deliveries SET status = 'delivered', payload_json = ?,
|
|
103
|
+
message_entry_id = ?, delivered_at = ? WHERE delivery_id = ?`).run(JSON.stringify(details), entry.entry_id, Date.now(), row.delivery_id);
|
|
104
|
+
return true;
|
|
105
|
+
})) continue;
|
|
106
|
+
}
|
|
107
|
+
emitSessionTranscriptUpdate({ conversationId: delivery.conversationId });
|
|
108
|
+
notify(delivery.conversationId, delivery.deliveryId);
|
|
109
|
+
getSqliteDatabase().prepare("UPDATE task_result_deliveries SET notified_at = ? WHERE delivery_id = ?").run(Date.now(), row.delivery_id);
|
|
110
|
+
delivered += 1;
|
|
111
|
+
log.info({
|
|
112
|
+
conversationId: delivery.conversationId,
|
|
113
|
+
taskId: delivery.taskId,
|
|
114
|
+
deliveryId: delivery.deliveryId,
|
|
115
|
+
durationMs: Date.now() - delivery.createdAt
|
|
116
|
+
}, "Task result delivered to main Chat");
|
|
117
|
+
} catch (error) {
|
|
118
|
+
this.#repository.retry(row.delivery_id, error instanceof Error ? error.message : String(error));
|
|
119
|
+
if (row.attempts === 0 || row.attempts === 7) log.warn({
|
|
120
|
+
err: error,
|
|
121
|
+
deliveryId: row.delivery_id
|
|
122
|
+
}, "Task result delivery failed");
|
|
123
|
+
}
|
|
124
|
+
return delivered;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
//#endregion
|
|
128
|
+
export { TaskResultDeliveryService };
|
|
@@ -2,6 +2,7 @@ import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
|
2
2
|
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
3
3
|
import { TaskContextRepository } from "./task-context-repository.js";
|
|
4
4
|
import { TaskCollaborationRepository } from "./task-collaboration-repository.js";
|
|
5
|
+
import { TaskResultDeliveryRepository } from "./task-result-delivery-repository.js";
|
|
5
6
|
import { TaskApplicationService } from "./task-application-service.js";
|
|
6
7
|
//#region src/tasks/task-run-coordinator.ts
|
|
7
8
|
init_task_repository();
|
|
@@ -10,6 +11,7 @@ var TaskRunCoordinator = class TaskRunCoordinator {
|
|
|
10
11
|
#evidence = [];
|
|
11
12
|
#application = new TaskApplicationService();
|
|
12
13
|
#runs = new TaskRunRepository();
|
|
14
|
+
#hasDeliverables = false;
|
|
13
15
|
constructor(runId) {
|
|
14
16
|
this.runId = runId;
|
|
15
17
|
}
|
|
@@ -81,6 +83,8 @@ var TaskRunCoordinator = class TaskRunCoordinator {
|
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
captureOutcome(outcome) {
|
|
86
|
+
new TaskResultDeliveryRepository().capture(this.runId, outcome);
|
|
87
|
+
this.#hasDeliverables ||= outcome.deliverables.some((item) => item.availability === "available");
|
|
84
88
|
for (const item of outcome.evidence) {
|
|
85
89
|
if (item.kind !== "check") continue;
|
|
86
90
|
this.addEvidence({
|
|
@@ -113,12 +117,13 @@ var TaskRunCoordinator = class TaskRunCoordinator {
|
|
|
113
117
|
if (run.status === "waiting" && this.#runs.listActiveWaits(run.taskId).length > 0) return;
|
|
114
118
|
const hasAssistantResult = Boolean(input.assistantText?.trim() && input.assistantText.trim() !== "NO_REPLY");
|
|
115
119
|
const hasBoardResult = new TaskCollaborationRepository().recent(run.taskId, void 0, 20).some((entry) => entry.taskRunId === run.id && entry.kind === "result");
|
|
116
|
-
const emptySuccess = input.status === "succeeded" && !hasAssistantResult && !hasBoardResult && this.#evidence.length === 0;
|
|
120
|
+
const emptySuccess = input.status === "succeeded" && !hasAssistantResult && !hasBoardResult && !this.#hasDeliverables && this.#evidence.length === 0;
|
|
117
121
|
const status = emptySuccess ? "failed" : input.status;
|
|
118
122
|
const summary = emptySuccess ? "Agent run returned no result or evidence" : input.summary;
|
|
119
123
|
this.#application.completeRun({
|
|
120
124
|
runId: run.id,
|
|
121
125
|
expectedRunVersion: run.version,
|
|
126
|
+
resultText: input.assistantText,
|
|
122
127
|
receipt: {
|
|
123
128
|
status,
|
|
124
129
|
summary,
|
|
@@ -16,13 +16,24 @@ var TaskRunDispatcher = class {
|
|
|
16
16
|
#application = new TaskApplicationService();
|
|
17
17
|
#draining = /* @__PURE__ */ new Set();
|
|
18
18
|
#activeRunIds = /* @__PURE__ */ new Set();
|
|
19
|
+
#heartbeats = /* @__PURE__ */ new Set();
|
|
20
|
+
#stopped = false;
|
|
19
21
|
constructor(deps) {
|
|
20
22
|
this.deps = deps;
|
|
21
23
|
}
|
|
22
24
|
dispatch() {
|
|
23
|
-
this.drain()
|
|
25
|
+
this.drain().catch((error) => {
|
|
26
|
+
if (this.#stopped) return;
|
|
27
|
+
log.error({ err: error }, `TaskRun dispatch failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
stop() {
|
|
31
|
+
this.#stopped = true;
|
|
32
|
+
for (const heartbeat of this.#heartbeats) clearInterval(heartbeat);
|
|
33
|
+
this.#heartbeats.clear();
|
|
24
34
|
}
|
|
25
35
|
async drain() {
|
|
36
|
+
if (this.#stopped) return;
|
|
26
37
|
this.reconcileExpiredRuns();
|
|
27
38
|
const count = Math.max(1, Math.min(8, this.deps.maxConcurrency ?? 3));
|
|
28
39
|
await Promise.all(Array.from({ length: count }, (_, slot) => this.drainSlot(`${this.deps.workerId}:${slot}`)));
|
|
@@ -67,7 +78,7 @@ var TaskRunDispatcher = class {
|
|
|
67
78
|
if (this.#draining.has(workerId)) return;
|
|
68
79
|
this.#draining.add(workerId);
|
|
69
80
|
try {
|
|
70
|
-
while (
|
|
81
|
+
while (!this.#stopped) {
|
|
71
82
|
const run = this.#runs.claimNext({
|
|
72
83
|
owner: workerId,
|
|
73
84
|
leaseMs: LEASE_MS,
|
|
@@ -89,22 +100,29 @@ var TaskRunDispatcher = class {
|
|
|
89
100
|
}) : run)) continue;
|
|
90
101
|
const agentId = typeof run.executorRef.agentId === "string" ? run.executorRef.agentId : void 0;
|
|
91
102
|
const conversationId = await this.deps.ensureSession(task.id, run.id, agentId);
|
|
103
|
+
if (this.#stopped) return;
|
|
92
104
|
this.#activeRunIds.add(run.id);
|
|
93
105
|
const heartbeat = setInterval(() => {
|
|
94
106
|
if (!this.#runs.heartbeat({
|
|
95
107
|
runId: run.id,
|
|
96
108
|
owner: workerId,
|
|
97
109
|
leaseMs: LEASE_MS
|
|
98
|
-
}))
|
|
110
|
+
})) {
|
|
111
|
+
clearInterval(heartbeat);
|
|
112
|
+
this.#heartbeats.delete(heartbeat);
|
|
113
|
+
}
|
|
99
114
|
}, HEARTBEAT_MS);
|
|
100
115
|
heartbeat.unref?.();
|
|
116
|
+
this.#heartbeats.add(heartbeat);
|
|
101
117
|
try {
|
|
102
118
|
await this.deps.runAgent(run.id, conversationId, buildTaskRunMessage(task.contract?.objective ?? task.title, run.trigger, task.body));
|
|
103
119
|
} finally {
|
|
104
120
|
clearInterval(heartbeat);
|
|
121
|
+
this.#heartbeats.delete(heartbeat);
|
|
105
122
|
this.#activeRunIds.delete(run.id);
|
|
106
123
|
}
|
|
107
124
|
} catch (error) {
|
|
125
|
+
if (this.#stopped) return;
|
|
108
126
|
const current = this.#runs.get(run.id);
|
|
109
127
|
if (current && [
|
|
110
128
|
"queued",
|
|
@@ -142,6 +160,7 @@ var TaskRunDispatcher = class {
|
|
|
142
160
|
}
|
|
143
161
|
}
|
|
144
162
|
} catch (error) {
|
|
163
|
+
if (this.#stopped) return;
|
|
145
164
|
log.error({ err: error }, `TaskRun dispatch failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
146
165
|
} finally {
|
|
147
166
|
this.#draining.delete(workerId);
|
|
@@ -12,27 +12,27 @@ import { normalizeAgentId } from "../../agent-catalog/id.js";
|
|
|
12
12
|
import { init_agent_scope, listAgentEntries } from "../../agent/agent-scope.js";
|
|
13
13
|
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
14
14
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
15
|
-
import { init_paths } from "../../config/paths.js";
|
|
16
15
|
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../../routing/agent-session-key.js";
|
|
17
|
-
import { loadConfig } from "../../config/loader.js";
|
|
18
|
-
import { prependEnvelopeTimestamp } from "../../channels/envelope-timestamp.js";
|
|
19
16
|
import { resolveEffectiveAgentProfile } from "../../config/agent-profile.js";
|
|
17
|
+
import { init_paths } from "../../config/paths.js";
|
|
20
18
|
import { effectiveWorkspacePathForSession } from "../../session/session-workspace.js";
|
|
21
|
-
import { buildReviewContext, resolveGitRoot } from "../../review/review-git.js";
|
|
22
|
-
import { MessageBus, MessageBusShutdownError } from "../../infra/bus/queue.js";
|
|
23
|
-
import "../../infra/bus/index.js";
|
|
24
|
-
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
25
|
-
import "../../config/index.js";
|
|
26
19
|
import { ProjectService } from "../../projects/project-service.js";
|
|
27
20
|
import { inferSuggestedProjectDefaultAgentId } from "../../projects/project-agent-suggestion.js";
|
|
28
21
|
import "../../projects/index.js";
|
|
29
22
|
import { buildSessionTimeline } from "../../session/transcript-outline.js";
|
|
30
23
|
import { transcriptRowsToClientHistory } from "../../session/client-history.js";
|
|
24
|
+
import { createCreateShareTool, isShareToolAvailable } from "../../agent/tools/create-share-tool.js";
|
|
25
|
+
import { evictEmbeddedSessionRunner } from "../../agent/embedded/session-runner.js";
|
|
31
26
|
import { SessionIndex } from "../../session/manager.js";
|
|
32
27
|
import "../../session/index.js";
|
|
33
28
|
import { parseModelRef } from "../../agent/models/selection.js";
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
29
|
+
import { loadConfig } from "../../config/loader.js";
|
|
30
|
+
import { buildReviewContext, resolveGitRoot } from "../../review/review-git.js";
|
|
31
|
+
import { MessageBus, MessageBusShutdownError } from "../../infra/bus/queue.js";
|
|
32
|
+
import "../../infra/bus/index.js";
|
|
33
|
+
import { prependEnvelopeTimestamp } from "../../channels/envelope-timestamp.js";
|
|
34
|
+
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
35
|
+
import "../../config/index.js";
|
|
36
36
|
import { buildWorkflowChildTools } from "../../agent/workflow/workflow-child-tools.js";
|
|
37
37
|
import { WorkflowRunService } from "../../workflows/service/workflow-run-service.js";
|
|
38
38
|
import { WorkflowSessionBridge } from "../../workflows/service/workflow-session-bridge.js";
|
|
@@ -5,9 +5,9 @@ import { sessionInputCommandSchema } from "../../../packages/gateway-contract/sr
|
|
|
5
5
|
import { isSessionCommandRejected } from "../../../packages/gateway-contract/src/session-command-rejection.js";
|
|
6
6
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
7
7
|
import { init_paths } from "../../config/paths.js";
|
|
8
|
-
import { gatewayCredentialAuthorization } from "../../gateway/credential.js";
|
|
9
8
|
import { transcriptRowsToClientHistory } from "../../session/client-history.js";
|
|
10
9
|
import { parseModelRef } from "../../agent/models/selection.js";
|
|
10
|
+
import { gatewayCredentialAuthorization } from "../../gateway/credential.js";
|
|
11
11
|
import { RealtimeClient } from "../../../packages/realtime-client/src/index.js";
|
|
12
12
|
import { buildTuiTranscriptTree, transcriptTreeEntryIdToRowNumber } from "../tui-transcript-tree.js";
|
|
13
13
|
import { computeTuiSessionStats } from "../tui-session-stats.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { init_paths, resolveExtensionsDir } from "../../config/paths.js";
|
|
4
|
+
import { ExtensionLoader } from "../../extensions/loader.js";
|
|
4
5
|
import { loadConfig } from "../../config/loader.js";
|
|
5
6
|
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
6
7
|
import "../../config/index.js";
|
|
7
|
-
import { ExtensionLoader } from "../../extensions/loader.js";
|
|
8
8
|
//#region src/tui/extension-host/load-extensions.ts
|
|
9
9
|
init_paths();
|
|
10
10
|
init_logger();
|
|
@@ -3,8 +3,8 @@ import { getRuntimeLogStats } from "../utils/logger/stats.js";
|
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
4
|
import { resolveConfigPath } from "../config/paths.js";
|
|
5
5
|
import { getProviderDisplayName, getSortedProviders, init_providers, providerSupportsApiKey, providerSupportsOAuth } from "../providers/index.js";
|
|
6
|
-
import { normalizeVerboseLevel } from "../agent/transcript/thinking-types.js";
|
|
7
6
|
import { createWorkflowCatalog } from "../agent/workflow/catalog.js";
|
|
7
|
+
import { normalizeVerboseLevel } from "../agent/transcript/thinking-types.js";
|
|
8
8
|
import "../config/index.js";
|
|
9
9
|
import { countPendingChatInputs } from "./tui-chat-input-state.js";
|
|
10
10
|
import { computeContextUsagePercent, formatContextUsageLabel } from "./tui-context-usage.js";
|
|
@@ -2,19 +2,19 @@ import { closeXopcDatabase, isXopcDatabaseOpen, openXopcDatabase } from "../stor
|
|
|
2
2
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
3
3
|
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
4
4
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
5
|
-
import { resolveConfigPath } from "../config/paths.js";
|
|
6
5
|
import { init_agent_session_key, isValidAgentId, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
6
|
+
import { resolveConfigPath } from "../config/paths.js";
|
|
7
7
|
import { init_providers, providerSupportsOAuth } from "../providers/index.js";
|
|
8
|
-
import { loadConfig } from "../config/loader.js";
|
|
9
|
-
import { normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel } from "../agent/transcript/thinking-types.js";
|
|
10
|
-
import { createWorkflowCatalog } from "../agent/workflow/catalog.js";
|
|
11
|
-
import "../config/index.js";
|
|
12
|
-
import { provenanceTracker } from "../extensions/security.js";
|
|
13
8
|
import { ProjectService } from "../projects/project-service.js";
|
|
14
9
|
import { isValidProjectAgentId, normalizeProjectAgentId } from "../projects/project-agent.js";
|
|
15
10
|
import { inferSuggestedProjectDefaultAgentId } from "../projects/project-agent-suggestion.js";
|
|
16
11
|
import "../projects/index.js";
|
|
12
|
+
import { createWorkflowCatalog } from "../agent/workflow/catalog.js";
|
|
17
13
|
import "../tasks/index.js";
|
|
14
|
+
import { normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel } from "../agent/transcript/thinking-types.js";
|
|
15
|
+
import { provenanceTracker } from "../extensions/security.js";
|
|
16
|
+
import { loadConfig } from "../config/loader.js";
|
|
17
|
+
import "../config/index.js";
|
|
18
18
|
import { theme } from "./theme.js";
|
|
19
19
|
import { getTuiKeybindingsPath } from "./tui-keybindings-file.js";
|
|
20
20
|
import { formatKeyIds, formatXopcTuiHotkeys } from "./format-tui-hotkeys.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { listThinkingLevels, normalizeThinkLevel } from "../agent/transcript/thinking-types.js";
|
|
2
1
|
import { getProjectTrustOptions, hasTrustRequiringProjectResources } from "../project-trust/trust-store.js";
|
|
2
|
+
import { listThinkingLevels, normalizeThinkLevel } from "../agent/transcript/thinking-types.js";
|
|
3
3
|
import { searchableSelectListTheme, theme } from "./theme.js";
|
|
4
4
|
import { formatKeyIds } from "./format-tui-hotkeys.js";
|
|
5
5
|
import { formatSessionPickerDescription } from "./tui-session-format.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
2
|
import { init_paths, resolveBundledSkillsDir } from "../config/paths.js";
|
|
3
|
+
import { loadSkills } from "../agent/skills/index.js";
|
|
3
4
|
import { loadConfig } from "../config/loader.js";
|
|
4
5
|
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
5
6
|
import "../config/index.js";
|
|
6
|
-
import { loadSkills } from "../agent/skills/index.js";
|
|
7
7
|
//#region src/tui/tui-skills-autocomplete.ts
|
|
8
8
|
init_paths();
|
|
9
9
|
/** `@skill` autocomplete from workspace + global + bundled skill directories. */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
|
+
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
2
3
|
import { init_paths, resolveAgentProfileDir, resolveBundledSkillsDir } from "../config/paths.js";
|
|
4
|
+
import { resolveBootstrapFilesSync } from "../agent/bootstrap/bootstrap-files.js";
|
|
3
5
|
import { listConnectorInstances } from "../connectors/instances.js";
|
|
4
|
-
import {
|
|
6
|
+
import { createSkillConfigManager, isSkillEnabled } from "../agent/skills/config.js";
|
|
7
|
+
import { loadSkills } from "../agent/skills/index.js";
|
|
5
8
|
import { createWorkflowCatalog } from "../agent/workflow/catalog.js";
|
|
6
9
|
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
7
10
|
import "../config/index.js";
|
|
8
|
-
import { createSkillConfigManager, isSkillEnabled } from "../agent/skills/config.js";
|
|
9
|
-
import { loadSkills } from "../agent/skills/index.js";
|
|
10
|
-
import { resolveBootstrapFilesSync } from "../agent/bootstrap/bootstrap-files.js";
|
|
11
11
|
import { basename } from "node:path";
|
|
12
12
|
//#region src/tui/tui-startup-resources.ts
|
|
13
13
|
init_paths();
|
package/dist/src/tui/tui.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { version } from "../../package.js";
|
|
2
2
|
import { resolveStateDir, resolveXopcDatabasePath } from "../config/paths-state.js";
|
|
3
|
-
import { init_paths } from "../config/paths.js";
|
|
4
3
|
import { init_agent_session_key, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
5
|
-
import { getAllModels, getAllProviders, getApiKey, init_providers, isProviderConfiguredSync } from "../providers/index.js";
|
|
6
|
-
import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
7
|
-
import { loadConfig } from "../config/loader.js";
|
|
8
4
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
9
|
-
import "../config/
|
|
10
|
-
import {
|
|
11
|
-
import { renderWorkflowFinalSummary, renderWorkflowPanel } from "../agent/workflow/snapshot.js";
|
|
5
|
+
import { init_paths } from "../config/paths.js";
|
|
6
|
+
import { getAllModels, getAllProviders, getApiKey, init_providers, isProviderConfiguredSync } from "../providers/index.js";
|
|
12
7
|
import { isTerminalWorkflowRunStatus } from "../workflows/domain/run.js";
|
|
13
8
|
import "../workflows/domain/index.js";
|
|
14
9
|
import { ProjectTrustStore, hasTrustRequiringProjectResources } from "../project-trust/trust-store.js";
|
|
10
|
+
import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../gateway/chat-limits.js";
|
|
11
|
+
import { loadConfig } from "../config/loader.js";
|
|
12
|
+
import { renderWorkflowFinalSummary, renderWorkflowPanel } from "../agent/workflow/snapshot.js";
|
|
13
|
+
import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
14
|
+
import "../config/index.js";
|
|
15
15
|
import { runViewToSnapshot } from "../workflows/service/run-view-to-snapshot.js";
|
|
16
16
|
import { resolveTuiConversationId, resolveTuiStartupConversationId } from "../routing/resolve-tui-session-key.js";
|
|
17
17
|
import { applyThemeById, getBashExcludeBorderColor, getBashModeBorderColor, getCustomThemesDir, getThemeExports, getThinkingBorderColor, initTuiTheme, listAvailableThemeIds, resolveThemePalette } from "./theme-manager.js";
|
|
@@ -6,8 +6,8 @@ import { FRPC_RELEASES, FRPC_VERSION } from "./frpc-release.js";
|
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { chmodSync, createReadStream, createWriteStream, existsSync, mkdirSync, mkdtempSync, renameSync, rmSync } from "node:fs";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
|
-
import { Readable, Transform } from "node:stream";
|
|
10
9
|
import { pipeline } from "node:stream/promises";
|
|
10
|
+
import { Readable, Transform } from "node:stream";
|
|
11
11
|
//#region src/tunnel/frpc-binary.ts
|
|
12
12
|
init_paths();
|
|
13
13
|
init_logger();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { resolveGatewayEffectiveHost } from "../config/gateway-bind.js";
|
|
4
|
-
import { resolveGatewayAuth } from "../gateway/auth.js";
|
|
5
4
|
import { resolveOptionalTunnelRegistrationSecret, resolveTunnelBrokerUrl } from "./env.js";
|
|
6
5
|
import { getTunnelService } from "./tunnel-service.js";
|
|
6
|
+
import { resolveGatewayAuth } from "../gateway/auth.js";
|
|
7
7
|
import { requireTunnelGatewayToken } from "./auth-policy.js";
|
|
8
8
|
import { hasValidTunnelConsent } from "./consent.js";
|
|
9
9
|
import { resolveFrpSubdomainHost } from "./frp-subdomain-host.js";
|
|
@@ -6,12 +6,12 @@ import { getSessionConfig, init_config_repository } from "../../storage/sqlite/c
|
|
|
6
6
|
import { getConversationRouting } from "../../storage/sqlite/conversation-repository.js";
|
|
7
7
|
import { getConversation } from "../../routing/agent-session-key.js";
|
|
8
8
|
import { init_session_key } from "../../routing/session-key.js";
|
|
9
|
-
import { getUserAssertion } from "../../user-model/repository.js";
|
|
10
|
-
import "../../user-model/index.js";
|
|
11
9
|
import { getKnowledgeItem } from "../../knowledge-memory/repository.js";
|
|
12
10
|
import "../../knowledge-memory/index.js";
|
|
13
|
-
import {
|
|
11
|
+
import { getUserAssertion } from "../../user-model/repository.js";
|
|
12
|
+
import "../../user-model/index.js";
|
|
14
13
|
import { stripRuntimeContextFromUserMessage } from "../../session/user-message-display.js";
|
|
14
|
+
import { buildExecutionContext } from "../../agent/context/execution-context.js";
|
|
15
15
|
//#region src/voice/realtime/memory-context.ts
|
|
16
16
|
init_session_key();
|
|
17
17
|
init_config_repository();
|
|
@@ -4,14 +4,14 @@ import { init_changes, onUserContextChange } from "../../user-context/changes.js
|
|
|
4
4
|
import { decodeVoiceUplinkAudioFrame, encodeVoiceAudioFrame } from "../../../packages/realtime-protocol/src/voice-audio.js";
|
|
5
5
|
import { VOICE_REALTIME_HEARTBEAT_INTERVAL_MS, VOICE_REALTIME_MAX_BINARY_FRAME_BYTES, VOICE_REALTIME_START_TIMEOUT_MS, VOICE_REALTIME_WS_PATH, init_voice, parseVoiceClientJsonFrame, parseVoiceClientMessage } from "../../../packages/realtime-protocol/src/voice.js";
|
|
6
6
|
import { getModelCatalogStore, init_model_catalog_store } from "../../providers/model-catalog-store.js";
|
|
7
|
-
import { ALIBABA_REALTIME_TTS_MODEL } from "../tts/providers/alibaba-speech.js";
|
|
8
|
-
import { resolveSpeechProviderChain } from "../tts/factory.js";
|
|
9
|
-
import { mergeTtsConfigFromAppConfig } from "../tts/merge-config.js";
|
|
10
7
|
import { getMediaUnderstandingProvider } from "../../media-understanding/registry.js";
|
|
11
8
|
import { resolveSTTProviderChain } from "../stt/factory.js";
|
|
12
9
|
import { mergeSttConfigFromAppConfig } from "../stt/config.js";
|
|
13
|
-
import { voiceConversationInstructions } from "./conversation-context.js";
|
|
14
10
|
import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
|
|
11
|
+
import { ALIBABA_REALTIME_TTS_MODEL } from "../tts/providers/alibaba-speech.js";
|
|
12
|
+
import { resolveSpeechProviderChain } from "../tts/factory.js";
|
|
13
|
+
import { mergeTtsConfigFromAppConfig } from "../tts/merge-config.js";
|
|
14
|
+
import { voiceConversationInstructions } from "./conversation-context.js";
|
|
15
15
|
import { createPreauthConnectionBudget } from "../../gateway/security/preauth-connection-budget.js";
|
|
16
16
|
import { createAgentVoiceEngine } from "./agentEngine.js";
|
|
17
17
|
import { resolveOmniRoute } from "./omniRoute.js";
|