<!-- source-hash: 6aecca2e05a8c612241168939fffcf70 -->
Utility helpers for resolving, formatting, and rendering tool call data — titles, argument values, and execution results — used across approval and execution UI cards.

## Key Components

### Constants
- **`COMMAND_BODY_ARG_KEYS`** — Ordered list of argument keys (`command`, `query`, `script`, `scriptContent`, `code`) checked when resolving a tool call's display title.

### Functions

| Function | Description |
|---|---|
| `getToolCallTitle(opts)` | Resolves a human-readable title from args, title, or name — shape-agnostic for both approval and execution cards. |
| `getCommandText(call)` | Thin adapter over `getToolCallTitle` for `PendingToolCallData`. |
| `expandedJsonStringify(value)` | Pretty-prints JSON with real newlines for multi-line strings instead of escaped `\n` sequences. |
| `formatToolArgValue(value)` | Determines inline vs. block rendering for a single tool argument value. |
| `formatToolResult(value)` | Determines inline vs. block rendering for a tool execution result, stripping markdown code fences if present. |

### Types
- **`FormattedArgValue`** — Discriminated union: `{ kind: 'inline'; text: string }` or `{ kind: 'block'; text: string; language: 'json' | 'text' }`.

## Usage Example

```typescript
import {
  getCommandText,
  formatToolArgValue,
  formatToolResult,
} from './tool-call-helpers'

// Resolve display title from a pending tool call
const title = getCommandText(pendingCall)
// → e.g. "Get-Process | Where-Object CPU -gt 50"

// Render an argument value
const rendered = formatToolArgValue({ host: 'server-01', port: 22 })
// → { kind: 'block', text: '{\n  "host": "server-01",\n  "port": 22\n}', language: 'json' }

// Render a tool execution result (strips fences, detects JSON)
const result = formatToolResult('```json\n{"status":"ok"}\n```')
// → { kind: 'block', text: '{\n  "status": "ok"\n}', language: 'json' }
```