(def: D)
| 781 | type AnyToolDef = ToolDef<any, any, any> |
| 782 | |
| 783 | export function buildTool<D extends AnyToolDef>(def: D): BuiltTool<D> { |
| 784 | // The runtime spread is straightforward; the `as` bridges the gap between |
| 785 | // the structural-any constraint and the precise BuiltTool<D> return. The |
| 786 | // type semantics are proven by the 0-error typecheck across all 60+ tools. |
| 787 | return { |
| 788 | ...TOOL_DEFAULTS, |
| 789 | userFacingName: () => def.name, |
| 790 | ...def, |
| 791 | } as BuiltTool<D> |
| 792 | } |
| 793 | |
| 794 |
no outgoing calls
no test coverage detected