diff options
Diffstat (limited to 'packages/server/src')
| -rw-r--r-- | packages/server/src/tools/edit.ts | 1 | ||||
| -rw-r--r-- | packages/server/src/tools/shell.ts | 1 | ||||
| -rw-r--r-- | packages/server/src/tools/tools.ts | 14 | ||||
| -rw-r--r-- | packages/server/src/tools/write-file.ts | 1 | ||||
| -rw-r--r-- | packages/server/src/utils/nextSpeakerChecker.ts | 2 |
5 files changed, 10 insertions, 9 deletions
diff --git a/packages/server/src/tools/edit.ts b/packages/server/src/tools/edit.ts index 7b327778..9301d5e8 100644 --- a/packages/server/src/tools/edit.ts +++ b/packages/server/src/tools/edit.ts @@ -291,6 +291,7 @@ Expectation for parameters: { context: 3 }, ); const confirmationDetails: ToolEditConfirmationDetails = { + type: 'edit', title: `Confirm Edit: ${shortenPath(makeRelative(params.file_path, this.rootDirectory))}`, fileName, fileDiff, diff --git a/packages/server/src/tools/shell.ts b/packages/server/src/tools/shell.ts index 6cf49a7b..dd8f8639 100644 --- a/packages/server/src/tools/shell.ts +++ b/packages/server/src/tools/shell.ts @@ -107,6 +107,7 @@ export class ShellTool extends BaseTool<ShellToolParams, ToolResult> { return false; // already approved and whitelisted } const confirmationDetails: ToolExecuteConfirmationDetails = { + type: 'exec', title: 'Confirm Shell Command', command: params.command, rootCommand, diff --git a/packages/server/src/tools/tools.ts b/packages/server/src/tools/tools.ts index 58209166..2f5a4095 100644 --- a/packages/server/src/tools/tools.ts +++ b/packages/server/src/tools/tools.ts @@ -171,25 +171,23 @@ export interface FileDiff { fileName: string; } -export interface ToolCallConfirmationDetailsDefault { +export interface ToolEditConfirmationDetails { + type: 'edit'; title: string; onConfirm: (outcome: ToolConfirmationOutcome) => Promise<void>; -} - -export interface ToolEditConfirmationDetails - extends ToolCallConfirmationDetailsDefault { fileName: string; fileDiff: string; } -export interface ToolExecuteConfirmationDetails - extends ToolCallConfirmationDetailsDefault { +export interface ToolExecuteConfirmationDetails { + type: 'exec'; + title: string; + onConfirm: (outcome: ToolConfirmationOutcome) => Promise<void>; command: string; rootCommand: string; } export type ToolCallConfirmationDetails = - | ToolCallConfirmationDetailsDefault | ToolEditConfirmationDetails | ToolExecuteConfirmationDetails; diff --git a/packages/server/src/tools/write-file.ts b/packages/server/src/tools/write-file.ts index c9f95ea9..1b6b6dc8 100644 --- a/packages/server/src/tools/write-file.ts +++ b/packages/server/src/tools/write-file.ts @@ -158,6 +158,7 @@ export class WriteFileTool extends BaseTool<WriteFileToolParams, ToolResult> { ); const confirmationDetails: ToolEditConfirmationDetails = { + type: 'edit', title: `Confirm Write: ${shortenPath(relativePath)}`, fileName, fileDiff, diff --git a/packages/server/src/utils/nextSpeakerChecker.ts b/packages/server/src/utils/nextSpeakerChecker.ts index a7818713..5eb0c512 100644 --- a/packages/server/src/utils/nextSpeakerChecker.ts +++ b/packages/server/src/utils/nextSpeakerChecker.ts @@ -94,7 +94,7 @@ export async function checkNextSpeaker( return null; } catch (error) { console.warn( - 'Failed to talk to Gemiin endpoint when seeing if conversation should continue.', + 'Failed to talk to Gemini endpoint when seeing if conversation should continue.', error, ); return null; |
