@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
|
@@ -6,6 +6,7 @@ import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "
|
|
|
6
6
|
import { init_session_instance_repository, readCurrentTranscriptId } from "./session-instance-repository.js";
|
|
7
7
|
import { bumpSessionInputRevision, getSessionInputById, getSessionInputState, init_session_input_repository, insertSessionInput, setSessionInputStatus } from "./session-input-repository.js";
|
|
8
8
|
import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-run-repository.js";
|
|
9
|
+
import { init_request_repository, personalRequestForExecution, personalRequestForWait, updatePersonalRequest } from "../../personal-agent/request-repository.js";
|
|
9
10
|
import { getConnectorAccount, init_connector_account_repository } from "./connector-account-repository.js";
|
|
10
11
|
import { getConnectorConnection, init_connector_repository } from "./connector-repository.js";
|
|
11
12
|
import { randomUUID } from "node:crypto";
|
|
@@ -68,8 +69,10 @@ function requireSessionConnection(input) {
|
|
|
68
69
|
return runSqliteWriteTransaction((db) => {
|
|
69
70
|
const transcriptId = readCurrentTranscriptId(db, input.conversationId);
|
|
70
71
|
const runtime = getSessionInputState(input.conversationId);
|
|
71
|
-
const
|
|
72
|
-
|
|
72
|
+
const originId = input.origin?.inputId ?? runtime.activeInputId;
|
|
73
|
+
const origin = originId ? getSessionInputById(input.conversationId, originId) : void 0;
|
|
74
|
+
const originRunId = input.origin?.runId ?? runtime.activeRunId;
|
|
75
|
+
if (!transcriptId || !origin || !originRunId || origin.expectedTranscriptId && origin.expectedTranscriptId !== transcriptId) throw new Error("Connection recovery requires a queued chat execution.");
|
|
73
76
|
const resumed = origin.payload ? getConnectionWait(origin.payload.waitId) : void 0;
|
|
74
77
|
if (resumed?.resolution === "skipped") return { status: "skipped" };
|
|
75
78
|
const active = getActiveConnectionWait(input.conversationId);
|
|
@@ -97,7 +100,9 @@ function requireSessionConnection(input) {
|
|
|
97
100
|
}
|
|
98
101
|
const lastEntry = db.prepare("SELECT entry_id FROM transcript_entries WHERE transcript_id = ? ORDER BY seq DESC LIMIT 1").get(transcriptId);
|
|
99
102
|
const wait = {
|
|
100
|
-
|
|
103
|
+
conversationId: input.conversationId,
|
|
104
|
+
principalId: input.principalId,
|
|
105
|
+
agentId: input.agentId,
|
|
101
106
|
needs: [...new Map(input.needs.map((need) => [need.key, need])).values()],
|
|
102
107
|
id: randomUUID(),
|
|
103
108
|
transcriptId,
|
|
@@ -105,7 +110,7 @@ function requireSessionConnection(input) {
|
|
|
105
110
|
objectiveRevision: (resumed?.objectiveRevision ?? 0) + 1,
|
|
106
111
|
objectiveUpdatedAt: resumed?.objectiveUpdatedAt ?? origin.createdAtMs,
|
|
107
112
|
originInputId: origin.id,
|
|
108
|
-
originRunId
|
|
113
|
+
originRunId,
|
|
109
114
|
taskRunId: origin.taskRunId,
|
|
110
115
|
checkpoint: {
|
|
111
116
|
entryId: lastEntry?.entry_id,
|
|
@@ -158,10 +163,16 @@ function requireSessionConnection(input) {
|
|
|
158
163
|
});
|
|
159
164
|
}
|
|
160
165
|
/** The input and the wait transition commit together, using the existing queue's unique key. */
|
|
161
|
-
function queueConnectionResolution(wait, resolution) {
|
|
166
|
+
function queueConnectionResolution(wait, resolution, resolvePersonal) {
|
|
162
167
|
return runSqliteWriteTransaction(() => {
|
|
163
168
|
const current = getConnectionWait(wait.id);
|
|
164
169
|
if (!current || current.version !== wait.version || current.status !== "open") throw new Error("WAIT_CHANGED");
|
|
170
|
+
if (resolvePersonal?.(wait, resolution)) return updateConnectionWait({
|
|
171
|
+
...wait,
|
|
172
|
+
status: "closed",
|
|
173
|
+
resolution,
|
|
174
|
+
intent: void 0
|
|
175
|
+
}, wait.version);
|
|
165
176
|
const origin = getSessionInputById(wait.conversationId, wait.originInputId);
|
|
166
177
|
if (!origin) throw new Error("Original input is unavailable.");
|
|
167
178
|
const input = insertSessionInput({
|
|
@@ -239,6 +250,21 @@ function consumeConnectionResume(input) {
|
|
|
239
250
|
}
|
|
240
251
|
function connectionBindings(conversationId) {
|
|
241
252
|
if (!isXopcDatabaseOpen()) return [];
|
|
253
|
+
const personalRequest = personalRequestForExecution(conversationId);
|
|
254
|
+
if (personalRequest?.accountId) {
|
|
255
|
+
const account = getConnectorAccount(personalRequest.accountId);
|
|
256
|
+
return [{
|
|
257
|
+
key: `${personalRequest.connectorId}:${personalRequest.accountId}`,
|
|
258
|
+
target: {
|
|
259
|
+
type: "connector",
|
|
260
|
+
connectorId: personalRequest.connectorId
|
|
261
|
+
},
|
|
262
|
+
label: personalRequest.connectorId,
|
|
263
|
+
capabilities: [],
|
|
264
|
+
accountId: personalRequest.accountId,
|
|
265
|
+
connectionId: account?.currentConnectionId
|
|
266
|
+
}];
|
|
267
|
+
}
|
|
242
268
|
let sessionContext = getConnectionSessionContext(conversationId);
|
|
243
269
|
if (sessionContext?.sessionType === "workflow-subagent" && sessionContext.parentConversationId) sessionContext = getConnectionSessionContext(sessionContext.parentConversationId);
|
|
244
270
|
const workflowAccounts = sessionContext?.sessionType === "workflow-run" ? sessionContext.customData.connectorAccounts : void 0;
|
|
@@ -360,9 +386,11 @@ function cancelConnectionObjective(conversationId) {
|
|
|
360
386
|
if (!wait) return;
|
|
361
387
|
runSqliteWriteTransaction(() => {
|
|
362
388
|
if (wait.queuedInputId) setSessionInputStatus(wait.queuedInputId, "cancelled");
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
389
|
+
const personalRequest = personalRequestForWait(wait.id);
|
|
390
|
+
const runs = new TaskRunRepository();
|
|
391
|
+
const taskRunId = wait.taskRunId ?? (personalRequest?.taskId ? runs.getActiveRoot(personalRequest.taskId)?.id : void 0);
|
|
392
|
+
if (taskRunId) {
|
|
393
|
+
const run = runs.get(taskRunId);
|
|
366
394
|
if (run?.status === "waiting") {
|
|
367
395
|
for (const taskWait of runs.listActiveWaits(run.taskId)) if (taskWait.condition.connectionWaitId === wait.id) runs.resolveWait({
|
|
368
396
|
waitId: taskWait.id,
|
|
@@ -394,6 +422,7 @@ function cancelConnectionObjective(conversationId) {
|
|
|
394
422
|
resolution: "cancelled",
|
|
395
423
|
intent: void 0
|
|
396
424
|
}, wait.version);
|
|
425
|
+
if (personalRequest && personalRequest.state !== "cancelled") updatePersonalRequest(personalRequest, { state: "cancelled" });
|
|
397
426
|
});
|
|
398
427
|
publishConnectionWait(conversationId);
|
|
399
428
|
}
|
|
@@ -414,6 +443,7 @@ var log, events;
|
|
|
414
443
|
var init_connection_wait_repository = __esmMin((() => {
|
|
415
444
|
init_logger();
|
|
416
445
|
init_task_run_repository();
|
|
446
|
+
init_request_repository();
|
|
417
447
|
init_connection();
|
|
418
448
|
init_connector_account_repository();
|
|
419
449
|
init_connector_repository();
|
|
@@ -7,7 +7,7 @@ import { init_node_sqlite, requireNodeSqlite } from "../../infra/node-sqlite.js"
|
|
|
7
7
|
import { ensureXopcDatabaseSchema, init_schema } from "./schema.js";
|
|
8
8
|
import { init_unhandled_rejections, installSqliteTransientRejectionHandler } from "../../infra/unhandled-rejections.js";
|
|
9
9
|
import path from "node:path";
|
|
10
|
-
import
|
|
10
|
+
import fs from "node:fs";
|
|
11
11
|
import childProcess from "node:child_process";
|
|
12
12
|
//#region src/storage/sqlite/connection.ts
|
|
13
13
|
function normalizeNonNegativeInteger(value, label) {
|
|
@@ -17,7 +17,7 @@ function normalizeNonNegativeInteger(value, label) {
|
|
|
17
17
|
function findExistingVolumePath(targetPath) {
|
|
18
18
|
let current = path.resolve(targetPath);
|
|
19
19
|
while (true) try {
|
|
20
|
-
return
|
|
20
|
+
return fs.statSync(current).isDirectory() ? current : path.dirname(current);
|
|
21
21
|
} catch {
|
|
22
22
|
const parent = path.dirname(current);
|
|
23
23
|
if (parent === current) return null;
|
|
@@ -64,7 +64,7 @@ function parseMountCommandEntries(contents) {
|
|
|
64
64
|
}
|
|
65
65
|
function readMountEntries() {
|
|
66
66
|
try {
|
|
67
|
-
return parseProcMountInfoEntries(
|
|
67
|
+
return parseProcMountInfoEntries(fs.readFileSync(PROC_MOUNTINFO_PATH, "utf8"));
|
|
68
68
|
} catch {}
|
|
69
69
|
try {
|
|
70
70
|
return parseMountCommandEntries(String(childProcess.execFileSync("mount", [])));
|
|
@@ -91,7 +91,7 @@ function isNetworkMountEntryPath(targetPath) {
|
|
|
91
91
|
return mountEntry ? isNetworkMountType(mountEntry.fsType) : false;
|
|
92
92
|
}
|
|
93
93
|
function isNetworkBackedPath(targetPath) {
|
|
94
|
-
if (typeof
|
|
94
|
+
if (typeof fs.statfsSync !== "function") return isNetworkMountEntryPath(targetPath);
|
|
95
95
|
const checkedPath = findExistingVolumePath(targetPath);
|
|
96
96
|
if (!checkedPath) return false;
|
|
97
97
|
try {
|
|
@@ -100,7 +100,7 @@ function isNetworkBackedPath(targetPath) {
|
|
|
100
100
|
4283649346,
|
|
101
101
|
4266872130,
|
|
102
102
|
20859
|
|
103
|
-
].includes(
|
|
103
|
+
].includes(fs.statfsSync(checkedPath).type >>> 0)) return true;
|
|
104
104
|
} catch {
|
|
105
105
|
return isNetworkMountEntryPath(checkedPath);
|
|
106
106
|
}
|
|
@@ -145,13 +145,13 @@ function ensureDatabasePermissions(pathname) {
|
|
|
145
145
|
if (pathname === ":memory:") return;
|
|
146
146
|
const dir = pathname.slice(0, Math.max(pathname.lastIndexOf("/"), pathname.lastIndexOf("\\")));
|
|
147
147
|
if (dir) {
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
149
|
+
fs.chmodSync(dir, DB_DIR_MODE);
|
|
150
150
|
}
|
|
151
151
|
for (const suffix of DB_SIDECAR_SUFFIXES) {
|
|
152
152
|
const candidate = `${pathname}${suffix}`;
|
|
153
|
-
if (!
|
|
154
|
-
|
|
153
|
+
if (!fs.existsSync(candidate)) continue;
|
|
154
|
+
fs.chmodSync(candidate, DB_FILE_MODE);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
function openDatabaseAtPath(pathname) {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
ALTER TABLE task_origin_links ADD COLUMN origin_transcript_id TEXT;
|
|
2
|
+
ALTER TABLE task_origin_links ADD COLUMN request_input_id TEXT;
|
|
3
|
+
UPDATE task_origin_links SET origin_transcript_id = (
|
|
4
|
+
SELECT active_transcript_id FROM sessions WHERE sessions.conversation_id = task_origin_links.conversation_id
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
CREATE TABLE task_run_outcomes (
|
|
8
|
+
task_run_id TEXT NOT NULL REFERENCES task_runs(run_id) ON DELETE CASCADE,
|
|
9
|
+
outcome_id TEXT NOT NULL,
|
|
10
|
+
assignment_epoch INTEGER NOT NULL,
|
|
11
|
+
outcome_json TEXT NOT NULL,
|
|
12
|
+
created_at INTEGER NOT NULL,
|
|
13
|
+
PRIMARY KEY(task_run_id, outcome_id)
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
CREATE TABLE task_result_deliveries (
|
|
17
|
+
delivery_id TEXT PRIMARY KEY,
|
|
18
|
+
task_run_id TEXT NOT NULL REFERENCES task_runs(run_id) ON DELETE CASCADE,
|
|
19
|
+
conversation_id TEXT NOT NULL REFERENCES sessions(conversation_id) ON DELETE CASCADE,
|
|
20
|
+
payload_json TEXT NOT NULL,
|
|
21
|
+
status TEXT NOT NULL CHECK(status IN ('pending', 'delivered', 'stale', 'failed')),
|
|
22
|
+
message_entry_id TEXT,
|
|
23
|
+
attempts INTEGER NOT NULL DEFAULT 0,
|
|
24
|
+
next_attempt_at INTEGER NOT NULL,
|
|
25
|
+
last_error TEXT,
|
|
26
|
+
created_at INTEGER NOT NULL,
|
|
27
|
+
delivered_at INTEGER,
|
|
28
|
+
notified_at INTEGER,
|
|
29
|
+
UNIQUE(task_run_id, conversation_id)
|
|
30
|
+
);
|
|
31
|
+
CREATE INDEX idx_task_result_deliveries_pending
|
|
32
|
+
ON task_result_deliveries(status, next_attempt_at);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
CREATE TABLE personal_requests (
|
|
2
|
+
request_id TEXT PRIMARY KEY,
|
|
3
|
+
conversation_id TEXT NOT NULL REFERENCES sessions(conversation_id) ON DELETE CASCADE,
|
|
4
|
+
transcript_id TEXT NOT NULL,
|
|
5
|
+
input_id TEXT NOT NULL,
|
|
6
|
+
idempotency_key TEXT NOT NULL,
|
|
7
|
+
request_hash TEXT NOT NULL,
|
|
8
|
+
objective TEXT NOT NULL,
|
|
9
|
+
connector_id TEXT NOT NULL,
|
|
10
|
+
executor_agent_id TEXT NOT NULL,
|
|
11
|
+
account_id TEXT,
|
|
12
|
+
parameters_json TEXT NOT NULL,
|
|
13
|
+
state TEXT NOT NULL CHECK(state IN ('preflighting','waiting_connection','queued','running','completed','failed','cancelled')),
|
|
14
|
+
connection_wait_id TEXT UNIQUE,
|
|
15
|
+
task_id TEXT UNIQUE REFERENCES tasks(task_id) ON DELETE SET NULL,
|
|
16
|
+
result_json TEXT,
|
|
17
|
+
result_run_id TEXT,
|
|
18
|
+
delivery_entry_id TEXT,
|
|
19
|
+
notified_at INTEGER,
|
|
20
|
+
delivery_attempts INTEGER NOT NULL DEFAULT 0,
|
|
21
|
+
delivery_next_attempt_at INTEGER NOT NULL DEFAULT 0,
|
|
22
|
+
delivery_error TEXT,
|
|
23
|
+
version INTEGER NOT NULL DEFAULT 1,
|
|
24
|
+
created_at INTEGER NOT NULL,
|
|
25
|
+
updated_at INTEGER NOT NULL,
|
|
26
|
+
UNIQUE(conversation_id, transcript_id, idempotency_key)
|
|
27
|
+
);
|
|
28
|
+
CREATE INDEX idx_personal_requests_conversation ON personal_requests(conversation_id, created_at);
|
|
@@ -3,7 +3,7 @@ import type { ApplyMigrationsOptions } from './types.js';
|
|
|
3
3
|
/** Baseline schema version applied from schema.sql on first open. */
|
|
4
4
|
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 165;
|
|
5
5
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
6
|
-
export declare const XOPC_DB_SCHEMA_VERSION =
|
|
6
|
+
export declare const XOPC_DB_SCHEMA_VERSION = 232;
|
|
7
7
|
export declare function resolveMigrationsDir(override?: string): string;
|
|
8
8
|
/**
|
|
9
9
|
* Apply sequential SQL migrations from (currentVersion + 1) through targetVersion.
|
|
@@ -57,7 +57,7 @@ function applySingleMigration(db, migration, discardOldScenes = false) {
|
|
|
57
57
|
*/
|
|
58
58
|
function applyPendingMigrations(db, options = {}) {
|
|
59
59
|
db.function("xopc_operation_id", () => currentOperationId() ?? null);
|
|
60
|
-
const targetVersion = options.targetVersion ??
|
|
60
|
+
const targetVersion = options.targetVersion ?? 232;
|
|
61
61
|
let currentVersion = readSchemaVersion(db);
|
|
62
62
|
if (currentVersion > targetVersion) throw new DatabaseSchemaTooNewError(currentVersion, targetVersion);
|
|
63
63
|
if (!options.migrationsDir && currentVersion < 165) throw new DatabaseSchemaTooOldError(currentVersion, 165);
|
|
@@ -95,7 +95,7 @@ function applyPendingMigrations(db, options = {}) {
|
|
|
95
95
|
}
|
|
96
96
|
/** Inspect schema version without mutating the database. */
|
|
97
97
|
function inspectSchemaMigrationStatus(db, options = {}) {
|
|
98
|
-
const appVersion = options.targetVersion ??
|
|
98
|
+
const appVersion = options.targetVersion ?? 232;
|
|
99
99
|
const dbVersion = readSchemaVersion(db);
|
|
100
100
|
if (dbVersion > appVersion) return {
|
|
101
101
|
dbVersion,
|
|
@@ -137,7 +137,7 @@ var init_runner = __esmMin((() => {
|
|
|
137
137
|
init_errors();
|
|
138
138
|
log = createLogger("Sqlite:Migrations");
|
|
139
139
|
XOPC_DB_BASELINE_SCHEMA_VERSION = 165;
|
|
140
|
-
XOPC_DB_SCHEMA_VERSION =
|
|
140
|
+
XOPC_DB_SCHEMA_VERSION = 232;
|
|
141
141
|
}));
|
|
142
142
|
//#endregion
|
|
143
143
|
init_runner();
|
|
@@ -3,6 +3,7 @@ import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "
|
|
|
3
3
|
import { validateConversationId, validateTranscriptId } from "../../../packages/gateway-contract/src/conversation-identity.js";
|
|
4
4
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
5
5
|
import { init_session_instance_repository, readCurrentTranscriptId } from "./session-instance-repository.js";
|
|
6
|
+
import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-run-repository.js";
|
|
6
7
|
import { buildDefaultSessionMetadata, init_session_metadata } from "./session-metadata.js";
|
|
7
8
|
import { init_timestamps, optionalTimestampToMs } from "./timestamps.js";
|
|
8
9
|
import { buildGlobalSessionStats, init_row_mappers, metadataToSessionInsert, sessionRowToMetadata } from "./row-mappers.js";
|
|
@@ -311,6 +312,37 @@ function deleteSessionRecord(conversationId) {
|
|
|
311
312
|
db.prepare(`UPDATE transcripts SET status = 'archived', archive_reason = 'delete', archived_at = ?
|
|
312
313
|
WHERE transcript_id = ?`).run(now, existing.active_transcript_id);
|
|
313
314
|
cancelConnectionObjective(conversationId);
|
|
315
|
+
if (db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = 'personal_requests'").get()) {
|
|
316
|
+
const requests = db.prepare("SELECT task_id FROM personal_requests WHERE conversation_id = ? AND task_id IS NOT NULL").all(conversationId);
|
|
317
|
+
const runs = new TaskRunRepository();
|
|
318
|
+
for (const request of requests) {
|
|
319
|
+
const run = runs.getActiveRoot(request.task_id);
|
|
320
|
+
if (!run) continue;
|
|
321
|
+
for (const wait of runs.listActiveWaits(request.task_id)) runs.resolveWait({
|
|
322
|
+
waitId: wait.id,
|
|
323
|
+
actor: { kind: "user" },
|
|
324
|
+
resolution: { cancelled: true }
|
|
325
|
+
});
|
|
326
|
+
runs.finalize({
|
|
327
|
+
runId: run.id,
|
|
328
|
+
expectedVersion: run.version,
|
|
329
|
+
actor: { kind: "user" },
|
|
330
|
+
receipt: {
|
|
331
|
+
status: "cancelled",
|
|
332
|
+
summary: "Originating Personal conversation deleted",
|
|
333
|
+
changes: [],
|
|
334
|
+
evidence: [],
|
|
335
|
+
verification: {
|
|
336
|
+
status: "unverified",
|
|
337
|
+
checks: []
|
|
338
|
+
},
|
|
339
|
+
remainingWork: [],
|
|
340
|
+
needsUser: false,
|
|
341
|
+
completionVerdict: "not_achieved"
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
}
|
|
314
346
|
db.prepare(`DELETE FROM sessions WHERE conversation_id = ?`).run(conversationId);
|
|
315
347
|
return true;
|
|
316
348
|
});
|
|
@@ -334,6 +366,7 @@ function resolveSessionAgentId(conversationId) {
|
|
|
334
366
|
}
|
|
335
367
|
var init_session_repository = __esmMin((() => {
|
|
336
368
|
init_connection_wait_repository();
|
|
369
|
+
init_task_run_repository();
|
|
337
370
|
init_src();
|
|
338
371
|
init_changes();
|
|
339
372
|
init_session_metadata();
|
|
@@ -4,10 +4,10 @@ import { TaskRepository, init_task_repository } from "../task-repository.js";
|
|
|
4
4
|
import { TaskRunRepository, init_task_run_repository } from "../task-run-repository.js";
|
|
5
5
|
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
6
6
|
import { defineReadCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
7
|
-
import {
|
|
7
|
+
import { TaskConversationRepository } from "../task-conversation-repository.js";
|
|
8
8
|
import { TaskReadModelProjector } from "../task-read-model-projector.js";
|
|
9
|
+
import { TaskContextRepository } from "../task-context-repository.js";
|
|
9
10
|
import { TaskDependencyService } from "../task-dependency-service.js";
|
|
10
|
-
import { TaskConversationRepository } from "../task-conversation-repository.js";
|
|
11
11
|
import { TaskCriterionReviewRepository } from "../task-criterion-review-repository.js";
|
|
12
12
|
import { TaskValueMetricsService } from "../task-value-metrics-service.js";
|
|
13
13
|
//#region src/tasks/capabilities/read.ts
|
|
@@ -4,8 +4,8 @@ import { TaskRepository, init_task_repository } from "../task-repository.js";
|
|
|
4
4
|
import { TaskRunRepository, init_task_run_repository } from "../task-run-repository.js";
|
|
5
5
|
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
6
6
|
import { defineAtomicCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
7
|
-
import { TaskApplicationService } from "../task-application-service.js";
|
|
8
7
|
import { resolveProjectAgentId } from "../../projects/project-agent.js";
|
|
8
|
+
import { TaskApplicationService } from "../task-application-service.js";
|
|
9
9
|
import { TaskSignalService } from "../task-signal-service.js";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
//#region src/tasks/capabilities/write.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
|
|
2
2
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
3
|
-
import { getExecutionEnvironmentForSession } from "../execution-environments/subject.js";
|
|
4
3
|
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
4
|
+
import { getExecutionEnvironmentForSession } from "../execution-environments/subject.js";
|
|
5
5
|
//#region src/tasks/execution-context.ts
|
|
6
6
|
init_sqlite();
|
|
7
7
|
const ORIGINS = new Set([
|
|
@@ -2,11 +2,11 @@ import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
|
2
2
|
import { isHomeAttentionAcknowledged } from "../storage/sqlite/home-attention-repository.js";
|
|
3
3
|
import { listConnectorApprovals } from "../storage/sqlite/connector-repository.js";
|
|
4
4
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
5
|
-
import "../automations/domain/defaults.js";
|
|
6
|
-
import "../automations/index.js";
|
|
7
5
|
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
8
|
-
import
|
|
6
|
+
import "../automations/domain/defaults.js";
|
|
9
7
|
import { AttentionGovernor } from "./attention-governor.js";
|
|
8
|
+
import { listGatewayAgents } from "../gateway/agents-admin.js";
|
|
9
|
+
import "../automations/index.js";
|
|
10
10
|
//#region src/tasks/home-query-service.ts
|
|
11
11
|
init_sqlite();
|
|
12
12
|
init_task_repository();
|
package/dist/src/tasks/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { enqueueTaskAttentionRequiredEvent, enqueueTaskChanged, enqueueTaskChangedEvent, init_task_change_events } from "./task-change-events.js";
|
|
2
2
|
import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
3
3
|
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
4
|
-
import {
|
|
4
|
+
import { TaskConversationConflictError, TaskConversationRepository } from "./task-conversation-repository.js";
|
|
5
5
|
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
6
|
+
import { TaskContextRepository } from "./task-context-repository.js";
|
|
6
7
|
import { TaskDependencyError, TaskDependencyService } from "./task-dependency-service.js";
|
|
7
|
-
import { TaskConversationConflictError, TaskConversationRepository } from "./task-conversation-repository.js";
|
|
8
|
-
import { TaskApplicationService } from "./task-application-service.js";
|
|
9
|
-
import { assembleTaskContext, buildDelegatedTaskDirective, buildTaskExecutionDirective, getTaskContextManifest, getTaskExecutionBrief } from "./task-context-assembler.js";
|
|
10
8
|
import { TaskValueMetricsService } from "./task-value-metrics-service.js";
|
|
11
9
|
import { TaskDeletionService } from "./task-deletion-service.js";
|
|
10
|
+
import { TaskApplicationService } from "./task-application-service.js";
|
|
12
11
|
import { TaskSignalService } from "./task-signal-service.js";
|
|
13
12
|
import { resolveExecutionContext } from "./execution-context.js";
|
|
14
13
|
import { AttentionGovernor } from "./attention-governor.js";
|
|
@@ -16,6 +15,7 @@ import { HomeQueryService, buildHomeWorkbench, decisionFromTask } from "./home-q
|
|
|
16
15
|
import { TaskWorkflowCoordinator } from "./task-workflow-coordinator.js";
|
|
17
16
|
import { defineTaskContract } from "./task-contract-definition.js";
|
|
18
17
|
import { ModelTaskContractPlanner, parseTaskContractResponse } from "./task-contract-planner.js";
|
|
18
|
+
import { assembleTaskContext, buildDelegatedTaskDirective, buildTaskExecutionDirective, getTaskContextManifest, getTaskExecutionBrief } from "./task-context-assembler.js";
|
|
19
19
|
import { TaskRunCoordinator } from "./task-run-coordinator.js";
|
|
20
20
|
import { ProjectOperatingViewService, summarizeProjectOperatingView } from "./project-operating-view-service.js";
|
|
21
21
|
import { TaskHandoffService } from "./task-handoff-service.js";
|
|
@@ -4,12 +4,13 @@ import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
|
4
4
|
import { enqueueTaskAttentionRequiredEvent, enqueueTaskChangedEvent, init_task_change_events } from "./task-change-events.js";
|
|
5
5
|
import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
6
6
|
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
7
|
-
import {
|
|
7
|
+
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
8
8
|
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
9
|
+
import { TaskContextRepository } from "./task-context-repository.js";
|
|
9
10
|
import { TaskDependencyService } from "./task-dependency-service.js";
|
|
10
|
-
import { TaskCollaborationRepository } from "./task-collaboration-repository.js";
|
|
11
|
-
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
12
11
|
import { TaskCriterionReviewRepository } from "./task-criterion-review-repository.js";
|
|
12
|
+
import { TaskCollaborationRepository } from "./task-collaboration-repository.js";
|
|
13
|
+
import { TaskResultDeliveryRepository } from "./task-result-delivery-repository.js";
|
|
13
14
|
import { createHash, randomUUID } from "node:crypto";
|
|
14
15
|
//#region src/tasks/task-application-service.ts
|
|
15
16
|
init_src();
|
|
@@ -97,6 +98,11 @@ var TaskApplicationService = class {
|
|
|
97
98
|
if (input.originConversationId) {
|
|
98
99
|
if (db.prepare(`INSERT INTO task_origin_links (task_id, conversation_id, created_at)
|
|
99
100
|
SELECT ?, conversation_id, ? FROM sessions WHERE conversation_id = ?`).run(task.id, task.createdAt, input.originConversationId).changes !== 1) throw new Error("Task origin conversation not found");
|
|
101
|
+
db.prepare(`UPDATE task_origin_links SET
|
|
102
|
+
origin_transcript_id = (SELECT active_transcript_id FROM sessions WHERE conversation_id = ?),
|
|
103
|
+
request_input_id = (SELECT id FROM session_inputs WHERE conversation_id = ?
|
|
104
|
+
AND status = 'running' ORDER BY created_at_ms DESC LIMIT 1)
|
|
105
|
+
WHERE task_id = ?`).run(input.originConversationId, input.originConversationId, task.id);
|
|
100
106
|
db.prepare(`INSERT INTO task_main_agent_links (task_id, agent_id, origin_conversation_id, created_at)
|
|
101
107
|
SELECT ?, agent_id, conversation_id, ? FROM sessions WHERE conversation_id = ?`).run(task.id, task.createdAt, input.originConversationId);
|
|
102
108
|
}
|
|
@@ -491,6 +497,7 @@ var TaskApplicationService = class {
|
|
|
491
497
|
body: input.receipt.summary || (input.receipt.status === "succeeded" ? "TaskRun completed" : "TaskRun failed"),
|
|
492
498
|
idempotencyKey: `task-run-receipt:${run.id}`
|
|
493
499
|
});
|
|
500
|
+
if (input.receipt.status === "succeeded" || input.receipt.status === "failed") new TaskResultDeliveryRepository().enqueue(run.id, input.receipt.summary, input.receipt.status, input.resultText);
|
|
494
501
|
if (input.receipt.status !== "succeeded") {
|
|
495
502
|
const model = this.#projector.project(task);
|
|
496
503
|
if (!input.suppressAttention) enqueueTaskAttentionRequiredEvent(db, {
|
|
@@ -3,8 +3,8 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
4
4
|
import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
5
5
|
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
6
|
-
import { TaskCollaborationRepository } from "./task-collaboration-repository.js";
|
|
7
6
|
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
7
|
+
import { TaskCollaborationRepository } from "./task-collaboration-repository.js";
|
|
8
8
|
import { TaskApplicationService } from "./task-application-service.js";
|
|
9
9
|
//#region src/tasks/task-collaboration-delivery.ts
|
|
10
10
|
init_task_repository();
|
|
@@ -4,9 +4,9 @@ import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
|
4
4
|
import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
5
5
|
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
6
6
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
7
|
+
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
7
8
|
import { TaskContextRepository } from "./task-context-repository.js";
|
|
8
9
|
import { TaskCollaborationRepository } from "./task-collaboration-repository.js";
|
|
9
|
-
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
10
10
|
import { TaskOriginRepository } from "./task-origin-repository.js";
|
|
11
11
|
//#region src/tasks/task-context-assembler.ts
|
|
12
12
|
init_src();
|
|
@@ -145,6 +145,7 @@ function buildTaskExecutionDirective(conversationId) {
|
|
|
145
145
|
handoffPayload ? `Handoff snapshot: ${handoffPayload}` : "",
|
|
146
146
|
collaboration.length ? `Recent task collaboration:\n${collaboration.map((entry) => `- ${entry.sequence} ${entry.authorKind} ${entry.kind}: ${JSON.stringify(entry.body.slice(0, 1e3))}`).join("\n")}` : "",
|
|
147
147
|
"Report meaningful progress with xopc_use task collaboration_post. If blocked, post a question and stop this execution turn until answered.",
|
|
148
|
+
"For user-facing files, publish completed outputs with publish_artifacts before finishing. image_generate already publishes its images. Return structured artifact references rather than only local file paths. Published final outcomes are delivered automatically to the originating chat. Keep the final summary short and distinguish generated outputs from verified or accepted results.",
|
|
148
149
|
"Take safe in-scope steps and produce inspectable evidence. Do not claim completion without verification.",
|
|
149
150
|
"</xopc_task_execution>"
|
|
150
151
|
].filter(Boolean).join("\n");
|
|
@@ -5,8 +5,8 @@ import { TaskRunRepository, init_task_run_repository } from "./task-run-reposito
|
|
|
5
5
|
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
6
6
|
import { init_agent_scope, listAgentEntries } from "../agent/agent-scope.js";
|
|
7
7
|
import { init_session_key, resolveConversationId, sanitizeSegment } from "../routing/session-key.js";
|
|
8
|
-
import { TaskContextRepository } from "./task-context-repository.js";
|
|
9
8
|
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
9
|
+
import { TaskContextRepository } from "./task-context-repository.js";
|
|
10
10
|
//#region src/tasks/task-handoff-service.ts
|
|
11
11
|
init_agent_scope();
|
|
12
12
|
init_session_key();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
2
2
|
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
3
|
-
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../providers/model-response.js";
|
|
4
3
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
5
4
|
import { completeWithResolvedCredentials } from "../providers/model-call.js";
|
|
5
|
+
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../providers/model-response.js";
|
|
6
6
|
import { TaskCollaborationRepository } from "./task-collaboration-repository.js";
|
|
7
7
|
import { getPersonalAgentByConversation } from "../personal-agent/repository.js";
|
|
8
8
|
//#region src/tasks/task-main-update-decision-service.ts
|
|
@@ -1,14 +1,41 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
4
|
+
import { init_request_repository, personalRequestForTask } from "../personal-agent/request-repository.js";
|
|
3
5
|
import { TaskCollaborationRepository } from "./task-collaboration-repository.js";
|
|
6
|
+
import { TaskResultDeliveryRepository } from "./task-result-delivery-repository.js";
|
|
4
7
|
//#region src/tasks/task-main-update-delivery.ts
|
|
5
8
|
init_logger();
|
|
9
|
+
init_task_run_repository();
|
|
10
|
+
init_request_repository();
|
|
6
11
|
const log = createLogger("TaskMainUpdateDelivery");
|
|
7
12
|
var TaskMainUpdateDelivery = class {
|
|
8
13
|
#entries = new TaskCollaborationRepository();
|
|
9
14
|
async drain(input, limit = 20) {
|
|
10
15
|
let delivered = 0;
|
|
11
16
|
for (const { entry, conversationId, decision, decisionReason } of this.#entries.pendingMainUpdates(limit)) {
|
|
17
|
+
if ([
|
|
18
|
+
"result",
|
|
19
|
+
"failure",
|
|
20
|
+
"progress"
|
|
21
|
+
].includes(entry.kind) && personalRequestForTask(entry.taskId)) {
|
|
22
|
+
this.#entries.markMainUpdateDelivered(entry.id);
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const results = new TaskResultDeliveryRepository();
|
|
26
|
+
const isResult = entry.kind === "result" && entry.taskRunId;
|
|
27
|
+
if (isResult && results.hasForRun(entry.taskRunId)) {
|
|
28
|
+
this.#entries.markMainUpdateDelivered(entry.id);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (isResult && results.hasCapturedOutcome(entry.taskRunId) && [
|
|
32
|
+
"running",
|
|
33
|
+
"waiting",
|
|
34
|
+
"verifying"
|
|
35
|
+
].includes(new TaskRunRepository().get(entry.taskRunId)?.status ?? "")) {
|
|
36
|
+
this.#entries.deferMainUpdate(entry.id);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
12
39
|
if (!input.isAvailable(conversationId)) {
|
|
13
40
|
this.#entries.deferMainUpdate(entry.id);
|
|
14
41
|
continue;
|
|
@@ -31,6 +58,10 @@ var TaskMainUpdateDelivery = class {
|
|
|
31
58
|
entry
|
|
32
59
|
});
|
|
33
60
|
if (!decision) this.#entries.decideMainUpdate(entry.id, verdict.notify ? "notify" : "silent", verdict.reason);
|
|
61
|
+
if (isResult && results.hasForRun(entry.taskRunId)) {
|
|
62
|
+
this.#entries.markMainUpdateDelivered(entry.id);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
34
65
|
if (!verdict.notify) {
|
|
35
66
|
this.#entries.markMainUpdateDelivered(entry.id);
|
|
36
67
|
delivered += 1;
|
|
@@ -40,7 +71,7 @@ var TaskMainUpdateDelivery = class {
|
|
|
40
71
|
`A delegated Task has a new ${entry.kind} update. Task ID: ${entry.taskId}.`,
|
|
41
72
|
`Collaboration entry ID: ${entry.id}.`,
|
|
42
73
|
`Your private notification decision: ${JSON.stringify(verdict.reason)}.`,
|
|
43
|
-
"Read the Task and collaboration board with xopc_use. If this is a worker question, first answer it from the Task brief or conversation with personal_task(command=\"answer\", taskId, questionId, instruction) when available; ask the user only for a genuinely missing fact. For failures, inspect the actual blocker and try a suitable alternative within the user’s authorization before reporting an impasse. Then tell the user what matters in your own words. Keep the response proportionate to the update and recent conversation. Do not expose this internal trigger or repeat already reported details. If a result receipt is generic, use the board for the actual outcome. A finished TaskRun is not proof that the Task passed verification or was accepted; check its receipt and use precise status language. Do not ask the user to close a Task unless requested. Use tools without preliminary user-facing commentary, then give one concise reply."
|
|
74
|
+
"Read the Task and collaboration board with personal_task(command=\"get\", taskId) when available, otherwise xopc_use. If this is a worker question, first answer it from the Task brief or conversation with personal_task(command=\"answer\", taskId, questionId, instruction) when available; ask the user only for a genuinely missing fact. For failures, inspect the actual blocker and try a suitable alternative within the user’s authorization before reporting an impasse. Then tell the user what matters in your own words. Keep the response proportionate to the update and recent conversation. Do not expose this internal trigger or repeat already reported details. If a result receipt is generic, use the board for the actual outcome. A finished TaskRun is not proof that the Task passed verification or was accepted; check its receipt and use precise status language. Do not ask the user to close a Task unless requested. Use tools without preliminary user-facing commentary, then give one concise reply."
|
|
44
75
|
].join("\n");
|
|
45
76
|
if (await input.submitAndConfirm({
|
|
46
77
|
conversationId,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type TurnOutcome } from '@xopcai/gateway-contract';
|
|
2
|
+
export declare function onTaskResultQueued(listener: () => void): () => void;
|
|
3
|
+
export interface TaskResultDeliveryRow {
|
|
4
|
+
delivery_id: string;
|
|
5
|
+
payload_json: string;
|
|
6
|
+
status: 'pending' | 'delivered' | 'stale' | 'failed';
|
|
7
|
+
attempts: number;
|
|
8
|
+
message_entry_id: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare class TaskResultDeliveryRepository {
|
|
11
|
+
capture(runId: string, value: TurnOutcome): void;
|
|
12
|
+
/** Called inside the run completion transaction, after stale receipts are rejected. */
|
|
13
|
+
enqueue(runId: string, summary: string, status: 'succeeded' | 'failed', resultText?: string): boolean;
|
|
14
|
+
hasForRun(runId: string): boolean;
|
|
15
|
+
hasCapturedOutcome(runId: string): boolean;
|
|
16
|
+
pending(limit?: number): TaskResultDeliveryRow[];
|
|
17
|
+
retry(id: string, error: string): void;
|
|
18
|
+
}
|