mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 06:04:05 +00:00
feat(coding-agent): type ToolCallEvent.input per tool
Matches ToolResultEvent pattern with typed inputs via discriminated union. - Export *ToolInput types from tool schemas - Add *ToolCallEvent interfaces for each built-in tool - Add isToolCallEventType() guard with overloads for built-ins Direct narrowing (event.toolName === "bash") doesn't work due to CustomToolCallEvent.toolName: string overlapping with literals. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
469fb5d27c
commit
a8a0f4b9fb
13 changed files with 219 additions and 19 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import type { AgentTool } from "@mariozechner/pi-agent-core";
|
||||
import { Type } from "@sinclair/typebox";
|
||||
import { type Static, Type } from "@sinclair/typebox";
|
||||
import { constants } from "fs";
|
||||
import { access as fsAccess, readFile as fsReadFile, writeFile as fsWriteFile } from "fs/promises";
|
||||
import {
|
||||
|
|
@ -19,6 +19,8 @@ const editSchema = Type.Object({
|
|||
newText: Type.String({ description: "New text to replace the old text with" }),
|
||||
});
|
||||
|
||||
export type EditToolInput = Static<typeof editSchema>;
|
||||
|
||||
export interface EditToolDetails {
|
||||
/** Unified diff of the changes made */
|
||||
diff: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue