@xopcai/xopc 0.0.308 → 0.0.311
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/_locales/en/messages.json +8 -0
- package/dist/browser-ext/_locales/zh_CN/messages.json +8 -0
- package/dist/browser-ext/dist/assets/{sidepanel-BbSQr-6P.css → sidepanel-DD6GEMvc.css} +16 -0
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +537 -96
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-wgSB2HYK.js → activity-store-DVUTs1fk.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-dUotwUO6.js → agent-avatar-dicebear-zKINl7UH.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D2ePZKdY.js +1 -0
- package/dist/gateway/static/root/assets/{agents-VPDIGRSS.js → agents-BiD9STyv.js} +1 -1
- package/dist/gateway/static/root/assets/{api-BKHmTb0w.js → api-_aHQA8bd.js} +1 -1
- package/dist/gateway/static/root/assets/{app-link-BiBXVEvp.js → app-link-wamYbNUl.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-zPz0rOND.js → app-management-settings-panel-C94LAxyt.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DhvhR43G.js → appearance-settings-CP01zHvC.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-B7DmSJQj.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BQVZMreT.js → archive-plugin-SwWFt5MT.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CPE-TMPf.js → attachment-load-DdTFml9l.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-C4IAy_zF.js → automations-page-Kmr5WVFp.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-bkijiu-Y.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DgTl7diZ.js → binary-plugins-47UTtDNq.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CcOVA-Gw.js → block-editor-DvzZkMG8.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-BzkJog8e.js → browser-automation-inputs-C611KRBx.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page--zKAgj1k.js → browser-automations-page-DrUKNL9X.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-Dhf_MWCf.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BCubrDf8.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-e4T1DEfN.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BfLd2rIJ.js → chat-terminal-dock-Bg_m7HUE.js} +2 -2
- package/dist/gateway/static/root/assets/{chunk-KS7C4IRE-Cq1tE_3b.js → chunk-KS7C4IRE-BMYIfy9x.js} +2 -2
- package/dist/gateway/static/root/assets/computer-settings-page-CosCmVsT.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-BlC1OXX4.js → connector-service-page-BL-hSR7_.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-C0WWxnxJ.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-DqYFVasF.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-CF_zYzxX.js → dependency-picker-DCyyFLKp.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CDwtLR7Z.js → desktop-pet-CFnnpRA_.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-U5wWRH4c.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-BhHxvFO1.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-CX5OXxEU.js → extension-debug-page-DA8WJ3-E.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BytR1PaY.js → extension-page-C2BIB88m.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CkaMJA5F.js → extension-settings-page-kpYo979N.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-B6wHa6ZI.js → gateway-config-swr-DUDX42qY.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-B53R0CA4.js → gateway-realtime-CGOW0-b4.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-D4um_sV7.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-CE9t1yTa.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DRzGnEV-.js → gateway-startup-retry-Cf8OxlvY.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-C7Ezx8Du.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-Ck_pyDom.js → image-generation-api-D2YorS--.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DrtbjL8O.js → imports-page-NPk698vI.js} +1 -1
- package/dist/gateway/static/root/assets/index-1wIKA-kM.css +1 -0
- package/dist/gateway/static/root/assets/index-DxYitLp8.js +79 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BlZh41Xq.js → keyboard-shortcuts-settings-BhreF0_O.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CPmynb3x.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DbP7wWuh.js → local-apps-page-DOZZBdqj.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-msTfRK8P.js → locale-store-DA0Z5jM_.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-C0n66FiO.js → logs-page-M8kz26yo.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-i6GhxpGV.js → management-settings-JLqHYQvY.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BInabSKf.js → markdown-view-BDpcjR_Z.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-DSjfHfaW.css +1 -0
- package/dist/gateway/static/root/assets/{media-plugins-CnWChQ3Y.js → media-plugins-B75SWUJd.js} +1 -1
- package/dist/gateway/static/root/assets/messages-4BtQKYlM.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-B_Ft0M32.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-C32mxSD-.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-BWitjb3e.js → page-tabs-CMlQUzT6.js} +1 -1
- package/dist/gateway/static/root/assets/{popover-select-9i-ZtHXL.js → popover-select-B-GDnZO9.js} +1 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-cZ2hszQT.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-gmi5LLwM.js → product-open-page-CPoSbglF.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DYttWua0.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-D46drWbl.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BSWtko7U.js → registry-api-C0DCx3wv.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C9n9Nuhi.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CtOjKGWg.js → runtime-tools-settings-panel-bMLWRApp.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-Dw3hmHAr.js +1 -0
- package/dist/gateway/static/root/assets/{schema-form-DkyyDcl2.js → schema-form-UVJV_7AS.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-C8P6ff91.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-whpUsAy3.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-C0JDGN_V.js → settings-form-section-BqzOqonM.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-DQ9RJ8-b.js +1 -0
- package/dist/gateway/static/root/assets/settings-page-layout-D3Spald3.js +1 -0
- package/dist/gateway/static/root/assets/{settings-shell-layer-context-DCp6ykjQ.js → settings-shell-layer-context-BTQUDoJ2.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-C8u601m8.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-Bt1K657Y.js → share-preview-page-BcgYzA7y.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Bv-2rZ8e.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-LM-cgWUS.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-ggmb7rCW.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-vq5Ujm03.js → skills-page.utils-ADABzrtk.js} +1 -1
- package/dist/gateway/static/root/assets/system-settings-panel-DfkcW_Za.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-DC4yqDFd.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-1SZ-HFHX.js → theme-store-CegIlB8d.js} +1 -1
- package/dist/gateway/static/root/assets/tunnel-api-CTuwTdMm.js +1 -0
- package/dist/gateway/static/root/assets/use-autosave-5ZDd9XKh.js +1 -0
- package/dist/gateway/static/root/assets/user-model-page-BFKFhdZ0.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-B2pZCcxY.js → voice-api-key-field-D3urfd-n.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DgJML_uM.js → voice-config-api-DTyMdGOR.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Bptv7bEY.js → work-discovery-overlay-JzM3Ylbs.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BijCrNc4.js → workflow-run-setup-panel-Bn2CtRdB.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BiCmt98A.js +6 -0
- package/dist/gateway/static/root/connector-icons/SOURCES.md +0 -2
- package/dist/gateway/static/root/index.html +17 -20
- package/dist/gateway/static/root/notification-sw.js +1 -1
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/notifications.js +12 -11
- package/dist/packages/gateway-contract/src/proactive.js +6 -6
- package/dist/packages/gateway-contract/src/project-monitoring.js +4 -4
- package/dist/packages/gateway-contract/src/project-operating.js +1 -4
- package/dist/packages/gateway-contract/src/sessions.js +6 -1
- package/dist/src/agent/agent-manager.d.ts +2 -6
- package/dist/src/agent/agent-manager.js +31 -5
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/child-agent-factory.d.ts +1 -0
- package/dist/src/agent/child-agent-factory.js +18 -4
- package/dist/src/agent/coding/repository-instructions.d.ts +4 -0
- package/dist/src/agent/coding/repository-instructions.js +46 -2
- package/dist/src/agent/commands/command-registry.js +1 -1
- package/dist/src/agent/context/execution-scope.js +1 -1
- package/dist/src/agent/data-acquisition/git.d.ts +17 -0
- package/dist/src/agent/data-acquisition/git.js +100 -0
- package/dist/src/agent/data-acquisition/render.d.ts +7 -0
- package/dist/src/agent/data-acquisition/render.js +79 -0
- package/dist/src/agent/data-acquisition/scheduler.d.ts +12 -0
- package/dist/src/agent/data-acquisition/scheduler.js +53 -0
- package/dist/src/agent/data-acquisition/schema.d.ts +75 -0
- package/dist/src/agent/data-acquisition/schema.js +206 -0
- package/dist/src/agent/data-acquisition/service.d.ts +10 -0
- package/dist/src/agent/data-acquisition/service.js +292 -0
- package/dist/src/agent/data-acquisition/types.d.ts +37 -0
- package/dist/src/agent/data-acquisition/types.js +5 -0
- package/dist/src/agent/embedded/run-turn.js +16 -4
- package/dist/src/agent/embedded/session-runner.d.ts +1 -0
- package/dist/src/agent/embedded/session-runner.js +3 -0
- package/dist/src/agent/embedded/tool-result-truncation.js +11 -0
- package/dist/src/agent/embedded/xopc-tools-bridge.js +2 -1
- package/dist/src/agent/external-tools/cliProvider.d.ts +47 -0
- package/dist/src/agent/external-tools/cliProvider.js +317 -0
- package/dist/src/agent/external-tools/composio-provider.js +15 -4
- package/dist/src/agent/external-tools/gateway-tools.js +10 -3
- package/dist/src/agent/external-tools/index.js +14 -1
- package/dist/src/agent/external-tools/read-policy.d.ts +6 -0
- package/dist/src/agent/external-tools/read-policy.js +21 -0
- package/dist/src/agent/external-tools/service.d.ts +1 -0
- package/dist/src/agent/external-tools/service.js +4 -1
- package/dist/src/agent/external-tools/types.d.ts +3 -1
- package/dist/src/agent/external-tools/types.js +1 -0
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
- package/dist/src/agent/memory/turn-provenance.js +2 -1
- package/dist/src/agent/orchestration/agent-turn-policy.js +25 -10
- package/dist/src/agent/orchestration/delegation-scope.d.ts +9 -0
- package/dist/src/agent/orchestration/delegation-scope.js +11 -0
- package/dist/src/agent/prompt/sections/tooling.js +3 -1
- package/dist/src/agent/prompt/subagent-context.js +4 -2
- package/dist/src/agent/sandbox/fileAccess.d.ts +2 -0
- package/dist/src/agent/sandbox/fileAccess.js +31 -2
- package/dist/src/agent/service/parse-outbound-session-key.js +1 -1
- package/dist/src/agent/service.js +1 -0
- package/dist/src/agent/service.types.d.ts +2 -0
- package/dist/src/agent/tools/dataBatch.d.ts +4 -0
- package/dist/src/agent/tools/dataBatch.js +50 -0
- package/dist/src/agent/tools/delegate-tool.d.ts +6 -3
- package/dist/src/agent/tools/delegate-tool.js +65 -48
- package/dist/src/agent/tools/delegation-parent-policy.d.ts +7 -0
- package/dist/src/agent/tools/delegation-parent-policy.js +41 -0
- package/dist/src/agent/tools/delegation-policy.d.ts +16 -0
- package/dist/src/agent/tools/delegation-policy.js +93 -0
- package/dist/src/agent/tools/factory.d.ts +4 -0
- package/dist/src/agent/tools/factory.js +45 -5
- package/dist/src/agent/tools/fetch-text.d.ts +7 -0
- package/dist/src/agent/tools/fetch-text.js +86 -0
- package/dist/src/agent/tools/find.js +1 -1
- package/dist/src/agent/tools/grep.js +11 -23
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/agent/tools/knowledge-memory-tool.js +10 -2
- package/dist/src/agent/tools/read.js +7 -5
- package/dist/src/agent/tools/repository-search.d.ts +12 -2
- package/dist/src/agent/tools/repository-search.js +127 -74
- package/dist/src/agent/tools/search/providers/xopc-cloud.d.ts +20 -0
- package/dist/src/agent/tools/search/providers/xopc-cloud.js +56 -0
- package/dist/src/agent/tools/search/registry.d.ts +4 -2
- package/dist/src/agent/tools/search/registry.js +5 -3
- package/dist/src/agent/tools/web.js +19 -28
- package/dist/src/agent/tools/xopc-use-tool.d.ts +4 -2
- package/dist/src/agent/tools/xopc-use-tool.js +46 -43
- package/dist/src/agent/workflow/subagent-runner.js +25 -3
- package/dist/src/agent/workflow/workflow-child-tools.js +13 -8
- package/dist/src/agent-config/schema.d.ts +7 -0
- package/dist/src/agent-config/schema.js +2 -0
- package/dist/src/automations/service/automation-service.d.ts +0 -4
- package/dist/src/automations/service/automation-service.js +0 -31
- package/dist/src/capabilities/store-connector.js +46 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/project.js +1 -1
- package/dist/src/config/schema.d.ts +8 -4
- package/dist/src/config/schema.js +2 -12
- package/dist/src/config/web-patch.js +0 -5
- package/dist/src/connectors/account-selection.d.ts +14 -0
- package/dist/src/connectors/account-selection.js +26 -0
- package/dist/src/connectors/china-catalog.js +93 -226
- package/dist/src/connectors/cli/adapterRegistry.d.ts +4 -0
- package/dist/src/connectors/cli/adapterRegistry.js +26 -0
- package/dist/src/connectors/cli/adapters/lark.d.ts +2 -0
- package/dist/src/connectors/cli/adapters/lark.js +143 -0
- package/dist/src/connectors/cli/adapters/larkShortcuts.d.ts +3 -0
- package/dist/src/connectors/cli/adapters/larkShortcuts.js +64 -0
- package/dist/src/connectors/cli/adapters/wecom.d.ts +2 -0
- package/dist/src/connectors/cli/adapters/wecom.js +97 -0
- package/dist/src/connectors/cli/adapters/wps365/bundle.js +575 -0
- package/dist/src/connectors/cli/adapters/wps365.d.ts +2 -0
- package/dist/src/connectors/cli/adapters/wps365.js +115 -0
- package/dist/src/connectors/cli/assets.d.ts +3 -0
- package/dist/src/connectors/cli/assets.js +44 -0
- package/dist/src/connectors/cli/authorization.d.ts +16 -0
- package/dist/src/connectors/cli/authorization.js +184 -0
- package/dist/src/connectors/cli/distributions.d.ts +4 -0
- package/dist/src/connectors/cli/distributions.js +69 -0
- package/dist/src/connectors/cli/installer.d.ts +5 -0
- package/dist/src/connectors/cli/installer.js +102 -0
- package/dist/src/connectors/cli/lifecycle.d.ts +1 -0
- package/dist/src/connectors/cli/lifecycle.js +19 -0
- package/dist/src/connectors/cli/process.d.ts +18 -0
- package/dist/src/connectors/cli/process.js +100 -0
- package/dist/src/connectors/cli/protocol.d.ts +10 -0
- package/dist/src/connectors/cli/protocol.js +63 -0
- package/dist/src/connectors/cli/runtime.d.ts +10 -0
- package/dist/src/connectors/cli/runtime.js +93 -0
- package/dist/src/connectors/cli/store.d.ts +35 -0
- package/dist/src/connectors/cli/store.js +121 -0
- package/dist/src/connectors/cli/types.d.ts +73 -0
- package/dist/src/connectors/composio-backends.js +1 -1
- package/dist/src/connectors/composio-sessions.d.ts +1 -0
- package/dist/src/connectors/composio-sessions.js +8 -3
- package/dist/src/connectors/composio.js +1 -1
- package/dist/src/connectors/connection-candidates.js +22 -3
- package/dist/src/connectors/connection-recovery-service.d.ts +1 -0
- package/dist/src/connectors/connection-recovery-service.js +53 -8
- package/dist/src/connectors/health.js +52 -0
- package/dist/src/connectors/instances.js +5 -1
- package/dist/src/connectors/lifecycle.js +2 -0
- package/dist/src/connectors/principal.js +2 -1
- package/dist/src/connectors/runtime-adapter-registry.js +31 -0
- package/dist/src/connectors/types.d.ts +13 -1
- package/dist/src/connectors/usage.js +1 -1
- package/dist/src/connectors/workflow-preflight.js +8 -4
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/hono/app.d.ts +2 -0
- package/dist/src/gateway/hono/app.js +4 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +2 -15
- package/dist/src/gateway/hono/lib/config-payload.js +0 -11
- package/dist/src/gateway/hono/routes/cli-connectors.d.ts +3 -0
- package/dist/src/gateway/hono/routes/cli-connectors.js +219 -0
- package/dist/src/gateway/hono/routes/config-patch/gateway.d.ts +2 -2
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +0 -59
- package/dist/src/gateway/hono/routes/config.js +0 -16
- package/dist/src/gateway/hono/routes/connectors.js +21 -22
- package/dist/src/gateway/hono/routes/deps.d.ts +2 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +4 -17
- package/dist/src/gateway/hono/routes/projects.js +1 -1
- package/dist/src/gateway/hono/routes/public-gateway.js +0 -1
- package/dist/src/gateway/hono/routes/scenes.d.ts +3 -0
- package/dist/src/gateway/hono/routes/scenes.js +142 -0
- package/dist/src/gateway/hono/routes/sessions.js +141 -13
- package/dist/src/gateway/hono/routes/tasks.js +0 -46
- package/dist/src/gateway/hono/routes/user-model.js +54 -1
- package/dist/src/gateway/scenes/browserNotifications.d.ts +4 -0
- package/dist/src/gateway/scenes/browserNotifications.js +54 -0
- package/dist/src/gateway/scenes/host.d.ts +34 -0
- package/dist/src/gateway/scenes/host.js +129 -0
- package/dist/src/gateway/scenes/mailContext.d.ts +32 -0
- package/dist/src/gateway/scenes/mailContext.js +235 -0
- package/dist/src/gateway/security/gateway-scopes.js +0 -4
- package/dist/src/gateway/security/index.js +1 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +1 -10
- package/dist/src/gateway/service/config-coordinator.js +0 -16
- package/dist/src/gateway/service/run-gateway-agent.js +1 -1
- package/dist/src/gateway/service.d.ts +4 -25
- package/dist/src/gateway/service.js +44 -99
- package/dist/src/gateway/session-context-summary.js +2 -1
- package/dist/src/infra/unhandled-rejections.js +1 -1
- package/dist/src/migrations/runner.js +1 -4
- package/dist/src/notifications/browser-endpoint.d.ts +2 -0
- package/dist/src/notifications/browser-endpoint.js +13 -0
- package/dist/src/notifications/browserSubscriptions.d.ts +20 -0
- package/dist/src/notifications/browserSubscriptions.js +59 -0
- package/dist/src/notifications/browserTransport.d.ts +9 -0
- package/dist/src/notifications/browserTransport.js +64 -0
- package/dist/src/notifications/dispatch.d.ts +46 -0
- package/dist/src/notifications/dispatch.js +109 -0
- package/dist/src/notifications/domain-delivery.d.ts +21 -0
- package/dist/src/notifications/planner.js +0 -36
- package/dist/src/notifications/quietHours.d.ts +6 -0
- package/dist/src/notifications/quietHours.js +23 -0
- package/dist/src/notifications/resultOutbox.d.ts +23 -0
- package/dist/src/notifications/resultOutbox.js +49 -0
- package/dist/src/notifications/service.d.ts +18 -4
- package/dist/src/notifications/service.js +42 -61
- package/dist/src/notifications/store.d.ts +2 -1
- package/dist/src/notifications/store.js +7 -8
- package/dist/src/projects/project-service.d.ts +1 -4
- package/dist/src/projects/project-service.js +2 -30
- package/dist/src/projects/workspace.js +1 -1
- package/dist/src/providers/model-catalog-persistence.js +19 -1
- package/dist/src/providers/model-catalog-store.js +1 -0
- package/dist/src/providers/model-catalog-types.d.ts +17 -0
- package/dist/src/providers/xopc-cloud-model-source.js +27 -0
- package/dist/src/scenes/agentExecutor.d.ts +8 -0
- package/dist/src/scenes/agentExecutor.js +63 -0
- package/dist/src/scenes/contracts.d.ts +118 -0
- package/dist/src/scenes/contracts.js +145 -0
- package/dist/src/scenes/execution.d.ts +56 -0
- package/dist/src/scenes/execution.js +168 -0
- package/dist/src/scenes/httpServices.d.ts +34 -0
- package/dist/src/scenes/inbox.d.ts +16 -0
- package/dist/src/scenes/inbox.js +68 -0
- package/dist/src/scenes/mailContext.d.ts +20 -0
- package/dist/src/scenes/mailContext.js +106 -0
- package/dist/src/scenes/mailObservations.d.ts +20 -0
- package/dist/src/scenes/mailObservations.js +107 -0
- package/dist/src/scenes/maintenance.d.ts +3 -0
- package/dist/src/scenes/maintenance.js +24 -0
- package/dist/src/scenes/metrics.d.ts +35 -0
- package/dist/src/scenes/metrics.js +94 -0
- package/dist/src/scenes/notificationEligibility.d.ts +17 -0
- package/dist/src/scenes/notificationEligibility.js +72 -0
- package/dist/src/scenes/notificationPublication.d.ts +7 -0
- package/dist/src/scenes/notificationPublication.js +43 -0
- package/dist/src/scenes/preferences.d.ts +40 -0
- package/dist/src/scenes/preferences.js +108 -0
- package/dist/src/scenes/readiness.d.ts +7 -0
- package/dist/src/scenes/readiness.js +20 -0
- package/dist/src/scenes/repository.d.ts +174 -0
- package/dist/src/scenes/repository.js +740 -0
- package/dist/src/scenes/resultNotifications.d.ts +17 -0
- package/dist/src/scenes/resultNotifications.js +204 -0
- package/dist/src/scenes/runtime.d.ts +25 -0
- package/dist/src/scenes/runtime.js +101 -0
- package/dist/src/scenes/schedule.d.ts +9 -0
- package/dist/src/scenes/schedule.js +45 -0
- package/dist/src/scenes/service.d.ts +29 -0
- package/dist/src/scenes/service.js +116 -0
- package/dist/src/scenes/templates.d.ts +64 -0
- package/dist/src/scenes/templates.js +76 -0
- package/dist/src/scenes/userNotes.d.ts +10 -0
- package/dist/src/scenes/userNotes.js +34 -0
- package/dist/src/session/resolve-session.js +2 -1
- package/dist/src/session/store.js +2 -1
- package/dist/src/share/share-config.js +0 -5
- package/dist/src/share/site-share-config.js +0 -5
- package/dist/src/storage/sqlite/connection-wait-repository.js +20 -7
- package/dist/src/storage/sqlite/connection.js +1 -1
- package/dist/src/storage/sqlite/connector-account-repository.js +1 -0
- package/dist/src/storage/sqlite/connector-sync-policy-repository.d.ts +0 -4
- package/dist/src/storage/sqlite/connector-sync-policy-repository.js +3 -17
- package/dist/src/storage/sqlite/conversation-repository.js +2 -1
- package/dist/src/storage/sqlite/index.d.ts +1 -0
- package/dist/src/storage/sqlite/index.js +4 -2
- package/dist/src/storage/sqlite/migrations/186_sidebar_layout.sql +16 -0
- package/dist/src/storage/sqlite/migrations/187_cli_connectors.sql +34 -0
- package/dist/src/storage/sqlite/migrations/188_scene_storage.sql +2 -0
- package/dist/src/storage/sqlite/migrations/189_scene_source_health.sql +8 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.d.ts +2 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.js +7 -3
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +20 -44
- package/dist/src/storage/sqlite/migrations/scene-reset.d.ts +5 -0
- package/dist/src/storage/sqlite/migrations/scene-reset.js +40 -0
- package/dist/src/storage/sqlite/scenes-schema.d.ts +8 -0
- package/dist/src/storage/sqlite/scenes-schema.js +61 -0
- package/dist/src/storage/sqlite/schema.js +4 -10
- package/dist/src/storage/sqlite/schemas/notifications.sql +65 -0
- package/dist/src/storage/sqlite/schemas/scenes.sql +212 -0
- package/dist/src/storage/sqlite/session-read-repository.d.ts +8 -0
- package/dist/src/storage/sqlite/session-read-repository.js +35 -0
- package/dist/src/storage/sqlite/session-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/session-repository.js +2 -25
- package/dist/src/storage/sqlite/sidebar-layout-repository.d.ts +12 -0
- package/dist/src/storage/sqlite/sidebar-layout-repository.js +53 -0
- package/dist/src/storage/sqlite/sql-assets.d.ts +2 -0
- package/dist/src/storage/sqlite/sql-assets.js +18 -0
- package/dist/src/storage/sqlite/transaction.d.ts +2 -0
- package/dist/src/storage/sqlite/transaction.js +20 -1
- package/dist/src/tasks/home-query-service.d.ts +0 -2
- package/dist/src/tasks/home-query-service.js +13 -43
- package/dist/src/tasks/index.d.ts +0 -1
- package/dist/src/tasks/index.js +4 -5
- package/dist/src/tasks/project-operating-view-service.js +1 -4
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/user-model/goals.d.ts +10 -0
- package/dist/src/user-model/goals.js +29 -1
- package/dist/src/user-model/index.js +2 -2
- package/dist/src/voice/realtime/memory-context.js +2 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +5 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-C6LflMXr.js +0 -1
- package/dist/gateway/static/root/assets/api-DFOlahZv.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Pmslbzzr.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-Fx5VUJRu.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DBms6d35.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-epdDWIZy.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-B0bsDtmP.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-B2JwuTjG.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-Ckgc0Py-.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-By33-bF1.js +0 -2
- package/dist/gateway/static/root/assets/cron-expression-CqNE-nf6.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-BS9ZjzYJ.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-C0djIc1J.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-CDKj9LQj.js +0 -1
- package/dist/gateway/static/root/assets/external-link-DjqjBmc3.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BLDgrJ30.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-_YU-1p0z.js +0 -1
- package/dist/gateway/static/root/assets/globe-DSSGFWFn.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-CVIvvm4x.js +0 -1
- package/dist/gateway/static/root/assets/home-page-COCHelcL.js +0 -1
- package/dist/gateway/static/root/assets/index-CDfcPiPb.js +0 -79
- package/dist/gateway/static/root/assets/index-CRu1p38D.css +0 -1
- package/dist/gateway/static/root/assets/loader-circle-CifKLtgG.js +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-D7_Raxjw.js +0 -2
- package/dist/gateway/static/root/assets/markdown-view-Y68dCxuc.css +0 -1
- package/dist/gateway/static/root/assets/messages-F74LVAiU.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-C59d8vDW.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-C1GBPrVI.js +0 -8
- package/dist/gateway/static/root/assets/preview-open-alternatives-UaCWCxZv.js +0 -1
- package/dist/gateway/static/root/assets/proactive-page-CtSFJxoM.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-ILTmQ1YN.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-snl4rOQZ.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BbaAcEN3.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-DrWL71O8.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BG0kl4HT.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-DiIyMQ52.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-layout-X1x-2Cp9.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-EPazhoZO.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-g2MdRXSZ.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-B1DPzu98.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-Wd0uYSPG.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-Cz1P-HDH.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-BG3A5gPZ.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-DQGoFuZO.js +0 -1
- package/dist/gateway/static/root/assets/use-autosave-DVDlBb95.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-qM5UiTGx.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-DRy1RAYH.js +0 -6
- package/dist/gateway/static/root/connector-icons/wps-calendar.svg +0 -14
- package/dist/gateway/static/root/connector-icons/wps-mail.svg +0 -7
- package/dist/src/connectors/source-change-publisher.d.ts +0 -17
- package/dist/src/connectors/source-change-publisher.js +0 -151
- package/dist/src/gateway/heartbeat/check-store.d.ts +0 -18
- package/dist/src/gateway/heartbeat/check-store.js +0 -74
- package/dist/src/gateway/heartbeat/index.d.ts +0 -1
- package/dist/src/gateway/heartbeat/index.js +0 -2
- package/dist/src/gateway/heartbeat/service.d.ts +0 -55
- package/dist/src/gateway/heartbeat/service.js +0 -228
- package/dist/src/gateway/hono/routes/proactive-control.d.ts +0 -3
- package/dist/src/gateway/hono/routes/proactive-control.js +0 -135
- package/dist/src/gateway/hono/routes/proactive.d.ts +0 -4
- package/dist/src/gateway/hono/routes/proactive.js +0 -164
- package/dist/src/gateway/hono/routes/workspace.d.ts +0 -3
- package/dist/src/gateway/hono/routes/workspace.js +0 -62
- package/dist/src/gateway/workspace-heartbeat-path.d.ts +0 -3
- package/dist/src/gateway/workspace-heartbeat-path.js +0 -14
- package/dist/src/migrations/conversation-routing-config.d.ts +0 -2
- package/dist/src/migrations/conversation-routing-config.js +0 -42
- package/dist/src/notifications/proactive-channel.d.ts +0 -8
- package/dist/src/notifications/proactive-channel.js +0 -60
- package/dist/src/notifications/proactive-policy.d.ts +0 -3
- package/dist/src/notifications/proactive-policy.js +0 -35
- package/dist/src/notifications/web-push.d.ts +0 -19
- package/dist/src/notifications/web-push.js +0 -185
- package/dist/src/proactive/actions/service.d.ts +0 -1
- package/dist/src/proactive/actions/service.js +0 -82
- package/dist/src/proactive/events/envelope.d.ts +0 -2
- package/dist/src/proactive/events/envelope.js +0 -54
- package/dist/src/proactive/events/product-event-bridge.d.ts +0 -7
- package/dist/src/proactive/events/product-event-bridge.js +0 -87
- package/dist/src/proactive/events/publisher.d.ts +0 -4
- package/dist/src/proactive/events/repository.d.ts +0 -9
- package/dist/src/proactive/events/repository.js +0 -63
- package/dist/src/proactive/events/types.d.ts +0 -44
- package/dist/src/proactive/events/types.js +0 -15
- package/dist/src/proactive/execution/agent-executor.d.ts +0 -21
- package/dist/src/proactive/execution/agent-executor.js +0 -125
- package/dist/src/proactive/execution/authorization.d.ts +0 -7
- package/dist/src/proactive/execution/authorization.js +0 -71
- package/dist/src/proactive/execution/context.d.ts +0 -49
- package/dist/src/proactive/execution/context.js +0 -408
- package/dist/src/proactive/execution/insight.d.ts +0 -14
- package/dist/src/proactive/execution/insight.js +0 -132
- package/dist/src/proactive/execution/repository.d.ts +0 -28
- package/dist/src/proactive/execution/repository.js +0 -211
- package/dist/src/proactive/execution/types.d.ts +0 -80
- package/dist/src/proactive/execution/worker.d.ts +0 -15
- package/dist/src/proactive/execution/worker.js +0 -146
- package/dist/src/proactive/experience.d.ts +0 -89
- package/dist/src/proactive/experience.js +0 -195
- package/dist/src/proactive/follow-ups.d.ts +0 -128
- package/dist/src/proactive/follow-ups.js +0 -182
- package/dist/src/proactive/inbox/cards.d.ts +0 -21
- package/dist/src/proactive/inbox/cards.js +0 -276
- package/dist/src/proactive/inbox/delivery.d.ts +0 -6
- package/dist/src/proactive/inbox/delivery.js +0 -54
- package/dist/src/proactive/inbox/digest.d.ts +0 -8
- package/dist/src/proactive/inbox/digest.js +0 -123
- package/dist/src/proactive/inbox/lifecycle.d.ts +0 -4
- package/dist/src/proactive/inbox/lifecycle.js +0 -62
- package/dist/src/proactive/inbox/notification-policy.d.ts +0 -1
- package/dist/src/proactive/inbox/notification-policy.js +0 -25
- package/dist/src/proactive/inbox/repository.d.ts +0 -25
- package/dist/src/proactive/inbox/repository.js +0 -244
- package/dist/src/proactive/inbox/service.d.ts +0 -23
- package/dist/src/proactive/inbox/service.js +0 -46
- package/dist/src/proactive/inbox/types.d.ts +0 -64
- package/dist/src/proactive/inbox/worker.d.ts +0 -13
- package/dist/src/proactive/inbox/worker.js +0 -71
- package/dist/src/proactive/index.d.ts +0 -20
- package/dist/src/proactive/index.js +0 -14
- package/dist/src/proactive/mail-thread.d.ts +0 -13
- package/dist/src/proactive/mail-thread.js +0 -55
- package/dist/src/proactive/maintenance.d.ts +0 -4
- package/dist/src/proactive/maintenance.js +0 -28
- package/dist/src/proactive/metrics.d.ts +0 -10
- package/dist/src/proactive/metrics.js +0 -28
- package/dist/src/proactive/policy/presence.d.ts +0 -2
- package/dist/src/proactive/policy/presence.js +0 -30
- package/dist/src/proactive/policy/service.d.ts +0 -54
- package/dist/src/proactive/policy/service.js +0 -123
- package/dist/src/proactive/routing/batch-repository.d.ts +0 -27
- package/dist/src/proactive/routing/batch-repository.js +0 -57
- package/dist/src/proactive/routing/matcher.d.ts +0 -5
- package/dist/src/proactive/routing/matcher.js +0 -57
- package/dist/src/proactive/routing/types.d.ts +0 -44
- package/dist/src/proactive/routing/types.js +0 -1
- package/dist/src/proactive/scenarios/control.d.ts +0 -52
- package/dist/src/proactive/scenarios/control.js +0 -75
- package/dist/src/proactive/scenarios/prompt-composer.d.ts +0 -14
- package/dist/src/proactive/scenarios/prompt-composer.js +0 -26
- package/dist/src/proactive/scenarios/repository.d.ts +0 -23
- package/dist/src/proactive/scenarios/repository.js +0 -174
- package/dist/src/proactive/scenarios/service.d.ts +0 -15
- package/dist/src/proactive/scenarios/service.js +0 -26
- package/dist/src/proactive/scenarios/types.d.ts +0 -43
- package/dist/src/proactive/scenarios/types.js +0 -1
- package/dist/src/proactive/service.d.ts +0 -25
- package/dist/src/proactive/service.js +0 -78
- package/dist/src/proactive/source-freshness.d.ts +0 -8
- package/dist/src/proactive/source-freshness.js +0 -28
- package/dist/src/proactive/status.d.ts +0 -2
- package/dist/src/proactive/status.js +0 -22
- package/dist/src/proactive/temporal/schedule.d.ts +0 -3
- package/dist/src/proactive/temporal/schedule.js +0 -68
- package/dist/src/proactive/temporal/worker.d.ts +0 -17
- package/dist/src/proactive/temporal/worker.js +0 -129
- package/dist/src/tasks/project-monitoring-service.d.ts +0 -32
- package/dist/src/tasks/project-monitoring-service.js +0 -118
- /package/dist/src/{proactive/execution → connectors/cli}/types.js +0 -0
- /package/dist/src/{proactive/events/publisher.js → notifications/domain-delivery.js} +0 -0
- /package/dist/src/{proactive/inbox/types.js → scenes/httpServices.js} +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
//#region src/agent/tools/delegation-policy.ts
|
|
2
|
+
const DELEGATION_CAPABILITIES = [
|
|
3
|
+
"local_read",
|
|
4
|
+
"web_read",
|
|
5
|
+
"knowledge_read",
|
|
6
|
+
"skills_read",
|
|
7
|
+
"external_read",
|
|
8
|
+
"local_write",
|
|
9
|
+
"command",
|
|
10
|
+
"browser"
|
|
11
|
+
];
|
|
12
|
+
/** Host-owned classifications. New tools fail closed until classified. */
|
|
13
|
+
const DELEGATION_TOOL_CAPABILITIES = {
|
|
14
|
+
read_file: "local_read",
|
|
15
|
+
grep: "local_read",
|
|
16
|
+
find: "local_read",
|
|
17
|
+
list_dir: "local_read",
|
|
18
|
+
review_workspace: "local_read",
|
|
19
|
+
read_media: "local_read",
|
|
20
|
+
image: "local_read",
|
|
21
|
+
tool_manual: "local_read",
|
|
22
|
+
web_search: "web_read",
|
|
23
|
+
web_fetch: "web_read",
|
|
24
|
+
web_extract: "web_read",
|
|
25
|
+
knowledge_search: "knowledge_read",
|
|
26
|
+
knowledge_get: "knowledge_read",
|
|
27
|
+
session_search: "knowledge_read",
|
|
28
|
+
session_recall: "knowledge_read",
|
|
29
|
+
user_context_search: "knowledge_read",
|
|
30
|
+
user_context_get: "knowledge_read",
|
|
31
|
+
skills_list: "skills_read",
|
|
32
|
+
skill_view: "skills_read",
|
|
33
|
+
skills_marketplace_search: "skills_read",
|
|
34
|
+
xopc_tool_search: "external_read",
|
|
35
|
+
xopc_tool_describe: "external_read",
|
|
36
|
+
xopc_tool_execute: "external_read",
|
|
37
|
+
write_file: "local_write",
|
|
38
|
+
apply_patch: "local_write",
|
|
39
|
+
exec_command: "command",
|
|
40
|
+
language_diagnostics: "command",
|
|
41
|
+
browser_use: "browser"
|
|
42
|
+
};
|
|
43
|
+
const RESEARCH = [
|
|
44
|
+
"local_read",
|
|
45
|
+
"web_read",
|
|
46
|
+
"knowledge_read",
|
|
47
|
+
"skills_read",
|
|
48
|
+
"external_read"
|
|
49
|
+
];
|
|
50
|
+
function delegationCapabilities(mode, requested) {
|
|
51
|
+
const ceiling = mode === "implement" ? [
|
|
52
|
+
...RESEARCH,
|
|
53
|
+
"local_write",
|
|
54
|
+
"command",
|
|
55
|
+
"browser"
|
|
56
|
+
] : mode === "custom" ? [...RESEARCH, "browser"] : mode === "research" ? RESEARCH : ["local_read"];
|
|
57
|
+
const defaults = mode === "implement" ? ceiling.filter((capability) => capability !== "browser") : mode === "custom" ? [] : ceiling;
|
|
58
|
+
return new Set((requested ?? defaults).filter((capability) => ceiling.includes(capability)));
|
|
59
|
+
}
|
|
60
|
+
function resolveDelegationTools(parentNames, mode, requested, capabilities) {
|
|
61
|
+
const parent = new Set(parentNames);
|
|
62
|
+
const allowed = delegationCapabilities(mode, capabilities);
|
|
63
|
+
const granted = [];
|
|
64
|
+
const rejected = [];
|
|
65
|
+
for (const tool of new Set((requested ?? parentNames).map((name) => name.trim()).filter(Boolean))) {
|
|
66
|
+
const capability = DELEGATION_TOOL_CAPABILITIES[tool];
|
|
67
|
+
const reason = !parent.has(tool) ? "Unavailable to the parent agent" : !capability ? "Tool has no delegable capability" : !allowed.has(capability) ? `Capability ${capability} is outside this delegation` : void 0;
|
|
68
|
+
if (reason) {
|
|
69
|
+
if (requested) rejected.push({
|
|
70
|
+
tool,
|
|
71
|
+
reason
|
|
72
|
+
});
|
|
73
|
+
} else granted.push(tool);
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
granted,
|
|
77
|
+
rejected
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** Always enforce the external read contract, even when the child explicitly sends readOnly:false. */
|
|
81
|
+
function protectDelegatedTool(tool) {
|
|
82
|
+
if (tool.name !== "xopc_tool_execute") return tool;
|
|
83
|
+
return {
|
|
84
|
+
...tool,
|
|
85
|
+
execute: (id, args, signal, onUpdate) => tool.execute(id, {
|
|
86
|
+
...args,
|
|
87
|
+
readOnly: true,
|
|
88
|
+
approvalId: void 0
|
|
89
|
+
}, signal, onUpdate)
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
export { DELEGATION_CAPABILITIES, DELEGATION_TOOL_CAPABILITIES, delegationCapabilities, protectDelegatedTool, resolveDelegationTools };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SceneAccess } from '../../scenes/httpServices.js';
|
|
1
2
|
/**
|
|
2
3
|
* Agent Tools Factory - Creates and configures agent tools
|
|
3
4
|
*
|
|
@@ -54,6 +55,7 @@ export interface ToolFactoryDeps {
|
|
|
54
55
|
};
|
|
55
56
|
/** Gateway: enables the `automation` tool. */
|
|
56
57
|
getAutomationService?: () => AutomationService | undefined;
|
|
58
|
+
getSceneAccess?: () => SceneAccess | undefined;
|
|
57
59
|
getBrowserAutomationService?: () => BrowserAutomationService | undefined;
|
|
58
60
|
emitBrowserEvent?: (type: string, payload: unknown) => void;
|
|
59
61
|
/** Gateway: enables the `xopc_use` product-object tool. */
|
|
@@ -83,6 +85,8 @@ export interface ToolFactoryDeps {
|
|
|
83
85
|
installSkillFromMarketplace?: (opts: MarketplaceSkillInstallToolOptions) => Promise<MarketplaceSkillInstallToolResult>;
|
|
84
86
|
}
|
|
85
87
|
export interface CreateCoreToolsOptions {
|
|
88
|
+
getParentTools?: () => AgentTool<any, any>[];
|
|
89
|
+
createDelegationPolicy?: () => import('../orchestration/agent-turn-policy.js').AgentTurnPolicy;
|
|
86
90
|
/** Workspace root for file/command tools (defaults to factory workspace). */
|
|
87
91
|
workspace?: string;
|
|
88
92
|
/** Canonical `agents/<id>/profile/`: bare SOUL.md / IDENTITY.md resolve here after the workspace. */
|
|
@@ -3,7 +3,7 @@ import { createLogger } from "../../utils/logger/index.js";
|
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
4
|
import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
|
|
5
5
|
import { getBrowserTabBinding } from "../../storage/sqlite/browser-tab-binding-repository.js";
|
|
6
|
-
import { getSessionMetadata } from "../../storage/sqlite/session-repository.js";
|
|
6
|
+
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
7
7
|
import { getSessionTaskPlan, setSessionTaskPlan } from "../../storage/sqlite/session-task-plan-repository.js";
|
|
8
8
|
import "../../storage/sqlite/index.js";
|
|
9
9
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
@@ -15,6 +15,7 @@ import { EXTERNAL_TOOL_NAMES } from "../external-tools/gateway-tools.js";
|
|
|
15
15
|
import { buildRuntimeEnvironment } from "../../runtime-tools/environment.js";
|
|
16
16
|
import { createDefaultExternalToolGatewayTools } from "../external-tools/index.js";
|
|
17
17
|
import { createReadFileTool } from "./read.js";
|
|
18
|
+
import { createDataBatchTool } from "./dataBatch.js";
|
|
18
19
|
import { skillEnvironmentId } from "../skills/installer.js";
|
|
19
20
|
import { createWriteFileTool } from "./write.js";
|
|
20
21
|
import { createListDirTool } from "./list-dir.js";
|
|
@@ -64,6 +65,7 @@ import { ComputerRuntime } from "../../computer/runtime.js";
|
|
|
64
65
|
import { createComputerUseTool } from "./computer-use-tool.js";
|
|
65
66
|
import { createReviewWorkspaceTool } from "./review-workspace.js";
|
|
66
67
|
import { createLanguageDiagnosticsTool } from "./language-diagnostics.js";
|
|
68
|
+
import { createDelegationParentPolicy } from "./delegation-parent-policy.js";
|
|
67
69
|
import { createWorkflowCatalog } from "../workflow/catalog.js";
|
|
68
70
|
import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
|
|
69
71
|
import { createTextToSpeechTool } from "./tts-tool.js";
|
|
@@ -256,7 +258,7 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
256
258
|
const listDir = createListDirTool(workspace);
|
|
257
259
|
const grep = createGrepTool(workspace);
|
|
258
260
|
const find = createFindTool(workspace);
|
|
259
|
-
|
|
261
|
+
const core = [
|
|
260
262
|
createSessionStatusTool(),
|
|
261
263
|
createMemoryMaintenanceTool({ getConfig: () => this.deps.getConfig?.() }),
|
|
262
264
|
createToolManualTool(),
|
|
@@ -423,12 +425,13 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
423
425
|
})] : [],
|
|
424
426
|
...this.deps.getAutomationService ? [createAutomationTool({ getAutomationService: this.deps.getAutomationService })] : [],
|
|
425
427
|
...browserEnabled && this.deps.getBrowserAutomationService ? [createBrowserAutomationTool({ getBrowserAutomationService: this.deps.getBrowserAutomationService })] : [],
|
|
426
|
-
...this.deps.getAutomationService || this.deps.getProjectService || this.deps.getNotesService || this.deps.getLocalAppService || this.deps.dispatchTaskEvents || this.deps.dispatchTaskRuns ? [createXopcUseTool({
|
|
428
|
+
...this.deps.getAutomationService || this.deps.getSceneAccess || this.deps.getProjectService || this.deps.getNotesService || this.deps.getLocalAppService || this.deps.dispatchTaskEvents || this.deps.dispatchTaskRuns ? [createXopcUseTool({
|
|
427
429
|
getWorkspace: () => this.deps.workspace,
|
|
428
430
|
getConfig: () => this.deps.getConfig?.(),
|
|
429
431
|
getCurrentAgentId: () => options.agentId,
|
|
430
432
|
getCurrentConversationId: () => this.deps.getCurrentContext()?.conversationId,
|
|
431
433
|
getAutomationService: this.deps.getAutomationService,
|
|
434
|
+
getSceneAccess: this.deps.getSceneAccess,
|
|
432
435
|
getNotesService: this.deps.getNotesService,
|
|
433
436
|
getProjectService: this.deps.getProjectService,
|
|
434
437
|
getLocalAppService: this.deps.getLocalAppService,
|
|
@@ -461,6 +464,12 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
461
464
|
})] : [],
|
|
462
465
|
...primary ? [createDelegateTool({
|
|
463
466
|
workspace,
|
|
467
|
+
getParentTools: () => options?.getParentTools?.() ?? filterToolsByDisabledSet(core, disabled),
|
|
468
|
+
createParentPolicy: options?.createDelegationPolicy ?? (() => createDelegationParentPolicy({
|
|
469
|
+
getConfig: () => this.deps.getConfig?.(),
|
|
470
|
+
conversationId: currentConversationId(),
|
|
471
|
+
agentId: resolvedAgentId
|
|
472
|
+
})),
|
|
464
473
|
getSubagentModel: () => {
|
|
465
474
|
const m = (options?.getPrimaryModel ?? this.deps.getPrimaryModel)?.();
|
|
466
475
|
if (!m) throw new Error("No primary model configured for delegate_task");
|
|
@@ -468,7 +477,14 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
468
477
|
},
|
|
469
478
|
bus: this.deps.bus,
|
|
470
479
|
getConfig: () => this.deps.getConfig?.(),
|
|
471
|
-
getCurrentContext: () =>
|
|
480
|
+
getCurrentContext: () => {
|
|
481
|
+
const context = this.deps.getCurrentContext?.();
|
|
482
|
+
const conversationId = currentConversationId();
|
|
483
|
+
return conversationId ? {
|
|
484
|
+
...context,
|
|
485
|
+
conversationId
|
|
486
|
+
} : context ?? null;
|
|
487
|
+
},
|
|
472
488
|
toolExecutorConfig: this.deps.toolExecutorConfig,
|
|
473
489
|
buildChildTools: (childOpts) => {
|
|
474
490
|
return new AgentToolsFactory({
|
|
@@ -485,6 +501,7 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
485
501
|
agentId: options?.agentId ?? childOpts.agentId,
|
|
486
502
|
conversationId: childOpts.browserConversationId,
|
|
487
503
|
disabledTools: new Set([
|
|
504
|
+
...disabled ?? [],
|
|
488
505
|
EXTERNAL_TOOL_NAMES.search,
|
|
489
506
|
EXTERNAL_TOOL_NAMES.describe,
|
|
490
507
|
EXTERNAL_TOOL_NAMES.execute,
|
|
@@ -495,7 +512,30 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
495
512
|
}
|
|
496
513
|
})] : [],
|
|
497
514
|
...optionalTools
|
|
498
|
-
]
|
|
515
|
+
];
|
|
516
|
+
if ([
|
|
517
|
+
"read_file",
|
|
518
|
+
"grep",
|
|
519
|
+
"exec_command",
|
|
520
|
+
"knowledge_search",
|
|
521
|
+
"knowledge_get",
|
|
522
|
+
"web_search",
|
|
523
|
+
"web_fetch",
|
|
524
|
+
"xopc_tool_execute"
|
|
525
|
+
].some((name) => !disabled?.has(name))) {
|
|
526
|
+
const dataTools = () => {
|
|
527
|
+
const config = this.deps.getConfig?.();
|
|
528
|
+
const policies = config ? (currentConversationId() ? resolveEffectiveAgentConfigForSession(config, currentConversationId()) : resolveEffectiveAgentConfigForAgent(config, resolvedAgentId)).config.tools : void 0;
|
|
529
|
+
if (policies?.data_batch?.mode === "deny") return [];
|
|
530
|
+
return filterToolsByDisabledSet(core, disabled).filter((tool) => policies?.[tool.name]?.mode !== "deny");
|
|
531
|
+
};
|
|
532
|
+
core.push(createDataBatchTool(workspace, () => new Set(dataTools().map((tool) => tool.name)), {
|
|
533
|
+
getTools: dataTools,
|
|
534
|
+
canExecute: (name) => dataTools().some((tool) => tool.name === name),
|
|
535
|
+
allowHostGit: () => getCommandIsolation()?.mode !== "docker"
|
|
536
|
+
}));
|
|
537
|
+
}
|
|
538
|
+
return filterToolsByDisabledSet(core, disabled);
|
|
499
539
|
}
|
|
500
540
|
createCapabilityTools(capabilityNames, options) {
|
|
501
541
|
const disabled = options?.disabledTools;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type WebsiteBlocklistConfig } from './url-safety.js';
|
|
2
|
+
/** Validate each redirect and the address actually used for the connection. */
|
|
3
|
+
export declare function fetchPublicText(input: string, blocklist: WebsiteBlocklistConfig | undefined, signal?: AbortSignal): Promise<{
|
|
4
|
+
text: string;
|
|
5
|
+
contentType: string;
|
|
6
|
+
url: string;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { checkUrlSafety, checkWebsiteBlocklist } from "./url-safety.js";
|
|
2
|
+
import { Agent, fetch } from "undici";
|
|
3
|
+
import { lookup } from "node:dns";
|
|
4
|
+
//#region src/agent/tools/fetch-text.ts
|
|
5
|
+
/** Validate each redirect and the address actually used for the connection. */
|
|
6
|
+
async function fetchPublicText(input, blocklist, signal) {
|
|
7
|
+
const deadline = AbortSignal.any([...signal ? [signal] : [], AbortSignal.timeout(25e3)]);
|
|
8
|
+
const dispatcher = new Agent({ connect: { lookup(hostname, options, callback) {
|
|
9
|
+
lookup(hostname, { all: true }, (error, addresses) => {
|
|
10
|
+
if (error) {
|
|
11
|
+
callback(error, "", 4);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (!addresses.length || addresses.some((item) => !checkUrlSafety(`http://${item.family === 6 ? `[${item.address}]` : item.address}`).safe)) {
|
|
15
|
+
callback(/* @__PURE__ */ new Error("DNS resolved to a non-public address"), "", 4);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (options.all) callback(null, addresses);
|
|
19
|
+
else callback(null, addresses[0].address, addresses[0].family);
|
|
20
|
+
});
|
|
21
|
+
} } });
|
|
22
|
+
try {
|
|
23
|
+
let url = input;
|
|
24
|
+
for (let redirects = 0; redirects <= 5; redirects++) {
|
|
25
|
+
deadline.throwIfAborted();
|
|
26
|
+
const safety = checkUrlSafety(url);
|
|
27
|
+
if (!safety.safe) throw new Error(`Blocked: ${safety.reason}`);
|
|
28
|
+
const blocked = checkWebsiteBlocklist(url, blocklist);
|
|
29
|
+
if (blocked) throw new Error(`Blocked: ${blocked.message}`);
|
|
30
|
+
const response = await fetch(url, {
|
|
31
|
+
signal: deadline,
|
|
32
|
+
redirect: "manual",
|
|
33
|
+
dispatcher
|
|
34
|
+
});
|
|
35
|
+
if ([
|
|
36
|
+
301,
|
|
37
|
+
302,
|
|
38
|
+
303,
|
|
39
|
+
307,
|
|
40
|
+
308
|
|
41
|
+
].includes(response.status)) {
|
|
42
|
+
await response.body?.cancel();
|
|
43
|
+
const location = response.headers.get("location");
|
|
44
|
+
if (!location) throw new Error("Redirect has no location");
|
|
45
|
+
url = new URL(location, url).href;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (!response.ok) {
|
|
49
|
+
await response.body?.cancel();
|
|
50
|
+
throw new Error(`HTTP ${response.status}`);
|
|
51
|
+
}
|
|
52
|
+
const reader = response.body?.getReader();
|
|
53
|
+
if (!reader) return {
|
|
54
|
+
text: "",
|
|
55
|
+
contentType: response.headers.get("content-type") ?? "",
|
|
56
|
+
url
|
|
57
|
+
};
|
|
58
|
+
const decoder = new TextDecoder();
|
|
59
|
+
let text = "", bytes = 0;
|
|
60
|
+
try {
|
|
61
|
+
for (;;) {
|
|
62
|
+
deadline.throwIfAborted();
|
|
63
|
+
const chunk = await reader.read();
|
|
64
|
+
if (chunk.done) break;
|
|
65
|
+
bytes += chunk.value.byteLength;
|
|
66
|
+
if (bytes > 6e6) throw new Error("Response too large");
|
|
67
|
+
text += decoder.decode(chunk.value, { stream: true });
|
|
68
|
+
}
|
|
69
|
+
text += decoder.decode();
|
|
70
|
+
} finally {
|
|
71
|
+
await reader.cancel().catch(() => {});
|
|
72
|
+
reader.releaseLock();
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
text,
|
|
76
|
+
contentType: response.headers.get("content-type") ?? "",
|
|
77
|
+
url
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
throw new Error("Too many redirects");
|
|
81
|
+
} finally {
|
|
82
|
+
await dispatcher.close();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { fetchPublicText };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
|
|
2
|
-
import { resolveToCwd } from "../../utils/helpers.js";
|
|
3
2
|
import { isSearchFileAllowed, repositorySearch } from "./repository-search.js";
|
|
3
|
+
import { resolveToCwd } from "../../utils/helpers.js";
|
|
4
4
|
import { Type } from "@sinclair/typebox";
|
|
5
5
|
//#region src/agent/tools/find.ts
|
|
6
6
|
const findSchema = Type.Object({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
|
|
2
|
+
import { parseRepositoryMatch, repositorySearch } from "./repository-search.js";
|
|
2
3
|
import { resolveToCwd } from "../../utils/helpers.js";
|
|
3
|
-
import { isSearchFileAllowed, repositorySearch } from "./repository-search.js";
|
|
4
4
|
import { Type } from "@sinclair/typebox";
|
|
5
5
|
//#region src/agent/tools/grep.ts
|
|
6
6
|
const grepSchema = Type.Object({
|
|
@@ -36,7 +36,9 @@ function createGrepTool(cwd) {
|
|
|
36
36
|
if (!policy.allowed) throw new Error(policy.reason);
|
|
37
37
|
path = policy.canonicalPath;
|
|
38
38
|
const limit = Math.min(1e3, Math.max(1, params.limit ?? 100));
|
|
39
|
-
const
|
|
39
|
+
const lines = [];
|
|
40
|
+
const outputLimit = limit * (1 + 2 * (params.context ?? 0));
|
|
41
|
+
const truncated = (await repositorySearch(cwd, [
|
|
40
42
|
"--json",
|
|
41
43
|
"--line-number",
|
|
42
44
|
"--with-filename",
|
|
@@ -45,8 +47,6 @@ function createGrepTool(cwd) {
|
|
|
45
47
|
"--max-columns",
|
|
46
48
|
"300",
|
|
47
49
|
"--max-columns-preview",
|
|
48
|
-
"--max-count",
|
|
49
|
-
String(limit),
|
|
50
50
|
"--context",
|
|
51
51
|
String(params.context ?? 0),
|
|
52
52
|
...params.ignoreCase ? ["--ignore-case"] : [],
|
|
@@ -56,25 +56,13 @@ function createGrepTool(cwd) {
|
|
|
56
56
|
params.pattern,
|
|
57
57
|
"--",
|
|
58
58
|
path
|
|
59
|
-
], signal)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
} catch {
|
|
67
|
-
if (result.truncated) continue;
|
|
68
|
-
throw new Error("Invalid search output");
|
|
69
|
-
}
|
|
70
|
-
if (event.type !== "match" && event.type !== "context") continue;
|
|
71
|
-
const data = event.data;
|
|
72
|
-
if (!data?.path?.text || !data.lines?.text || !isSearchFileAllowed(cwd, data.path.text)) continue;
|
|
73
|
-
const separator = event.type === "match" ? ":" : "-";
|
|
74
|
-
lines.push(`${data.path.text}${separator}${data.line_number}${separator}${data.lines.text.replace(/\r?\n$/, "")}`);
|
|
75
|
-
}
|
|
76
|
-
const outputLimit = limit * (1 + 2 * (params.context ?? 0));
|
|
77
|
-
const truncated = result.truncated || lines.length > outputLimit;
|
|
59
|
+
], signal, { onLine: (row) => {
|
|
60
|
+
const match = parseRepositoryMatch(cwd, row);
|
|
61
|
+
if (!match) return;
|
|
62
|
+
const separator = match.match ? ":" : "-";
|
|
63
|
+
lines.push(`${match.path}${separator}${match.line}${separator}${match.text}`);
|
|
64
|
+
if (lines.length > outputLimit) return false;
|
|
65
|
+
} })).truncated || lines.length > outputLimit;
|
|
78
66
|
return {
|
|
79
67
|
content: [{
|
|
80
68
|
type: "text",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { getToolMetadata, DEFAULT_TOOL_METADATA, type AgentToolWithMetadata, type ToolMutationScope, type ToolVerificationKind, type XopcToolMetadata, } from './metadata.js';
|
|
2
2
|
export { ToolConcurrencyController, resolveToolLockMode, type ToolLockMode, } from './concurrency.js';
|
|
3
3
|
export { createReadFileTool, type CreateReadFileToolOptions } from './read.js';
|
|
4
|
+
export { createDataBatchTool } from './dataBatch.js';
|
|
4
5
|
export { createWriteFileTool, writeFileTool } from './write.js';
|
|
5
6
|
export { createListDirTool, listDirTool } from './list-dir.js';
|
|
6
7
|
export { createExecCommandTool, type ExecCommandDetails, type ExecCommandUpdateDetails, } from './exec-command.js';
|
|
@@ -2,6 +2,7 @@ import { DEFAULT_TOOL_METADATA, getToolMetadata } from "./metadata.js";
|
|
|
2
2
|
import { ToolConcurrencyController, resolveToolLockMode } from "./concurrency.js";
|
|
3
3
|
import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, GREP_MAX_LINE_LENGTH, formatSize, truncateHead, truncateLine, truncateTail } from "./truncate.js";
|
|
4
4
|
import { createReadFileTool } from "./read.js";
|
|
5
|
+
import { createDataBatchTool } from "./dataBatch.js";
|
|
5
6
|
import { createWriteFileTool, writeFileTool } from "./write.js";
|
|
6
7
|
import { createListDirTool, listDirTool } from "./list-dir.js";
|
|
7
8
|
import { createPublishArtifactsTool } from "./publish-artifacts.js";
|
|
@@ -43,4 +44,4 @@ import { createDesktopPetTool } from "./desktop-pet-tool.js";
|
|
|
43
44
|
import { createManagedJobTool } from "./managed-job-tool.js";
|
|
44
45
|
import { createImageTool } from "./image-tool.js";
|
|
45
46
|
import { createImageGenerateTool, resolveImageGenerationModelConfigForTool } from "./image-generate-tool.js";
|
|
46
|
-
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, createDelegateTool, createDesktopPetTool, createExecCommandTool, createFindTool, createGrepTool, createImageGenerateTool, createImageTool, createKnowledgeGetTool, createKnowledgeSearchTool, createKnowledgeWriteTool, createListDirTool, createManagedJobTool, createMemoryMaintenanceTool, createMessageTool, createPublishArtifactsTool, createReadFileTool, createReadMediaTool, createSendMediaTool, createSessionRecallTool, createSessionSearchTool, createSessionStatusTool, createSkillInstallTool, createSkillManageTool, createSkillViewTool, createSkillsListTool, createSkillsMarketplaceSearchTool, createTodoTool, createToolManualTool, createUpdatePlanTool, createUserContextGetTool, createUserContextSearchTool, createUserContextUpdateTool, createWebExtractTool, createWebFetchTool, createWebSearchTool, createWorkflowTool, createWriteFileTool, createXopcUseTool, findTool, formatSize, fuzzyFindText, generateDiffString, getToolMetadata, grepTool, isShareToolAvailable, listDirTool, normalizeForFuzzyMatch, normalizeToLF, resolveImageGenerationModelConfigForTool, resolveImageModelConfigForTool, resolveToolLockMode, restoreLineEndings, stripBom, stripHtmlBoilerplate, truncateHead, truncateLine, truncateTail, writeFileTool };
|
|
47
|
+
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, createKnowledgeSearchTool, createKnowledgeWriteTool, createListDirTool, createManagedJobTool, createMemoryMaintenanceTool, createMessageTool, createPublishArtifactsTool, createReadFileTool, createReadMediaTool, createSendMediaTool, createSessionRecallTool, createSessionSearchTool, createSessionStatusTool, createSkillInstallTool, createSkillManageTool, createSkillViewTool, createSkillsListTool, createSkillsMarketplaceSearchTool, createTodoTool, createToolManualTool, createUpdatePlanTool, createUserContextGetTool, createUserContextSearchTool, createUserContextUpdateTool, createWebExtractTool, createWebFetchTool, createWebSearchTool, createWorkflowTool, createWriteFileTool, createXopcUseTool, findTool, formatSize, fuzzyFindText, generateDiffString, getToolMetadata, grepTool, isShareToolAvailable, listDirTool, normalizeForFuzzyMatch, normalizeToLF, resolveImageGenerationModelConfigForTool, resolveImageModelConfigForTool, resolveToolLockMode, restoreLineEndings, stripBom, stripHtmlBoilerplate, truncateHead, truncateLine, truncateTail, writeFileTool };
|
|
@@ -48,6 +48,7 @@ function createKnowledgeSearchTool(options) {
|
|
|
48
48
|
label: "Knowledge Search",
|
|
49
49
|
description: "Search project, workspace, and session knowledge for prior decisions, facts, lessons, and commitments.",
|
|
50
50
|
parameters: SearchSchema,
|
|
51
|
+
supportsParallel: true,
|
|
51
52
|
async execute(_toolCallId, raw) {
|
|
52
53
|
if (!options.canRead()) return {
|
|
53
54
|
content: [{
|
|
@@ -82,6 +83,7 @@ function createKnowledgeGetTool(options) {
|
|
|
82
83
|
label: "Knowledge Get",
|
|
83
84
|
description: "Read one knowledge item returned by knowledge_search.",
|
|
84
85
|
parameters: GetSchema,
|
|
86
|
+
supportsParallel: true,
|
|
85
87
|
async execute(_toolCallId, raw) {
|
|
86
88
|
if (!options.canRead()) return {
|
|
87
89
|
content: [{
|
|
@@ -97,13 +99,19 @@ function createKnowledgeGetTool(options) {
|
|
|
97
99
|
type: "text",
|
|
98
100
|
text: JSON.stringify(item, null, 2)
|
|
99
101
|
}],
|
|
100
|
-
details: {
|
|
102
|
+
details: {
|
|
103
|
+
item,
|
|
104
|
+
complete: true
|
|
105
|
+
}
|
|
101
106
|
} : {
|
|
102
107
|
content: [{
|
|
103
108
|
type: "text",
|
|
104
109
|
text: `Knowledge item not found: ${id}`
|
|
105
110
|
}],
|
|
106
|
-
details: {
|
|
111
|
+
details: {
|
|
112
|
+
id,
|
|
113
|
+
error: "knowledge_not_found"
|
|
114
|
+
}
|
|
107
115
|
};
|
|
108
116
|
}
|
|
109
117
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { checkedFilePath,
|
|
1
|
+
import { checkedFilePath, readWorkspaceFileAsync } from "../sandbox/fileAccess.js";
|
|
2
|
+
import { dataScheduler } from "../data-acquisition/scheduler.js";
|
|
2
3
|
import { checkFileSafety } from "../prompt/safety.js";
|
|
3
4
|
import { DEFAULT_MAX_BYTES, formatSize, truncateHead } from "./truncate.js";
|
|
4
5
|
import { isBareProfileMarkdownFileName, resolvePathUnderWorkspace, resolveProfileMarkdownPathIfBareName } from "./tool-paths.js";
|
|
@@ -27,12 +28,12 @@ function createReadFileTool(workspace, options) {
|
|
|
27
28
|
label: "📄 Read",
|
|
28
29
|
supportsParallel: true,
|
|
29
30
|
idempotent: true,
|
|
30
|
-
async execute(_toolCallId, params,
|
|
31
|
-
return executeReadFile(workspace, options?.profileMarkdownRoot, params);
|
|
31
|
+
async execute(_toolCallId, params, signal) {
|
|
32
|
+
return dataScheduler.run(workspace, signal, () => executeReadFile(workspace, options?.profileMarkdownRoot, params, signal));
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
|
-
async function executeReadFile(workspace, profileMarkdownRoot, params) {
|
|
36
|
+
async function executeReadFile(workspace, profileMarkdownRoot, params, signal) {
|
|
36
37
|
try {
|
|
37
38
|
const safety = checkFileSafety("read", params.path);
|
|
38
39
|
if (!safety.allowed) return {
|
|
@@ -66,7 +67,7 @@ async function executeReadFile(workspace, profileMarkdownRoot, params) {
|
|
|
66
67
|
}],
|
|
67
68
|
details: { status: "failed" }
|
|
68
69
|
};
|
|
69
|
-
const content =
|
|
70
|
+
const content = (await readWorkspaceFileAsync(activeRoot, normalized, signal, MAX_FILE_SIZE)).toString("utf8");
|
|
70
71
|
const offset = Math.max(1, params.offset ?? 1);
|
|
71
72
|
const lines = content.split("\n");
|
|
72
73
|
if (offset > lines.length) throw new Error(`Offset ${offset} exceeds ${lines.length} lines`);
|
|
@@ -90,6 +91,7 @@ async function executeReadFile(workspace, profileMarkdownRoot, params) {
|
|
|
90
91
|
}
|
|
91
92
|
};
|
|
92
93
|
} catch (error) {
|
|
94
|
+
signal?.throwIfAborted();
|
|
93
95
|
return {
|
|
94
96
|
content: [{
|
|
95
97
|
type: "text",
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export interface RepositorySearchOptions {
|
|
2
|
+
maxBytes?: number;
|
|
3
|
+
onLine?: (line: string) => boolean | void;
|
|
4
|
+
}
|
|
5
|
+
export declare function parseRepositoryMatch(workspace: string, line: string): {
|
|
6
|
+
path: string;
|
|
7
|
+
line: number;
|
|
8
|
+
text: string;
|
|
9
|
+
match: boolean;
|
|
10
|
+
} | undefined;
|
|
11
|
+
/** One bounded process path for raw filename output and streamed JSON events. */
|
|
12
|
+
export declare function repositorySearch(cwd: string, args: string[], signal?: AbortSignal, options?: RepositorySearchOptions): Promise<{
|
|
3
13
|
output: string;
|
|
4
14
|
truncated: boolean;
|
|
5
15
|
}>;
|