@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
|
@@ -8,13 +8,40 @@ var BrowserRuntime = class {
|
|
|
8
8
|
connecting;
|
|
9
9
|
opening = /* @__PURE__ */ new Map();
|
|
10
10
|
sessionsByTask = /* @__PURE__ */ new Map();
|
|
11
|
+
activeActions = /* @__PURE__ */ new Map();
|
|
12
|
+
pinnedTasks = /* @__PURE__ */ new Set();
|
|
13
|
+
humanControlledTasks = /* @__PURE__ */ new Set();
|
|
11
14
|
constructor(options) {
|
|
12
15
|
this.options = options;
|
|
13
16
|
}
|
|
17
|
+
pinSession(taskKey) {
|
|
18
|
+
this.pinnedTasks.add(taskKey);
|
|
19
|
+
}
|
|
20
|
+
unpinSession(taskKey) {
|
|
21
|
+
this.pinnedTasks.delete(taskKey);
|
|
22
|
+
}
|
|
23
|
+
setHumanControlled(taskKey, controlled) {
|
|
24
|
+
if (controlled) this.humanControlledTasks.add(taskKey);
|
|
25
|
+
else this.humanControlledTasks.delete(taskKey);
|
|
26
|
+
}
|
|
27
|
+
getSessionId(taskKey) {
|
|
28
|
+
return this.sessionsByTask.get(taskKey)?.id;
|
|
29
|
+
}
|
|
30
|
+
getLiveHandle(taskKey) {
|
|
31
|
+
const session = this.sessionsByTask.get(taskKey);
|
|
32
|
+
if (!session || session.closing) return void 0;
|
|
33
|
+
return this.driver?.getLiveHandle?.(session.id);
|
|
34
|
+
}
|
|
35
|
+
async waitForIdle(taskKey, timeoutMs = 5e3) {
|
|
36
|
+
const active = this.activeActions.get(taskKey);
|
|
37
|
+
if (!active) return;
|
|
38
|
+
await Promise.race([active.catch(() => {}), new Promise((resolve) => setTimeout(resolve, timeoutMs))]);
|
|
39
|
+
}
|
|
14
40
|
async execute(taskKey, input, signal) {
|
|
15
41
|
this.evictExpiredSessions();
|
|
16
42
|
if (!this.options.getConfig().enabled && input.action !== "close") return failure("DRIVER_UNAVAILABLE", "Browser Control is disabled.");
|
|
17
43
|
if (signal?.aborted) return failure("ABORTED", "Operation was aborted.");
|
|
44
|
+
if (input.action !== "close" && (this.humanControlledTasks.has(taskKey) || this.options.isHumanControlled?.(taskKey))) return failure("INVALID_INPUT", "The user currently controls this browser session. Wait for explicit handback before continuing.");
|
|
18
45
|
const resolvedTarget = input.target ? void 0 : this.options.resolveTarget?.(taskKey);
|
|
19
46
|
const effectiveInput = input.target || !resolvedTarget ? input : {
|
|
20
47
|
...input,
|
|
@@ -35,12 +62,21 @@ var BrowserRuntime = class {
|
|
|
35
62
|
sessionId: session.id,
|
|
36
63
|
action: input.action
|
|
37
64
|
});
|
|
65
|
+
const pinned = this.pinnedTasks.has(taskKey) || this.options.isSessionPinned?.(taskKey) === true;
|
|
66
|
+
const actionPromise = (async () => {
|
|
67
|
+
try {
|
|
68
|
+
const raw = driver.abortClosesSession && !pinned && signal && input.action !== "close" ? await this.dispatchCancellable(driver, session, effectiveInput, signal) : await this.dispatch(driver, session, effectiveInput, signal);
|
|
69
|
+
return this.constrainResult(raw);
|
|
70
|
+
} catch (error) {
|
|
71
|
+
return failure("DRIVER_UNAVAILABLE", error instanceof Error ? error.message : String(error));
|
|
72
|
+
}
|
|
73
|
+
})();
|
|
74
|
+
this.activeActions.set(taskKey, actionPromise);
|
|
38
75
|
let result;
|
|
39
76
|
try {
|
|
40
|
-
result =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
result = failure("DRIVER_UNAVAILABLE", error instanceof Error ? error.message : String(error));
|
|
77
|
+
result = await actionPromise;
|
|
78
|
+
} finally {
|
|
79
|
+
if (this.activeActions.get(taskKey) === actionPromise) this.activeActions.delete(taskKey);
|
|
44
80
|
}
|
|
45
81
|
if (result.ok) {
|
|
46
82
|
if (result.receipt.observation) {
|
|
@@ -54,6 +90,13 @@ var BrowserRuntime = class {
|
|
|
54
90
|
tabId,
|
|
55
91
|
origin: page.origin
|
|
56
92
|
});
|
|
93
|
+
const liveHandle = driver.getLiveHandle?.(session.id);
|
|
94
|
+
if (liveHandle && effectiveInput.target?.kind !== "attached_tab") this.options.publishManagedLive?.(taskKey, {
|
|
95
|
+
browserSessionId: session.id,
|
|
96
|
+
handle: liveHandle,
|
|
97
|
+
url: session.observation.url,
|
|
98
|
+
title: session.observation.title
|
|
99
|
+
});
|
|
57
100
|
}
|
|
58
101
|
this.options.emit?.("browser.action.completed", {
|
|
59
102
|
sessionId: session.id,
|
|
@@ -75,9 +118,12 @@ var BrowserRuntime = class {
|
|
|
75
118
|
async shutdown() {
|
|
76
119
|
await Promise.allSettled(this.opening.values());
|
|
77
120
|
await this.connecting?.catch(() => {});
|
|
121
|
+
for (const taskKey of this.sessionsByTask.keys()) this.options.publishManagedLive?.(taskKey, void 0);
|
|
78
122
|
await this.driver?.disconnect();
|
|
79
123
|
this.driver = null;
|
|
80
124
|
this.sessionsByTask.clear();
|
|
125
|
+
this.pinnedTasks.clear();
|
|
126
|
+
this.humanControlledTasks.clear();
|
|
81
127
|
}
|
|
82
128
|
async closeTaskSession(taskKey, target) {
|
|
83
129
|
await this.opening.get(taskKey)?.catch(() => {});
|
|
@@ -87,6 +133,9 @@ var BrowserRuntime = class {
|
|
|
87
133
|
}
|
|
88
134
|
closeSession(session, target) {
|
|
89
135
|
return session.closing ??= Promise.resolve().then(async () => {
|
|
136
|
+
this.options.publishManagedLive?.(session.taskKey, void 0);
|
|
137
|
+
this.pinnedTasks.delete(session.taskKey);
|
|
138
|
+
this.humanControlledTasks.delete(session.taskKey);
|
|
90
139
|
await this.driver?.closeSession(session.id, target);
|
|
91
140
|
if (this.sessionsByTask.get(session.taskKey) === session) this.sessionsByTask.delete(session.taskKey);
|
|
92
141
|
this.options.emit?.("browser.session.closed", { sessionId: session.id });
|
|
@@ -372,6 +421,8 @@ var BrowserRuntime = class {
|
|
|
372
421
|
const expiresBefore = Date.now() - this.options.getConfig().limits.sessionTimeoutMs;
|
|
373
422
|
for (const [taskKey, session] of this.sessionsByTask) {
|
|
374
423
|
if (session.closing || session.lastUsedAt >= expiresBefore) continue;
|
|
424
|
+
if (this.pinnedTasks.has(taskKey) || this.options.isSessionPinned?.(taskKey)) continue;
|
|
425
|
+
this.options.publishManagedLive?.(taskKey, void 0);
|
|
375
426
|
this.driver?.closeSession(session.id).catch(() => {});
|
|
376
427
|
this.sessionsByTask.delete(taskKey);
|
|
377
428
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { init_agent_scope, listAgentEntries, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
2
2
|
import { init_connector_repository, listConnectorConnections } from "../storage/sqlite/connector-repository.js";
|
|
3
3
|
import { personalAgentId } from "../personal-agent/repository.js";
|
|
4
|
+
import { buildExtensionMetadataSnapshot, resolveExtensionLoaderOptionsFromConfig } from "../extensions/extension-metadata-snapshot.js";
|
|
5
|
+
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus } from "../channels/catalog/channel-catalog-service.js";
|
|
4
6
|
import { listConnectorCatalog } from "../connectors/catalog.js";
|
|
5
7
|
import { isManagedConnectorServer } from "../connectors/materialize.js";
|
|
6
8
|
import { listConnectorInstances } from "../connectors/instances.js";
|
|
7
9
|
import { listStoreConnectorCatalog } from "./store-connector.js";
|
|
8
10
|
import { listAgentPluginInventory } from "../extensions/agent-plugins/inventory.js";
|
|
9
11
|
import { isBundledChannelExtension } from "../channels/bundled-channel-extensions.js";
|
|
10
|
-
import { buildExtensionMetadataSnapshot, resolveExtensionLoaderOptionsFromConfig } from "../extensions/extension-metadata-snapshot.js";
|
|
11
|
-
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus } from "../channels/catalog/channel-catalog-service.js";
|
|
12
12
|
import { projectComposioConnectionStatus } from "../connectors/runtime-status.js";
|
|
13
13
|
import { fetchRegistry } from "../extensions/marketplace.js";
|
|
14
14
|
//#region src/capabilities/capability-catalog.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AgentCatalogRepository, init_repository } from "../../agent-catalog/repository.js";
|
|
2
|
-
import { getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, init_schema, parseModelRef } from "../../config/schema.js";
|
|
3
2
|
import { init_model_policy, isComputerModel, isDedicatedComputerProfile } from "../../computer/model-policy.js";
|
|
4
3
|
import { getModelCatalogStore, init_model_catalog_store } from "../../providers/model-catalog-store.js";
|
|
5
|
-
import { init_providers, isProviderConfiguredSync, resolveModel } from "../../providers/index.js";
|
|
6
4
|
import { compareCatalogModels } from "../../providers/model-catalog-ranking.js";
|
|
5
|
+
import { getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, init_schema, parseModelRef } from "../../config/schema.js";
|
|
6
|
+
import { init_providers, isProviderConfiguredSync, resolveModel } from "../../providers/index.js";
|
|
7
7
|
import { planCapabilities } from "./planner.js";
|
|
8
8
|
//#region src/capabilities/readiness/from-config.ts
|
|
9
9
|
init_model_policy();
|
|
@@ -5,8 +5,8 @@ import { validEndpointDomain } from "../connectors/endpoint-policy.js";
|
|
|
5
5
|
import { listConnectorInstances } from "../connectors/instances.js";
|
|
6
6
|
import { installConnectorDefinition } from "../connectors/install.js";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
|
-
import AdmZip from "adm-zip";
|
|
9
8
|
import { isIP } from "node:net";
|
|
9
|
+
import AdmZip from "adm-zip";
|
|
10
10
|
//#region src/capabilities/store-connector.ts
|
|
11
11
|
const STORE_CONNECTOR_CANDIDATE_PREFIX = "store-connector:";
|
|
12
12
|
function storeConnectorCandidateRef(packageName, version) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { isSTTAvailable } from "../../voice/stt/availability.js";
|
|
3
4
|
import { decodeInboundAttachmentBase64, readInboundAttachmentBuffer } from "./inbound-persist.js";
|
|
4
5
|
import { transcribe } from "../../voice/stt/transcribe-core.js";
|
|
5
|
-
import { isSTTAvailable } from "../../voice/stt/availability.js";
|
|
6
6
|
import "../../voice/stt/index.js";
|
|
7
7
|
//#region src/channels/attachments/voice-stt-webchat.ts
|
|
8
8
|
init_logger();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Config } from '../../config/schema.js';
|
|
2
|
+
export type EnterpriseMediaKind = 'image' | 'video' | 'audio' | 'file';
|
|
3
|
+
export interface EnterpriseMedia {
|
|
4
|
+
buffer: Buffer;
|
|
5
|
+
mimeType: string;
|
|
6
|
+
filename: string;
|
|
7
|
+
kind: EnterpriseMediaKind;
|
|
8
|
+
}
|
|
9
|
+
export declare function loadEnterpriseMedia(cfg: Config, rawInput: string, options?: {
|
|
10
|
+
mediaType?: string;
|
|
11
|
+
filenameHint?: string;
|
|
12
|
+
maxBytes?: number;
|
|
13
|
+
localRoots?: readonly string[];
|
|
14
|
+
}): Promise<EnterpriseMedia>;
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { checkFileSafety } from "../../agent/prompt/safety.js";
|
|
2
|
+
import { evaluateFilePolicy } from "../../agent/sandbox/exec-policy.js";
|
|
3
|
+
import { assertUrlSafe } from "../../agent/tools/url-safety.js";
|
|
4
|
+
import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
|
|
5
|
+
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
6
|
+
import "../../storage/sqlite/index.js";
|
|
7
|
+
import { getMimeType } from "../media.js";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { promises } from "node:fs";
|
|
10
|
+
//#region src/channels/enterprise/media.ts
|
|
11
|
+
const DEFAULT_MAX_BYTES = 20 * 1024 * 1024;
|
|
12
|
+
const MIME_TO_EXT = {
|
|
13
|
+
"image/jpeg": "jpg",
|
|
14
|
+
"image/jpg": "jpg",
|
|
15
|
+
"image/png": "png",
|
|
16
|
+
"image/gif": "gif",
|
|
17
|
+
"image/webp": "webp",
|
|
18
|
+
"image/bmp": "bmp",
|
|
19
|
+
"image/svg+xml": "svg",
|
|
20
|
+
"video/mp4": "mp4",
|
|
21
|
+
"video/webm": "webm",
|
|
22
|
+
"video/quicktime": "mov",
|
|
23
|
+
"audio/mpeg": "mp3",
|
|
24
|
+
"audio/mp3": "mp3",
|
|
25
|
+
"audio/ogg": "ogg",
|
|
26
|
+
"audio/wav": "wav",
|
|
27
|
+
"audio/mp4": "m4a",
|
|
28
|
+
"audio/amr": "amr",
|
|
29
|
+
"application/pdf": "pdf",
|
|
30
|
+
"application/zip": "zip",
|
|
31
|
+
"application/json": "json",
|
|
32
|
+
"text/plain": "txt",
|
|
33
|
+
"text/markdown": "md",
|
|
34
|
+
"text/csv": "csv",
|
|
35
|
+
"text/html": "html"
|
|
36
|
+
};
|
|
37
|
+
function isPathUnderRoots(resolved, roots) {
|
|
38
|
+
const norm = path.normalize(resolved);
|
|
39
|
+
for (const root of roots) {
|
|
40
|
+
const r = path.normalize(root);
|
|
41
|
+
if (norm === r || norm.startsWith(r + path.sep)) return true;
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
function sniffBufferMime(buf) {
|
|
46
|
+
if (buf.length >= 8 && buf[0] === 137 && buf[1] === 80 && buf[2] === 78 && buf[3] === 71 && buf[4] === 13 && buf[5] === 10 && buf[6] === 26 && buf[7] === 10) return "image/png";
|
|
47
|
+
if (buf.length >= 3 && buf[0] === 255 && buf[1] === 216 && buf[2] === 255) return "image/jpeg";
|
|
48
|
+
if (buf.length >= 4 && buf.subarray(0, 4).toString("ascii") === "GIF8") return "image/gif";
|
|
49
|
+
if (buf.length >= 12 && buf.subarray(0, 4).toString("ascii") === "RIFF" && buf.subarray(8, 12).toString("ascii") === "WEBP") return "image/webp";
|
|
50
|
+
if (buf.length >= 5 && buf.subarray(0, 5).toString("ascii") === "%PDF-") return "application/pdf";
|
|
51
|
+
if (buf.length >= 4 && buf.subarray(0, 4).toString("ascii") === "OggS") return "audio/ogg";
|
|
52
|
+
if (buf.length >= 12 && buf.subarray(4, 8).toString("ascii") === "ftyp") return "video/mp4";
|
|
53
|
+
if (buf.length >= 6 && buf.subarray(0, 6).toString("ascii") === "#!AMR\n") return "audio/amr";
|
|
54
|
+
}
|
|
55
|
+
function sanitizeFilename(raw) {
|
|
56
|
+
if (!raw?.trim()) return "";
|
|
57
|
+
const base = path.basename(raw.trim()).replace(/[\\/:*?"<>|\r\n\0]/g, "_").trim();
|
|
58
|
+
if (!base || base === "." || base === "..") return "";
|
|
59
|
+
return base;
|
|
60
|
+
}
|
|
61
|
+
function extensionForMime(mimeType) {
|
|
62
|
+
const normalized = mimeType.split(";")[0]?.trim().toLowerCase() || "";
|
|
63
|
+
if (MIME_TO_EXT[normalized]) return MIME_TO_EXT[normalized];
|
|
64
|
+
const sub = normalized.split("/")[1]?.replace(/[^a-z0-9]/g, "");
|
|
65
|
+
return sub && sub !== "octetstream" ? sub : "bin";
|
|
66
|
+
}
|
|
67
|
+
function resolveKind(mimeType, mediaType) {
|
|
68
|
+
const normalized = mimeType.split(";")[0]?.trim().toLowerCase() || "";
|
|
69
|
+
if (normalized === "image/svg+xml") return "file";
|
|
70
|
+
if (mediaType === "photo") return normalized.startsWith("image/") || !normalized ? "image" : "file";
|
|
71
|
+
if (mediaType === "video") return "video";
|
|
72
|
+
if (mediaType === "audio") return "audio";
|
|
73
|
+
if (mediaType === "document") return "file";
|
|
74
|
+
if (normalized.startsWith("image/")) return "image";
|
|
75
|
+
if (normalized.startsWith("video/")) return "video";
|
|
76
|
+
if (normalized.startsWith("audio/")) return "audio";
|
|
77
|
+
return "file";
|
|
78
|
+
}
|
|
79
|
+
function buildFilename(hint, fallback, kind, mimeType) {
|
|
80
|
+
const clean = sanitizeFilename(hint) || sanitizeFilename(fallback);
|
|
81
|
+
if (clean) return clean;
|
|
82
|
+
const ext = extensionForMime(mimeType);
|
|
83
|
+
return `${kind === "image" ? "image" : kind === "video" ? "video" : kind === "audio" ? "audio" : "file"}.${ext}`;
|
|
84
|
+
}
|
|
85
|
+
const MAX_REMOTE_REDIRECTS = 5;
|
|
86
|
+
async function fetchSafeRemoteMedia(initialUrl, maxBytes) {
|
|
87
|
+
let currentUrl = initialUrl;
|
|
88
|
+
let response;
|
|
89
|
+
for (let hop = 0; hop <= MAX_REMOTE_REDIRECTS; hop += 1) {
|
|
90
|
+
assertUrlSafe(currentUrl);
|
|
91
|
+
response = await fetch(currentUrl, {
|
|
92
|
+
redirect: "manual",
|
|
93
|
+
signal: AbortSignal.timeout(3e4)
|
|
94
|
+
});
|
|
95
|
+
if (response.status >= 300 && response.status < 400) {
|
|
96
|
+
const location = response.headers.get("location");
|
|
97
|
+
await response.body?.cancel();
|
|
98
|
+
if (!location) throw new Error(`Media redirect missing Location header (HTTP ${response.status})`);
|
|
99
|
+
if (hop === MAX_REMOTE_REDIRECTS) throw new Error("Too many redirects while fetching media");
|
|
100
|
+
currentUrl = new URL(location, currentUrl).href;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
if (!response || !response.ok) {
|
|
106
|
+
await response?.body?.cancel();
|
|
107
|
+
throw new Error(`Failed to fetch media (HTTP ${response?.status ?? "unknown"})`);
|
|
108
|
+
}
|
|
109
|
+
const contentLength = Number(response.headers.get("content-length"));
|
|
110
|
+
if (Number.isFinite(contentLength) && contentLength > maxBytes) {
|
|
111
|
+
await response.body?.cancel();
|
|
112
|
+
throw new Error(`Media too large (${contentLength} bytes, max ${maxBytes})`);
|
|
113
|
+
}
|
|
114
|
+
let buffer;
|
|
115
|
+
if (response.body) {
|
|
116
|
+
const reader = response.body.getReader();
|
|
117
|
+
const chunks = [];
|
|
118
|
+
let total = 0;
|
|
119
|
+
try {
|
|
120
|
+
while (true) {
|
|
121
|
+
const { done, value } = await reader.read();
|
|
122
|
+
if (done) break;
|
|
123
|
+
if (!value) continue;
|
|
124
|
+
total += value.byteLength;
|
|
125
|
+
if (total > maxBytes) {
|
|
126
|
+
await reader.cancel();
|
|
127
|
+
throw new Error(`Media too large (${total} bytes, max ${maxBytes})`);
|
|
128
|
+
}
|
|
129
|
+
chunks.push(value);
|
|
130
|
+
}
|
|
131
|
+
} finally {
|
|
132
|
+
reader.releaseLock();
|
|
133
|
+
}
|
|
134
|
+
buffer = Buffer.concat(chunks, total);
|
|
135
|
+
} else {
|
|
136
|
+
buffer = Buffer.from(await response.arrayBuffer());
|
|
137
|
+
if (buffer.length > maxBytes) throw new Error(`Media too large (${buffer.length} bytes, max ${maxBytes})`);
|
|
138
|
+
}
|
|
139
|
+
if (buffer.length === 0) throw new Error("Media payload is empty");
|
|
140
|
+
const headerMime = (response.headers.get("content-type") || "").split(";")[0]?.trim().toLowerCase() || "";
|
|
141
|
+
return {
|
|
142
|
+
buffer,
|
|
143
|
+
headerMime,
|
|
144
|
+
finalUrl: currentUrl
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
async function loadEnterpriseMedia(cfg, rawInput, options) {
|
|
148
|
+
const maxBytes = options?.maxBytes ?? DEFAULT_MAX_BYTES;
|
|
149
|
+
const trimmed = rawInput.trim();
|
|
150
|
+
const input = trimmed.startsWith("@") ? trimmed.slice(1).trim() : trimmed;
|
|
151
|
+
if (!input) throw new Error("Media URL is required");
|
|
152
|
+
let buffer;
|
|
153
|
+
let mimeType;
|
|
154
|
+
let fallbackName;
|
|
155
|
+
if (/^data:/i.test(input)) {
|
|
156
|
+
const match = /^data:([^;,]+)?(;base64)?,/i.exec(input);
|
|
157
|
+
if (!match) throw new Error("Invalid media data URL");
|
|
158
|
+
const declaredMime = (match[1] || "application/octet-stream").trim().toLowerCase();
|
|
159
|
+
const dataPart = input.slice(match[0].length);
|
|
160
|
+
buffer = match[2] ? Buffer.from(dataPart.replace(/\s/g, ""), "base64") : Buffer.from(decodeURIComponent(dataPart), "utf8");
|
|
161
|
+
if (buffer.length === 0) throw new Error("Media payload is empty");
|
|
162
|
+
if (buffer.length > maxBytes) throw new Error(`Media too large (${buffer.length} bytes, max ${maxBytes})`);
|
|
163
|
+
mimeType = declaredMime === "application/octet-stream" ? sniffBufferMime(buffer) ?? declaredMime : declaredMime;
|
|
164
|
+
} else if (/^https?:\/\//i.test(input)) {
|
|
165
|
+
const fetched = await fetchSafeRemoteMedia(input, maxBytes);
|
|
166
|
+
buffer = fetched.buffer;
|
|
167
|
+
fallbackName = sanitizeFilename(new URL(fetched.finalUrl).pathname);
|
|
168
|
+
mimeType = fetched.headerMime && fetched.headerMime !== "application/octet-stream" ? fetched.headerMime : sniffBufferMime(buffer) ?? (fallbackName ? getMimeType("document", fallbackName) : "application/octet-stream");
|
|
169
|
+
} else {
|
|
170
|
+
let filePath = input.startsWith("file://") ? input.slice(7) : input;
|
|
171
|
+
const workspace = isXopcDatabaseOpen() ? getWorkspacePath(cfg) : options?.localRoots?.[0] || process.env.XOPC_WORKSPACE?.trim() || "";
|
|
172
|
+
if (!workspace) throw new Error("Workspace root is unavailable for local media");
|
|
173
|
+
if (!path.isAbsolute(filePath)) filePath = path.resolve(workspace, filePath);
|
|
174
|
+
filePath = path.normalize(filePath);
|
|
175
|
+
const preSafety = checkFileSafety("read", filePath);
|
|
176
|
+
if (!preSafety.allowed) throw new Error(preSafety.message ?? "File path not allowed");
|
|
177
|
+
const roots = [workspace, ...options?.localRoots ?? []].filter(Boolean);
|
|
178
|
+
const [realPath, ...resolvedRoots] = await Promise.all([promises.realpath(filePath), ...roots.map((r) => promises.realpath(r).catch(() => r))]);
|
|
179
|
+
if (!isPathUnderRoots(realPath, resolvedRoots)) throw new Error(`Media path escapes allowed workspace roots: ${filePath}`);
|
|
180
|
+
const policy = evaluateFilePolicy({
|
|
181
|
+
operation: "read",
|
|
182
|
+
path: realPath,
|
|
183
|
+
workspaceRoot: resolvedRoots[0] ?? workspace,
|
|
184
|
+
config: { allowedRoots: resolvedRoots }
|
|
185
|
+
});
|
|
186
|
+
if (!policy.allowed) throw new Error(policy.reason ?? "File path not allowed");
|
|
187
|
+
const canonicalSafety = checkFileSafety("read", realPath);
|
|
188
|
+
if (!canonicalSafety.allowed) throw new Error(canonicalSafety.message ?? "File path not allowed");
|
|
189
|
+
const st = await promises.stat(realPath);
|
|
190
|
+
if (!st.isFile()) throw new Error(`Media path is not a file: ${filePath}`);
|
|
191
|
+
if (st.size === 0) throw new Error("Media file is empty");
|
|
192
|
+
if (st.size > maxBytes) throw new Error(`Media too large (${st.size} bytes, max ${maxBytes})`);
|
|
193
|
+
buffer = await promises.readFile(realPath);
|
|
194
|
+
fallbackName = path.basename(realPath);
|
|
195
|
+
const extMime = getMimeType("document", realPath);
|
|
196
|
+
mimeType = extMime !== "application/octet-stream" ? extMime : sniffBufferMime(buffer) ?? extMime;
|
|
197
|
+
}
|
|
198
|
+
const kind = resolveKind(mimeType, options?.mediaType);
|
|
199
|
+
const filename = buildFilename(options?.filenameHint, fallbackName, kind, mimeType);
|
|
200
|
+
return {
|
|
201
|
+
buffer,
|
|
202
|
+
mimeType,
|
|
203
|
+
filename,
|
|
204
|
+
kind
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
//#endregion
|
|
208
|
+
export { loadEnterpriseMedia };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type WebSocket from 'ws';
|
|
2
2
|
import type { ChannelPlugin } from '../plugin-types.js';
|
|
3
|
+
import { type EnterpriseMedia } from './media.js';
|
|
3
4
|
import { type ChannelSetupLink, type EnterpriseCredentials, type EnterpriseRegistration } from './setup.js';
|
|
5
|
+
export type { EnterpriseMedia, EnterpriseMediaKind } from './media.js';
|
|
4
6
|
export type EnterpriseMessage = {
|
|
5
7
|
senderId: string;
|
|
6
8
|
groupId?: string;
|
|
@@ -14,6 +16,7 @@ export type EnterpriseMessage = {
|
|
|
14
16
|
export type EnterpriseTransport = {
|
|
15
17
|
run: (signal: AbortSignal, online: (socket?: WebSocket) => void, onFailure: (message?: string) => void) => Promise<void>;
|
|
16
18
|
send: (target: string, group: boolean, text: string, replyId?: string) => Promise<string>;
|
|
19
|
+
sendMedia?: (target: string, group: boolean, media: EnterpriseMedia, caption?: string, replyId?: string) => Promise<string>;
|
|
17
20
|
};
|
|
18
21
|
export declare function createEnterpriseChannel(options: {
|
|
19
22
|
id: 'dingtalk' | 'wecom' | 'slack' | 'discord';
|
|
@@ -24,6 +27,7 @@ export declare function createEnterpriseChannel(options: {
|
|
|
24
27
|
begin?: (signal: AbortSignal) => Promise<EnterpriseRegistration>;
|
|
25
28
|
credentialIdIsSecret?: boolean;
|
|
26
29
|
threads?: boolean;
|
|
30
|
+
media?: boolean;
|
|
27
31
|
sendWhileDisconnected?: boolean;
|
|
28
32
|
setupLink?: ChannelSetupLink;
|
|
29
33
|
setupTemplate?: {
|
|
@@ -2,6 +2,7 @@ import { resolveStandardAllowFromPath, resolveStandardPairingPath } from "../pai
|
|
|
2
2
|
import { readAllowFromIdsSync } from "../pairing/allow-from-file.js";
|
|
3
3
|
import { evaluateAccess } from "../security.js";
|
|
4
4
|
import { redactEnterpriseChannelSecret } from "./config-surface.js";
|
|
5
|
+
import { loadEnterpriseMedia } from "./media.js";
|
|
5
6
|
import { record, string } from "./socket.js";
|
|
6
7
|
import { createEnterpriseSetup } from "./setup.js";
|
|
7
8
|
import { createHash } from "node:crypto";
|
|
@@ -44,7 +45,7 @@ function createEnterpriseChannel(options) {
|
|
|
44
45
|
chatTypes: ["direct", "group"],
|
|
45
46
|
reactions: false,
|
|
46
47
|
threads: options.threads === true,
|
|
47
|
-
media:
|
|
48
|
+
media: options.media === true,
|
|
48
49
|
nativeCommands: false,
|
|
49
50
|
blockStreaming: false
|
|
50
51
|
},
|
|
@@ -197,22 +198,49 @@ function createEnterpriseChannel(options) {
|
|
|
197
198
|
outbound: {
|
|
198
199
|
deliveryMode: "direct",
|
|
199
200
|
textChunkLimit: 1800,
|
|
200
|
-
async sendText(
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
const target = to.slice(separator + 1);
|
|
204
|
-
if (!runtime || !online && !options.sendWhileDisconnected || targetAccount && targetAccount !== accountId) throw new Error(`${label} is disconnected`);
|
|
205
|
-
if (!target || kind !== "user" && kind !== "group") throw new Error(`Invalid ${label} target`);
|
|
206
|
-
if (mediaUrl) throw new Error(`${label} only supports text delivery`);
|
|
207
|
-
const reply = string(outboundMetadata?.channelReplyId) || (options.threads ? string(threadId) : "") || replyToId || void 0;
|
|
201
|
+
async sendText(ctx) {
|
|
202
|
+
const { active, target, isGroup, reply } = resolveOutbound(ctx);
|
|
203
|
+
if (ctx.mediaUrl) throw new Error(`${label} sendText does not accept mediaUrl; use sendMedia`);
|
|
208
204
|
return {
|
|
209
205
|
success: true,
|
|
210
|
-
messageId: await
|
|
211
|
-
chatId: to
|
|
206
|
+
messageId: await active.transport.send(target, isGroup, ctx.text, reply),
|
|
207
|
+
chatId: ctx.to
|
|
212
208
|
};
|
|
213
|
-
}
|
|
209
|
+
},
|
|
210
|
+
...options.media ? { async sendMedia(ctx) {
|
|
211
|
+
const { active, target, isGroup, reply } = resolveOutbound(ctx);
|
|
212
|
+
if (!active.transport.sendMedia) throw new Error(`${label} only supports text delivery`);
|
|
213
|
+
const mediaUrl = ctx.mediaUrl?.trim();
|
|
214
|
+
if (!mediaUrl) throw new Error(`${label} sendMedia requires mediaUrl`);
|
|
215
|
+
const filenameHint = typeof ctx.outboundMetadata?.mediaFileName === "string" ? ctx.outboundMetadata.mediaFileName : void 0;
|
|
216
|
+
const media = await loadEnterpriseMedia(ctx.cfg, mediaUrl, {
|
|
217
|
+
mediaType: ctx.mediaType,
|
|
218
|
+
filenameHint,
|
|
219
|
+
localRoots: ctx.mediaLocalRoots
|
|
220
|
+
});
|
|
221
|
+
const caption = ctx.text?.trim() || void 0;
|
|
222
|
+
return {
|
|
223
|
+
success: true,
|
|
224
|
+
messageId: await active.transport.sendMedia(target, isGroup, media, caption, reply),
|
|
225
|
+
chatId: ctx.to
|
|
226
|
+
};
|
|
227
|
+
} } : {}
|
|
214
228
|
}
|
|
215
229
|
};
|
|
230
|
+
function resolveOutbound(ctx) {
|
|
231
|
+
const separator = ctx.to.indexOf(":");
|
|
232
|
+
const kind = ctx.to.slice(0, separator);
|
|
233
|
+
const target = ctx.to.slice(separator + 1);
|
|
234
|
+
if (!runtime || !online && !options.sendWhileDisconnected || ctx.accountId && ctx.accountId !== accountId) throw new Error(`${label} is disconnected`);
|
|
235
|
+
if (!target || kind !== "user" && kind !== "group") throw new Error(`Invalid ${label} target`);
|
|
236
|
+
const reply = string(ctx.outboundMetadata?.channelReplyId) || (options.threads ? string(ctx.threadId) : "") || ctx.replyToId || void 0;
|
|
237
|
+
return {
|
|
238
|
+
active: runtime,
|
|
239
|
+
target,
|
|
240
|
+
isGroup: kind === "group",
|
|
241
|
+
reply
|
|
242
|
+
};
|
|
243
|
+
}
|
|
216
244
|
return plugin;
|
|
217
245
|
}
|
|
218
246
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { parseFrontmatterBlock } from "../markdown/frontmatter.js";
|
|
2
1
|
import { findFenceSpanAt, isSafeFenceBreak, parseFenceSpans } from "../markdown/fences.js";
|
|
3
2
|
import { chunkText } from "../markdown/chunk.js";
|
|
4
3
|
import { chunkMarkdownIR, markdownToIR, markdownToIRWithMeta } from "../markdown/ir.js";
|
|
5
4
|
import { renderMarkdownWithMarkers } from "../markdown/render.js";
|
|
6
5
|
import { convertMarkdownTables } from "../markdown/tables.js";
|
|
6
|
+
import { parseFrontmatterBlock } from "../markdown/frontmatter.js";
|
|
7
7
|
import { buildCodeSpanIndex, createInlineCodeState } from "../markdown/code-spans.js";
|
|
8
8
|
import "../markdown/index.js";
|
|
9
9
|
export { buildCodeSpanIndex, chunkMarkdownIR, chunkText, convertMarkdownTables, createInlineCodeState, findFenceSpanAt, isSafeFenceBreak, markdownToIR, markdownToIRWithMeta, parseFenceSpans, parseFrontmatterBlock, renderMarkdownWithMarkers };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { parseFrontmatterBlock } from "../markdown/frontmatter.js";
|
|
2
1
|
import { compileAllowlist, evaluateAccess, hasBotMention, removeBotMention, resolveAllowlistMatch, resolveAllowlistMatchSimple, resolveDmPolicy, resolveGroupPolicy } from "./security.js";
|
|
3
|
-
import { getChannelPlugin, getChannelRegistryVersion, listChannelPlugins, syncChannelPluginsFromManager } from "./plugins/registry.js";
|
|
4
2
|
import { findFenceSpanAt, isSafeFenceBreak, parseFenceSpans } from "../markdown/fences.js";
|
|
5
3
|
import { chunkText } from "../markdown/chunk.js";
|
|
6
4
|
import { chunkMarkdownIR, markdownToIR, markdownToIRWithMeta } from "../markdown/ir.js";
|
|
7
5
|
import { renderMarkdownWithMarkers } from "../markdown/render.js";
|
|
8
6
|
import { convertMarkdownTables } from "../markdown/tables.js";
|
|
7
|
+
import { parseFrontmatterBlock } from "../markdown/frontmatter.js";
|
|
9
8
|
import { buildCodeSpanIndex, createInlineCodeState } from "../markdown/code-spans.js";
|
|
9
|
+
import { getChannelPlugin, getChannelRegistryVersion, listChannelPlugins, syncChannelPluginsFromManager } from "./plugins/registry.js";
|
|
10
10
|
import "./format.js";
|
|
11
11
|
import { MessagePipeline, createEnvelopeTimestampHandler, createFilterCommandsHandler, createFilterEmptyHandler, createFilterSelfHandler, createPipeline, standardPreflightHandlers, standardProcessHandlers } from "./pipeline.js";
|
|
12
12
|
import { ChannelManager, createChannelManager } from "./manager.js";
|
|
@@ -3,3 +3,5 @@
|
|
|
3
3
|
* {@link ChannelManager.send} drops these without treating them as unknown plugins.
|
|
4
4
|
*/
|
|
5
5
|
export declare const INTERNAL_OUTBOUND_DROP_CHANNEL = "__xopc_internal";
|
|
6
|
+
/** Returns true for real external IM/chat channels (DingTalk, WeCom, Feishu, Telegram, Weixin, Slack, Discord, etc.). */
|
|
7
|
+
export declare function isExternalMessagingChannel(channel?: string | null): boolean;
|
|
@@ -4,5 +4,21 @@
|
|
|
4
4
|
* {@link ChannelManager.send} drops these without treating them as unknown plugins.
|
|
5
5
|
*/
|
|
6
6
|
const INTERNAL_OUTBOUND_DROP_CHANNEL = "__xopc_internal";
|
|
7
|
+
const NON_EXTERNAL_MESSAGING_CHANNELS = new Set([
|
|
8
|
+
"webchat",
|
|
9
|
+
"cli",
|
|
10
|
+
"tui",
|
|
11
|
+
"system",
|
|
12
|
+
"automation",
|
|
13
|
+
"heartbeat",
|
|
14
|
+
"cron",
|
|
15
|
+
"subagent",
|
|
16
|
+
INTERNAL_OUTBOUND_DROP_CHANNEL
|
|
17
|
+
]);
|
|
18
|
+
/** Returns true for real external IM/chat channels (DingTalk, WeCom, Feishu, Telegram, Weixin, Slack, Discord, etc.). */
|
|
19
|
+
function isExternalMessagingChannel(channel) {
|
|
20
|
+
const normalized = channel?.trim().toLowerCase();
|
|
21
|
+
return Boolean(normalized && !NON_EXTERNAL_MESSAGING_CHANNELS.has(normalized));
|
|
22
|
+
}
|
|
7
23
|
//#endregion
|
|
8
|
-
export { INTERNAL_OUTBOUND_DROP_CHANNEL };
|
|
24
|
+
export { INTERNAL_OUTBOUND_DROP_CHANNEL, isExternalMessagingChannel };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { init_resolve_route, resolveRoute } from "../routing/resolve-route.js";
|
|
4
3
|
import { issuePairingChallenge } from "./pairing/pairing-challenge.js";
|
|
5
4
|
import { registerPairingChannelResolver } from "./pairing/pairing-service.js";
|
|
5
|
+
import { init_resolve_route, resolveRoute } from "../routing/resolve-route.js";
|
|
6
6
|
import { verifiedChannelBus } from "./verified-inbound.js";
|
|
7
7
|
import { CHANNEL_RESTART_POLICY, computeBackoff } from "./restart-policy.js";
|
|
8
8
|
//#region src/channels/lifecycle-supervisor.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { mergeTtsConfigFromAppConfig } from "../voice/tts/merge-config.js";
|
|
4
|
-
import { maybeApplyTtsToPayload } from "../voice/tts/payload.js";
|
|
5
3
|
import { ChannelMessageJournal } from "./message-journal.js";
|
|
6
4
|
import "./internal-outbound.js";
|
|
5
|
+
import { mergeTtsConfigFromAppConfig } from "../voice/tts/merge-config.js";
|
|
6
|
+
import { maybeApplyTtsToPayload } from "../voice/tts/payload.js";
|
|
7
7
|
import { deliverOutboundMessage } from "./outbound/deliver.js";
|
|
8
8
|
import { OutboundPersistStore } from "./outbound/persist-store.js";
|
|
9
9
|
//#region src/channels/outbound-sender.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { resolveStandardAllowFromPath, resolveStandardPairingPath } from "./paths.js";
|
|
2
2
|
import { readAllowFromIdsSync, removeAllowFromIdSync } from "./allow-from-file.js";
|
|
3
|
+
import { resolveDmPolicy } from "../security.js";
|
|
3
4
|
import "./pairing-constants.js";
|
|
4
5
|
import { PAIRING_PENDING_TTL_MS, approvePairingBySenderIdSync, approvePairingCodeSync, dismissPairingBySenderIdSync, listPendingPairingRequestsSync } from "./pairing-store.js";
|
|
5
6
|
import { broadcastPairingEvent } from "./pairing-events.js";
|
|
6
|
-
import { resolveDmPolicy } from "../security.js";
|
|
7
7
|
//#region src/channels/pairing/pairing-service.ts
|
|
8
8
|
const pairingResolvers = /* @__PURE__ */ new Map();
|
|
9
9
|
function registerPairingChannelResolver(channel, resolver) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { appendAllowFromIdSync } from "./allow-from-file.js";
|
|
2
2
|
import "./pairing-constants.js";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import fs from "node:fs";
|
|
5
4
|
import crypto from "node:crypto";
|
|
5
|
+
import fs from "node:fs";
|
|
6
6
|
//#region src/channels/pairing/pairing-store.ts
|
|
7
7
|
const PAIRING_CODE_LENGTH = 8;
|
|
8
8
|
const PAIRING_CODE_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { resolveAllowlistMatchSimple } from "../../channels/security.js";
|
|
1
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
3
|
import { init_logger } from "../../utils/logger.js";
|
|
3
4
|
import { init_paths, resolveConfigPath } from "../../config/paths.js";
|
|
5
|
+
import { commandRegistry } from "../registry.js";
|
|
4
6
|
import { ConfigSchema, init_schema } from "../../config/schema.js";
|
|
5
|
-
import { resolveAllowlistMatchSimple } from "../../channels/security.js";
|
|
6
7
|
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
7
|
-
import { commandRegistry } from "../registry.js";
|
|
8
8
|
import { parseConfigValue } from "../config-value.js";
|
|
9
9
|
import { getConfigValueAtPath, parseConfigPath, setConfigValueAtPath, unsetConfigValueAtPath } from "../config-paths.js";
|
|
10
10
|
//#region src/chat-commands/builtins/config.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { commandRegistry } from "../registry.js";
|
|
1
2
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
2
3
|
import { effectiveWorkspacePathForSession } from "../../session/session-workspace.js";
|
|
3
4
|
import { getProjectForSession } from "../../projects/workspace.js";
|
|
4
|
-
import { commandRegistry } from "../registry.js";
|
|
5
5
|
import { buildReviewDiffBundle, parseReviewTargetArgs, resolveGitRoot } from "../../review/review-git.js";
|
|
6
6
|
import { formatReviewMarkdown } from "../../review/review-types.js";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|