Files
Void-Homelab/tests/fixtures/fake-claude-blue.js
2026-06-04 21:43:34 +10:00

18 lines
1.3 KiB
JavaScript
Executable File

#!/usr/bin/env node
// Fake claude CLI for the Little Blue route test. Emits text deltas + a
// propose_action tool call (no draft). The tool's real HTTP call is irrelevant
// here — the route only streams the fixture + persists.
const ID = 'toolu_blue_01';
const lines = [
{ type: 'system', subtype: 'init', session_id: 'fake-blue', tools: [], cwd: '/tmp' },
{ type: 'stream_event', event: { type: 'content_block_start', index: 0, content_block: { type: 'text', text: '' } } },
{ type: 'stream_event', event: { type: 'content_block_delta', index: 0, delta: { type: 'text_delta', text: 'Restarting it now.' } } },
{ type: 'stream_event', event: { type: 'content_block_stop', index: 0 } },
{ type: 'stream_event', event: { type: 'content_block_start', index: 1, content_block: { type: 'tool_use', id: ID, name: 'mcp__void__propose_action', input: {} } } },
{ type: 'stream_event', event: { type: 'content_block_stop', index: 1 } },
{ type: 'tool_result', tool_use_id: ID, content: [{ type: 'text', text: JSON.stringify({ executed: true }) }] },
{ type: 'result', subtype: 'success', is_error: false, result: 'Restarting it now.', stop_reason: 'end_turn', session_id: 'fake-blue', total_cost_usd: 0.0001, usage: { input_tokens: 30, output_tokens: 3 } }
];
for (const l of lines) process.stdout.write(JSON.stringify(l) + '\n');
process.exit(0);