@xopcai/xopc 0.0.276 → 0.0.278
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
- package/dist/extensions/feishu/src/outbound/media-load.js +2 -2
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/outbound-sender.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +12 -12
- package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
- package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-sj_1IC5H.js → agent-avatar-dicebear-lRVOwbrK.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DAqn5DdL.js +1 -0
- package/dist/gateway/static/root/assets/{agents-CIzev0Qj.js → agents-DNQNTDkU.js} +1 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-oHTY5PDs.js +1 -0
- package/dist/gateway/static/root/assets/{appearance-settings-BeXvF-dZ.js → appearance-settings-B0YnZ3ig.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-Bh0etSmL.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BSgaIIGE.js → archive-plugin-D4x142le.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CGNt02hP.js → attachment-load-zibD2Hod.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DoafJiVA.js → automations-page-Dkp7gp_S.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-w4McwueN.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BsAL26Aq.js → binary-plugins-CfUzu1Hc.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BxB7m8aI.js → block-editor-r5nCBBan.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-DGCqIPXT.js → browser-automation-inputs-DcVLoIzc.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BNsO-Ip2.js → browser-automations-page-BnL4JnTM.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DxX-t0EJ.js +8 -0
- package/dist/gateway/static/root/assets/{button-B11EPpor.js → button-BA45yciM.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CvacBQAI.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-CJzSNo-L.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-ZCFwco1W.js → chat-terminal-dock-CWVnJtBp.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-DNBhBT0b.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-C26e13YU.js → cron-expression-CjrWuy2m.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-CpxFfgpg.js → date-picker-XjPSlgq_.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-eCIGAfHa.js → dependency-picker-CkyfEP88.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-_MSZvIDO.js → desktop-pet-BAE_NVx5.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-feBnJWkV.js → desktop-pet-settings-BUw6V2R9.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DsR5NQEC.js +1 -0
- package/dist/gateway/static/root/assets/{dist-CpzYSoz7.js → dist-BGTk37IG.js} +1 -1
- package/dist/gateway/static/root/assets/{dist-DBS3OB8K.js → dist-CI_fqRk-.js} +1 -1
- package/dist/gateway/static/root/assets/{dist-DLmwHyAh.js → dist-Che_jiQF.js} +1 -1
- package/dist/gateway/static/root/assets/es2015-DBLcMg5B.js +41 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-CotBlxJ-.js → extension-debug-page-giBeIVUT.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CFBmQ7U3.js → extension-page-Bqo9bNtx.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Cd1lfh8z.js → extension-settings-page-BX-6AA3k.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-Dil7vuyU.js +1 -0
- package/dist/gateway/static/root/assets/{heartbeat-settings-DRG0u1ON.js → heartbeat-settings-DWFAopk_.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Dpeuvazg.js +1 -0
- package/dist/gateway/static/root/assets/index-B03HGpzt.js +74 -0
- package/dist/gateway/static/root/assets/index-CXF9-BpI.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BLHsdFIQ.js → keyboard-shortcuts-settings-BKGPpBnV.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CBtemxFc.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BjAj1xhq.js → local-apps-page-B06ToOxB.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DibI1GsP.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-CPHxDaOw.js → management-settings-DJ6yMZCd.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-B2IR4E2r.js → markdown-view-DF3aJP_5.js} +4 -4
- package/dist/gateway/static/root/assets/{media-plugins-BUOzcXCL.js → media-plugins-CdrLNAks.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-GOxomxOK.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-CQBgk3_x.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-BgEYFhqS.js → page-tabs-B7LA4z-x.js} +1 -1
- package/dist/gateway/static/root/assets/popover-select-DGmMQt4t.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-C-pQIx6W.js → preview-open-alternatives-DTQRN7WR.js} +1 -1
- package/dist/gateway/static/root/assets/proactive-card-BF3741px.js +1 -0
- package/dist/gateway/static/root/assets/proactive-page-1EM217v0.js +1 -0
- package/dist/gateway/static/root/assets/product-open-page-BazdmFYo.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-B1Pm-fQd.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DUrxyNR9.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-C6VzHUwx.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DkAjFJ-9.js → runtime-tools-settings-panel-D-DZf4I1.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-BpDcuSsl.js → schema-form-B-Yj9DVW.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-DtemHfkv.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-ByEVQe0c.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-RElRijJw.js → settings-form-section-BxPUqwY6.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CaixunoA.js → settings-page-zLn8lIrs.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BwIrk3Jx.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-CC-bFOTf.js → share-preview-page-DAc_FkVc.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Dwdv6QyS.js +1 -0
- package/dist/gateway/static/root/assets/{skill-reload-api-CcOtxf53.js → skill-reload-api-CDzQWN60.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DmRvRxtY.js → skills-page-CO5XVkbY.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page.utils-BR5bk2vT.js +1 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-DRIJ5mXq.js → system-settings-panel-C0ptJutB.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-DOjcKOzQ.js +1 -0
- package/dist/gateway/static/root/assets/tunnel-api-BABuQvGD.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-Cq4--C1i.js → use-autosave-Dc5aN2px.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-UhsSP_pC.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CbJ6tKGI.js → voice-api-key-field-CY0DpJui.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-Brg9yJBr.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-vw1229Fh.js → workflow-run-setup-panel-D3fq7boB.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-S7XXNBWa.js +6 -0
- package/dist/gateway/static/root/index.html +9 -9
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/tasks.js +6 -1
- package/dist/src/agent/agent-manager.js +17 -17
- package/dist/src/agent/agent-scope.js +2 -2
- package/dist/src/agent/background-review/run-background-review.js +4 -4
- package/dist/src/agent/commands/command-isolation.d.ts +1 -0
- package/dist/src/agent/commands/command-isolation.js +17 -1
- package/dist/src/agent/commands/commandMounts.d.ts +2 -0
- package/dist/src/agent/commands/commandMounts.js +32 -0
- package/dist/src/agent/context/coordinator.js +3 -3
- package/dist/src/agent/context/execution-context.js +4 -4
- package/dist/src/agent/context/execution-scope.js +2 -2
- package/dist/src/agent/context/project-context.js +4 -4
- package/dist/src/agent/embedded/index.js +2 -2
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +5 -5
- package/dist/src/agent/embedded/run-turn.js +2 -2
- package/dist/src/agent/embedded/session-tool-result-guard.js +3 -3
- package/dist/src/agent/external-tools/composio-provider.js +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +1 -1
- package/dist/src/agent/external-tools/mcp-provider.js +2 -2
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/providers/dashscope.js +1 -1
- package/dist/src/agent/image/generation/providers/fal.js +1 -1
- package/dist/src/agent/image/generation/providers/google.js +1 -1
- package/dist/src/agent/image/generation/runtime.js +1 -1
- package/dist/src/agent/image/index.js +1 -1
- package/dist/src/agent/image/load-image-media.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/index.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +2 -2
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/memory/index.js +2 -2
- package/dist/src/agent/messaging/outbound-coordinator.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +5 -5
- package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
- package/dist/src/agent/sandbox/command-validator.js +0 -20
- package/dist/src/agent/sandbox/exec-policy.d.ts +1 -0
- package/dist/src/agent/sandbox/exec-policy.js +3 -3
- package/dist/src/agent/sandbox/fileAccess.d.ts +7 -0
- package/dist/src/agent/sandbox/fileAccess.js +100 -0
- package/dist/src/agent/sandbox/path-policy.d.ts +2 -0
- package/dist/src/agent/sandbox/path-policy.js +54 -17
- package/dist/src/agent/sandbox/sanitize-env-vars.js +10 -9
- package/dist/src/agent/service/direct-turn-helpers.js +6 -6
- package/dist/src/agent/service/process-direct-one-shot.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +5 -5
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.js +19 -19
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +3 -3
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +5 -5
- package/dist/src/agent/tools/apply-patch.js +25 -38
- package/dist/src/agent/tools/create-share-tool.js +13 -5
- package/dist/src/agent/tools/delegate-tool.js +3 -3
- package/dist/src/agent/tools/exec-command.js +2 -1
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.js +13 -13
- package/dist/src/agent/tools/find.js +5 -3
- package/dist/src/agent/tools/grep.js +21 -4
- package/dist/src/agent/tools/image-generate-tool.js +5 -6
- package/dist/src/agent/tools/index.js +5 -5
- package/dist/src/agent/tools/list-dir.js +2 -1
- package/dist/src/agent/tools/managed-job-tool.js +1 -0
- package/dist/src/agent/tools/publish-artifacts.js +4 -3
- package/dist/src/agent/tools/read.js +9 -6
- package/dist/src/agent/tools/repository-search.d.ts +2 -0
- package/dist/src/agent/tools/repository-search.js +51 -7
- package/dist/src/agent/tools/review-workspace.js +76 -10
- package/dist/src/agent/tools/send-media.js +5 -4
- package/dist/src/agent/tools/skills-tools.js +1 -1
- package/dist/src/agent/tools/tool-paths.js +3 -1
- package/dist/src/agent/tools/tts-tool.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +1 -1
- package/dist/src/agent/tools/write.js +6 -19
- package/dist/src/agent/tools/xopc-use-tool.js +6 -6
- package/dist/src/agent/workflow/subagent-runner.js +1 -1
- package/dist/src/agent-config/schema.d.ts +24 -0
- package/dist/src/agent-config/schema.js +2 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/store-connector.js +1 -1
- package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
- package/dist/src/channels/index.js +2 -2
- package/dist/src/channels/outbound-sender.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +9 -9
- package/dist/src/channels/pairing/pairing-store.js +6 -6
- package/dist/src/chat-commands/builtins/config.js +2 -2
- package/dist/src/chat-commands/builtins/review.js +1 -1
- package/dist/src/chat-commands/builtins/session.js +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +1 -1
- package/dist/src/chat-commands/builtins/tts.js +1 -1
- package/dist/src/chat-commands/builtins/understanding.js +1 -1
- package/dist/src/chat-commands/builtins/workflow.js +2 -2
- package/dist/src/chat-commands/context.js +2 -2
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +6 -6
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +21 -20
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +2 -2
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/gateway/token.js +1 -1
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard.js +2 -2
- package/dist/src/cli/commands/project.js +2 -2
- package/dist/src/cli/commands/runtime.js +1 -1
- package/dist/src/cli/commands/skills.js +2 -2
- package/dist/src/cli/commands/tui.js +1 -1
- package/dist/src/cli/commands/tunnel.js +3 -3
- package/dist/src/cli/extension-cli-register.js +4 -4
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +16 -0
- package/dist/src/connectors/connected-source-understanding.js +2 -2
- package/dist/src/connectors/connection-recovery-service.js +3 -3
- package/dist/src/discussions/live-worker.js +1 -1
- package/dist/src/discussions/sealer.js +1 -1
- package/dist/src/extensions/api.js +3 -3
- package/dist/src/extensions/bundled-extension-activation.js +1 -1
- package/dist/src/extensions/index.js +1 -1
- package/dist/src/extensions/loader.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agents-admin.js +4 -4
- package/dist/src/gateway/device-routes.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +2 -2
- package/dist/src/gateway/hono/app.js +3 -3
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
- package/dist/src/gateway/hono/lib/config-payload.js +3 -3
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +2 -2
- package/dist/src/gateway/hono/routes/browser.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +3 -3
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +2 -2
- package/dist/src/gateway/hono/routes/media.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +5 -5
- package/dist/src/gateway/hono/routes/notes.js +1 -1
- package/dist/src/gateway/hono/routes/proactive-control.js +4 -4
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/sessions.js +1 -1
- package/dist/src/gateway/hono/routes/shares.js +25 -4
- package/dist/src/gateway/hono/routes/site-shares.js +1 -1
- package/dist/src/gateway/hono/routes/status.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +10 -3
- package/dist/src/gateway/hono/routes/user-model.js +4 -4
- package/dist/src/gateway/hono/routes/voice.js +3 -3
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/lock.js +10 -10
- package/dist/src/gateway/media-access.js +2 -2
- package/dist/src/gateway/ports.js +6 -6
- package/dist/src/gateway/server.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +4 -4
- package/dist/src/gateway/service/marketplace-service.js +3 -3
- package/dist/src/gateway/service/run-gateway-agent.js +3 -3
- package/dist/src/gateway/service.js +31 -31
- package/dist/src/gateway/session-context-summary.js +2 -2
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/infra/gateway-processes.js +2 -2
- package/dist/src/infra/path-env.js +3 -3
- package/dist/src/infra/update-global.js +10 -10
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/media-shared/http/ssrf-guard.js +1 -1
- package/dist/src/notes/agent-context.js +3 -3
- package/dist/src/notes/service.js +3 -2
- package/dist/src/proactive/actions/service.js +1 -1
- package/dist/src/proactive/execution/agent-executor.js +1 -1
- package/dist/src/proactive/execution/context.js +1 -1
- package/dist/src/proactive/execution/worker.js +1 -1
- package/dist/src/proactive/experience.js +7 -2
- package/dist/src/proactive/follow-ups.js +1 -1
- package/dist/src/proactive/inbox/cards.js +2 -2
- package/dist/src/proactive/inbox/delivery.js +2 -2
- package/dist/src/proactive/inbox/digest.js +2 -2
- package/dist/src/proactive/inbox/notification-policy.js +1 -1
- package/dist/src/proactive/inbox/repository.js +1 -1
- package/dist/src/proactive/inbox/service.js +1 -1
- package/dist/src/proactive/index.js +1 -1
- package/dist/src/proactive/temporal/worker.js +1 -1
- package/dist/src/projects/project-skill-service.js +2 -2
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/remote-access/exposure-manager.js +1 -1
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +3 -3
- package/dist/src/session/thinking-resolve.js +1 -1
- package/dist/src/share/share-store.js +6 -2
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/tasks/execution-context.js +1 -1
- package/dist/src/tasks/home-query-service.js +4 -3
- package/dist/src/tasks/index.js +3 -3
- package/dist/src/tasks/project-operating-view-service.js +7 -4
- package/dist/src/tasks/task-application-service.js +109 -5
- package/dist/src/tasks/task-context-assembler.js +8 -4
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-read-model-projector.js +7 -5
- package/dist/src/tasks/task-run-coordinator.js +3 -1
- package/dist/src/tasks/task-run-repository.js +4 -1
- package/dist/src/tui/backends/embedded-backend.js +9 -9
- package/dist/src/tui/backends/gateway-realtime-backend.js +2 -2
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-command-formatters.js +1 -1
- package/dist/src/tui/tui-commands.js +5 -5
- package/dist/src/tui/tui-picker-overlay.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +5 -5
- package/dist/src/tui/tui.js +3 -3
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/voice/local/runtime-worker.js +1 -1
- package/dist/src/voice/realtime/memory-context.js +3 -3
- package/dist/src/voice/stt/index.js +2 -2
- package/dist/src/voice/stt/preflight.js +1 -1
- package/dist/src/voice/stt/providers/local-transcription.js +1 -1
- package/dist/src/voice/stt/transcribe-core.js +1 -1
- package/dist/src/voice/tts/index.js +3 -3
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/payload.js +1 -1
- package/dist/src/voice/tts/speak-core.js +1 -1
- package/dist/src/work-discovery/service.js +3 -3
- package/dist/src/workflows/context/workflow-context.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +6 -6
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-B5MRLEy8.js +0 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-DY3Vwxjq.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Ch_9Ffgk.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-MACr99IO.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-Nvdoi0B1.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BluLJq5I.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-DYxxhcjb.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Bpcp8UyE.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-D_fB0fml.js +0 -1
- package/dist/gateway/static/root/assets/es2015-BvLh9GaE.js +0 -41
- package/dist/gateway/static/root/assets/gateway-settings-BH35C8RI.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BlZk-aD4.js +0 -1
- package/dist/gateway/static/root/assets/index-CfQor-TM.js +0 -74
- package/dist/gateway/static/root/assets/index-DKy1Qn1_.css +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-DJd71FlC.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-5MWeZ6Ae.js +0 -2
- package/dist/gateway/static/root/assets/note-detail-panel-Bch98ut3.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CWO5dQKN.js +0 -8
- package/dist/gateway/static/root/assets/popover-select-Dz_Qis2R.js +0 -1
- package/dist/gateway/static/root/assets/proactive-card-DfjMVJUW.js +0 -1
- package/dist/gateway/static/root/assets/proactive-page-BGVcVsbd.js +0 -1
- package/dist/gateway/static/root/assets/product-open-page-DsQcgZkI.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-DZFVirjV.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-B2g6inq-.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CbkUOkQY.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page--7-w-0WS.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BvZrH_sp.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Ul06Y5YX.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DwV2Wh7S.js +0 -1
- package/dist/gateway/static/root/assets/skills-page.utils-CT0-daZD.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-BQjLHqSk.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-IvWcgZdD.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-hwc5-nqV.js +0 -2
- package/dist/gateway/static/root/assets/work-discovery-overlay-BG2pmXL3.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-DZWpJHDr.js +0 -6
|
@@ -122,18 +122,6 @@ const HIGH_PATTERNS = [
|
|
|
122
122
|
pattern: /\blaunchctl\s+(load|unload|start|stop)\b/,
|
|
123
123
|
reason: "macOS launchctl manipulation"
|
|
124
124
|
},
|
|
125
|
-
{
|
|
126
|
-
pattern: /\bgit\s+(?:-[^\s]+\s+)*(?!push\s+--force\b)(commit|push|checkout|switch|restore|reset|rebase|merge|cherry-pick|clean|apply|am|stash)\b/,
|
|
127
|
-
reason: "Git command may mutate repository state or publish changes"
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
pattern: /\bgit\s+(?:-[^\s]+\s+)*branch\s+(-[dD]|--delete|--move|-m|-M|--set-upstream-to)\b/,
|
|
131
|
-
reason: "Git branch mutation"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
pattern: /\bgit\s+(?:-[^\s]+\s+)*tag\s+(-[adfs]|--delete|--annotate|--force|--sign)\b/,
|
|
135
|
-
reason: "Git tag mutation"
|
|
136
|
-
},
|
|
137
125
|
{
|
|
138
126
|
pattern: /\bsudo\s+/,
|
|
139
127
|
reason: "Sudo command execution"
|
|
@@ -159,14 +147,6 @@ const MEDIUM_PATTERNS = [
|
|
|
159
147
|
{
|
|
160
148
|
pattern: /\bchmod\s+(?!\+x\b)[0-7]{3,4}\b/,
|
|
161
149
|
reason: "Octal permission change"
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
pattern: /\bgit\s+push\s+--force/,
|
|
165
|
-
reason: "Force push to git remote"
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
pattern: /\bgit\s+reset\s+--hard/,
|
|
169
|
-
reason: "Hard git reset"
|
|
170
150
|
}
|
|
171
151
|
];
|
|
172
152
|
/**
|
|
@@ -21,6 +21,7 @@ import type { ExecPolicyResult, SandboxConfig, PathValidationResult } from './ty
|
|
|
21
21
|
export declare function evaluateExecPolicy(params: {
|
|
22
22
|
command: string;
|
|
23
23
|
cwd: string;
|
|
24
|
+
workspaceRoot?: string;
|
|
24
25
|
config?: Partial<SandboxConfig>;
|
|
25
26
|
allowedEnvVars?: string[];
|
|
26
27
|
}): ExecPolicyResult;
|
|
@@ -57,7 +57,7 @@ function evaluateExecPolicy(params) {
|
|
|
57
57
|
warning: commandResult.reason
|
|
58
58
|
}, "Command allowed with warning");
|
|
59
59
|
const cwdResult = validatePath(params.cwd, {
|
|
60
|
-
allowedRoots: config.allowedRoots.length > 0 ? config.allowedRoots :
|
|
60
|
+
allowedRoots: config.allowedRoots.length > 0 ? config.allowedRoots : [params.workspaceRoot ?? params.cwd],
|
|
61
61
|
extraBlockedPaths: config.blockedPaths
|
|
62
62
|
});
|
|
63
63
|
if (!cwdResult.allowed) {
|
|
@@ -92,10 +92,10 @@ function evaluateFilePolicy(params) {
|
|
|
92
92
|
};
|
|
93
93
|
if (config.mode === "off") return { allowed: true };
|
|
94
94
|
const result = params.operation !== "read" ? validateWritePath(params.path, params.workspaceRoot, {
|
|
95
|
-
allowedRoots: config.allowedRoots.length > 0 ? config.allowedRoots :
|
|
95
|
+
allowedRoots: config.allowedRoots.length > 0 ? config.allowedRoots : [params.workspaceRoot],
|
|
96
96
|
extraBlockedPaths: config.blockedPaths
|
|
97
97
|
}) : validatePath(params.path.startsWith("/") ? params.path : resolve(params.workspaceRoot, params.path), {
|
|
98
|
-
allowedRoots: config.allowedRoots.length > 0 ? config.allowedRoots :
|
|
98
|
+
allowedRoots: config.allowedRoots.length > 0 ? config.allowedRoots : [params.workspaceRoot],
|
|
99
99
|
extraBlockedPaths: config.blockedPaths
|
|
100
100
|
});
|
|
101
101
|
if (!result.allowed) log.warn({
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Revalidate at I/O time; never truncate a file before checking the opened inode. */
|
|
2
|
+
export declare function checkedFilePath(workspaceRoot: string, path: string, operation: 'read' | 'write' | 'delete'): string;
|
|
3
|
+
export declare function readWorkspaceFile(workspace: string, path: string, maxBytes?: number): Buffer;
|
|
4
|
+
export declare function writeWorkspaceFile(workspace: string, path: string, content: string | Buffer): void;
|
|
5
|
+
export declare function deleteWorkspaceFile(workspace: string, path: string): void;
|
|
6
|
+
/** Refuse publication of directory trees containing protected or escaping entries. */
|
|
7
|
+
export declare function assertWorkspaceTreeReadable(workspace: string, path: string): void;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { evaluateFilePolicy } from "./exec-policy.js";
|
|
2
|
+
import { dirname, join, resolve } from "node:path";
|
|
3
|
+
import { closeSync, constants, fstatSync, ftruncateSync, lstatSync, mkdirSync, openSync, readSync, readdirSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
4
|
+
//#region src/agent/sandbox/fileAccess.ts
|
|
5
|
+
/** Revalidate at I/O time; never truncate a file before checking the opened inode. */
|
|
6
|
+
function checkedFilePath(workspaceRoot, path, operation) {
|
|
7
|
+
const policy = evaluateFilePolicy({
|
|
8
|
+
workspaceRoot,
|
|
9
|
+
path,
|
|
10
|
+
operation
|
|
11
|
+
});
|
|
12
|
+
if (!policy.allowed || !policy.canonicalPath) throw new Error(`Sandbox: ${policy.reason ?? "Cannot resolve file"}`);
|
|
13
|
+
return policy.canonicalPath;
|
|
14
|
+
}
|
|
15
|
+
function mkdirChecked(workspace, directory) {
|
|
16
|
+
const path = checkedFilePath(workspace, directory, "write");
|
|
17
|
+
try {
|
|
18
|
+
if (!lstatSync(path).isDirectory()) throw new Error("Expected a directory");
|
|
19
|
+
} catch (error) {
|
|
20
|
+
if (error.code !== "ENOENT") throw error;
|
|
21
|
+
mkdirChecked(workspace, dirname(path));
|
|
22
|
+
if (checkedFilePath(workspace, path, "write") !== path) throw new Error("Directory changed during operation");
|
|
23
|
+
mkdirSync(path);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function openChecked(workspace, inputPath, write) {
|
|
27
|
+
const operation = write ? "write" : "read";
|
|
28
|
+
const path = checkedFilePath(workspace, inputPath, operation);
|
|
29
|
+
if (write) mkdirChecked(workspace, dirname(path));
|
|
30
|
+
if (checkedFilePath(workspace, path, operation) !== path) throw new Error("Path changed during operation");
|
|
31
|
+
const flags = (write ? constants.O_WRONLY : constants.O_RDONLY) | constants.O_NOFOLLOW | constants.O_NONBLOCK;
|
|
32
|
+
let fd;
|
|
33
|
+
try {
|
|
34
|
+
fd = openSync(path, flags);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
if (!write || error.code !== "ENOENT") throw error;
|
|
37
|
+
fd = openSync(path, flags | constants.O_CREAT | constants.O_EXCL, 384);
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
const opened = fstatSync(fd);
|
|
41
|
+
const currentPath = checkedFilePath(workspace, inputPath, operation);
|
|
42
|
+
const current = statSync(currentPath);
|
|
43
|
+
if (currentPath !== path || current.dev !== opened.dev || current.ino !== opened.ino) throw new Error("File changed during operation");
|
|
44
|
+
if (!opened.isFile() || opened.nlink !== 1) throw new Error("Sandbox requires a regular file without hard links");
|
|
45
|
+
return fd;
|
|
46
|
+
} catch (error) {
|
|
47
|
+
closeSync(fd);
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function readWorkspaceFile(workspace, path, maxBytes = 10 * 1024 * 1024) {
|
|
52
|
+
const fd = openChecked(workspace, path, false);
|
|
53
|
+
try {
|
|
54
|
+
if (fstatSync(fd).size > maxBytes) throw new Error(`File too large: maximum ${maxBytes} bytes`);
|
|
55
|
+
const chunks = [];
|
|
56
|
+
let total = 0;
|
|
57
|
+
for (;;) {
|
|
58
|
+
const chunk = Buffer.alloc(Math.min(64 * 1024, maxBytes - total + 1));
|
|
59
|
+
const count = readSync(fd, chunk);
|
|
60
|
+
if (count === 0) break;
|
|
61
|
+
total += count;
|
|
62
|
+
if (total > maxBytes) throw new Error(`File too large: maximum ${maxBytes} bytes`);
|
|
63
|
+
chunks.push(chunk.subarray(0, count));
|
|
64
|
+
}
|
|
65
|
+
return Buffer.concat(chunks);
|
|
66
|
+
} finally {
|
|
67
|
+
closeSync(fd);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function writeWorkspaceFile(workspace, path, content) {
|
|
71
|
+
const fd = openChecked(workspace, path, true);
|
|
72
|
+
try {
|
|
73
|
+
ftruncateSync(fd, 0);
|
|
74
|
+
writeFileSync(fd, content, "utf8");
|
|
75
|
+
} finally {
|
|
76
|
+
closeSync(fd);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function deleteWorkspaceFile(workspace, path) {
|
|
80
|
+
const target = checkedFilePath(workspace, path, "delete");
|
|
81
|
+
if (!lstatSync(target).isFile()) throw new Error("Expected a regular file");
|
|
82
|
+
if (checkedFilePath(workspace, resolve(target), "delete") !== target) throw new Error("File changed during operation");
|
|
83
|
+
unlinkSync(target);
|
|
84
|
+
}
|
|
85
|
+
/** Refuse publication of directory trees containing protected or escaping entries. */
|
|
86
|
+
function assertWorkspaceTreeReadable(workspace, path) {
|
|
87
|
+
const seen = /* @__PURE__ */ new Set();
|
|
88
|
+
let count = 0;
|
|
89
|
+
const visit = (input) => {
|
|
90
|
+
if (++count > 2e5) throw new Error("Share exceeds safe traversal limit");
|
|
91
|
+
const target = checkedFilePath(workspace, input, "read");
|
|
92
|
+
if (seen.has(target)) return;
|
|
93
|
+
seen.add(target);
|
|
94
|
+
if (lstatSync(target).isDirectory()) for (const name of readdirSync(target)) visit(join(target, name));
|
|
95
|
+
else closeSync(openChecked(workspace, target, false));
|
|
96
|
+
};
|
|
97
|
+
visit(path);
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
export { assertWorkspaceTreeReadable, checkedFilePath, deleteWorkspaceFile, readWorkspaceFile, writeWorkspaceFile };
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* Aligned with OpenClaw's validate-sandbox-security.ts blocked-path approach.
|
|
6
6
|
*/
|
|
7
7
|
import type { PathValidationResult } from './types.js';
|
|
8
|
+
export declare function getBlockedPaths(): string[];
|
|
9
|
+
export declare function containsBlockedCredentialSegment(target: string): string | null;
|
|
8
10
|
/**
|
|
9
11
|
* Validate that a path does not escape into blocked system/credential directories.
|
|
10
12
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { homedir } from "node:os";
|
|
2
2
|
import { isAbsolute, normalize, posix, resolve, sep } from "node:path";
|
|
3
|
-
import { realpathSync } from "node:fs";
|
|
3
|
+
import { lstatSync, realpathSync } from "node:fs";
|
|
4
4
|
//#region src/agent/sandbox/path-policy.ts
|
|
5
5
|
/**
|
|
6
6
|
* Path safety validation for sandbox isolation.
|
|
@@ -52,6 +52,23 @@ function getBlockedPaths() {
|
|
|
52
52
|
process.env.USERPROFILE
|
|
53
53
|
].filter((home) => Boolean(home && home !== "/")));
|
|
54
54
|
for (const home of homes) for (const sub of BLOCKED_HOME_SUBPATHS) blocked.add(normalizePosixPath(resolvePolicyPath(`${home}/${sub}`)));
|
|
55
|
+
for (const path of [
|
|
56
|
+
process.env.XOPC_CONFIG_PATH,
|
|
57
|
+
process.env.XOPC_CONFIG,
|
|
58
|
+
...[
|
|
59
|
+
"",
|
|
60
|
+
"-wal",
|
|
61
|
+
"-shm",
|
|
62
|
+
"-journal"
|
|
63
|
+
].map((suffix) => process.env.XOPC_STATE_DIR ? resolve(process.env.XOPC_STATE_DIR, `xopc.db${suffix}`) : void 0)
|
|
64
|
+
]) {
|
|
65
|
+
if (!path) continue;
|
|
66
|
+
const resolved = resolvePolicyPath(path);
|
|
67
|
+
blocked.add(normalizePosixPath(resolved));
|
|
68
|
+
try {
|
|
69
|
+
blocked.add(normalizePosixPath(realpathSync(resolved)));
|
|
70
|
+
} catch {}
|
|
71
|
+
}
|
|
55
72
|
return [...blocked];
|
|
56
73
|
}
|
|
57
74
|
/**
|
|
@@ -70,6 +87,8 @@ function containsBlockedCredentialSegment(target) {
|
|
|
70
87
|
const prefix = `/${sub.replace(/\\/g, "/")}`;
|
|
71
88
|
if (normalized.endsWith(prefix) || normalized.includes(`${prefix}/`)) return sub;
|
|
72
89
|
}
|
|
90
|
+
if (/(?:^|\/)\.xopc\/(?:xopc\.json|xopc\.db(?:-[^/]*)?)(?:\/|$)/.test(normalized)) return ".xopc config/state";
|
|
91
|
+
if (/(?:^|\/)\.env(?:\.[^/]*)?(?:\/|$)/.test(normalized)) return ".env";
|
|
73
92
|
return null;
|
|
74
93
|
}
|
|
75
94
|
/**
|
|
@@ -80,20 +99,16 @@ function containsBlockedCredentialSegment(target) {
|
|
|
80
99
|
function resolveCanonicalPath(targetPath) {
|
|
81
100
|
try {
|
|
82
101
|
return realpathSync(targetPath);
|
|
83
|
-
} catch {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
try {
|
|
90
|
-
resolved = realpathSync(candidate);
|
|
91
|
-
} catch {
|
|
92
|
-
unresolved = segments.slice(i).join("/");
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
102
|
+
} catch (error) {
|
|
103
|
+
if (error.code !== "ENOENT") throw error;
|
|
104
|
+
try {
|
|
105
|
+
if (lstatSync(targetPath).isSymbolicLink()) throw new Error("Unresolvable symbolic link");
|
|
106
|
+
} catch (statError) {
|
|
107
|
+
if (statError.code !== "ENOENT") throw statError;
|
|
95
108
|
}
|
|
96
|
-
|
|
109
|
+
const parent = resolve(targetPath, "..");
|
|
110
|
+
if (parent === targetPath) throw error;
|
|
111
|
+
return resolve(resolveCanonicalPath(parent), targetPath.split(sep).at(-1));
|
|
97
112
|
}
|
|
98
113
|
}
|
|
99
114
|
/**
|
|
@@ -134,7 +149,21 @@ function validatePath(rawPath, options) {
|
|
|
134
149
|
};
|
|
135
150
|
}
|
|
136
151
|
}
|
|
137
|
-
|
|
152
|
+
let canonical;
|
|
153
|
+
try {
|
|
154
|
+
canonical = resolveCanonicalPath(target);
|
|
155
|
+
} catch {
|
|
156
|
+
return {
|
|
157
|
+
allowed: false,
|
|
158
|
+
reason: "Cannot safely resolve path"
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
const canonicalNormalized = normalizePosixPath(canonical);
|
|
162
|
+
const canonicalCredential = containsBlockedCredentialSegment(canonicalNormalized);
|
|
163
|
+
if (canonicalCredential) return {
|
|
164
|
+
allowed: false,
|
|
165
|
+
reason: `Path resolves to protected credential path: ${canonicalCredential}`
|
|
166
|
+
};
|
|
138
167
|
if (canonicalNormalized !== target) {
|
|
139
168
|
for (const blocked of blockedPaths) if (isPathInsideOrEqual(blocked, canonicalNormalized)) return {
|
|
140
169
|
allowed: false,
|
|
@@ -142,7 +171,15 @@ function validatePath(rawPath, options) {
|
|
|
142
171
|
};
|
|
143
172
|
}
|
|
144
173
|
if (options?.allowedRoots && options.allowedRoots.length > 0) {
|
|
145
|
-
|
|
174
|
+
let normalizedRoots;
|
|
175
|
+
try {
|
|
176
|
+
normalizedRoots = options.allowedRoots.map((r) => normalizePosixPath(resolveCanonicalPath(resolvePolicyPath(r))));
|
|
177
|
+
} catch {
|
|
178
|
+
return {
|
|
179
|
+
allowed: false,
|
|
180
|
+
reason: "Cannot safely resolve allowed roots"
|
|
181
|
+
};
|
|
182
|
+
}
|
|
146
183
|
if (!normalizedRoots.some((root) => isPathInsideOrEqual(root, canonicalNormalized))) return {
|
|
147
184
|
allowed: false,
|
|
148
185
|
reason: `Path is outside allowed roots: ${normalizedRoots.join(", ")}`
|
|
@@ -173,4 +210,4 @@ function validateWritePath(rawPath, workspaceRoot, options) {
|
|
|
173
210
|
return validatePath(resolvedPath, options);
|
|
174
211
|
}
|
|
175
212
|
//#endregion
|
|
176
|
-
export { validatePath, validateWritePath };
|
|
213
|
+
export { containsBlockedCredentialSegment, getBlockedPaths, validatePath, validateWritePath };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isDangerousHostEnvVarName } from "../../infra/host-env-security.js";
|
|
1
2
|
//#region src/agent/sandbox/sanitize-env-vars.ts
|
|
2
3
|
/**
|
|
3
4
|
* Filters process environment before passing it to child processes (e.g. exec_command)
|
|
@@ -21,10 +22,10 @@ function isDangerousEnvVar(key) {
|
|
|
21
22
|
const upperKey = key.toUpperCase();
|
|
22
23
|
return BLOCKED_ENV_VAR_PATTERNS.some((pattern) => pattern.test(upperKey));
|
|
23
24
|
}
|
|
24
|
-
function validateEnvVarValue(key, value) {
|
|
25
|
+
function validateEnvVarValue(key, value, allowCredentialData = false) {
|
|
25
26
|
if (value.includes("\0")) return `Environment variable ${key} contains null bytes`;
|
|
26
27
|
if (value.length > MAX_ENV_VAR_LENGTH) return `Environment variable ${key} exceeds maximum length (${MAX_ENV_VAR_LENGTH})`;
|
|
27
|
-
if (/^[A-Za-z0-9+/=]{80,}$/.test(value)) return `Environment variable ${key} looks like base64-encoded credential data`;
|
|
28
|
+
if (!allowCredentialData && /^[A-Za-z0-9+/=]{80,}$/.test(value)) return `Environment variable ${key} looks like base64-encoded credential data`;
|
|
28
29
|
return null;
|
|
29
30
|
}
|
|
30
31
|
function sanitizeEnvVars(env, options) {
|
|
@@ -35,17 +36,17 @@ function sanitizeEnvVars(env, options) {
|
|
|
35
36
|
const customBlocked = options?.customBlocked ?? [];
|
|
36
37
|
for (const [key, value] of Object.entries(env)) {
|
|
37
38
|
if (value === void 0) continue;
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
const warning = validateEnvVarValue(key, value, allowedVars.has(key));
|
|
40
|
+
if (warning) {
|
|
41
|
+
warnings.push(warning);
|
|
40
42
|
continue;
|
|
41
43
|
}
|
|
42
|
-
if (
|
|
44
|
+
if (isDangerousHostEnvVarName(key)) {
|
|
43
45
|
blocked.push(key);
|
|
44
46
|
continue;
|
|
45
47
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
warnings.push(warning);
|
|
48
|
+
if (!allowedVars.has(key) && (isDangerousEnvVar(key) || customBlocked.some((pattern) => pattern.test(key)))) {
|
|
49
|
+
blocked.push(key);
|
|
49
50
|
continue;
|
|
50
51
|
}
|
|
51
52
|
safe[key] = value;
|
|
@@ -63,7 +64,7 @@ function prepareSafeToolEnv(baseEnv, options) {
|
|
|
63
64
|
const { safe } = sanitizeEnvVars(baseEnv, options);
|
|
64
65
|
return {
|
|
65
66
|
...safe,
|
|
66
|
-
HOME:
|
|
67
|
+
HOME: safe.HOME || "/tmp"
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
70
|
//#endregion
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { getClarificationResumeInput } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
2
2
|
import { getConnectionResumeInput } from "../../storage/sqlite/connection-wait-repository.js";
|
|
3
|
-
import { resolveImageHandlingStrategy } from "../image/vision-detection.js";
|
|
4
|
-
import { hydrateUserTurnForLlm } from "../inbound/attachment-pipeline.js";
|
|
5
|
-
import { buildTaskExecutionDirective } from "../../tasks/task-context-assembler.js";
|
|
6
|
-
import { prependAgentContext } from "../context/prepend.js";
|
|
7
|
-
import { extractAgentUserPlainText } from "../memory/user-message-text.js";
|
|
8
|
-
import { shouldSkipResetOverlapCommand } from "../../session/reset-triggers.js";
|
|
9
3
|
import { parseSlashCommand } from "../../chat-commands/command-parse.js";
|
|
10
4
|
import { commandRegistry } from "../../chat-commands/registry.js";
|
|
11
5
|
import "../../chat-commands/index.js";
|
|
6
|
+
import { shouldSkipResetOverlapCommand } from "../../session/reset-triggers.js";
|
|
7
|
+
import { resolveImageHandlingStrategy } from "../image/vision-detection.js";
|
|
8
|
+
import { hydrateUserTurnForLlm } from "../inbound/attachment-pipeline.js";
|
|
12
9
|
import { runEmbeddedTurnForSession } from "../embedded/run-for-session.js";
|
|
13
10
|
import { injectSourceContextsIntoUserMessage } from "../source-context/injector.js";
|
|
11
|
+
import { extractAgentUserPlainText } from "../memory/user-message-text.js";
|
|
12
|
+
import { buildTaskExecutionDirective } from "../../tasks/task-context-assembler.js";
|
|
13
|
+
import { prependAgentContext } from "../context/prepend.js";
|
|
14
14
|
import crypto from "node:crypto";
|
|
15
15
|
//#region src/agent/service/direct-turn-helpers.ts
|
|
16
16
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { clearPendingTranscriptUserMessage, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
2
1
|
import { initSessionTurn } from "../../session/init-session-turn.js";
|
|
3
2
|
import "../../session/index.js";
|
|
3
|
+
import { clearPendingTranscriptUserMessage, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
4
4
|
import { buildDirectUserMessageContent } from "./build-direct-message-content.js";
|
|
5
5
|
import { hydratePerTurnState, runDirectAgentTurn, tryRunSlashCommand } from "./direct-turn-helpers.js";
|
|
6
6
|
//#region src/agent/service/process-direct-one-shot.ts
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { getClarificationResumeInput } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
2
2
|
import { getConnectionResumeInput } from "../../storage/sqlite/connection-wait-repository.js";
|
|
3
|
+
import { mergeSttConfigFromAppConfig } from "../../voice/stt/config.js";
|
|
4
|
+
import "../../voice/stt/index.js";
|
|
3
5
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
4
|
-
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
5
|
-
import { clearPendingTranscriptUserMessage, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
6
|
-
import { formatAgentRunErrorForClient } from "../client-error-format.js";
|
|
7
6
|
import { resolveConfiguredActivityDetailDefault, resolveEffectiveReasoningLevel } from "../../session/thinking-resolve.js";
|
|
8
7
|
import { initSessionTurn } from "../../session/init-session-turn.js";
|
|
9
8
|
import "../../session/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import "
|
|
9
|
+
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
10
|
+
import { clearPendingTranscriptUserMessage, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
12
11
|
import { isVoiceLikeAttachment, mergeVoiceTranscriptsIntoUserText } from "../../channels/attachments/voice-stt-webchat.js";
|
|
13
12
|
import { applyReasoningVisibility } from "../streaming/reasoning-visibility.js";
|
|
13
|
+
import { formatAgentRunErrorForClient } from "../client-error-format.js";
|
|
14
14
|
import { isSessionSourceBinding, summarizeSourceContext } from "../source-context/types.js";
|
|
15
15
|
import { injectSourceContextsIntoUserMessage } from "../source-context/injector.js";
|
|
16
16
|
import { AsyncQueue, AsyncQueueOverflowError } from "./async-queue.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isTTSAvailable } from "../../voice/tts/factory.js";
|
|
2
|
-
import { speak } from "../../voice/tts/speak-core.js";
|
|
3
2
|
import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
|
|
4
3
|
import { getChannelOutputFormat, shouldUseTTS } from "../../voice/tts/service.js";
|
|
4
|
+
import { speak } from "../../voice/tts/speak-core.js";
|
|
5
5
|
import { compressAudio } from "../../voice/tts/audio.js";
|
|
6
|
-
import { persistOutboundTtsAudio } from "../../channels/attachments/outbound-tts-persist.js";
|
|
7
6
|
import "../../voice/tts/index.js";
|
|
7
|
+
import { persistOutboundTtsAudio } from "../../channels/attachments/outbound-tts-persist.js";
|
|
8
8
|
//#region src/agent/service/webchat-tts.ts
|
|
9
9
|
/** True when the explicit TTS tool already produced durable Webchat audio. */
|
|
10
10
|
function isSuccessfulWebchatTtsToolEvent(event) {
|
|
@@ -2,40 +2,32 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
|
|
4
4
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
5
|
-
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
6
5
|
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
7
|
-
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
8
6
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
9
|
-
import { extractTextContent } from "./context/workspace.js";
|
|
10
|
-
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
11
|
-
import { getProjectForSession } from "../projects/workspace.js";
|
|
12
|
-
import { runWithEmbeddedExecutionSession } from "./embedded/execution-context.js";
|
|
13
|
-
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "./skills/workspace-skills-dir.js";
|
|
14
7
|
import { removeSkillsLockEntry } from "./skills/hub-lock.js";
|
|
15
8
|
import { installSkillFromZip } from "./skills/managed-store.js";
|
|
16
|
-
import {
|
|
9
|
+
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
10
|
+
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
11
|
+
import { getProjectForSession } from "../projects/workspace.js";
|
|
17
12
|
import { getUserTimezone } from "../user-model/repository.js";
|
|
18
13
|
import "../user-model/index.js";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { AgentManager } from "./agent-manager.js";
|
|
14
|
+
import { initializeCommands } from "../chat-commands/index.js";
|
|
15
|
+
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
16
|
+
import { ExtensionHookRunner } from "../extensions/hooks.js";
|
|
17
|
+
import "../extensions/index.js";
|
|
18
|
+
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "./skills/workspace-skills-dir.js";
|
|
19
|
+
import { pullSkillFromSource } from "./skills/hub-pull.js";
|
|
20
|
+
import { extractTextContent } from "./context/workspace.js";
|
|
27
21
|
import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../gateway/chat-limits.js";
|
|
28
22
|
import { maybeRefineSessionTitleWithLlm, maybeSetProvisionalSessionTitle } from "../session/session-title.js";
|
|
29
23
|
import { resolveCompactionPolicy } from "./memory/compaction-policy.js";
|
|
30
24
|
import { SessionStore } from "../session/store.js";
|
|
25
|
+
import { onSessionTranscriptUpdate } from "../session/transcript-events.js";
|
|
31
26
|
import { SessionConfigStore } from "../session/config-store.js";
|
|
32
27
|
import "../session/index.js";
|
|
33
|
-
import { ExtensionHookRunner } from "../extensions/hooks.js";
|
|
34
|
-
import "../extensions/index.js";
|
|
35
28
|
import { SessionTracker } from "./session/tracker.js";
|
|
36
29
|
import { ModelManager } from "./models/manager.js";
|
|
37
30
|
import "./models/index.js";
|
|
38
|
-
import { initializeCommands } from "../chat-commands/index.js";
|
|
39
31
|
import { HookHandler } from "./lifecycle/hook-handler.js";
|
|
40
32
|
import { ToolErrorTracker } from "./tools/error-tracker.js";
|
|
41
33
|
import { RequestLimiter } from "./models/request-limiter.js";
|
|
@@ -47,6 +39,11 @@ import { ContextMiddleware } from "./middleware/context.js";
|
|
|
47
39
|
import "./middleware/index.js";
|
|
48
40
|
import { LifecycleManager } from "./lifecycle/manager.js";
|
|
49
41
|
import "./lifecycle/index.js";
|
|
42
|
+
import { resolveAgentTurnTimeoutMs } from "./orchestration/run-agent-turn-with-timeout.js";
|
|
43
|
+
import { persistInboundAttachments } from "../channels/attachments/inbound-persist.js";
|
|
44
|
+
import { buildTranscriptUserMessage, hydrateUserTurnForLlm } from "./inbound/attachment-pipeline.js";
|
|
45
|
+
import { runXopcEmbeddedTurn } from "./embedded/run-turn.js";
|
|
46
|
+
import { runWithEmbeddedExecutionSession } from "./embedded/execution-context.js";
|
|
50
47
|
import { MessageRouter } from "./messaging/message-router.js";
|
|
51
48
|
import { CommandHandler } from "./messaging/command-handler.js";
|
|
52
49
|
import { StreamManager } from "./messaging/stream-manager.js";
|
|
@@ -65,7 +62,10 @@ import { AgentOrchestrator } from "./orchestration/agent-orchestrator.js";
|
|
|
65
62
|
import { AgentEventHandler } from "./orchestration/agent-event-handler.js";
|
|
66
63
|
import "./orchestration/index.js";
|
|
67
64
|
import { getWorkflowProgressBroker } from "./workflow/progress-broker.js";
|
|
65
|
+
import { resolveResponseLanguageForSession } from "./prompt/response-language.js";
|
|
68
66
|
import "./workflow/index.js";
|
|
67
|
+
import { normalizeSkillInstallTarget } from "./skills/install-target.js";
|
|
68
|
+
import { AgentManager } from "./agent-manager.js";
|
|
69
69
|
import { TaskJudgeService } from "./tasks/task-judge-service.js";
|
|
70
70
|
import { analyzeResponseLanguage } from "../i18n/language-consistency.js";
|
|
71
71
|
import { readFile } from "node:fs/promises";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { init_workspace_defaults, resolveDefaultAgentWorkspaceDir } from "../../config/workspace-defaults.js";
|
|
4
|
-
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
4
|
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
5
|
+
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
6
6
|
import { getExecutionEnvironmentForSession } from "../../execution-environments/subject.js";
|
|
7
7
|
import { effectiveWorkspacePathForSession, projectWorkspacePath } from "../../session/session-workspace.js";
|
|
8
8
|
import { getProjectForSession } from "../../projects/workspace.js";
|
|
@@ -2,10 +2,10 @@ import { resolveStateDir } from "../../config/paths-state.js";
|
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
4
|
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
5
|
+
import { isManagedSkillTransientDirName } from "./managed-store.js";
|
|
5
6
|
import { createSkillConfigManager } from "./config.js";
|
|
6
7
|
import { resolveWorkspaceSkillsDir } from "./workspace-skills-dir.js";
|
|
7
8
|
import { resolveAgentsSkillsDir, resolveWorkspaceAgentsSkillsDir } from "./skill-sources.js";
|
|
8
|
-
import { isManagedSkillTransientDirName } from "./managed-store.js";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import chokidar from "chokidar";
|
|
11
11
|
//#region src/agent/skills/filesystem-watcher.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_paths, resolveSkillsLockPath } from "../../config/paths.js";
|
|
2
1
|
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
|
+
import { init_paths, resolveSkillsLockPath } from "../../config/paths.js";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
//#region src/agent/skills/hub-lock.ts
|
|
5
5
|
/**
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
2
|
-
import { formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
3
|
-
import { computeSkillTreeHashSync } from "./hub-hash.js";
|
|
4
2
|
import { getSkillsLockEntry, recordSkillsHubInstall } from "./hub-lock.js";
|
|
5
3
|
import { installSkillFromZip, isIgnorableZipEntry, isValidSkillId, prepareManagedSkillTempDir, promoteManagedSkillTempDir } from "./managed-store.js";
|
|
4
|
+
import { formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
5
|
+
import { computeSkillTreeHashSync } from "./hub-hash.js";
|
|
6
6
|
import { tmpdir } from "node:os";
|
|
7
7
|
import { basename, dirname, join, normalize, resolve, sep } from "node:path";
|
|
8
8
|
import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
10
|
import { execFileSync } from "node:child_process";
|
|
11
|
-
import { fetch } from "undici";
|
|
12
11
|
import AdmZip from "adm-zip";
|
|
12
|
+
import { fetch } from "undici";
|
|
13
13
|
//#region src/agent/skills/hub-pull.ts
|
|
14
14
|
/**
|
|
15
15
|
* CLI / hub: install or update skills from git or archive (zip / tar.gz) into ~/.xopc/skills.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { downloadSkillZipBuffer, fetchMarketplacePackageDetail, listSkillCategories, listSkillPackages, resolveSkillZipDownloadUrl, resolveSkillsStoreBaseUrl, skillIdForMarketplaceInstall, verifyStoreArtifactSha256 } from "./store-api-client.js";
|
|
1
2
|
import { registerMarketplaceAdapter } from "../../registry.js";
|
|
2
3
|
import { buildSkillMarkdownPreviewFromRaw } from "../../../skill-markdown-preview-from-raw.js";
|
|
3
|
-
import { downloadSkillZipBuffer, fetchMarketplacePackageDetail, listSkillCategories, listSkillPackages, resolveSkillZipDownloadUrl, resolveSkillsStoreBaseUrl, skillIdForMarketplaceInstall, verifyStoreArtifactSha256 } from "./store-api-client.js";
|
|
4
4
|
//#region src/agent/skills/marketplace/adapters/store/adapter.ts
|
|
5
5
|
const storeMarketplaceAdapter = {
|
|
6
6
|
id: "store",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_resolution, resolveConnectedPlatformEndpoint } from "../../../../../platform/resolution.js";
|
|
2
|
-
import { MAX_SKILL_ZIP_BYTES, isValidSkillId } from "../../../managed-store.js";
|
|
3
2
|
import { MAX_EXTENSION_STORE_ZIP_BYTES } from "../../../../../extensions/store-zip-limits.js";
|
|
3
|
+
import { MAX_SKILL_ZIP_BYTES, isValidSkillId } from "../../../managed-store.js";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
//#region src/agent/skills/marketplace/adapters/store/store-api-client.ts
|
|
6
6
|
/**
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
4
|
+
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
4
5
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
5
|
-
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
6
6
|
import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
|
|
7
|
-
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
8
|
-
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
9
|
-
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
10
7
|
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
8
|
+
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
9
|
+
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
10
|
+
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
11
11
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
12
|
-
import {
|
|
12
|
+
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
13
13
|
//#region src/agent/tasks/task-judge-service.ts
|
|
14
14
|
init_schema();
|
|
15
15
|
init_providers();
|