spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / diff / tests / fixtures / turn-diffs-of / edits-of.ts
19 lines · 449 BRaw
1import type { SessionMessage } from 'claude-code'
2
3/**
4 * An assistant message whose Edit calls came back with the given results,
5 * in order.
6 *
7 * @param results each call's structured result
8 * @returns the message
9 */
10export const editsOf = (...results: unknown[]): SessionMessage => ({
11 role: 'assistant',
12 text: '',
13 toolUses: results.map((result, at) => ({
14 tool_use_id: `t${at}`,
15 tool: 'Edit',
16 input: {},
17 result,
18 })),
19})