diff options
| author | Olcan <[email protected]> | 2025-05-27 15:40:18 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-27 15:40:18 -0700 |
| commit | bfeaac844186153698d3a7079b41214bbf1e4371 (patch) | |
| tree | b7b5208072de7f43eb45d9e7a2fe64b1febee42f /packages/server/src/tools/tools.ts | |
| parent | 0d5f7686d7c4cd355cc2d327a2f04c8d7d31e09e (diff) | |
live output from shell tool (#573)
Diffstat (limited to 'packages/server/src/tools/tools.ts')
| -rw-r--r-- | packages/server/src/tools/tools.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/server/src/tools/tools.ts b/packages/server/src/tools/tools.ts index 2f5a4095..c57bbd39 100644 --- a/packages/server/src/tools/tools.ts +++ b/packages/server/src/tools/tools.ts @@ -64,7 +64,11 @@ export interface Tool< * @param params Parameters for the tool execution * @returns Result of the tool execution */ - execute(params: TParams, signal: AbortSignal): Promise<TResult>; + execute( + params: TParams, + signal: AbortSignal, + onOutputChunk?: (chunk: string) => void, + ): Promise<TResult>; } /** @@ -144,7 +148,11 @@ export abstract class BaseTool< * @param signal AbortSignal for tool cancellation * @returns Result of the tool execution */ - abstract execute(params: TParams, signal: AbortSignal): Promise<TResult>; + abstract execute( + params: TParams, + signal: AbortSignal, + onOutputChunk?: (chunk: string) => void, + ): Promise<TResult>; } export interface ToolResult { |
