test(core): align tool contract expectations (#39172)
This commit is contained in:
parent
f15398efc3
commit
470e360942
13 changed files with 333 additions and 116 deletions
|
|
@ -5,7 +5,7 @@ import { readDisplayText } from "@opencode-ai/tui/mini/tool"
|
|||
export type ToolInput = Record<string, unknown>
|
||||
export type ToolContent = ReadonlyArray<
|
||||
| { readonly type: "text"; readonly text: string }
|
||||
| { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string }
|
||||
| { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string | null }
|
||||
>
|
||||
|
||||
export function toToolKind(toolName: string): ToolKind {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import type {
|
||||
EventSubscribeOutput,
|
||||
JsonValue,
|
||||
LLMToolContent,
|
||||
LocationRef,
|
||||
OpenCodeClient,
|
||||
SessionMessageAssistantTool,
|
||||
SessionMessageInfo,
|
||||
ToolContent,
|
||||
} from "@opencode-ai/client/promise"
|
||||
import { SessionMessage } from "@opencode-ai/schema/session-message"
|
||||
import { EOL } from "node:os"
|
||||
|
|
@ -56,7 +56,7 @@ type ToolState = StartedPart & {
|
|||
provider?: unknown
|
||||
providerState?: SessionMessageAssistantTool["providerState"]
|
||||
metadata: Record<string, JsonValue>
|
||||
content: LLMToolContent[]
|
||||
content: ToolContent[]
|
||||
}
|
||||
|
||||
type V2Event = EventSubscribeOutput
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue