@xopcai/xopc 0.0.383 → 0.0.385
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/{activity-store-qv0XyrXk.js → activity-store-CB2X4Gmu.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-66HwhyEK.js → agent-avatar-dicebear-Cb9eaXxR.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DEV-xtgm.js +1 -0
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-CebTVaRM.js → agent-plugin-dialog-DXKc3Luj.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DcNxwpJQ.js +77 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-BGy9IvSr.js → agents-admin-api-BkULgC6Q.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BKaU6sGT.js → app-management-settings-panel-X5i0Tz7_.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-E5WFcCdZ.js → appearance-settings-CmHHzquT.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-CExfOhRj.js → apps-page-ChFA4Zp0.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BvhxzyLJ.js → archive-plugin-De0ND0oA.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CWcNFzvK.js → automations-page-BFqsIqOI.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-Blfak-fT.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CD0gYKR2.js → binary-plugins-Do535ZGW.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CBVXeGAt.js → block-editor-CpOLG3Co.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-automation-inputs-B-Qz_411.js → browser-automation-inputs-B9M1RYTm.js} +1 -1
- package/dist/gateway/static/root/assets/browser-automations-page-BSbTJ9j2.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-BUlILJrB.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-w2GUuF7V.js → capabilities-2Do3eKMM.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-CaL5RDm3.js → capabilities-XFwwUNU3.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-CeRdkwRf.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-CIvwbZps.js → capabilities-settings-panel-S-cKsGja.js} +6 -6
- package/dist/gateway/static/root/assets/{capability-header-actions-DKaZAOWW.js → capability-header-actions-6w8pQhnn.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-D82wgP8A.js → channels-DfNTGBmp.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DuqWzcEq.js → chat-terminal-dock-DnoQHpDc.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-BiM0fCvO.js → computer-settings-page-7yliE7sG.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-o8kuXjVt.js → connector-service-page-DOLAUFSW.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DAsn97XG.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-5tzjG3n1.js → date-picker-DNDqr4Fk.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DLcDUyep.js → dependency-picker-B5oG7RgE.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-D-w8487x.js → desktop-pet-K7kUCX1O.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-D-w7uF8Q.js → desktop-pet-settings-KgOAuqSh.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DvqniZDm.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-B7d2s14w.js → directory-picker-path-field-BmOguLDl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-sntm2YRN.js → extension-debug-page-DtHNy4TE.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CPbWA4Oy.js → extension-page-DSSuMQxp.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-CnDGKMN6.js → extension-provider-nbgU7xBS.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-PAHKn-Az.js → extension-settings-page-DSd__mNd.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-BJaSQNiV.js → fallback-models-D7bjbiwZ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-DIhXgHH-.js → gateway-config-swr-D0tBjSgj.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-BkgWeVUQ.js → gateway-realtime-BnHraJ3O.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BVriF6Zj.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-hSXGWumL.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DnXc9GNb.js → gateway-startup-retry-C1DQsIH3.js} +1 -1
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-Cw_HUlEk.js → highlighted-body-KQOG7T2V-C7xJwE61.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-DJNmlMfH.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-4dtNAW64.js → image-generation-api-DodU6GNC.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DVvyrYUy.js → imports-page-BufZPzGE.js} +1 -1
- package/dist/gateway/static/root/assets/index-DBRwvWzm.css +1 -0
- package/dist/gateway/static/root/assets/{index-B-wZyMBY.js → index-K8SXDtxr.js} +110 -110
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DywXmCvO.js → keyboard-shortcuts-settings-B8pPP5RF.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-dBlBepLG.js → local-app-workbench-page-zEtvE7pJ.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-DdEXqsZw.js → local-apps-page-Bli7e_eg.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-D-_OuGWH.js → local-session-drafts-D_tYFy7d.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-BNDrBt2C.js → locale-store-uRu_DsWm.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DpSob5Id.js → logs-page-BimZk3R4.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-10Vl7gLU.js → management-settings-5Y4COyU9.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-Ct4sKkUf.css +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-pEV4TIPK.js → markdown-view-DHfQAvZQ.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DU1Ike3m.js → media-plugins-BombFqsX.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-DBRj4-1-.js +1 -0
- package/dist/gateway/static/root/assets/messages-DTqbfje6.js +3 -0
- package/dist/gateway/static/root/assets/{models-hub-cache-Lp4PAH-A.js → models-hub-cache-Ct6X5zmB.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-KLDPLVg7.js +5 -0
- package/dist/gateway/static/root/assets/{notes-api-B_LGV8Lh.js → notes-api-nqN2wKYc.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-DST0oPXD.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-DzkU3HrQ.js → page-context-capture-button-Bmed83-6.js} +1 -1
- package/dist/gateway/static/root/assets/page-tabs-HLrKIjXH.js +1 -0
- package/dist/gateway/static/root/assets/personal-page-BG4Ystrm.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-Dbs3Xtis.js → product-open-page-CXkYP9xE.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-x-EvUxt7.js → product-preview-content-DjmupQSq.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CzBmV0P6.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-CSahay3I.js → projects-page-DByqe5Em.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-DX5EhiBp.js → registry-api-CYqA7bfl.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DTjj-odF.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-DYeTxrEb.js → runtime-tools-api-zzoxjSuR.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DbuAW7ky.js → runtime-tools-settings-panel-B_ptn3T8.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-DVzrw6Q9.js → scenes-page-wkua4l5y.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-Ch-wK0Os.js → schema-form-VvOSM84Y.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-BKIg9cjN.js → send-session-input-BCAF-Ikt.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-Cf3ACMv7.js → session-api-CzVTrG8n.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-Djtcwo3n.js → session-manager-_yy4bxhT.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-D06XwYAT.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DoAHy1wj.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-D-Uz-C5u.js → settings-page-C-6BJdb1.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-L0JSG0K-.js +1 -0
- package/dist/gateway/static/root/assets/{share-link-dialog-Cke8qSIS.js → share-link-dialog-C47Xgzta.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CQjfWJVh.js → share-preview-page-nJ2FWAEP.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-CQapohsa.js → shares-api-B0HlMAzi.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BbgAUM3v.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-v1XR_zqL.js → skill-api-BFU1tPyw.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-CPW9mIZH.js → skill-reload-api-CEJx5rPd.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-Cu80KslP.js → skills-page-DZw6el4o.js} +1 -1
- package/dist/gateway/static/root/assets/specialists-4bkS5rZ4.js +1 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-CbIHO53w.js → system-settings-panel-DshSGWNg.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-DvRLEt8e.js → task-detail-page-CfZhq4XZ.js} +2 -2
- package/dist/gateway/static/root/assets/{task-expandable-content-CQ9Y17UE.js → task-expandable-content-CF6Bj-Qa.js} +1 -1
- package/dist/gateway/static/root/assets/tasks-DJIeIk9C.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-BNDzgUPq.js → theme-store-BUfzeDvL.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-DbbQg2I5.js → tracing-settings-page-C2q5B3Kp.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-CQXrU_XI.js → tunnel-api-DFDXwWnU.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-BdLt6u0c.js → usage-page-2RJLg54s.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-CFn9aZYy.js → use-autosave-DgbCgsao.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-DXCEME1D.js → use-composer-attachments-BFP3k6oC.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-CEB7pfWq.js → use-file-preview-expanded-B1BiTQNS.js} +2 -2
- package/dist/gateway/static/root/assets/user-model-page-y1gjGYPI.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-C9s0iBGA.js → voice-api-key-field-4AIkbm9R.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-BIm_aTqX.js → voice-config-api-Kw1pYlLN.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-C3KsL1Ap.js → work-discovery-overlay-Ch-KfpCF.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CEx_jYPu.js → workflow-run-setup-panel-CTu297Hc.js} +2 -2
- package/dist/gateway/static/root/assets/{workflows-page-BYGPnFEF.js → workflows-page-CRZXG_rm.js} +3 -3
- package/dist/gateway/static/root/assets/{workspace-api-uZFF1SlQ.js → workspace-api-Xr3wz8T3.js} +2 -2
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-DcPFuTIk.js → xopc-cloud-account-card-hEfjVjnc.js} +1 -1
- package/dist/gateway/static/root/index.html +30 -29
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/index.js +1 -1
- package/dist/packages/gateway-contract/src/task-lifecycle.js +3 -0
- package/dist/packages/gateway-contract/src/tasks.js +41 -10
- package/dist/src/agent/agent-manager.d.ts +6 -0
- package/dist/src/agent/agent-manager.js +18 -15
- 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 +10 -10
- package/dist/src/agent/child-agent-factory.js +7 -1
- 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 +1 -1
- package/dist/src/agent/context/project-context.js +3 -3
- package/dist/src/agent/data-acquisition/service.js +1 -1
- package/dist/src/agent/embedded/codemode-extension.js +1 -1
- package/dist/src/agent/embedded/execution-tool-policy.d.ts +1 -1
- package/dist/src/agent/embedded/execution-tool-policy.js +3 -2
- package/dist/src/agent/embedded/index.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +38 -18
- package/dist/src/agent/embedded/run-turn.js +119 -35
- package/dist/src/agent/embedded/session-runner.js +12 -4
- package/dist/src/agent/embedded/session-tool-result-guard.js +2 -2
- package/dist/src/agent/embedded/tool-result-truncation.js +1 -1
- package/dist/src/agent/embedded/types.d.ts +2 -1
- package/dist/src/agent/external-tools/cliProvider.d.ts +1 -0
- package/dist/src/agent/external-tools/cliProvider.js +4 -3
- package/dist/src/agent/external-tools/composio-provider.js +5 -3
- package/dist/src/agent/external-tools/endpoint-provider.js +4 -4
- package/dist/src/agent/external-tools/gateway-tools.js +10 -4
- package/dist/src/agent/external-tools/index.js +1 -1
- package/dist/src/agent/external-tools/service.d.ts +1 -0
- package/dist/src/agent/external-tools/service.js +3 -1
- package/dist/src/agent/external-tools/types.d.ts +4 -0
- package/dist/src/agent/image/generation/openai-images-provider.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 +2 -2
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/index.js +3 -3
- package/dist/src/agent/mcp/config.js +1 -1
- package/dist/src/agent/memory/context-budget.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/orchestration/agent-turn-policy.d.ts +1 -0
- package/dist/src/agent/orchestration/delegation-budget.js +2 -1
- package/dist/src/agent/orchestration/llm-turn-retry.d.ts +5 -0
- package/dist/src/agent/orchestration/llm-turn-retry.js +15 -5
- package/dist/src/agent/orchestration/turn-recovery.d.ts +6 -0
- package/dist/src/agent/orchestration/turn-recovery.js +29 -0
- package/dist/src/agent/prompt/response-language.js +1 -1
- package/dist/src/agent/prompt/sections/tooling.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +3 -3
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +11 -10
- package/dist/src/agent/service/process-direct-streaming.js +12 -6
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.d.ts +6 -0
- package/dist/src/agent/service.js +21 -18
- package/dist/src/agent/session/session-config-service.js +2 -2
- 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/starter-agents.d.ts +1 -0
- package/dist/src/agent/starter-agents.js +12 -0
- package/dist/src/agent/tasks/task-judge-service.js +32 -14
- 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/error-pattern-matcher.js +1 -1
- package/dist/src/agent/tools/exec-command.js +3 -1
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.d.ts +6 -0
- package/dist/src/agent/tools/factory.js +50 -40
- 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.d.ts +1 -0
- package/dist/src/agent/tools/index.js +8 -7
- package/dist/src/agent/tools/list-dir.js +1 -1
- package/dist/src/agent/tools/personal-attention-tool.d.ts +2 -0
- package/dist/src/agent/tools/personal-attention-tool.js +52 -18
- package/dist/src/agent/tools/personal-read-tool.js +16 -6
- package/dist/src/agent/tools/personal-request-result-tool.js +20 -3
- package/dist/src/agent/tools/personal-request-tool.js +216 -17
- package/dist/src/agent/tools/personal-result-budget.d.ts +2 -0
- package/dist/src/agent/tools/personal-result-budget.js +57 -0
- package/dist/src/agent/tools/personal-task-tool.d.ts +17 -21
- package/dist/src/agent/tools/personal-task-tool.js +356 -24
- 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/task-collaboration-tool.d.ts +16 -0
- package/dist/src/agent/tools/task-collaboration-tool.js +153 -0
- 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 +25 -13
- package/dist/src/agent/transcript/index.js +2 -2
- package/dist/src/agent/transcript/transcript-hygiene.js +2 -2
- package/dist/src/agent/workflow/subagent-runner.js +1 -1
- package/dist/src/agent-config/resolver.js +2 -0
- package/dist/src/agent-config/schema.d.ts +8 -0
- package/dist/src/agent-config/schema.js +2 -0
- package/dist/src/agent-matching/delegation-service.js +1 -1
- package/dist/src/agent-matching/selection-repository.d.ts +1 -0
- package/dist/src/agent-matching/selection-repository.js +1 -1
- package/dist/src/agent-matching/service.js +2 -2
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/capabilities/write.d.ts +4 -0
- package/dist/src/automations/domain/index.js +2 -2
- package/dist/src/automations/domain/validation.d.ts +8 -0
- package/dist/src/automations/draft/automation-draft-service.js +1 -1
- package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -0
- 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 +1 -1
- package/dist/src/chat-commands/context.js +4 -4
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +8 -8
- 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 +1 -1
- package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +1 -1
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +3 -3
- package/dist/src/cli/commands/extension.js +4 -4
- 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/mcp.js +1 -1
- package/dist/src/cli/commands/models.js +2 -2
- 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 +6 -6
- 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/agent-model-intents.js +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/schema.js +5 -5
- 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-ingestion.js +4 -4
- package/dist/src/connectors/connected-source-understanding.js +4 -4
- package/dist/src/connectors/connection-recovery-service.d.ts +6 -0
- package/dist/src/connectors/connection-recovery-service.js +157 -38
- package/dist/src/connectors/content-enrichment.js +1 -1
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/connectors/learning-coordinator.js +2 -2
- 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/endpoint-tools/index.js +1 -1
- package/dist/src/endpoint-tools/runtime.js +2 -2
- package/dist/src/extensions/activation-context.js +3 -3
- package/dist/src/extensions/agent-plugins/source-http-fetch.js +1 -1
- 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/commands-skills.js +4 -4
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +4 -4
- package/dist/src/gateway/hono/routes/connection-waits.js +3 -1
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/context-sources.js +2 -2
- package/dist/src/gateway/hono/routes/endpoint-tools.js +1 -1
- package/dist/src/gateway/hono/routes/home.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/media.js +1 -1
- package/dist/src/gateway/hono/routes/memory-learning.js +3 -3
- package/dist/src/gateway/hono/routes/models.js +5 -5
- package/dist/src/gateway/hono/routes/notes.js +1 -1
- package/dist/src/gateway/hono/routes/personal-agent.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +4 -4
- package/dist/src/gateway/hono/routes/session-command-handler.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +4 -4
- 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 +3 -2
- package/dist/src/gateway/hono/routes/user-model.js +7 -7
- 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 +1 -1
- 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 +2 -2
- package/dist/src/gateway/service/config-coordinator.js +2 -2
- package/dist/src/gateway/service/marketplace-service.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +12 -8
- package/dist/src/gateway/service/session-command-service.js +1 -1
- package/dist/src/gateway/service/session-input-coordinator.js +4 -2
- package/dist/src/gateway/service.d.ts +1 -0
- package/dist/src/gateway/service.js +62 -48
- package/dist/src/gateway/session-context-summary.js +3 -3
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/home-intelligence/generator.js +2 -2
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/imports/inventory.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/knowledge/connected-knowledge-pipeline.js +2 -2
- package/dist/src/knowledge/index.js +1 -1
- package/dist/src/knowledge-memory/repository.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/mcp/gateway-http-client.js +1 -1
- package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
- package/dist/src/memory-learning/source-learning.js +5 -5
- package/dist/src/memory-learning/task-receipts.js +1 -1
- package/dist/src/notes/agent-context.js +4 -4
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/store.js +1 -1
- package/dist/src/personal-agent/capability-service.js +4 -4
- package/dist/src/personal-agent/policy.js +2 -7
- package/dist/src/personal-agent/proactivity/repository.js +1 -1
- package/dist/src/personal-agent/proactivity/routes.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +5 -5
- package/dist/src/personal-agent/prompt-context.d.ts +1 -4
- package/dist/src/personal-agent/prompt-context.js +9 -34
- package/dist/src/personal-agent/prompts.js +35 -10
- package/dist/src/personal-agent/reply-composer.js +27 -13
- package/dist/src/personal-agent/request-access.d.ts +3 -0
- package/dist/src/personal-agent/request-access.js +31 -0
- package/dist/src/personal-agent/request-delivery.js +10 -5
- package/dist/src/personal-agent/request-repository.d.ts +4 -2
- package/dist/src/personal-agent/request-repository.js +4 -4
- package/dist/src/personal-agent/request-service.d.ts +3 -1
- package/dist/src/personal-agent/request-service.js +131 -38
- package/dist/src/personal-agent/task-cancel.d.ts +7 -0
- package/dist/src/personal-agent/task-cancel.js +76 -0
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/providers/model-response.js +13 -2
- package/dist/src/realtime/runtime.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 +5 -5
- package/dist/src/session/client-history.js +1 -1
- package/dist/src/session/index.js +1 -1
- package/dist/src/session/store.js +24 -11
- package/dist/src/session/thinking-resolve.js +1 -1
- 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 +2 -0
- package/dist/src/storage/sqlite/connection-wait-repository.js +83 -4
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/storage/sqlite/migrations/249_task_allocations.sql +17 -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/transcript-repository.d.ts +2 -0
- package/dist/src/storage/sqlite/transcript-repository.js +25 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/relations.d.ts +38 -2
- package/dist/src/tasks/capabilities/write.d.ts +40 -0
- package/dist/src/tasks/capabilities/write.js +7 -6
- package/dist/src/tasks/execution-context.js +1 -1
- package/dist/src/tasks/home-query-service.js +2 -2
- package/dist/src/tasks/index.js +5 -5
- package/dist/src/tasks/task-allocation-repository.d.ts +25 -0
- package/dist/src/tasks/task-allocation-repository.js +82 -0
- package/dist/src/tasks/task-allocation-service.d.ts +39 -0
- package/dist/src/tasks/task-allocation-service.js +310 -0
- package/dist/src/tasks/task-application-service.js +47 -4
- package/dist/src/tasks/task-collaboration-delivery.js +5 -2
- package/dist/src/tasks/task-collaboration-repository.d.ts +3 -0
- package/dist/src/tasks/task-collaboration-repository.js +11 -1
- package/dist/src/tasks/task-context-assembler.js +15 -7
- package/dist/src/tasks/task-continuation.d.ts +5 -0
- package/dist/src/tasks/task-continuation.js +32 -0
- package/dist/src/tasks/task-handoff-service.js +2 -2
- package/dist/src/tasks/task-main-update-decision-service.js +2 -2
- package/dist/src/tasks/task-main-update-delivery.js +15 -8
- package/dist/src/tasks/task-origin-repository.d.ts +2 -1
- package/dist/src/tasks/task-origin-repository.js +9 -5
- package/dist/src/tasks/task-read-model-projector.d.ts +2 -1
- package/dist/src/tasks/task-read-model-projector.js +22 -9
- package/dist/src/tasks/task-result-delivery-repository.js +1 -1
- package/dist/src/tasks/task-result-delivery-service.js +4 -4
- package/dist/src/tasks/task-run-coordinator.d.ts +1 -0
- package/dist/src/tasks/task-run-coordinator.js +31 -8
- package/dist/src/tasks/task-run-dispatcher.d.ts +1 -1
- package/dist/src/tasks/task-run-dispatcher.js +16 -4
- package/dist/src/tasks/task-run-repository.d.ts +8 -0
- package/dist/src/tasks/task-run-repository.js +32 -1
- package/dist/src/tui/backends/embedded-backend.js +11 -11
- package/dist/src/tui/backends/gateway-realtime-backend.js +2 -2
- package/dist/src/tui/extension-host/load-extensions.js +2 -2
- 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 +2 -2
- package/dist/src/tui/tui-startup-resources.js +5 -5
- 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/user-context/access-policy.js +1 -1
- package/dist/src/user-model/bootstrap.js +1 -1
- package/dist/src/user-model/capture/executor.js +1 -1
- package/dist/src/user-model/index.js +2 -2
- package/dist/src/voice/realtime/memory-context.js +6 -6
- 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/index.js +1 -1
- package/dist/src/work-discovery/service.js +7 -7
- 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 +2 -2
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Bewx00VC.js +0 -1
- package/dist/gateway/static/root/assets/agents-ByJbzt3F.js +0 -77
- package/dist/gateway/static/root/assets/automations-workspace-DOJnSOJ7.js +0 -6
- package/dist/gateway/static/root/assets/browser-automations-page-DGcGOkIq.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-CHCWHtkG.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-CVaH729t.js +0 -2
- package/dist/gateway/static/root/assets/connectors-page-BpCGV1Gg.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-CEfqb0dk.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-IK77lcix.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CnqeYLJI.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CKUJdUkK.js +0 -2
- package/dist/gateway/static/root/assets/index-BvOYtdnP.css +0 -1
- package/dist/gateway/static/root/assets/markdown-view-CZWff4bI.css +0 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-Bd0DNN_v.js +0 -1
- package/dist/gateway/static/root/assets/messages-CRy8QVkB.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-DiJ5O3Ga.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BEhxVwpX.js +0 -8
- package/dist/gateway/static/root/assets/page-tabs-BLGO2VIm.js +0 -1
- package/dist/gateway/static/root/assets/personal-page-Dpgj9Y5a.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-CAM4Q3Kh.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-B6y0lXZc.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-DY0UP_lC.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BLTR6Opb.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DWAAlzV5.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DPrpUIj7.js +0 -1
- package/dist/gateway/static/root/assets/tasks-DwKXgZ-I.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-BgIW4ITJ.js +0 -2
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { assertBrowserUrlAllowed } from "../../browser/url-policy.js";
|
|
2
|
-
import { BrowserRuntime } from "../../browser/runtime/browser-runtime.js";
|
|
3
|
-
import "../../browser/index.js";
|
|
4
1
|
import { DEFAULT_TOOL_METADATA, getToolMetadata } from "./metadata.js";
|
|
5
2
|
import { ToolConcurrencyController, resolveToolLockMode } from "./concurrency.js";
|
|
6
|
-
import { resolveImageModelConfigForTool } from "../image/tool-model-config.js";
|
|
7
|
-
import { createDataBatchTool } from "./dataBatch.js";
|
|
8
|
-
import { DEFAULT_DELEGATE_TOOLS, DELEGATE_BLOCKED_TOOLS, createDelegateTool } from "./delegate-tool.js";
|
|
9
3
|
import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, GREP_MAX_LINE_LENGTH, formatSize, truncateHead, truncateLine, truncateTail } from "./truncate.js";
|
|
10
4
|
import { createReadFileTool } from "./read.js";
|
|
5
|
+
import { createDataBatchTool } from "./dataBatch.js";
|
|
11
6
|
import { createWriteFileTool, writeFileTool } from "./write.js";
|
|
12
7
|
import { createListDirTool, listDirTool } from "./list-dir.js";
|
|
13
8
|
import { createPublishArtifactsTool } from "./publish-artifacts.js";
|
|
@@ -31,6 +26,11 @@ import { createUpdatePlanTool } from "./update-plan-tool.js";
|
|
|
31
26
|
import { createSessionStatusTool } from "./session-status-tool.js";
|
|
32
27
|
import { createMemoryMaintenanceTool } from "./memory-maintenance-tool.js";
|
|
33
28
|
import { createClarifyTool } from "./clarify-tool.js";
|
|
29
|
+
import { assertBrowserUrlAllowed } from "../../browser/url-policy.js";
|
|
30
|
+
import { BrowserRuntime } from "../../browser/runtime/browser-runtime.js";
|
|
31
|
+
import "../../browser/index.js";
|
|
32
|
+
import { resolveImageModelConfigForTool } from "../image/tool-model-config.js";
|
|
33
|
+
import { DEFAULT_DELEGATE_TOOLS, DELEGATE_BLOCKED_TOOLS, createDelegateTool } from "./delegate-tool.js";
|
|
34
34
|
import { createWorkflowTool } from "./workflow-tool.js";
|
|
35
35
|
import { createWorkflowManageTool } from "./workflow-manage-tool.js";
|
|
36
36
|
import { createAutomationTool } from "./automation-tool.js";
|
|
@@ -46,4 +46,5 @@ import { createManagedJobTool } from "./managed-job-tool.js";
|
|
|
46
46
|
import { createImageTool } from "./image-tool.js";
|
|
47
47
|
import { createImageGenerateTool, resolveImageGenerationModelConfigForTool } from "./image-generate-tool.js";
|
|
48
48
|
import { createPersonalReadTool } from "./personal-read-tool.js";
|
|
49
|
-
|
|
49
|
+
import { createTaskCollaborationTool } from "./task-collaboration-tool.js";
|
|
50
|
+
export { BrowserRuntime, DEFAULT_DELEGATE_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_TOOL_METADATA, DEFAULT_WEB_EXTRACT_MAX_LENGTH, DELEGATE_BLOCKED_TOOLS, GREP_MAX_LINE_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, TodoStore, ToolConcurrencyController, assertBrowserUrlAllowed, createApplyPatchTool, createAutomationTool, createBrowserAutomationTool, createClarifyTool, createCreateShareTool, createDataBatchTool, createDelegateTool, createDesktopPetTool, createExecCommandTool, createFindTool, createGrepTool, createImageGenerateTool, createImageTool, createKnowledgeGetTool, createKnowledgeReadTool, createKnowledgeSearchTool, createKnowledgeWriteTool, createListDirTool, createManagedJobTool, createMemoryMaintenanceTool, createMessageTool, createPersonalReadTool, createPublishArtifactsTool, createReadFileTool, createReadMediaTool, createSendMediaTool, createSessionRecallTool, createSessionSearchTool, createSessionStatusTool, createSkillInstallTool, createSkillManageTool, createSkillViewTool, createSkillsListTool, createSkillsMarketplaceSearchTool, createTaskCollaborationTool, createTodoTool, createToolManualTool, createUpdatePlanTool, createUserContextGetTool, createUserContextReadTool, createUserContextSearchTool, createUserContextUpdateTool, createWebExtractTool, createWebFetchTool, createWebSearchTool, createWorkflowManageTool, createWorkflowTool, createWriteFileTool, createXopcUseTool, findTool, formatSize, fuzzyFindText, generateDiffString, getToolMetadata, grepTool, isShareToolAvailable, listDirTool, normalizeForFuzzyMatch, normalizeToLF, resolveImageGenerationModelConfigForTool, resolveImageModelConfigForTool, resolveToolLockMode, restoreLineEndings, stripBom, stripHtmlBoilerplate, truncateHead, truncateLine, truncateTail, writeFileTool };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
2
1
|
import { checkedFilePath } from "../sandbox/fileAccess.js";
|
|
2
|
+
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
3
3
|
import { readdir } from "fs/promises";
|
|
4
4
|
import { Type } from "@sinclair/typebox";
|
|
5
5
|
//#region src/agent/tools/list-dir.ts
|
|
@@ -2,6 +2,8 @@ import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
|
2
2
|
import type { Config } from '../../config/schema.js';
|
|
3
3
|
declare const schema: import("@sinclair/typebox").TObject<{
|
|
4
4
|
command: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"list">, import("@sinclair/typebox").TLiteral<"follow">, import("@sinclair/typebox").TLiteral<"pause">, import("@sinclair/typebox").TLiteral<"end">, import("@sinclair/typebox").TLiteral<"resume">, import("@sinclair/typebox").TLiteral<"settings">, import("@sinclair/typebox").TLiteral<"interests">, import("@sinclair/typebox").TLiteral<"feedback">, import("@sinclair/typebox").TLiteral<"rollback">]>;
|
|
5
|
+
offset: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
6
|
+
limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
5
7
|
id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
6
8
|
subject: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7
9
|
summary: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getSqliteDatabase, init_transaction } from "../../storage/sqlite/transaction.js";
|
|
2
2
|
import { init_session_instance_repository, readCurrentTranscriptId } from "../../storage/sqlite/session-instance-repository.js";
|
|
3
|
-
import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
|
|
4
3
|
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
4
|
+
import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
|
|
5
|
+
import { boundedPersonalResult } from "./personal-result-budget.js";
|
|
5
6
|
import { parseLocalCheckTime } from "../../personal-agent/proactivity/follow-up-request.js";
|
|
6
7
|
import { applyThreadFeedback, getAttention, getProactivitySettings, listAttention, listInterestCandidates, patchAttention, patchProactivitySettings, rollbackStrategy, saveAttention, strategyState, userText } from "../../personal-agent/proactivity/repository.js";
|
|
7
8
|
import { Type } from "@sinclair/typebox";
|
|
@@ -20,6 +21,11 @@ const schema = Type.Object({
|
|
|
20
21
|
Type.Literal("feedback"),
|
|
21
22
|
Type.Literal("rollback")
|
|
22
23
|
]),
|
|
24
|
+
offset: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
25
|
+
limit: Type.Optional(Type.Integer({
|
|
26
|
+
minimum: 1,
|
|
27
|
+
maximum: 20
|
|
28
|
+
})),
|
|
23
29
|
id: Type.Optional(Type.String()),
|
|
24
30
|
subject: Type.Optional(Type.String({ maxLength: 160 })),
|
|
25
31
|
summary: Type.Optional(Type.String({ maxLength: 1600 })),
|
|
@@ -39,6 +45,35 @@ const schema = Type.Object({
|
|
|
39
45
|
])),
|
|
40
46
|
preparation: Type.Optional(Type.Union([Type.Literal("brief"), Type.Literal("thorough")])),
|
|
41
47
|
versionId: Type.Optional(Type.String({ description: "Latest strategy version ID returned by list; required for rollback." }))
|
|
48
|
+
}, {
|
|
49
|
+
additionalProperties: false,
|
|
50
|
+
anyOf: [
|
|
51
|
+
{ properties: { command: { enum: [
|
|
52
|
+
"list",
|
|
53
|
+
"settings",
|
|
54
|
+
"interests"
|
|
55
|
+
] } } },
|
|
56
|
+
{
|
|
57
|
+
properties: { command: { const: "follow" } },
|
|
58
|
+
required: ["subject"]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
properties: { command: { enum: [
|
|
62
|
+
"pause",
|
|
63
|
+
"end",
|
|
64
|
+
"resume"
|
|
65
|
+
] } },
|
|
66
|
+
required: ["id"]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
properties: { command: { const: "feedback" } },
|
|
70
|
+
required: ["id", "feedback"]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
properties: { command: { const: "rollback" } },
|
|
74
|
+
required: ["id", "versionId"]
|
|
75
|
+
}
|
|
76
|
+
]
|
|
42
77
|
});
|
|
43
78
|
function createPersonalAttentionTool(deps) {
|
|
44
79
|
return {
|
|
@@ -59,30 +94,29 @@ function createPersonalAttentionTool(deps) {
|
|
|
59
94
|
}],
|
|
60
95
|
details: {}
|
|
61
96
|
};
|
|
62
|
-
if (input.command === "interests") {
|
|
63
|
-
if (!resolveUserContextSessionAccess(config, conversationId).userModel) throw new Error("Interest access is unavailable");
|
|
97
|
+
if (input.command === "interests" || input.command === "list") {
|
|
98
|
+
if (input.command === "interests" && !resolveUserContextSessionAccess(config, conversationId).userModel) throw new Error("Interest access is unavailable");
|
|
99
|
+
const rows = input.command === "interests" ? listInterestCandidates(conversationId) : listAttention(conversationId).map((thread) => ({
|
|
100
|
+
id: thread.id,
|
|
101
|
+
subject: thread.subject,
|
|
102
|
+
status: thread.status,
|
|
103
|
+
nextCheckAt: thread.next_check_at,
|
|
104
|
+
revision: thread.revision,
|
|
105
|
+
strategy: strategyState(thread.id)
|
|
106
|
+
}));
|
|
107
|
+
const offset = input.offset ?? 0;
|
|
64
108
|
return {
|
|
65
109
|
content: [{
|
|
66
110
|
type: "text",
|
|
67
|
-
text: JSON.stringify(
|
|
111
|
+
text: JSON.stringify(boundedPersonalResult({
|
|
112
|
+
items: rows.slice(offset, offset + (input.limit ?? 10)),
|
|
113
|
+
total: rows.length,
|
|
114
|
+
offset
|
|
115
|
+
}))
|
|
68
116
|
}],
|
|
69
117
|
details: {}
|
|
70
118
|
};
|
|
71
119
|
}
|
|
72
|
-
if (input.command === "list") return {
|
|
73
|
-
content: [{
|
|
74
|
-
type: "text",
|
|
75
|
-
text: JSON.stringify(listAttention(conversationId).map((thread) => ({
|
|
76
|
-
id: thread.id,
|
|
77
|
-
subject: thread.subject,
|
|
78
|
-
status: thread.status,
|
|
79
|
-
nextCheckAt: thread.next_check_at,
|
|
80
|
-
revision: thread.revision,
|
|
81
|
-
strategy: strategyState(thread.id)
|
|
82
|
-
})))
|
|
83
|
-
}],
|
|
84
|
-
details: {}
|
|
85
|
-
};
|
|
86
120
|
const db = getSqliteDatabase();
|
|
87
121
|
const transcriptId = readCurrentTranscriptId(db, conversationId);
|
|
88
122
|
const source = db.prepare("SELECT entry_id,payload_json FROM transcript_entries WHERE transcript_id = ? AND role = 'user' ORDER BY seq DESC LIMIT 1").get(transcriptId);
|
|
@@ -20,6 +20,12 @@ const schema = Type.Object({
|
|
|
20
20
|
minimum: 1,
|
|
21
21
|
maximum: 10
|
|
22
22
|
}))
|
|
23
|
+
}, {
|
|
24
|
+
additionalProperties: false,
|
|
25
|
+
anyOf: [{ properties: { command: { const: "list" } } }, {
|
|
26
|
+
properties: { command: { const: "get" } },
|
|
27
|
+
required: ["id"]
|
|
28
|
+
}]
|
|
23
29
|
});
|
|
24
30
|
const fields = [
|
|
25
31
|
"id",
|
|
@@ -52,11 +58,15 @@ function compact(value, textLimit) {
|
|
|
52
58
|
result[key] = entry.slice(0, textLimit);
|
|
53
59
|
if (entry.length > textLimit) truncatedFields.push(key);
|
|
54
60
|
} else if (typeof entry === "number" || typeof entry === "boolean" || entry === null) result[key] = entry;
|
|
55
|
-
else if (entry && typeof entry === "object" && !Array.isArray(entry))
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
else if (entry && typeof entry === "object" && !Array.isArray(entry)) {
|
|
62
|
+
const nested = Object.entries(entry);
|
|
63
|
+
if (nested.length > 12 || nested.some(([, item]) => typeof item === "string" && item.length > 200 || item !== null && typeof item === "object")) truncatedFields.push(key);
|
|
64
|
+
result[key] = Object.fromEntries(nested.slice(0, 12).filter(([, item]) => [
|
|
65
|
+
"string",
|
|
66
|
+
"number",
|
|
67
|
+
"boolean"
|
|
68
|
+
].includes(typeof item) || item === null).map(([field, item]) => [field, typeof item === "string" ? item.slice(0, 200) : item]));
|
|
69
|
+
} else if (Array.isArray(entry)) truncatedFields.push(key);
|
|
60
70
|
}
|
|
61
71
|
if (truncatedFields.length) result.truncatedFields = truncatedFields;
|
|
62
72
|
return result;
|
|
@@ -119,7 +129,7 @@ function createPersonalReadTool(deps) {
|
|
|
119
129
|
items: selected.map((row) => compact(row, 200)),
|
|
120
130
|
offset,
|
|
121
131
|
total: result.total ?? rows.length,
|
|
122
|
-
nextOffset: selected.length
|
|
132
|
+
nextOffset: offset + selected.length < Number(result.total ?? rows.length) ? offset + selected.length : void 0,
|
|
123
133
|
excerpts: true
|
|
124
134
|
};
|
|
125
135
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { getSqliteDatabase, init_transaction } from "../../storage/sqlite/transaction.js";
|
|
1
|
+
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
2
2
|
import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-run-repository.js";
|
|
3
3
|
import { init_request_repository, personalRequestForExecution } from "../../personal-agent/request-repository.js";
|
|
4
|
+
import { assertPersonalRequestAccountAccess } from "../../personal-agent/request-access.js";
|
|
5
|
+
import { TaskCollaborationRepository } from "../../tasks/task-collaboration-repository.js";
|
|
6
|
+
import { selectionRequestHash } from "../../agent-matching/selection-repository.js";
|
|
4
7
|
import { PersonalRequestResultSchema } from "../../personal-agent/request-result.js";
|
|
5
8
|
import { Type } from "@sinclair/typebox";
|
|
6
9
|
//#region src/agent/tools/personal-request-result-tool.ts
|
|
@@ -47,8 +50,22 @@ function createPersonalRequestResultTool(conversationId) {
|
|
|
47
50
|
if (result.coverage && Date.parse(result.coverage.from) >= Date.parse(result.coverage.to)) throw new Error("Invalid coverage range");
|
|
48
51
|
if (result.coverage && request.parameters.timeRange && (Date.parse(result.coverage.from) > Date.parse(request.parameters.timeRange.from) || Date.parse(result.coverage.to) < Date.parse(request.parameters.timeRange.to))) result.coverage.partial = true;
|
|
49
52
|
const run = request.taskId ? new TaskRunRepository().getActiveRoot(request.taskId) : void 0;
|
|
50
|
-
if (!run || run.conversationId !== id) throw new Error("Task execution changed");
|
|
51
|
-
|
|
53
|
+
if (!run || run.conversationId !== id || !["running", "verifying"].includes(run.status)) throw new Error("Task execution changed");
|
|
54
|
+
assertPersonalRequestAccountAccess(request);
|
|
55
|
+
runSqliteWriteTransaction(() => {
|
|
56
|
+
const board = new TaskCollaborationRepository();
|
|
57
|
+
const direction = board.coordination(run.taskId).filter((entry) => ["main_agent", "user"].includes(entry.authorKind) && ["answer", "instruction"].includes(entry.kind)).at(-1)?.sequence ?? 0;
|
|
58
|
+
board.append({
|
|
59
|
+
taskId: run.taskId,
|
|
60
|
+
taskRunId: run.id,
|
|
61
|
+
authorKind: "worker_agent",
|
|
62
|
+
authorId: request.executorAgentId,
|
|
63
|
+
kind: "result",
|
|
64
|
+
body: result.summary,
|
|
65
|
+
idempotencyKey: `personal-request-result:${request.requestId}:${run.id}:${direction}:${selectionRequestHash(result)}`
|
|
66
|
+
});
|
|
67
|
+
getSqliteDatabase().prepare("UPDATE personal_requests SET result_json = ?, result_run_id = ?, updated_at = ? WHERE request_id = ?").run(JSON.stringify(result), run.id, Date.now(), request.requestId);
|
|
68
|
+
});
|
|
52
69
|
return {
|
|
53
70
|
content: [{
|
|
54
71
|
type: "text",
|
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
2
|
+
import { init_session_instance_repository, readCurrentTranscriptId } from "../../storage/sqlite/session-instance-repository.js";
|
|
3
|
+
import { getSessionInputState, init_session_input_repository } from "../../storage/sqlite/session-input-repository.js";
|
|
4
|
+
import { getPersonalRequest, init_request_repository, listPersonalRequests, updatePersonalRequest } from "../../personal-agent/request-repository.js";
|
|
5
|
+
import { getActiveConnectionWait, init_connection_wait_repository, reviseCurrentConnectionObjective, updateConnectionWait } from "../../storage/sqlite/connection-wait-repository.js";
|
|
6
|
+
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
7
|
+
import { init_session_repository } from "../../storage/sqlite/session-repository.js";
|
|
2
8
|
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
9
|
+
import { TaskAllocationRepository } from "../../tasks/task-allocation-repository.js";
|
|
10
|
+
import { boundedPersonalResult } from "./personal-result-budget.js";
|
|
11
|
+
import { selectionRequestHash } from "../../agent-matching/selection-repository.js";
|
|
12
|
+
import { cancelPersonalTask } from "../../personal-agent/task-cancel.js";
|
|
13
|
+
import { createPersonalTaskTool } from "./personal-task-tool.js";
|
|
3
14
|
import { personalCapabilities } from "../../personal-agent/capability-service.js";
|
|
4
|
-
import { cancelPersonalRequest, personalRequestSnapshot, publishPersonalRequest, submitPersonalRequest } from "../../personal-agent/request-service.js";
|
|
15
|
+
import { assertPersonalRequestTimeRange, cancelPersonalRequest, personalRequestSnapshot, publishPersonalRequest, submitPersonalRequest } from "../../personal-agent/request-service.js";
|
|
5
16
|
import { Type } from "@sinclair/typebox";
|
|
6
17
|
//#region src/agent/tools/personal-request-tool.ts
|
|
18
|
+
init_session_input_repository();
|
|
19
|
+
init_session_repository();
|
|
20
|
+
init_session_instance_repository();
|
|
21
|
+
init_connection_wait_repository();
|
|
7
22
|
init_request_repository();
|
|
23
|
+
init_transaction();
|
|
8
24
|
const CapabilitySchema = Type.Object({
|
|
9
25
|
query: Type.String({
|
|
10
26
|
minLength: 1,
|
|
@@ -17,12 +33,33 @@ const RequestSchema = Type.Object({
|
|
|
17
33
|
"submit",
|
|
18
34
|
"get",
|
|
19
35
|
"list",
|
|
20
|
-
"cancel"
|
|
36
|
+
"cancel",
|
|
37
|
+
"answer",
|
|
38
|
+
"instruct",
|
|
39
|
+
"collaboration",
|
|
40
|
+
"entry"
|
|
21
41
|
].map((command) => Type.Literal(command))),
|
|
42
|
+
instruction: Type.Optional(Type.String({
|
|
43
|
+
minLength: 1,
|
|
44
|
+
maxLength: 8e3
|
|
45
|
+
})),
|
|
46
|
+
questionId: Type.Optional(Type.String({ minLength: 1 })),
|
|
47
|
+
entryId: Type.Optional(Type.String({ minLength: 1 })),
|
|
48
|
+
afterSequence: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
49
|
+
bodyOffset: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
22
50
|
requestId: Type.Optional(Type.String()),
|
|
51
|
+
offset: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
52
|
+
limit: Type.Optional(Type.Integer({
|
|
53
|
+
minimum: 1,
|
|
54
|
+
maximum: 20
|
|
55
|
+
})),
|
|
23
56
|
connectorId: Type.Optional(Type.String()),
|
|
24
|
-
agentId: Type.Optional(Type.String()),
|
|
25
57
|
accountId: Type.Optional(Type.String()),
|
|
58
|
+
description: Type.Optional(Type.String({
|
|
59
|
+
minLength: 1,
|
|
60
|
+
maxLength: 16e3,
|
|
61
|
+
description: "Complete task brief preserving all user requirements, stages, inputs, outputs and constraints. Do not replace exact specifications with a short objective or a reference to an unspecified process."
|
|
62
|
+
})),
|
|
26
63
|
objective: Type.Optional(Type.String({
|
|
27
64
|
minLength: 1,
|
|
28
65
|
maxLength: 4e3
|
|
@@ -31,13 +68,49 @@ const RequestSchema = Type.Object({
|
|
|
31
68
|
minLength: 1,
|
|
32
69
|
maxLength: 200
|
|
33
70
|
})),
|
|
34
|
-
selectionReason: Type.Optional(Type.String({ maxLength: 500 })),
|
|
35
71
|
timeRange: Type.Optional(Type.Object({
|
|
36
72
|
from: Type.String(),
|
|
37
73
|
to: Type.String(),
|
|
38
74
|
timezone: Type.String(),
|
|
39
75
|
expression: Type.String()
|
|
40
76
|
}))
|
|
77
|
+
}, {
|
|
78
|
+
additionalProperties: false,
|
|
79
|
+
anyOf: [
|
|
80
|
+
{
|
|
81
|
+
properties: { command: { const: "submit" } },
|
|
82
|
+
required: [
|
|
83
|
+
"objective",
|
|
84
|
+
"connectorId",
|
|
85
|
+
"description"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{ properties: { command: { const: "list" } } },
|
|
89
|
+
{
|
|
90
|
+
properties: { command: { enum: [
|
|
91
|
+
"get",
|
|
92
|
+
"cancel",
|
|
93
|
+
"collaboration"
|
|
94
|
+
] } },
|
|
95
|
+
required: ["requestId"]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
properties: { command: { const: "entry" } },
|
|
99
|
+
required: ["requestId", "entryId"]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
properties: { command: { const: "instruct" } },
|
|
103
|
+
required: ["requestId", "instruction"]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
properties: { command: { const: "answer" } },
|
|
107
|
+
required: [
|
|
108
|
+
"requestId",
|
|
109
|
+
"questionId",
|
|
110
|
+
"instruction"
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
]
|
|
41
114
|
});
|
|
42
115
|
function createPersonalRequestTools(deps) {
|
|
43
116
|
const conversation = () => {
|
|
@@ -45,6 +118,28 @@ function createPersonalRequestTools(deps) {
|
|
|
45
118
|
if (!id || !isPersonalConversation(id)) throw new Error("Personal conversation is required");
|
|
46
119
|
return id;
|
|
47
120
|
};
|
|
121
|
+
const snapshot = (request) => {
|
|
122
|
+
const value = personalRequestSnapshot(request);
|
|
123
|
+
return {
|
|
124
|
+
...value,
|
|
125
|
+
executorAgentId: value.parameters.allocate && value.executorAgentId === "task-router" ? void 0 : value.executorAgentId,
|
|
126
|
+
...value.taskId ? { allocation: new TaskAllocationRepository().summary(value.taskId) } : {}
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
const compactSnapshot = (request) => {
|
|
130
|
+
const value = snapshot(request);
|
|
131
|
+
return {
|
|
132
|
+
requestId: value.requestId,
|
|
133
|
+
taskId: value.taskId,
|
|
134
|
+
state: value.state,
|
|
135
|
+
version: value.version,
|
|
136
|
+
connectorId: value.connectorId,
|
|
137
|
+
accountId: value.accountId,
|
|
138
|
+
executorAgentId: value.executorAgentId,
|
|
139
|
+
..."allocation" in value ? { allocation: value.allocation } : {},
|
|
140
|
+
parameters: { timeRange: value.parameters.timeRange }
|
|
141
|
+
};
|
|
142
|
+
};
|
|
48
143
|
const result = (value) => ({
|
|
49
144
|
content: [{
|
|
50
145
|
type: "text",
|
|
@@ -56,45 +151,149 @@ function createPersonalRequestTools(deps) {
|
|
|
56
151
|
name: "personal_capability",
|
|
57
152
|
label: "Connected app availability",
|
|
58
153
|
parameters: CapabilitySchema,
|
|
59
|
-
description: "Check connected-app capabilities, account connection state and specialist Agents locally.
|
|
154
|
+
description: "Check connected-app capabilities, account connection state and specialist Agents locally. The background Task Router selects an executor within account permissions; do not compare executor profiles in the main conversation. For Gmail or other supported apps, check here before delegating. ready is a local preflight; the worker still validates live tools. No remote search or authorization is performed.",
|
|
60
155
|
async execute(_id, input) {
|
|
61
|
-
return result(personalCapabilities(conversation(), input.query, input.accountId))
|
|
156
|
+
return result(personalCapabilities(conversation(), input.query, input.accountId).map(({ executorProfiles: _profiles, executorAgentIds, accounts, ...capability }) => ({
|
|
157
|
+
...capability,
|
|
158
|
+
eligibleExecutorCount: executorAgentIds.length,
|
|
159
|
+
accounts: accounts.map(({ executorAgentIds: _ids, ...account }) => account)
|
|
160
|
+
})));
|
|
62
161
|
}
|
|
63
162
|
}, {
|
|
64
163
|
name: "personal_request",
|
|
65
164
|
label: "Connected app request",
|
|
66
165
|
parameters: RequestSchema,
|
|
67
|
-
description: "Submit a read-only connected-app request using exact connectorId
|
|
166
|
+
description: "Submit a read-only connected-app request with a short objective and complete description using the exact connectorId from personal_capability. The background Task Router chooses an executor after account authorization. Preserves the objective, displays connection or account selection in this main chat, and starts a specialist Task automatically once connected. Return quickly after submission. Never claim data was read until the Task result arrives. Resolve absolute query dates and include timeRange. If mail has no user-specified range, the host returns an explicit last-7-days default; mention that range in your confirmation. get includes complete Task coordination state; collaboration/entry read the same board and full questions. answer forwards the exact questionId; instruct forwards new requirements to the existing Task. Answers and instructions cannot change the connector/account, grant access or allow writes; reconnection stays in the existing connection UI. Saved, delivered, executor-confirmed and verified are distinct states. Use get/list for status without polling; preserve idempotencyKey on uncertain retries; cancel only when the user requests it.",
|
|
68
167
|
async execute(toolCallId, input) {
|
|
69
168
|
const conversationId = conversation();
|
|
70
|
-
if (input.command === "list")
|
|
169
|
+
if (input.command === "list") {
|
|
170
|
+
const offset = input.offset ?? 0;
|
|
171
|
+
const items = listPersonalRequests(conversationId, input.limit ?? 10, offset).map((request) => {
|
|
172
|
+
const { result: _result, parameters, ...summary } = snapshot(request);
|
|
173
|
+
const { brief: _brief, ...queryParameters } = parameters;
|
|
174
|
+
return {
|
|
175
|
+
...summary,
|
|
176
|
+
parameters: queryParameters
|
|
177
|
+
};
|
|
178
|
+
});
|
|
179
|
+
const total = getSqliteDatabase().prepare("SELECT count(*) AS count FROM personal_requests WHERE conversation_id = ?").get(conversationId).count;
|
|
180
|
+
return result(boundedPersonalResult({
|
|
181
|
+
items,
|
|
182
|
+
total,
|
|
183
|
+
offset
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
71
186
|
if (input.command === "submit") {
|
|
72
|
-
if (!input.objective?.trim() || !input.connectorId
|
|
187
|
+
if (!input.objective?.trim() || !input.connectorId) throw new Error("objective and connectorId are required");
|
|
73
188
|
const request = submitPersonalRequest({
|
|
74
189
|
conversationId,
|
|
75
190
|
connectorId: input.connectorId,
|
|
76
|
-
agentId: input.agentId,
|
|
77
191
|
accountId: input.accountId,
|
|
78
192
|
objective: input.objective.trim(),
|
|
79
|
-
|
|
193
|
+
description: input.description?.trim(),
|
|
80
194
|
timeRange: input.timeRange,
|
|
81
|
-
idempotencyKey: input.idempotencyKey ??
|
|
195
|
+
idempotencyKey: input.idempotencyKey ?? `personal-request-submit:${selectionRequestHash({
|
|
196
|
+
inputId: getSessionInputState(conversationId).activeInputId ?? toolCallId,
|
|
197
|
+
objective: input.objective.trim(),
|
|
198
|
+
description: input.description?.trim(),
|
|
199
|
+
connectorId: input.connectorId,
|
|
200
|
+
accountId: input.accountId,
|
|
201
|
+
timeRange: input.timeRange
|
|
202
|
+
})}`
|
|
82
203
|
});
|
|
83
204
|
publishPersonalRequest(request);
|
|
84
205
|
deps.dispatchTaskRuns?.();
|
|
85
|
-
return result(
|
|
206
|
+
return result(compactSnapshot(request));
|
|
86
207
|
}
|
|
87
208
|
const request = input.requestId ? getPersonalRequest(input.requestId) : void 0;
|
|
88
209
|
if (!request || request.conversationId !== conversationId) throw new Error("Request does not belong to this conversation");
|
|
89
210
|
if (input.command === "cancel") {
|
|
211
|
+
if (["completed", "failed"].includes(personalRequestSnapshot(request).state)) return result(compactSnapshot(request));
|
|
212
|
+
if (request.state === "cancelled") {
|
|
213
|
+
const stop = request.taskId ? await cancelPersonalTask(request.taskId, conversationId, input.idempotencyKey ?? toolCallId) : { executionStopConfirmed: true };
|
|
214
|
+
return result({
|
|
215
|
+
...compactSnapshot(request),
|
|
216
|
+
executionStopConfirmed: stop.executionStopConfirmed
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
const stop = request.taskId ? await cancelPersonalTask(request.taskId, conversationId, input.idempotencyKey ?? toolCallId) : { executionStopConfirmed: true };
|
|
90
220
|
const cancelled = cancelPersonalRequest(request);
|
|
91
221
|
publishPersonalRequest(cancelled);
|
|
92
222
|
return result({
|
|
93
|
-
...cancelled,
|
|
94
|
-
executionStopConfirmed:
|
|
223
|
+
...compactSnapshot(cancelled),
|
|
224
|
+
executionStopConfirmed: stop.executionStopConfirmed
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
const taskTool = createPersonalTaskTool({
|
|
228
|
+
...deps,
|
|
229
|
+
getCurrentAgentId: () => deps.getCurrentAgentId?.() ?? getSessionMetadata(conversationId)?.agentId
|
|
230
|
+
});
|
|
231
|
+
if (input.command === "instruct" && input.timeRange) assertPersonalRequestTimeRange(input.timeRange);
|
|
232
|
+
const instruction = input.command === "instruct" && input.timeRange ? `${input.instruction}\n\nUpdated absolute query range: ${JSON.stringify(input.timeRange)}` : input.instruction;
|
|
233
|
+
if (input.command === "answer" || input.command === "instruct") {
|
|
234
|
+
if ([
|
|
235
|
+
"completed",
|
|
236
|
+
"failed",
|
|
237
|
+
"cancelled"
|
|
238
|
+
].includes(personalRequestSnapshot(request).state)) throw new Error("Request is no longer active");
|
|
239
|
+
if (readCurrentTranscriptId(getSqliteDatabase(), conversationId) !== request.transcriptId) throw new Error("SESSION_CHANGED");
|
|
240
|
+
if (!request.taskId && input.command === "instruct" && request.state === "waiting_connection") {
|
|
241
|
+
const addition = `\n\nSupplemental requirement:\n${instruction.trim()}`;
|
|
242
|
+
if (!request.objective.endsWith(addition)) runSqliteWriteTransaction(() => {
|
|
243
|
+
if (getActiveConnectionWait(conversationId)?.id !== request.connectionWaitId) throw new Error("Connection objective changed");
|
|
244
|
+
reviseCurrentConnectionObjective(conversationId, request.objective + addition);
|
|
245
|
+
const revised = getActiveConnectionWait(conversationId);
|
|
246
|
+
updateConnectionWait({
|
|
247
|
+
...revised,
|
|
248
|
+
checkpoint: {
|
|
249
|
+
...revised.checkpoint,
|
|
250
|
+
timeRange: input.timeRange ?? request.parameters.timeRange
|
|
251
|
+
}
|
|
252
|
+
}, revised.version);
|
|
253
|
+
updatePersonalRequest(request, {
|
|
254
|
+
objective: request.objective + addition,
|
|
255
|
+
parameters: {
|
|
256
|
+
...request.parameters,
|
|
257
|
+
...input.timeRange ? { timeRange: input.timeRange } : {}
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
return result({
|
|
262
|
+
...snapshot(getPersonalRequest(request.requestId)),
|
|
263
|
+
instructionStatus: "saved",
|
|
264
|
+
guidance: "Account authorization is still required. The existing Request will create its Task with this requirement after authorization."
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
if (input.command !== "get" || request.taskId) {
|
|
269
|
+
if (!request.taskId) throw new Error("No Task yet; complete account authorization in the main connection UI");
|
|
270
|
+
const coordinated = await taskTool.execute(toolCallId, {
|
|
271
|
+
...input,
|
|
272
|
+
instruction,
|
|
273
|
+
taskId: request.taskId
|
|
274
|
+
});
|
|
275
|
+
if (input.command === "instruct" && input.timeRange && JSON.parse(coordinated.content[0].text).ok === true) runSqliteWriteTransaction(() => {
|
|
276
|
+
const current = getPersonalRequest(request.requestId);
|
|
277
|
+
updatePersonalRequest(current, { parameters: {
|
|
278
|
+
...current.parameters,
|
|
279
|
+
timeRange: input.timeRange
|
|
280
|
+
} });
|
|
281
|
+
const wait = getActiveConnectionWait(conversationId);
|
|
282
|
+
if (wait && wait.id === current.connectionWaitId) updateConnectionWait({
|
|
283
|
+
...wait,
|
|
284
|
+
checkpoint: {
|
|
285
|
+
...wait.checkpoint,
|
|
286
|
+
timeRange: input.timeRange
|
|
287
|
+
}
|
|
288
|
+
}, wait.version);
|
|
289
|
+
});
|
|
290
|
+
if (input.command !== "get") return coordinated;
|
|
291
|
+
return result({
|
|
292
|
+
...snapshot(request),
|
|
293
|
+
coordination: JSON.parse(coordinated.content[0].text)
|
|
95
294
|
});
|
|
96
295
|
}
|
|
97
|
-
return result(
|
|
296
|
+
return result(snapshot(request));
|
|
98
297
|
}
|
|
99
298
|
}];
|
|
100
299
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import "./local-read-budget.js";
|
|
2
|
+
//#region src/agent/tools/personal-result-budget.ts
|
|
3
|
+
/** Bound model-visible reads and disclose every omitted field or list item. */
|
|
4
|
+
function boundedPersonalResult(value) {
|
|
5
|
+
let truncated = false;
|
|
6
|
+
const project = (entry, depth = 0) => {
|
|
7
|
+
if (typeof entry === "string") {
|
|
8
|
+
if (entry.length > 600) truncated = true;
|
|
9
|
+
return entry.slice(0, 600);
|
|
10
|
+
}
|
|
11
|
+
if (!entry || typeof entry !== "object") return entry;
|
|
12
|
+
if (depth > 6) {
|
|
13
|
+
truncated = true;
|
|
14
|
+
return "[omitted]";
|
|
15
|
+
}
|
|
16
|
+
if (Array.isArray(entry)) {
|
|
17
|
+
if (entry.length > 20) truncated = true;
|
|
18
|
+
return entry.slice(0, 20).map((item) => project(item, depth + 1));
|
|
19
|
+
}
|
|
20
|
+
return Object.fromEntries(Object.entries(entry).map(([key, item]) => [key, project(item, depth + 1)]));
|
|
21
|
+
};
|
|
22
|
+
const result = project(value);
|
|
23
|
+
if (!result || typeof result !== "object" || Array.isArray(result)) return result;
|
|
24
|
+
const payload = result;
|
|
25
|
+
let removedItems = false;
|
|
26
|
+
const items = payload.items;
|
|
27
|
+
if (Array.isArray(items)) {
|
|
28
|
+
while (items.length && JSON.stringify(payload).length > 7900) {
|
|
29
|
+
items.pop();
|
|
30
|
+
truncated = true;
|
|
31
|
+
removedItems = true;
|
|
32
|
+
}
|
|
33
|
+
if (!items.length && removedItems) return {
|
|
34
|
+
...payload,
|
|
35
|
+
nextOffset: void 0,
|
|
36
|
+
truncated: true,
|
|
37
|
+
requiresSpecialist: true,
|
|
38
|
+
guidance: "A single item exceeds the local read budget."
|
|
39
|
+
};
|
|
40
|
+
if (typeof payload.offset === "number" && (removedItems || typeof payload.total === "number" && payload.offset + items.length < payload.total)) payload.nextOffset = payload.offset + items.length;
|
|
41
|
+
}
|
|
42
|
+
if (JSON.stringify(payload).length > 7900) return {
|
|
43
|
+
truncated: true,
|
|
44
|
+
requiresSpecialist: true,
|
|
45
|
+
guidance: "Complete details exceed the local read budget."
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
...payload,
|
|
49
|
+
...truncated ? {
|
|
50
|
+
truncated: true,
|
|
51
|
+
excerpts: true,
|
|
52
|
+
...!Array.isArray(items) ? { requiresSpecialist: true } : {}
|
|
53
|
+
} : {}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { boundedPersonalResult };
|