diff options
| author | Olcan <[email protected]> | 2025-05-30 13:59:05 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-30 13:59:05 -0700 |
| commit | 1a5fd2ccb2c96931921dfddbc64639ddf946980c (patch) | |
| tree | 1a60d3a242b79abf26502478cb43906de6ba9cdd /packages/server/src/tools/tools.ts | |
| parent | 0869fd168fddc9e8d86739b80d86373a1caf663a (diff) | |
add flags for markdown rendering and live updating to Tool to avoid special-casing shell tool by name, and open door for other tools to specify their rendering/updating (#629)
Diffstat (limited to 'packages/server/src/tools/tools.ts')
| -rw-r--r-- | packages/server/src/tools/tools.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/server/src/tools/tools.ts b/packages/server/src/tools/tools.ts index eb1da248..e5d0c7cf 100644 --- a/packages/server/src/tools/tools.ts +++ b/packages/server/src/tools/tools.ts @@ -34,6 +34,16 @@ export interface Tool< schema: FunctionDeclaration; /** + * Whether the tool's output should be rendered as markdown + */ + isOutputMarkdown: boolean; + + /** + * Whether the tool supports live (streaming) output + */ + canUpdateOutput: boolean; + + /** * Validates the parameters for the tool * Should be called from both `shouldConfirmExecute` and `execute` * `shouldConfirmExecute` should return false immediately if invalid @@ -85,6 +95,8 @@ export abstract class BaseTool< * @param name Internal name of the tool (used for API calls) * @param displayName User-friendly display name of the tool * @param description Description of what the tool does + * @param isOutputMarkdown Whether the tool's output should be rendered as markdown + * @param canUpdateOutput Whether the tool supports live (streaming) output * @param parameterSchema JSON Schema defining the parameters */ constructor( @@ -92,6 +104,8 @@ export abstract class BaseTool< readonly displayName: string, readonly description: string, readonly parameterSchema: Record<string, unknown>, + readonly isOutputMarkdown: boolean = true, + readonly canUpdateOutput: boolean = false, ) {} /** |
