Files
deepseek-harness/packages/client/ui-tool/src/client/contract/slots.ts

40 lines
1.7 KiB
TypeScript

/** Tool UI slot declarations and their composed component props. */
import type { PropsLocale, PropsRenderSlots, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
import type { ToolCallBlock } from '@deepseek-ai/dsh-client-runtime/client'
import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
import type {} from '@deepseek-ai/dsh-client-locale/client'
declare module '@deepseek-ai/dsh-client-ui-slots' {
interface SlotMap {
/** Keyed atomic Tool call view, dispatched by the wire Tool name. */
'tool.call.toolview': { kind: 'keyed'; scope: 'session'; owner: ToolCallOwnerProps }
}
}
/** Standard owner currency supplied to every atomic Tool view. */
export interface ToolCallOwnerProps {
/** Tool call identity, stable across running and settled forms. */
callId: string
/** Wire Tool name and keyed dispatch value. */
toolName: string
/** Frozen running call or settled result node. */
block: ToolCallBlock
/** Session workspace root for relative summaries. */
cwd?: string | undefined
/** Open a Tool argument path through the Host. */
openFile: (path: string) => void
/** Inspect this call in the trajectory view when available. */
inspect?: (() => void) | undefined
}
/** Full props of a registered atomic Tool view. */
export type ToolCallViewProps = PropsRuntime<'tool.call.toolview'>
/** Full props of the Tool call-tree renderer registered into the chat flow. */
export type ToolTreeProps = PropsRuntime<'conversation.chat.tool'>
& PropsRenderSlots<'tool.call.toolview'>
& PropsLocale<'conversation'>
/** Full props of the selected Tool output renderer in the details panel. */
export type ToolDetailsProps = PropsRuntime<'conversation.details.tool'> & PropsLocale<'conversation'>