@tencent-ai/agent-sdk 0.3.252 → 0.3.253
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/CHANGELOG.md +22 -0
- package/cli/dist/codebuddy-headless.js +73 -58
- package/cli/dist/codebuddy-lite-wb.mjs +96 -81
- package/cli/dist/lazy/{427.68132a34.js → 427.74b982af.js} +4 -4
- package/cli/dist/lazy-headless/{834.391fb41e.js → 834.3b674e07.js} +9 -9
- package/cli/dist-server/3556.codebuddy.js +1 -1
- package/cli/dist-server/6037.codebuddy.js +1 -1
- package/cli/dist-server/6784.codebuddy.js +1 -1
- package/cli/dist-server/codebuddy.js +45 -30
- package/cli/dist-server/types/node/agent/openai-agents-types.d.ts +5 -5
- package/cli/dist-server/types/node/mcp/mcp-sdk-values.d.ts +1 -1
- package/cli/dist-server/types/node/model/model-provider.d.ts +3 -1
- package/cli/dist-server/types/node/tools/a2a-get-task-tool.d.ts +139 -34
- package/cli/dist-server/types/node/tools/a2a-poll-retry.d.ts +46 -0
- package/cli/package.json +1 -1
- 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 +4 -4
- package/cli/product.selfhosted.json +2 -2
- package/package.json +1 -1
- package/cli/dist-server/types/node/acp/acp-view-rewind-to.d.ts +0 -34
- package/cli/dist-server/types/node/acp/acp-web-ui-client.d.ts +0 -22
- 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-home/agent-home-envelope-body.d.ts +0 -54
- package/cli/dist-server/types/node/agent-home/agent-home-inbox-events.d.ts +0 -14
- package/cli/dist-server/types/node/agent-home/agent-home-room-contacts.d.ts +0 -30
- package/cli/dist-server/types/node/agent-team/permission-bridge-client.d.ts +0 -32
- package/cli/dist-server/types/node/agent-team/permission-bridge-protocol.d.ts +0 -47
- package/cli/dist-server/types/node/agent-view/handoff-policy.d.ts +0 -80
- package/cli/dist-server/types/node/agent-view/job-respawn-prefs.d.ts +0 -12
- package/cli/dist-server/types/node/agent-view/session-handoff.d.ts +0 -161
- package/cli/dist-server/types/node/ask/index.d.ts +0 -3
- package/cli/dist-server/types/node/bash-sandbox/bash-sandbox-manager.d.ts +0 -125
- package/cli/dist-server/types/node/bash-sandbox/legacy-sandbox-shell-service.d.ts +0 -33
- package/cli/dist-server/types/node/bash-sandbox/managed-security-policy.d.ts +0 -6
- package/cli/dist-server/types/node/bash-sandbox/workbuddy-directory-protection.d.ts +0 -12
- package/cli/dist-server/types/node/checkpoint/checkpoint-service.d.ts +0 -70
- package/cli/dist-server/types/node/checkpoint/file-changes-controller.d.ts +0 -29
- package/cli/dist-server/types/node/checkpoint/file-track-service.d.ts +0 -11
- package/cli/dist-server/types/node/checkpoint/file-version-manager.d.ts +0 -10
- package/cli/dist-server/types/node/checkpoint/file-version-store.d.ts +0 -9
- package/cli/dist-server/types/node/checkpoint/file-version-update-strategies.d.ts +0 -62
- package/cli/dist-server/types/node/command/add-dir-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/agents-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/auto-compact-command-executor.d.ts +0 -20
- package/cli/dist-server/types/node/command/background-command-executor.d.ts +0 -29
- package/cli/dist-server/types/node/command/btw-command-executor.d.ts +0 -19
- package/cli/dist-server/types/node/command/clear-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/config-command-executor.d.ts +0 -15
- package/cli/dist-server/types/node/command/context-command-executor.d.ts +0 -42
- package/cli/dist-server/types/node/command/copy-command-executor.d.ts +0 -10
- package/cli/dist-server/types/node/command/cost-command-executor.d.ts +0 -13
- package/cli/dist-server/types/node/command/debug-command-executor.d.ts +0 -15
- package/cli/dist-server/types/node/command/deep-research-command-executor.d.ts +0 -25
- package/cli/dist-server/types/node/command/doctor-command-executor.d.ts +0 -7
- package/cli/dist-server/types/node/command/effort-command-executor.d.ts +0 -46
- package/cli/dist-server/types/node/command/exit-command-executor.d.ts +0 -14
- package/cli/dist-server/types/node/command/export-command-executor.d.ts +0 -7
- package/cli/dist-server/types/node/command/feedback-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/fork-bg-command-executor.d.ts +0 -30
- package/cli/dist-server/types/node/command/fork-command-executor.d.ts +0 -28
- package/cli/dist-server/types/node/command/goal-command-executor.d.ts +0 -50
- package/cli/dist-server/types/node/command/handoff-message-adapter.d.ts +0 -9
- package/cli/dist-server/types/node/command/help-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/hooks-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/ide-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/mcp-command-executor.d.ts +0 -15
- package/cli/dist-server/types/node/command/memory-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/mode-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/model-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/model-image-to-image-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-image-to-video-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-lite-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-reasoning-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-text-to-image-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-text-to-video-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/multitask-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/permissions-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/plan-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/plugin-command-executor.d.ts +0 -25
- package/cli/dist-server/types/node/command/plugin-validate-command-executor.d.ts +0 -21
- package/cli/dist-server/types/node/command/release-notes-command-executor.d.ts +0 -18
- package/cli/dist-server/types/node/command/reload-plugins-command-executor.d.ts +0 -24
- package/cli/dist-server/types/node/command/remote-control-command-executor.d.ts +0 -44
- package/cli/dist-server/types/node/command/rename-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/reset-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/resume-command-executor.d.ts +0 -21
- package/cli/dist-server/types/node/command/rewind-command-executor.d.ts +0 -10
- package/cli/dist-server/types/node/command/sandbox-command-executor.d.ts +0 -20
- package/cli/dist-server/types/node/command/save-workflow-command-executor.d.ts +0 -43
- package/cli/dist-server/types/node/command/session-reset-notifier.d.ts +0 -23
- package/cli/dist-server/types/node/command/skills-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/stats-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/status-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/tasks-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/terminal-setup-command-executor.d.ts +0 -7
- package/cli/dist-server/types/node/command/theme-command-executor.d.ts +0 -7
- package/cli/dist-server/types/node/command/todos-command-executor.d.ts +0 -16
- package/cli/dist-server/types/node/command/upgrade-command-executor.d.ts +0 -13
- package/cli/dist-server/types/node/command/vim-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/workflows-command-executor.d.ts +0 -26
- package/cli/dist-server/types/node/feedback/feedback-protocol.d.ts +0 -32
- package/cli/dist-server/types/node/feedback/feedback-service.d.ts +0 -19
- package/cli/dist-server/types/node/feedback/index.d.ts +0 -2
- package/cli/dist-server/types/node/goal/goal-policy.d.ts +0 -55
- package/cli/dist-server/types/node/goal/goal-protocol.d.ts +0 -178
- package/cli/dist-server/types/node/goal/goal-service.d.ts +0 -201
- package/cli/dist-server/types/node/goal/goal-session-start-hook.d.ts +0 -24
- package/cli/dist-server/types/node/hooks/parse-frontmatter-hooks.d.ts +0 -42
- package/cli/dist-server/types/node/install/index.d.ts +0 -6
- package/cli/dist-server/types/node/install/install-controller.d.ts +0 -15
- package/cli/dist-server/types/node/install/install-env.d.ts +0 -12
- package/cli/dist-server/types/node/install/install-errors.d.ts +0 -46
- package/cli/dist-server/types/node/install/install-protocol.d.ts +0 -83
- package/cli/dist-server/types/node/install/install-service.d.ts +0 -36
- package/cli/dist-server/types/node/install/install-utils.d.ts +0 -7
- package/cli/dist-server/types/node/install/releases-service.d.ts +0 -18
- package/cli/dist-server/types/node/install/shell-setup.d.ts +0 -36
- package/cli/dist-server/types/node/mcp/mcp-cancellation.d.ts +0 -65
- package/cli/dist-server/types/node/mcp/mcp-controller.d.ts +0 -56
- package/cli/dist-server/types/node/mcp/mcp-model-id-header-helper.d.ts +0 -12
- package/cli/dist-server/types/node/mcp/mcp-oauth-callback-html.d.ts +0 -6
- package/cli/dist-server/types/node/mcp/mcp-oauth-controller.d.ts +0 -26
- package/cli/dist-server/types/node/mcp/mcp-output-storage.d.ts +0 -57
- package/cli/dist-server/types/node/mcp/mcp-server-override-impl.d.ts +0 -136
- package/cli/dist-server/types/node/mcp/mcp-server-override.d.ts +0 -29
- package/cli/dist-server/types/node/mcp/mcp-tool-result-sideband.d.ts +0 -26
- package/cli/dist-server/types/node/mcp/mcp-validate-middleware.d.ts +0 -25
- package/cli/dist-server/types/node/mcp/models/mcp-server.d.ts +0 -18
- package/cli/dist-server/types/node/mcp/node-websocket-transport.d.ts +0 -38
- package/cli/dist-server/types/node/mcp/official-mcp-egress-policy.d.ts +0 -17
- package/cli/dist-server/types/node/mcp/sdk-mcp-server.d.ts +0 -143
- package/cli/dist-server/types/node/mcp/sdk-mcp-transport.d.ts +0 -97
- package/cli/dist-server/types/node/message-queue/followup-queue.d.ts +0 -35
- package/cli/dist-server/types/node/message-queue/index.d.ts +0 -11
- package/cli/dist-server/types/node/plugins/concurrency.d.ts +0 -1
- package/cli/dist-server/types/node/plugins/dependency-resolver.d.ts +0 -43
- package/cli/dist-server/types/node/plugins/directory-plugin-cache-projection.d.ts +0 -2
- package/cli/dist-server/types/node/plugins/guards/index.d.ts +0 -2
- package/cli/dist-server/types/node/plugins/guards/weixinpay-integrity-guard.d.ts +0 -15
- package/cli/dist-server/types/node/plugins/installers/git-plugin-installer.d.ts +0 -42
- package/cli/dist-server/types/node/plugins/installers/git-subdir-plugin-installer.d.ts +0 -19
- package/cli/dist-server/types/node/plugins/installers/index.d.ts +0 -4
- package/cli/dist-server/types/node/plugins/installers/local-plugin-installer.d.ts +0 -40
- package/cli/dist-server/types/node/plugins/installers/npm-plugin-installer.d.ts +0 -23
- package/cli/dist-server/types/node/plugins/loaders/agent-loader.d.ts +0 -43
- package/cli/dist-server/types/node/plugins/loaders/command-loader.d.ts +0 -37
- package/cli/dist-server/types/node/plugins/loaders/hook-loader.d.ts +0 -55
- package/cli/dist-server/types/node/plugins/loaders/index.d.ts +0 -8
- package/cli/dist-server/types/node/plugins/loaders/lsp-loader.d.ts +0 -47
- package/cli/dist-server/types/node/plugins/loaders/mcp-loader.d.ts +0 -75
- package/cli/dist-server/types/node/plugins/loaders/output-style-loader.d.ts +0 -49
- package/cli/dist-server/types/node/plugins/loaders/plugin-loader-manager.d.ts +0 -49
- package/cli/dist-server/types/node/plugins/loaders/skill-loader.d.ts +0 -45
- package/cli/dist-server/types/node/plugins/marketplace-name-validator.d.ts +0 -50
- package/cli/dist-server/types/node/plugins/marketplace-path-safety.d.ts +0 -86
- package/cli/dist-server/types/node/plugins/marketplaces/base-marketplace.d.ts +0 -43
- package/cli/dist-server/types/node/plugins/marketplaces/builtin-marketplace-provider.d.ts +0 -22
- package/cli/dist-server/types/node/plugins/marketplaces/directory-marketplace.d.ts +0 -19
- package/cli/dist-server/types/node/plugins/marketplaces/git-availability-detector.d.ts +0 -62
- package/cli/dist-server/types/node/plugins/marketplaces/git-fallback-coordinator.d.ts +0 -42
- package/cli/dist-server/types/node/plugins/marketplaces/git-to-zip-url-converter.d.ts +0 -50
- package/cli/dist-server/types/node/plugins/marketplaces/github-marketplace.d.ts +0 -41
- package/cli/dist-server/types/node/plugins/marketplaces/http-marketplace.d.ts +0 -47
- package/cli/dist-server/types/node/plugins/marketplaces/index.d.ts +0 -13
- package/cli/dist-server/types/node/plugins/marketplaces/marketplace-config-manager.d.ts +0 -39
- package/cli/dist-server/types/node/plugins/marketplaces/marketplace-factory.d.ts +0 -11
- package/cli/dist-server/types/node/plugins/marketplaces/marketplace-storage.d.ts +0 -141
- package/cli/dist-server/types/node/plugins/marketplaces/marketplace-update-checker.d.ts +0 -38
- package/cli/dist-server/types/node/plugins/marketplaces/workspace-project-root.d.ts +0 -14
- package/cli/dist-server/types/node/plugins/marketplaces/zip-marketplace.d.ts +0 -134
- package/cli/dist-server/types/node/plugins/mcpb-handler.d.ts +0 -29
- package/cli/dist-server/types/node/plugins/plugin-controller.d.ts +0 -75
- package/cli/dist-server/types/node/plugins/plugin-error-collector.d.ts +0 -17
- package/cli/dist-server/types/node/plugins/plugin-install-stats-service.d.ts +0 -20
- package/cli/dist-server/types/node/plugins/plugin-manager.d.ts +0 -692
- package/cli/dist-server/types/node/plugins/plugin-policy-service.d.ts +0 -53
- package/cli/dist-server/types/node/plugins/plugin-validator.d.ts +0 -48
- package/cli/dist-server/types/node/plugins/zip-utils.d.ts +0 -93
- package/cli/dist-server/types/node/remote-control/clients/liveness-watchdog.d.ts +0 -56
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-activity.d.ts +0 -23
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-auth.d.ts +0 -64
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-client-factory.d.ts +0 -47
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-client.d.ts +0 -191
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-inbound.d.ts +0 -7
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-interaction.d.ts +0 -142
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-live.d.ts +0 -78
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-media.d.ts +0 -35
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-qr-bind.d.ts +0 -49
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-respond-queue.d.ts +0 -33
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-types.d.ts +0 -207
- package/cli/dist-server/types/node/remote-control/remote-control-protocol.d.ts +0 -288
- package/cli/dist-server/types/node/remote-gateway/gateway-protocol.d.ts +0 -502
- package/cli/dist-server/types/node/remote-gateway/utils/qrcode-utils.d.ts +0 -16
- package/cli/dist-server/types/node/session/session-preview-utils.d.ts +0 -30
- package/cli/dist-server/types/node/settings/model-setting-utils.d.ts +0 -2
- package/cli/dist-server/types/node/tool-control/tool-control-policy.d.ts +0 -35
- 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 -19
- package/cli/dist-server/types/node/utils/add-dir-utils.d.ts +0 -20
- package/cli/dist-server/types/node/utils/compress-path.source.d.ts +0 -59
- package/cli/dist-server/types/node/vim/index.d.ts +0 -2
- package/cli/dist-server/types/node/vim/vim-manager.d.ts +0 -12
- package/cli/dist-server/types/node/vim/vim-protocol.d.ts +0 -24
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
* 未 preload 直接用 `new Agent(...)` 会 fail-loud(TypeError: undefined is not
|
|
27
27
|
* a constructor)——刻意设计,静默 sync require 回退会让整个 lazy 化归零。
|
|
28
28
|
*/
|
|
29
|
-
import type { Agent as AgentTypeCtor, AgentConfiguration, AgentInputItem as OriginalAgentInputItem, AgentOptions, AssistantMessageItem as OriginalAssistantMessageItem, ComputerCallResultItem as OriginalComputerCallResultItem, ComputerUseCallItem as OriginalComputerUseCallItem, FunctionCallItem as OriginalFunctionCallItem, FunctionCallResultItem as OriginalFunctionCallResultItem, FunctionTool as FunctionToolTypeCtor, Handoff as HandoffTypeCtor, handoff as handoffFn, HostedToolCallItem as OriginalHostedToolCallItem, Model as ModelType, ModelProvider as ModelProviderType, NonStreamRunOptions, OpenAIChatCompletionsModel as OpenAIChatCompletionsModelTypeCtor, ReasoningItem as OriginalReasoningItem, ResponseStreamEvent, RunConfig, RunContext as RunContextTypeCtor, RunItem, Runner as RunnerTypeCtor, RunResult as RunResultTypeCtor, RunState as RunStateTypeCtor, RunToolApprovalItem as RunToolApprovalItemTypeCtor, StreamedRunResult as RawStreamedRunResultTypeCtor, StreamRunOptions, SystemMessageItem as OriginalSystemMessageItem, Tool as OpenAIToolType, tool as toolTypeCtor, ToolExecuteArgument, UnknownItem as OriginalUnknownItem, Usage as UsageTypeCtor, UserMessageItem as OriginalUserMessageItem
|
|
30
|
-
import type { AgentOutputType,
|
|
29
|
+
import type { addTraceProcessor as addTraceProcessorFn, Agent as AgentTypeCtor, AgentConfiguration, AgentInputItem as OriginalAgentInputItem, AgentOptions, AssistantMessageItem as OriginalAssistantMessageItem, ComputerCallResultItem as OriginalComputerCallResultItem, ComputerUseCallItem as OriginalComputerUseCallItem, FunctionCallItem as OriginalFunctionCallItem, FunctionCallResultItem as OriginalFunctionCallResultItem, FunctionTool as FunctionToolTypeCtor, Handoff as HandoffTypeCtor, handoff as handoffFn, HostedToolCallItem as OriginalHostedToolCallItem, Model as ModelType, ModelProvider as ModelProviderType, NonStreamRunOptions, OpenAIChatCompletionsModel as OpenAIChatCompletionsModelTypeCtor, ReasoningItem as OriginalReasoningItem, ResponseStreamEvent, RunConfig, RunContext as RunContextTypeCtor, RunItem, Runner as RunnerTypeCtor, RunResult as RunResultTypeCtor, RunState as RunStateTypeCtor, RunToolApprovalItem as RunToolApprovalItemTypeCtor, setTraceProcessors as setTraceProcessorsFn, StreamedRunResult as RawStreamedRunResultTypeCtor, StreamRunOptions, SystemMessageItem as OriginalSystemMessageItem, Tool as OpenAIToolType, tool as toolTypeCtor, ToolExecuteArgument, UnknownItem as OriginalUnknownItem, Usage as UsageTypeCtor, UserMessageItem as OriginalUserMessageItem } from '@openai/agents';
|
|
30
|
+
import type { AgentOutputType, getAllMcpTools as getAllMcpToolsFn, MaxTurnsExceededError as MaxTurnsExceededErrorTypeCtor, ModelBehaviorError as ModelBehaviorErrorTypeCtor } from '@openai/agents-core';
|
|
31
31
|
import type { TextOutput, UnknownContext, UserContent } from '@openai/agents-core/types';
|
|
32
32
|
import { FileHistorySnapshotItem, ResendForkNoticeItem } from './custom-input-item-types';
|
|
33
33
|
export * from './custom-input-item-types';
|
|
@@ -58,16 +58,16 @@ export declare let tool: typeof toolTypeCtor;
|
|
|
58
58
|
export declare let Handoff: typeof HandoffTypeCtor;
|
|
59
59
|
export declare let handoff: typeof handoffFn;
|
|
60
60
|
export declare let OpenAIChatCompletionsModel: typeof OpenAIChatCompletionsModelTypeCtor;
|
|
61
|
-
export declare let addTraceProcessor: typeof addTraceProcessorFn;
|
|
62
|
-
export declare let setTraceProcessors: typeof setTraceProcessorsFn;
|
|
63
61
|
export declare let getAllMcpTools: typeof getAllMcpToolsFn;
|
|
64
62
|
export declare let MaxTurnsExceededError: typeof MaxTurnsExceededErrorTypeCtor;
|
|
65
63
|
export declare let ModelBehaviorError: typeof ModelBehaviorErrorTypeCtor;
|
|
64
|
+
export declare function addTraceProcessor(processor: Parameters<typeof addTraceProcessorFn>[0]): void;
|
|
65
|
+
export declare function setTraceProcessors(processors: Parameters<typeof setTraceProcessorsFn>[0]): void;
|
|
66
66
|
/**
|
|
67
67
|
* 拉起 `@openai/agents` + `@openai/agents-core` lazy chunk 并 assign runtime 值。
|
|
68
68
|
* 幂等;并发 caller 复用同一次加载 promise。
|
|
69
69
|
*/
|
|
70
|
-
export declare function preloadOpenaiAgentsTypes(): Promise<
|
|
70
|
+
export declare function preloadOpenaiAgentsTypes(): Promise<typeof import('@openai/agents')>;
|
|
71
71
|
/** 等价 `err instanceof MaxTurnsExceededError`;无需 preload 即可用。 */
|
|
72
72
|
export declare function isMaxTurnsExceededError(err: unknown): boolean;
|
|
73
73
|
/** 等价 `err instanceof ModelBehaviorError`;无需 preload 即可用。 */
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* `mcp-server-override.connect`,都在 activate 之后 MCP config resolve 完成时才走。
|
|
23
23
|
* 在 `McpReadyService.doInit`(activate coordinator 触发点)里 preload 一次即可。
|
|
24
24
|
*/
|
|
25
|
-
import type {
|
|
25
|
+
import type { auth as authFn, discoverAuthorizationServerMetadata as discoverAuthorizationServerMetadataFn, discoverOAuthProtectedResourceMetadata as discoverOAuthProtectedResourceMetadataFn, discoverOAuthServerInfo as discoverOAuthServerInfoFn, exchangeAuthorization as exchangeAuthorizationFn, extractResourceMetadataUrl as extractResourceMetadataUrlFn, OAuthClientProvider, OAuthDiscoveryState } from '@modelcontextprotocol/sdk/client/auth.js';
|
|
26
26
|
import type { Client as ClientTypeCtor } from '@modelcontextprotocol/sdk/client/index.js';
|
|
27
27
|
import type { SSEClientTransport as SSEClientTransportTypeCtor, SSEClientTransportOptions } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
28
28
|
import type { StdioClientTransport as StdioClientTransportTypeCtor, StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RestOperations } from '@celljs/http';
|
|
2
2
|
import { AuthenticationManager } from '@genie/authentication';
|
|
3
3
|
import { ClientInfoProvider, LanguageModel, ProductManager } from '@genie/product';
|
|
4
|
-
import { Logger } from '@genie/telemetry';
|
|
4
|
+
import { Logger, TraceService } from '@genie/telemetry';
|
|
5
5
|
import { OpenAI } from 'openai';
|
|
6
6
|
import { AgentManager } from '../agent';
|
|
7
7
|
import { GalileoTimingHook } from '../galileo';
|
|
@@ -93,6 +93,7 @@ export declare class ModelProviderImpl implements ModelProvider {
|
|
|
93
93
|
protected readonly clientInfoProvider: ClientInfoProvider;
|
|
94
94
|
protected readonly agentManager: AgentManager;
|
|
95
95
|
protected readonly logger: Logger;
|
|
96
|
+
protected readonly traceService?: TraceService;
|
|
96
97
|
protected readonly defaultInputItemProcessor: DefaultInputItemProcessor;
|
|
97
98
|
protected readonly functionCallResultAgentInputItemProcessor: FunctionCallResultAgentInputItemProcessor;
|
|
98
99
|
protected readonly modelErrorAnalyzer: ModelErrorAnalyzer;
|
|
@@ -273,6 +274,7 @@ export declare class ModelProviderImpl implements ModelProvider {
|
|
|
273
274
|
* AbortSignal 已触发时一律不重试(尊重取消语义)。env 运行时 live 读(prewarm 契约)。
|
|
274
275
|
*/
|
|
275
276
|
private requestWithConnectionRetry;
|
|
277
|
+
private getModelTracer;
|
|
276
278
|
/**
|
|
277
279
|
* MVP 验证:agent-cli 模型请求最终走 OpenAI SDK 的自定义 fetch adapter,
|
|
278
280
|
* 不一定会被 Galileo SDK 的 global fetch/http instrumentation 捕获。
|
|
@@ -19,26 +19,37 @@ declare const A2AGetTaskParameters: z.ZodObject<{
|
|
|
19
19
|
task_id: string;
|
|
20
20
|
}>;
|
|
21
21
|
export declare const ENV_POLL_INTERVAL_MS = "CODEBUDDY_A2A_POLL_INTERVAL_MS";
|
|
22
|
-
export declare const ENV_POLL_BACKOFF_MULTIPLIER = "CODEBUDDY_A2A_POLL_BACKOFF_MULTIPLIER";
|
|
23
|
-
export declare const ENV_POLL_MAX_INTERVAL_MS = "CODEBUDDY_A2A_POLL_MAX_INTERVAL_MS";
|
|
24
|
-
export declare const ENV_POLL_MAX_ATTEMPTS = "CODEBUDDY_A2A_POLL_MAX_ATTEMPTS";
|
|
25
22
|
export declare const ENV_POLL_MAX_DURATION_MS = "CODEBUDDY_A2A_POLL_MAX_DURATION_MS";
|
|
26
23
|
export interface A2APollPolicy {
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Constant gap between polls, ms. Default 500ms.
|
|
26
|
+
*
|
|
27
|
+
* Flat rather than exponentially backed off. Backoff optimizes for the
|
|
28
|
+
* long tail, but the tail is exactly where it hurts: it used to stretch
|
|
29
|
+
* to a 30s gap, so a task finishing at second 31 was reported up to 30
|
|
30
|
+
* seconds late, and the user watching the progress line saw a stall. A
|
|
31
|
+
* remote task the user is actively waiting on is worth one cheap request
|
|
32
|
+
* every half second.
|
|
33
|
+
*/
|
|
34
|
+
intervalMs: number;
|
|
35
|
+
/**
|
|
36
|
+
* Wall-clock budget for the whole loop, ms. Default 30 minutes.
|
|
37
|
+
*
|
|
38
|
+
* A HARD cap: when it runs out the remote task is canceled, so this is
|
|
39
|
+
* the longest a single outbound task may run — not merely the longest a
|
|
40
|
+
* single call waits.
|
|
41
|
+
*/
|
|
36
42
|
maxDurationMs: number;
|
|
37
43
|
}
|
|
38
44
|
/**
|
|
39
45
|
* Resolve the effective poll policy, applying any env overrides on top of
|
|
40
46
|
* `DEFAULT_POLL_POLICY`. Read fresh on every `execute()` call — not cached
|
|
41
47
|
* — so a test/host can change the env between calls.
|
|
48
|
+
*
|
|
49
|
+
* Only these two knobs are exposed. The retry schedule for a FAILED request
|
|
50
|
+
* (see a2a-poll-retry.ts) is fixed, because the cadence and the budget are
|
|
51
|
+
* the only two a host has a reason to tune and every additional dial is one
|
|
52
|
+
* more way to configure the loop into a request storm.
|
|
42
53
|
*/
|
|
43
54
|
export declare function resolvePollPolicy(): A2APollPolicy;
|
|
44
55
|
/** Exported so `A2ASendMessageTool` can classify its own (single, non-looping) result the same way — see that tool's artifact-download integration. */
|
|
@@ -54,17 +65,28 @@ export declare function __resetUserStoppedTasksForTest(): void;
|
|
|
54
65
|
* Every non-terminal status — including `input-required`/`auth-required` —
|
|
55
66
|
* is relayed (A.2's live-progress mechanism, reusing the foreground Bash
|
|
56
67
|
* tool's `session.inputSubject.next({status: 'in_progress', ...})` pattern)
|
|
57
|
-
* and polled straight through
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
68
|
+
* and polled straight through at a fixed interval (A.3), never treated as a
|
|
69
|
+
* stop condition (A.5).
|
|
70
|
+
*
|
|
71
|
+
* Three things stop the loop, and only one of them is a plain success:
|
|
72
|
+
*
|
|
73
|
+
* - one of the 4 terminal states (`completed`/`failed`/`canceled`/`rejected`);
|
|
74
|
+
* - the wall-clock budget running out;
|
|
75
|
+
* - `tasks/get` failing in a way that survives the retry schedule.
|
|
76
|
+
*
|
|
77
|
+
* The last two both END the remote task: the loop issues `tasks/cancel` and
|
|
78
|
+
* reports what that cancel actually did. This is a deliberate reversal of the
|
|
79
|
+
* older "give up for now, let the model re-poll" contract, which left a
|
|
80
|
+
* remote task running with nobody watching it whenever the model chose not to
|
|
81
|
+
* call back. The cost is that the budget is now a ceiling on the TASK, not
|
|
82
|
+
* just on the call — a task that needs longer than `maxDurationMs` cannot
|
|
83
|
+
* finish, and the host has to raise the budget for it.
|
|
62
84
|
*
|
|
63
85
|
* **One exception, added in issue #107183: approval interrupts.** When a poll
|
|
64
86
|
* observes a `snapshot.approval` payload (an out-of-band approval the remote
|
|
65
87
|
* agent is waiting on — see `A2aTaskSnapshot.approval`), relaying opaque
|
|
66
|
-
* `(N pending approval)` text and polling on
|
|
67
|
-
* way to act. So the loop PAUSES and raises
|
|
88
|
+
* `(N pending approval)` text and polling on until the budget runs out gives
|
|
89
|
+
* the user no way to act. So the loop PAUSES and raises an ACP `elicitation/create`
|
|
68
90
|
* card carrying the approval tokens, then resumes or stops per the answer:
|
|
69
91
|
*
|
|
70
92
|
* - `accept` — resume polling and do nothing else. The host delivers the
|
|
@@ -119,7 +141,39 @@ export declare class A2AGetTaskTool extends BaseTool implements Tool {
|
|
|
119
141
|
execute(input: z.infer<typeof A2AGetTaskParameters>, context: RunContext<Session>, details?: {
|
|
120
142
|
toolCall: FunctionCallItem;
|
|
121
143
|
}): Promise<ToolResult>;
|
|
122
|
-
|
|
144
|
+
/**
|
|
145
|
+
* One logical poll: a `tasks/get`, plus up to
|
|
146
|
+
* {@link POLL_RETRY_MAX_ATTEMPTS} retries when the failure looks
|
|
147
|
+
* transient.
|
|
148
|
+
*
|
|
149
|
+
* Retrying at all is the point. Before this, a single hiccup — a 502 from
|
|
150
|
+
* a load balancer mid-deploy, a reset socket — ended a poll the user had
|
|
151
|
+
* been waiting minutes for. What is NOT retried is a 400-409: those say
|
|
152
|
+
* the request itself is wrong (bad task id, no permission), and repeating
|
|
153
|
+
* it five times just delays telling the model something it needs to act
|
|
154
|
+
* on. See `classifyPollFailure` for where that line is drawn and why it
|
|
155
|
+
* is not simply "all of 4xx".
|
|
156
|
+
*
|
|
157
|
+
* Three ways out:
|
|
158
|
+
* - a snapshot, on the first try or a later one;
|
|
159
|
+
* - a THROWN `ToolExecutionError`, for a non-retryable failure or a user
|
|
160
|
+
* abort — the model gets the error, the task is left alone;
|
|
161
|
+
* - `give-up`, when the retries (or the budget) ran out. The caller ends
|
|
162
|
+
* the remote task and reports; this is not an exception because it is a
|
|
163
|
+
* reportable outcome, not a broken call.
|
|
164
|
+
*/
|
|
165
|
+
private pollWithRetry;
|
|
166
|
+
private abortedError;
|
|
167
|
+
/**
|
|
168
|
+
* Error text for a failure the model has to act on itself.
|
|
169
|
+
*
|
|
170
|
+
* Leads with the HTTP status because that is what tells a 404 (wrong task
|
|
171
|
+
* id — the model may have one from an earlier turn) apart from a 403
|
|
172
|
+
* (this agent is not allowed here — retrying will never help), and
|
|
173
|
+
* carries the remote's own response body, which is where an agent
|
|
174
|
+
* normally puts the part a human can act on.
|
|
175
|
+
*/
|
|
176
|
+
private formatRequestFailure;
|
|
123
177
|
/**
|
|
124
178
|
* A.2's live-progress relay — the SAME `session.inputSubject.next({...})`
|
|
125
179
|
* shape the foreground Bash tool uses for its own streaming updates
|
|
@@ -165,24 +219,44 @@ export declare class A2AGetTaskTool extends BaseTool implements Tool {
|
|
|
165
219
|
/**
|
|
166
220
|
* Model-facing result after a user ended a task from an approval card.
|
|
167
221
|
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
222
|
+
* Written as named sections — what was shown, what happened, and the
|
|
223
|
+
* host's reason — rather than one prose paragraph, because the single
|
|
224
|
+
* line that has to win was getting buried mid-sentence: this tool's own
|
|
225
|
+
* `description` tells the model in MUST-level wording to immediately
|
|
226
|
+
* re-poll any non-final result, so the text has to say plainly that
|
|
227
|
+
* polling is over.
|
|
228
|
+
*
|
|
229
|
+
* Only counter-intuitive instructions are spelled out. Telling the user
|
|
230
|
+
* the action did not happen is what a model does anyway; not re-polling,
|
|
231
|
+
* closing an unconfirmed cancel out with `A2ACancelTask`, and reporting a
|
|
232
|
+
* real terminal state instead of the refusal are the three it would
|
|
233
|
+
* otherwise get wrong.
|
|
174
234
|
*
|
|
175
235
|
* When the cancel revealed the task was already terminal — commonly
|
|
176
236
|
* because the approval was granted through the approving system's own UI
|
|
177
237
|
* while our card sat open — the REAL state is reported through the
|
|
178
238
|
* existing `formatTerminalContent()`, so a completed task is never
|
|
179
239
|
* reported as a refusal.
|
|
240
|
+
*
|
|
241
|
+
* No agent id anywhere: it is the registry's routing key and is not
|
|
242
|
+
* guaranteed to match the card's display name (see `A2aRegisteredAgent`),
|
|
243
|
+
* while `taskId` alone already identifies the task uniquely.
|
|
180
244
|
*/
|
|
181
245
|
private buildApprovalStopResult;
|
|
246
|
+
/** Blank line between sections, reasons always last — see {@link appendApprovalResponseNotes}. */
|
|
247
|
+
private composeSections;
|
|
182
248
|
/**
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
249
|
+
* Append host-supplied reasons as the LAST section of the result.
|
|
250
|
+
*
|
|
251
|
+
* The JSON encoding is the actual guard, not formatting: it collapses
|
|
252
|
+
* newlines and heading-looking text into a single string literal, so a
|
|
253
|
+
* reason cannot forge a section of its own. Keeping it last means no
|
|
254
|
+
* instruction ever follows client-controlled text.
|
|
255
|
+
*
|
|
256
|
+
* A lone reason needs no action label — the section above it already said
|
|
257
|
+
* what the user did. Several reasons only happen when one call raised more
|
|
258
|
+
* than one card (accepting one approval, then declining another), and
|
|
259
|
+
* there the labels are what keep two opposite answers apart.
|
|
186
260
|
*/
|
|
187
261
|
private appendApprovalResponseNotes;
|
|
188
262
|
/**
|
|
@@ -201,11 +275,42 @@ export declare class A2AGetTaskTool extends BaseTool implements Tool {
|
|
|
201
275
|
*/
|
|
202
276
|
private formatTerminalContent;
|
|
203
277
|
/**
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
278
|
+
* The ordinary end of a poll: the task reached a terminal state, so wait
|
|
279
|
+
* out its artifact downloads and hand the model the result.
|
|
280
|
+
*
|
|
281
|
+
* Shared with the stop path below, which lands here whenever a cancel
|
|
282
|
+
* discovers the task had already finished. That sharing is the point —
|
|
283
|
+
* a task that completed WITH attachments in the second before we tried to
|
|
284
|
+
* cancel it must not lose them to a different, artifact-unaware code
|
|
285
|
+
* path.
|
|
286
|
+
*
|
|
287
|
+
* Assumes its snapshot's downloads have already been kicked off; both
|
|
288
|
+
* callers do that, the loop on every tick and the stop path for the
|
|
289
|
+
* snapshot the cancel read back.
|
|
290
|
+
*/
|
|
291
|
+
private buildTerminalResult;
|
|
292
|
+
/**
|
|
293
|
+
* End the remote task and tell the model what that actually did.
|
|
294
|
+
*
|
|
295
|
+
* Reached when the loop gives up on a task that never finished — the
|
|
296
|
+
* budget ran out, or `tasks/get` kept failing. Both used to return "still
|
|
297
|
+
* running, call me again", which read fine but left a real task running
|
|
298
|
+
* on the remote agent for as long as it liked whenever the model decided
|
|
299
|
+
* not to call back. Ending it here means the ceiling is enforced rather
|
|
300
|
+
* than merely reported.
|
|
301
|
+
*
|
|
302
|
+
* The cancel is what produces the text, not a guess made before it:
|
|
303
|
+
*
|
|
304
|
+
* - `already-terminal` — the task crossed the finish line while we were
|
|
305
|
+
* canceling it, so there is nothing to narrate. It goes back through
|
|
306
|
+
* the normal terminal path and the model sees an ordinary result,
|
|
307
|
+
* artifacts and all.
|
|
308
|
+
* - `canceled` — say so, and name the state the remote reported rather
|
|
309
|
+
* than assuming CANCELED; nothing in the spec pins `tasks/cancel` to
|
|
310
|
+
* one value.
|
|
311
|
+
* - `unknown` — we could not confirm anything, so the model is told the
|
|
312
|
+
* task may still be running and pointed at `A2ACancelTask`.
|
|
208
313
|
*/
|
|
209
|
-
private
|
|
314
|
+
private buildPollStoppedResult;
|
|
210
315
|
}
|
|
211
316
|
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retry policy for a FAILED `tasks/get` REQUEST — distinct from
|
|
3
|
+
* `A2APollPolicy`, which governs the cadence of SUCCESSFUL polls. A request
|
|
4
|
+
* that never produced a task snapshot is retried on this schedule; a request
|
|
5
|
+
* that did is subject to the poll interval instead.
|
|
6
|
+
*
|
|
7
|
+
* Fixed rather than env-overridable: the poll interval and the overall budget
|
|
8
|
+
* are the two knobs a host has a legitimate reason to tune, and every extra
|
|
9
|
+
* one is a way to misconfigure the loop into a request storm.
|
|
10
|
+
*/
|
|
11
|
+
export declare const POLL_RETRY_MAX_ATTEMPTS = 5;
|
|
12
|
+
export declare const POLL_RETRY_BASE_INTERVAL_MS = 1000;
|
|
13
|
+
export declare const POLL_RETRY_BACKOFF_MULTIPLIER = 1.5;
|
|
14
|
+
export interface PollFailureClassification {
|
|
15
|
+
/**
|
|
16
|
+
* The HTTP status behind this failure, when one could be established.
|
|
17
|
+
* Absent for transport failures that never got a response at all (DNS,
|
|
18
|
+
* connection reset, the client's own timeout) — deliberately not defaulted
|
|
19
|
+
* to 500, so the model is never told a status the wire did not carry.
|
|
20
|
+
*/
|
|
21
|
+
httpStatus?: number;
|
|
22
|
+
/** Whether the poll loop should retry rather than give up. */
|
|
23
|
+
retryable: boolean;
|
|
24
|
+
/** The SDK's error text, verbatim. */
|
|
25
|
+
message: string;
|
|
26
|
+
/**
|
|
27
|
+
* What the remote actually said: the `Response:` tail of the SDK's HTTP
|
|
28
|
+
* error text, or a JSON-RPC error's structured `data`. Absent when the
|
|
29
|
+
* failure produced no body.
|
|
30
|
+
*/
|
|
31
|
+
responseBody?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Decide whether a failed `tasks/get` request is worth retrying, and pull out
|
|
35
|
+
* the detail the model needs either way.
|
|
36
|
+
*
|
|
37
|
+
* Knows nothing about aborts on purpose. A user cancel and the client's own
|
|
38
|
+
* 120s request timeout reach this function as the SAME error text (see
|
|
39
|
+
* `A2aClientService.withAbortAndClient`), so only the caller — which can read
|
|
40
|
+
* `session.abortSignal` — can tell them apart. This classifies the timeout
|
|
41
|
+
* reading of that message (retryable) and leaves the cancel reading to the
|
|
42
|
+
* poll loop.
|
|
43
|
+
*/
|
|
44
|
+
export declare function classifyPollFailure(err: unknown): PollFailureClassification;
|
|
45
|
+
/** Wait before the `retryIndex`-th (0-based) retry: 1s, 1.5s, 2.25s, 3.375s, 5.0625s. */
|
|
46
|
+
export declare function pollRetryDelayMs(retryIndex: number): number;
|
package/cli/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tencent-ai/codebuddy-code",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.145.0",
|
|
4
4
|
"description": "Use CodeBuddy, Tencent's AI assistant, right from your terminal. CodeBuddy can understand your codebase, edit files, run terminal commands, and handle entire workflows for you.",
|
|
5
5
|
"main": "lib/node/index.js",
|
|
6
6
|
"typings": "lib/node/index.d.ts",
|
|
@@ -822,6 +822,6 @@
|
|
|
822
822
|
"SelectImage": true,
|
|
823
823
|
"SkipToolCallSupportCheck": true
|
|
824
824
|
},
|
|
825
|
-
"commit": "
|
|
826
|
-
"date": "2026-09-
|
|
825
|
+
"commit": "6582f0c18fc69b31f97ca6fc98673eaf2a0666a1",
|
|
826
|
+
"date": "2026-09-05T05:39:52.463Z"
|
|
827
827
|
}
|
package/cli/product.ioa.json
CHANGED
package/cli/product.json
CHANGED
|
@@ -1245,11 +1245,11 @@
|
|
|
1245
1245
|
},
|
|
1246
1246
|
{
|
|
1247
1247
|
"name": "tool-a2asendmessage-description",
|
|
1248
|
-
"template": "Send a message to one outbound A2A (Agent2Agent) agent authorized for this conversation.\n\nParameters:\n- `agent_name` (required): the target agent's name, exactly as returned by A2AGetAgentCard (the Agent Card `name`), or from an explicit @Agent mention.\n- `message` (required): a concise, self-contained task or question. Do not paste the whole conversation — state the goal and only the context the agent actually needs (the agent has no visibility into this conversation otherwise).\n- `skill_id` (optional): route directly to one declared skill, for @Agent.Skill-style precise dispatch. Only effective when A2AGetAgentCard reported `supports_skill_routing: true` for that agent; otherwise this is ignored.\n- `attachments` (optional): a list of files to attach to the message, each referenced by a fetchable `url` (plus optional `filename` and `media_type`). Each is sent to the agent as a standard A2A file part. The `url` must already be reachable by the remote agent — this tool sends it as-is and does NOT upload, host, or transform the file. Use this when you already have a URL for a file you want the agent to work on; obtain that URL through whatever mechanism your environment provides.\n\nThis call is NOT synchronous: it returns immediately with whatever single reply the agent gave, and does not wait for the task to finish. Check the returned status: only completed/failed/canceled/rejected are final. For ANY other status — working, submitted, input-required, or auth-required — you MUST immediately call A2AGetTask with the returned task_id, in the same turn, before doing anything else with this task. Do not wait, and do not ask the user for permission first.\n\nauth-required and input-required are NOT a signal to stop and hand off to the user by themselves — calling A2AGetTask to check status is just reading state, not performing a login or filling credentials on the user's behalf, so it does not conflict with any policy against automating logins. A2AGetTask polls automatically
|
|
1248
|
+
"template": "Send a message to one outbound A2A (Agent2Agent) agent authorized for this conversation.\n\nParameters:\n- `agent_name` (required): the target agent's name, exactly as returned by A2AGetAgentCard (the Agent Card `name`), or from an explicit @Agent mention.\n- `message` (required): a concise, self-contained task or question. Do not paste the whole conversation — state the goal and only the context the agent actually needs (the agent has no visibility into this conversation otherwise).\n- `skill_id` (optional): route directly to one declared skill, for @Agent.Skill-style precise dispatch. Only effective when A2AGetAgentCard reported `supports_skill_routing: true` for that agent; otherwise this is ignored.\n- `attachments` (optional): a list of files to attach to the message, each referenced by a fetchable `url` (plus optional `filename` and `media_type`). Each is sent to the agent as a standard A2A file part. The `url` must already be reachable by the remote agent — this tool sends it as-is and does NOT upload, host, or transform the file. Use this when you already have a URL for a file you want the agent to work on; obtain that URL through whatever mechanism your environment provides.\n\nThis call is NOT synchronous: it returns immediately with whatever single reply the agent gave, and does not wait for the task to finish. Check the returned status: only completed/failed/canceled/rejected are final. For ANY other status — working, submitted, input-required, or auth-required — you MUST immediately call A2AGetTask with the returned task_id, in the same turn, before doing anything else with this task. Do not wait, and do not ask the user for permission first.\n\nauth-required and input-required are NOT a signal to stop and hand off to the user by themselves — calling A2AGetTask to check status is just reading state, not performing a login or filling credentials on the user's behalf, so it does not conflict with any policy against automating logins. A2AGetTask polls automatically, relays the agent's own request (e.g. \"please sign in\", a clarifying question) to the user exactly once, and keeps waiting for the remote task to advance — it will surface the eventual outcome once the user (or the agent) resolves whatever it was waiting on.\n\nBehavior notes:\n- Calling the same `agent_id` (and `skill_id`, if used) again in a later turn continues the same conversation with that agent automatically — you don't need to restate prior context.\n- To message multiple agents in one turn, call this tool once per agent as parallel tool calls — one agent failing does not affect the others.\n- Any files or links the agent produced are returned as part of the result text.\n- Not available inside a sub-agent or team-member session — only the main conversation can call outbound A2A agents.\n"
|
|
1249
1249
|
},
|
|
1250
1250
|
{
|
|
1251
1251
|
"name": "tool-a2agettask-description",
|
|
1252
|
-
"template": "Wait for a previously created outbound A2A task to finish, polling automatically.\n\nParameters:\n- `agent_name` (required): the same agent name passed to the original A2ASendMessage call.\n- `task_id` (required): the taskId from a prior A2ASendMessage or A2AGetTask result.\n\nThis call polls the remote task's real, current state
|
|
1252
|
+
"template": "Wait for a previously created outbound A2A task to finish, polling automatically.\n\nParameters:\n- `agent_name` (required): the same agent name passed to the original A2ASendMessage call.\n- `task_id` (required): the taskId from a prior A2ASendMessage or A2AGetTask result.\n\nThis call polls the remote task's real, current state at a steady interval, showing live progress as it goes, and returns once the task reaches a final state (completed/failed/canceled/rejected).\n\nThis is the only wait the task gets. If it runs past the time limit, or the remote agent stops answering, the task is canceled and this returns telling you exactly that. Whatever this returns is therefore final: never call A2AGetTask again with the same task_id. If the work is still needed, start it over with A2ASendMessage.\n\nIf the task is waiting on external input or auth (input-required/auth-required), that request is relayed to the user once and polling continues — this call keeps waiting for the task to advance rather than handing back a stale copy of what you already saw. Checking status this way is just reading state, not performing a login or filling credentials on the user's behalf, so calling this while the task is waiting on the user to complete a login/approval step out of band does not conflict with any policy against automating logins.\n\nNot available inside a sub-agent or team-member session — only the main conversation can query outbound A2A tasks.\n"
|
|
1253
1253
|
},
|
|
1254
1254
|
{
|
|
1255
1255
|
"name": "tool-a2acanceltask-description",
|
|
@@ -2226,6 +2226,6 @@
|
|
|
2226
2226
|
"description": "tool-a2acanceltask-description"
|
|
2227
2227
|
}
|
|
2228
2228
|
],
|
|
2229
|
-
"commit": "
|
|
2230
|
-
"date": "2026-09-
|
|
2229
|
+
"commit": "6582f0c18fc69b31f97ca6fc98673eaf2a0666a1",
|
|
2230
|
+
"date": "2026-09-05T05:39:52.468Z"
|
|
2231
2231
|
}
|
|
@@ -359,6 +359,6 @@
|
|
|
359
359
|
"ScheduledTasks": true,
|
|
360
360
|
"SkipToolCallSupportCheck": true
|
|
361
361
|
},
|
|
362
|
-
"commit": "
|
|
363
|
-
"date": "2026-09-
|
|
362
|
+
"commit": "6582f0c18fc69b31f97ca6fc98673eaf2a0666a1",
|
|
363
|
+
"date": "2026-09-05T05:39:52.487Z"
|
|
364
364
|
}
|
package/package.json
CHANGED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* rewindTo — 统一回退操作(Phase 1 核心收敛点)
|
|
3
|
-
*
|
|
4
|
-
* 将 applyResendFork() 和 CheckpointService.updateHistory() 两处重复的
|
|
5
|
-
* "回退历史指针 + 标记 conversationReverted" 逻辑统一到此函数。
|
|
6
|
-
*
|
|
7
|
-
* 职责分离:
|
|
8
|
-
* - rewindTo() → 纯状态变更(lastMessageId + conversationReverted)
|
|
9
|
-
* - reason 分支 → 副作用差异(persist notice / historyReloadSubject)
|
|
10
|
-
* - 调用方 → 负责解析 fork 点(resolveResendForkPoint / checkpoint.parentId)
|
|
11
|
-
*
|
|
12
|
-
* @see issue #50495 / docs/plans/2026-06-20-resend-edit-unified-plan.md
|
|
13
|
-
*/
|
|
14
|
-
import type { Session } from '../session/session-protocol';
|
|
15
|
-
/** 回退原因,决定 rewindTo 的副作用行为 */
|
|
16
|
-
export type RewindReason = 'resend_edit' | 'checkpoint_revert';
|
|
17
|
-
export interface RewindOptions {
|
|
18
|
-
/** resend_edit 时需要持久化的被编辑消息 ID */
|
|
19
|
-
editedUserItemId?: string;
|
|
20
|
-
/** 持久化函数(仅 resend_edit 使用)— 通常为 sessionManager.addHistory */
|
|
21
|
-
addHistory?: (session: Session, items: any[]) => Promise<void>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* 将会话历史指针回退到指定 fork 点。
|
|
25
|
-
*
|
|
26
|
-
* 统一行为:
|
|
27
|
-
* 1. session.lastMessageId = forkPointId
|
|
28
|
-
* 2. session.conversationReverted = true
|
|
29
|
-
*
|
|
30
|
-
* 按 reason 触发不同副作用:
|
|
31
|
-
* - 'resend_edit': 调用 addHistory 持久化 fork 墓碑标记
|
|
32
|
-
* - 'checkpoint_revert': 触发 historyReloadSubject 通知前端刷新
|
|
33
|
-
*/
|
|
34
|
-
export declare function rewindTo(session: Session, forkPointId: string | undefined, reason: RewindReason, options?: RewindOptions): Promise<void>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Web UI ACP 握手身份。WorkBuddy / Zed 等 --acp 客户端不带这个名字。
|
|
3
|
-
* 刷新快照、busy 工具、/goal drain 只对这个客户端生效,避免改到共用 --acp 语义。
|
|
4
|
-
*/
|
|
5
|
-
export declare const ACP_WEB_UI_CLIENT_NAME = "codebuddy-web-ui";
|
|
6
|
-
export declare function isWebUiAcpClientName(name: unknown): boolean;
|
|
7
|
-
export declare function isWebUiAcpSession(session: {
|
|
8
|
-
options?: object;
|
|
9
|
-
}): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Keep the in-memory Web-ACP marker aligned with the connection that most
|
|
12
|
-
* recently admitted the session.
|
|
13
|
-
*
|
|
14
|
-
* A same-id session may be reused instead of deserialized again. In that
|
|
15
|
-
* case simply doing nothing for non-Web clients leaves a stale `webUiAcp`
|
|
16
|
-
* bit behind and lets WorkBuddy enter Web-only goal/follow-up behaviour.
|
|
17
|
-
* The marker is transport state, not durable session identity, so an
|
|
18
|
-
* unopted ACP client must actively clear it.
|
|
19
|
-
*/
|
|
20
|
-
export declare function syncWebUiAcpSessionFlag<T extends {
|
|
21
|
-
options?: object;
|
|
22
|
-
}>(session: T, webUiAcp: boolean): void;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 上下文消耗 5 类目细拆 · 字符分类 + 反向归一化分配。
|
|
3
|
-
* 严格守恒:sum(usageByCategory) === input.totalTokens(即 ACP usage_update.used)。
|
|
4
|
-
*/
|
|
5
|
-
/** 5 类目细拆结果。schema 版本字段 `version` 为后续扩展预留。 */
|
|
6
|
-
export interface UsageByCategory {
|
|
7
|
-
systemPrompt: number;
|
|
8
|
-
conversation: number;
|
|
9
|
-
tools: number;
|
|
10
|
-
mcp: number;
|
|
11
|
-
skills: number;
|
|
12
|
-
/** schema 版本:未来扩展加字段时 +1,客户端按 version 兼容。 */
|
|
13
|
-
version: 1;
|
|
14
|
-
}
|
|
15
|
-
/** 单个 tool 定义的最小契约(仅消费 name + description;其它字段透传 JSON.stringify)。 */
|
|
16
|
-
export interface ToolLike {
|
|
17
|
-
name: string;
|
|
18
|
-
description?: string;
|
|
19
|
-
/** OpenAI Agent SDK 的 tool 通常带 parameters/schema;calculator 不解析,只 JSON.stringify。 */
|
|
20
|
-
input_schema?: unknown;
|
|
21
|
-
parameters?: unknown;
|
|
22
|
-
}
|
|
23
|
-
/** 单条 history item 的结构松约束(结构不规范时 calculator 跳过,不抛错)。 */
|
|
24
|
-
export interface HistoryItemLike {
|
|
25
|
-
type?: string;
|
|
26
|
-
role?: string;
|
|
27
|
-
content?: unknown;
|
|
28
|
-
callId?: string;
|
|
29
|
-
name?: string;
|
|
30
|
-
arguments?: unknown;
|
|
31
|
-
output?: unknown;
|
|
32
|
-
}
|
|
33
|
-
export interface UsageByCategoryInput {
|
|
34
|
-
/** 当前请求最终发给模型的 system prompt 渲染产物(已 resolve 为字符串)。 */
|
|
35
|
-
systemPrompt: string;
|
|
36
|
-
/** 当前请求装载的 tool 定义列表(用作字符代理:JSON.stringify 每个 tool)。 */
|
|
37
|
-
tools: ReadonlyArray<ToolLike>;
|
|
38
|
-
/** session.history(user/assistant 消息 + function_call / function_call_result)。 */
|
|
39
|
-
history: ReadonlyArray<HistoryItemLike>;
|
|
40
|
-
/** ACP usage_update.used,作为最终归一化的总分母。 */
|
|
41
|
-
totalTokens: number;
|
|
42
|
-
}
|
|
43
|
-
export declare class UsageByCategoryCalculator {
|
|
44
|
-
static compute(input: UsageByCategoryInput): UsageByCategory;
|
|
45
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 守恒分配函数 —— 把 totalTokens 按 5 类目权重分配到非负整数桶里,sum 严格守恒。
|
|
3
|
-
* 算法:floor 分配 + 按余数从大到小补 1。
|
|
4
|
-
*/
|
|
5
|
-
export type UsageByCategoryKey = 'systemPrompt' | 'conversation' | 'tools' | 'mcp' | 'skills';
|
|
6
|
-
export declare function distributeWithConservation(estimates: Record<UsageByCategoryKey, number>, totalTokens: number): Record<UsageByCategoryKey, number>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skills / MCP 切分 · 上下文消耗 5 类目细拆专用。
|
|
3
|
-
* Skill 的 `<available_skills>` 归 skills;ToolSearch 的 `mcp__` 行归 mcp。
|
|
4
|
-
*/
|
|
5
|
-
import type { ToolLike } from './usage-by-category-calculator';
|
|
6
|
-
export interface ToolsBuckets {
|
|
7
|
-
toolsChars: string;
|
|
8
|
-
mcpChars: string;
|
|
9
|
-
skillsChars: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function collectToolsBuckets(tools: ReadonlyArray<ToolLike>): ToolsBuckets;
|