diff options
| author | shishu314 <[email protected]> | 2025-08-07 19:58:18 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-07 23:58:18 +0000 |
| commit | bae922a6327a8ae97ca53ac1829ff385ca025460 (patch) | |
| tree | 5250171f5fdbaf8b4d5f6043a1b721df033d0a31 /packages/core/src/telemetry/tool-call-decision.ts | |
| parent | 60362e0329febb8811f37d7f68f00843dd51e1ed (diff) | |
fix(cli) - Move logging into CodeAssistServer (#5781)
Co-authored-by: Shi Shu <[email protected]>
Diffstat (limited to 'packages/core/src/telemetry/tool-call-decision.ts')
| -rw-r--r-- | packages/core/src/telemetry/tool-call-decision.ts | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/packages/core/src/telemetry/tool-call-decision.ts b/packages/core/src/telemetry/tool-call-decision.ts new file mode 100644 index 00000000..167df10a --- /dev/null +++ b/packages/core/src/telemetry/tool-call-decision.ts @@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +import { ToolConfirmationOutcome } from '../tools/tools.js'; + +export enum ToolCallDecision { + ACCEPT = 'accept', + REJECT = 'reject', + MODIFY = 'modify', + AUTO_ACCEPT = 'auto_accept', +} + +export function getDecisionFromOutcome( + outcome: ToolConfirmationOutcome, +): ToolCallDecision { + switch (outcome) { + case ToolConfirmationOutcome.ProceedOnce: + return ToolCallDecision.ACCEPT; + case ToolConfirmationOutcome.ProceedAlways: + case ToolConfirmationOutcome.ProceedAlwaysServer: + case ToolConfirmationOutcome.ProceedAlwaysTool: + return ToolCallDecision.AUTO_ACCEPT; + case ToolConfirmationOutcome.ModifyWithEditor: + return ToolCallDecision.MODIFY; + case ToolConfirmationOutcome.Cancel: + default: + return ToolCallDecision.REJECT; + } +} |
