@xopcai/xopc 0.0.386 → 0.0.388
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/dist/sidepanel.js +1 -1
- 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-D-86VOlb.js → agent-avatar-dicebear-44LqtGte.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-SmeUVHY8.js → agent-defaults-settings-panel-2VA4eKPf.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-BVT3wXq5.js → agent-plugin-dialog-DRhTOw_O.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-D7rLQFhX.js → agents-BemUH_Yf.js} +3 -3
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CUR7n5iP.js → app-management-settings-panel-CR_cc7rj.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BCotSGep.js → appearance-settings-CYofu-su.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-hk0bo9LT.js → apps-page-CHjWvDjk.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CqxuUwox.js → automations-page-BIF0skon.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-11_Z69pr.js → automations-workspace-DOwtT4sS.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-eldB84Mj.js → block-editor-C_RD603p.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-D4TaUPYT.js → browser-automations-page-B-Ezk_8l.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-BXRlxeGV.js → browser-settings-page-BSmmTBn4.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-DVj9n65C.js → capabilities-BX1rCiVm.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BkKgImWi.js → capabilities-CW389yo6.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-CyYlueEd.js → capabilities-page-xZgTYYDn.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-uVEgfvo0.js → capabilities-settings-panel-oqkuOjcR.js} +3 -3
- package/dist/gateway/static/root/assets/{capability-header-actions-BXv0xu56.js → capability-header-actions-Chuhscdb.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-fNb3SOzm.js → channels-Dq2C2k9M.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CnLtparQ.js → chat-terminal-dock-srB_M-aQ.js} +1 -1
- package/dist/gateway/static/root/assets/{chunk-KS7C4IRE-BMYIfy9x.js → chunk-KS7C4IRE--EKdQGRF.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-xM0AnOlP.js → computer-settings-page-Af00Kjc0.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-CdG2WUb6.js → connector-service-page-3W0_7-4L.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-BRd08GH6.js → connectors-page-BZk-Gou5.js} +1 -1
- package/dist/gateway/static/root/assets/constants-DeXt1mV-.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-DIBbE-O8.js → date-picker-DBgZBmik.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DDD8zokD.js → dependency-picker-BDJ406kH.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-KlF390Xn.js → desktop-pet-Do1XPn6U.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CgqQMKDC.js → desktop-pet-settings-LKeVh6OH.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-BR6isfG2.js → device-pairing-wizard-CvZpnSVw.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-vPQsW05P.js → directory-picker-path-field-BMLHoL6g.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-ZHLPrLbH.js → extension-debug-page-B0wTBCx4.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DJ42KFRN.js → extension-page-vR2r4uUB.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-6IcsyNaV.js → extension-provider-CJZ5EVpQ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-D7-5v0V4.js → extension-settings-page-1tbWe5xQ.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-DnYn7qOV.js → fallback-models-CW6a1-GK.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-Bwe3JWX-.js → gateway-settings-vQWTUx2c.js} +1 -1
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-DefTxF3q.js → highlighted-body-KQOG7T2V-BM__yiMn.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-hfWuVtcG.js +2 -0
- package/dist/gateway/static/root/assets/{imports-page-CTdBYZib.js → imports-page-CuR6RSUM.js} +1 -1
- package/dist/gateway/static/root/assets/index-CNH8vwcY.js +260 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CXKp57O_.js → keyboard-shortcuts-settings-DpyqH2cP.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-DzD_OzGY.js → local-app-workbench-page-B4hIoxV8.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-B0E0vttg.js → local-apps-page-S7lUpENM.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-Be4BGM4Z.js +1 -0
- package/dist/gateway/static/root/assets/{logs-page-eL4fYcMl.js → logs-page-CSlZT1-L.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-DSpjodMC.js → management-settings-BYCL5CwV.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DHfQAvZQ.js → markdown-view-CBjl-XEc.js} +2 -2
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-i9N5shss.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-CsY5tQp5.js → note-detail-panel-CJ5Earr_.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-api-nqN2wKYc.js → notes-api-BlGP533W.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-D09LjNoj.js → notes-page-CPGk8-n1.js} +5 -5
- package/dist/gateway/static/root/assets/{page-context-capture-button-DO-aP3D9.js → page-context-capture-button-C2bSXVbz.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-E8F2aGNB.js → personal-page-BjTt5R3s.js} +1 -1
- package/dist/gateway/static/root/assets/product-open-page-Cn16lm5l.js +1 -0
- package/dist/gateway/static/root/assets/{product-preview-content-B-cz-pIV.js → product-preview-content-CowgeuoG.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-WhefAh8E.js → project-detail-page-CyKx4PyN.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-CyqAs0tO.js → projects-page--_hXxUMC.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BwhRGL6m.js → remote-access-hub-Bq_eqQYf.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-o26dmPNq.js → runtime-tools-settings-panel-BgCATci5.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-D_e19kv_.js → scenes-page-DxE3jRPR.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DLLdqUC3.js → schema-form-I6pzJJzg.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-2I-nFJcE.js → send-session-input-C293-Hbx.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-Co5ozD0l.js → session-manager-COd9RECl.js} +2 -2
- package/dist/gateway/static/root/assets/{sessions-page-DX6INsiS.js → sessions-page-CQkGFnJM.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Dtlsvsci.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-Bc_zxxRu.js → settings-page-Dy5oQDbx.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-FpF_cPPr.js → setup-status-panel-CrAazq4r.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-C47Xgzta.js → share-link-dialog-BKGI8Kr0.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BOCcPBqQ.js → share-preview-page-BF2WaO43.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-CInxjxgJ.js → shares-settings-BNMhs-Vd.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-Bjd8WAA4.js → skill-api-RIjxQs-Y.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-8CKS3Oo2.js → skills-page-XVOxILQn.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BgQdsrNw.js → system-settings-panel-C8aLy8T_.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-BnG5ehZ6.js → task-detail-page-o1O2IDVP.js} +2 -2
- package/dist/gateway/static/root/assets/{task-expandable-content-BCuc70Vc.js → task-expandable-content-C9ohICpw.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-CY7MoDGf.js → tunnel-api-JkDu1wiC.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-s8Sv_PIG.js → usage-page-B8K6Y4ro.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-D0S2iZF4.js → use-composer-attachments-rgW7h4sD.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-BElqELib.js → use-file-preview-expanded-DSKIxfz9.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-CyWrEtHY.js → user-model-page-C1QX47VR.js} +2 -2
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DmZXLs1v.js → work-discovery-overlay-BshsEDRO.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BdLOzHm4.js → workflow-run-setup-panel-CRG3paWy.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-Cx3I3AV5.js → workflows-page-c-AoSVzm.js} +3 -3
- package/dist/gateway/static/root/assets/{workspace-api-Du7-xJ0q.js → workspace-api-JWHOFos6.js} +2 -2
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-D8B136vW.js → xopc-cloud-account-card-PDSIicr1.js} +1 -1
- package/dist/gateway/static/root/index.html +15 -15
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/index.js +2 -0
- package/dist/packages/gateway-contract/src/result-reference.js +25 -0
- package/dist/packages/gateway-contract/src/session-input-command.js +2 -1
- package/dist/packages/gateway-contract/src/task-research-result.js +1 -0
- package/dist/packages/gateway-contract/src/task-result-delivery.js +21 -0
- package/dist/packages/gateway-contract/src/turn-outcome.js +1 -0
- package/dist/src/agent/agent-manager.js +16 -16
- 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 +9 -9
- package/dist/src/agent/child-agent-factory.js +1 -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/run-for-session.js +5 -5
- package/dist/src/agent/embedded/run-turn.js +13 -13
- package/dist/src/agent/embedded/session-runner.js +3 -3
- 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/xopc-tools-bridge.js +13 -2
- package/dist/src/agent/external-tools/cliProvider.js +4 -4
- package/dist/src/agent/external-tools/composio-provider.js +3 -3
- package/dist/src/agent/external-tools/endpoint-provider.js +4 -4
- package/dist/src/agent/external-tools/gateway-tools.js +3 -3
- 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/inbound/attachment-pipeline.js +4 -4
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/index.js +3 -3
- 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/llm-turn-retry.js +1 -1
- package/dist/src/agent/prompt/response-language.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.d.ts +2 -0
- package/dist/src/agent/service/direct-turn-helpers.js +8 -4
- package/dist/src/agent/service/process-direct-one-shot.js +4 -1
- package/dist/src/agent/service/process-direct-streaming.js +7 -6
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.js +21 -21
- package/dist/src/agent/session/session-config-service.js +3 -3
- package/dist/src/agent/session/session-hydrator.js +1 -1
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +2 -2
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/source-context/index.js +2 -2
- package/dist/src/agent/source-context/result-context.d.ts +2 -0
- package/dist/src/agent/source-context/result-context.js +32 -0
- package/dist/src/agent/source-context/types.d.ts +2 -2
- package/dist/src/agent/source-context/types.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +7 -7
- 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/exec-command.js +47 -2
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.js +35 -28
- 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-attention-tool.js +2 -2
- package/dist/src/agent/tools/personal-performance.d.ts +2 -0
- package/dist/src/agent/tools/personal-performance.js +82 -0
- package/dist/src/agent/tools/personal-request-result-tool.js +1 -1
- package/dist/src/agent/tools/personal-request-tool.js +3 -3
- package/dist/src/agent/tools/personal-result-tool.d.ts +2 -0
- package/dist/src/agent/tools/personal-result-tool.js +106 -0
- package/dist/src/agent/tools/personal-task-tool.d.ts +11 -1
- package/dist/src/agent/tools/personal-task-tool.js +110 -6
- 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 +21 -2
- 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 +9 -1
- package/dist/src/agent/tools/task-collaboration-tool.js +122 -3
- package/dist/src/agent/tools/task-evidence.d.ts +3 -0
- package/dist/src/agent/tools/task-evidence.js +71 -0
- package/dist/src/agent/tools/task-result-tool.js +24 -4
- package/dist/src/agent/tools/tool-media.js +1 -1
- 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 +26 -5
- 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-matching/delegation-service.js +1 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/oauth/xopc-cloud.js +2 -2
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/domain/index.js +1 -1
- package/dist/src/automations/draft/automation-draft-service.js +1 -1
- package/dist/src/automations/index.js +2 -2
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/capabilities/store-connector.js +2 -2
- 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/builtins/config.js +4 -4
- 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/context.js +2 -2
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +7 -7
- 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/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/extension.js +2 -2
- 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/model.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.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 +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.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.js +5 -5
- package/dist/src/connectors/content-enrichment.js +1 -1
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/connectors/learning-coordinator.js +1 -1
- package/dist/src/discussions/live-worker.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/auth.js +1 -1
- package/dist/src/extensions/agent-plugins/credentials.js +1 -1
- 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 +4 -4
- package/dist/src/gateway/hono/routes/agent-stream.js +1 -1
- 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/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/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 +1 -1
- package/dist/src/gateway/hono/routes/projects.js +3 -3
- package/dist/src/gateway/hono/routes/runtime-tools.js +1 -1
- package/dist/src/gateway/hono/routes/session-command-handler.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +5 -5
- package/dist/src/gateway/hono/routes/sessions.js +3 -3
- package/dist/src/gateway/hono/routes/shares.js +2 -2
- 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 +7 -7
- package/dist/src/gateway/hono/routes/voice.js +7 -7
- package/dist/src/gateway/hono/routes/workflows.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 +2 -2
- 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 +3 -3
- package/dist/src/gateway/service/config-coordinator.js +2 -2
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +24 -5
- package/dist/src/gateway/service/session-command-service.js +2 -2
- package/dist/src/gateway/service/session-input-coordinator.js +2 -2
- package/dist/src/gateway/service.js +72 -41
- package/dist/src/gateway/session-context-summary.js +4 -4
- 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/compatibility.js +1 -1
- package/dist/src/imports/inventory.js +3 -3
- package/dist/src/imports/productImport.js +2 -2
- package/dist/src/imports/runtime.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 +9 -9
- 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 +2 -2
- package/dist/src/mcp/gateway-http-client.js +1 -1
- package/dist/src/media/session-references.js +1 -1
- package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
- package/dist/src/memory-learning/source-learning.js +4 -4
- 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/service.js +3 -3
- package/dist/src/personal-agent/capability-service.js +2 -2
- package/dist/src/personal-agent/communication.js +1 -0
- package/dist/src/personal-agent/performance.d.ts +83 -0
- package/dist/src/personal-agent/performance.js +65 -0
- package/dist/src/personal-agent/policy.d.ts +1 -1
- package/dist/src/personal-agent/policy.js +1 -0
- package/dist/src/personal-agent/proactivity/routes.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +7 -7
- package/dist/src/personal-agent/prompt-context.js +9 -7
- package/dist/src/personal-agent/prompts.js +7 -4
- package/dist/src/personal-agent/reply-composer.js +86 -15
- package/dist/src/personal-agent/request-delivery.js +5 -3
- package/dist/src/personal-agent/request-service.js +5 -5
- package/dist/src/personal-agent/result-extraction.d.ts +42 -0
- package/dist/src/personal-agent/result-extraction.js +209 -0
- package/dist/src/personal-agent/result-read-continuations.d.ts +13 -0
- package/dist/src/personal-agent/result-read-continuations.js +78 -0
- package/dist/src/personal-agent/result-reader.d.ts +43 -0
- package/dist/src/personal-agent/result-reader.js +461 -0
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/personal-agent/task-cancel.js +1 -1
- package/dist/src/platform/index.js +1 -1
- package/dist/src/projects/index.js +1 -1
- package/dist/src/projects/project-agent-suggestion.js +1 -1
- package/dist/src/projects/project-service.js +1 -1
- package/dist/src/projects/project-skill-service.js +2 -2
- package/dist/src/projects/workspace.js +1 -1
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/realtime/runtime.js +1 -1
- package/dist/src/remote-access/exposure-manager.js +1 -1
- package/dist/src/routing/agent-session-key.js +1 -1
- package/dist/src/scenes/taskFollowUp/agentExecutor.js +4 -4
- package/dist/src/scenes/taskFollowUp/resources.js +2 -2
- package/dist/src/scenes/taskFollowUp/service.js +6 -6
- package/dist/src/session/client-history.d.ts +1 -1
- package/dist/src/session/client-history.js +1 -1
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/init-session-turn.js +1 -1
- package/dist/src/session/resolve-session.js +1 -1
- package/dist/src/session/session-context-for-llm.js +2 -0
- package/dist/src/session/store.js +5 -5
- package/dist/src/session/thinking-resolve.js +1 -1
- package/dist/src/share/hosted-session-share.js +2 -2
- package/dist/src/share/session-share-service.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/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/storage/sqlite/migrations/251_personal_result_reads.sql +40 -0
- package/dist/src/storage/sqlite/migrations/252_task_work_revisions.sql +15 -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/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tasks/home-query-service.js +2 -2
- package/dist/src/tasks/index.js +4 -4
- package/dist/src/tasks/task-allocation-service.js +64 -13
- package/dist/src/tasks/task-application-service.d.ts +18 -0
- package/dist/src/tasks/task-application-service.js +135 -4
- package/dist/src/tasks/task-collaboration-delivery.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +10 -7
- package/dist/src/tasks/task-contract-definition.d.ts +3 -0
- package/dist/src/tasks/task-contract-planner.js +50 -16
- package/dist/src/tasks/task-conversation-repository.js +1 -1
- package/dist/src/tasks/task-evidence-ranges.d.ts +7 -0
- package/dist/src/tasks/task-evidence-ranges.js +20 -0
- package/dist/src/tasks/task-execution-capabilities.d.ts +26 -0
- package/dist/src/tasks/task-execution-capabilities.js +117 -0
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-handoff.d.ts +56 -0
- package/dist/src/tasks/task-handoff.js +510 -0
- package/dist/src/tasks/task-main-update-decision-service.js +3 -3
- package/dist/src/tasks/task-model-call.js +1 -1
- package/dist/src/tasks/task-read-model-projector.d.ts +6 -0
- package/dist/src/tasks/task-read-model-projector.js +12 -1
- package/dist/src/tasks/task-research-repair.js +6 -2
- package/dist/src/tasks/task-research-result.d.ts +16 -2
- package/dist/src/tasks/task-research-result.js +126 -42
- package/dist/src/tasks/task-result-delivery-repository.js +27 -4
- package/dist/src/tasks/task-result-delivery-service.js +38 -10
- package/dist/src/tasks/task-run-coordinator.js +7 -5
- package/dist/src/tasks/task-run-dispatcher.d.ts +1 -0
- package/dist/src/tasks/task-run-dispatcher.js +3 -2
- package/dist/src/tui/backends/embedded-backend.js +13 -13
- 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 +5 -5
- 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 +6 -6
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/user-context/access-policy.js +2 -2
- 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 +7 -7
- 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/service.js +7 -7
- package/dist/src/workflows/context/workflow-context.js +1 -1
- package/dist/src/workflows/engine/workflow-engine.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +7 -7
- package/dist/src/workflows/service/workflow-session-bridge.js +2 -2
- package/package.json +5 -3
- package/dist/gateway/static/root/assets/constants-CpWu0oHS.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BtSy2hRV.js +0 -2
- package/dist/gateway/static/root/assets/index-B08iR7fT.js +0 -260
- package/dist/gateway/static/root/assets/local-session-drafts-D_tYFy7d.js +0 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-BTrk2wWv.js +0 -1
- package/dist/gateway/static/root/assets/product-open-page-aUoA-uPw.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-C4_gW1vw.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { downloadSkillZipBuffer, fetchMarketplacePackageDetail, listSkillCategories, listSkillPackages, resolveSkillZipDownloadUrl, resolveSkillsStoreBaseUrl, skillIdForMarketplaceInstall, verifyStoreArtifactSha256 } from "./store-api-client.js";
|
|
2
1
|
import { registerMarketplaceAdapter } from "../../registry.js";
|
|
3
2
|
import { buildSkillMarkdownPreviewFromRaw } from "../../../skill-markdown-preview-from-raw.js";
|
|
3
|
+
import { downloadSkillZipBuffer, fetchMarketplacePackageDetail, listSkillCategories, listSkillPackages, resolveSkillZipDownloadUrl, resolveSkillsStoreBaseUrl, skillIdForMarketplaceInstall, verifyStoreArtifactSha256 } from "./store-api-client.js";
|
|
4
4
|
//#region src/agent/skills/marketplace/adapters/store/adapter.ts
|
|
5
5
|
const storeMarketplaceAdapter = {
|
|
6
6
|
id: "store",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { MAX_SKILL_ZIP_BYTES, isValidSkillId } from "../../../managed-store.js";
|
|
1
2
|
import { init_resolution, resolveConnectedPlatformEndpoint } from "../../../../../platform/resolution.js";
|
|
2
3
|
import { MAX_EXTENSION_STORE_ZIP_BYTES } from "../../../../../extensions/store-zip-limits.js";
|
|
3
|
-
import { MAX_SKILL_ZIP_BYTES, isValidSkillId } from "../../../managed-store.js";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
//#region src/agent/skills/marketplace/adapters/store/store-api-client.ts
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isSessionSourceBinding, isTurnContextRef, parseTurnContextRefs, summarizeSourceContext } from "./types.js";
|
|
2
|
-
import {
|
|
2
|
+
import { buildUserAssertionAgentContext } from "./user-assertion-context.js";
|
|
3
3
|
import { buildFileAgentContext } from "./file-context.js";
|
|
4
4
|
import { buildSessionAgentContext } from "./session-context.js";
|
|
5
5
|
import { buildBrowserTabAgentContext } from "./browser-tab.js";
|
|
6
|
-
import {
|
|
6
|
+
import { injectSourceContextsIntoUserMessage } from "./injector.js";
|
|
7
7
|
export { buildBrowserTabAgentContext, buildFileAgentContext, buildSessionAgentContext, buildUserAssertionAgentContext, injectSourceContextsIntoUserMessage, isSessionSourceBinding, isTurnContextRef, parseTurnContextRefs, summarizeSourceContext };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { parseResultReferenceId, resultReferenceVersion } from "../../../packages/gateway-contract/src/result-reference.js";
|
|
2
|
+
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
|
+
import { resolvePersonalResultReference } from "../../personal-agent/result-reader.js";
|
|
4
|
+
//#region src/agent/source-context/result-context.ts
|
|
5
|
+
init_src();
|
|
6
|
+
function buildResultAgentContext(conversationId, sourceId, expectedVersion) {
|
|
7
|
+
const selection = parseResultReferenceId(sourceId);
|
|
8
|
+
if (!selection) return null;
|
|
9
|
+
try {
|
|
10
|
+
const delivery = resolvePersonalResultReference(conversationId, selection.resultId);
|
|
11
|
+
const version = resultReferenceVersion(delivery);
|
|
12
|
+
if (expectedVersion && expectedVersion !== version) return null;
|
|
13
|
+
const artifact = selection.sourceId === "body" ? void 0 : delivery.outcome.deliverables.find((item) => item.artifactId === selection.sourceId);
|
|
14
|
+
if (selection.sourceId !== "body" && !artifact) return null;
|
|
15
|
+
return {
|
|
16
|
+
kind: "result",
|
|
17
|
+
sourceId,
|
|
18
|
+
version,
|
|
19
|
+
title: artifact?.title ?? delivery.taskTitle,
|
|
20
|
+
text: JSON.stringify({
|
|
21
|
+
...selection,
|
|
22
|
+
taskId: delivery.taskId,
|
|
23
|
+
version,
|
|
24
|
+
guidance: "The user selected this result. Read its exact content with personal_result; this reference is not the full source."
|
|
25
|
+
})
|
|
26
|
+
};
|
|
27
|
+
} catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { buildResultAgentContext };
|
|
@@ -13,7 +13,7 @@ export interface SessionSourceBinding {
|
|
|
13
13
|
}
|
|
14
14
|
export interface TurnContextRef {
|
|
15
15
|
refId?: string;
|
|
16
|
-
kind: 'note' | 'task' | 'file' | 'session' | 'browser_tab' | 'user_assertion';
|
|
16
|
+
kind: 'result' | 'note' | 'task' | 'file' | 'session' | 'browser_tab' | 'user_assertion';
|
|
17
17
|
sourceId: string;
|
|
18
18
|
expectedVersion?: string;
|
|
19
19
|
}
|
|
@@ -32,7 +32,7 @@ export interface SourceContextRefSummary {
|
|
|
32
32
|
}
|
|
33
33
|
export interface AgentSourceContext {
|
|
34
34
|
refId?: string;
|
|
35
|
-
kind: SessionSourceBinding['kind'] | 'task' | 'file' | 'session' | 'browser_tab' | 'browser_page' | 'app_context' | 'user_assertion' | 'device_context';
|
|
35
|
+
kind: SessionSourceBinding['kind'] | 'result' | 'task' | 'file' | 'session' | 'browser_tab' | 'browser_page' | 'app_context' | 'user_assertion' | 'device_context';
|
|
36
36
|
sourceId: string;
|
|
37
37
|
version: string;
|
|
38
38
|
title: string;
|
|
@@ -17,7 +17,7 @@ function summarizeSourceContext(context) {
|
|
|
17
17
|
function isTurnContextRef(value) {
|
|
18
18
|
if (!value || typeof value !== "object") return false;
|
|
19
19
|
const row = value;
|
|
20
|
-
return (row.kind === "note" || row.kind === "task" || row.kind === "file" || row.kind === "session" || row.kind === "browser_tab" || row.kind === "user_assertion") && typeof row.sourceId === "string" && row.sourceId.trim().length > 0 && (row.refId === void 0 || typeof row.refId === "string" && /^[A-Za-z0-9_-]{1,64}$/.test(row.refId)) && (row.expectedVersion === void 0 || typeof row.expectedVersion === "string");
|
|
20
|
+
return (row.kind === "result" || row.kind === "note" || row.kind === "task" || row.kind === "file" || row.kind === "session" || row.kind === "browser_tab" || row.kind === "user_assertion") && typeof row.sourceId === "string" && row.sourceId.trim().length > 0 && (row.refId === void 0 || typeof row.refId === "string" && /^[A-Za-z0-9_-]{1,64}$/.test(row.refId)) && (row.expectedVersion === void 0 || typeof row.expectedVersion === "string");
|
|
21
21
|
}
|
|
22
22
|
function parseTurnContextRefs(value, max = 5) {
|
|
23
23
|
if (value === void 0) return [];
|
|
@@ -2,20 +2,20 @@ import { createLogger } from "../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { TaskRepository, init_task_repository } from "../../tasks/task-repository.js";
|
|
4
4
|
import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-run-repository.js";
|
|
5
|
+
import { resolveTaskLocale } from "../../tasks/task-language.js";
|
|
5
6
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
7
|
+
import { TaskCollaborationRepository } from "../../tasks/task-collaboration-repository.js";
|
|
8
|
+
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
9
|
+
import { extractAssistantText, getAssistantMessageErrorReason, isTransientProviderErrorMessage, stripCodeFences } from "../../providers/model-response.js";
|
|
6
10
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
7
11
|
import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
|
|
8
12
|
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
9
|
-
import { extractAssistantText, getAssistantMessageErrorReason, isTransientProviderErrorMessage, stripCodeFences } from "../../providers/model-response.js";
|
|
10
|
-
import { canResumeAfterModelFailure } from "../orchestration/turn-recovery.js";
|
|
11
|
-
import { resolveTaskLocale } from "../../tasks/task-language.js";
|
|
12
|
-
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
13
|
-
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
14
|
-
import { TaskCollaborationRepository } from "../../tasks/task-collaboration-repository.js";
|
|
15
13
|
import { currentTaskResearchResult } from "../../tasks/task-research-result.js";
|
|
14
|
+
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
15
|
+
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
16
|
+
import { canResumeAfterModelFailure } from "../orchestration/turn-recovery.js";
|
|
16
17
|
import { buildResponseLanguageSection } from "../prompt/sections/response-language.js";
|
|
17
18
|
import { resolveResponseLanguageForSession } from "../prompt/response-language.js";
|
|
18
|
-
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
19
19
|
//#region src/agent/tasks/task-judge-service.ts
|
|
20
20
|
init_schema();
|
|
21
21
|
init_providers();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { turnOutcomeKindFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { assertWorkspaceTreeReadable, checkedFilePath } from "../sandbox/fileAccess.js";
|
|
4
|
-
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
5
3
|
import { resolveGatewayEffectiveHost } from "../../config/gateway-bind.js";
|
|
4
|
+
import { resolveReverseProxyPublicUrl } from "../../gateway/public-url.js";
|
|
5
|
+
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
6
|
+
import { assertWorkspaceTreeReadable, checkedFilePath } from "../sandbox/fileAccess.js";
|
|
6
7
|
import { resolveShareConfig } from "../../share/share-config.js";
|
|
7
8
|
import { mergeWithDefaults } from "../../share/site-share-config.js";
|
|
8
9
|
import { getShareStore } from "../../share/share-store.js";
|
|
9
10
|
import { getSiteShareStore } from "../../share/site-share-store.js";
|
|
10
11
|
import { resolveShareUrl, resolveSiteShareUrl } from "../../share/share-url.js";
|
|
11
12
|
import { publishHostedStaticSite } from "../../share/hosted-static-site-publish.js";
|
|
12
|
-
import { resolveReverseProxyPublicUrl } from "../../gateway/public-url.js";
|
|
13
13
|
import { audienceDefaults, decideShareKind, makeDescription, makeTitle, probeShareTarget, rememberStagedSite, stageSingleHtmlAsSite } from "../../share/share-auto.js";
|
|
14
14
|
import { scheduleThumbnail } from "../../share/share-thumbnail.js";
|
|
15
15
|
import { resolveToolLocale, shareToolErrorLine, shareToolSuccessLines } from "../../i18n/share-tool-bundle.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { renderDataBatch } from "../data-acquisition/render.js";
|
|
3
4
|
import { DataBatchSchema } from "../data-acquisition/schema.js";
|
|
4
5
|
import { acquireData } from "../data-acquisition/service.js";
|
|
5
|
-
import { renderDataBatch } from "../data-acquisition/render.js";
|
|
6
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
7
|
//#region src/agent/tools/dataBatch.ts
|
|
8
8
|
init_logger();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { init_research_checkpoint, researchResumeContext } from "../orchestration/research-checkpoint.js";
|
|
2
2
|
import { claimResearchCheckpoint, createResearchCheckpoint, finishResearchCheckpoint, getResearchCheckpoint, init_research_checkpoint_repository, recordResearchEvidence, recordResearchSearch, saveResearchCheckpoint } from "../../storage/sqlite/research-checkpoint-repository.js";
|
|
3
3
|
import { resolveAgentAbortReason } from "../orchestration/run-termination.js";
|
|
4
|
+
import { runGit } from "../../execution-environments/git.js";
|
|
5
|
+
import { LocalWorktreeManager } from "../../execution-environments/local-worktree-manager.js";
|
|
6
|
+
import { SessionEnvironmentService } from "../../execution-environments/session-environment-service.js";
|
|
4
7
|
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
5
8
|
import { EXTERNAL_TOOL_NAMES } from "../external-tools/gateway-tools.js";
|
|
6
9
|
import "../external-tools/index.js";
|
|
7
10
|
import { getDelegationScope } from "../orchestration/delegation-scope.js";
|
|
8
11
|
import { DELEGATION_BUDGETS } from "../orchestration/delegation-budget.js";
|
|
9
12
|
import { createDelegateChildHandle } from "../child-agent-factory.js";
|
|
10
|
-
import { runGit } from "../../execution-environments/git.js";
|
|
11
|
-
import { LocalWorktreeManager } from "../../execution-environments/local-worktree-manager.js";
|
|
12
|
-
import { SessionEnvironmentService } from "../../execution-environments/session-environment-service.js";
|
|
13
13
|
import { DELEGATION_CAPABILITIES, DELEGATION_TOOL_CAPABILITIES, protectDelegatedTool, resolveDelegationTools } from "./delegation-policy.js";
|
|
14
14
|
import { resolve } from "node:path";
|
|
15
15
|
import { Type } from "@sinclair/typebox";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { runProcess } from "../../process/run-process.js";
|
|
1
2
|
import { commandRegistry, commandTimeout } from "../commands/command-registry.js";
|
|
2
3
|
import { evaluateExecPolicy } from "../sandbox/exec-policy.js";
|
|
3
4
|
import { formatSize, truncateTail } from "./truncate.js";
|
|
@@ -58,6 +59,7 @@ function createExecCommandTool(workspaceCwd, options) {
|
|
|
58
59
|
"Unix and Docker use /bin/sh, not your interactive shell. Do not use Bash process substitution <(...) or other Bash-only syntax unless invoking an installed bash explicitly. Prefer separate portable commands or a script file. Windows hosts use cmd.exe.",
|
|
59
60
|
"Use apply_patch for file edits; do not edit files by shell redirection unless explicitly necessary.",
|
|
60
61
|
"Relative cwd values resolve under the current agent workspace.",
|
|
62
|
+
"Use a fresh output directory with mkdir -p. Avoid destructive cleanup such as rm -rf on variable paths; blocked cleanup should be removed, never disguised or moved to bypass policy. A syntax preflight on Unix host commands prevents partial writes from malformed shell syntax.",
|
|
61
63
|
"When the command creates final user-facing files, declare all final paths in outputs so they are persisted with this command."
|
|
62
64
|
].join(" "),
|
|
63
65
|
parameters: ExecCommandSchema,
|
|
@@ -99,7 +101,7 @@ function createExecCommandTool(workspaceCwd, options) {
|
|
|
99
101
|
allowedEnvVars: options?.getSkillPassthroughEnvVarNames?.() ?? []
|
|
100
102
|
});
|
|
101
103
|
if (!policy.allowed) {
|
|
102
|
-
const text = `Sandbox blocked command: ${policy.reason}
|
|
104
|
+
const text = `Sandbox blocked command: ${policy.reason}\nNothing was executed. Remove destructive cleanup and use a fresh output directory with mkdir -p, or narrow the operation. Do not repeat unchanged or rephrase the blocked operation to bypass policy.`;
|
|
103
105
|
return {
|
|
104
106
|
content: [{
|
|
105
107
|
type: "text",
|
|
@@ -125,12 +127,55 @@ function createExecCommandTool(workspaceCwd, options) {
|
|
|
125
127
|
}
|
|
126
128
|
const timeoutMs = commandTimeout(params.timeoutMs, policy.timeoutMs);
|
|
127
129
|
const maxOutputChars = clampMaxOutputChars(params.maxOutputChars);
|
|
130
|
+
const isolation = options?.getCommandIsolation?.();
|
|
131
|
+
if (process.platform !== "win32" && isolation?.mode !== "docker") {
|
|
132
|
+
const started = performance.now();
|
|
133
|
+
const syntax = await runProcess({
|
|
134
|
+
program: "/bin/sh",
|
|
135
|
+
args: [
|
|
136
|
+
"-n",
|
|
137
|
+
"-c",
|
|
138
|
+
command
|
|
139
|
+
],
|
|
140
|
+
cwd: policy.effectiveCwd,
|
|
141
|
+
env: policy.sanitizedEnv,
|
|
142
|
+
timeoutMs: 5e3,
|
|
143
|
+
maxOutputBytes: 8e3,
|
|
144
|
+
signal,
|
|
145
|
+
terminationPolicy: "tree"
|
|
146
|
+
});
|
|
147
|
+
if (syntax.exitCode !== 0) {
|
|
148
|
+
const details = {
|
|
149
|
+
command,
|
|
150
|
+
cwd: policy.effectiveCwd,
|
|
151
|
+
status: syntax.timedOut ? "timed_out" : "failed",
|
|
152
|
+
exitCode: syntax.exitCode,
|
|
153
|
+
durationMs: performance.now() - started,
|
|
154
|
+
timedOut: syntax.timedOut,
|
|
155
|
+
truncated: false,
|
|
156
|
+
outputBytes: Buffer.byteLength(syntax.stderr),
|
|
157
|
+
totalOutputBytes: Buffer.byteLength(syntax.stderr),
|
|
158
|
+
captureTruncated: syntax.outputTruncated,
|
|
159
|
+
stdout: "",
|
|
160
|
+
stderr: syntax.stderr,
|
|
161
|
+
aggregatedOutput: syntax.stderr,
|
|
162
|
+
failureHint: "Shell syntax preflight failed; nothing was executed. Use portable POSIX sh syntax (for example diff file1 file2), or explicitly invoke an installed bash for Bash syntax. Fix the command; no side effects need replaying."
|
|
163
|
+
};
|
|
164
|
+
return {
|
|
165
|
+
content: [{
|
|
166
|
+
type: "text",
|
|
167
|
+
text: formatOutputForModel(details, maxOutputChars).text
|
|
168
|
+
}],
|
|
169
|
+
details
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
}
|
|
128
173
|
const runtimeEnv = options?.prepareEnv ? await options.prepareEnv(policy.sanitizedEnv, policy.effectiveCwd) : policy.sanitizedEnv;
|
|
129
174
|
const owner = options?.getConversationId?.() ?? workspaceCwd;
|
|
130
175
|
const registry = commandRegistry();
|
|
131
176
|
let commandResult = await registry.start({
|
|
132
177
|
workspace: workspaceCwd,
|
|
133
|
-
isolation
|
|
178
|
+
isolation,
|
|
134
179
|
owner,
|
|
135
180
|
command,
|
|
136
181
|
cwd: policy.effectiveCwd,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { withRetry } from "../../infra/retry.js";
|
|
3
4
|
import { commandTimeout } from "../commands/command-registry.js";
|
|
4
5
|
import { DEFAULT_TOOL_EXECUTION_TIMEOUT_MS, TimeoutError, executeWithTimeout } from "../lifecycle/timeout-wrapper.js";
|
|
5
|
-
import { withRetry } from "../../infra/retry.js";
|
|
6
6
|
import { ToolConcurrencyController, resolveToolLockMode } from "./concurrency.js";
|
|
7
7
|
//#region src/agent/tools/executor.ts
|
|
8
8
|
init_logger();
|
|
@@ -9,22 +9,33 @@ import { patchSessionMetadata } from "../../storage/sqlite/session-repository.js
|
|
|
9
9
|
import { getSessionTaskPlan, setSessionTaskPlan } from "../../storage/sqlite/session-task-plan-repository.js";
|
|
10
10
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
11
11
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
12
|
-
import {
|
|
12
|
+
import { buildRuntimeEnvironment } from "../../runtime-tools/environment.js";
|
|
13
|
+
import { skillEnvironmentId } from "../skills/installer.js";
|
|
13
14
|
import { resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession } from "../../config/agent-profile.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { PERSONAL_TOOL_DESCRIPTIONS } from "../../personal-agent/policy.js";
|
|
18
|
-
import { PERSONAL_REQUEST_TOOL_IDS, filterExecutionTools, resolveExecutionToolPolicy } from "../embedded/execution-tool-policy.js";
|
|
15
|
+
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
16
|
+
import { createWorkflowCatalog } from "../workflow/catalog.js";
|
|
17
|
+
import { BrowserRuntime } from "../../browser/runtime/browser-runtime.js";
|
|
19
18
|
import "../../../packages/browser-control-contract/src/index.js";
|
|
19
|
+
import { createBrowserDriver } from "../../browser/drivers/create-driver.js";
|
|
20
|
+
import { checkBrowserReadiness } from "../../browser/readiness.js";
|
|
21
|
+
import "../../browser/index.js";
|
|
20
22
|
import { getEmbeddedExecutionRunId, getEmbeddedExecutionSession } from "../embedded/execution-context.js";
|
|
23
|
+
import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
|
|
24
|
+
import { ComputerRuntime } from "../../computer/runtime.js";
|
|
21
25
|
import { wrapToolsWithProtection } from "./executor.js";
|
|
22
26
|
import { EXTERNAL_TOOL_NAMES } from "../external-tools/gateway-tools.js";
|
|
23
27
|
import { createDefaultExternalToolGatewayTools } from "../external-tools/index.js";
|
|
24
|
-
import {
|
|
28
|
+
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
29
|
+
import { getPendingTranscriptUserText } from "../inbound/attachment-pipeline.js";
|
|
25
30
|
import { createDataBatchTool } from "./dataBatch.js";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
31
|
+
import { markCodemodeCoreRead } from "./codemode-permissions.js";
|
|
32
|
+
import { PERSONAL_TOOL_DESCRIPTIONS } from "../../personal-agent/policy.js";
|
|
33
|
+
import { PERSONAL_REQUEST_TOOL_IDS, filterExecutionTools, resolveExecutionToolPolicy } from "../embedded/execution-tool-policy.js";
|
|
34
|
+
import { createDelegateTool } from "./delegate-tool.js";
|
|
35
|
+
import { createDelegationParentPolicy } from "./delegation-parent-policy.js";
|
|
36
|
+
import { LOCAL_READ_MAX_CHARS } from "./local-read-budget.js";
|
|
37
|
+
import { createPersonalAttentionTool } from "./personal-attention-tool.js";
|
|
38
|
+
import { createReadFileTool } from "./read.js";
|
|
28
39
|
import { createWriteFileTool } from "./write.js";
|
|
29
40
|
import { createListDirTool } from "./list-dir.js";
|
|
30
41
|
import { createPublishArtifactsTool } from "./publish-artifacts.js";
|
|
@@ -48,14 +59,7 @@ import { createUpdatePlanTool } from "./update-plan-tool.js";
|
|
|
48
59
|
import { createSessionStatusTool } from "./session-status-tool.js";
|
|
49
60
|
import { createMemoryMaintenanceTool } from "./memory-maintenance-tool.js";
|
|
50
61
|
import { createClarifyTool } from "./clarify-tool.js";
|
|
51
|
-
import { BrowserRuntime } from "../../browser/runtime/browser-runtime.js";
|
|
52
|
-
import { createBrowserDriver } from "../../browser/drivers/create-driver.js";
|
|
53
|
-
import { checkBrowserReadiness } from "../../browser/readiness.js";
|
|
54
|
-
import "../../browser/index.js";
|
|
55
|
-
import { getPendingTranscriptUserText } from "../inbound/attachment-pipeline.js";
|
|
56
|
-
import { createDelegateTool } from "./delegate-tool.js";
|
|
57
62
|
import { createWorkflowTool } from "./workflow-tool.js";
|
|
58
|
-
import { createWorkflowCatalog } from "../workflow/catalog.js";
|
|
59
63
|
import { createWorkflowManageTool } from "./workflow-manage-tool.js";
|
|
60
64
|
import { createAutomationTool } from "./automation-tool.js";
|
|
61
65
|
import { createBrowserAutomationTool } from "./browser-automation-tool.js";
|
|
@@ -72,17 +76,17 @@ import { createImageGenerateTool } from "./image-generate-tool.js";
|
|
|
72
76
|
import { createPersonalReadTool } from "./personal-read-tool.js";
|
|
73
77
|
import { createTaskCollaborationTool } from "./task-collaboration-tool.js";
|
|
74
78
|
import "./index.js";
|
|
79
|
+
import { createPersonalResultTool } from "./personal-result-tool.js";
|
|
75
80
|
import { createPersonalTaskTool } from "./personal-task-tool.js";
|
|
81
|
+
import { withTaskEvidenceIdentity } from "./task-evidence.js";
|
|
82
|
+
import { withPersonalPerformance } from "./personal-performance.js";
|
|
76
83
|
import { createPersonalRequestTools } from "./personal-request-tool.js";
|
|
77
84
|
import { createPersonalRequestConnectionTool, createPersonalRequestResultTool } from "./personal-request-result-tool.js";
|
|
78
85
|
import { createPersonalPreferenceTool } from "./personal-preference-tool.js";
|
|
79
86
|
import { createBrowserUseTool } from "./browser/tool/browser-use-tool.js";
|
|
80
|
-
import { ComputerRuntime } from "../../computer/runtime.js";
|
|
81
87
|
import { createComputerUseTool } from "./computer-use-tool.js";
|
|
82
88
|
import { createReviewWorkspaceTool } from "./review-workspace.js";
|
|
83
89
|
import { createLanguageDiagnosticsTool } from "./language-diagnostics.js";
|
|
84
|
-
import { createDelegationParentPolicy } from "./delegation-parent-policy.js";
|
|
85
|
-
import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
|
|
86
90
|
import { createTextToSpeechTool } from "./tts-tool.js";
|
|
87
91
|
import { getAgentCapabilityToolNames } from "../capabilities/registry.js";
|
|
88
92
|
import "../capabilities/index.js";
|
|
@@ -429,6 +433,11 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
429
433
|
createSendMediaTool(workspace, bus, deliveryContext),
|
|
430
434
|
createPublishArtifactsTool(workspace),
|
|
431
435
|
createTaskResultTool(currentConversationId),
|
|
436
|
+
createTaskCollaborationTool({
|
|
437
|
+
...productToolDeps,
|
|
438
|
+
getWorkspace: () => workspace,
|
|
439
|
+
getCurrentConversationId: currentConversationId
|
|
440
|
+
}),
|
|
432
441
|
createReadMediaTool(personalToolsConfigured ? {
|
|
433
442
|
textOnly: true,
|
|
434
443
|
maxChars: LOCAL_READ_MAX_CHARS,
|
|
@@ -532,6 +541,7 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
532
541
|
...this.deps.getAutomationService || this.deps.getSceneAccess || this.deps.getProjectService || this.deps.getNotesService || this.deps.getLocalAppService || this.deps.getChatPreviewService || this.deps.dispatchTaskEvents || this.deps.dispatchTaskRuns ? [createXopcUseTool(productToolDeps), ...personalToolsConfigured ? [
|
|
533
542
|
createPersonalTaskTool(productToolDeps),
|
|
534
543
|
createPersonalReadTool(productToolDeps),
|
|
544
|
+
createPersonalResultTool(currentConversationId),
|
|
535
545
|
...createPersonalRequestTools(productToolDeps),
|
|
536
546
|
createPersonalAttentionTool({
|
|
537
547
|
getConversationId: () => this.deps.getCurrentContext()?.conversationId,
|
|
@@ -616,14 +626,7 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
616
626
|
}
|
|
617
627
|
})] : [],
|
|
618
628
|
...optionalTools,
|
|
619
|
-
...personalExecution ? [
|
|
620
|
-
createPersonalRequestResultTool(currentConversationId),
|
|
621
|
-
createPersonalRequestConnectionTool(currentConversationId),
|
|
622
|
-
createTaskCollaborationTool({
|
|
623
|
-
...productToolDeps,
|
|
624
|
-
getCurrentConversationId: currentConversationId
|
|
625
|
-
})
|
|
626
|
-
] : []
|
|
629
|
+
...personalExecution ? [createPersonalRequestResultTool(currentConversationId), createPersonalRequestConnectionTool(currentConversationId)] : []
|
|
627
630
|
];
|
|
628
631
|
if ([
|
|
629
632
|
"read_file",
|
|
@@ -668,7 +671,11 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
668
671
|
return ["create_desktop_pet"];
|
|
669
672
|
}
|
|
670
673
|
createAllTools(coreOptions) {
|
|
671
|
-
|
|
674
|
+
const wrapped = wrapToolsWithProtection(this.createCoreTools(coreOptions), this.deps.toolExecutorConfig);
|
|
675
|
+
const executionId = coreOptions?.conversationId ?? getEmbeddedExecutionSession() ?? this.deps.getCurrentContext()?.conversationId;
|
|
676
|
+
const taskExecution = executionId && isXopcDatabaseOpen() && new TaskConversationRepository().resolveActiveExecutionSession(executionId);
|
|
677
|
+
const observed = wrapped.map((tool) => taskExecution || tool.name.startsWith("personal_") ? withPersonalPerformance(tool, executionId, taskExecution ? taskExecution.taskId : void 0, taskExecution ? taskExecution.runId : void 0, taskExecution ? taskExecution.assignmentEpoch : void 0) : tool);
|
|
678
|
+
return sortToolsForPromptCache(taskExecution ? observed.map((tool) => withTaskEvidenceIdentity(tool)) : observed);
|
|
672
679
|
}
|
|
673
680
|
};
|
|
674
681
|
function filterToolsByDisabledSet(tools, disabled) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { getAgentDefaultImageGenerationModelConfig, init_schema } from "../../config/schema.js";
|
|
2
|
-
import { readWorkspaceFile, writeWorkspaceFile } from "../sandbox/fileAccess.js";
|
|
3
2
|
import { imageAssetFromDataUrl, imageFileExtensionForMimeType, mimeTypeFromFileName, parseImageDataUrl, sniffImageMimeType } from "../image/generation/image-assets.js";
|
|
4
|
-
import {
|
|
3
|
+
import { getImageGenerationProvider } from "../image/generation/provider-registry.js";
|
|
5
4
|
import { buildCapabilityPlansForConfig } from "../../capabilities/readiness/from-config.js";
|
|
6
5
|
import "../../capabilities/readiness/index.js";
|
|
7
6
|
import { applyImageGenerationModelConfigDefaults } from "../image/image-helpers.js";
|
|
7
|
+
import { readWorkspaceFile, writeWorkspaceFile } from "../sandbox/fileAccess.js";
|
|
8
|
+
import { persistToolMedia } from "./tool-media.js";
|
|
8
9
|
import { isFailoverError } from "../failover-error.js";
|
|
9
|
-
import { getImageGenerationProvider } from "../image/generation/provider-registry.js";
|
|
10
10
|
import { generateImage, listImageGenerationProvidersSummary } from "../image/generation/runtime.js";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { randomBytes } from "node:crypto";
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { assertBrowserUrlAllowed } from "../../browser/url-policy.js";
|
|
2
|
+
import { BrowserRuntime } from "../../browser/runtime/browser-runtime.js";
|
|
3
|
+
import "../../browser/index.js";
|
|
1
4
|
import { DEFAULT_TOOL_METADATA, getToolMetadata } from "./metadata.js";
|
|
2
5
|
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";
|
|
3
9
|
import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, GREP_MAX_LINE_LENGTH, formatSize, truncateHead, truncateLine, truncateTail } from "./truncate.js";
|
|
4
10
|
import { createReadFileTool } from "./read.js";
|
|
5
|
-
import { createDataBatchTool } from "./dataBatch.js";
|
|
6
11
|
import { createWriteFileTool, writeFileTool } from "./write.js";
|
|
7
12
|
import { createListDirTool, listDirTool } from "./list-dir.js";
|
|
8
13
|
import { createPublishArtifactsTool } from "./publish-artifacts.js";
|
|
@@ -27,11 +32,6 @@ import { createUpdatePlanTool } from "./update-plan-tool.js";
|
|
|
27
32
|
import { createSessionStatusTool } from "./session-status-tool.js";
|
|
28
33
|
import { createMemoryMaintenanceTool } from "./memory-maintenance-tool.js";
|
|
29
34
|
import { createClarifyTool } from "./clarify-tool.js";
|
|
30
|
-
import { assertBrowserUrlAllowed } from "../../browser/url-policy.js";
|
|
31
|
-
import { BrowserRuntime } from "../../browser/runtime/browser-runtime.js";
|
|
32
|
-
import "../../browser/index.js";
|
|
33
|
-
import { resolveImageModelConfigForTool } from "../image/tool-model-config.js";
|
|
34
|
-
import { DEFAULT_DELEGATE_TOOLS, DELEGATE_BLOCKED_TOOLS, createDelegateTool } from "./delegate-tool.js";
|
|
35
35
|
import { createWorkflowTool } from "./workflow-tool.js";
|
|
36
36
|
import { createWorkflowManageTool } from "./workflow-manage-tool.js";
|
|
37
37
|
import { createAutomationTool } from "./automation-tool.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { checkedFilePath } from "../sandbox/fileAccess.js";
|
|
2
1
|
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
2
|
+
import { checkedFilePath } from "../sandbox/fileAccess.js";
|
|
3
3
|
import { readdir } from "fs/promises";
|
|
4
4
|
import { Type } from "@sinclair/typebox";
|
|
5
5
|
//#region src/agent/tools/list-dir.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
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 { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
4
3
|
import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
|
|
5
|
-
import {
|
|
4
|
+
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
6
5
|
import { parseLocalCheckTime } from "../../personal-agent/proactivity/follow-up-request.js";
|
|
7
6
|
import { applyThreadFeedback, getAttention, getProactivitySettings, listAttention, listInterestCandidates, patchAttention, patchProactivitySettings, rollbackStrategy, saveAttention, strategyState, userText } from "../../personal-agent/proactivity/repository.js";
|
|
7
|
+
import { boundedPersonalResult } from "./personal-result-budget.js";
|
|
8
8
|
import { Type } from "@sinclair/typebox";
|
|
9
9
|
//#region src/agent/tools/personal-attention-tool.ts
|
|
10
10
|
init_transaction();
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { recordPersonalPerformance } from "../../personal-agent/performance.js";
|
|
2
|
+
//#region src/agent/tools/personal-performance.ts
|
|
3
|
+
function withPersonalPerformance(tool, conversationId, taskId, runId, assignmentEpoch) {
|
|
4
|
+
return {
|
|
5
|
+
...tool,
|
|
6
|
+
execute: async (...args) => {
|
|
7
|
+
const started = performance.now();
|
|
8
|
+
const raw = args[1];
|
|
9
|
+
const command = typeof raw?.command === "string" && /^[a-z_]{1,32}$/.test(raw.command) ? raw.command : void 0;
|
|
10
|
+
const identity = {
|
|
11
|
+
conversationId,
|
|
12
|
+
taskId,
|
|
13
|
+
runId,
|
|
14
|
+
assignmentEpoch,
|
|
15
|
+
tool: tool.name,
|
|
16
|
+
toolCallId: args[0],
|
|
17
|
+
command
|
|
18
|
+
};
|
|
19
|
+
try {
|
|
20
|
+
const result = await tool.execute(args[0], args[1], args[2], args[3]);
|
|
21
|
+
const details = result.details;
|
|
22
|
+
let payload;
|
|
23
|
+
if (tool.name.startsWith("personal_")) {
|
|
24
|
+
const text = result.content.find((item) => item.type === "text");
|
|
25
|
+
if (text?.type === "text") try {
|
|
26
|
+
payload = JSON.parse(text.text);
|
|
27
|
+
} catch {}
|
|
28
|
+
}
|
|
29
|
+
const failed = result.isError || payload?.ok === false || [
|
|
30
|
+
"failed",
|
|
31
|
+
"blocked",
|
|
32
|
+
"error",
|
|
33
|
+
"invalid_reference",
|
|
34
|
+
"conflict",
|
|
35
|
+
"unavailable"
|
|
36
|
+
].includes(payload?.status ?? details?.status ?? "");
|
|
37
|
+
const status = failed ? "error" : [
|
|
38
|
+
"preparing",
|
|
39
|
+
"pending",
|
|
40
|
+
"running"
|
|
41
|
+
].includes(payload?.status ?? details?.status ?? "") ? "pending" : "success";
|
|
42
|
+
const durationMs = performance.now() - started;
|
|
43
|
+
const errorCode = failed ? details?.status === "blocked" ? "command_blocked" : details?.failureHint?.startsWith("Shell syntax preflight") ? "shell_syntax" : "tool_error" : void 0;
|
|
44
|
+
recordPersonalPerformance({
|
|
45
|
+
...identity,
|
|
46
|
+
phase: "tool",
|
|
47
|
+
durationMs,
|
|
48
|
+
status,
|
|
49
|
+
errorCode
|
|
50
|
+
});
|
|
51
|
+
if (tool.name === "personal_task" && ["submit", "revise"].includes(command ?? "")) recordPersonalPerformance({
|
|
52
|
+
...identity,
|
|
53
|
+
phase: "local_write",
|
|
54
|
+
durationMs,
|
|
55
|
+
status
|
|
56
|
+
});
|
|
57
|
+
if (tool.name === "personal_result" && ["read", "search"].includes(command ?? "") && status !== "pending") recordPersonalPerformance({
|
|
58
|
+
...identity,
|
|
59
|
+
phase: "hot_read",
|
|
60
|
+
durationMs,
|
|
61
|
+
status
|
|
62
|
+
});
|
|
63
|
+
return result;
|
|
64
|
+
} catch (error) {
|
|
65
|
+
let errorCode = "tool_error";
|
|
66
|
+
if (error instanceof Error) try {
|
|
67
|
+
if (JSON.parse(error.message).code === "source_quote_mismatch") errorCode = "source_quote_mismatch";
|
|
68
|
+
} catch {}
|
|
69
|
+
recordPersonalPerformance({
|
|
70
|
+
...identity,
|
|
71
|
+
phase: "tool",
|
|
72
|
+
durationMs: performance.now() - started,
|
|
73
|
+
status: args[2]?.aborted ? "cancelled" : "error",
|
|
74
|
+
errorCode
|
|
75
|
+
});
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { withPersonalPerformance };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
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
4
|
import { TaskCollaborationRepository } from "../../tasks/task-collaboration-repository.js";
|
|
6
5
|
import { selectionRequestHash } from "../../agent-matching/selection-repository.js";
|
|
7
6
|
import { PersonalRequestResultSchema } from "../../personal-agent/request-result.js";
|
|
7
|
+
import { assertPersonalRequestAccountAccess } from "../../personal-agent/request-access.js";
|
|
8
8
|
import { Type } from "@sinclair/typebox";
|
|
9
9
|
//#region src/agent/tools/personal-request-result-tool.ts
|
|
10
10
|
init_transaction();
|
|
@@ -5,13 +5,13 @@ import { getPersonalRequest, init_request_repository, listPersonalRequests, upda
|
|
|
5
5
|
import { getActiveConnectionWait, init_connection_wait_repository, reviseCurrentConnectionObjective, updateConnectionWait } from "../../storage/sqlite/connection-wait-repository.js";
|
|
6
6
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
7
7
|
import { init_session_repository } from "../../storage/sqlite/session-repository.js";
|
|
8
|
-
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
9
8
|
import { TaskAllocationRepository } from "../../tasks/task-allocation-repository.js";
|
|
10
|
-
import {
|
|
9
|
+
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
11
10
|
import { selectionRequestHash } from "../../agent-matching/selection-repository.js";
|
|
12
|
-
import { createPersonalTaskTool } from "./personal-task-tool.js";
|
|
13
11
|
import { personalCapabilities } from "../../personal-agent/capability-service.js";
|
|
14
12
|
import { assertPersonalRequestTimeRange, cancelPersonalRequest, personalRequestSnapshot, publishPersonalRequest, stopPersonalRequestExecution, submitPersonalRequest } from "../../personal-agent/request-service.js";
|
|
13
|
+
import { boundedPersonalResult } from "./personal-result-budget.js";
|
|
14
|
+
import { createPersonalTaskTool } from "./personal-task-tool.js";
|
|
15
15
|
import { Type } from "@sinclair/typebox";
|
|
16
16
|
//#region src/agent/tools/personal-request-tool.ts
|
|
17
17
|
init_session_input_repository();
|