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 / read-only-answer.ts
13 lines · 480 BRaw
1import type { ResultOf } from 'claude-code'
2
3/**
4 * A shell tool's answer as the engine gives it for a command the tool holds
5 * read-only (`ls`, `git status`): the result, and `isReadOnly` beside it.
6 *
7 * Built through Object.assign, since the declarations may not name the
8 * field yet; the plugin reads it through a type that may lack it too.
9 */
10export const READ_ONLY_ANSWER: ResultOf['tool.call'] = Object.assign(
11 { result: 'listed' },
12 { isReadOnly: true as const },
13)