MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / writeWire

Function writeWire

packages/agent-core/test/session/subagent-host.test.ts:1670–1685  ·  view source on GitHub ↗
(homedir: string, records: readonly Record<string, unknown>[])

Source from the content-addressed store, hash-verified

1668}
1669
1670async function writeWire(homedir: string, records: readonly Record<string, unknown>[]) {
1671 await mkdir(homedir, { recursive: true });
1672 const wireRecords =
1673 records.length === 0
1674 ? []
1675 : [
1676 {
1677 type: 'metadata',
1678 protocol_version: AGENT_WIRE_PROTOCOL_VERSION,
1679 created_at: 1,
1680 },
1681 ...records,
1682 ];
1683 const text = wireRecords.map((record) => JSON.stringify(record)).join('\n');
1684 await writeFile(join(homedir, 'wire.jsonl'), text.length === 0 ? '' : `${text}\n`, 'utf-8');
1685}
1686
1687function childBashToolResultOutput(child: AgentTestContext): string | undefined {
1688 for (const entry of child.allEvents) {

Callers 1

Calls 2

mkdirFunction · 0.50
writeFileFunction · 0.50

Tested by

no test coverage detected