2026-10-12 12:58:52 +09:00
|
|
|
import type { DynamicToolUIPart, ToolUIPart, UITools } from "ai"
|
2026-10-05 22:39:32 +09:00
|
|
|
import type { DiagramOperation } from "@/packages/mcp-server/src/diagram-operations.ts"
|
|
|
|
|
|
|
|
|
|
export type { DiagramOperation }
|
2026-01-04 12:04:06 +09:00
|
|
|
|
2026-10-12 12:58:52 +09:00
|
|
|
/**
|
|
|
|
|
* A tool part as the UI reads it, in any state: input, output and errorText
|
|
|
|
|
* are each there or not, instead of one shape per state.
|
|
|
|
|
*/
|
|
|
|
|
export type ToolPartLike = (ToolUIPart<UITools> | DynamicToolUIPart) & {
|
|
|
|
|
input?:
|
|
|
|
|
| ({
|
|
|
|
|
xml?: string
|
|
|
|
|
operations?: DiagramOperation[]
|
|
|
|
|
} & Record<string, unknown>)
|
|
|
|
|
| undefined
|
2026-01-04 12:04:06 +09:00
|
|
|
output?: string
|
2026-10-05 22:39:32 +09:00
|
|
|
errorText?: string
|
2026-01-04 12:04:06 +09:00
|
|
|
}
|