import { Stream } from "effect" import { LLMClient } from "../../src/route" import type { Tools } from "../../src/tool" import type { RunOptions } from "../../src/tool-runtime" type CompatRunOptions = RunOptions & { readonly maxSteps?: number } export const runTools = (options: CompatRunOptions) => LLMClient.stream({ ...options, stopWhen: options.stopWhen ?? LLMClient.stepCountIs(options.maxSteps ?? 10) })