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 / todo-write-of.ts
20 lines · 482 BRaw
1import type { SessionMessage } from 'claude-code'
2
3/**
4 * An assistant message holding one TodoWrite whose items have the given
5 * statuses.
6 *
7 * @param statuses each item's status
8 * @returns the message
9 */
10export const todoWriteOf = (statuses: readonly string[]): SessionMessage => ({
11 role: 'assistant',
12 text: '',
13 toolUses: [
14 {
15 tool_use_id: 'w',
16 tool: 'TodoWrite',
17 input: { todos: statuses.map(status => ({ content: 'x', status })) },
18 },
19 ],
20})