MCPcopy Create free account
hub / github.com/WJX20/claude-code / createSyntheticAssistantMessage

Function createSyntheticAssistantMessage

src/remote/remotePermissionBridge.ts:12–46  ·  view source on GitHub ↗
(
  request: SDKControlPermissionRequest,
  requestId: string,
)

Source from the content-addressed store, hash-verified

10 * we don't have a real one — the tool use runs on the CCR container.
11 */
12export function createSyntheticAssistantMessage(
13 request: SDKControlPermissionRequest,
14 requestId: string,
15): AssistantMessage {
16 return {
17 type: 'assistant',
18 uuid: randomUUID(),
19 message: {
20 id: `remote-${requestId}`,
21 type: 'message',
22 role: 'assistant',
23 content: [
24 {
25 type: 'tool_use',
26 id: request.tool_use_id,
27 name: request.tool_name,
28 input: request.input,
29 },
30 ],
31 model: '',
32 stop_reason: null,
33 stop_sequence: null,
34 container: null,
35 context_management: null,
36 usage: {
37 input_tokens: 0,
38 output_tokens: 0,
39 cache_creation_input_tokens: 0,
40 cache_read_input_tokens: 0,
41 },
42 } as AssistantMessage['message'],
43 requestId: undefined,
44 timestamp: new Date().toISOString(),
45 }
46}
47
48/**
49 * Create a minimal Tool stub for tools that aren't loaded locally.

Callers 3

useRemoteSessionFunction · 0.85
useSSHSessionFunction · 0.85
useDirectConnectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected