1956
/** Builds the SDK user message for a send, addressed to `sdkSessionId`. */
1957
private _buildSdkPrompt(sdkSessionId: string, prompt: string, attachments: readonly MessageAttachment[] | undefined, turnId: string): SDKUserMessage {
1958
>
const contentBlocks = resolvePromptToContentBlocks(prompt, attachments);
claudeAgent.ts
1959
>
return {
1960
>
type: 'user',
1961
>
message: { role: 'user', content: contentBlocks },
1962
>
session_id: sdkSessionId,
1963
>
parent_tool_use_id: null,
1964
>
// M1 / Glossary: `Turn.id ↔ SDKUserMessage.uuid`. The SDK types this
1965
>
// as a branded `${string}-…` template-literal alias of Node's
1966
>
// `crypto.UUID`; cast at the boundary rather than threading the brand
1967
>
// up to every caller.
1968
>
uuid: turnId as `${string}-${string}-${string}-${string}-${string}`,
1969
>
};
1970
>
}
1971
1972
respondToPermissionRequest(requestId: string, approved: boolean): void {