import type { ToolResult } from '#cli/core/model'
import type { ToolRunner } from '../../shell'

/**
 * Tool execution in the DimCode TUI is handled by the agent process.
 *
 * The UI still needs a `ToolRunner` implementation because the shared store
 * expects one, but it should never be called in normal operation.
 */
export function createNoopToolRunner(): ToolRunner {
  return async (call) => {
    const name = call.name
    const result: ToolResult = {
      toolCallId: call.id,
      status: 'error',
      output: [
        'Tool execution is handled by the DimCode agent.',
        `This UI cannot run tool "${name}" locally.`,
      ].join('\n'),
    }
    return result
  }
}
