@xopcai/xopc 0.0.488 → 0.0.489
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/dingtalk/src/index.js +54 -10
- package/dist/extensions/discord/src/index.js +39 -6
- package/dist/extensions/feishu/src/adapters/cli-login.js +1 -1
- package/dist/extensions/feishu/src/adapters/gateway-setup.js +1 -1
- package/dist/extensions/feishu/src/outbound/media-load.d.ts +1 -0
- package/dist/extensions/feishu/src/outbound/media-load.js +2 -2
- package/dist/extensions/feishu/src/outbound/outbound-adapter.js +2 -1
- package/dist/extensions/feishu/src/pairing/feishu-pairing-prompt.js +1 -1
- package/dist/extensions/feishu/src/plugin.js +1 -1
- package/dist/extensions/feishu/src/streaming/streaming-adapter.js +1 -1
- package/dist/extensions/feishu/src/transport/client/install-sdk.js +2 -2
- package/dist/extensions/feishu/src/transport/reliability/message-ingress.js +3 -3
- package/dist/extensions/feishu/src/transport/socket-mode/monitor.js +1 -1
- package/dist/extensions/slack/src/index.js +51 -1
- package/dist/extensions/slack/src/manifest.js +1 -0
- package/dist/extensions/telegram/src/adapters/outbound-adapter.js +6 -1
- package/dist/extensions/telegram/src/adapters/streaming-adapter.js +3 -3
- package/dist/extensions/telegram/src/doctor.js +2 -2
- package/dist/extensions/telegram/src/draft-stream.js +1 -1
- package/dist/extensions/telegram/src/exec-approval-handler.js +1 -1
- package/dist/extensions/telegram/src/focus-handler.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +7 -7
- package/dist/extensions/telegram/src/outbound-sender.js +6 -5
- package/dist/extensions/telegram/src/plugin.js +23 -23
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/wecom/src/index.js +82 -6
- package/dist/extensions/weixin/src/api/api.js +1 -1
- package/dist/extensions/weixin/src/auth/accounts.js +2 -2
- package/dist/extensions/weixin/src/auth/pairing.js +1 -1
- package/dist/extensions/weixin/src/cdn/upload.js +1 -1
- package/dist/extensions/weixin/src/cli/gateway-qr-login.js +1 -1
- package/dist/extensions/weixin/src/cli/qr-login.js +2 -2
- package/dist/extensions/weixin/src/media/data-url.d.ts +1 -0
- package/dist/extensions/weixin/src/media/data-url.js +5 -2
- package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
- package/dist/extensions/weixin/src/messaging/inbound.js +2 -2
- package/dist/extensions/weixin/src/messaging/process-message.js +5 -5
- package/dist/extensions/weixin/src/messaging/quote-cache.js +1 -1
- package/dist/extensions/weixin/src/messaging/send.js +1 -1
- package/dist/extensions/weixin/src/monitor/monitor.js +2 -2
- package/dist/extensions/weixin/src/outbound-send.js +18 -6
- package/dist/extensions/weixin/src/plugin.js +3 -3
- package/dist/gateway/server/chunks.bin +1560 -1521
- package/dist/gateway/server/chunks.json +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DelDZorh.js → automations-page-B3i5x1Lc.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-leY4yCvw.js → automations-workspace-D6-Kk33X.js} +2 -2
- package/dist/gateway/static/root/assets/{chat-page-XqG9aYBd.js → chat-page-oy4EGdO1.js} +2 -2
- package/dist/gateway/static/root/assets/{home-page-Bxr3V5lc.js → home-page-BmoT_EN4.js} +3 -3
- package/dist/gateway/static/root/assets/{home-task-actions-GAO06s1_.js → home-task-actions-Ck0AhcYe.js} +1 -1
- package/dist/gateway/static/root/assets/{index-BjU5H5hz.js → index-BiQP7-5r.js} +8 -8
- package/dist/gateway/static/root/assets/{note-detail-panel-BTNX68oO.js → note-detail-panel-CYNPJVVE.js} +2 -2
- package/dist/gateway/static/root/assets/{notes-page-FocipOyc.js → notes-page-Dpd98vQp.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-CSc2n5UD.js → personal-page-BfljqOp5.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-CK_EN6Jq.js → project-detail-page-CcnOT_aq.js} +1 -1
- package/dist/gateway/static/root/assets/right-workspace-store-DsVm6C0V.js +1 -0
- package/dist/gateway/static/root/assets/{route-preload-Ab7Zw-df.js → route-preload-CsBdFJHO.js} +2 -2
- package/dist/gateway/static/root/assets/{routine-panel-DzdJGicv.js → routine-panel-pVuJtctD.js} +2 -2
- package/dist/gateway/static/root/assets/{settings-page-CzW5GM5r.js → settings-page-BRAijVXZ.js} +1 -1
- package/dist/gateway/static/root/assets/{space-page-BCzDsNJd.js → space-page-CUwakPrj.js} +2 -2
- package/dist/gateway/static/root/assets/{task-detail-page-B_YXsT9W.js → task-detail-page-Cvx-XtFO.js} +1 -1
- package/dist/gateway/static/root/assets/{task-header-title-bZVPIbyR.js → task-header-title-DHb7z-hq.js} +1 -1
- package/dist/gateway/static/root/assets/{task-run-issue-notice-BXOES2t9.js → task-run-issue-notice-CqjS8_gi.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-DWiIdMIi.js → use-composer-attachments-CQwCTKAp.js} +1 -1
- package/dist/gateway/static/root/assets/{use-personal-work-D0tMU1bP.js → use-personal-work-fvvZDK_7.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-DPHnm_7A.js → workspace-file-preview-dialog-DdVyIRKm.js} +1 -1
- package/dist/gateway/static/root/index.html +9 -9
- package/dist/package.js +1 -1
- package/dist/src/activity/emitter.js +1 -1
- package/dist/src/agent/agent-manager.js +8 -8
- package/dist/src/agent/background-review/prompts.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +3 -3
- package/dist/src/agent/coding/repository-instructions.js +1 -1
- package/dist/src/agent/coding/workspace-revision.js +1 -1
- package/dist/src/agent/commands/command-isolation.js +1 -1
- package/dist/src/agent/commands/command-registry.js +1 -1
- package/dist/src/agent/context/execution-context.js +2 -2
- package/dist/src/agent/context/workspace-seed.js +1 -1
- package/dist/src/agent/data-acquisition/git.js +1 -1
- package/dist/src/agent/data-acquisition/service.js +1 -1
- package/dist/src/agent/embedded/codemode-output.js +2 -2
- package/dist/src/agent/embedded/execution-tool-policy.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +6 -6
- package/dist/src/agent/embedded/run-turn.js +76 -17
- package/dist/src/agent/embedded/runs.js +1 -1
- package/dist/src/agent/embedded/session-runner.js +2 -1
- package/dist/src/agent/embedded/types.d.ts +1 -1
- package/dist/src/agent/embedded/xopc-stream-bridge.js +3 -3
- package/dist/src/agent/external-tools/endpoint-provider.js +1 -1
- package/dist/src/agent/external-tools/index.js +1 -1
- package/dist/src/agent/image/generation/providers/xopc-cloud.js +2 -2
- package/dist/src/agent/image/load-image-media.js +2 -2
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/inbound/inbound-loop.js +6 -1
- package/dist/src/agent/independent-execution.js +2 -2
- package/dist/src/agent/mcp/connection-drafts.js +2 -2
- package/dist/src/agent/mcp/connection-setup.js +1 -1
- package/dist/src/agent/mcp/conversation-setup.js +1 -1
- package/dist/src/agent/mcp/discovery.js +1 -1
- package/dist/src/agent/mcp/transport.js +1 -1
- package/dist/src/agent/mcp/weixin-setup-scope.js +2 -2
- package/dist/src/agent/messaging/command-handler.js +1 -1
- package/dist/src/agent/prompt/response-language.js +1 -1
- package/dist/src/agent/prompt/sections/tooling.d.ts +1 -0
- package/dist/src/agent/prompt/sections/tooling.js +7 -2
- package/dist/src/agent/prompt/service-prompt-builder.js +1 -1
- package/dist/src/agent/prompt/system-prompt-params.js +1 -1
- package/dist/src/agent/prompt/system-prompt.js +1 -0
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/sandbox/native-command.js +1 -1
- package/dist/src/agent/sandbox/path-policy.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +3 -3
- package/dist/src/agent/service/process-direct-streaming.js +2 -2
- package/dist/src/agent/service.js +7 -5
- package/dist/src/agent/session/session-config-service.js +1 -1
- package/dist/src/agent/skills/hub-hash.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/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-sources.js +1 -1
- package/dist/src/agent/tools/browser/tool/browser-use-tool.js +48 -2
- package/dist/src/agent/tools/browser/tool/schemas.d.ts +2 -1
- package/dist/src/agent/tools/browser/tool/schemas.js +6 -0
- package/dist/src/agent/tools/communication.d.ts +1 -0
- package/dist/src/agent/tools/communication.js +10 -3
- package/dist/src/agent/tools/delegate-tool.js +1 -1
- package/dist/src/agent/tools/exec-command.js +1 -1
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.js +13 -4
- package/dist/src/agent/tools/fetch-text.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.d.ts +7 -0
- package/dist/src/agent/tools/image-generate-tool.js +21 -1
- package/dist/src/agent/tools/managed-job-tool.js +1 -1
- package/dist/src/agent/tools/personal-attention-tool.js +1 -1
- package/dist/src/agent/tools/personal-memory-tool.js +3 -3
- package/dist/src/agent/tools/publish-artifacts.js +1 -1
- package/dist/src/agent/tools/read.js +1 -1
- package/dist/src/agent/tools/review-workspace.js +2 -2
- package/dist/src/agent/tools/scoped-workspace-tools.js +1 -1
- package/dist/src/agent/tools/send-media.d.ts +1 -0
- package/dist/src/agent/tools/send-media.js +7 -4
- package/dist/src/agent/tools/task-collaboration-tool.js +2 -2
- package/dist/src/agent/tools/tool-media.d.ts +1 -0
- package/dist/src/agent/tools/tool-media.js +14 -1
- package/dist/src/agent/tools/user-context-tool.js +2 -2
- package/dist/src/agent/tools/web-extract.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +6 -6
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth/openai.js +1 -1
- package/dist/src/auth/oauth/xopc-cloud.js +2 -2
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/automations/delivery/delivery-router.js +1 -1
- package/dist/src/automations/service/action-executor.js +1 -1
- package/dist/src/automations/service/automation-service.js +1 -1
- package/dist/src/backup/archive.js +4 -4
- package/dist/src/browser/assistance.d.ts +34 -0
- package/dist/src/browser/assistance.js +243 -0
- package/dist/src/browser/cache-dir-policy.js +1 -1
- package/dist/src/browser/drivers/browser-driver.d.ts +44 -0
- package/dist/src/browser/drivers/playwright-driver.d.ts +2 -1
- package/dist/src/browser/drivers/playwright-driver.js +161 -0
- package/dist/src/browser/managed-live-runtime.d.ts +79 -0
- package/dist/src/browser/managed-live-runtime.js +313 -0
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +4 -4
- package/dist/src/browser/runtime/browser-runtime.d.ts +18 -1
- package/dist/src/browser/runtime/browser-runtime.js +55 -4
- package/dist/src/capabilities/capability-catalog.js +2 -2
- package/dist/src/capabilities/readiness/from-config.js +2 -2
- package/dist/src/capabilities/store-connector.js +1 -1
- package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
- package/dist/src/channels/channel-domain.d.ts +1 -0
- package/dist/src/channels/enterprise/media.d.ts +14 -0
- package/dist/src/channels/enterprise/media.js +208 -0
- package/dist/src/channels/enterprise/plugin.d.ts +4 -0
- package/dist/src/channels/enterprise/plugin.js +40 -12
- package/dist/src/channels/format.js +1 -1
- package/dist/src/channels/index.js +2 -2
- package/dist/src/channels/internal-outbound.d.ts +2 -0
- package/dist/src/channels/internal-outbound.js +17 -1
- package/dist/src/channels/lifecycle-supervisor.js +1 -1
- package/dist/src/channels/outbound-sender.js +2 -2
- package/dist/src/channels/pairing/pairing-service.js +1 -1
- package/dist/src/channels/pairing/pairing-store.js +1 -1
- 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/context.js +2 -2
- package/dist/src/chat-commands/index.js +1 -1
- package/dist/src/cli/commands/agent.js +2 -2
- package/dist/src/cli/commands/browser-cli-helpers.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
- package/dist/src/cli/commands/doctor/checks/image-providers.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +2 -2
- package/dist/src/cli/commands/extension-marketplace.js +3 -3
- package/dist/src/cli/commands/extension-pack.js +1 -1
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/cli/commands/mcp.js +1 -1
- package/dist/src/cli/commands/models.js +3 -3
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +1 -1
- package/dist/src/cli/commands/runtime.js +1 -1
- package/dist/src/cli/commands/skills.js +1 -1
- package/dist/src/cli/commands/tunnel.js +1 -1
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +2 -2
- package/dist/src/computer/broker.js +1 -1
- package/dist/src/computer/runtime.js +2 -2
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/paths-state.js +1 -1
- package/dist/src/config/schema.js +2 -2
- package/dist/src/config/workspace-path.js +1 -1
- package/dist/src/connectors/cli/installer.js +1 -1
- package/dist/src/connectors/connected-source-ingestion.js +1 -1
- package/dist/src/connectors/connected-source-understanding.js +1 -1
- package/dist/src/connectors/content-enrichment.js +1 -1
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/daemon/constants.js +1 -1
- package/dist/src/daemon/install-plan.js +1 -1
- package/dist/src/daemon/launchd.js +1 -1
- package/dist/src/daemon/schtasks.js +1 -1
- package/dist/src/daemon/systemd.js +1 -1
- package/dist/src/discussions/action-tasks.js +1 -1
- package/dist/src/discussions/live-worker.js +2 -2
- package/dist/src/discussions/recording.js +2 -2
- package/dist/src/discussions/repository.js +1 -1
- package/dist/src/discussions/sealer.js +3 -3
- package/dist/src/discussions/service.js +1 -1
- package/dist/src/endpoint-tools/delegation.js +1 -1
- package/dist/src/endpoint-tools/upload-service.js +1 -1
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- package/dist/src/execution-environments/worktree-safety.js +1 -1
- package/dist/src/extensions/activation-context.js +2 -2
- package/dist/src/extensions/agent-plugins/auth.js +3 -3
- package/dist/src/extensions/agent-plugins/branding.js +1 -1
- package/dist/src/extensions/agent-plugins/cli-authorization.js +3 -3
- package/dist/src/extensions/agent-plugins/credentials.js +1 -1
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +2 -2
- package/dist/src/extensions/agent-plugins/resources.js +1 -1
- package/dist/src/extensions/agent-plugins/setup.js +1 -1
- package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
- package/dist/src/extensions/agent-plugins/source-catalog.js +2 -2
- package/dist/src/extensions/agent-plugins/source-http-fetch.js +1 -1
- package/dist/src/extensions/agent-plugins/sources.js +1 -1
- package/dist/src/extensions/agent-plugins/store.js +2 -2
- package/dist/src/extensions/agent-plugins/user-config.js +2 -2
- package/dist/src/extensions/agent-plugins/validation.js +3 -3
- package/dist/src/extensions/api.js +2 -2
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/loader.js +2 -2
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/extensions/update.js +2 -2
- package/dist/src/files/file-service.js +1 -1
- package/dist/src/gateway/agent-reactions/reaction.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +3 -3
- package/dist/src/gateway/hono/lib/static-ui.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/browser.js +261 -3
- package/dist/src/gateway/hono/routes/channels.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/device-connections.js +1 -1
- package/dist/src/gateway/hono/routes/files.js +1 -1
- package/dist/src/gateway/hono/routes/host-fs.js +1 -1
- package/dist/src/gateway/hono/routes/local-apps.js +1 -1
- package/dist/src/gateway/hono/routes/memory-learning.js +1 -1
- package/dist/src/gateway/hono/routes/mobile-capability-actions.js +3 -3
- package/dist/src/gateway/hono/routes/mobile-capability-panels.js +4 -4
- package/dist/src/gateway/hono/routes/mobile-model-settings.js +13 -5
- package/dist/src/gateway/hono/routes/models.js +6 -6
- package/dist/src/gateway/hono/routes/notes.js +1 -1
- package/dist/src/gateway/hono/routes/observability.js +1 -1
- package/dist/src/gateway/hono/routes/personal-agent.js +1 -1
- package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
- package/dist/src/gateway/hono/routes/phone.js +1 -1
- package/dist/src/gateway/hono/routes/session-command-handler.js +1 -1
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +2 -2
- package/dist/src/gateway/hono/routes/shares.js +1 -1
- package/dist/src/gateway/hono/routes/status.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/user-model.js +3 -3
- package/dist/src/gateway/hono/routes/video-generation.js +1 -1
- package/dist/src/gateway/hono/routes/voice.js +4 -4
- package/dist/src/gateway/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +2 -2
- package/dist/src/gateway/mobile-privacy.js +1 -1
- package/dist/src/gateway/next-turn-suggestions/snapshot.js +1 -1
- package/dist/src/gateway/ports.js +1 -1
- package/dist/src/gateway/provider-model-setup.js +1 -1
- package/dist/src/gateway/security/device-request-proof.js +1 -1
- package/dist/src/gateway/security/gateway-scopes.js +2 -0
- package/dist/src/gateway/service/agent-runner.js +2 -2
- package/dist/src/gateway/service/config-coordinator.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +5 -3
- package/dist/src/gateway/service/session-command-service.js +1 -1
- package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -0
- package/dist/src/gateway/service/session-input-coordinator.js +13 -3
- package/dist/src/gateway/service.d.ts +4 -0
- package/dist/src/gateway/service.js +42 -17
- package/dist/src/gateway/xopc-cloud-capability-setup.js +2 -2
- package/dist/src/home-intelligence/follow-ups.js +1 -1
- package/dist/src/home-intelligence/host.js +1 -1
- package/dist/src/home-intelligence/repository.js +1 -1
- package/dist/src/home-intelligence/routines.js +1 -1
- package/dist/src/imports/files.js +1 -1
- package/dist/src/imports/importService.js +2 -2
- package/dist/src/imports/inventory.js +1 -1
- package/dist/src/imports/planner.js +1 -1
- package/dist/src/imports/productImport.js +1 -1
- package/dist/src/imports/scanner.js +1 -1
- package/dist/src/imports/sources.js +1 -1
- package/dist/src/infra/brew.js +1 -1
- package/dist/src/infra/bus/queue.js +1 -1
- package/dist/src/infra/package-runtime-check.js +1 -1
- package/dist/src/infra/path-env.js +1 -1
- package/dist/src/infra/ports.js +1 -1
- package/dist/src/infra/process-diagnostics.js +1 -1
- package/dist/src/infra/ssh-tunnel.js +1 -1
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/infra/write-file-atomic.js +1 -1
- package/dist/src/knowledge-memory/repository.js +1 -1
- package/dist/src/knowledge-memory/usage-policy.js +1 -1
- package/dist/src/local-apps/artifact-files.js +1 -1
- package/dist/src/local-apps/execution-authority.js +1 -1
- package/dist/src/local-apps/p1-services.js +1 -1
- package/dist/src/local-apps/preview-sessions.js +1 -1
- package/dist/src/local-apps/preview-worker.js +1 -1
- package/dist/src/local-apps/public-assets.js +1 -1
- package/dist/src/local-apps/service.js +3 -3
- package/dist/src/local-apps/store.js +1 -1
- package/dist/src/markdown/index.js +1 -1
- package/dist/src/mcp/connection-grants.js +1 -1
- package/dist/src/mcp/delegation.js +3 -3
- package/dist/src/mcp/gateway-http-client.js +1 -1
- package/dist/src/media/session-references.js +1 -1
- package/dist/src/media-shared/http/provider-http.js +1 -1
- package/dist/src/media-understanding/runner.js +1 -1
- package/dist/src/memory-learning/choice-observations.js +1 -1
- package/dist/src/memory-learning/source-learning.js +2 -2
- package/dist/src/music-generation/artifact.js +2 -2
- package/dist/src/notes/agent-context.js +1 -1
- package/dist/src/notes/service.js +1 -1
- package/dist/src/notes/store.js +1 -1
- package/dist/src/notifications/store.js +1 -1
- package/dist/src/observability/runtime.js +1 -1
- package/dist/src/personal-agent/proactivity/repository.js +1 -1
- package/dist/src/personal-agent/proactivity/routes.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +3 -3
- package/dist/src/personal-agent/prompt-context.js +2 -2
- package/dist/src/personal-agent/reply-composer.js +4 -4
- package/dist/src/personal-agent/reply-style.d.ts +2 -2
- package/dist/src/personal-agent/reply-style.js +8 -7
- package/dist/src/personal-agent/request-delivery.js +1 -1
- package/dist/src/personal-agent/request-service.js +1 -1
- package/dist/src/personal-agent/result-reader.js +3 -3
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/personal-agent/unread.js +1 -1
- package/dist/src/phone/adb-driver.js +2 -2
- package/dist/src/phone/cloud-adb-connection.js +1 -1
- package/dist/src/phone/execution-trace.js +1 -1
- package/dist/src/phone/hdc-driver.js +2 -2
- package/dist/src/phone/hdc-video-tools.js +1 -1
- package/dist/src/phone/model-adapter.js +1 -1
- package/dist/src/phone/ui-session.js +1 -1
- package/dist/src/platform/index.js +1 -1
- package/dist/src/project-trust/trust-store.js +1 -1
- package/dist/src/projects/workspace-project.js +1 -1
- package/dist/src/providers/extension-stream-bridge.js +2 -2
- package/dist/src/providers/index.js +4 -4
- package/dist/src/providers/model-call.js +3 -3
- package/dist/src/providers/model-catalog-persistence.js +2 -2
- package/dist/src/providers/model-registry.js +3 -3
- package/dist/src/providers/provider-disconnect-core.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/providers/setup/voice.js +1 -1
- package/dist/src/providers/xopc-cloud-catalog-coordinator.js +1 -1
- package/dist/src/providers/xopc-cloud-credit-budget.js +1 -1
- package/dist/src/providers/xopc-cloud-model-source.js +1 -1
- package/dist/src/review/review-git.js +1 -1
- package/dist/src/runtime-tools/downloader.js +1 -1
- package/dist/src/runtime-tools/harmony-dependencies.js +1 -1
- package/dist/src/runtime-tools/manager.js +2 -2
- package/dist/src/runtime-tools/phone-dependencies.js +1 -1
- package/dist/src/session/history-recall-policy.js +1 -1
- package/dist/src/session/init-session-turn.js +1 -1
- package/dist/src/session/resolve-session.js +1 -1
- package/dist/src/share/hosted-note-publication.js +1 -1
- package/dist/src/share/hosted-session-share.js +1 -1
- package/dist/src/share/hosted-static-site-publication.js +1 -1
- package/dist/src/share/session-share-service.js +1 -1
- package/dist/src/share/share-auto.js +1 -1
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/share/site-proxy.js +1 -1
- package/dist/src/space/budget-workbook.js +1 -1
- package/dist/src/space/ingest.js +1 -1
- package/dist/src/space/repository.js +2 -2
- package/dist/src/space/workbook-turn.js +1 -1
- package/dist/src/space/worker.js +1 -1
- package/dist/src/storage/sqlite/ai-usage-repository.js +1 -1
- package/dist/src/storage/sqlite/clarification-wait-repository.js +2 -2
- package/dist/src/storage/sqlite/connection.js +2 -2
- package/dist/src/storage/sqlite/conversation-repository.js +2 -2
- package/dist/src/storage/sqlite/desktop-execution-repository.js +1 -1
- package/dist/src/storage/sqlite/desktop-execution-stop-repository.js +1 -1
- package/dist/src/storage/sqlite/device-access-repository.js +1 -1
- package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
- package/dist/src/storage/sqlite/index.js +1 -1
- package/dist/src/storage/sqlite/schema-upgrade.js +3 -3
- package/dist/src/storage/sqlite/session-creation-repository.js +1 -1
- package/dist/src/storage/sqlite/session-input-control-repository.js +1 -1
- package/dist/src/storage/sqlite/session-repository.js +1 -1
- package/dist/src/support/collect-support-report.js +1 -1
- package/dist/src/tasks/capabilities/management.js +1 -1
- package/dist/src/tasks/capabilities/relations.js +1 -1
- package/dist/src/tasks/delegated-run-result.js +1 -1
- package/dist/src/tasks/task-allocation-service.js +2 -2
- package/dist/src/tasks/task-application-service.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +2 -2
- package/dist/src/tasks/task-criterion-review-repository.js +1 -1
- package/dist/src/tasks/task-deliverables.js +1 -1
- package/dist/src/tasks/task-delivery-checks.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-handoff.js +4 -4
- package/dist/src/tasks/task-json-acceptance.js +1 -1
- package/dist/src/tasks/task-main-update-decision-service.js +1 -1
- package/dist/src/tasks/task-origin-repository.js +1 -1
- package/dist/src/tasks/task-read-model-projector.js +1 -1
- package/dist/src/tasks/task-research-repair.js +2 -2
- package/dist/src/tasks/task-research-result.js +3 -3
- package/dist/src/tasks/task-result-delivery-repository.js +1 -1
- package/dist/src/tasks/task-result-delivery-service.js +2 -2
- package/dist/src/tasks/task-run-coordinator.js +3 -3
- package/dist/src/tasks/task-run-repository.js +1 -1
- package/dist/src/tasks/task-signal-service.js +1 -1
- package/dist/src/tasks/task-workspace-verification.js +2 -2
- package/dist/src/tui/backends/embedded-backend.js +5 -5
- package/dist/src/tui/backends/embedded-drafts.js +1 -1
- package/dist/src/tui/clipboard-image.js +2 -2
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-capabilities.js +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +2 -2
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +4 -4
- package/dist/src/tunnel/frpc-binary.js +2 -2
- package/dist/src/usage/cloud-capability.js +1 -1
- package/dist/src/usage/recorder.js +2 -2
- package/dist/src/user-context/access-policy.js +2 -2
- package/dist/src/user-model/bootstrap.js +1 -1
- package/dist/src/user-model/capture/executor.js +1 -1
- package/dist/src/user-model/index.js +2 -2
- package/dist/src/user-model/usage-policy.js +1 -1
- package/dist/src/utils/index.js +1 -1
- package/dist/src/utils/logger/index.js +2 -2
- package/dist/src/utils/logger.js +1 -1
- package/dist/src/video-generation/artifact.js +2 -2
- package/dist/src/video-generation/repository.js +1 -1
- package/dist/src/voice/audio/normalize.js +1 -1
- package/dist/src/voice/platform-settings.js +1 -1
- package/dist/src/voice/realtime/conversation-context.js +1 -1
- package/dist/src/voice/realtime/memory-context.js +2 -2
- package/dist/src/voice/realtime/runtime.js +2 -2
- package/dist/src/voice/realtime/user-context.js +1 -1
- package/dist/src/voice/stt/factory.js +1 -1
- package/dist/src/voice/stt/index.js +2 -2
- package/dist/src/voice/stt/preflight.js +2 -2
- package/dist/src/voice/stt/providers/bailian-plan-transcription.js +3 -3
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +3 -3
- package/dist/src/voice/stt/transcribe-core.js +1 -1
- package/dist/src/voice/tts/factory.js +1 -1
- package/dist/src/voice/tts/providers/bailian-plan-speech.js +2 -2
- package/dist/src/voice/tts/providers/edge-speech.js +1 -1
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +2 -2
- package/dist/src/work-discovery/candidate-discovery.js +2 -2
- package/dist/src/work-discovery/probe.js +2 -2
- package/dist/src/work-discovery/service.js +4 -4
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/right-workspace-store-CcRApllu.js +0 -1
|
@@ -2,13 +2,15 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
4
4
|
import { parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
|
|
5
|
+
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
6
|
+
import { getUserTimezone } from "../user-model/repository.js";
|
|
5
7
|
import { init_model_usage, withModelUsageOrigin } from "../providers/model-usage.js";
|
|
8
|
+
import { runWithEmbeddedExecutionSession } from "./embedded/execution-context.js";
|
|
9
|
+
import { configureTracing, flushTracing } from "../observability/runtime.js";
|
|
10
|
+
import { persistInboundAttachments } from "../channels/attachments/inbound-persist.js";
|
|
6
11
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
7
|
-
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
8
12
|
import { extractProfileAgentId, resolveEffectiveAgentConfigForSession } from "../config/agent-profile.js";
|
|
9
13
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
10
|
-
import { configureTracing, flushTracing } from "../observability/runtime.js";
|
|
11
|
-
import { getUserTimezone } from "../user-model/repository.js";
|
|
12
14
|
import { extractTextContent } from "./context/workspace.js";
|
|
13
15
|
import { resolveAgentTurnTimeoutMs } from "./orchestration/run-agent-turn-with-timeout.js";
|
|
14
16
|
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
@@ -20,9 +22,7 @@ import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "./ski
|
|
|
20
22
|
import { removeSkillsLockEntry } from "./skills/hub-lock.js";
|
|
21
23
|
import { installSkillFromZip } from "./skills/managed-store.js";
|
|
22
24
|
import { pullSkillFromSource } from "./skills/hub-pull.js";
|
|
23
|
-
import { persistInboundAttachments } from "../channels/attachments/inbound-persist.js";
|
|
24
25
|
import { buildTranscriptUserMessage, hydrateUserTurnForLlm } from "./inbound/attachment-pipeline.js";
|
|
25
|
-
import { runWithEmbeddedExecutionSession } from "./embedded/execution-context.js";
|
|
26
26
|
import { resolveResponseLanguageForSession } from "./prompt/response-language.js";
|
|
27
27
|
import { resolveAvailableTaskModels, resolveTurnModelRefs } from "./models/turn-candidates.js";
|
|
28
28
|
import { normalizeSkillInstallTarget } from "./skills/install-target.js";
|
|
@@ -831,8 +831,10 @@ var AgentService = class {
|
|
|
831
831
|
await this.cancelConfigurationSetups(key);
|
|
832
832
|
const { getPhoneRuntime } = await import("../phone/runtime.js");
|
|
833
833
|
const { cancelPhoneAssistance } = await import("../phone/assistance.js");
|
|
834
|
+
const { cancelBrowserAssistance } = await import("../browser/assistance.js");
|
|
834
835
|
cancelPhoneAssistance(key);
|
|
835
836
|
await getPhoneRuntime().stop(key, "close");
|
|
837
|
+
cancelBrowserAssistance(key);
|
|
836
838
|
const task = await this.sessionStore.reset(key);
|
|
837
839
|
if (!task) return null;
|
|
838
840
|
this.agentManager.removeAgent(key);
|
|
@@ -2,11 +2,11 @@ import { createLogger } from "../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { chooseModelThinking } from "../../../packages/gateway-contract/src/model-selection.js";
|
|
4
4
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
5
|
+
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
5
6
|
import { ResponseLanguageSchema, init_response_language } from "../../i18n/response-language.js";
|
|
6
7
|
import { resolveEffectiveAgentConfigForSession } from "../../config/agent-profile.js";
|
|
7
8
|
import { normalizeWorkingDirectoryInput } from "../../session/session-workspace.js";
|
|
8
9
|
import { getProjectWorkspacePathForSession } from "../../projects/workspace.js";
|
|
9
|
-
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
10
10
|
import { getModelThinking } from "../../providers/model-thinking.js";
|
|
11
11
|
import { normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel } from "../transcript/thinking-types.js";
|
|
12
12
|
import "../../session/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join, relative } from "node:path";
|
|
2
|
-
import { createReadStream, existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
3
2
|
import { createHash } from "node:crypto";
|
|
3
|
+
import { createReadStream, existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
4
4
|
//#region src/agent/skills/hub-hash.ts
|
|
5
5
|
/**
|
|
6
6
|
* Deterministic content hash for a skill directory (for hub lock / drift detection).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
1
|
import { init_paths, resolveSkillsLockPath } from "../../config/paths.js";
|
|
2
|
+
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
//#region src/agent/skills/hub-lock.ts
|
|
5
5
|
/**
|
|
@@ -3,13 +3,13 @@ import { formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
|
3
3
|
import { computeSkillTreeHashSync } from "./hub-hash.js";
|
|
4
4
|
import { getSkillsLockEntry, recordSkillsHubInstall } from "./hub-lock.js";
|
|
5
5
|
import { installSkillFromZip, isIgnorableZipEntry, isValidSkillId, prepareManagedSkillTempDir, promoteManagedSkillTempDir } from "./managed-store.js";
|
|
6
|
-
import { tmpdir } from "node:os";
|
|
7
6
|
import { basename, dirname, join, normalize, resolve, sep } from "node:path";
|
|
7
|
+
import { tmpdir } from "node:os";
|
|
8
8
|
import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
9
|
-
import { fileURLToPath } from "node:url";
|
|
10
9
|
import { execFileSync } from "node:child_process";
|
|
11
|
-
import
|
|
10
|
+
import { fileURLToPath } from "node:url";
|
|
12
11
|
import { fetch } from "undici";
|
|
12
|
+
import AdmZip from "adm-zip";
|
|
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,8 +1,8 @@
|
|
|
1
1
|
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
|
-
import { init_paths } from "../../config/paths.js";
|
|
5
4
|
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
5
|
+
import { init_paths } from "../../config/paths.js";
|
|
6
6
|
import { findInstallSpec, hasBinary, installSkill } from "./installer.js";
|
|
7
7
|
import { applySkillEnvOverrides, createSkillConfigManager, getSkillEnvironment, isSkillEnabled, resolveSkillConfig, validateSkillConfig } from "./config.js";
|
|
8
8
|
import { parseSkillToolConditions } from "./skill-tool-gating.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
2
1
|
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
2
|
+
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
3
3
|
import { loadSkillsLock } from "./hub-lock.js";
|
|
4
4
|
import { dirname, join, resolve, sep } from "node:path";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
2
1
|
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
2
|
+
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
3
3
|
import { resolveWorkspaceSkillsDir } from "./workspace-skills-dir.js";
|
|
4
4
|
import { formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
5
5
|
import { fuzzyFindText, normalizeForFuzzyMatch, normalizeToLF, restoreLineEndings } from "../tools/edit-diff.js";
|
|
@@ -2,8 +2,8 @@ import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
|
2
2
|
import { resolvePluginCapabilityAccess } from "../../extensions/agent-plugins/capability-access.js";
|
|
3
3
|
import { AgentPluginStore } from "../../extensions/agent-plugins/store.js";
|
|
4
4
|
import { resolveWorkspaceSkillsDir } from "./workspace-skills-dir.js";
|
|
5
|
-
import { homedir } from "node:os";
|
|
6
5
|
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
6
|
+
import { homedir } from "node:os";
|
|
7
7
|
import { existsSync, realpathSync } from "node:fs";
|
|
8
8
|
//#region src/agent/skills/skill-sources.ts
|
|
9
9
|
init_paths();
|
|
@@ -1,13 +1,59 @@
|
|
|
1
|
+
import { getEmbeddedExecutionRunId } from "../../../embedded/execution-context.js";
|
|
1
2
|
import { formatBrowserObservation } from "../../../../browser/observation/format.js";
|
|
3
|
+
import { requireBrowserAssistance } from "../../../../browser/assistance.js";
|
|
2
4
|
import { BrowserUseSchema, browserUseInputError, decodeBrowserUseInput } from "./schemas.js";
|
|
3
5
|
//#region src/agent/tools/browser/tool/browser-use-tool.ts
|
|
4
6
|
function createBrowserUseTool(deps) {
|
|
5
7
|
return {
|
|
6
8
|
name: "browser_use",
|
|
7
9
|
label: "🌐 Browser",
|
|
8
|
-
description: "Control a persistent browser through typed semantic actions. Start with observe or navigate. Every click, fill, select, press, scroll, wait, upload, and sequence requires the numeric revision from the latest observation, even without an element ref. Use refs from that same observation. Read visible data from the latest observation, including labeled textbox values. Once the requested result is visible, report it and finish. Keep any verification in this browser session. Screenshots are attached only when requested or semantic observation is insufficient.",
|
|
10
|
+
description: "Control a persistent browser through typed semantic actions. Start with observe or navigate. Every click, fill, select, press, scroll, wait, upload, and sequence requires the numeric revision from the latest observation, even without an element ref. Use refs from that same observation. When a page requires manual login, CAPTCHA, MFA, or explicit user confirmation in the managed browser, call action=\"request_user\" with a short reason to pause and let the user take over the live browser tab. Read visible data from the latest observation, including labeled textbox values. Once the requested result is visible, report it and finish. Keep any verification in this browser session. Screenshots are attached only when requested or semantic observation is insufficient.",
|
|
9
11
|
parameters: BrowserUseSchema,
|
|
10
|
-
async execute(
|
|
12
|
+
async execute(toolCallId, params, signal) {
|
|
13
|
+
if (params.action === "request_user") {
|
|
14
|
+
const reason = typeof params.reason === "string" && params.reason.trim() ? params.reason.trim().slice(0, 400) : "需要在浏览器中完成登录或人工确认。";
|
|
15
|
+
const conversationId = deps.getTaskId();
|
|
16
|
+
const runtime = deps.getRuntime();
|
|
17
|
+
const liveHandle = runtime.getLiveHandle(conversationId);
|
|
18
|
+
const browserSessionId = params.sessionId || liveHandle?.sessionId || runtime.getSessionId(conversationId);
|
|
19
|
+
const runId = getEmbeddedExecutionRunId();
|
|
20
|
+
if (!browserSessionId || !runId) return {
|
|
21
|
+
content: [{
|
|
22
|
+
type: "text",
|
|
23
|
+
text: "[INVALID_INPUT] Start a browser session first before requesting user takeover."
|
|
24
|
+
}],
|
|
25
|
+
details: {
|
|
26
|
+
ok: false,
|
|
27
|
+
kind: "browser_error",
|
|
28
|
+
error: {
|
|
29
|
+
code: "INVALID_INPUT",
|
|
30
|
+
message: "No active browser session for takeover."
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
runtime.pinSession(conversationId);
|
|
35
|
+
const url = liveHandle?.getUrl() ?? "";
|
|
36
|
+
const wait = requireBrowserAssistance(conversationId, runId, toolCallId, {
|
|
37
|
+
browserSessionId,
|
|
38
|
+
reason,
|
|
39
|
+
url,
|
|
40
|
+
title: liveHandle ? await liveHandle.getTitle().catch(() => "") : ""
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
content: [{
|
|
44
|
+
type: "text",
|
|
45
|
+
text: reason
|
|
46
|
+
}],
|
|
47
|
+
details: {
|
|
48
|
+
ok: true,
|
|
49
|
+
kind: "browser_assistance_required",
|
|
50
|
+
waitId: wait.id,
|
|
51
|
+
reason,
|
|
52
|
+
browserSessionId,
|
|
53
|
+
url
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
11
57
|
const input = decodeBrowserUseInput(params);
|
|
12
58
|
if (!input) {
|
|
13
59
|
const message = browserUseInputError(params.action, params.revision);
|
|
@@ -190,7 +190,7 @@ export declare const BrowserUseActionSchema: import("@sinclair/typebox").TUnion<
|
|
|
190
190
|
sessionId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
191
191
|
}>]>;
|
|
192
192
|
export declare const BrowserUseSchema: import("@sinclair/typebox").TObject<{
|
|
193
|
-
action: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"observe">, import("@sinclair/typebox").TLiteral<"navigate">, import("@sinclair/typebox").TLiteral<"click">, import("@sinclair/typebox").TLiteral<"fill">, import("@sinclair/typebox").TLiteral<"select">, import("@sinclair/typebox").TLiteral<"press">, import("@sinclair/typebox").TLiteral<"scroll">, import("@sinclair/typebox").TLiteral<"wait">, import("@sinclair/typebox").TLiteral<"upload">, import("@sinclair/typebox").TLiteral<"tabs">, import("@sinclair/typebox").TLiteral<"sequence">, import("@sinclair/typebox").TLiteral<"close">]>;
|
|
193
|
+
action: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"observe">, import("@sinclair/typebox").TLiteral<"navigate">, import("@sinclair/typebox").TLiteral<"click">, import("@sinclair/typebox").TLiteral<"fill">, import("@sinclair/typebox").TLiteral<"select">, import("@sinclair/typebox").TLiteral<"press">, import("@sinclair/typebox").TLiteral<"scroll">, import("@sinclair/typebox").TLiteral<"wait">, import("@sinclair/typebox").TLiteral<"upload">, import("@sinclair/typebox").TLiteral<"tabs">, import("@sinclair/typebox").TLiteral<"sequence">, import("@sinclair/typebox").TLiteral<"request_user">, import("@sinclair/typebox").TLiteral<"close">]>;
|
|
194
194
|
sessionId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
195
195
|
revision: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
196
196
|
ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -268,6 +268,7 @@ export declare const BrowserUseSchema: import("@sinclair/typebox").TObject<{
|
|
|
268
268
|
state: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"visible">, import("@sinclair/typebox").TLiteral<"hidden">]>>;
|
|
269
269
|
}>>;
|
|
270
270
|
}>]>>>;
|
|
271
|
+
reason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
271
272
|
}>;
|
|
272
273
|
export type BrowserUseInput = Static<typeof BrowserUseSchema>;
|
|
273
274
|
export declare function browserUseInputError(action: string, revision: unknown): string;
|
|
@@ -163,6 +163,7 @@ const BrowserUseSchema = Type.Object({
|
|
|
163
163
|
Type.Literal("upload"),
|
|
164
164
|
Type.Literal("tabs"),
|
|
165
165
|
Type.Literal("sequence"),
|
|
166
|
+
Type.Literal("request_user"),
|
|
166
167
|
Type.Literal("close")
|
|
167
168
|
]),
|
|
168
169
|
sessionId: SessionId,
|
|
@@ -203,6 +204,11 @@ const BrowserUseSchema = Type.Object({
|
|
|
203
204
|
steps: Type.Optional(Type.Array(SequenceStep, {
|
|
204
205
|
minItems: 1,
|
|
205
206
|
maxItems: 10
|
|
207
|
+
})),
|
|
208
|
+
reason: Type.Optional(Type.String({
|
|
209
|
+
minLength: 1,
|
|
210
|
+
maxLength: 400,
|
|
211
|
+
description: "Short explanation shown to the user when requesting manual browser takeover (login, CAPTCHA, MFA, confirmation)."
|
|
206
212
|
}))
|
|
207
213
|
}, { additionalProperties: false });
|
|
208
214
|
const ACTION_FIELDS = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { buildOutboundMediaMetadata } from "./tool-media.js";
|
|
3
4
|
import { Type } from "@sinclair/typebox";
|
|
4
5
|
//#region src/agent/tools/communication.ts
|
|
5
6
|
init_logger();
|
|
@@ -74,13 +75,19 @@ When TTS is enabled, you may also use the \`text_to_speech\` tool to send a stan
|
|
|
74
75
|
const channel = requestedChannel || ctx.channel;
|
|
75
76
|
const chatId = requestedChatId || ctx.chatId;
|
|
76
77
|
const accountId = p.accountId?.trim();
|
|
78
|
+
const mediaUrl = p.mediaUrl?.trim() || (p.buffer ? `data:${p.contentType?.trim() || "application/octet-stream"};base64,${p.buffer}` : void 0);
|
|
79
|
+
const baseMeta = !requestedChannel ? ctx?.metadata : void 0;
|
|
80
|
+
const metadata = buildOutboundMediaMetadata(accountId ? {
|
|
81
|
+
...baseMeta,
|
|
82
|
+
accountId
|
|
83
|
+
} : baseMeta, p.filename?.trim() || void 0);
|
|
77
84
|
try {
|
|
78
85
|
const msg = {
|
|
79
86
|
channel,
|
|
80
87
|
chat_id: chatId,
|
|
81
88
|
content: p.content,
|
|
82
|
-
...
|
|
83
|
-
mediaUrl
|
|
89
|
+
...metadata ? { metadata } : {},
|
|
90
|
+
mediaUrl,
|
|
84
91
|
mediaType: p.mediaType,
|
|
85
92
|
replyToMessageId: p.replyTo,
|
|
86
93
|
quoteText: p.quoteText,
|
|
@@ -92,7 +99,7 @@ When TTS is enabled, you may also use the \`text_to_speech\` tool to send a stan
|
|
|
92
99
|
return {
|
|
93
100
|
content: [{
|
|
94
101
|
type: "text",
|
|
95
|
-
text: `✅ Message sent${
|
|
102
|
+
text: `✅ Message sent${mediaUrl ? ` + ${p.mediaType || "media"}` : ""}${p.replyTo ? " (as reply)" : ""}`
|
|
96
103
|
}],
|
|
97
104
|
details: {}
|
|
98
105
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { getDelegationScope } from "../orchestration/delegation-scope.js";
|
|
1
2
|
import { researchResumeContext } from "../orchestration/research-checkpoint.js";
|
|
2
3
|
import { claimResearchCheckpoint, createResearchCheckpoint, finishResearchCheckpoint, getResearchCheckpoint, recordResearchEvidence, recordResearchSearch, saveResearchCheckpoint } from "../../storage/sqlite/research-checkpoint-repository.js";
|
|
3
4
|
import { resolveAgentAbortReason } from "../orchestration/run-termination.js";
|
|
4
5
|
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
5
6
|
import { EXTERNAL_TOOL_NAMES } from "../external-tools/gateway-tools.js";
|
|
6
7
|
import "../external-tools/index.js";
|
|
7
|
-
import { getDelegationScope } from "../orchestration/delegation-scope.js";
|
|
8
8
|
import { runGit } from "../../execution-environments/git.js";
|
|
9
9
|
import { LocalWorktreeManager } from "../../execution-environments/local-worktree-manager.js";
|
|
10
10
|
import { SessionEnvironmentService } from "../../execution-environments/session-environment-service.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { evaluateExecPolicy } from "../sandbox/exec-policy.js";
|
|
1
2
|
import { runProcess } from "../../process/run-process.js";
|
|
2
3
|
import { getEmbeddedCommandYieldSignal } from "../embedded/runs.js";
|
|
3
4
|
import { getSessionInteractionPolicy } from "../session/interaction-policy-state.js";
|
|
4
5
|
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
5
6
|
import { commandRegistry, commandTimeout } from "../commands/command-registry.js";
|
|
6
7
|
import "../session/interaction-policy.js";
|
|
7
|
-
import { evaluateExecPolicy } from "../sandbox/exec-policy.js";
|
|
8
8
|
import { formatSize, truncateTail } from "./truncate.js";
|
|
9
9
|
import { publishArtifactPaths } from "./publish-artifacts.js";
|
|
10
10
|
import { classifyVerificationCommand } from "../coding/verification-command.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { withRetry } from "../../infra/retry.js";
|
|
3
4
|
import { commandTimeout } from "../commands/command-registry.js";
|
|
4
5
|
import { DEFAULT_TOOL_EXECUTION_TIMEOUT_MS, TimeoutError, executeWithTimeout } from "../lifecycle/timeout-wrapper.js";
|
|
5
|
-
import { withRetry } from "../../infra/retry.js";
|
|
6
6
|
import { ToolConcurrencyController, resolveToolLockMode } from "./concurrency.js";
|
|
7
7
|
//#region src/agent/tools/executor.ts
|
|
8
8
|
init_logger();
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { init_paths_state, 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
|
+
import { getExecutionAuthority } from "../../infra/execution-authority.js";
|
|
4
5
|
import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
|
|
5
|
-
import { getBrowserTabBinding } from "../../storage/sqlite/browser-tab-binding-repository.js";
|
|
6
6
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
7
|
+
import { getBrowserTabBinding } from "../../storage/sqlite/browser-tab-binding-repository.js";
|
|
7
8
|
import { init_request_repository, personalRequestForExecution } from "../../personal-agent/request-repository.js";
|
|
8
9
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
9
10
|
import { patchSessionMetadata } from "../../storage/sqlite/session-repository.js";
|
|
@@ -11,16 +12,15 @@ import { getSessionTaskPlan, setSessionTaskPlan } from "../../storage/sqlite/ses
|
|
|
11
12
|
import "../../storage/sqlite/index.js";
|
|
12
13
|
import { getConversationRouting } from "../../storage/sqlite/conversation-repository.js";
|
|
13
14
|
import { init_session_key } from "../../routing/session-key.js";
|
|
15
|
+
import { getEmbeddedExecutionRunId, getEmbeddedExecutionSession } from "../embedded/execution-context.js";
|
|
14
16
|
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
15
17
|
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
16
|
-
import { getExecutionAuthority } from "../../infra/execution-authority.js";
|
|
17
18
|
import { canRecallConversation, canRecallHistoryEntry } from "../../session/history-recall-policy.js";
|
|
18
19
|
import { getExecutionEnvironmentForSession } from "../../execution-environments/subject.js";
|
|
19
20
|
import { buildRuntimeEnvironment } from "../../runtime-tools/environment.js";
|
|
20
21
|
import { skillEnvironmentId } from "../skills/installer.js";
|
|
21
22
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
22
23
|
import { getActiveTranscriptUserText, getPendingTranscriptUserText } from "../inbound/attachment-pipeline.js";
|
|
23
|
-
import { getEmbeddedExecutionRunId, getEmbeddedExecutionSession } from "../embedded/execution-context.js";
|
|
24
24
|
import { getSessionInteractionPolicy } from "../session/interaction-policy-state.js";
|
|
25
25
|
import "../session/interaction-policy.js";
|
|
26
26
|
import { PERSONAL_TOOL_DESCRIPTIONS } from "../../personal-agent/policy.js";
|
|
@@ -224,6 +224,13 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
224
224
|
source
|
|
225
225
|
});
|
|
226
226
|
},
|
|
227
|
+
publishManagedLive: (conversationId, source) => {
|
|
228
|
+
this.deps.emitBrowserEvent?.("browser.managed.live", {
|
|
229
|
+
conversationId,
|
|
230
|
+
source,
|
|
231
|
+
runtime: this.browserRuntime
|
|
232
|
+
});
|
|
233
|
+
},
|
|
227
234
|
resolveTarget: (conversationId) => {
|
|
228
235
|
const binding = getBrowserTabBinding(conversationId);
|
|
229
236
|
if (binding) return {
|
|
@@ -387,7 +394,9 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
387
394
|
const imageGenerateTool = createImageGenerateTool({
|
|
388
395
|
config: cfg,
|
|
389
396
|
workspace,
|
|
390
|
-
agentId: options?.agentId ?? (cfg ? resolveDefaultAgentId() : "main")
|
|
397
|
+
agentId: options?.agentId ?? (cfg ? resolveDefaultAgentId() : "main"),
|
|
398
|
+
bus,
|
|
399
|
+
getContext: () => executionToolPolicy.taskExecution || currentConversationId() && getSessionMetadata(currentConversationId())?.sessionType === "heartbeat" ? null : this.deps.getCurrentContext()
|
|
391
400
|
});
|
|
392
401
|
const agentId = options?.agentId;
|
|
393
402
|
const resolvedAgentId = agentId ?? (executionConversationId ? getSessionMetadata(executionConversationId)?.agentId : void 0) ?? (cfg ? resolveDefaultAgentId() : "main");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { checkUrlSafety, checkWebsiteBlocklist } from "./url-safety.js";
|
|
2
|
-
import { lookup } from "node:dns";
|
|
3
2
|
import { Agent, fetch } from "undici";
|
|
3
|
+
import { lookup } from "node:dns";
|
|
4
4
|
//#region src/agent/tools/fetch-text.ts
|
|
5
5
|
/** Validate each redirect and the address actually used for the connection. */
|
|
6
6
|
async function fetchPublicText(input, blocklist, signal) {
|
|
@@ -2,6 +2,7 @@ import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
|
2
2
|
import type { Config } from '../../config/schema.js';
|
|
3
3
|
import { parseImageDataUrl } from '../image/generation/image-assets.js';
|
|
4
4
|
import type { ToolModelConfig } from '../image/tool-model-config.js';
|
|
5
|
+
import type { MessageBus } from '../../infra/bus/index.js';
|
|
5
6
|
export { parseImageDataUrl };
|
|
6
7
|
export declare function resolveImageGenerationModelConfigForTool(params: {
|
|
7
8
|
cfg?: Config;
|
|
@@ -11,4 +12,10 @@ export declare function createImageGenerateTool(options: {
|
|
|
11
12
|
config?: Config;
|
|
12
13
|
workspace: string;
|
|
13
14
|
agentId: string;
|
|
15
|
+
bus?: MessageBus;
|
|
16
|
+
getContext?: () => {
|
|
17
|
+
channel: string;
|
|
18
|
+
chatId: string;
|
|
19
|
+
metadata?: Record<string, unknown>;
|
|
20
|
+
} | null;
|
|
14
21
|
}): AgentTool<any, Record<string, unknown>> | null;
|
|
@@ -4,7 +4,8 @@ import "../../capabilities/readiness/index.js";
|
|
|
4
4
|
import { applyImageGenerationModelConfigDefaults } from "../image/image-helpers.js";
|
|
5
5
|
import { readWorkspaceFile, writeWorkspaceFile } from "../sandbox/fileAccess.js";
|
|
6
6
|
import { imageAssetFromDataUrl, imageFileExtensionForMimeType, mimeTypeFromFileName, parseImageDataUrl, sniffImageMimeType } from "../image/generation/image-assets.js";
|
|
7
|
-
import { persistToolMedia } from "./tool-media.js";
|
|
7
|
+
import { buildOutboundMediaMetadata, persistToolMedia } from "./tool-media.js";
|
|
8
|
+
import { isExternalMessagingChannel } from "../../channels/internal-outbound.js";
|
|
8
9
|
import { isFailoverError } from "../failover-error.js";
|
|
9
10
|
import { getImageGenerationProvider } from "../image/generation/provider-registry.js";
|
|
10
11
|
import { generateImage, listImageGenerationProvidersSummary } from "../image/generation/runtime.js";
|
|
@@ -288,11 +289,30 @@ function createImageGenerateTool(options) {
|
|
|
288
289
|
filePath: paths[index],
|
|
289
290
|
mediaType: "photo"
|
|
290
291
|
})));
|
|
292
|
+
const deliveryCtx = options.getContext?.();
|
|
293
|
+
let deliveredToChannel;
|
|
294
|
+
if (options.bus && deliveryCtx && isExternalMessagingChannel(deliveryCtx.channel)) {
|
|
295
|
+
for (let index = 0; index < result.images.length; index += 1) {
|
|
296
|
+
const image = result.images[index];
|
|
297
|
+
const item = media[index];
|
|
298
|
+
const outboundMetadata = buildOutboundMediaMetadata(deliveryCtx.metadata, item.name);
|
|
299
|
+
await options.bus.publishOutbound({
|
|
300
|
+
channel: deliveryCtx.channel,
|
|
301
|
+
chat_id: deliveryCtx.chatId,
|
|
302
|
+
content: "",
|
|
303
|
+
mediaUrl: `data:${item.mimeType};base64,${image.buffer.toString("base64")}`,
|
|
304
|
+
mediaType: "photo",
|
|
305
|
+
...outboundMetadata ? { metadata: outboundMetadata } : {}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
deliveredToChannel = deliveryCtx.channel;
|
|
309
|
+
}
|
|
291
310
|
return {
|
|
292
311
|
content: [{
|
|
293
312
|
type: "text",
|
|
294
313
|
text: [
|
|
295
314
|
`Generated and published ${paths.length} image(s) with ${result.provider}/${result.model}.`,
|
|
315
|
+
...deliveredToChannel ? [`Delivered ${paths.length} image(s) directly to ${deliveredToChannel}.`] : [],
|
|
296
316
|
"In a Task, select the returned artifact IDs in publish_task_result.finalArtifactIds for final delivery. Publication alone does not confirm delivery to the originating chat.",
|
|
297
317
|
...paths.map((p) => `Saved: ${p}`)
|
|
298
318
|
].join("\n")
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { evaluateExecPolicy } from "../sandbox/exec-policy.js";
|
|
1
2
|
import { getEmbeddedCommandYieldSignal } from "../embedded/runs.js";
|
|
2
3
|
import { getSessionInteractionPolicy } from "../session/interaction-policy-state.js";
|
|
3
4
|
import { commandRegistry, commandTimeout } from "../commands/command-registry.js";
|
|
4
5
|
import "../session/interaction-policy.js";
|
|
5
|
-
import { evaluateExecPolicy } from "../sandbox/exec-policy.js";
|
|
6
6
|
import { resolve } from "node:path";
|
|
7
7
|
import { Type } from "@sinclair/typebox";
|
|
8
8
|
//#region src/agent/tools/managed-job-tool.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getSqliteDatabase, init_transaction } from "../../storage/sqlite/transaction.js";
|
|
2
2
|
import { init_session_instance_repository, readCurrentTranscriptId } from "../../storage/sqlite/session-instance-repository.js";
|
|
3
|
-
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
4
3
|
import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
|
|
4
|
+
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
5
5
|
import { boundedPersonalResult } from "./personal-result-budget.js";
|
|
6
6
|
import { parseLocalCheckTime } from "../../personal-agent/proactivity/follow-up-request.js";
|
|
7
7
|
import { applyThreadFeedback, getAttention, getProactivitySettings, listAttention, listInterestCandidates, patchAttention, patchProactivitySettings, rollbackStrategy, saveAttention, strategyState, userText } from "../../personal-agent/proactivity/repository.js";
|
|
@@ -3,6 +3,9 @@ import { createCollaborationRule } from "../../storage/sqlite/collaboration-rule
|
|
|
3
3
|
import { createContextEvidence } from "../../storage/sqlite/context-evidence-repository.js";
|
|
4
4
|
import { init_session_instance_repository, readCurrentTranscriptId } from "../../storage/sqlite/session-instance-repository.js";
|
|
5
5
|
import { init_changes, notifyUserContextChange } from "../../user-context/changes.js";
|
|
6
|
+
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, reconcileAssertion, setAssertionStatus, setUserAssertionScope } from "../../user-model/repository.js";
|
|
7
|
+
import { canUseAssertion } from "../../user-model/usage-policy.js";
|
|
8
|
+
import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
|
|
6
9
|
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
7
10
|
import { learningRoleSql, learningTranscriptMessage } from "../../memory-learning/transcript-source.js";
|
|
8
11
|
import { inferMemorySensitivity } from "../memory/sensitivity.js";
|
|
@@ -11,9 +14,6 @@ import { deleteKnowledgeItem, getKnowledgeItem, reviewKnowledgeItem, setKnowledg
|
|
|
11
14
|
import "../../knowledge-memory/index.js";
|
|
12
15
|
import { ownerExcludesGlobalScope, ownerMemoryScope, standingToolScope } from "../../user-model/capture/evidence-policy.js";
|
|
13
16
|
import { isUnquotedOwnerEvidence } from "../../memory-learning/owner-directive.js";
|
|
14
|
-
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, reconcileAssertion, setAssertionStatus, setUserAssertionScope } from "../../user-model/repository.js";
|
|
15
|
-
import { canUseAssertion } from "../../user-model/usage-policy.js";
|
|
16
|
-
import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
|
|
17
17
|
import "../../user-model/index.js";
|
|
18
18
|
import { getSessionInteractionPolicy } from "../session/interaction-policy-state.js";
|
|
19
19
|
import "../session/interaction-policy.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
|
|
1
2
|
import { turnOutcomeKindFromFileName, turnOutcomeMimeTypeFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
2
3
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
4
|
import { fileResourceId, fileSpaceId } from "../../files/file-service.js";
|
|
4
5
|
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
5
|
-
import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
|
|
6
6
|
import { readWorkspaceFile } from "../sandbox/fileAccess.js";
|
|
7
7
|
import { persistToolMedia } from "./tool-media.js";
|
|
8
8
|
import { basename, isAbsolute, relative, sep } from "node:path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { checkFileSafety } from "../prompt/safety.js";
|
|
1
2
|
import { isBareProfileMarkdownFileName, resolvePathUnderWorkspace, resolveProfileMarkdownPathIfBareName } from "./tool-paths.js";
|
|
2
3
|
import { checkedFilePath, readWorkspaceFileAsync } from "../sandbox/fileAccess.js";
|
|
3
|
-
import { checkFileSafety } from "../prompt/safety.js";
|
|
4
4
|
import { dataScheduler } from "../data-acquisition/scheduler.js";
|
|
5
5
|
import { formatSize, truncateHead } from "./truncate.js";
|
|
6
6
|
import { stat } from "fs/promises";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { prepareSafeToolEnv } from "../sandbox/sanitize-env-vars.js";
|
|
2
|
-
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
3
2
|
import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
|
|
3
|
+
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
4
4
|
import { checkedFilePath, readWorkspaceFile } from "../sandbox/fileAccess.js";
|
|
5
5
|
import { resolve } from "node:path";
|
|
6
|
-
import { execFile } from "node:child_process";
|
|
7
6
|
import { promisify } from "node:util";
|
|
7
|
+
import { execFile } from "node:child_process";
|
|
8
8
|
import { lstat, readlink, realpath } from "node:fs/promises";
|
|
9
9
|
import { Type } from "@sinclair/typebox";
|
|
10
10
|
//#region src/agent/tools/review-workspace.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { checkedFilePath, readWorkspaceFile, writeWorkspaceFile } from "../sandbox/fileAccess.js";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
|
-
import { existsSync, readdirSync } from "node:fs";
|
|
4
3
|
import { createHash } from "node:crypto";
|
|
4
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
5
5
|
import { Type } from "@sinclair/typebox";
|
|
6
6
|
//#region src/agent/tools/scoped-workspace-tools.ts
|
|
7
7
|
/** Bounded file capability shared by background task executors; no command authority. */
|
|
@@ -3,6 +3,7 @@ import type { MessageBus } from '../../infra/bus/index.js';
|
|
|
3
3
|
interface MessageContext {
|
|
4
4
|
channel: string;
|
|
5
5
|
chatId: string;
|
|
6
|
+
metadata?: Record<string, unknown>;
|
|
6
7
|
}
|
|
7
8
|
export declare function createSendMediaTool(workspace: string, bus: MessageBus, getContext: () => MessageContext | null): AgentTool;
|
|
8
9
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { checkFileSafety } from "../prompt/safety.js";
|
|
1
2
|
import { turnOutcomeKindFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
2
3
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
4
|
import { MEDIA_MAX_BYTES } from "../../media/store.js";
|
|
4
5
|
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
5
6
|
import { readWorkspaceFile } from "../sandbox/fileAccess.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
7
|
+
import { buildOutboundMediaMetadata, persistToolMedia } from "./tool-media.js";
|
|
8
|
+
import { isExternalMessagingChannel } from "../../channels/internal-outbound.js";
|
|
8
9
|
import { basename } from "node:path";
|
|
9
10
|
import { Type } from "@sinclair/typebox";
|
|
10
11
|
//#region src/agent/tools/send-media.ts
|
|
@@ -51,13 +52,15 @@ function createSendMediaTool(workspace, bus, getContext) {
|
|
|
51
52
|
filePath: resolved,
|
|
52
53
|
...p.mediaType ? { mediaType: p.mediaType } : {}
|
|
53
54
|
});
|
|
54
|
-
if (ctx.channel
|
|
55
|
+
if (isExternalMessagingChannel(ctx.channel)) {
|
|
56
|
+
const outboundMetadata = buildOutboundMediaMetadata(ctx.metadata, media.name);
|
|
55
57
|
const msg = {
|
|
56
58
|
channel: ctx.channel,
|
|
57
59
|
chat_id: ctx.chatId,
|
|
58
60
|
content: p.caption || "",
|
|
59
61
|
mediaUrl: `data:${media.mimeType};base64,${fileBuffer.toString("base64")}`,
|
|
60
|
-
mediaType: media.type
|
|
62
|
+
mediaType: media.type,
|
|
63
|
+
...outboundMetadata ? { metadata: outboundMetadata } : {}
|
|
61
64
|
};
|
|
62
65
|
await bus.publishOutbound(msg);
|
|
63
66
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { getSqliteDatabase, init_transaction } from "../../storage/sqlite/transaction.js";
|
|
2
1
|
import { parseResultReferenceId } from "../../../packages/gateway-contract/src/result-reference.js";
|
|
3
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
|
+
import { getSqliteDatabase, init_transaction } from "../../storage/sqlite/transaction.js";
|
|
4
4
|
import { TaskRepository, init_task_repository } from "../../tasks/task-repository.js";
|
|
5
5
|
import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-run-repository.js";
|
|
6
6
|
import { init_request_repository, personalRequestForExecution } from "../../personal-agent/request-repository.js";
|
|
7
7
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
8
8
|
import { init_session_repository } from "../../storage/sqlite/session-repository.js";
|
|
9
|
+
import { getEmbeddedExecutionSession } from "../embedded/execution-context.js";
|
|
9
10
|
import { assertTaskHandoffExecutorAccess, getTaskHandoff, materializeTaskHandoffFile, readTaskConversationExcerpts, readTaskHandoffSource } from "../../tasks/task-handoff.js";
|
|
10
11
|
import { TaskReadModelProjector } from "../../tasks/task-read-model-projector.js";
|
|
11
12
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
12
13
|
import { TaskCollaborationRepository } from "../../tasks/task-collaboration-repository.js";
|
|
13
|
-
import { getEmbeddedExecutionSession } from "../embedded/execution-context.js";
|
|
14
14
|
import { taskResearchEvidence } from "../../tasks/task-research-result.js";
|
|
15
15
|
import { createXopcUseTool } from "./xopc-use-tool.js";
|
|
16
16
|
import { Type } from "@sinclair/typebox";
|
|
@@ -2,6 +2,7 @@ import type { MediaRef } from '../../media/types.js';
|
|
|
2
2
|
export type ToolMediaType = 'photo' | 'video' | 'audio' | 'document';
|
|
3
3
|
export declare function detectToolMediaMimeType(buffer: Buffer, filePath: string): string;
|
|
4
4
|
export declare function mediaTypeFromMimeType(mimeType: string): ToolMediaType;
|
|
5
|
+
export declare function buildOutboundMediaMetadata(contextMetadata?: Record<string, unknown>, mediaFileName?: string): Record<string, unknown> | undefined;
|
|
5
6
|
export declare function persistToolMedia(params: {
|
|
6
7
|
buffer: Buffer;
|
|
7
8
|
filePath: string;
|