UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 917 B
import{a as e}from"./transcript-string-coerce-DTk-8HSr.mjs";const t=[`id`,`tool_call_id`,`toolCallId`,`tool_use_id`,`toolUseId`];function normalizeToolContentType(e){return typeof e==`string`?e.toLowerCase():``}function isToolCallContentType(e){let t=normalizeToolContentType(e);return t===`toolcall`||t===`tool_call`||t===`tooluse`||t===`tool_use`}function isToolResultContentType(e){let t=normalizeToolContentType(e);return t===`toolresult`||t===`tool_result`}function isToolCallBlock(e){return isToolCallContentType(e.type)}function isToolResultBlock(e){return isToolResultContentType(e.type)}function resolveToolUseId(n){for(let r of t){let t=e(n[r]);if(t)return t}}function readToolErrorFlag(e){let t=e.isError??e.is_error;return typeof t==`boolean`?t:void 0}export{readToolErrorFlag as a,isToolResultContentType as i,isToolCallContentType as n,resolveToolUseId as o,isToolResultBlock as r,isToolCallBlock as t};