@tencent-ai/agent-sdk 0.3.263-dev.90f0e98.202609190050 → 0.3.263
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/cli/dist/codebuddy-headless.js +1 -1
- package/cli/dist/codebuddy-lite-wb.mjs +1 -1
- package/cli/dist-server/codebuddy.js +1 -1
- package/cli/dist-server/types/node/references/index.d.ts +2 -0
- package/cli/dist-server/types/node/settings/settings-controller.d.ts +23 -0
- package/cli/dist-server/types/node/settings/settings-validate-middleware.d.ts +9 -0
- package/cli/dist-server/types/node/utils/compress-path.source.d.ts +59 -0
- package/cli/package.json +2 -3
- package/cli/product.cloudhosted.json +2 -2
- package/cli/product.internal.json +2 -2
- package/cli/product.ioa.json +2 -2
- package/cli/product.json +2 -2
- package/cli/product.selfhosted.json +2 -2
- package/package.json +2 -3
- package/cli/dist-server/types/node/a2a/a2a-artifact-download-service.d.ts +0 -51
- package/cli/dist-server/types/node/a2a/a2a-context-store.d.ts +0 -100
- package/cli/dist-server/types/node/a2a/a2a-remote-cancel.d.ts +0 -111
- package/cli/dist-server/types/node/acp/usage-by-category-calculator.d.ts +0 -45
- package/cli/dist-server/types/node/acp/usage-by-category-char-weight.d.ts +0 -9
- package/cli/dist-server/types/node/acp/usage-by-category-distribute.d.ts +0 -6
- package/cli/dist-server/types/node/acp/usage-by-category-tools-split.d.ts +0 -11
- package/cli/dist-server/types/node/agent/agent-config-cli-fields.d.ts +0 -57
- package/cli/dist-server/types/node/agent/agent-controller.d.ts +0 -127
- package/cli/dist-server/types/node/agent/agent-display.d.ts +0 -77
- package/cli/dist-server/types/node/agent/agent-runtime-adapter.d.ts +0 -69
- package/cli/dist-server/types/node/agent/custom-agent-identity.d.ts +0 -54
- package/cli/dist-server/types/node/agent/custom-agent-manager.d.ts +0 -43
- package/cli/dist-server/types/node/agent/custom-agent-path-registry.d.ts +0 -19
- package/cli/dist-server/types/node/agent/insights-data-agent-run-interceptor.d.ts +0 -67
- package/cli/dist-server/types/node/agent/interceptor-name-registry.d.ts +0 -4
- package/cli/dist-server/types/node/agent/interceptors/channel-event-interceptor.d.ts +0 -44
- package/cli/dist-server/types/node/agent/interceptors/command-interceptors.d.ts +0 -71
- package/cli/dist-server/types/node/agent/interceptors/deep-research-pending-interceptor.d.ts +0 -30
- package/cli/dist-server/types/node/agent/interceptors/env-interceptor.d.ts +0 -7
- package/cli/dist-server/types/node/agent/interceptors/file-interceptors.d.ts +0 -38
- package/cli/dist-server/types/node/agent/interceptors/image-interceptors.d.ts +0 -47
- package/cli/dist-server/types/node/agent/interceptors/index.d.ts +0 -15
- package/cli/dist-server/types/node/agent/interceptors/initial-prompt-interceptor.d.ts +0 -29
- package/cli/dist-server/types/node/agent/interceptors/model-interceptors.d.ts +0 -43
- package/cli/dist-server/types/node/agent/interceptors/sandbox-interceptor.d.ts +0 -68
- package/cli/dist-server/types/node/agent/interceptors/sensitive-user-input-interceptor.d.ts +0 -7
- package/cli/dist-server/types/node/agent/interceptors/system-reminder-interceptor.d.ts +0 -76
- package/cli/dist-server/types/node/agent/interceptors/team-resume-intent-interceptor.d.ts +0 -31
- package/cli/dist-server/types/node/agent/interceptors/telemetry-interceptors.d.ts +0 -43
- package/cli/dist-server/types/node/agent/interceptors/ultracode-effort-reminder-interceptor.d.ts +0 -21
- package/cli/dist-server/types/node/agent/interceptors/ultracode-keyword-interceptor.d.ts +0 -34
- package/cli/dist-server/types/node/agent/main-agent-acp-handler.d.ts +0 -203
- package/cli/dist-server/types/node/agent/main-agent-policy.d.ts +0 -33
- package/cli/dist-server/types/node/agent/memory-context-interceptor.d.ts +0 -84
- package/cli/dist-server/types/node/agent/stream-json-init-interceptor.d.ts +0 -9
- package/cli/dist-server/types/node/agent/subagent-limits.d.ts +0 -75
- package/cli/dist-server/types/node/agent/team-context-interceptor.d.ts +0 -42
- package/cli/dist-server/types/node/agent/team-resume-intent.d.ts +0 -20
- package/cli/dist-server/types/node/agent/teammate-failure-interceptor.d.ts +0 -67
- package/cli/dist-server/types/node/agent-home/agent-home-acp-forward.d.ts +0 -11
- package/cli/dist-server/types/node/agent-home/agent-home-agent-create.d.ts +0 -31
- package/cli/dist-server/types/node/agent-home/agent-home-audit.d.ts +0 -54
- package/cli/dist-server/types/node/agent-home/agent-home-channel-context.d.ts +0 -44
- package/cli/dist-server/types/node/agent-home/agent-home-channel-create.d.ts +0 -73
- package/cli/dist-server/types/node/agent-home/agent-home-channel-events.d.ts +0 -8
- package/cli/dist-server/types/node/agent-home/agent-home-channel-lookup.d.ts +0 -30
- package/cli/dist-server/types/node/agent-home/agent-home-channel-speech.d.ts +0 -72
- package/cli/dist-server/types/node/agent-home/agent-home-channel-task-events.d.ts +0 -45
- package/cli/dist-server/types/node/agent-home/agent-home-channel-task-order.d.ts +0 -25
- package/cli/dist-server/types/node/agent-home/agent-home-channel-tasks.d.ts +0 -156
- package/cli/dist-server/types/node/agent-home/agent-home-channel-wake-guard.d.ts +0 -35
- package/cli/dist-server/types/node/agent-home/agent-home-channel-wake.d.ts +0 -102
- package/cli/dist-server/types/node/agent-home/agent-home-colleague-job.d.ts +0 -37
- package/cli/dist-server/types/node/agent-home/agent-home-colleague-memory.d.ts +0 -52
- package/cli/dist-server/types/node/agent-home/agent-home-deliver.d.ts +0 -76
- package/cli/dist-server/types/node/agent-home/agent-home-directory-lock.d.ts +0 -22
- package/cli/dist-server/types/node/agent-home/agent-home-errors.d.ts +0 -17
- package/cli/dist-server/types/node/agent-home/agent-home-inbox.d.ts +0 -101
- package/cli/dist-server/types/node/agent-home/agent-home-main-session.d.ts +0 -33
- package/cli/dist-server/types/node/agent-home/agent-home-recipients.d.ts +0 -38
- package/cli/dist-server/types/node/agent-home/agent-home-room-context-interceptor.d.ts +0 -30
- package/cli/dist-server/types/node/agent-home/agent-home-runtime-arm-state.d.ts +0 -14
- package/cli/dist-server/types/node/agent-home/agent-home-runtime.d.ts +0 -87
- package/cli/dist-server/types/node/agent-home/agent-home-settings.d.ts +0 -39
- package/cli/dist-server/types/node/agent-home/agent-home-tool-gate.d.ts +0 -53
- package/cli/dist-server/types/node/agent-home/channel-wake-service.d.ts +0 -69
- package/cli/dist-server/types/node/agent-task/categorize-failure.d.ts +0 -65
- package/cli/dist-server/types/node/agent-team/shutdown-coordinator.d.ts +0 -98
- package/cli/dist-server/types/node/agent-team/team-runtime-adopter.d.ts +0 -13
- package/cli/dist-server/types/node/agent-team/team-runtime-manifest.d.ts +0 -66
- package/cli/dist-server/types/node/agent-team/team-runtime-status.d.ts +0 -34
- package/cli/dist-server/types/node/agent-view/agent-view-actions.d.ts +0 -205
- package/cli/dist-server/types/node/agent-view/job-reclaim-gate.d.ts +0 -13
- package/cli/dist-server/types/node/ask/index.d.ts +0 -3
- package/cli/dist-server/types/node/bash-sandbox/index.d.ts +0 -4
- package/cli/dist-server/types/node/code-ratio/cli-git-commit-watcher.d.ts +0 -159
- package/cli/dist-server/types/node/code-ratio/cli-svn-commit-watcher.d.ts +0 -111
- package/cli/dist-server/types/node/code-ratio/code-ratio-reporting-service.d.ts +0 -90
- package/cli/dist-server/types/node/code-ratio/fs-file-reader.d.ts +0 -26
- package/cli/dist-server/types/node/code-ratio/index.d.ts +0 -5
- package/cli/dist-server/types/node/code-ratio/repo-discovery.d.ts +0 -32
- package/cli/dist-server/types/node/code-ratio/vcs-repo-resolver.d.ts +0 -51
- package/cli/dist-server/types/node/control-signal/stdout-writer.d.ts +0 -99
- package/cli/dist-server/types/node/elicitation/elicitation-service.d.ts +0 -100
- package/cli/dist-server/types/node/hooks/admin-trusted.d.ts +0 -41
- package/cli/dist-server/types/node/http/api-galileo-metrics.d.ts +0 -19
- package/cli/dist-server/types/node/http/classify-network-error.d.ts +0 -21
- package/cli/dist-server/types/node/http/custom-header-http-interceptor.d.ts +0 -14
- package/cli/dist-server/types/node/http/fetch-proxy.d.ts +0 -22
- package/cli/dist-server/types/node/http/http-proxy-interceptor.d.ts +0 -74
- package/cli/dist-server/types/node/http/index.d.ts +0 -6
- package/cli/dist-server/types/node/http/workbuddy-config-dir.d.ts +0 -17
- package/cli/dist-server/types/node/lsp/index.d.ts +0 -6
- package/cli/dist-server/types/node/lsp/lsp-client.d.ts +0 -104
- package/cli/dist-server/types/node/lsp/lsp-exit-registry.d.ts +0 -16
- package/cli/dist-server/types/node/lsp/lsp-manager.d.ts +0 -91
- package/cli/dist-server/types/node/lsp/lsp-protocol.d.ts +0 -245
- package/cli/dist-server/types/node/model/effort-capabilities.d.ts +0 -64
- package/cli/dist-server/types/node/model/passthrough-header-policy.d.ts +0 -25
- package/cli/dist-server/types/node/multitask/completion-bus.d.ts +0 -36
- package/cli/dist-server/types/node/multitask/coordinator-acp-bridge.d.ts +0 -41
- package/cli/dist-server/types/node/multitask/coordinator-interceptor.d.ts +0 -7
- package/cli/dist-server/types/node/multitask/coordinator-tool-policy.d.ts +0 -18
- package/cli/dist-server/types/node/multitask/delegation-planner.d.ts +0 -6
- package/cli/dist-server/types/node/multitask/entry-guard.d.ts +0 -12
- package/cli/dist-server/types/node/multitask/host-api.d.ts +0 -63
- package/cli/dist-server/types/node/multitask/inspect-self-tool.d.ts +0 -18
- package/cli/dist-server/types/node/multitask/multitask-log.d.ts +0 -2
- package/cli/dist-server/types/node/multitask/multitask-metrics.d.ts +0 -2
- package/cli/dist-server/types/node/multitask/planner-runtime.d.ts +0 -7
- package/cli/dist-server/types/node/multitask/sandbox-reveal.d.ts +0 -35
- package/cli/dist-server/types/node/multitask/self-model.d.ts +0 -7
- package/cli/dist-server/types/node/multitask/slash-entry.d.ts +0 -14
- package/cli/dist-server/types/node/multitask/spawn-detached.d.ts +0 -9
- package/cli/dist-server/types/node/multitask/subagent-alias.d.ts +0 -5
- package/cli/dist-server/types/node/multitask/surface-reminder.d.ts +0 -5
- package/cli/dist-server/types/node/multitask/types.d.ts +0 -123
- package/cli/dist-server/types/node/multitask/wakeup-gate.d.ts +0 -21
- package/cli/dist-server/types/node/navigation/index.d.ts +0 -2
- package/cli/dist-server/types/node/runtime/add-dir-middleware.d.ts +0 -13
- package/cli/dist-server/types/node/runtime/external-uri-opener.d.ts +0 -8
- package/cli/dist-server/types/node/runtime/file-local-storage.d.ts +0 -17
- package/cli/dist-server/types/node/runtime/workspace-folder-manager.d.ts +0 -45
- package/cli/dist-server/types/node/runtime/workspace.d.ts +0 -5
- package/cli/dist-server/types/node/sandbox-cli/network-block-records.d.ts +0 -18
- package/cli/dist-server/types/node/shortcut/shortcut-protocol.d.ts +0 -41
- package/cli/dist-server/types/node/stats/index.d.ts +0 -5
- package/cli/dist-server/types/node/tools/a2a-cancel-task-tool.d.ts +0 -55
- package/cli/dist-server/types/node/tools/a2a-get-agent-card-tool.d.ts +0 -59
- package/cli/dist-server/types/node/tools/a2a-get-task-tool.d.ts +0 -316
- package/cli/dist-server/types/node/tools/a2a-poll-retry.d.ts +0 -46
- package/cli/dist-server/types/node/tools/a2a-send-message-tool.d.ts +0 -138
- package/cli/dist-server/types/node/tools/a2a-tool-guards.d.ts +0 -48
- package/cli/dist-server/types/node/tools/agent-tool.d.ts +0 -154
- package/cli/dist-server/types/node/tools/artifact-common.d.ts +0 -80
- package/cli/dist-server/types/node/tools/artifact-control-tool.d.ts +0 -103
- package/cli/dist-server/types/node/tools/artifact-tool.d.ts +0 -109
- package/cli/dist-server/types/node/tools/ask-user-for-structured-input-tool.d.ts +0 -127
- package/cli/dist-server/types/node/tools/ask-user-question-tool.d.ts +0 -237
- package/cli/dist-server/types/node/tools/ask-user-question-validation.d.ts +0 -22
- package/cli/dist-server/types/node/tools/auto-mode/auto-mode-critique-client.d.ts +0 -51
- package/cli/dist-server/types/node/tools/auto-mode/auto-mode-strategy.d.ts +0 -21
- package/cli/dist-server/types/node/tools/auto-mode/index.d.ts +0 -15
- package/cli/dist-server/types/node/tools/background-output-files.d.ts +0 -39
- package/cli/dist-server/types/node/tools/background-output-tail-poller.d.ts +0 -60
- package/cli/dist-server/types/node/tools/bash-output-tool.d.ts +0 -34
- package/cli/dist-server/types/node/tools/bash-sandbox-approval-requester.d.ts +0 -48
- package/cli/dist-server/types/node/tools/bash-security-windows.d.ts +0 -34
- package/cli/dist-server/types/node/tools/bash-tool.d.ts +0 -204
- package/cli/dist-server/types/node/tools/channel-tasks-tool.d.ts +0 -174
- package/cli/dist-server/types/node/tools/computer-use-capabilities.d.ts +0 -23
- package/cli/dist-server/types/node/tools/computer-use-executor.d.ts +0 -130
- package/cli/dist-server/types/node/tools/computer-use-tool.d.ts +0 -86
- package/cli/dist-server/types/node/tools/create-channel-tool.d.ts +0 -82
- package/cli/dist-server/types/node/tools/create-colleague-tool.d.ts +0 -64
- package/cli/dist-server/types/node/tools/create-mode-write-guard.d.ts +0 -3
- package/cli/dist-server/types/node/tools/cron-create-tool.d.ts +0 -41
- package/cli/dist-server/types/node/tools/cron-delete-tool.d.ts +0 -28
- package/cli/dist-server/types/node/tools/cron-list-tool.d.ts +0 -27
- package/cli/dist-server/types/node/tools/defer-execute-tool.d.ts +0 -260
- package/cli/dist-server/types/node/tools/delegate-tool.d.ts +0 -71
- package/cli/dist-server/types/node/tools/edit-tool.d.ts +0 -78
- package/cli/dist-server/types/node/tools/enter-planmode-tool.d.ts +0 -29
- package/cli/dist-server/types/node/tools/enter-worktree-tool.d.ts +0 -59
- package/cli/dist-server/types/node/tools/exit-planmode-tool.d.ts +0 -86
- package/cli/dist-server/types/node/tools/file-action-report-utils.d.ts +0 -35
- package/cli/dist-server/types/node/tools/glob-tool.d.ts +0 -102
- package/cli/dist-server/types/node/tools/grep-tool.d.ts +0 -141
- package/cli/dist-server/types/node/tools/image-edit-tool.d.ts +0 -94
- package/cli/dist-server/types/node/tools/image-gen-tool.d.ts +0 -107
- package/cli/dist-server/types/node/tools/kill-shell-tool.d.ts +0 -27
- package/cli/dist-server/types/node/tools/leave-worktree-tool.d.ts +0 -54
- package/cli/dist-server/types/node/tools/list-colleagues-tool.d.ts +0 -35
- package/cli/dist-server/types/node/tools/list-mcp-resources-tool.d.ts +0 -58
- package/cli/dist-server/types/node/tools/lsp-tool.d.ts +0 -68
- package/cli/dist-server/types/node/tools/main-agent-meta-tools.d.ts +0 -107
- package/cli/dist-server/types/node/tools/malicious-block-guidance.d.ts +0 -11
- package/cli/dist-server/types/node/tools/memory-tool.d.ts +0 -33
- package/cli/dist-server/types/node/tools/message-colleague-tool.d.ts +0 -79
- package/cli/dist-server/types/node/tools/monitor-tool.d.ts +0 -216
- package/cli/dist-server/types/node/tools/monitor-ws-network-policy.d.ts +0 -64
- package/cli/dist-server/types/node/tools/monitor-ws-source.d.ts +0 -72
- package/cli/dist-server/types/node/tools/multi-edit-tool.d.ts +0 -104
- package/cli/dist-server/types/node/tools/notebook-edit-tool.d.ts +0 -75
- package/cli/dist-server/types/node/tools/notebook-read-tool.d.ts +0 -55
- package/cli/dist-server/types/node/tools/notebook-write-tool.d.ts +0 -7
- package/cli/dist-server/types/node/tools/powershell-clm-types.d.ts +0 -30
- package/cli/dist-server/types/node/tools/powershell-command-semantics.d.ts +0 -23
- package/cli/dist-server/types/node/tools/powershell-dangerous-cmdlets.d.ts +0 -72
- package/cli/dist-server/types/node/tools/powershell-destructive-warning.d.ts +0 -12
- package/cli/dist-server/types/node/tools/powershell-detection.d.ts +0 -51
- package/cli/dist-server/types/node/tools/powershell-git-safety.d.ts +0 -60
- package/cli/dist-server/types/node/tools/powershell-pty-utils.d.ts +0 -13
- package/cli/dist-server/types/node/tools/powershell-security.d.ts +0 -93
- package/cli/dist-server/types/node/tools/powershell-tool.d.ts +0 -174
- package/cli/dist-server/types/node/tools/product-interaction-tools.d.ts +0 -23
- package/cli/dist-server/types/node/tools/push-notification-tool.d.ts +0 -55
- package/cli/dist-server/types/node/tools/read-mcp-resource-tool.d.ts +0 -71
- package/cli/dist-server/types/node/tools/read-state-guard.d.ts +0 -22
- package/cli/dist-server/types/node/tools/read-tool.d.ts +0 -71
- package/cli/dist-server/types/node/tools/repl/index.d.ts +0 -10
- package/cli/dist-server/types/node/tools/repl/repl-bridge-broker.d.ts +0 -109
- package/cli/dist-server/types/node/tools/repl/repl-bridge-host.d.ts +0 -29
- package/cli/dist-server/types/node/tools/repl/repl-catalog-protocol.d.ts +0 -136
- package/cli/dist-server/types/node/tools/repl/repl-catalog-render.d.ts +0 -56
- package/cli/dist-server/types/node/tools/repl/repl-catalog-source.d.ts +0 -117
- package/cli/dist-server/types/node/tools/repl/repl-import-rewrite.d.ts +0 -17
- package/cli/dist-server/types/node/tools/repl/repl-nested-interaction.d.ts +0 -32
- package/cli/dist-server/types/node/tools/repl/repl-sandbox-result.d.ts +0 -111
- package/cli/dist-server/types/node/tools/repl/repl-tool.d.ts +0 -128
- package/cli/dist-server/types/node/tools/repl/repl-worker-manager.d.ts +0 -95
- package/cli/dist-server/types/node/tools/repl/repl-worker-source.d.ts +0 -16
- package/cli/dist-server/types/node/tools/repl/repl-worker-source.generated.d.ts +0 -2
- package/cli/dist-server/types/node/tools/report-findings-tool.d.ts +0 -97
- package/cli/dist-server/types/node/tools/running-background-tasks.d.ts +0 -26
- package/cli/dist-server/types/node/tools/sandbox-approval-helpers.d.ts +0 -19
- package/cli/dist-server/types/node/tools/sandbox-intercept-message.d.ts +0 -22
- package/cli/dist-server/types/node/tools/sandbox-network-intercept-message.d.ts +0 -25
- package/cli/dist-server/types/node/tools/sandbox-permission-file-tool.d.ts +0 -14
- package/cli/dist-server/types/node/tools/sandbox-program-blacklist-message.d.ts +0 -9
- package/cli/dist-server/types/node/tools/send-message-tool.d.ts +0 -116
- package/cli/dist-server/types/node/tools/send-user-message-attachments.d.ts +0 -22
- package/cli/dist-server/types/node/tools/send-user-message-tool.d.ts +0 -60
- package/cli/dist-server/types/node/tools/shell-stream-pusher.d.ts +0 -25
- package/cli/dist-server/types/node/tools/skill-manage-tool.d.ts +0 -77
- package/cli/dist-server/types/node/tools/skill-tool.d.ts +0 -129
- package/cli/dist-server/types/node/tools/slash-command-tool.d.ts +0 -45
- package/cli/dist-server/types/node/tools/speak-in-channel-tool.d.ts +0 -178
- package/cli/dist-server/types/node/tools/structured-output-tool.d.ts +0 -43
- package/cli/dist-server/types/node/tools/task-create-tool.d.ts +0 -72
- package/cli/dist-server/types/node/tools/task-get-tool.d.ts +0 -31
- package/cli/dist-server/types/node/tools/task-list-tool.d.ts +0 -21
- package/cli/dist-server/types/node/tools/task-output-tool.d.ts +0 -127
- package/cli/dist-server/types/node/tools/task-stop-tool.d.ts +0 -61
- package/cli/dist-server/types/node/tools/task-update-tool.d.ts +0 -79
- package/cli/dist-server/types/node/tools/team-delete-tool.d.ts +0 -38
- package/cli/dist-server/types/node/tools/todo-write-tool.d.ts +0 -117
- package/cli/dist-server/types/node/tools/tool-permission-strategy.d.ts +0 -83
- package/cli/dist-server/types/node/tools/tool-search-tool.d.ts +0 -113
- package/cli/dist-server/types/node/tools/video-gen-tool.d.ts +0 -82
- package/cli/dist-server/types/node/tools/wait-for-mcp-servers-tool.d.ts +0 -79
- package/cli/dist-server/types/node/tools/web-fetch-tool.d.ts +0 -164
- package/cli/dist-server/types/node/tools/web-search-tool.d.ts +0 -79
- package/cli/dist-server/types/node/tools/webfetch-resource-kind.d.ts +0 -25
- package/cli/dist-server/types/node/tools/wechat-reply-tool.d.ts +0 -43
- package/cli/dist-server/types/node/tools/wecom-reply-tool.d.ts +0 -65
- package/cli/dist-server/types/node/tools/workflow-tool.d.ts +0 -100
- package/cli/dist-server/types/node/tools/write-tool.d.ts +0 -74
- package/cli/dist-server/types/node/utils/stdio-persistence.d.ts +0 -39
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CreateChannel —— agent 自主建频道 / 拉人(自治组队第二步)。
|
|
3
|
-
*
|
|
4
|
-
* create:2–6 个常驻同事(主 Agent 不是成员,不算名额),lead 缺省创建者(同事)否则第一个成员;给了 kickoff 就作为第一句发言并
|
|
5
|
-
* 全员唤醒(没有 job 的同事会当场起 job)。invite:把已有同事加进来,
|
|
6
|
-
* 同样可选 kickoff 唤醒。
|
|
7
|
-
* 规则(成员解析 / 配额 / lead)全在 agent-home-channel-create,工具只做编排。
|
|
8
|
-
*/
|
|
9
|
-
import type { Session } from '../../vendor/cbc-core/node/index.js';
|
|
10
|
-
import type { RunContext } from '../../vendor/cbc-shared/node/index.js';
|
|
11
|
-
import { Logger } from '@genie/telemetry';
|
|
12
|
-
import { z } from 'zod';
|
|
13
|
-
import { ChannelWakeService } from '../agent-home/channel-wake-service';
|
|
14
|
-
import { SettingsManager } from '../settings/settings-protocol';
|
|
15
|
-
import { BaseTool } from './base-tool';
|
|
16
|
-
import { Tool, ToolCallArgumentRenderer, ToolNames, ToolResult } from './tool-protocol';
|
|
17
|
-
declare const CreateChannelParameters: z.ZodObject<{
|
|
18
|
-
action: z.ZodEnum<["create", "invite"]>;
|
|
19
|
-
name: z.ZodOptional<z.ZodString>;
|
|
20
|
-
memberAgentIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
21
|
-
kickoff: z.ZodOptional<z.ZodString>;
|
|
22
|
-
leadAgentId: z.ZodOptional<z.ZodString>;
|
|
23
|
-
channel: z.ZodOptional<z.ZodString>;
|
|
24
|
-
}, "strip", z.ZodTypeAny, {
|
|
25
|
-
action: "create" | "invite";
|
|
26
|
-
name?: string | undefined;
|
|
27
|
-
memberAgentIds?: string[] | undefined;
|
|
28
|
-
kickoff?: string | undefined;
|
|
29
|
-
leadAgentId?: string | undefined;
|
|
30
|
-
channel?: string | undefined;
|
|
31
|
-
}, {
|
|
32
|
-
action: "create" | "invite";
|
|
33
|
-
name?: string | undefined;
|
|
34
|
-
memberAgentIds?: string[] | undefined;
|
|
35
|
-
kickoff?: string | undefined;
|
|
36
|
-
leadAgentId?: string | undefined;
|
|
37
|
-
channel?: string | undefined;
|
|
38
|
-
}>;
|
|
39
|
-
type CreateChannelInput = z.infer<typeof CreateChannelParameters>;
|
|
40
|
-
export declare class CreateChannelTool extends BaseTool implements Tool {
|
|
41
|
-
protected readonly logger: Logger;
|
|
42
|
-
protected readonly wakeService?: ChannelWakeService;
|
|
43
|
-
protected readonly settingsManager?: SettingsManager;
|
|
44
|
-
name: ToolNames;
|
|
45
|
-
description: string;
|
|
46
|
-
needsApproval: boolean;
|
|
47
|
-
shouldShowInToolSearch: () => boolean;
|
|
48
|
-
parameters: z.ZodObject<{
|
|
49
|
-
action: z.ZodEnum<["create", "invite"]>;
|
|
50
|
-
name: z.ZodOptional<z.ZodString>;
|
|
51
|
-
memberAgentIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
52
|
-
kickoff: z.ZodOptional<z.ZodString>;
|
|
53
|
-
leadAgentId: z.ZodOptional<z.ZodString>;
|
|
54
|
-
channel: z.ZodOptional<z.ZodString>;
|
|
55
|
-
}, "strip", z.ZodTypeAny, {
|
|
56
|
-
action: "create" | "invite";
|
|
57
|
-
name?: string | undefined;
|
|
58
|
-
memberAgentIds?: string[] | undefined;
|
|
59
|
-
kickoff?: string | undefined;
|
|
60
|
-
leadAgentId?: string | undefined;
|
|
61
|
-
channel?: string | undefined;
|
|
62
|
-
}, {
|
|
63
|
-
action: "create" | "invite";
|
|
64
|
-
name?: string | undefined;
|
|
65
|
-
memberAgentIds?: string[] | undefined;
|
|
66
|
-
kickoff?: string | undefined;
|
|
67
|
-
leadAgentId?: string | undefined;
|
|
68
|
-
channel?: string | undefined;
|
|
69
|
-
}>;
|
|
70
|
-
argumentRenderer: ToolCallArgumentRenderer;
|
|
71
|
-
toAutoClassifierInput(_input: unknown): string;
|
|
72
|
-
isEnabled: (args?: {
|
|
73
|
-
runContext?: RunContext<Session>;
|
|
74
|
-
agent?: {
|
|
75
|
-
name?: string;
|
|
76
|
-
};
|
|
77
|
-
}) => Promise<boolean>;
|
|
78
|
-
execute(input: CreateChannelInput, context?: RunContext<Session>): Promise<ToolResult>;
|
|
79
|
-
/** 发言(有 kickoff)+ 唤醒。返回实际唤醒人数;无 wakeService 时返回 0 并记日志。 */
|
|
80
|
-
private speakAndWake;
|
|
81
|
-
}
|
|
82
|
-
export {};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CreateColleague —— agent 自主建同事(自治组队第一步)。
|
|
3
|
-
*
|
|
4
|
-
* 建的是 `~/.codebuddy/agent-home/directory.json` 里的 AgentHomeProfile:
|
|
5
|
-
* 没有 job,等有人 @ / 派任务时才被唤醒起 job。
|
|
6
|
-
* 规则(配额 / 深度 / 频率)全在 agent-home-agent-create,工具只做映射。
|
|
7
|
-
*/
|
|
8
|
-
import type { Session } from '../../vendor/cbc-core/node/index.js';
|
|
9
|
-
import type { RunContext } from '../../vendor/cbc-shared/node/index.js';
|
|
10
|
-
import { Logger } from '@genie/telemetry';
|
|
11
|
-
import { z } from 'zod';
|
|
12
|
-
import { SettingsManager } from '../settings/settings-protocol';
|
|
13
|
-
import { BaseTool } from './base-tool';
|
|
14
|
-
import { Tool, ToolCallArgumentRenderer, ToolNames, ToolResult } from './tool-protocol';
|
|
15
|
-
export declare class CreateColleagueTool extends BaseTool implements Tool {
|
|
16
|
-
protected readonly logger: Logger;
|
|
17
|
-
protected readonly settingsManager?: SettingsManager;
|
|
18
|
-
name: ToolNames;
|
|
19
|
-
description: string;
|
|
20
|
-
needsApproval: boolean;
|
|
21
|
-
shouldShowInToolSearch: () => boolean;
|
|
22
|
-
parameters: z.ZodObject<{
|
|
23
|
-
name: z.ZodString;
|
|
24
|
-
title: z.ZodOptional<z.ZodString>;
|
|
25
|
-
description: z.ZodOptional<z.ZodString>;
|
|
26
|
-
engine: z.ZodOptional<z.ZodString>;
|
|
27
|
-
model: z.ZodOptional<z.ZodString>;
|
|
28
|
-
permissionMode: z.ZodOptional<z.ZodString>;
|
|
29
|
-
homeCwd: z.ZodOptional<z.ZodString>;
|
|
30
|
-
}, "strip", z.ZodTypeAny, {
|
|
31
|
-
name: string;
|
|
32
|
-
title?: string | undefined;
|
|
33
|
-
description?: string | undefined;
|
|
34
|
-
engine?: string | undefined;
|
|
35
|
-
model?: string | undefined;
|
|
36
|
-
permissionMode?: string | undefined;
|
|
37
|
-
homeCwd?: string | undefined;
|
|
38
|
-
}, {
|
|
39
|
-
name: string;
|
|
40
|
-
title?: string | undefined;
|
|
41
|
-
description?: string | undefined;
|
|
42
|
-
engine?: string | undefined;
|
|
43
|
-
model?: string | undefined;
|
|
44
|
-
permissionMode?: string | undefined;
|
|
45
|
-
homeCwd?: string | undefined;
|
|
46
|
-
}>;
|
|
47
|
-
argumentRenderer: ToolCallArgumentRenderer;
|
|
48
|
-
toAutoClassifierInput(_input: unknown): string;
|
|
49
|
-
isEnabled: (args?: {
|
|
50
|
-
runContext?: RunContext<Session>;
|
|
51
|
-
agent?: {
|
|
52
|
-
name?: string;
|
|
53
|
-
};
|
|
54
|
-
}) => Promise<boolean>;
|
|
55
|
-
execute(input: {
|
|
56
|
-
name?: string;
|
|
57
|
-
title?: string;
|
|
58
|
-
description?: string;
|
|
59
|
-
engine?: string;
|
|
60
|
-
model?: string;
|
|
61
|
-
permissionMode?: string;
|
|
62
|
-
homeCwd?: string;
|
|
63
|
-
}, context?: RunContext<Session>): Promise<ToolResult>;
|
|
64
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { RunContext } from '@openai/agents';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { CronCreateModelSchema } from '@genie/cbc-cron';
|
|
4
|
-
import { Agent } from '../../vendor/cbc-shared/node/index.js';
|
|
5
|
-
import { Session } from '../../vendor/cbc-core/node/index.js';
|
|
6
|
-
import { BaseTool } from './base-tool';
|
|
7
|
-
import { Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
|
|
8
|
-
import { ToolNames } from '../../vendor/cbc-shared/node/index.js';
|
|
9
|
-
export declare class CronCreateTool extends BaseTool implements Tool {
|
|
10
|
-
private readonly stateManager;
|
|
11
|
-
name: ToolNames;
|
|
12
|
-
description: string;
|
|
13
|
-
parameters: z.ZodObject<Omit<{
|
|
14
|
-
cron: z.ZodString;
|
|
15
|
-
prompt: z.ZodString;
|
|
16
|
-
recurring: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
-
durable: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
-
}, "durable">, "strict", z.ZodTypeAny, {
|
|
19
|
-
cron: string;
|
|
20
|
-
prompt: string;
|
|
21
|
-
recurring?: boolean | undefined;
|
|
22
|
-
}, {
|
|
23
|
-
cron: string;
|
|
24
|
-
prompt: string;
|
|
25
|
-
recurring?: boolean | undefined;
|
|
26
|
-
}>;
|
|
27
|
-
strict: boolean;
|
|
28
|
-
needsApproval: boolean;
|
|
29
|
-
argumentRenderer: ToolCallArgumentRenderer;
|
|
30
|
-
isEnabled: (_args: {
|
|
31
|
-
runContext: RunContext<Session>;
|
|
32
|
-
agent: Agent;
|
|
33
|
-
}) => Promise<boolean>;
|
|
34
|
-
/**
|
|
35
|
-
* Auto mode classifier projection: `${cron}: ${prompt}` (Claude alignment,
|
|
36
|
-
* decision D1) — a scheduled/delayed-execution action; the prompt is the
|
|
37
|
-
* deferred risk. Consumed in history (CronCreate has `needsApproval = false`).
|
|
38
|
-
*/
|
|
39
|
-
toAutoClassifierInput(input: unknown): string;
|
|
40
|
-
execute(input: z.infer<typeof CronCreateModelSchema>, _context?: RunContext<Session>): Promise<ToolResult>;
|
|
41
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { RunContext } from '@openai/agents';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { CronDeleteSchema } from '@genie/cbc-cron';
|
|
4
|
-
import { Agent } from '../../vendor/cbc-shared/node/index.js';
|
|
5
|
-
import { Session } from '../../vendor/cbc-core/node/index.js';
|
|
6
|
-
import { BaseTool } from './base-tool';
|
|
7
|
-
import { Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
|
|
8
|
-
import { ToolNames } from '../../vendor/cbc-shared/node/index.js';
|
|
9
|
-
export declare class CronDeleteTool extends BaseTool implements Tool {
|
|
10
|
-
private readonly stateManager;
|
|
11
|
-
name: ToolNames;
|
|
12
|
-
description: string;
|
|
13
|
-
parameters: z.ZodObject<{
|
|
14
|
-
id: z.ZodString;
|
|
15
|
-
}, "strict", z.ZodTypeAny, {
|
|
16
|
-
id: string;
|
|
17
|
-
}, {
|
|
18
|
-
id: string;
|
|
19
|
-
}>;
|
|
20
|
-
strict: boolean;
|
|
21
|
-
needsApproval: boolean;
|
|
22
|
-
argumentRenderer: ToolCallArgumentRenderer;
|
|
23
|
-
isEnabled: (_args: {
|
|
24
|
-
runContext: RunContext<Session>;
|
|
25
|
-
agent: Agent;
|
|
26
|
-
}) => Promise<boolean>;
|
|
27
|
-
execute(input: z.infer<typeof CronDeleteSchema>, _context?: RunContext<Session>): Promise<ToolResult>;
|
|
28
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Session } from '../../vendor/cbc-core/node/index.js';
|
|
2
|
-
import { Agent, ToolNames } from '../../vendor/cbc-shared/node/index.js';
|
|
3
|
-
import type { RunContext } from '@openai/agents';
|
|
4
|
-
import { BaseTool } from './base-tool';
|
|
5
|
-
import { Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
|
|
6
|
-
/** Max prompt length shown in a CronList line before truncating with an ellipsis. */
|
|
7
|
-
export declare const CRON_LIST_PROMPT_PREVIEW_LENGTH = 80;
|
|
8
|
-
/**
|
|
9
|
-
* Truncate a job's prompt to the preview length shown in CronList output.
|
|
10
|
-
* Anything relying on this preview being visible (e.g. the /loop marker
|
|
11
|
-
* lookup in loop-skill-provider.ts) must stay within this length.
|
|
12
|
-
*/
|
|
13
|
-
export declare function truncatePromptPreview(prompt: string): string;
|
|
14
|
-
export declare class CronListTool extends BaseTool implements Tool {
|
|
15
|
-
private readonly stateManager;
|
|
16
|
-
name: ToolNames;
|
|
17
|
-
description: string;
|
|
18
|
-
parameters: import("zod").ZodObject<{}, "strict", import("zod").ZodTypeAny, {}, {}>;
|
|
19
|
-
strict: boolean;
|
|
20
|
-
needsApproval: boolean;
|
|
21
|
-
argumentRenderer: ToolCallArgumentRenderer;
|
|
22
|
-
isEnabled: (_args: {
|
|
23
|
-
runContext: RunContext<Session>;
|
|
24
|
-
agent: Agent;
|
|
25
|
-
}) => Promise<boolean>;
|
|
26
|
-
execute(_input?: unknown, _context?: RunContext<Session>): Promise<ToolResult>;
|
|
27
|
-
}
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import { AgentManager, Session, SessionManager } from '../../vendor/cbc-core/node/index.js';
|
|
2
|
-
import { type FunctionCallItem, RunContext, ToolExecuteArgument, ToolNames } from '../../vendor/cbc-shared/node/index.js';
|
|
3
|
-
import { Logger } from '@genie/telemetry';
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import { AcpBroadcastService } from '../acp/acp-protocol';
|
|
6
|
-
import { AgentScopedMcpManager, McpConfigManager, McpManager } from '../mcp/mcp-protocol';
|
|
7
|
-
import { BaseTool } from './base-tool';
|
|
8
|
-
import { DeferToolConfigService } from './defer-tool-config-protocol';
|
|
9
|
-
import { Tool, ToolCallArgumentRenderer, ToolManager, ToolResult } from './tool-protocol';
|
|
10
|
-
import { ToolSearchService } from './tool-search-protocol';
|
|
11
|
-
import { AgentToolDeferOverlayCache } from './tool-spec';
|
|
12
|
-
/**
|
|
13
|
-
* Parameters for the DeferExecuteTool
|
|
14
|
-
*/
|
|
15
|
-
declare const DeferExecuteParameters: z.ZodObject<{
|
|
16
|
-
toolName: z.ZodString;
|
|
17
|
-
params: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
18
|
-
}, "strip", z.ZodTypeAny, {
|
|
19
|
-
toolName: string;
|
|
20
|
-
params: Record<string, any>;
|
|
21
|
-
}, {
|
|
22
|
-
toolName: string;
|
|
23
|
-
params: Record<string, any>;
|
|
24
|
-
}>;
|
|
25
|
-
/**
|
|
26
|
-
* Proxy tool for executing deferred-loading tools without injecting their
|
|
27
|
-
* definitions into the LLM tools list.
|
|
28
|
-
*
|
|
29
|
-
* Supports built-in deferred tools (e.g., ImageGen, LSP), canonical MCP tools
|
|
30
|
-
* (`mcp__server__tool`), and bare-name MCP tools from transparent proxy.
|
|
31
|
-
*
|
|
32
|
-
* Tool Enable & SDK Filtering:
|
|
33
|
-
* Built-in deferred tools use the AgentManager wrapped isEnabled chain, including
|
|
34
|
-
* defer activation bypass, original tool availability, SDK allow/deny options,
|
|
35
|
-
* delegate-mode restrictions, and other visibility gates.
|
|
36
|
-
*
|
|
37
|
-
* Deferred MCP tools are not listed in agent.tools. They bypass the agent tool-name
|
|
38
|
-
* filter here, but are still subject to the subagent MCP whitelist
|
|
39
|
-
* (McpSubagentToolManager, when the agent registered one) and to
|
|
40
|
-
* ToolPermissionService deny/approval checks before execution.
|
|
41
|
-
*
|
|
42
|
-
* Flow:
|
|
43
|
-
* 1. Model calls ToolSearch → gets tool name, description, and full parameter schema
|
|
44
|
-
* 2. Model calls DeferExecuteTool({ toolName, params }) → checks isEnabled + SDK filters
|
|
45
|
-
* 3. If tool passes all checks, validates params against schema and delegates to the real tool
|
|
46
|
-
*
|
|
47
|
-
* This keeps the LLM context prefix (system prompt + tools list) stable,
|
|
48
|
-
* maximizing KV cache hit rate on providers that support prefix caching.
|
|
49
|
-
*/
|
|
50
|
-
export declare class DeferExecuteTool extends BaseTool implements Tool {
|
|
51
|
-
protected readonly toolManager: ToolManager;
|
|
52
|
-
protected readonly toolSearchService: ToolSearchService;
|
|
53
|
-
protected readonly deferToolConfigService: DeferToolConfigService;
|
|
54
|
-
protected readonly agentToolDeferOverlayCache: AgentToolDeferOverlayCache;
|
|
55
|
-
protected readonly logger: Logger;
|
|
56
|
-
name: ToolNames;
|
|
57
|
-
isEnabled: () => Promise<boolean>;
|
|
58
|
-
parameters: z.ZodObject<{
|
|
59
|
-
toolName: z.ZodString;
|
|
60
|
-
params: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
61
|
-
}, "strip", z.ZodTypeAny, {
|
|
62
|
-
toolName: string;
|
|
63
|
-
params: Record<string, any>;
|
|
64
|
-
}, {
|
|
65
|
-
toolName: string;
|
|
66
|
-
params: Record<string, any>;
|
|
67
|
-
}>;
|
|
68
|
-
argumentRenderer: ToolCallArgumentRenderer;
|
|
69
|
-
protected readonly mcpManager: McpManager;
|
|
70
|
-
protected readonly agentScopedMcpManager: AgentScopedMcpManager;
|
|
71
|
-
protected readonly mcpConfigManager: McpConfigManager;
|
|
72
|
-
protected readonly sessionManager: SessionManager;
|
|
73
|
-
protected readonly agentManager: AgentManager;
|
|
74
|
-
/**
|
|
75
|
-
* Optional because ACP only exists when the CLI runs as an ACP backend
|
|
76
|
-
* (Web UI, IDE, workbuddy-desktop). In SDK / headless mode this stays undefined
|
|
77
|
-
* and MCP progress is silently dropped — same as before this feature existed.
|
|
78
|
-
*/
|
|
79
|
-
protected readonly acpBroadcastService?: AcpBroadcastService;
|
|
80
|
-
private ajv;
|
|
81
|
-
private validateCache;
|
|
82
|
-
/**
|
|
83
|
-
* Override needsApproval to support dual-mode permission matching:
|
|
84
|
-
*
|
|
85
|
-
* Phase 1: Check DeferExecuteTool's own permission rules.
|
|
86
|
-
* Supports rules like "DeferExecuteTool(*)" and "DeferExecuteTool(TeamCreate)".
|
|
87
|
-
* The targetToolName is passed as a Command arg so that
|
|
88
|
-
* "DeferExecuteTool(TeamCreate)" matches via matchCommandRule.
|
|
89
|
-
*
|
|
90
|
-
* Phase 2: Delegate to the target tool's permission check.
|
|
91
|
-
* Supports rules like "TeamCreate" and "TeamCreate(*)".
|
|
92
|
-
* This ensures each target tool's own permission rules still apply.
|
|
93
|
-
*/
|
|
94
|
-
needsApproval: (runContext: RunContext<Session>, input: ToolExecuteArgument<any>, callId?: string) => Promise<boolean>;
|
|
95
|
-
/**
|
|
96
|
-
* Fallback: check permission against DeferExecuteTool itself.
|
|
97
|
-
*/
|
|
98
|
-
private defaultNeedsApproval;
|
|
99
|
-
private isMandatoryApprovalEnabled;
|
|
100
|
-
execute(input: z.infer<typeof DeferExecuteParameters>, context: RunContext<Session>, details?: {
|
|
101
|
-
toolCall: FunctionCallItem;
|
|
102
|
-
}): Promise<ToolResult>;
|
|
103
|
-
/**
|
|
104
|
-
* Public routing entry for callers outside the LLM tool-call path — currently the
|
|
105
|
-
* REPL sandbox, whose preloaded tool globals dispatch through here.
|
|
106
|
-
*
|
|
107
|
-
* Differs from {@link execute} in two ways, both required by the REPL:
|
|
108
|
-
* 1. **No deferred-index requirement.** The sandbox preloads *all* session tools,
|
|
109
|
-
* including non-deferred builtins (Bash/Read/...) that are absent from the
|
|
110
|
-
* ToolSearchService index. `execute` rejects those with "not found".
|
|
111
|
-
* 2. **No param validation against the index.** Schema validation happens inside
|
|
112
|
-
* each execution path; the index may not hold a schema for inline builtins.
|
|
113
|
-
*
|
|
114
|
-
* Tool-availability filtering (`--tools` / agent whitelist) IS enforced here via
|
|
115
|
-
* `checkToolAllowed`, same as {@link execute} — otherwise the REPL sandbox could
|
|
116
|
-
* invoke a builtin (e.g. Bash) that the whitelist excludes, bypassing `--tools`.
|
|
117
|
-
*
|
|
118
|
-
* Interactive *permission* (approval prompting) is NOT done here — the caller must
|
|
119
|
-
* run `checkPermission` itself (the REPL broker does, see mcp-code-mode-design.md
|
|
120
|
-
* §4.8). Keeping approval outside avoids double-prompting when a caller has its own
|
|
121
|
-
* approval semantics. Availability filtering and approval are distinct gates.
|
|
122
|
-
*/
|
|
123
|
-
routeToolCall(toolName: string, params: Record<string, unknown>, context: RunContext<Session>, details?: {
|
|
124
|
-
toolCall: FunctionCallItem;
|
|
125
|
-
}): Promise<ToolResult>;
|
|
126
|
-
/**
|
|
127
|
-
* Execute a built-in deferred tool via ToolManager.
|
|
128
|
-
*/
|
|
129
|
-
private executeBuiltinTool;
|
|
130
|
-
/**
|
|
131
|
-
* Execute an MCP tool via the MCP server's callTool method.
|
|
132
|
-
*
|
|
133
|
-
* MCP tools are not managed by ToolManager; they live on MCPServer instances.
|
|
134
|
-
* Deferred MCP names can be canonical "mcp__serverName__rawToolName" or
|
|
135
|
-
* bare names from transparent proxy, such as "connect_cloud_service".
|
|
136
|
-
*
|
|
137
|
-
* When `toolCallId` is available (i.e. running under an ACP backend) and an
|
|
138
|
-
* `AcpBroadcastService` is wired, we install an `__onProgress` callback in
|
|
139
|
-
* `meta` so MCP server progress notifications are broadcast as ACP
|
|
140
|
-
* `tool_call_update` events with `metaData.mcpProgress`. The MCP renderer
|
|
141
|
-
* (cb-chat-ui) reads that field and shows live progress in the UI.
|
|
142
|
-
*/
|
|
143
|
-
private executeMcpTool;
|
|
144
|
-
/**
|
|
145
|
-
* 解析本次工具调用应透传的模型 ID。
|
|
146
|
-
*
|
|
147
|
-
* 优先级对齐 ModelConfigAgentRunInterceptor:
|
|
148
|
-
* session.requestOptions.model(运行时切模型:SDK set_model / ACP 切模型 / 命令 frontmatter)
|
|
149
|
-
* > session.options.model(--model 启动参数)
|
|
150
|
-
* > agent 默认模型(headless/-p 场景下前两者通常为空,这里回退保证 modelId 不丢)。
|
|
151
|
-
*
|
|
152
|
-
* agent 默认模型解析失败时静默返回 undefined:modelId 透传是“尽力而为”,
|
|
153
|
-
* 不应因取模型失败而阻断工具调用。
|
|
154
|
-
*/
|
|
155
|
-
private resolveCurrentModelId;
|
|
156
|
-
/**
|
|
157
|
-
* Convert MCP CallToolResultContent to ToolResult.
|
|
158
|
-
*
|
|
159
|
-
* @param content 工具返回的 content 数组(text/image/resource 块)
|
|
160
|
-
* @param resultMeta CallToolResult 顶层的 structuredContent / _meta(经 sideband sink 捞回)。
|
|
161
|
-
* 存在 MCP Apps `_meta.ui` 等扩展时,挂到结果上供下游 ACP 透传渲染。
|
|
162
|
-
*/
|
|
163
|
-
private convertMcpResult;
|
|
164
|
-
/**
|
|
165
|
-
* MCP Apps(io.modelcontextprotocol/ui):委托共享广播实现。
|
|
166
|
-
* 直连 FunctionTool 路径由 mcp-server-manager.callTool 出口同样调用该实现(#80575)。
|
|
167
|
-
*/
|
|
168
|
-
private maybeBroadcastMcpUi;
|
|
169
|
-
/**
|
|
170
|
-
* Unified builtin deferred tool filtering check using getAllowedToolsForAgent.
|
|
171
|
-
* MCP deferred tools, including bare-name transparent-proxy tools, bypass this
|
|
172
|
-
* agent tool-name filter, but `mcp__` tools are still gated by the subagent MCP
|
|
173
|
-
* whitelist (McpSubagentToolManager) when the current agent registered one.
|
|
174
|
-
*
|
|
175
|
-
* Returns a ToolResult error if blocked, or undefined if allowed.
|
|
176
|
-
*/
|
|
177
|
-
private checkToolAllowed;
|
|
178
|
-
/**
|
|
179
|
-
* Normalize the nested `params` field before validation/dispatch.
|
|
180
|
-
*
|
|
181
|
-
* Weaker models sometimes double-encode this object field as a JSON string
|
|
182
|
-
* (e.g. emit `params: "{}"` instead of `params: {}`). Since the SDK only
|
|
183
|
-
* JSON.parses the outer tool arguments and does not coerce nested fields,
|
|
184
|
-
* such a string would reach validateParams and fail with "root: must be
|
|
185
|
-
* object", breaking every MCP tool routed through DeferExecuteTool.
|
|
186
|
-
*
|
|
187
|
-
* Only a string that parses into a plain object is unwrapped. Anything else
|
|
188
|
-
* (already an object, or a string that is not a JSON object) is returned
|
|
189
|
-
* unchanged so validateParams can still surface the original schema error.
|
|
190
|
-
*/
|
|
191
|
-
private normalizeParams;
|
|
192
|
-
/**
|
|
193
|
-
* Recover long numeric IDs whose precision `JSON.parse` already destroyed.
|
|
194
|
-
*
|
|
195
|
-
* A JSON integer beyond `Number.MAX_SAFE_INTEGER` cannot survive parsing:
|
|
196
|
-
* `1070198486138087566` becomes `1070198486138087600`, so the downstream tool
|
|
197
|
-
* looks up a resource that does not exist. The exact digits only survive in the
|
|
198
|
-
* raw tool-call arguments, so walk the raw JSON tree and put the original
|
|
199
|
-
* literal back — as a string — before validation.
|
|
200
|
-
*
|
|
201
|
-
* No schema gate is applied. AJV runs next with `coerceTypes`, so a field the
|
|
202
|
-
* schema declares as number is coerced straight back to a number (unchanged
|
|
203
|
-
* behavior), while string-typed and schema-free fields keep the exact digits.
|
|
204
|
-
* Gating on "schema says string" would miss the common proxy shape, where the
|
|
205
|
-
* real business params are nested inside a free-form object (e.g. a connector's
|
|
206
|
-
* `proxy_execute_tool(tool_name, tool_args)`) that the proxy schema declares
|
|
207
|
-
* only as `type: object` and therefore says nothing about the inner ID.
|
|
208
|
-
*/
|
|
209
|
-
private restoreUnsafeIntegerLiterals;
|
|
210
|
-
/**
|
|
211
|
-
* Walk a parsed container in lockstep with its raw JSON node. Recursion is
|
|
212
|
-
* required because the corrupted ID is frequently nested: proxy tools carry
|
|
213
|
-
* business params inside a free-form object, and batch APIs carry them in arrays.
|
|
214
|
-
*/
|
|
215
|
-
private restoreUnsafeIntegersIn;
|
|
216
|
-
private restoreUnsafeIntegerAt;
|
|
217
|
-
private isPlainObject;
|
|
218
|
-
private isDeferExecuteToolCall;
|
|
219
|
-
private parseRawParamsNode;
|
|
220
|
-
private shouldRestoreUnsafeInteger;
|
|
221
|
-
/**
|
|
222
|
-
* Validate params against a JSON Schema.
|
|
223
|
-
* Returns a ToolResult with a detailed error message if validation fails, or undefined if valid.
|
|
224
|
-
*/
|
|
225
|
-
private validateParams;
|
|
226
|
-
/**
|
|
227
|
-
* Parse the deferred MCP tool name format without importing mcp-utils, which
|
|
228
|
-
* pulls in debug/session modules during isolated unit tests.
|
|
229
|
-
*/
|
|
230
|
-
private parseMcpToolFullName;
|
|
231
|
-
/**
|
|
232
|
-
* Convert a bare-name MCP tool to the canonical mcp__server__tool name for permission matching.
|
|
233
|
-
*/
|
|
234
|
-
private getMcpPermissionToolName;
|
|
235
|
-
/**
|
|
236
|
-
* 透明代理回退:当虚拟 server name(如 'playwright')在 connectedServers 中不存在时,
|
|
237
|
-
* 查找声明了对应 server/tool 路由的 transparent_proxy server。
|
|
238
|
-
*
|
|
239
|
-
* 兜底匹配策略(顺序,issue #49128):
|
|
240
|
-
* 1. 静态 toolsConfig 路由命中(启动期 mcp-config 显式声明 server_name 映射)—— 最强
|
|
241
|
-
* 2. 运行期热补 toolsConfig 路由命中(mcp-server-manager 在 tools/list 响应里
|
|
242
|
-
* 根据 _meta.serverName 写入的同 server_name 条目,issue #33921)—— 次强
|
|
243
|
-
* 3. 透明代理回退(任意 transparent_proxy: true 的 server)—— 兜底,应对
|
|
244
|
-
* set(DYNAMIC) 反复覆盖 toolsConfig 导致两层路由都 miss 的间隙
|
|
245
|
-
*
|
|
246
|
-
* 路径 3 的安全性论证:
|
|
247
|
-
* - 只对 mcp__<X>__<Y> 形态的调用生效(caller 已经判定 isPrefixedMcpTool)
|
|
248
|
-
* - 透明代理 server (connector-proxy) 的 callTool 反向路由
|
|
249
|
-
* (mcp-server-manager.ts:364-368) 会把 mcp__lexiang__xxx 转回 lexiang_xxx
|
|
250
|
-
* 传给 proxy;proxy 内部按 short name 找到 client,找不到就返回 MCP error,
|
|
251
|
-
* 等价于 "工具未连接" 的语义错误,不会越权调到其它 server
|
|
252
|
-
* - 路径 1/2 命中时不进入 3,所以 ardot / netdrive 显式预塞的兜底语义保留
|
|
253
|
-
*/
|
|
254
|
-
private findTransparentProxyServer;
|
|
255
|
-
/**
|
|
256
|
-
* 裸名 MCP 工具没有 server 前缀,只能通过 transparent_proxy 配置定位实际 MCP server。
|
|
257
|
-
*/
|
|
258
|
-
private findTransparentProxyServerForBareTool;
|
|
259
|
-
}
|
|
260
|
-
export {};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Delegate Tool - Executes tools delegated from client-side tool providers
|
|
3
|
-
*
|
|
4
|
-
* This tool enables the agent to invoke tools that are provided by external
|
|
5
|
-
* client-side tool providers (e.g., IDE extensions, plugins). The actual tool
|
|
6
|
-
* execution happens on the client side via the ACP delegateTool extension method.
|
|
7
|
-
*/
|
|
8
|
-
import { Logger } from '@celljs/core';
|
|
9
|
-
import { z } from 'zod';
|
|
10
|
-
import { RunContext } from '../../vendor/cbc-shared/node/index.js';
|
|
11
|
-
import { Session } from '../../vendor/cbc-core/node/index.js';
|
|
12
|
-
import { BaseTool } from './base-tool';
|
|
13
|
-
import { Tool, ToolResult } from './tool-protocol';
|
|
14
|
-
import { ToolNames } from '../../vendor/cbc-shared/node/index.js';
|
|
15
|
-
/**
|
|
16
|
-
* Schema for delegate tool execution
|
|
17
|
-
* Accepts tool ID, input parameters, and optional timeout
|
|
18
|
-
*/
|
|
19
|
-
declare const DelegateToolSchema: z.ZodObject<{
|
|
20
|
-
toolId: z.ZodString;
|
|
21
|
-
input: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
22
|
-
timeout: z.ZodOptional<z.ZodNumber>;
|
|
23
|
-
}, "strip", z.ZodTypeAny, {
|
|
24
|
-
toolId: string;
|
|
25
|
-
input: Record<string, any>;
|
|
26
|
-
timeout?: number | undefined;
|
|
27
|
-
}, {
|
|
28
|
-
toolId: string;
|
|
29
|
-
input: Record<string, any>;
|
|
30
|
-
timeout?: number | undefined;
|
|
31
|
-
}>;
|
|
32
|
-
export type DelegateToolInput = z.infer<typeof DelegateToolSchema>;
|
|
33
|
-
/**
|
|
34
|
-
* Delegate Tool Implementation
|
|
35
|
-
*
|
|
36
|
-
* This tool is automatically instantiated and registered by DelegateToolManager.
|
|
37
|
-
* It serves as a proxy for executing tools delegated from client-side providers.
|
|
38
|
-
*/
|
|
39
|
-
export declare class DelegateToolImpl extends BaseTool implements Tool {
|
|
40
|
-
readonly logger: Logger;
|
|
41
|
-
name: ToolNames;
|
|
42
|
-
readonly promptCacheStability: 'volatile';
|
|
43
|
-
description: string;
|
|
44
|
-
parameters: z.ZodObject<{
|
|
45
|
-
toolId: z.ZodString;
|
|
46
|
-
input: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
47
|
-
timeout: z.ZodOptional<z.ZodNumber>;
|
|
48
|
-
}, "strip", z.ZodTypeAny, {
|
|
49
|
-
toolId: string;
|
|
50
|
-
input: Record<string, any>;
|
|
51
|
-
timeout?: number | undefined;
|
|
52
|
-
}, {
|
|
53
|
-
toolId: string;
|
|
54
|
-
input: Record<string, any>;
|
|
55
|
-
timeout?: number | undefined;
|
|
56
|
-
}>;
|
|
57
|
-
needsApproval: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* DelegateTool is always enabled, but only becomes useful when delegate tools are registered
|
|
60
|
-
*/
|
|
61
|
-
isEnabled: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Execute a delegate tool on the client side via ACP extension method
|
|
64
|
-
*/
|
|
65
|
-
execute(input: DelegateToolInput, context?: RunContext<Session>): Promise<ToolResult>;
|
|
66
|
-
/**
|
|
67
|
-
* Extract raw response for hook usage
|
|
68
|
-
*/
|
|
69
|
-
extractRawResponse(result: ToolResult): unknown;
|
|
70
|
-
}
|
|
71
|
-
export {};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Workspace } from '@genie/runtime';
|
|
2
|
-
import type { RunContext } from '@openai/agents';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
import { CodeRatioReportingService } from '../code-ratio';
|
|
5
|
-
import { Session } from '../../vendor/cbc-core/node/index.js';
|
|
6
|
-
import { TelemetryService } from '../telemetry';
|
|
7
|
-
import { SandboxPermissionFileTool } from './sandbox-permission-file-tool';
|
|
8
|
-
import { ReadFileStateService, Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
|
|
9
|
-
import { ToolArg, ToolNames } from '../../vendor/cbc-shared/node/index.js';
|
|
10
|
-
declare const EditParameters: z.ZodObject<{
|
|
11
|
-
file_path: z.ZodString;
|
|
12
|
-
old_string: z.ZodString;
|
|
13
|
-
new_string: z.ZodString;
|
|
14
|
-
replace_all: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
15
|
-
}, "strip", z.ZodTypeAny, {
|
|
16
|
-
file_path: string;
|
|
17
|
-
old_string: string;
|
|
18
|
-
new_string: string;
|
|
19
|
-
replace_all: boolean;
|
|
20
|
-
}, {
|
|
21
|
-
file_path: string;
|
|
22
|
-
old_string: string;
|
|
23
|
-
new_string: string;
|
|
24
|
-
replace_all?: boolean | undefined;
|
|
25
|
-
}>;
|
|
26
|
-
export declare class EditTool extends SandboxPermissionFileTool implements Tool {
|
|
27
|
-
protected readonly workspace: Workspace;
|
|
28
|
-
protected readonly readFileStateService: ReadFileStateService;
|
|
29
|
-
protected readonly telemetryService: TelemetryService;
|
|
30
|
-
protected readonly codeRatioReportingService?: CodeRatioReportingService;
|
|
31
|
-
name: ToolNames;
|
|
32
|
-
aliases: string[];
|
|
33
|
-
parameters: z.ZodObject<{
|
|
34
|
-
file_path: z.ZodString;
|
|
35
|
-
old_string: z.ZodString;
|
|
36
|
-
new_string: z.ZodString;
|
|
37
|
-
replace_all: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
38
|
-
}, "strip", z.ZodTypeAny, {
|
|
39
|
-
file_path: string;
|
|
40
|
-
old_string: string;
|
|
41
|
-
new_string: string;
|
|
42
|
-
replace_all: boolean;
|
|
43
|
-
}, {
|
|
44
|
-
file_path: string;
|
|
45
|
-
old_string: string;
|
|
46
|
-
new_string: string;
|
|
47
|
-
replace_all?: boolean | undefined;
|
|
48
|
-
}>;
|
|
49
|
-
argumentRenderer: ToolCallArgumentRenderer;
|
|
50
|
-
resolveNeedPermissionArgs(_runContext: RunContext, input: z.infer<typeof EditParameters>, _callId?: string): ToolArg[];
|
|
51
|
-
/**
|
|
52
|
-
* Auto mode classifier projection: `${file_path}: ${new_string}` (strict
|
|
53
|
-
* Claude alignment, decision D1) — the new content is what the classifier
|
|
54
|
-
* inspects for a dangerous payload.
|
|
55
|
-
*/
|
|
56
|
-
toAutoClassifierInput(input: unknown): string;
|
|
57
|
-
execute(input: z.infer<typeof EditParameters>, context: RunContext<Session>): Promise<ToolResult>;
|
|
58
|
-
/**
|
|
59
|
-
* 兜底来自 IO 操作(writeFileContent / readFileContent 等)的普通 Error:这类异常常丢失
|
|
60
|
-
* errno,故同时按 errno 与 message 关键词识别。applyTextReplacement 抛的带码
|
|
61
|
-
* ToolExecutionError 由 execute 原样透传,不进入此方法。
|
|
62
|
-
* 优先级:无内容变更(4004) → 多重匹配(4008) → 路径不存在(4012) →
|
|
63
|
-
* 权限(4013) → 未匹配(4003) → 沙箱(4014) → 空指针 crash(4015) → 兜底(4000)。
|
|
64
|
-
*/
|
|
65
|
-
private classifyEditError;
|
|
66
|
-
/**
|
|
67
|
-
* 校验参数,失败时抛出带细分错误码的 ToolExecutionError:
|
|
68
|
-
* - zod 失败 / 空路径 → InvalidParameterError(90000)
|
|
69
|
-
* - old==new(无变更)→ ReplaceNoContentChangedError(4004)
|
|
70
|
-
* - 新建文件逃生口:old_string==='' 且文件不存在 → 放行(当 Write 用)
|
|
71
|
-
* 直接抛而非返回字符串,避免各场景被统一压成 90000,无法在监控聚合中区分。
|
|
72
|
-
*/
|
|
73
|
-
private validateToolParams;
|
|
74
|
-
private countOccurrences;
|
|
75
|
-
private resolveFilePath;
|
|
76
|
-
private reportFileAction;
|
|
77
|
-
}
|
|
78
|
-
export {};
|