@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region packages/gateway-contract/src/proactive.ts
|
|
4
|
-
var ProactiveLevelSchema, ProactiveTimezoneSchema, ProactivePreferencesSchema,
|
|
4
|
+
var ProactiveLevelSchema, ProactiveTimezoneSchema, ProactivePreferencesSchema, ProactiveSubscriptionSettingsSchema, ProactiveArtifactSchema, ProactiveTaskDraftSchema;
|
|
5
5
|
var init_proactive = __esmMin((() => {
|
|
6
6
|
ProactiveLevelSchema = z.enum([
|
|
7
7
|
"quiet",
|
|
@@ -46,7 +46,7 @@ var init_proactive = __esmMin((() => {
|
|
|
46
46
|
notificationsMuted: z.boolean().default(false),
|
|
47
47
|
revision: z.number().int().nonnegative().default(0)
|
|
48
48
|
});
|
|
49
|
-
|
|
49
|
+
z.object({
|
|
50
50
|
level: ProactivePreferencesSchema.shape.level.removeDefault().optional(),
|
|
51
51
|
timezone: ProactivePreferencesSchema.shape.timezone.removeDefault().optional(),
|
|
52
52
|
quietStartHour: ProactivePreferencesSchema.shape.quietStartHour.removeDefault().optional(),
|
|
@@ -74,13 +74,13 @@ var init_proactive = __esmMin((() => {
|
|
|
74
74
|
scanIntervalMinutes: z.number().int().min(15).max(10080).nullable().default(null),
|
|
75
75
|
userInstructions: z.string().max(12e3).default("")
|
|
76
76
|
});
|
|
77
|
-
|
|
77
|
+
ProactiveSubscriptionSettingsSchema.extend({
|
|
78
78
|
scenarioKey: z.string().min(1).max(100),
|
|
79
79
|
scopeKind: z.enum(["workspace", "project"]),
|
|
80
80
|
scopeId: z.string().min(1).max(200),
|
|
81
81
|
enabled: z.boolean().default(true)
|
|
82
82
|
}).strict();
|
|
83
|
-
|
|
83
|
+
z.object({
|
|
84
84
|
level: ProactiveSubscriptionSettingsSchema.shape.level.removeDefault().optional(),
|
|
85
85
|
delivery: ProactiveSubscriptionSettingsSchema.shape.delivery.removeDefault().optional(),
|
|
86
86
|
completedAt: ProactiveSubscriptionSettingsSchema.shape.completedAt.removeDefault().optional(),
|
|
@@ -102,7 +102,7 @@ var init_proactive = __esmMin((() => {
|
|
|
102
102
|
title: z.string().trim().min(1).max(160),
|
|
103
103
|
objective: z.string().trim().min(1).max(1200)
|
|
104
104
|
}).strict();
|
|
105
|
-
|
|
105
|
+
z.object({
|
|
106
106
|
actionId: z.enum([
|
|
107
107
|
"read",
|
|
108
108
|
"resolve",
|
|
@@ -133,4 +133,4 @@ var init_proactive = __esmMin((() => {
|
|
|
133
133
|
}));
|
|
134
134
|
//#endregion
|
|
135
135
|
init_proactive();
|
|
136
|
-
export { ProactiveArtifactSchema,
|
|
136
|
+
export { ProactiveArtifactSchema, ProactiveLevelSchema, ProactivePreferencesSchema, ProactiveSubscriptionSettingsSchema, ProactiveTaskDraftSchema, ProactiveTimezoneSchema, init_proactive };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region packages/gateway-contract/src/project-monitoring.ts
|
|
4
|
-
var MonitoringModeSchema, QuietHoursSchema
|
|
4
|
+
var MonitoringModeSchema, QuietHoursSchema;
|
|
5
5
|
var init_project_monitoring = __esmMin((() => {
|
|
6
6
|
MonitoringModeSchema = z.enum([
|
|
7
7
|
"observe",
|
|
@@ -13,7 +13,7 @@ var init_project_monitoring = __esmMin((() => {
|
|
|
13
13
|
endHour: z.number().int().min(0).max(23),
|
|
14
14
|
timezone: z.string().min(1)
|
|
15
15
|
});
|
|
16
|
-
|
|
16
|
+
z.object({
|
|
17
17
|
projectId: z.string(),
|
|
18
18
|
mode: MonitoringModeSchema,
|
|
19
19
|
quietHours: QuietHoursSchema.optional(),
|
|
@@ -23,7 +23,7 @@ var init_project_monitoring = __esmMin((() => {
|
|
|
23
23
|
configured: z.boolean(),
|
|
24
24
|
updatedAt: z.number().optional()
|
|
25
25
|
});
|
|
26
|
-
|
|
26
|
+
z.object({
|
|
27
27
|
mode: MonitoringModeSchema.optional(),
|
|
28
28
|
quietHours: QuietHoursSchema.nullable().optional(),
|
|
29
29
|
allowedActions: z.array(z.string()).optional(),
|
|
@@ -33,4 +33,4 @@ var init_project_monitoring = __esmMin((() => {
|
|
|
33
33
|
}));
|
|
34
34
|
//#endregion
|
|
35
35
|
init_project_monitoring();
|
|
36
|
-
export { MonitoringModeSchema,
|
|
36
|
+
export { MonitoringModeSchema, QuietHoursSchema, init_project_monitoring };
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { TaskAttentionItemSchema, TaskOperationalStateSchema, TaskPhaseSchema, TaskResolutionSchema } from "./task-lifecycle.js";
|
|
3
3
|
import { TaskDependencySummarySchema, TaskPrioritySchema, TaskRunReceiptSchema, init_tasks } from "./tasks.js";
|
|
4
|
-
import { ProjectMonitoringPolicySchema, init_project_monitoring } from "./project-monitoring.js";
|
|
5
4
|
import { z } from "zod";
|
|
6
5
|
//#region packages/gateway-contract/src/project-operating.ts
|
|
7
6
|
var ProjectSummarySchema, ProjectTaskDependencyEdgeSchema, ProjectTaskCardSchema;
|
|
8
7
|
var init_project_operating = __esmMin((() => {
|
|
9
8
|
init_tasks();
|
|
10
|
-
init_project_monitoring();
|
|
11
9
|
ProjectSummarySchema = z.object({
|
|
12
10
|
id: z.string(),
|
|
13
11
|
name: z.string(),
|
|
@@ -91,8 +89,7 @@ var init_project_operating = __esmMin((() => {
|
|
|
91
89
|
]),
|
|
92
90
|
summary: z.string(),
|
|
93
91
|
recommendedAction: z.string().optional()
|
|
94
|
-
})
|
|
95
|
-
monitoring: ProjectMonitoringPolicySchema
|
|
92
|
+
})
|
|
96
93
|
});
|
|
97
94
|
}));
|
|
98
95
|
//#endregion
|
|
@@ -138,7 +138,12 @@ var init_sessions = __esmMin((() => {
|
|
|
138
138
|
offset: z.number(),
|
|
139
139
|
hasMore: z.boolean()
|
|
140
140
|
}),
|
|
141
|
-
inbox: sessionsListResponseSchema
|
|
141
|
+
inbox: sessionsListResponseSchema,
|
|
142
|
+
pinned: z.array(z.unknown()).default([]),
|
|
143
|
+
layouts: z.record(z.string(), z.object({
|
|
144
|
+
itemIds: z.array(z.string()),
|
|
145
|
+
revision: z.number().int().nonnegative()
|
|
146
|
+
})).default({})
|
|
142
147
|
}).passthrough();
|
|
143
148
|
}));
|
|
144
149
|
//#endregion
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Agent Manager - Manages Agent instances per session
|
|
3
|
-
*
|
|
4
|
-
* Each session gets its own Agent instance for true isolation
|
|
5
|
-
* and concurrent processing across sessions.
|
|
6
|
-
*/
|
|
1
|
+
import type { SceneAccess } from '../scenes/httpServices.js';
|
|
7
2
|
import { Agent, type AgentMessage, type AgentEvent, type ThinkingLevel } from '@earendil-works/pi-agent-core';
|
|
8
3
|
import type { AgentInstanceGateway } from './agent-instance-gateway.js';
|
|
9
4
|
import { type Config } from '../config/schema.js';
|
|
@@ -95,6 +90,7 @@ export interface AgentManagerConfig {
|
|
|
95
90
|
};
|
|
96
91
|
/** Gateway: exposes AutomationService for the `automation` tool. */
|
|
97
92
|
getAutomationService?: () => AutomationService | undefined;
|
|
93
|
+
getSceneAccess?: () => SceneAccess | undefined;
|
|
98
94
|
getBrowserAutomationService?: () => import('../browser/automations/index.js').BrowserAutomationService | undefined;
|
|
99
95
|
emitBrowserEvent?: (type: string, payload: unknown) => void;
|
|
100
96
|
/** Gateway: exposes first-class xopc product objects for the `xopc_use` tool. */
|
|
@@ -4,7 +4,7 @@ import { init_logger } from "../utils/logger.js";
|
|
|
4
4
|
import { isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
|
|
5
5
|
import { consumeClarificationApproval } from "../storage/sqlite/clarification-wait-repository.js";
|
|
6
6
|
import { getInteractionState } from "../storage/sqlite/interaction-state-repository.js";
|
|
7
|
-
import { getSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
7
|
+
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
8
8
|
import "../storage/sqlite/index.js";
|
|
9
9
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
10
10
|
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
@@ -262,6 +262,7 @@ var AgentManager = class {
|
|
|
262
262
|
getSessionStore: this.config.getSessionStore,
|
|
263
263
|
gatewayClarify: this.config.gatewayClarify,
|
|
264
264
|
getAutomationService: this.config.getAutomationService,
|
|
265
|
+
getSceneAccess: this.config.getSceneAccess,
|
|
265
266
|
getBrowserAutomationService: this.config.getBrowserAutomationService,
|
|
266
267
|
emitBrowserEvent: this.config.emitBrowserEvent,
|
|
267
268
|
getNotesService: this.config.getNotesService,
|
|
@@ -967,6 +968,8 @@ var AgentManager = class {
|
|
|
967
968
|
conversationId,
|
|
968
969
|
disabledTools: profile.tools.denied,
|
|
969
970
|
getPrimaryModel: () => agent?.state.model ?? model,
|
|
971
|
+
getParentTools: () => agent?.state.tools ?? [],
|
|
972
|
+
createDelegationPolicy: () => this.createAgentTurnPolicy(conversationId),
|
|
970
973
|
getMemoryManager: () => rt.memoryManager,
|
|
971
974
|
getSkillManager: () => rt.skillManager
|
|
972
975
|
});
|
|
@@ -1009,11 +1012,12 @@ var AgentManager = class {
|
|
|
1009
1012
|
};
|
|
1010
1013
|
}
|
|
1011
1014
|
buildAgentTurnPolicy(conversationId, profile) {
|
|
1015
|
+
const currentProfile = () => resolveEffectiveAgentProfileForSession(this.config.config, conversationId);
|
|
1012
1016
|
return createAgentTurnPolicy({
|
|
1013
1017
|
maxTurns: profile.config.runtime.maxTurns,
|
|
1014
1018
|
maxToolFailures: profile.config.runtime.maxToolFailuresPerTurn,
|
|
1015
1019
|
resolveToolLimit: (toolName, args) => {
|
|
1016
|
-
const policy = this.resolveToolPolicy(
|
|
1020
|
+
const policy = this.resolveToolPolicy(currentProfile(), toolName, args);
|
|
1017
1021
|
const maxCalls = policy?.maxCallsPerTurn;
|
|
1018
1022
|
return policy && maxCalls ? {
|
|
1019
1023
|
id: policy.id,
|
|
@@ -1039,8 +1043,12 @@ var AgentManager = class {
|
|
|
1039
1043
|
reason: decision.reason ?? "Blocked by collaboration rule."
|
|
1040
1044
|
};
|
|
1041
1045
|
}
|
|
1042
|
-
const policy = this.resolveToolPolicy(
|
|
1046
|
+
const policy = this.resolveToolPolicy(currentProfile(), toolName, args);
|
|
1043
1047
|
const detail = JSON.stringify(args ?? {});
|
|
1048
|
+
if (policy?.mode === "deny") return {
|
|
1049
|
+
block: true,
|
|
1050
|
+
reason: `${policy.id} is denied by tool policy.`
|
|
1051
|
+
};
|
|
1044
1052
|
if (policy?.mode === "ask") {
|
|
1045
1053
|
if (!await this.requestToolConfirmation(conversationId, policy?.id ?? toolName, detail)) return {
|
|
1046
1054
|
block: true,
|
|
@@ -1082,6 +1090,11 @@ var AgentManager = class {
|
|
|
1082
1090
|
});
|
|
1083
1091
|
}
|
|
1084
1092
|
resolveToolPolicy(profile, toolName, args) {
|
|
1093
|
+
const gatewayPolicy = profile.config.tools[toolName];
|
|
1094
|
+
if (gatewayPolicy && gatewayPolicy.mode !== "allow") return {
|
|
1095
|
+
id: toolName,
|
|
1096
|
+
...gatewayPolicy
|
|
1097
|
+
};
|
|
1085
1098
|
if (toolName !== "xopc_tool_execute") {
|
|
1086
1099
|
const policy = profile.config.tools[toolName];
|
|
1087
1100
|
return policy ? {
|
|
@@ -1089,13 +1102,26 @@ var AgentManager = class {
|
|
|
1089
1102
|
...policy
|
|
1090
1103
|
} : void 0;
|
|
1091
1104
|
}
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1105
|
+
const toolRef = typeof args?.toolRef === "string" ? args.toolRef : "";
|
|
1106
|
+
const parsed = parseExternalToolRef(toolRef, "mcp");
|
|
1107
|
+
if (!parsed) {
|
|
1108
|
+
const externalPolicy = profile.config.tools[toolRef];
|
|
1109
|
+
return externalPolicy ? {
|
|
1110
|
+
id: toolRef,
|
|
1111
|
+
...externalPolicy
|
|
1112
|
+
} : gatewayPolicy ? {
|
|
1113
|
+
id: toolName,
|
|
1114
|
+
...gatewayPolicy
|
|
1115
|
+
} : void 0;
|
|
1116
|
+
}
|
|
1094
1117
|
const id = mcpToolPolicyId(parsed.namespace, parsed.toolName);
|
|
1095
1118
|
const policy = profile.config.tools[id];
|
|
1096
1119
|
return policy ? {
|
|
1097
1120
|
id,
|
|
1098
1121
|
...policy
|
|
1122
|
+
} : gatewayPolicy ? {
|
|
1123
|
+
id: toolName,
|
|
1124
|
+
...gatewayPolicy
|
|
1099
1125
|
} : void 0;
|
|
1100
1126
|
}
|
|
1101
1127
|
async requestToolConfirmation(conversationId, toolName, detail) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { finishContextExtractionRun } from "../../storage/sqlite/context-extraction-repository.js";
|
|
4
|
-
import { getSessionMetadata } from "../../storage/sqlite/session-repository.js";
|
|
4
|
+
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
5
5
|
import { loadCompactionSourceSnapshot } from "../../storage/sqlite/transcript-repository.js";
|
|
6
6
|
import "../../storage/sqlite/index.js";
|
|
7
7
|
import { extractProfileAgentId } from "../../config/agent-profile.js";
|
|
@@ -30,6 +30,7 @@ export interface DelegateChildProgressHooks {
|
|
|
30
30
|
}) => void;
|
|
31
31
|
}
|
|
32
32
|
export interface DelegateChildHandleOptions {
|
|
33
|
+
authorizeToolCall?: import('./orchestration/agent-turn-policy.js').AgentTurnPolicyOptions['authorizeToolCall'];
|
|
33
34
|
workspace: string;
|
|
34
35
|
goal: string;
|
|
35
36
|
context?: string;
|
|
@@ -29,14 +29,20 @@ function createDelegateChildHandle(options) {
|
|
|
29
29
|
agentId: options.agentId,
|
|
30
30
|
getConfig: options.getConfig,
|
|
31
31
|
toolExecutorConfig: options.toolExecutorConfig,
|
|
32
|
-
browserConversationId: options.requesterConversationId ?? conversationId
|
|
32
|
+
browserConversationId: options.requesterConversationId ?? options.conversationId
|
|
33
33
|
}).filter((tool) => allow.has(tool.name));
|
|
34
34
|
const limit = Math.min(60, Math.max(1, Math.floor(options.maxIterations)));
|
|
35
35
|
let toolIterations = 0, exhausted = false, tokens = 0;
|
|
36
|
+
let terminationReason;
|
|
36
37
|
const policy = createAgentTurnPolicy({
|
|
37
38
|
maxTurns: limit + 1,
|
|
38
39
|
maxToolFailures: 5,
|
|
39
|
-
authorizeToolCall: async () => {
|
|
40
|
+
authorizeToolCall: async (context, signal) => {
|
|
41
|
+
const { toolCall } = context;
|
|
42
|
+
if (!allow.has(toolCall.name)) return {
|
|
43
|
+
block: true,
|
|
44
|
+
reason: "Tool is outside the delegated capability set."
|
|
45
|
+
};
|
|
40
46
|
if (toolIterations >= limit || tokens >= 1e5) {
|
|
41
47
|
exhausted = true;
|
|
42
48
|
return {
|
|
@@ -45,7 +51,15 @@ function createDelegateChildHandle(options) {
|
|
|
45
51
|
reason: "Sub-agent budget exhausted."
|
|
46
52
|
};
|
|
47
53
|
}
|
|
48
|
-
toolIterations++;
|
|
54
|
+
if (toolCall.name !== "data_batch") toolIterations++;
|
|
55
|
+
const decision = await options.authorizeToolCall?.(context, signal);
|
|
56
|
+
if (decision?.block) {
|
|
57
|
+
if (decision.terminate) {
|
|
58
|
+
exhausted = true;
|
|
59
|
+
terminationReason = decision.reason;
|
|
60
|
+
}
|
|
61
|
+
return decision;
|
|
62
|
+
}
|
|
49
63
|
}
|
|
50
64
|
});
|
|
51
65
|
const baseStop = policy.shouldStopAfterTurn;
|
|
@@ -118,7 +132,7 @@ function createDelegateChildHandle(options) {
|
|
|
118
132
|
const proof = verification?.type === "custom" ? verification.data : void 0;
|
|
119
133
|
const unverified = options.verifyChanges && proof?.changed && (!proof.evidence.some((item) => item.kind === "check" && item.status === "passed") || proof.evidence.some((item) => item.status !== "passed"));
|
|
120
134
|
return {
|
|
121
|
-
summary: result.lastAssistantText || result.errorMessage || (exhausted ? "Sub-agent budget exhausted." : "(no final response)"),
|
|
135
|
+
summary: [result.lastAssistantText || result.errorMessage, terminationReason].filter(Boolean).join("\n\n") || (exhausted ? "Sub-agent budget exhausted." : "(no final response)"),
|
|
122
136
|
toolIterations,
|
|
123
137
|
messages: await runtime.loadMessages(),
|
|
124
138
|
status: controller.signal.aborted ? "cancelled" : !result.ok ? "failed" : exhausted || unverified ? "partial" : "success",
|
|
@@ -8,5 +8,9 @@ export declare class RepositoryInstructions {
|
|
|
8
8
|
private constructor();
|
|
9
9
|
static open(workspace: string): Promise<RepositoryInstructions>;
|
|
10
10
|
forTool(name: string, input: unknown): Promise<string>;
|
|
11
|
+
forDataResult(content: Array<{
|
|
12
|
+
type: string;
|
|
13
|
+
text?: string;
|
|
14
|
+
}>): Promise<string>;
|
|
11
15
|
load(path: string, directory: boolean): Promise<string>;
|
|
12
16
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { validateDataBatch } from "../data-acquisition/schema.js";
|
|
2
|
+
import { isDataBatchResult } from "../data-acquisition/render.js";
|
|
3
|
+
import { basename, dirname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
2
4
|
import { execFile } from "node:child_process";
|
|
3
5
|
import { promisify } from "node:util";
|
|
4
6
|
import { readFile, realpath, stat } from "node:fs/promises";
|
|
@@ -35,6 +37,22 @@ var RepositoryInstructions = class RepositoryInstructions {
|
|
|
35
37
|
return new RepositoryInstructions(root, canonicalWorkspace);
|
|
36
38
|
}
|
|
37
39
|
async forTool(name, input) {
|
|
40
|
+
if (name === "data_batch") {
|
|
41
|
+
validateDataBatch(input);
|
|
42
|
+
const sections = [];
|
|
43
|
+
for (const operation of input.operations) {
|
|
44
|
+
const paths = operation.kind === "file_read" || operation.kind === "git_read" ? [operation.path] : operation.kind === "file_search" ? operation.paths : operation.kind === "git_recent" ? operation.paths ?? ["."] : [];
|
|
45
|
+
for (const path of paths) {
|
|
46
|
+
let directory = false;
|
|
47
|
+
try {
|
|
48
|
+
directory = (await stat(resolve(this.workspace, path))).isDirectory();
|
|
49
|
+
} catch {}
|
|
50
|
+
const section = await this.load(path, directory);
|
|
51
|
+
if (section && !sections.includes(section)) sections.push(section);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return sections.join("\n\n");
|
|
55
|
+
}
|
|
38
56
|
const args = input && typeof input === "object" ? input : {};
|
|
39
57
|
if (name === "apply_patch") {
|
|
40
58
|
const paths = [...String(args.patch ?? "").matchAll(/^\*\*\* (?:Add File|Update File|Delete File|Move to): (.+)$/gm)].map((match) => match[1].trim());
|
|
@@ -44,8 +62,34 @@ var RepositoryInstructions = class RepositoryInstructions {
|
|
|
44
62
|
if (name === "exec_command" || name === "managed_job" && args.action === "start") return this.load(typeof args.cwd === "string" ? args.cwd : ".", true);
|
|
45
63
|
return "";
|
|
46
64
|
}
|
|
65
|
+
async forDataResult(content) {
|
|
66
|
+
const sections = /* @__PURE__ */ new Set();
|
|
67
|
+
for (const block of content) {
|
|
68
|
+
if (block.type !== "text" || !block.text) continue;
|
|
69
|
+
let result;
|
|
70
|
+
try {
|
|
71
|
+
result = JSON.parse(block.text);
|
|
72
|
+
} catch {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (!isDataBatchResult(result)) continue;
|
|
76
|
+
for (const fragment of result.fragments) {
|
|
77
|
+
if (fragment.source.kind !== "file") continue;
|
|
78
|
+
const section = await this.load(fragment.source.resource, false);
|
|
79
|
+
if (section) sections.add(section);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return [...sections].join("\n\n");
|
|
83
|
+
}
|
|
47
84
|
async load(path, directory) {
|
|
48
|
-
|
|
85
|
+
let target = resolve(this.workspace, path);
|
|
86
|
+
try {
|
|
87
|
+
target = await realpath(target);
|
|
88
|
+
} catch {
|
|
89
|
+
try {
|
|
90
|
+
target = resolve(await realpath(dirname(target)), basename(target));
|
|
91
|
+
} catch {}
|
|
92
|
+
}
|
|
49
93
|
if (!inside(this.root, target)) return "";
|
|
50
94
|
const leaf = directory ? target : dirname(target);
|
|
51
95
|
const directories = [];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolveStateDir } from "../../config/paths-state.js";
|
|
2
2
|
import { init_global_singleton, resolveGlobalSingleton } from "../../utils/global-singleton.js";
|
|
3
3
|
import { init_paths } from "../../config/paths.js";
|
|
4
|
-
import { DurableState } from "../../storage/sqlite/durable-state.js";
|
|
5
4
|
import { spawnProcess } from "../../process/run-process.js";
|
|
5
|
+
import { DurableState } from "../../storage/sqlite/durable-state.js";
|
|
6
6
|
import { isolatedCommand, removeCommandContainer } from "./command-isolation.js";
|
|
7
7
|
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
8
8
|
import { join } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
|
|
2
|
-
import { getSessionMetadata } from "../../storage/sqlite/session-repository.js";
|
|
2
|
+
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
3
3
|
import "../../storage/sqlite/index.js";
|
|
4
4
|
import { sanitizeForPromptLiteral } from "../prompt/sanitize-for-prompt.js";
|
|
5
5
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type GitDataOperation = {
|
|
2
|
+
kind: 'git_recent';
|
|
3
|
+
paths?: string[];
|
|
4
|
+
since?: string;
|
|
5
|
+
until?: string;
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'git_read';
|
|
8
|
+
path: string;
|
|
9
|
+
commit: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function readGitData(workspace: string, operation: GitDataOperation, signal: AbortSignal, onRequest: () => void): Promise<{
|
|
12
|
+
text: string;
|
|
13
|
+
resource: string;
|
|
14
|
+
revision: string;
|
|
15
|
+
exhausted: boolean;
|
|
16
|
+
reason: string;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { runProcess } from "../../process/run-process.js";
|
|
2
|
+
import { evaluateExecPolicy } from "../sandbox/exec-policy.js";
|
|
3
|
+
import { checkedFilePath } from "../sandbox/fileAccess.js";
|
|
4
|
+
import { dataScheduler } from "./scheduler.js";
|
|
5
|
+
import { relative, resolve, sep } from "node:path";
|
|
6
|
+
//#region src/agent/data-acquisition/git.ts
|
|
7
|
+
async function readGitData(workspace, operation, signal, onRequest) {
|
|
8
|
+
const cwd = checkedFilePath(workspace, workspace, "read");
|
|
9
|
+
const policy = evaluateExecPolicy({
|
|
10
|
+
command: "git log",
|
|
11
|
+
cwd,
|
|
12
|
+
workspaceRoot: workspace
|
|
13
|
+
});
|
|
14
|
+
if (!policy.allowed) throw new Error(`Sandbox: ${policy.reason}`);
|
|
15
|
+
const env = Object.fromEntries(Object.entries(policy.sanitizedEnv).filter(([key]) => !key.startsWith("GIT_")));
|
|
16
|
+
env.GIT_CONFIG_NOSYSTEM = "1";
|
|
17
|
+
env.GIT_CONFIG_GLOBAL = process.platform === "win32" ? "NUL" : "/dev/null";
|
|
18
|
+
env.GIT_OPTIONAL_LOCKS = "0";
|
|
19
|
+
const run = async (args) => dataScheduler.run(cwd, signal, async () => {
|
|
20
|
+
onRequest();
|
|
21
|
+
const result = await runProcess({
|
|
22
|
+
program: "git",
|
|
23
|
+
args: [
|
|
24
|
+
"--no-pager",
|
|
25
|
+
"--literal-pathspecs",
|
|
26
|
+
"-c",
|
|
27
|
+
"core.fsmonitor=false",
|
|
28
|
+
"-c",
|
|
29
|
+
"core.hooksPath=/dev/null",
|
|
30
|
+
...args
|
|
31
|
+
],
|
|
32
|
+
cwd,
|
|
33
|
+
env,
|
|
34
|
+
signal,
|
|
35
|
+
timeoutMs: 5e3,
|
|
36
|
+
maxOutputBytes: 64 * 1024,
|
|
37
|
+
terminationPolicy: "tree"
|
|
38
|
+
});
|
|
39
|
+
signal.throwIfAborted();
|
|
40
|
+
if (result.exitCode !== 0 || result.timedOut) throw new Error(result.stderr || "Git data is unavailable");
|
|
41
|
+
return result;
|
|
42
|
+
});
|
|
43
|
+
if (operation.kind === "git_read") {
|
|
44
|
+
const target = checkedFilePath(workspace, resolve(workspace, operation.path), "read");
|
|
45
|
+
const path = relative((await run(["rev-parse", "--show-toplevel"])).stdout.trim(), target).split(sep).join("/");
|
|
46
|
+
if (path.startsWith("../") || path === "..") throw new Error("Git file must be inside the repository");
|
|
47
|
+
const result = await run([
|
|
48
|
+
"show",
|
|
49
|
+
"--no-ext-diff",
|
|
50
|
+
"--no-textconv",
|
|
51
|
+
`${operation.commit}:${path}`
|
|
52
|
+
]);
|
|
53
|
+
if (result.stdout.includes("\0")) throw new Error("Git object is binary; use a format-specific tool");
|
|
54
|
+
return {
|
|
55
|
+
text: result.stdout,
|
|
56
|
+
resource: target,
|
|
57
|
+
revision: operation.commit,
|
|
58
|
+
exhausted: !result.outputTruncated,
|
|
59
|
+
reason: result.outputTruncated ? "output_budget" : void 0
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const paths = (operation.paths ?? ["."]).map((path) => checkedFilePath(workspace, resolve(workspace, path), "read"));
|
|
63
|
+
for (const value of [operation.since, operation.until]) if (value && !Number.isFinite(Date.parse(value))) throw new Error("Invalid Git date");
|
|
64
|
+
const head = (await run([
|
|
65
|
+
"rev-parse",
|
|
66
|
+
"--verify",
|
|
67
|
+
"HEAD"
|
|
68
|
+
])).stdout.trim();
|
|
69
|
+
const shallow = (await run(["rev-parse", "--is-shallow-repository"])).stdout.trim() === "true";
|
|
70
|
+
const recent = await run([
|
|
71
|
+
"log",
|
|
72
|
+
"--no-ext-diff",
|
|
73
|
+
"--no-textconv",
|
|
74
|
+
"--format=%H %cI %s",
|
|
75
|
+
"-21",
|
|
76
|
+
...operation.since ? [`--since=${operation.since}`] : [],
|
|
77
|
+
...operation.until ? [`--until=${operation.until}`] : [],
|
|
78
|
+
"HEAD",
|
|
79
|
+
"--",
|
|
80
|
+
...paths
|
|
81
|
+
]);
|
|
82
|
+
const rows = recent.stdout.trim().split("\n").filter(Boolean);
|
|
83
|
+
const dirty = (await run([
|
|
84
|
+
"status",
|
|
85
|
+
"--porcelain",
|
|
86
|
+
"--untracked-files=normal",
|
|
87
|
+
"--",
|
|
88
|
+
...paths
|
|
89
|
+
])).stdout.length > 0;
|
|
90
|
+
const omitted = recent.outputTruncated || rows.length > 20;
|
|
91
|
+
return {
|
|
92
|
+
text: `HEAD: ${head}\nDirty worktree: ${dirty}\nShallow history: ${shallow}\n${rows.slice(0, 20).join("\n")}`,
|
|
93
|
+
resource: cwd,
|
|
94
|
+
revision: head,
|
|
95
|
+
exhausted: !omitted && !shallow,
|
|
96
|
+
reason: omitted ? "output_budget" : shallow ? "shallow_history" : void 0
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
export { readGitData };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type DataBatchResult } from './types.js';
|
|
2
|
+
/** Keep a valid envelope and explicit omissions even under a second context reduction. */
|
|
3
|
+
export declare function renderDataBatch(input: DataBatchResult, maxChars?: number): {
|
|
4
|
+
text: string;
|
|
5
|
+
result: DataBatchResult;
|
|
6
|
+
};
|
|
7
|
+
export declare function isDataBatchResult(value: unknown): value is DataBatchResult;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { DATA_MAX_CHARS } from "./types.js";
|
|
2
|
+
//#region src/agent/data-acquisition/render.ts
|
|
3
|
+
/** Keep a valid envelope and explicit omissions even under a second context reduction. */
|
|
4
|
+
function renderDataBatch(input, maxChars = DATA_MAX_CHARS) {
|
|
5
|
+
const result = structuredClone(input);
|
|
6
|
+
const omitted = /* @__PURE__ */ new Set();
|
|
7
|
+
const encode = () => JSON.stringify(result);
|
|
8
|
+
const mark = () => {
|
|
9
|
+
for (const operation of result.operations) {
|
|
10
|
+
operation.fragmentIds = operation.fragmentIds.filter((id) => result.fragments.some((fragment) => fragment.id === id));
|
|
11
|
+
if (omitted.has(operation.id)) {
|
|
12
|
+
operation.outputOmitted = true;
|
|
13
|
+
if (operation.status === "ok") operation.status = "partial";
|
|
14
|
+
operation.reason ??= "output_budget";
|
|
15
|
+
if (operation.kind === "file_read") {
|
|
16
|
+
const original = input.fragments.find((fragment) => fragment.operationIds.includes(operation.id));
|
|
17
|
+
const kept = result.fragments.find((fragment) => fragment.operationIds.includes(operation.id));
|
|
18
|
+
if (original?.startLine !== void 0) operation.next = {
|
|
19
|
+
path: original.source.resource,
|
|
20
|
+
startLine: kept?.endLine !== void 0 ? kept.endLine + 1 : original.startLine,
|
|
21
|
+
maxLines: operation.next?.maxLines ?? 120
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
let text = encode();
|
|
28
|
+
while (text.length > maxChars || Buffer.byteLength(text) > 32768) {
|
|
29
|
+
const nonempty = result.fragments.filter((fragment) => fragment.text.length > 0);
|
|
30
|
+
if (nonempty.length) {
|
|
31
|
+
for (const fragment of nonempty) {
|
|
32
|
+
fragment.operationIds.forEach((id) => omitted.add(id));
|
|
33
|
+
const lines = fragment.text.split("\n");
|
|
34
|
+
if (lines.length > 1) {
|
|
35
|
+
fragment.text = lines.slice(0, Math.floor(lines.length / 2)).join("\n");
|
|
36
|
+
if (fragment.startLine !== void 0) fragment.endLine = fragment.startLine + fragment.text.split("\n").length - 1;
|
|
37
|
+
} else fragment.text = "";
|
|
38
|
+
}
|
|
39
|
+
result.fragments = result.fragments.filter((fragment) => fragment.text.length > 0);
|
|
40
|
+
} else {
|
|
41
|
+
for (const operation of result.operations) {
|
|
42
|
+
operation.scope = "";
|
|
43
|
+
operation.reason = operation.reason?.slice(0, 80);
|
|
44
|
+
delete operation.next;
|
|
45
|
+
}
|
|
46
|
+
mark();
|
|
47
|
+
for (const operation of result.operations) delete operation.next;
|
|
48
|
+
text = encode();
|
|
49
|
+
if (text.length <= maxChars && Buffer.byteLength(text) <= 32768) break;
|
|
50
|
+
text = JSON.stringify({
|
|
51
|
+
status: "partial",
|
|
52
|
+
reason: "output_budget",
|
|
53
|
+
operations: result.operations.map((op) => ({
|
|
54
|
+
id: op.id,
|
|
55
|
+
status: op.status
|
|
56
|
+
}))
|
|
57
|
+
});
|
|
58
|
+
if (text.length > maxChars) text = "{\"status\":\"partial\"}";
|
|
59
|
+
if (text.length > maxChars) text = "";
|
|
60
|
+
return {
|
|
61
|
+
text,
|
|
62
|
+
result
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
mark();
|
|
66
|
+
text = encode();
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
text,
|
|
70
|
+
result
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function isDataBatchResult(value) {
|
|
74
|
+
if (!value || typeof value !== "object") return false;
|
|
75
|
+
const item = value;
|
|
76
|
+
return item.schemaVersion === 1 && Array.isArray(item.operations) && item.operations.length <= 8 && item.operations.every((op) => op && typeof op.id === "string" && Array.isArray(op.fragmentIds) && typeof op.scope === "string") && Array.isArray(item.fragments) && item.fragments.length <= 256 && item.fragments.every((fragment) => fragment && typeof fragment.text === "string" && Array.isArray(fragment.operationIds) && fragment.source && typeof fragment.source.kind === "string" && typeof fragment.source.resource === "string");
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
export { isDataBatchResult, renderDataBatch };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Shared limits across batches and callers; queued cancellation never consumes a permit. */
|
|
2
|
+
export declare class DataScheduler {
|
|
3
|
+
private readonly totalLimit;
|
|
4
|
+
private readonly resourceLimit;
|
|
5
|
+
private readonly running;
|
|
6
|
+
private readonly queue;
|
|
7
|
+
private active;
|
|
8
|
+
constructor(totalLimit?: number, resourceLimit?: number);
|
|
9
|
+
run<T>(key: string, signal: AbortSignal | undefined, task: () => Promise<T>): Promise<T>;
|
|
10
|
+
private drain;
|
|
11
|
+
}
|
|
12
|
+
export declare const dataScheduler: DataScheduler;
|