@xopcai/xopc 0.0.307 → 0.0.309
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-XKNYlFUI.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CZeQo09T.js → agent-avatar-dicebear-1S2TFECE.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-f0-YFMUz.js +1 -0
- package/dist/gateway/static/root/assets/{agents-BlrHMbRx.js → agents-CPqUMtCL.js} +1 -1
- package/dist/gateway/static/root/assets/{api-BKHmTb0w.js → api-BEUEE4f2.js} +1 -1
- package/dist/gateway/static/root/assets/api-CN4id43t.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-Bzw4fQP8.js → app-management-settings-panel-CgVBSqzu.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-8GZpUXva.js → appearance-settings-CoWdCokb.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-BkQQtIxH.js → apps-page-CexHOcWg.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-CQ2NaoHb.js → archive-plugin-C3ZA6LRS.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BFi1H7yJ.js → attachment-load-CdgS6_zy.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CDBXcii_.js → automations-page-BtHL2hpg.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-onJPfmO6.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-D07eWmOx.js → binary-plugins-CiDhtq_H.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CtVnjyYU.js → block-editor-Br00T83w.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-BzkJog8e.js → browser-automation-inputs-D2tILykA.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-DyrSbDdG.js → browser-automations-page-BVuEmryB.js} +1 -1
- package/dist/gateway/static/root/assets/browser-settings-page-BgVTyPFY.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Dra8wj1S.js +8 -0
- package/dist/gateway/static/root/assets/{channels-settings-DAD9qE3J.js → channels-settings-CkxiMDJ4.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-status-swr-B2JwuTjG.js → channels-status-swr-Dtder4G_.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-B62SZdAo.js → chat-terminal-dock-JsMtzDao.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-ClSresNq.js → computer-settings-page-DHerePwo.js} +1 -1
- package/dist/gateway/static/root/assets/connector-service-page-DZFNUTiN.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-cl9ZrV4D.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-CTMi_tql.js → cron-expression-DAhdv_Xv.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-B71AJK50.js → date-picker-PacO1m3a.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DlyGK-kA.js → dependency-picker-B-BcuG1y.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DGkbTE8_.js → desktop-pet-CdBBhhdY.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BY8r9j66.js → desktop-pet-settings-Gy03NgMI.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-DzRrgd59.js → device-pairing-wizard-aV25nKag.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-L8Mm1n3A.js → extension-debug-page-BFp5eKtY.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CFc4vSNU.js → extension-page-DL3vyyH6.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-B5zWyHr3.js → extension-settings-page-BXtvdAsY.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-B6wHa6ZI.js → gateway-config-swr-xAOGtenO.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-B53R0CA4.js → gateway-realtime-BuaTsMSi.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BG95uGVW.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-D7qmTH4R.js → gateway-settings-Dcr2Ikeh.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DRzGnEV-.js → gateway-startup-retry-BwDxKHd4.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-Glsl3X5b.js → heartbeat-settings-DOy3alvT.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-CDm3dGVy.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-Ck_pyDom.js → image-generation-api-wGMeI_yW.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-ByBX7ome.js → imports-page-zexFT5Rq.js} +1 -1
- package/dist/gateway/static/root/assets/index-D-vczw_0.css +1 -0
- package/dist/gateway/static/root/assets/index-DJo4DimT.js +79 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-C45RlO8a.js → keyboard-shortcuts-settings-CutG9zLh.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-DP0x2jpR.js → local-app-workbench-page-CwLvTwjn.js} +2 -2
- package/dist/gateway/static/root/assets/{local-apps-page-C_AQc2bI.js → local-apps-page-CJy6I7Dt.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-msTfRK8P.js → locale-store-DPZ79W1-.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DvM8Pyok.js → logs-page-egGcPHNi.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-D1uwSutV.js → management-settings-BQhIOELc.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BInabSKf.js → markdown-view-p2P5hP1U.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-C4mhf13f.js → media-plugins-CsBylqlN.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BiYTyLJr.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-c2k5Uz6X.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-BLQWJMhf.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-1go_BtX1.js → page-tabs-ChQ4jJFs.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DmoSC0j1.js → preview-open-alternatives-9B5W7nVE.js} +1 -1
- package/dist/gateway/static/root/assets/{proactive-page-xAjKTIID.js → proactive-page-iOjI0d_e.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-gmi5LLwM.js → product-open-page-BADxWEdP.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BcxbQn2M.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-BuSvld0O.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BSWtko7U.js → registry-api-B_e_nZSN.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CFS8LQKW.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-ClkOoxDl.js → runtime-tools-settings-panel-D-pwiIyp.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-BuEmLiaU.js → schema-form-IWmb05DX.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-DZjc__ok.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-C1SM5B93.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-Dor39QON.js → settings-form-section-B0veRBZs.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-Xj-yvIc8.js → settings-page-CxRWyWYe.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-D9Rl7Tec.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-BFWZoXdm.js → share-preview-page-CirpgkfD.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-CwCThBs0.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DG6VGbOX.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-BdRJ2vnL.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-Ii8qeXhs.js → skills-page.utils-B42mpWKV.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Di6OSO-0.js → system-settings-panel-DXIZpAvU.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-QXo9LJly.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-1SZ-HFHX.js → theme-store-BFbj_2Tu.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-DDOlOYlj.js → tunnel-api-Db2guRdW.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-CQ8uWNnB.js → use-autosave-DDY9qoXZ.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-CzPmMkaO.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-COTzshjL.js → voice-api-key-field-BZbKQ8HT.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DgJML_uM.js → voice-config-api-SKCeQLrH.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-_URrXbi4.js → work-discovery-overlay-BRVTTXNG.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CALs-1nd.js → workflow-run-setup-panel-D2kuwv5e.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CQXtiYtq.js +6 -0
- package/dist/gateway/static/root/index.html +12 -12
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/notifications.js +1 -1
- package/dist/packages/gateway-contract/src/sessions.js +6 -1
- package/dist/src/agent/agent-manager.js +29 -4
- package/dist/src/agent/background-review/prompts.js +3 -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/context/execution-context.js +4 -4
- 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/composio-provider.js +12 -1
- package/dist/src/agent/external-tools/gateway-tools.js +2 -1
- package/dist/src/agent/external-tools/index.js +8 -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 +2 -0
- package/dist/src/agent/memory/compaction-promotion.d.ts +1 -1
- package/dist/src/agent/memory/compaction-promotion.js +4 -3
- 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/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 +2 -0
- package/dist/src/agent/tools/factory.js +42 -3
- 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.d.ts +1 -1
- package/dist/src/agent/tools/knowledge-memory-tool.js +13 -5
- 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/user-context-tool.js +17 -7
- package/dist/src/agent/tools/web.js +19 -28
- 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/chat-commands/builtins/understanding.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/config/schema.d.ts +6 -4
- package/dist/src/config/schema.js +2 -2
- package/dist/src/connectors/connected-source-understanding.d.ts +1 -0
- package/dist/src/connectors/connected-source-understanding.js +1 -0
- package/dist/src/connectors/learning-coordinator.js +31 -9
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/heartbeat/service.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +4 -2
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/context-sources.js +0 -23
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/projects.js +8 -0
- package/dist/src/gateway/hono/routes/sessions.js +141 -13
- package/dist/src/gateway/hono/routes/user-model-refresh.d.ts +5 -0
- package/dist/src/gateway/hono/routes/user-model-refresh.js +128 -0
- package/dist/src/gateway/hono/routes/user-model.js +12 -5
- package/dist/src/gateway/hono/routes/work-discovery.js +0 -30
- package/dist/src/gateway/service.js +6 -6
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/knowledge/connected-knowledge-pipeline.js +1 -1
- package/dist/src/knowledge-memory/index.js +2 -2
- package/dist/src/knowledge-memory/repository.d.ts +7 -0
- package/dist/src/knowledge-memory/repository.js +58 -8
- package/dist/src/memory-maintenance/service.js +61 -31
- package/dist/src/migrations/memory-config.d.ts +2 -0
- package/dist/src/migrations/memory-config.js +77 -0
- package/dist/src/migrations/runner.js +2 -2
- package/dist/src/notifications/planner.js +5 -5
- package/dist/src/notifications/service.d.ts +2 -2
- package/dist/src/notifications/service.js +1 -1
- package/dist/src/storage/sqlite/index.d.ts +1 -0
- package/dist/src/storage/sqlite/index.js +2 -1
- package/dist/src/storage/sqlite/migrations/184_memory_suppressions.sql +12 -0
- package/dist/src/storage/sqlite/migrations/185_understanding_refresh_batches.sql +6 -0
- package/dist/src/storage/sqlite/migrations/186_sidebar_layout.sql +16 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/sidebar-layout-repository.d.ts +12 -0
- package/dist/src/storage/sqlite/sidebar-layout-repository.js +53 -0
- package/dist/src/user-context/config.d.ts +4 -9
- package/dist/src/user-context/config.js +7 -27
- package/dist/src/user-context/memory-suppression.d.ts +7 -0
- package/dist/src/user-context/memory-suppression.js +23 -0
- package/dist/src/user-context/relationship-continuity.js +1 -1
- package/dist/src/user-context/sources/refresh-service.d.ts +48 -0
- package/dist/src/user-context/sources/refresh-service.js +221 -0
- package/dist/src/user-context/sources/repository.js +1 -1
- package/dist/src/user-model/bootstrap.js +27 -24
- package/dist/src/user-model/capture/executor.d.ts +1 -1
- package/dist/src/user-model/capture/executor.js +17 -11
- package/dist/src/user-model/capture/semantic.js +1 -1
- package/dist/src/user-model/domain.d.ts +6 -2
- package/dist/src/user-model/index.js +3 -3
- package/dist/src/user-model/profile.js +1 -1
- package/dist/src/user-model/repository.d.ts +4 -1
- package/dist/src/user-model/repository.js +96 -6
- package/dist/src/user-model/usage-policy.d.ts +2 -0
- package/dist/src/user-model/usage-policy.js +6 -2
- package/dist/src/work-discovery/project-understanding.js +2 -1
- package/dist/src/work-discovery/service.d.ts +8 -24
- package/dist/src/work-discovery/service.js +138 -180
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BPsRb9Ck.js +0 -1
- package/dist/gateway/static/root/assets/api-DFOlahZv.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-CUpiTTiY.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CqTxLpil.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BZ_-pnS6.js +0 -8
- package/dist/gateway/static/root/assets/connector-service-page-CPqVmNvx.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BUQyg3CW.js +0 -2
- package/dist/gateway/static/root/assets/gateway-realtime-store-BLDgrJ30.js +0 -1
- package/dist/gateway/static/root/assets/home-page-s9hDQ8Hc.js +0 -1
- package/dist/gateway/static/root/assets/index-RBCkv8a_.js +0 -79
- package/dist/gateway/static/root/assets/index-cFU4S35z.css +0 -1
- package/dist/gateway/static/root/assets/messages-F74LVAiU.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-D35sErp2.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-8jCDklDn.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-BUMQHy_N.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DT-Mt7XR.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Clz3byir.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-tQRwktKm.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DqWg9XS5.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BB_sMB7P.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-oDALm4b6.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DmwelnfK.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BE9JXz4U.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-D1AWszc7.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-C00i4ea0.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-BUiBjz6m.js +0 -6
- package/dist/src/migrations/knowledge-memory-read-policy-config.d.ts +0 -2
- package/dist/src/migrations/knowledge-memory-read-policy-config.js +0 -48
|
@@ -1,84 +1,137 @@
|
|
|
1
1
|
import { prepareSafeToolEnv } from "../sandbox/sanitize-env-vars.js";
|
|
2
2
|
import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
|
|
3
|
+
import { dataScheduler } from "../data-acquisition/scheduler.js";
|
|
3
4
|
import { resolveRipgrepBinary } from "../../infra/ripgrep.js";
|
|
4
5
|
import { lstatSync } from "node:fs";
|
|
5
6
|
import { spawn } from "node:child_process";
|
|
7
|
+
import { StringDecoder } from "node:string_decoder";
|
|
6
8
|
//#region src/agent/tools/repository-search.ts
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
9
|
+
function parseRepositoryMatch(workspace, line) {
|
|
10
|
+
if (!line) return void 0;
|
|
11
|
+
const event = JSON.parse(line);
|
|
12
|
+
if (event.type !== "match" && event.type !== "context") return void 0;
|
|
13
|
+
const data = event.data;
|
|
14
|
+
if (typeof data?.path?.text !== "string" || typeof data.lines?.text !== "string" || !Number.isInteger(data.line_number) || !isSearchFileAllowed(workspace, data.path.text)) return void 0;
|
|
15
|
+
return {
|
|
16
|
+
path: data.path.text,
|
|
17
|
+
line: data.line_number,
|
|
18
|
+
text: data.lines.text.replace(/\r?\n$/, ""),
|
|
19
|
+
match: event.type === "match"
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** One bounded process path for raw filename output and streamed JSON events. */
|
|
23
|
+
async function repositorySearch(cwd, args, signal, options = {}) {
|
|
24
|
+
const deadline = AbortSignal.any([...signal ? [signal] : [], AbortSignal.timeout(1e4)]);
|
|
25
|
+
return dataScheduler.run(cwd, deadline, async () => {
|
|
26
|
+
deadline.throwIfAborted();
|
|
27
|
+
const binary = await resolveRipgrepBinary();
|
|
28
|
+
deadline.throwIfAborted();
|
|
29
|
+
return new Promise((resolve, reject) => {
|
|
30
|
+
const separator = args.indexOf("--");
|
|
31
|
+
const searchOptions = separator < 0 ? args : args.slice(0, separator);
|
|
32
|
+
const targets = separator < 0 ? [] : args.slice(separator);
|
|
33
|
+
const excluded = [
|
|
34
|
+
".git",
|
|
35
|
+
"node_modules",
|
|
36
|
+
".env",
|
|
37
|
+
".env.*",
|
|
38
|
+
".ssh",
|
|
39
|
+
".aws",
|
|
40
|
+
".gnupg",
|
|
41
|
+
".docker",
|
|
42
|
+
".config",
|
|
43
|
+
".netrc",
|
|
44
|
+
".npmrc",
|
|
45
|
+
".cargo/credentials",
|
|
46
|
+
".kube",
|
|
47
|
+
".xopc"
|
|
48
|
+
];
|
|
49
|
+
const child = spawn(binary, [
|
|
50
|
+
"--no-config",
|
|
51
|
+
"--hidden",
|
|
52
|
+
...searchOptions,
|
|
53
|
+
...excluded.flatMap((path) => [
|
|
54
|
+
"--glob",
|
|
55
|
+
`!**/${path}`,
|
|
56
|
+
"--glob",
|
|
57
|
+
`!**/${path}/**`
|
|
58
|
+
]),
|
|
59
|
+
"--no-follow",
|
|
60
|
+
...targets
|
|
61
|
+
], {
|
|
62
|
+
cwd,
|
|
63
|
+
env: prepareSafeToolEnv(process.env)
|
|
64
|
+
});
|
|
65
|
+
const chunks = [];
|
|
66
|
+
const decoder = new StringDecoder("utf8");
|
|
67
|
+
let bytes = 0, truncated = false, stderr = "", pending = "";
|
|
68
|
+
let failure;
|
|
69
|
+
const stop = () => child.kill("SIGKILL");
|
|
70
|
+
const consume = (text) => {
|
|
71
|
+
pending += text;
|
|
72
|
+
let newline;
|
|
73
|
+
while (!truncated && (newline = pending.indexOf("\n")) !== -1) {
|
|
74
|
+
const line = pending.slice(0, newline);
|
|
75
|
+
pending = pending.slice(newline + 1);
|
|
76
|
+
if (options.onLine?.(line) === false) {
|
|
77
|
+
truncated = true;
|
|
78
|
+
stop();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
deadline.addEventListener("abort", stop, { once: true });
|
|
83
|
+
child.stdout.on("data", (chunk) => {
|
|
84
|
+
if (truncated || failure) return;
|
|
85
|
+
const remaining = Math.max(0, (options.maxBytes ?? 5e4) - bytes);
|
|
86
|
+
const selected = chunk.subarray(0, remaining);
|
|
87
|
+
bytes += chunk.length;
|
|
88
|
+
try {
|
|
89
|
+
if (options.onLine) consume(decoder.write(selected));
|
|
90
|
+
else chunks.push(selected);
|
|
91
|
+
} catch (error) {
|
|
92
|
+
failure = error instanceof Error ? error : new Error(String(error));
|
|
93
|
+
stop();
|
|
94
|
+
}
|
|
95
|
+
if (bytes > (options.maxBytes ?? 5e4)) {
|
|
96
|
+
truncated = true;
|
|
97
|
+
stop();
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
child.stderr.on("data", (chunk) => {
|
|
101
|
+
stderr = (stderr + String(chunk)).slice(-4e3);
|
|
102
|
+
});
|
|
103
|
+
child.on("error", (error) => {
|
|
104
|
+
failure = error;
|
|
105
|
+
});
|
|
106
|
+
child.on("close", (code) => {
|
|
107
|
+
deadline.removeEventListener("abort", stop);
|
|
108
|
+
if (deadline.aborted) {
|
|
109
|
+
reject(deadline.reason);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (failure) {
|
|
113
|
+
reject(failure);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (code !== 0 && code !== 1 && !truncated) {
|
|
117
|
+
reject(new Error(stderr || "Search did not complete; narrow the search."));
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
try {
|
|
121
|
+
if (options.onLine && !truncated) {
|
|
122
|
+
consume(decoder.end());
|
|
123
|
+
if (pending && options.onLine(pending) === false) truncated = true;
|
|
124
|
+
}
|
|
125
|
+
resolve({
|
|
126
|
+
output: Buffer.concat(chunks).toString("utf8"),
|
|
127
|
+
truncated
|
|
128
|
+
});
|
|
129
|
+
} catch (error) {
|
|
130
|
+
reject(error);
|
|
131
|
+
}
|
|
79
132
|
});
|
|
133
|
+
if (deadline.aborted) stop();
|
|
80
134
|
});
|
|
81
|
-
if (signal?.aborted) abort();
|
|
82
135
|
});
|
|
83
136
|
}
|
|
84
137
|
/** Search results must satisfy the same policy as direct file reads. */
|
|
@@ -97,4 +150,4 @@ function isSearchFileAllowed(workspace, path) {
|
|
|
97
150
|
}
|
|
98
151
|
}
|
|
99
152
|
//#endregion
|
|
100
|
-
export { isSearchFileAllowed, repositorySearch };
|
|
153
|
+
export { isSearchFileAllowed, parseRepositoryMatch, repositorySearch };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { retrievalLexicalSimilarity } from "../../retrieval/textFeatures.js";
|
|
2
|
-
import { getAssertionSlot, getUserAssertion, listUserAssertions, reconcileAssertion, setAssertionStatus } from "../../user-model/repository.js";
|
|
3
|
-
import {
|
|
2
|
+
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, listUserAssertions, reconcileAssertion, setAssertionStatus } from "../../user-model/repository.js";
|
|
3
|
+
import { canUseAssertion } from "../../user-model/usage-policy.js";
|
|
4
4
|
import "../../user-model/index.js";
|
|
5
5
|
import { Type } from "@sinclair/typebox";
|
|
6
6
|
//#region src/agent/tools/user-context-tool.ts
|
|
@@ -31,9 +31,6 @@ function visible(options, slotId) {
|
|
|
31
31
|
const scope = getAssertionSlot(slotId)?.scope;
|
|
32
32
|
return scope?.type === "global" || scope?.type === "agent" && scope.id === options.agentId || scope?.type === "workspace" && scope.id === options.workspaceId || scope?.type === "project" && scope.id === options.getProjectId?.() || scope?.type === "session" && scope.id === options.getSessionId();
|
|
33
33
|
}
|
|
34
|
-
function referenceable(assertion) {
|
|
35
|
-
return (assertion.status === "active" || isWorkingAssumption(assertion)) && assertion.authority !== "external_untrusted" && assertion.sensitivity !== "secret" && assertion.sensitivity !== "regulated" && assertion.disclosurePolicy !== "ask_before_reference";
|
|
36
|
-
}
|
|
37
34
|
function createUserContextSearchTool(options) {
|
|
38
35
|
return {
|
|
39
36
|
name: "user_context_search",
|
|
@@ -52,7 +49,7 @@ function createUserContextSearchTool(options) {
|
|
|
52
49
|
const results = listUserAssertions({
|
|
53
50
|
statuses: ["active", "candidate"],
|
|
54
51
|
limit: 1e3
|
|
55
|
-
}).filter((assertion) => visible(options, assertion.slotId)).filter(
|
|
52
|
+
}).filter((assertion) => visible(options, assertion.slotId)).filter((item) => canUseAssertion(item)).map((assertion) => ({
|
|
56
53
|
assertion,
|
|
57
54
|
score: retrievalLexicalSimilarity(input.query, `${assertion.statement} ${assertion.normalizedValue}`)
|
|
58
55
|
})).filter((item) => item.score > 0).sort((left, right) => right.score - left.score).slice(0, input.maxResults ?? 12).map(({ assertion, score }) => ({
|
|
@@ -89,7 +86,7 @@ function createUserContextGetTool(options) {
|
|
|
89
86
|
};
|
|
90
87
|
const id = raw.id;
|
|
91
88
|
const assertion = getUserAssertion(id);
|
|
92
|
-
if (!assertion || !visible(options, assertion.slotId) || !
|
|
89
|
+
if (!assertion || !visible(options, assertion.slotId) || !canUseAssertion(assertion)) return {
|
|
93
90
|
content: [{
|
|
94
91
|
type: "text",
|
|
95
92
|
text: `User assertion not found: ${id}`
|
|
@@ -199,6 +196,19 @@ function createUserContextUpdateTool(options) {
|
|
|
199
196
|
details: receipt
|
|
200
197
|
};
|
|
201
198
|
}
|
|
199
|
+
if (input.action === "forget") {
|
|
200
|
+
deleteUserAssertion(current.id);
|
|
201
|
+
return {
|
|
202
|
+
content: [{
|
|
203
|
+
type: "text",
|
|
204
|
+
text: "Memory deleted."
|
|
205
|
+
}],
|
|
206
|
+
details: {
|
|
207
|
+
action: "forget",
|
|
208
|
+
id: current.id
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
202
212
|
const status = {
|
|
203
213
|
confirm: "active",
|
|
204
214
|
reject: "rejected",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SearchProviderRegistry } from "./search/registry.js";
|
|
2
2
|
import { resolveWebSearchConfig } from "./search/resolve-config.js";
|
|
3
|
-
import {
|
|
3
|
+
import { fetchPublicText } from "./fetch-text.js";
|
|
4
4
|
import { Type } from "@sinclair/typebox";
|
|
5
5
|
//#region src/agent/tools/web.ts
|
|
6
6
|
const WebSearchSchema = Type.Object({
|
|
@@ -16,6 +16,7 @@ function createWebSearchTool(getConfig) {
|
|
|
16
16
|
description: "Search the web. Uses configured search APIs when set; otherwise falls back to a built-in HTML search (region-aware).",
|
|
17
17
|
parameters: WebSearchSchema,
|
|
18
18
|
label: "🔍 Web Search",
|
|
19
|
+
supportsParallel: true,
|
|
19
20
|
async execute(_toolCallId, params, signal) {
|
|
20
21
|
const p = params;
|
|
21
22
|
const cfg = resolveWebSearchConfig(getConfig()?.tools?.web);
|
|
@@ -49,13 +50,15 @@ function createWebSearchTool(getConfig) {
|
|
|
49
50
|
type: "text",
|
|
50
51
|
text: `Search error: ${error instanceof Error ? error.message : String(error)}`
|
|
51
52
|
}],
|
|
52
|
-
details: {
|
|
53
|
+
details: {
|
|
54
|
+
results: [],
|
|
55
|
+
error: error instanceof Error ? error.message : String(error)
|
|
56
|
+
}
|
|
53
57
|
};
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
60
|
};
|
|
57
61
|
}
|
|
58
|
-
const MAX_FETCH_CHARS = 6e6;
|
|
59
62
|
const WebFetchSchema = Type.Object({
|
|
60
63
|
url: Type.String({ description: "The URL to fetch" }),
|
|
61
64
|
maxChars: Type.Optional(Type.Number({ description: "Maximum characters to return (default: 10000)" }))
|
|
@@ -76,47 +79,35 @@ function createWebFetchTool(getConfig) {
|
|
|
76
79
|
description: "Fetch and extract readable content from a URL (HTML via Readability; plain text as-is).",
|
|
77
80
|
parameters: WebFetchSchema,
|
|
78
81
|
label: "🌐 Web Fetch",
|
|
82
|
+
supportsParallel: true,
|
|
79
83
|
async execute(_toolCallId, params, signal) {
|
|
80
84
|
try {
|
|
81
85
|
const p = params;
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
content: [{
|
|
85
|
-
type: "text",
|
|
86
|
-
text: `Blocked: ${safety.reason}`
|
|
87
|
-
}],
|
|
88
|
-
details: {}
|
|
89
|
-
};
|
|
90
|
-
const blocked = checkWebsiteBlocklist(p.url, getConfig()?.tools?.web?.blocklist);
|
|
91
|
-
if (blocked) return {
|
|
92
|
-
content: [{
|
|
93
|
-
type: "text",
|
|
94
|
-
text: `Blocked: ${blocked.message}`
|
|
95
|
-
}],
|
|
96
|
-
details: {}
|
|
97
|
-
};
|
|
98
|
-
const response = await fetch(p.url, { signal });
|
|
99
|
-
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
100
|
-
const html = await response.text();
|
|
101
|
-
if (html.length > MAX_FETCH_CHARS) throw new Error("Response too large");
|
|
86
|
+
const fetched = await fetchPublicText(p.url, getConfig()?.tools?.web?.blocklist, signal);
|
|
87
|
+
const html = fetched.text;
|
|
102
88
|
const maxChars = p.maxChars || 1e4;
|
|
103
|
-
const contentType =
|
|
89
|
+
const contentType = fetched.contentType;
|
|
104
90
|
const looksHtml = /html|xml/i.test(contentType) || /^[\s\n]*</.test(html.slice(0, Math.min(500, html.length)));
|
|
105
91
|
let text;
|
|
106
92
|
if (looksHtml) try {
|
|
107
|
-
text = await extractReadableText(html,
|
|
93
|
+
text = await extractReadableText(html, fetched.url);
|
|
108
94
|
if (!text || text.length < 40) text = stripHtmlFallback(html);
|
|
109
95
|
} catch {
|
|
110
96
|
text = stripHtmlFallback(html);
|
|
111
97
|
}
|
|
112
98
|
else text = html.trim();
|
|
113
|
-
|
|
99
|
+
const truncated = text.length > maxChars;
|
|
100
|
+
if (truncated) text = text.substring(0, maxChars) + "\n\n[truncated...]";
|
|
114
101
|
return {
|
|
115
102
|
content: [{
|
|
116
103
|
type: "text",
|
|
117
104
|
text
|
|
118
105
|
}],
|
|
119
|
-
details: {
|
|
106
|
+
details: {
|
|
107
|
+
truncated,
|
|
108
|
+
complete: !truncated,
|
|
109
|
+
url: fetched.url
|
|
110
|
+
}
|
|
120
111
|
};
|
|
121
112
|
} catch (error) {
|
|
122
113
|
return {
|
|
@@ -124,7 +115,7 @@ function createWebFetchTool(getConfig) {
|
|
|
124
115
|
type: "text",
|
|
125
116
|
text: `Fetch error: ${error instanceof Error ? error.message : String(error)}`
|
|
126
117
|
}],
|
|
127
|
-
details: {}
|
|
118
|
+
details: { error: error instanceof Error ? error.message : String(error) }
|
|
128
119
|
};
|
|
129
120
|
}
|
|
130
121
|
}
|
|
@@ -2,7 +2,9 @@ import { createLogger } from "../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { createSqliteTranscriptRuntime } from "../embedded/transcript-runtime.js";
|
|
4
4
|
import { createDelegateChildHandle } from "../child-agent-factory.js";
|
|
5
|
-
import {
|
|
5
|
+
import { DELEGATION_TOOL_CAPABILITIES, protectDelegatedTool, resolveDelegationTools } from "../tools/delegation-policy.js";
|
|
6
|
+
import { DELEGATE_BLOCKED_TOOLS } from "../tools/delegate-tool.js";
|
|
7
|
+
import { createDelegationParentPolicy } from "../tools/delegation-parent-policy.js";
|
|
6
8
|
import { STRUCTURED_OUTPUT_TOOL_NAME, createStructuredOutputTool } from "./structured-output-tool.js";
|
|
7
9
|
//#region src/agent/workflow/subagent-runner.ts
|
|
8
10
|
init_logger();
|
|
@@ -38,11 +40,27 @@ var DelegateSubagentRunner = class {
|
|
|
38
40
|
agentId: this.deps.agentId,
|
|
39
41
|
getConfig: this.deps.getConfig,
|
|
40
42
|
toolExecutorConfig: this.deps.toolExecutorConfig,
|
|
43
|
+
authorizeToolCall: createDelegationParentPolicy({
|
|
44
|
+
getConfig: this.deps.getConfig,
|
|
45
|
+
conversationId: opts.sessionMetadata?.parentConversationId,
|
|
46
|
+
agentId: this.deps.agentId
|
|
47
|
+
}).beforeToolCall,
|
|
41
48
|
buildChildTools: (childOpts) => {
|
|
42
|
-
const
|
|
49
|
+
const candidates = this.deps.buildChildTools({
|
|
43
50
|
...childOpts,
|
|
44
51
|
agentId: this.deps.agentId ?? childOpts.agentId
|
|
45
52
|
});
|
|
53
|
+
const access = resolveDelegationTools(candidates.map((tool) => tool.name), "custom", opts.allowedToolNames, [
|
|
54
|
+
"local_read",
|
|
55
|
+
"web_read",
|
|
56
|
+
"knowledge_read",
|
|
57
|
+
"skills_read",
|
|
58
|
+
"external_read",
|
|
59
|
+
...opts.allowedToolNames?.includes("browser_use") ? ["browser"] : []
|
|
60
|
+
]);
|
|
61
|
+
if (access.rejected.length) throw new Error(`Workflow delegation rejected tools: ${JSON.stringify(access.rejected)}. Use delegate_task implement for isolated writes and commands.`);
|
|
62
|
+
const granted = new Set(access.granted);
|
|
63
|
+
const base = candidates.filter((tool) => granted.has(tool.name)).map(protectDelegatedTool);
|
|
46
64
|
if (!wantStructured || !opts.schema) return base;
|
|
47
65
|
return [...base.filter((t) => t.name !== STRUCTURED_OUTPUT_TOOL_NAME), createStructuredOutputTool({
|
|
48
66
|
schema: opts.schema,
|
|
@@ -129,7 +147,11 @@ var DelegateSubagentRunner = class {
|
|
|
129
147
|
}
|
|
130
148
|
};
|
|
131
149
|
function resolveAllowedToolNames(requested, wantStructured) {
|
|
132
|
-
const filtered = (requested ??
|
|
150
|
+
const filtered = (requested ?? Object.keys(DELEGATION_TOOL_CAPABILITIES).filter((name) => ![
|
|
151
|
+
"local_write",
|
|
152
|
+
"command",
|
|
153
|
+
"browser"
|
|
154
|
+
].includes(DELEGATION_TOOL_CAPABILITIES[name]))).map((s) => String(s).trim()).filter((s) => s.length > 0).filter((s) => !DELEGATE_BLOCKED_TOOLS.has(s));
|
|
133
155
|
if (wantStructured && !filtered.includes("structured_output")) filtered.push(STRUCTURED_OUTPUT_TOOL_NAME);
|
|
134
156
|
return [...new Set(filtered)];
|
|
135
157
|
}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../external-tools/index.js";
|
|
1
|
+
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
3
2
|
import { AgentToolsFactory } from "../tools/factory.js";
|
|
4
3
|
//#region src/agent/workflow/workflow-child-tools.ts
|
|
5
4
|
/** Builds the tool set for workflow child agents (wired from gateway to avoid cycles). */
|
|
6
5
|
function buildWorkflowChildTools(childOptions) {
|
|
6
|
+
const config = childOptions.getConfig();
|
|
7
|
+
const profile = config ? childOptions.browserConversationId ? resolveEffectiveAgentProfileForSession(config, childOptions.browserConversationId) : childOptions.agentId ? resolveEffectiveAgentProfile(config, childOptions.agentId) : resolveEffectiveAgentProfileForSession(config, void 0) : void 0;
|
|
7
8
|
return new AgentToolsFactory({
|
|
8
9
|
workspace: childOptions.workspace,
|
|
9
10
|
bus: childOptions.bus,
|
|
10
|
-
getCurrentContext: () =>
|
|
11
|
+
getCurrentContext: () => childOptions.browserConversationId ? {
|
|
12
|
+
conversationId: childOptions.browserConversationId,
|
|
13
|
+
channel: "workflow",
|
|
14
|
+
chatId: childOptions.browserConversationId,
|
|
15
|
+
origin: {
|
|
16
|
+
type: "system",
|
|
17
|
+
source: "workflow"
|
|
18
|
+
}
|
|
19
|
+
} : null,
|
|
11
20
|
getConfig: childOptions.getConfig,
|
|
12
21
|
getPrimaryModel: () => childOptions.model,
|
|
13
22
|
endpointTools: childOptions.endpointTools,
|
|
@@ -17,11 +26,7 @@ function buildWorkflowChildTools(childOptions) {
|
|
|
17
26
|
getPrimaryModel: () => childOptions.model,
|
|
18
27
|
agentId: childOptions.agentId,
|
|
19
28
|
conversationId: childOptions.browserConversationId,
|
|
20
|
-
disabledTools:
|
|
21
|
-
EXTERNAL_TOOL_NAMES.search,
|
|
22
|
-
EXTERNAL_TOOL_NAMES.describe,
|
|
23
|
-
EXTERNAL_TOOL_NAMES.execute
|
|
24
|
-
])
|
|
29
|
+
disabledTools: profile?.tools.denied
|
|
25
30
|
});
|
|
26
31
|
}
|
|
27
32
|
//#endregion
|
|
@@ -96,6 +96,7 @@ export declare const ToolPolicySchema: z.ZodObject<{
|
|
|
96
96
|
deny: "deny";
|
|
97
97
|
ask: "ask";
|
|
98
98
|
}>;
|
|
99
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
99
100
|
maxCallsPerTurn: z.ZodOptional<z.ZodNumber>;
|
|
100
101
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
101
102
|
}, z.core.$strict>;
|
|
@@ -105,6 +106,7 @@ export declare const ToolPoliciesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
105
106
|
deny: "deny";
|
|
106
107
|
ask: "ask";
|
|
107
108
|
}>;
|
|
109
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
108
110
|
maxCallsPerTurn: z.ZodOptional<z.ZodNumber>;
|
|
109
111
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
110
112
|
}, z.core.$strict>>;
|
|
@@ -198,6 +200,7 @@ export declare const AgentDefaultsSchema: z.ZodObject<{
|
|
|
198
200
|
deny: "deny";
|
|
199
201
|
ask: "ask";
|
|
200
202
|
}>;
|
|
203
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
201
204
|
maxCallsPerTurn: z.ZodOptional<z.ZodNumber>;
|
|
202
205
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
203
206
|
}, z.core.$strict>>>;
|
|
@@ -289,6 +292,7 @@ export declare const AgentEntrySchema: z.ZodObject<{
|
|
|
289
292
|
deny: "deny";
|
|
290
293
|
ask: "ask";
|
|
291
294
|
}>;
|
|
295
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
292
296
|
maxCallsPerTurn: z.ZodOptional<z.ZodNumber>;
|
|
293
297
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
294
298
|
}, z.core.$strict>>>;
|
|
@@ -370,6 +374,7 @@ export declare const AgentsConfigSchema: z.ZodObject<{
|
|
|
370
374
|
deny: "deny";
|
|
371
375
|
ask: "ask";
|
|
372
376
|
}>;
|
|
377
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
373
378
|
maxCallsPerTurn: z.ZodOptional<z.ZodNumber>;
|
|
374
379
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
375
380
|
}, z.core.$strict>>>;
|
|
@@ -457,6 +462,7 @@ export declare const AgentsConfigSchema: z.ZodObject<{
|
|
|
457
462
|
deny: "deny";
|
|
458
463
|
ask: "ask";
|
|
459
464
|
}>;
|
|
465
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
460
466
|
maxCallsPerTurn: z.ZodOptional<z.ZodNumber>;
|
|
461
467
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
462
468
|
}, z.core.$strict>>>;
|
|
@@ -544,6 +550,7 @@ export declare const EffectiveAgentConfigSchema: z.ZodObject<{
|
|
|
544
550
|
deny: "deny";
|
|
545
551
|
ask: "ask";
|
|
546
552
|
}>;
|
|
553
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
547
554
|
maxCallsPerTurn: z.ZodOptional<z.ZodNumber>;
|
|
548
555
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
549
556
|
}, z.core.$strict>>;
|
|
@@ -49,6 +49,8 @@ var init_schema = __esmMin((() => {
|
|
|
49
49
|
]);
|
|
50
50
|
ToolPolicySchema = z.object({
|
|
51
51
|
mode: ToolModeSchema,
|
|
52
|
+
/** Host assertion for external tools; remote annotations alone cannot grant read access. */
|
|
53
|
+
readOnly: z.boolean().optional(),
|
|
52
54
|
maxCallsPerTurn: z.number().int().positive().optional(),
|
|
53
55
|
timeoutMs: z.number().int().positive().optional()
|
|
54
56
|
}).strict();
|
|
@@ -58,7 +58,7 @@ const rememberCommand = {
|
|
|
58
58
|
disclosurePolicy: "referenceable",
|
|
59
59
|
observedAt: Date.now(),
|
|
60
60
|
createdBy: "user"
|
|
61
|
-
});
|
|
61
|
+
}, Date.now(), { restoreDeleted: true });
|
|
62
62
|
const scopeLabel = sessionOnly ? "this conversation" : "all conversations";
|
|
63
63
|
return {
|
|
64
64
|
content: result.action === "created" ? `Remembered for ${scopeLabel}. You can review or remove it in User Model.` : `This is already remembered for ${scopeLabel}.`,
|
|
@@ -53,7 +53,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
53
53
|
id: "database-schema",
|
|
54
54
|
label: "Database schema",
|
|
55
55
|
status: "pass",
|
|
56
|
-
message: `SQLite schema v${status.dbVersion} (current release
|
|
56
|
+
message: `SQLite schema v${status.dbVersion} (current release v186).`,
|
|
57
57
|
hints: []
|
|
58
58
|
};
|
|
59
59
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_paths, resolveConfigPath } from "../../../config/paths.js";
|
|
2
2
|
import { loadConfig } from "../../../config/loader.js";
|
|
3
3
|
import "../../../config/index.js";
|
|
4
|
-
import { resolveGatewayService } from "../../../daemon/service.js";
|
|
5
4
|
import { isRestartEnabled } from "../../../config/commands.flags.js";
|
|
5
|
+
import { resolveGatewayService } from "../../../daemon/service.js";
|
|
6
6
|
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "../../../infra/restart.js";
|
|
7
7
|
import { findVerifiedGatewayListenerPidsOnPortSync, formatGatewayPidList, signalVerifiedGatewayPidSync } from "../../../infra/gateway-processes.js";
|
|
8
8
|
import { runServiceRestart, runServiceStop } from "./lifecycle-core.js";
|
|
@@ -100,6 +100,7 @@ export declare const AgentsConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
100
100
|
deny: "deny";
|
|
101
101
|
ask: "ask";
|
|
102
102
|
}>;
|
|
103
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
103
104
|
maxCallsPerTurn: z.ZodOptional<z.ZodNumber>;
|
|
104
105
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
105
106
|
}, z.core.$strict>>>;
|
|
@@ -187,6 +188,7 @@ export declare const AgentsConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
187
188
|
deny: "deny";
|
|
188
189
|
ask: "ask";
|
|
189
190
|
}>;
|
|
191
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
190
192
|
maxCallsPerTurn: z.ZodOptional<z.ZodNumber>;
|
|
191
193
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
192
194
|
}, z.core.$strict>>>;
|
|
@@ -1465,7 +1467,6 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
1465
1467
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1466
1468
|
writePolicy: z.ZodDefault<z.ZodEnum<{
|
|
1467
1469
|
allow: "allow";
|
|
1468
|
-
confirm: "confirm";
|
|
1469
1470
|
deny: "deny";
|
|
1470
1471
|
}>>;
|
|
1471
1472
|
sensitiveWritePolicy: z.ZodDefault<z.ZodEnum<{
|
|
@@ -1502,11 +1503,10 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
1502
1503
|
staleRetentionDays: z.ZodDefault<z.ZodNumber>;
|
|
1503
1504
|
}, z.core.$strict>>;
|
|
1504
1505
|
}, z.core.$strict>>;
|
|
1505
|
-
knowledgeMemory: z.ZodDefault<z.
|
|
1506
|
+
knowledgeMemory: z.ZodDefault<z.ZodObject<{
|
|
1506
1507
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1507
1508
|
writePolicy: z.ZodDefault<z.ZodEnum<{
|
|
1508
1509
|
allow: "allow";
|
|
1509
|
-
confirm: "confirm";
|
|
1510
1510
|
deny: "deny";
|
|
1511
1511
|
}>>;
|
|
1512
1512
|
readScopes: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
@@ -1539,7 +1539,7 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
1539
1539
|
allowExternalWrites: z.ZodDefault<z.ZodBoolean>;
|
|
1540
1540
|
allowedProviderIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1541
1541
|
autoWriteKinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1542
|
-
}, z.core.$strict
|
|
1542
|
+
}, z.core.$strict>>;
|
|
1543
1543
|
contextPlanning: z.ZodDefault<z.ZodObject<{
|
|
1544
1544
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1545
1545
|
maxAssertions: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1612,6 +1612,7 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
1612
1612
|
deny: "deny";
|
|
1613
1613
|
ask: "ask";
|
|
1614
1614
|
}>;
|
|
1615
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
1615
1616
|
maxCallsPerTurn: z.ZodOptional<z.ZodNumber>;
|
|
1616
1617
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1617
1618
|
}, z.core.$strict>>>;
|
|
@@ -1699,6 +1700,7 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
1699
1700
|
deny: "deny";
|
|
1700
1701
|
ask: "ask";
|
|
1701
1702
|
}>;
|
|
1703
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
1702
1704
|
maxCallsPerTurn: z.ZodOptional<z.ZodNumber>;
|
|
1703
1705
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1704
1706
|
}, z.core.$strict>>>;
|
|
@@ -1054,7 +1054,7 @@ workDiscoveryOnboarding: z.boolean().default(true) }).strict().default({ workDis
|
|
|
1054
1054
|
preferences: { responseLanguage: "auto" },
|
|
1055
1055
|
userModel: {
|
|
1056
1056
|
enabled: true,
|
|
1057
|
-
writePolicy: "
|
|
1057
|
+
writePolicy: "allow",
|
|
1058
1058
|
sensitiveWritePolicy: "confirm",
|
|
1059
1059
|
processingPolicy: "remote_allowed",
|
|
1060
1060
|
extraction: {
|
|
@@ -1075,7 +1075,7 @@ workDiscoveryOnboarding: z.boolean().default(true) }).strict().default({ workDis
|
|
|
1075
1075
|
},
|
|
1076
1076
|
knowledgeMemory: {
|
|
1077
1077
|
enabled: true,
|
|
1078
|
-
writePolicy: "
|
|
1078
|
+
writePolicy: "allow",
|
|
1079
1079
|
readScopes: [
|
|
1080
1080
|
"global",
|
|
1081
1081
|
"agent",
|
|
@@ -10,6 +10,7 @@ export declare function deriveConnectedSourceUnderstanding(input: {
|
|
|
10
10
|
sourceRunId: string;
|
|
11
11
|
processingPolicy: 'local_only' | 'remote_allowed';
|
|
12
12
|
analyze?: typeof analyzeUnderstandingSources;
|
|
13
|
+
assertAuthorized?: () => void;
|
|
13
14
|
}): Promise<{
|
|
14
15
|
created: number;
|
|
15
16
|
knowledgeCount: number;
|