mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 11:21:41 +00:00
refactor: dedupe agent and reply runtimes
This commit is contained in:
@@ -63,6 +63,31 @@ export function resolveActionArg(args: unknown): string | undefined {
|
||||
return action || undefined;
|
||||
}
|
||||
|
||||
export function resolveToolVerbAndDetailForArgs(params: {
|
||||
toolKey: string;
|
||||
args?: unknown;
|
||||
meta?: string;
|
||||
spec?: ToolDisplaySpec;
|
||||
fallbackDetailKeys?: string[];
|
||||
detailMode: "first" | "summary";
|
||||
detailCoerce?: CoerceDisplayValueOptions;
|
||||
detailMaxEntries?: number;
|
||||
detailFormatKey?: (raw: string) => string;
|
||||
}): { verb?: string; detail?: string } {
|
||||
return resolveToolVerbAndDetail({
|
||||
toolKey: params.toolKey,
|
||||
args: params.args,
|
||||
meta: params.meta,
|
||||
action: resolveActionArg(params.args),
|
||||
spec: params.spec,
|
||||
fallbackDetailKeys: params.fallbackDetailKeys,
|
||||
detailMode: params.detailMode,
|
||||
detailCoerce: params.detailCoerce,
|
||||
detailMaxEntries: params.detailMaxEntries,
|
||||
detailFormatKey: params.detailFormatKey,
|
||||
});
|
||||
}
|
||||
|
||||
export function coerceDisplayValue(
|
||||
value: unknown,
|
||||
opts: CoerceDisplayValueOptions = {},
|
||||
|
||||
Reference in New Issue
Block a user