mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 21:07:01 -06:00
d50dbfc448
Route Claude Agent SDK AskUserQuestion through OpenClaw's shared structured-input flow across the Control UI and existing channel fallback surfaces. Fixes #81099.
23 lines
707 B
TypeScript
23 lines
707 B
TypeScript
import { randomUUID } from "node:crypto";
|
|
import type { SDKUserMessage as ClaudeAgentSdkUserMessage } from "@anthropic-ai/claude-agent-sdk";
|
|
import type { CliBackendExecuteContext } from "openclaw/plugin-sdk/cli-backend";
|
|
|
|
export function splitClaudeToolNames(value: string): string[] {
|
|
return value
|
|
.split(",")
|
|
.map((name) => name.trim())
|
|
.filter(Boolean);
|
|
}
|
|
|
|
export function createClaudeAgentSdkUserMessage(
|
|
context: CliBackendExecuteContext,
|
|
): ClaudeAgentSdkUserMessage {
|
|
return {
|
|
type: "user",
|
|
message: { role: "user", content: context.prompt },
|
|
parent_tool_use_id: null,
|
|
uuid: randomUUID(),
|
|
...(context.sessionId ? { session_id: context.sessionId } : {}),
|
|
};
|
|
}
|