@xpert-ai/chatkit-types 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["export enum ChatMessageTypeEnum {\n // LOG = 'log',\n MESSAGE = 'message',\n EVENT = 'event'\n}\n\n/**\n * https://js.langchain.com/docs/how_to/streaming/#event-reference\n */\nexport enum ChatMessageEventTypeEnum {\n ON_CONVERSATION_START = 'on_conversation_start',\n ON_CONVERSATION_END = 'on_conversation_end',\n ON_MESSAGE_START = 'on_message_start',\n ON_MESSAGE_END = 'on_message_end',\n ON_TOOL_START = 'on_tool_start',\n ON_TOOL_END = 'on_tool_end',\n ON_TOOL_ERROR = 'on_tool_error',\n /**\n * Step message in tool call\n */\n ON_TOOL_MESSAGE = 'on_tool_message',\n ON_AGENT_START = 'on_agent_start',\n ON_AGENT_END = 'on_agent_end',\n ON_RETRIEVER_START = 'on_retriever_start',\n ON_RETRIEVER_END = 'on_retriever_end',\n ON_RETRIEVER_ERROR = 'on_retriever_error',\n ON_INTERRUPT = 'on_interrupt',\n ON_ERROR = 'on_error',\n ON_CHAT_EVENT = 'on_chat_event',\n}\n\n/**\n * Category of step message: determines the display components of computer use\n */\nexport enum ChatMessageStepCategory {\n /**\n * List of items: urls, files, etc.\n */\n List = 'list',\n /**\n * Websearch results\n */\n WebSearch = 'web_search',\n /**\n * Files list\n */\n Files = 'files',\n /**\n * View a file\n */\n File = 'file',\n /**\n * Program Execution\n */\n Program = 'program',\n /**\n * Iframe\n */\n Iframe = 'iframe',\n\n Memory = 'memory',\n\n Tasks = 'tasks',\n\n /**\n * Knowledges (knowledge base retriever results)\n */\n Knowledges = 'knowledges'\n}\n\n/**\n * Step message type, in canvas and ai message.\n */\nexport type TChatMessageStep<T = any> = TMessageComponent<TMessageComponentStep<T>>\n\nexport type ImageDetail = \"auto\" | \"low\" | \"high\";\nexport type MessageContentText = {\n type: \"text\";\n text: string;\n};\nexport type MessageContentImageUrl = {\n type: \"image_url\";\n image_url: string | {\n url: string;\n detail?: ImageDetail;\n };\n};\n\n/**\n * Similar to {@link MessageContentText} | {@link MessageContentImageUrl}, which together form {@link MessageContentComplex}\n */\nexport type TMessageContentComponent<T extends object = object> = {\n id: string\n type: 'component'\n data: TMessageComponent<T>\n xpertName?: string\n agentKey?: string;\n}\n\n/**\n * Defines the data type of the sub-message of `component` type in the message `content` {@link MessageContentComplex}\n */\nexport type TMessageComponent<T extends object = object> = T & {\n id?: string\n category: 'Dashboard' | 'Computer' | 'Tool'\n type?: string\n created_date?: Date | string\n}\n\nexport type TMessageContentText = {\n id?: string\n xpertName?: string\n agentKey?: string\n type: \"text\";\n text: string;\n};\nexport type TMessageContentMemory = {\n id?: string\n agentKey?: string\n type: \"memory\";\n data: any[];\n};\nexport type TMessageContentReasoning = {\n id?: string\n xpertName?: string\n agentKey?: string\n type: \"reasoning\";\n text: string;\n};\n/**\n * Enhance {@link MessageContentComplex} in Langchain.js\n */\nexport type TMessageContentComplex = (TMessageContentText | TMessageContentReasoning | MessageContentImageUrl | TMessageContentComponent | TMessageContentMemory | (Record<string, any> & {\n type?: \"text\" | \"image_url\" | string;\n}) | (Record<string, any> & {\n type?: never;\n})) & {\n id?: string\n xpertName?: string\n agentKey?: string;\n created_date?: Date | string\n}\n\n/**\n * Enhance {@link MessageContent} in Langchain.js\n * \n * @deprecated use {@link TMessageItems} instead\n */\nexport type TMessageContent = string | TMessageContentComplex[];\n\nexport type TMessageComponentIframe = {\n type: 'iframe'\n title: string\n url?: string\n data?: {\n url?: string\n }\n}\n\nexport type TMessageComponentStep<T = unknown> = {\n type: ChatMessageStepCategory\n toolset: string\n toolset_id: string\n tool?: string\n title: string\n message: string\n status: 'success' | 'fail' | 'running'\n created_date: Date | string\n end_date: Date | string\n error?: string\n data?: T\n input?: any\n output?: string\n artifact?: any\n}\n\n/**\n * Data type for chat event message\n */\nexport type TChatEventMessage = {\n type?: string\n title?: string\n message?: string\n status?: 'success' | 'fail' | 'running'\n created_date?: Date | string\n end_date?: Date | string\n error?: string\n}\n\nexport interface ChatkitMessage {\n status?: string\n content: TMessageItems\n reasoning?: TMessageContentReasoning[]\n type: 'user' | 'assistant' | 'system' | 'tool' | 'event'\n id: string\n}\n\nexport type TMessageItems = TMessageContentComplex[];"],"names":["ChatMessageTypeEnum","ChatMessageEventTypeEnum","ChatMessageStepCategory"],"mappings":"AAAO,IAAK,wCAAAA,yBAAL;AAELA,uBAAA,SAAA,IAAU;AACVA,uBAAA,OAAA,IAAQ;AAHE,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AASL,IAAK,6CAAAC,8BAAL;AACLA,4BAAA,uBAAA,IAAwB;AACxBA,4BAAA,qBAAA,IAAsB;AACtBA,4BAAA,kBAAA,IAAmB;AACnBA,4BAAA,gBAAA,IAAiB;AACjBA,4BAAA,eAAA,IAAgB;AAChBA,4BAAA,aAAA,IAAc;AACdA,4BAAA,eAAA,IAAgB;AAIhBA,4BAAA,iBAAA,IAAkB;AAClBA,4BAAA,gBAAA,IAAiB;AACjBA,4BAAA,cAAA,IAAe;AACfA,4BAAA,oBAAA,IAAqB;AACrBA,4BAAA,kBAAA,IAAmB;AACnBA,4BAAA,oBAAA,IAAqB;AACrBA,4BAAA,cAAA,IAAe;AACfA,4BAAA,UAAA,IAAW;AACXA,4BAAA,eAAA,IAAgB;AAnBN,SAAAA;AAAA,GAAA,4BAAA,CAAA,CAAA;AAyBL,IAAK,4CAAAC,6BAAL;AAILA,2BAAA,MAAA,IAAO;AAIPA,2BAAA,WAAA,IAAY;AAIZA,2BAAA,OAAA,IAAQ;AAIRA,2BAAA,MAAA,IAAO;AAIPA,2BAAA,SAAA,IAAU;AAIVA,2BAAA,QAAA,IAAS;AAETA,2BAAA,QAAA,IAAS;AAETA,2BAAA,OAAA,IAAQ;AAKRA,2BAAA,YAAA,IAAa;AAjCH,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"index.js","sources":["../../../node_modules/.pnpm/@langchain+core@1.1.7/node_modules/@langchain/core/dist/_virtual/rolldown_runtime.js","../../../node_modules/.pnpm/decamelize@1.2.0/node_modules/decamelize/index.js","../../../node_modules/.pnpm/camelcase@6.3.0/node_modules/camelcase/index.js","../../../node_modules/.pnpm/@langchain+core@1.1.7/node_modules/@langchain/core/dist/load/map_keys.js","../../../node_modules/.pnpm/@langchain+core@1.1.7/node_modules/@langchain/core/dist/load/serializable.js","../../../node_modules/.pnpm/@langchain+core@1.1.7/node_modules/@langchain/core/dist/messages/content/data.js","../../../node_modules/.pnpm/@langchain+core@1.1.7/node_modules/@langchain/core/dist/messages/block_translators/utils.js","../../../node_modules/.pnpm/@langchain+core@1.1.7/node_modules/@langchain/core/dist/messages/block_translators/anthropic.js","../../../node_modules/.pnpm/@langchain+core@1.1.7/node_modules/@langchain/core/dist/messages/block_translators/data.js","../../../node_modules/.pnpm/@langchain+core@1.1.7/node_modules/@langchain/core/dist/messages/block_translators/openai.js","../../../node_modules/.pnpm/@langchain+core@1.1.7/node_modules/@langchain/core/dist/messages/message.js","../../../node_modules/.pnpm/@langchain+core@1.1.7/node_modules/@langchain/core/dist/messages/format.js","../../../node_modules/.pnpm/@langchain+core@1.1.7/node_modules/@langchain/core/dist/messages/base.js","../../../node_modules/.pnpm/@langchain+core@1.1.7/node_modules/@langchain/core/dist/messages/tool.js","../src/interrupt.ts","../src/message.ts"],"sourcesContent":["//#region rolldown:runtime\nvar __defProp = Object.defineProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\n\n//#endregion\nexport { __export };","'use strict';\nmodule.exports = function (str, sep) {\n\tif (typeof str !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\tsep = typeof sep === 'undefined' ? '_' : sep;\n\n\treturn str\n\t\t.replace(/([a-z\\d])([A-Z])/g, '$1' + sep + '$2')\n\t\t.replace(/([A-Z]+)([A-Z][a-z\\d]+)/g, '$1' + sep + '$2')\n\t\t.toLowerCase();\n};\n","'use strict';\n\nconst UPPERCASE = /[\\p{Lu}]/u;\nconst LOWERCASE = /[\\p{Ll}]/u;\nconst LEADING_CAPITAL = /^[\\p{Lu}](?![\\p{Lu}])/gu;\nconst IDENTIFIER = /([\\p{Alpha}\\p{N}_]|$)/u;\nconst SEPARATORS = /[_.\\- ]+/;\n\nconst LEADING_SEPARATORS = new RegExp('^' + SEPARATORS.source);\nconst SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, 'gu');\nconst NUMBERS_AND_IDENTIFIER = new RegExp('\\\\d+' + IDENTIFIER.source, 'gu');\n\nconst preserveCamelCase = (string, toLowerCase, toUpperCase) => {\n\tlet isLastCharLower = false;\n\tlet isLastCharUpper = false;\n\tlet isLastLastCharUpper = false;\n\n\tfor (let i = 0; i < string.length; i++) {\n\t\tconst character = string[i];\n\n\t\tif (isLastCharLower && UPPERCASE.test(character)) {\n\t\t\tstring = string.slice(0, i) + '-' + string.slice(i);\n\t\t\tisLastCharLower = false;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = true;\n\t\t\ti++;\n\t\t} else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {\n\t\t\tstring = string.slice(0, i - 1) + '-' + string.slice(i - 1);\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = false;\n\t\t\tisLastCharLower = true;\n\t\t} else {\n\t\t\tisLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;\n\t\t}\n\t}\n\n\treturn string;\n};\n\nconst preserveConsecutiveUppercase = (input, toLowerCase) => {\n\tLEADING_CAPITAL.lastIndex = 0;\n\n\treturn input.replace(LEADING_CAPITAL, m1 => toLowerCase(m1));\n};\n\nconst postProcess = (input, toUpperCase) => {\n\tSEPARATORS_AND_IDENTIFIER.lastIndex = 0;\n\tNUMBERS_AND_IDENTIFIER.lastIndex = 0;\n\n\treturn input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier))\n\t\t.replace(NUMBERS_AND_IDENTIFIER, m => toUpperCase(m));\n};\n\nconst camelCase = (input, options) => {\n\tif (!(typeof input === 'string' || Array.isArray(input))) {\n\t\tthrow new TypeError('Expected the input to be `string | string[]`');\n\t}\n\n\toptions = {\n\t\tpascalCase: false,\n\t\tpreserveConsecutiveUppercase: false,\n\t\t...options\n\t};\n\n\tif (Array.isArray(input)) {\n\t\tinput = input.map(x => x.trim())\n\t\t\t.filter(x => x.length)\n\t\t\t.join('-');\n\t} else {\n\t\tinput = input.trim();\n\t}\n\n\tif (input.length === 0) {\n\t\treturn '';\n\t}\n\n\tconst toLowerCase = options.locale === false ?\n\t\tstring => string.toLowerCase() :\n\t\tstring => string.toLocaleLowerCase(options.locale);\n\tconst toUpperCase = options.locale === false ?\n\t\tstring => string.toUpperCase() :\n\t\tstring => string.toLocaleUpperCase(options.locale);\n\n\tif (input.length === 1) {\n\t\treturn options.pascalCase ? toUpperCase(input) : toLowerCase(input);\n\t}\n\n\tconst hasUpperCase = input !== toLowerCase(input);\n\n\tif (hasUpperCase) {\n\t\tinput = preserveCamelCase(input, toLowerCase, toUpperCase);\n\t}\n\n\tinput = input.replace(LEADING_SEPARATORS, '');\n\n\tif (options.preserveConsecutiveUppercase) {\n\t\tinput = preserveConsecutiveUppercase(input, toLowerCase);\n\t} else {\n\t\tinput = toLowerCase(input);\n\t}\n\n\tif (options.pascalCase) {\n\t\tinput = toUpperCase(input.charAt(0)) + input.slice(1);\n\t}\n\n\treturn postProcess(input, toUpperCase);\n};\n\nmodule.exports = camelCase;\n// TODO: Remove this for the next major release\nmodule.exports.default = camelCase;\n","import snakeCase from \"decamelize\";\nimport camelCase from \"camelcase\";\n\n//#region src/load/map_keys.ts\nfunction keyToJson(key, map) {\n\treturn map?.[key] || snakeCase(key);\n}\nfunction keyFromJson(key, map) {\n\treturn map?.[key] || camelCase(key);\n}\nfunction mapKeys(fields, mapper, map) {\n\tconst mapped = {};\n\tfor (const key in fields) if (Object.hasOwn(fields, key)) mapped[mapper(key, map)] = fields[key];\n\treturn mapped;\n}\n\n//#endregion\nexport { keyFromJson, keyToJson, mapKeys };\n//# sourceMappingURL=map_keys.js.map","import { __export } from \"../_virtual/rolldown_runtime.js\";\nimport { keyToJson, mapKeys } from \"./map_keys.js\";\n\n//#region src/load/serializable.ts\nvar serializable_exports = {};\n__export(serializable_exports, {\n\tSerializable: () => Serializable,\n\tget_lc_unique_name: () => get_lc_unique_name\n});\nfunction shallowCopy(obj) {\n\treturn Array.isArray(obj) ? [...obj] : { ...obj };\n}\nfunction replaceSecrets(root, secretsMap) {\n\tconst result = shallowCopy(root);\n\tfor (const [path, secretId] of Object.entries(secretsMap)) {\n\t\tconst [last, ...partsReverse] = path.split(\".\").reverse();\n\t\tlet current = result;\n\t\tfor (const part of partsReverse.reverse()) {\n\t\t\tif (current[part] === void 0) break;\n\t\t\tcurrent[part] = shallowCopy(current[part]);\n\t\t\tcurrent = current[part];\n\t\t}\n\t\tif (current[last] !== void 0) current[last] = {\n\t\t\tlc: 1,\n\t\t\ttype: \"secret\",\n\t\t\tid: [secretId]\n\t\t};\n\t}\n\treturn result;\n}\n/**\n* Get a unique name for the module, rather than parent class implementations.\n* Should not be subclassed, subclass lc_name above instead.\n*/\nfunction get_lc_unique_name(serializableClass) {\n\tconst parentClass = Object.getPrototypeOf(serializableClass);\n\tconst lcNameIsSubclassed = typeof serializableClass.lc_name === \"function\" && (typeof parentClass.lc_name !== \"function\" || serializableClass.lc_name() !== parentClass.lc_name());\n\tif (lcNameIsSubclassed) return serializableClass.lc_name();\n\telse return serializableClass.name;\n}\nvar Serializable = class Serializable {\n\tlc_serializable = false;\n\tlc_kwargs;\n\t/**\n\t* The name of the serializable. Override to provide an alias or\n\t* to preserve the serialized module name in minified environments.\n\t*\n\t* Implemented as a static method to support loading logic.\n\t*/\n\tstatic lc_name() {\n\t\treturn this.name;\n\t}\n\t/**\n\t* The final serialized identifier for the module.\n\t*/\n\tget lc_id() {\n\t\treturn [...this.lc_namespace, get_lc_unique_name(this.constructor)];\n\t}\n\t/**\n\t* A map of secrets, which will be omitted from serialization.\n\t* Keys are paths to the secret in constructor args, e.g. \"foo.bar.baz\".\n\t* Values are the secret ids, which will be used when deserializing.\n\t*/\n\tget lc_secrets() {\n\t\treturn void 0;\n\t}\n\t/**\n\t* A map of additional attributes to merge with constructor args.\n\t* Keys are the attribute names, e.g. \"foo\".\n\t* Values are the attribute values, which will be serialized.\n\t* These attributes need to be accepted by the constructor as arguments.\n\t*/\n\tget lc_attributes() {\n\t\treturn void 0;\n\t}\n\t/**\n\t* A map of aliases for constructor args.\n\t* Keys are the attribute names, e.g. \"foo\".\n\t* Values are the alias that will replace the key in serialization.\n\t* This is used to eg. make argument names match Python.\n\t*/\n\tget lc_aliases() {\n\t\treturn void 0;\n\t}\n\t/**\n\t* A manual list of keys that should be serialized.\n\t* If not overridden, all fields passed into the constructor will be serialized.\n\t*/\n\tget lc_serializable_keys() {\n\t\treturn void 0;\n\t}\n\tconstructor(kwargs, ..._args) {\n\t\tif (this.lc_serializable_keys !== void 0) this.lc_kwargs = Object.fromEntries(Object.entries(kwargs || {}).filter(([key]) => this.lc_serializable_keys?.includes(key)));\n\t\telse this.lc_kwargs = kwargs ?? {};\n\t}\n\ttoJSON() {\n\t\tif (!this.lc_serializable) return this.toJSONNotImplemented();\n\t\tif (this.lc_kwargs instanceof Serializable || typeof this.lc_kwargs !== \"object\" || Array.isArray(this.lc_kwargs)) return this.toJSONNotImplemented();\n\t\tconst aliases = {};\n\t\tconst secrets = {};\n\t\tconst kwargs = Object.keys(this.lc_kwargs).reduce((acc, key) => {\n\t\t\tacc[key] = key in this ? this[key] : this.lc_kwargs[key];\n\t\t\treturn acc;\n\t\t}, {});\n\t\tfor (let current = Object.getPrototypeOf(this); current; current = Object.getPrototypeOf(current)) {\n\t\t\tObject.assign(aliases, Reflect.get(current, \"lc_aliases\", this));\n\t\t\tObject.assign(secrets, Reflect.get(current, \"lc_secrets\", this));\n\t\t\tObject.assign(kwargs, Reflect.get(current, \"lc_attributes\", this));\n\t\t}\n\t\tObject.keys(secrets).forEach((keyPath) => {\n\t\t\tlet read = this;\n\t\t\tlet write = kwargs;\n\t\t\tconst [last, ...partsReverse] = keyPath.split(\".\").reverse();\n\t\t\tfor (const key of partsReverse.reverse()) {\n\t\t\t\tif (!(key in read) || read[key] === void 0) return;\n\t\t\t\tif (!(key in write) || write[key] === void 0) {\n\t\t\t\t\tif (typeof read[key] === \"object\" && read[key] != null) write[key] = {};\n\t\t\t\t\telse if (Array.isArray(read[key])) write[key] = [];\n\t\t\t\t}\n\t\t\t\tread = read[key];\n\t\t\t\twrite = write[key];\n\t\t\t}\n\t\t\tif (last in read && read[last] !== void 0) write[last] = write[last] || read[last];\n\t\t});\n\t\treturn {\n\t\t\tlc: 1,\n\t\t\ttype: \"constructor\",\n\t\t\tid: this.lc_id,\n\t\t\tkwargs: mapKeys(Object.keys(secrets).length ? replaceSecrets(kwargs, secrets) : kwargs, keyToJson, aliases)\n\t\t};\n\t}\n\ttoJSONNotImplemented() {\n\t\treturn {\n\t\t\tlc: 1,\n\t\t\ttype: \"not_implemented\",\n\t\t\tid: this.lc_id\n\t\t};\n\t}\n};\n\n//#endregion\nexport { Serializable, get_lc_unique_name, serializable_exports };\n//# sourceMappingURL=serializable.js.map","//#region src/messages/content/data.ts\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isDataContentBlock(content_block) {\n\treturn typeof content_block === \"object\" && content_block !== null && \"type\" in content_block && typeof content_block.type === \"string\" && \"source_type\" in content_block && (content_block.source_type === \"url\" || content_block.source_type === \"base64\" || content_block.source_type === \"text\" || content_block.source_type === \"id\");\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isURLContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"url\" && \"url\" in content_block && typeof content_block.url === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isBase64ContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"base64\" && \"data\" in content_block && typeof content_block.data === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isPlainTextContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"text\" && \"text\" in content_block && typeof content_block.text === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isIDContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"id\" && \"id\" in content_block && typeof content_block.id === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction convertToOpenAIImageBlock(content_block) {\n\tif (isDataContentBlock(content_block)) {\n\t\tif (content_block.source_type === \"url\") return {\n\t\t\ttype: \"image_url\",\n\t\t\timage_url: { url: content_block.url }\n\t\t};\n\t\tif (content_block.source_type === \"base64\") {\n\t\t\tif (!content_block.mime_type) throw new Error(\"mime_type key is required for base64 data.\");\n\t\t\tconst mime_type = content_block.mime_type;\n\t\t\treturn {\n\t\t\t\ttype: \"image_url\",\n\t\t\t\timage_url: { url: `data:${mime_type};base64,${content_block.data}` }\n\t\t\t};\n\t\t}\n\t}\n\tthrow new Error(\"Unsupported source type. Only 'url' and 'base64' are supported.\");\n}\n/**\n* Utility function for ChatModelProviders. Parses a mime type into a type, subtype, and parameters.\n*\n* @param mime_type - The mime type to parse.\n* @returns An object containing the type, subtype, and parameters.\n*\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction parseMimeType(mime_type) {\n\tconst parts = mime_type.split(\";\")[0].split(\"/\");\n\tif (parts.length !== 2) throw new Error(`Invalid mime type: \"${mime_type}\" - does not match type/subtype format.`);\n\tconst type = parts[0].trim();\n\tconst subtype = parts[1].trim();\n\tif (type === \"\" || subtype === \"\") throw new Error(`Invalid mime type: \"${mime_type}\" - type or subtype is empty.`);\n\tconst parameters = {};\n\tfor (const parameterKvp of mime_type.split(\";\").slice(1)) {\n\t\tconst parameterParts = parameterKvp.split(\"=\");\n\t\tif (parameterParts.length !== 2) throw new Error(`Invalid parameter syntax in mime type: \"${mime_type}\".`);\n\t\tconst key = parameterParts[0].trim();\n\t\tconst value = parameterParts[1].trim();\n\t\tif (key === \"\") throw new Error(`Invalid parameter syntax in mime type: \"${mime_type}\".`);\n\t\tparameters[key] = value;\n\t}\n\treturn {\n\t\ttype,\n\t\tsubtype,\n\t\tparameters\n\t};\n}\n/**\n* Utility function for ChatModelProviders. Parses a base64 data URL into a typed array or string.\n*\n* @param dataUrl - The base64 data URL to parse.\n* @param asTypedArray - Whether to return the data as a typed array.\n* @returns The parsed data and mime type, or undefined if the data URL is invalid.\n*\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction parseBase64DataUrl({ dataUrl: data_url, asTypedArray = false }) {\n\tconst formatMatch = data_url.match(/^data:(\\w+\\/\\w+);base64,([A-Za-z0-9+/]+=*)$/);\n\tlet mime_type;\n\tif (formatMatch) {\n\t\tmime_type = formatMatch[1].toLowerCase();\n\t\tconst data = asTypedArray ? Uint8Array.from(atob(formatMatch[2]), (c) => c.charCodeAt(0)) : formatMatch[2];\n\t\treturn {\n\t\t\tmime_type,\n\t\t\tdata\n\t\t};\n\t}\n\treturn void 0;\n}\n/**\n* Convert from a standard data content block to a provider's proprietary data content block format.\n*\n* Don't override this method. Instead, override the more specific conversion methods and use this\n* method unmodified.\n*\n* @param block - The standard data content block to convert.\n* @returns The provider data content block.\n* @throws An error if the standard data content block type is not supported.\n*\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction convertToProviderContentBlock(block, converter) {\n\tif (block.type === \"text\") {\n\t\tif (!converter.fromStandardTextBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardTextBlock\\` method.`);\n\t\treturn converter.fromStandardTextBlock(block);\n\t}\n\tif (block.type === \"image\") {\n\t\tif (!converter.fromStandardImageBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardImageBlock\\` method.`);\n\t\treturn converter.fromStandardImageBlock(block);\n\t}\n\tif (block.type === \"audio\") {\n\t\tif (!converter.fromStandardAudioBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardAudioBlock\\` method.`);\n\t\treturn converter.fromStandardAudioBlock(block);\n\t}\n\tif (block.type === \"file\") {\n\t\tif (!converter.fromStandardFileBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardFileBlock\\` method.`);\n\t\treturn converter.fromStandardFileBlock(block);\n\t}\n\tthrow new Error(`Unable to convert content block type '${block.type}' to provider-specific format: not recognized.`);\n}\n\n//#endregion\nexport { convertToOpenAIImageBlock, convertToProviderContentBlock, isBase64ContentBlock, isDataContentBlock, isIDContentBlock, isPlainTextContentBlock, isURLContentBlock, parseBase64DataUrl, parseMimeType };\n//# sourceMappingURL=data.js.map","//#region src/messages/block_translators/utils.ts\nfunction _isContentBlock(block, type) {\n\treturn _isObject(block) && block.type === type;\n}\nfunction _isObject(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\nfunction _isArray(value) {\n\treturn Array.isArray(value);\n}\nfunction _isString(value) {\n\treturn typeof value === \"string\";\n}\nfunction _isNumber(value) {\n\treturn typeof value === \"number\";\n}\nfunction _isBytesArray(value) {\n\treturn value instanceof Uint8Array;\n}\nfunction safeParseJson(value) {\n\ttry {\n\t\treturn JSON.parse(value);\n\t} catch {\n\t\treturn void 0;\n\t}\n}\nconst iife = (fn) => fn();\n\n//#endregion\nexport { _isArray, _isBytesArray, _isContentBlock, _isNumber, _isObject, _isString, iife, safeParseJson };\n//# sourceMappingURL=utils.js.map","import { _isArray, _isContentBlock, _isNumber, _isObject, _isString, iife, safeParseJson } from \"./utils.js\";\n\n//#region src/messages/block_translators/anthropic.ts\nfunction convertAnthropicAnnotation(citation) {\n\tif (citation.type === \"char_location\" && _isString(citation.document_title) && _isNumber(citation.start_char_index) && _isNumber(citation.end_char_index) && _isString(citation.cited_text)) {\n\t\tconst { document_title, start_char_index, end_char_index, cited_text,...rest } = citation;\n\t\treturn {\n\t\t\t...rest,\n\t\t\ttype: \"citation\",\n\t\t\tsource: \"char\",\n\t\t\ttitle: document_title ?? void 0,\n\t\t\tstartIndex: start_char_index,\n\t\t\tendIndex: end_char_index,\n\t\t\tcitedText: cited_text\n\t\t};\n\t}\n\tif (citation.type === \"page_location\" && _isString(citation.document_title) && _isNumber(citation.start_page_number) && _isNumber(citation.end_page_number) && _isString(citation.cited_text)) {\n\t\tconst { document_title, start_page_number, end_page_number, cited_text,...rest } = citation;\n\t\treturn {\n\t\t\t...rest,\n\t\t\ttype: \"citation\",\n\t\t\tsource: \"page\",\n\t\t\ttitle: document_title ?? void 0,\n\t\t\tstartIndex: start_page_number,\n\t\t\tendIndex: end_page_number,\n\t\t\tcitedText: cited_text\n\t\t};\n\t}\n\tif (citation.type === \"content_block_location\" && _isString(citation.document_title) && _isNumber(citation.start_block_index) && _isNumber(citation.end_block_index) && _isString(citation.cited_text)) {\n\t\tconst { document_title, start_block_index, end_block_index, cited_text,...rest } = citation;\n\t\treturn {\n\t\t\t...rest,\n\t\t\ttype: \"citation\",\n\t\t\tsource: \"block\",\n\t\t\ttitle: document_title ?? void 0,\n\t\t\tstartIndex: start_block_index,\n\t\t\tendIndex: end_block_index,\n\t\t\tcitedText: cited_text\n\t\t};\n\t}\n\tif (citation.type === \"web_search_result_location\" && _isString(citation.url) && _isString(citation.title) && _isString(citation.encrypted_index) && _isString(citation.cited_text)) {\n\t\tconst { url, title, encrypted_index, cited_text,...rest } = citation;\n\t\treturn {\n\t\t\t...rest,\n\t\t\ttype: \"citation\",\n\t\t\tsource: \"url\",\n\t\t\turl,\n\t\t\ttitle,\n\t\t\tstartIndex: Number(encrypted_index),\n\t\t\tendIndex: Number(encrypted_index),\n\t\t\tcitedText: cited_text\n\t\t};\n\t}\n\tif (citation.type === \"search_result_location\" && _isString(citation.source) && _isString(citation.title) && _isNumber(citation.start_block_index) && _isNumber(citation.end_block_index) && _isString(citation.cited_text)) {\n\t\tconst { source, title, start_block_index, end_block_index, cited_text,...rest } = citation;\n\t\treturn {\n\t\t\t...rest,\n\t\t\ttype: \"citation\",\n\t\t\tsource: \"search\",\n\t\t\turl: source,\n\t\t\ttitle: title ?? void 0,\n\t\t\tstartIndex: start_block_index,\n\t\t\tendIndex: end_block_index,\n\t\t\tcitedText: cited_text\n\t\t};\n\t}\n\treturn void 0;\n}\n/**\n* Converts an Anthropic content block to a standard V1 content block.\n*\n* This function handles the conversion of Anthropic-specific content blocks\n* (document and image blocks) to the standardized V1 format. It supports\n* various source types including base64 data, URLs, file IDs, and text data.\n*\n* @param block - The Anthropic content block to convert\n* @returns A standard V1 content block if conversion is successful, undefined otherwise\n*\n* @example\n* ```typescript\n* const anthropicBlock = {\n* type: \"image\",\n* source: {\n* type: \"base64\",\n* media_type: \"image/png\",\n* data: \"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==\"\n* }\n* };\n*\n* const standardBlock = convertToV1FromAnthropicContentBlock(anthropicBlock);\n* // Returns: { type: \"image\", mimeType: \"image/png\", data: \"...\" }\n* ```\n*/\nfunction convertToV1FromAnthropicContentBlock(block) {\n\tif (_isContentBlock(block, \"document\") && _isObject(block.source) && \"type\" in block.source) {\n\t\tif (block.source.type === \"base64\" && _isString(block.source.media_type) && _isString(block.source.data)) return {\n\t\t\ttype: \"file\",\n\t\t\tmimeType: block.source.media_type,\n\t\t\tdata: block.source.data\n\t\t};\n\t\telse if (block.source.type === \"url\" && _isString(block.source.url)) return {\n\t\t\ttype: \"file\",\n\t\t\turl: block.source.url\n\t\t};\n\t\telse if (block.source.type === \"file\" && _isString(block.source.file_id)) return {\n\t\t\ttype: \"file\",\n\t\t\tfileId: block.source.file_id\n\t\t};\n\t\telse if (block.source.type === \"text\" && _isString(block.source.data)) return {\n\t\t\ttype: \"file\",\n\t\t\tmimeType: String(block.source.media_type ?? \"text/plain\"),\n\t\t\tdata: block.source.data\n\t\t};\n\t} else if (_isContentBlock(block, \"image\") && _isObject(block.source) && \"type\" in block.source) {\n\t\tif (block.source.type === \"base64\" && _isString(block.source.media_type) && _isString(block.source.data)) return {\n\t\t\ttype: \"image\",\n\t\t\tmimeType: block.source.media_type,\n\t\t\tdata: block.source.data\n\t\t};\n\t\telse if (block.source.type === \"url\" && _isString(block.source.url)) return {\n\t\t\ttype: \"image\",\n\t\t\turl: block.source.url\n\t\t};\n\t\telse if (block.source.type === \"file\" && _isString(block.source.file_id)) return {\n\t\t\ttype: \"image\",\n\t\t\tfileId: block.source.file_id\n\t\t};\n\t}\n\treturn void 0;\n}\n/**\n* Converts an array of content blocks from Anthropic format to v1 standard format.\n*\n* This function processes each content block in the input array, attempting to convert\n* Anthropic-specific block formats (like image blocks with source objects, document blocks, etc.)\n* to the standardized v1 content block format. If a block cannot be converted, it is\n* passed through as-is with a type assertion to ContentBlock.Standard.\n*\n* @param content - Array of content blocks in Anthropic format to be converted\n* @returns Array of content blocks in v1 standard format\n*/\nfunction convertToV1FromAnthropicInput(content) {\n\tfunction* iterateContent() {\n\t\tfor (const block of content) {\n\t\t\tconst stdBlock = convertToV1FromAnthropicContentBlock(block);\n\t\t\tif (stdBlock) yield stdBlock;\n\t\t\telse yield block;\n\t\t}\n\t}\n\treturn Array.from(iterateContent());\n}\n/**\n* Converts an Anthropic AI message to an array of v1 standard content blocks.\n*\n* This function processes an AI message containing Anthropic-specific content blocks\n* and converts them to the standardized v1 content block format.\n*\n* @param message - The AI message containing Anthropic-formatted content blocks\n* @returns Array of content blocks in v1 standard format\n*\n* @example\n* ```typescript\n* const message = new AIMessage([\n* { type: \"text\", text: \"Hello world\" },\n* { type: \"thinking\", text: \"Let me think about this...\" },\n* { type: \"tool_use\", id: \"123\", name: \"calculator\", input: { a: 1, b: 2 } }\n* ]);\n*\n* const standardBlocks = convertToV1FromAnthropicMessage(message);\n* // Returns:\n* // [\n* // { type: \"text\", text: \"Hello world\" },\n* // { type: \"reasoning\", reasoning: \"Let me think about this...\" },\n* // { type: \"tool_call\", id: \"123\", name: \"calculator\", args: { a: 1, b: 2 } }\n* // ]\n* ```\n*/\nfunction convertToV1FromAnthropicMessage(message) {\n\tfunction* iterateContent() {\n\t\tconst content = typeof message.content === \"string\" ? [{\n\t\t\ttype: \"text\",\n\t\t\ttext: message.content\n\t\t}] : message.content;\n\t\tfor (const block of content) {\n\t\t\tif (_isContentBlock(block, \"text\") && _isString(block.text)) {\n\t\t\t\tconst { text, citations,...rest } = block;\n\t\t\t\tif (_isArray(citations) && citations.length) {\n\t\t\t\t\tconst _citations = citations.reduce((acc, item) => {\n\t\t\t\t\t\tconst citation = convertAnthropicAnnotation(item);\n\t\t\t\t\t\tif (citation) return [...acc, citation];\n\t\t\t\t\t\treturn acc;\n\t\t\t\t\t}, []);\n\t\t\t\t\tyield {\n\t\t\t\t\t\t...rest,\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\ttext,\n\t\t\t\t\t\tannotations: _citations\n\t\t\t\t\t};\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tyield {\n\t\t\t\t\t\t...rest,\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\ttext\n\t\t\t\t\t};\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (_isContentBlock(block, \"thinking\") && _isString(block.thinking)) {\n\t\t\t\tconst { thinking, signature,...rest } = block;\n\t\t\t\tyield {\n\t\t\t\t\t...rest,\n\t\t\t\t\ttype: \"reasoning\",\n\t\t\t\t\treasoning: thinking,\n\t\t\t\t\tsignature\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"redacted_thinking\")) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"non_standard\",\n\t\t\t\t\tvalue: block\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"tool_use\") && _isString(block.name) && _isString(block.id)) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"tool_call\",\n\t\t\t\t\tid: block.id,\n\t\t\t\t\tname: block.name,\n\t\t\t\t\targs: block.input\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"input_json_delta\")) {\n\t\t\t\tif (_isAIMessageChunk(message) && message.tool_call_chunks?.length) {\n\t\t\t\t\tconst tool_call_chunk = message.tool_call_chunks[0];\n\t\t\t\t\tyield {\n\t\t\t\t\t\ttype: \"tool_call_chunk\",\n\t\t\t\t\t\tid: tool_call_chunk.id,\n\t\t\t\t\t\tname: tool_call_chunk.name,\n\t\t\t\t\t\targs: tool_call_chunk.args,\n\t\t\t\t\t\tindex: tool_call_chunk.index\n\t\t\t\t\t};\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (_isContentBlock(block, \"server_tool_use\") && _isString(block.name) && _isString(block.id)) {\n\t\t\t\tconst { name, id } = block;\n\t\t\t\tif (name === \"web_search\") {\n\t\t\t\t\tconst query = iife(() => {\n\t\t\t\t\t\tif (typeof block.input === \"string\") return block.input;\n\t\t\t\t\t\telse if (_isObject(block.input) && _isString(block.input.query)) return block.input.query;\n\t\t\t\t\t\telse if (_isString(block.partial_json)) {\n\t\t\t\t\t\t\tconst json = safeParseJson(block.partial_json);\n\t\t\t\t\t\t\tif (json?.query) return json.query;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t\t});\n\t\t\t\t\tyield {\n\t\t\t\t\t\tid,\n\t\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\t\tname: \"web_search\",\n\t\t\t\t\t\targs: { query }\n\t\t\t\t\t};\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (block.name === \"code_execution\") {\n\t\t\t\t\tconst code = iife(() => {\n\t\t\t\t\t\tif (typeof block.input === \"string\") return block.input;\n\t\t\t\t\t\telse if (_isObject(block.input) && _isString(block.input.code)) return block.input.code;\n\t\t\t\t\t\telse if (_isString(block.partial_json)) {\n\t\t\t\t\t\t\tconst json = safeParseJson(block.partial_json);\n\t\t\t\t\t\t\tif (json?.code) return json.code;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t\t});\n\t\t\t\t\tyield {\n\t\t\t\t\t\tid,\n\t\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\t\tname: \"code_execution\",\n\t\t\t\t\t\targs: { code }\n\t\t\t\t\t};\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (_isContentBlock(block, \"web_search_tool_result\") && _isString(block.tool_use_id) && _isArray(block.content)) {\n\t\t\t\tconst { content: content$1, tool_use_id } = block;\n\t\t\t\tconst urls = content$1.reduce((acc, content$2) => {\n\t\t\t\t\tif (_isContentBlock(content$2, \"web_search_result\")) return [...acc, content$2.url];\n\t\t\t\t\treturn acc;\n\t\t\t\t}, []);\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"server_tool_call_result\",\n\t\t\t\t\tname: \"web_search\",\n\t\t\t\t\ttoolCallId: tool_use_id,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\toutput: { urls }\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"code_execution_tool_result\") && _isString(block.tool_use_id) && _isObject(block.content)) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"server_tool_call_result\",\n\t\t\t\t\tname: \"code_execution\",\n\t\t\t\t\ttoolCallId: block.tool_use_id,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\toutput: block.content\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"mcp_tool_use\")) {\n\t\t\t\tyield {\n\t\t\t\t\tid: block.id,\n\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\tname: \"mcp_tool_use\",\n\t\t\t\t\targs: block.input\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"mcp_tool_result\") && _isString(block.tool_use_id) && _isObject(block.content)) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"server_tool_call_result\",\n\t\t\t\t\tname: \"mcp_tool_use\",\n\t\t\t\t\ttoolCallId: block.tool_use_id,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\toutput: block.content\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"container_upload\")) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\tname: \"container_upload\",\n\t\t\t\t\targs: block.input\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"search_result\")) {\n\t\t\t\tyield {\n\t\t\t\t\tid: block.id,\n\t\t\t\t\ttype: \"non_standard\",\n\t\t\t\t\tvalue: block\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"tool_result\")) {\n\t\t\t\tyield {\n\t\t\t\t\tid: block.id,\n\t\t\t\t\ttype: \"non_standard\",\n\t\t\t\t\tvalue: block\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tconst stdBlock = convertToV1FromAnthropicContentBlock(block);\n\t\t\t\tif (stdBlock) {\n\t\t\t\t\tyield stdBlock;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield {\n\t\t\t\ttype: \"non_standard\",\n\t\t\t\tvalue: block\n\t\t\t};\n\t\t}\n\t}\n\treturn Array.from(iterateContent());\n}\nconst ChatAnthropicTranslator = {\n\ttranslateContent: convertToV1FromAnthropicMessage,\n\ttranslateContentChunk: convertToV1FromAnthropicMessage\n};\nfunction _isAIMessageChunk(message) {\n\treturn typeof message?._getType === \"function\" && typeof message.concat === \"function\" && message._getType() === \"ai\";\n}\n\n//#endregion\nexport { ChatAnthropicTranslator, convertToV1FromAnthropicInput };\n//# sourceMappingURL=anthropic.js.map","import { isBase64ContentBlock, isIDContentBlock, isURLContentBlock, parseBase64DataUrl } from \"../content/data.js\";\nimport { _isContentBlock, _isObject, _isString } from \"./utils.js\";\n\n//#region src/messages/block_translators/data.ts\nfunction convertToV1FromDataContentBlock(block) {\n\tif (isURLContentBlock(block)) return {\n\t\ttype: block.type,\n\t\tmimeType: block.mime_type,\n\t\turl: block.url,\n\t\tmetadata: block.metadata\n\t};\n\tif (isBase64ContentBlock(block)) return {\n\t\ttype: block.type,\n\t\tmimeType: block.mime_type ?? \"application/octet-stream\",\n\t\tdata: block.data,\n\t\tmetadata: block.metadata\n\t};\n\tif (isIDContentBlock(block)) return {\n\t\ttype: block.type,\n\t\tmimeType: block.mime_type,\n\t\tfileId: block.id,\n\t\tmetadata: block.metadata\n\t};\n\treturn block;\n}\nfunction convertToV1FromDataContent(content) {\n\treturn content.map(convertToV1FromDataContentBlock);\n}\nfunction isOpenAIDataBlock(block) {\n\tif (_isContentBlock(block, \"image_url\") && _isObject(block.image_url)) return true;\n\tif (_isContentBlock(block, \"input_audio\") && _isObject(block.input_audio)) return true;\n\tif (_isContentBlock(block, \"file\") && _isObject(block.file)) return true;\n\treturn false;\n}\nfunction convertToV1FromOpenAIDataBlock(block) {\n\tif (_isContentBlock(block, \"image_url\") && _isObject(block.image_url) && _isString(block.image_url.url)) {\n\t\tconst parsed = parseBase64DataUrl({ dataUrl: block.image_url.url });\n\t\tif (parsed) return {\n\t\t\ttype: \"image\",\n\t\t\tmimeType: parsed.mime_type,\n\t\t\tdata: parsed.data\n\t\t};\n\t\telse return {\n\t\t\ttype: \"image\",\n\t\t\turl: block.image_url.url\n\t\t};\n\t} else if (_isContentBlock(block, \"input_audio\") && _isObject(block.input_audio) && _isString(block.input_audio.data) && _isString(block.input_audio.format)) return {\n\t\ttype: \"audio\",\n\t\tdata: block.input_audio.data,\n\t\tmimeType: `audio/${block.input_audio.format}`\n\t};\n\telse if (_isContentBlock(block, \"file\") && _isObject(block.file) && _isString(block.file.data)) {\n\t\tconst parsed = parseBase64DataUrl({ dataUrl: block.file.data });\n\t\tif (parsed) return {\n\t\t\ttype: \"file\",\n\t\t\tdata: parsed.data,\n\t\t\tmimeType: parsed.mime_type\n\t\t};\n\t\telse if (_isString(block.file.file_id)) return {\n\t\t\ttype: \"file\",\n\t\t\tfileId: block.file.file_id\n\t\t};\n\t}\n\treturn block;\n}\n\n//#endregion\nexport { convertToV1FromDataContent, convertToV1FromOpenAIDataBlock, isOpenAIDataBlock };\n//# sourceMappingURL=data.js.map","import { _isArray, _isContentBlock, _isObject, _isString, iife } from \"./utils.js\";\nimport { convertToV1FromOpenAIDataBlock, isOpenAIDataBlock } from \"./data.js\";\n\n//#region src/messages/block_translators/openai.ts\n/**\n* Converts a ChatOpenAICompletions message to an array of v1 standard content blocks.\n*\n* This function processes an AI message from ChatOpenAICompletions API format\n* and converts it to the standardized v1 content block format. It handles both\n* string content and structured content blocks, as well as tool calls.\n*\n* @param message - The AI message containing ChatOpenAICompletions formatted content\n* @returns Array of content blocks in v1 standard format\n*\n* @example\n* ```typescript\n* const message = new AIMessage(\"Hello world\");\n* const standardBlocks = convertToV1FromChatCompletions(message);\n* // Returns: [{ type: \"text\", text: \"Hello world\" }]\n* ```\n*\n* @example\n* ```typescript\n* const message = new AIMessage([\n* { type: \"text\", text: \"Hello\" },\n* { type: \"image_url\", image_url: { url: \"https://example.com/image.png\" } }\n* ]);\n* message.tool_calls = [\n* { id: \"call_123\", name: \"calculator\", args: { a: 1, b: 2 } }\n* ];\n*\n* const standardBlocks = convertToV1FromChatCompletions(message);\n* // Returns:\n* // [\n* // { type: \"text\", text: \"Hello\" },\n* // { type: \"image\", url: \"https://example.com/image.png\" },\n* // { type: \"tool_call\", id: \"call_123\", name: \"calculator\", args: { a: 1, b: 2 } }\n* // ]\n* ```\n*/\nfunction convertToV1FromChatCompletions(message) {\n\tconst blocks = [];\n\tif (typeof message.content === \"string\") blocks.push({\n\t\ttype: \"text\",\n\t\ttext: message.content\n\t});\n\telse blocks.push(...convertToV1FromChatCompletionsInput(message.content));\n\tfor (const toolCall of message.tool_calls ?? []) blocks.push({\n\t\ttype: \"tool_call\",\n\t\tid: toolCall.id,\n\t\tname: toolCall.name,\n\t\targs: toolCall.args\n\t});\n\treturn blocks;\n}\n/**\n* Converts a ChatOpenAICompletions message chunk to an array of v1 standard content blocks.\n*\n* This function processes an AI message chunk from OpenAI's chat completions API and converts\n* it to the standardized v1 content block format. It handles both string and array content,\n* as well as tool calls that may be present in the chunk.\n*\n* @param message - The AI message chunk containing OpenAI-formatted content blocks\n* @returns Array of content blocks in v1 standard format\n*\n* @example\n* ```typescript\n* const chunk = new AIMessage(\"Hello\");\n* const standardBlocks = convertToV1FromChatCompletionsChunk(chunk);\n* // Returns: [{ type: \"text\", text: \"Hello\" }]\n* ```\n*\n* @example\n* ```typescript\n* const chunk = new AIMessage([\n* { type: \"text\", text: \"Processing...\" }\n* ]);\n* chunk.tool_calls = [\n* { id: \"call_456\", name: \"search\", args: { query: \"test\" } }\n* ];\n*\n* const standardBlocks = convertToV1FromChatCompletionsChunk(chunk);\n* // Returns:\n* // [\n* // { type: \"text\", text: \"Processing...\" },\n* // { type: \"tool_call\", id: \"call_456\", name: \"search\", args: { query: \"test\" } }\n* // ]\n* ```\n*/\nfunction convertToV1FromChatCompletionsChunk(message) {\n\tconst blocks = [];\n\tif (typeof message.content === \"string\") blocks.push({\n\t\ttype: \"text\",\n\t\ttext: message.content\n\t});\n\telse blocks.push(...convertToV1FromChatCompletionsInput(message.content));\n\tfor (const toolCall of message.tool_calls ?? []) blocks.push({\n\t\ttype: \"tool_call\",\n\t\tid: toolCall.id,\n\t\tname: toolCall.name,\n\t\targs: toolCall.args\n\t});\n\treturn blocks;\n}\n/**\n* Converts an array of ChatOpenAICompletions content blocks to v1 standard content blocks.\n*\n* This function processes content blocks from OpenAI's Chat Completions API format\n* and converts them to the standardized v1 content block format. It handles both\n* OpenAI-specific data blocks (which require conversion) and standard blocks\n* (which are passed through with type assertion).\n*\n* @param blocks - Array of content blocks in ChatOpenAICompletions format\n* @returns Array of content blocks in v1 standard format\n*\n* @example\n* ```typescript\n* const openaiBlocks = [\n* { type: \"text\", text: \"Hello world\" },\n* { type: \"image_url\", image_url: { url: \"https://example.com/image.png\" } }\n* ];\n*\n* const standardBlocks = convertToV1FromChatCompletionsInput(openaiBlocks);\n* // Returns:\n* // [\n* // { type: \"text\", text: \"Hello world\" },\n* // { type: \"image\", url: \"https://example.com/image.png\" }\n* // ]\n* ```\n*/\nfunction convertToV1FromChatCompletionsInput(blocks) {\n\tconst convertedBlocks = [];\n\tfor (const block of blocks) if (isOpenAIDataBlock(block)) convertedBlocks.push(convertToV1FromOpenAIDataBlock(block));\n\telse convertedBlocks.push(block);\n\treturn convertedBlocks;\n}\nfunction convertResponsesAnnotation(annotation) {\n\tif (annotation.type === \"url_citation\") {\n\t\tconst { url, title, start_index, end_index } = annotation;\n\t\treturn {\n\t\t\ttype: \"citation\",\n\t\t\turl,\n\t\t\ttitle,\n\t\t\tstartIndex: start_index,\n\t\t\tendIndex: end_index\n\t\t};\n\t}\n\tif (annotation.type === \"file_citation\") {\n\t\tconst { file_id, filename, index } = annotation;\n\t\treturn {\n\t\t\ttype: \"citation\",\n\t\t\ttitle: filename,\n\t\t\tstartIndex: index,\n\t\t\tendIndex: index,\n\t\t\tfileId: file_id\n\t\t};\n\t}\n\treturn annotation;\n}\n/**\n* Converts a ChatOpenAIResponses message to an array of v1 standard content blocks.\n*\n* This function processes an AI message containing OpenAI Responses-specific content blocks\n* and converts them to the standardized v1 content block format. It handles reasoning summaries,\n* text content with annotations, tool calls, and various tool outputs including code interpreter,\n* web search, file search, computer calls, and MCP-related blocks.\n*\n* @param message - The AI message containing OpenAI Responses-formatted content blocks\n* @returns Array of content blocks in v1 standard format\n*\n* @example\n* ```typescript\n* const message = new AIMessage({\n* content: [{ type: \"text\", text: \"Hello world\", annotations: [] }],\n* tool_calls: [{ id: \"123\", name: \"calculator\", args: { a: 1, b: 2 } }],\n* additional_kwargs: {\n* reasoning: { summary: [{ text: \"Let me calculate this...\" }] },\n* tool_outputs: [\n* {\n* type: \"code_interpreter_call\",\n* code: \"print('hello')\",\n* outputs: [{ type: \"logs\", logs: \"hello\" }]\n* }\n* ]\n* }\n* });\n*\n* const standardBlocks = convertToV1FromResponses(message);\n* // Returns:\n* // [\n* // { type: \"reasoning\", reasoning: \"Let me calculate this...\" },\n* // { type: \"text\", text: \"Hello world\", annotations: [] },\n* // { type: \"tool_call\", id: \"123\", name: \"calculator\", args: { a: 1, b: 2 } },\n* // { type: \"code_interpreter_call\", code: \"print('hello')\" },\n* // { type: \"code_interpreter_result\", output: [{ type: \"code_interpreter_output\", returnCode: 0, stdout: \"hello\" }] }\n* // ]\n* ```\n*/\nfunction convertToV1FromResponses(message) {\n\tfunction* iterateContent() {\n\t\tif (_isObject(message.additional_kwargs?.reasoning) && _isArray(message.additional_kwargs.reasoning.summary)) {\n\t\t\tconst summary = message.additional_kwargs.reasoning.summary.reduce((acc, item) => {\n\t\t\t\tif (_isObject(item) && _isString(item.text)) return `${acc}${item.text}`;\n\t\t\t\treturn acc;\n\t\t\t}, \"\");\n\t\t\tyield {\n\t\t\t\ttype: \"reasoning\",\n\t\t\t\treasoning: summary\n\t\t\t};\n\t\t}\n\t\tconst content = typeof message.content === \"string\" ? [{\n\t\t\ttype: \"text\",\n\t\t\ttext: message.content\n\t\t}] : message.content;\n\t\tfor (const block of content) if (_isContentBlock(block, \"text\")) {\n\t\t\tconst { text, annotations,...rest } = block;\n\t\t\tif (Array.isArray(annotations)) yield {\n\t\t\t\t...rest,\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: String(text),\n\t\t\t\tannotations: annotations.map(convertResponsesAnnotation)\n\t\t\t};\n\t\t\telse yield {\n\t\t\t\t...rest,\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: String(text)\n\t\t\t};\n\t\t}\n\t\tfor (const toolCall of message.tool_calls ?? []) yield {\n\t\t\ttype: \"tool_call\",\n\t\t\tid: toolCall.id,\n\t\t\tname: toolCall.name,\n\t\t\targs: toolCall.args\n\t\t};\n\t\tif (_isObject(message.additional_kwargs) && _isArray(message.additional_kwargs.tool_outputs)) for (const toolOutput of message.additional_kwargs.tool_outputs) {\n\t\t\tif (_isContentBlock(toolOutput, \"web_search_call\")) {\n\t\t\t\tyield {\n\t\t\t\t\tid: toolOutput.id,\n\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\tname: \"web_search\",\n\t\t\t\t\targs: { query: toolOutput.query }\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(toolOutput, \"file_search_call\")) {\n\t\t\t\tyield {\n\t\t\t\t\tid: toolOutput.id,\n\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\tname: \"file_search\",\n\t\t\t\t\targs: { query: toolOutput.query }\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(toolOutput, \"computer_call\")) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"non_standard\",\n\t\t\t\t\tvalue: toolOutput\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(toolOutput, \"code_interpreter_call\")) {\n\t\t\t\tif (_isString(toolOutput.code)) yield {\n\t\t\t\t\tid: toolOutput.id,\n\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\tname: \"code_interpreter\",\n\t\t\t\t\targs: { code: toolOutput.code }\n\t\t\t\t};\n\t\t\t\tif (_isArray(toolOutput.outputs)) {\n\t\t\t\t\tconst returnCode = iife(() => {\n\t\t\t\t\t\tif (toolOutput.status === \"in_progress\") return void 0;\n\t\t\t\t\t\tif (toolOutput.status === \"completed\") return 0;\n\t\t\t\t\t\tif (toolOutput.status === \"incomplete\") return 127;\n\t\t\t\t\t\tif (toolOutput.status === \"interpreting\") return void 0;\n\t\t\t\t\t\tif (toolOutput.status === \"failed\") return 1;\n\t\t\t\t\t\treturn void 0;\n\t\t\t\t\t});\n\t\t\t\t\tfor (const output of toolOutput.outputs) if (_isContentBlock(output, \"logs\")) {\n\t\t\t\t\t\tyield {\n\t\t\t\t\t\t\ttype: \"server_tool_call_result\",\n\t\t\t\t\t\t\ttoolCallId: toolOutput.id ?? \"\",\n\t\t\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\t\t\toutput: {\n\t\t\t\t\t\t\t\ttype: \"code_interpreter_output\",\n\t\t\t\t\t\t\t\treturnCode: returnCode ?? 0,\n\t\t\t\t\t\t\t\tstderr: [0, void 0].includes(returnCode) ? void 0 : String(output.logs),\n\t\t\t\t\t\t\t\tstdout: [0, void 0].includes(returnCode) ? String(output.logs) : void 0\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(toolOutput, \"mcp_call\")) {\n\t\t\t\tyield {\n\t\t\t\t\tid: toolOutput.id,\n\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\tname: \"mcp_call\",\n\t\t\t\t\targs: toolOutput.input\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(toolOutput, \"mcp_list_tools\")) {\n\t\t\t\tyield {\n\t\t\t\t\tid: toolOutput.id,\n\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\tname: \"mcp_list_tools\",\n\t\t\t\t\targs: toolOutput.input\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(toolOutput, \"mcp_approval_request\")) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"non_standard\",\n\t\t\t\t\tvalue: toolOutput\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(toolOutput, \"image_generation_call\")) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"non_standard\",\n\t\t\t\t\tvalue: toolOutput\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (_isObject(toolOutput)) yield {\n\t\t\t\ttype: \"non_standard\",\n\t\t\t\tvalue: toolOutput\n\t\t\t};\n\t\t}\n\t}\n\treturn Array.from(iterateContent());\n}\n/**\n* Converts a ChatOpenAIResponses message chunk to an array of v1 standard content blocks.\n*\n* This function processes an AI message chunk containing OpenAI-specific content blocks\n* and converts them to the standardized v1 content block format. It handles both the\n* regular message content and tool call chunks that are specific to streaming responses.\n*\n* @param message - The AI message chunk containing OpenAI-formatted content blocks\n* @returns Array of content blocks in v1 standard format\n*\n* @example\n* ```typescript\n* const messageChunk = new AIMessageChunk({\n* content: [{ type: \"text\", text: \"Hello\" }],\n* tool_call_chunks: [\n* { id: \"call_123\", name: \"calculator\", args: '{\"a\": 1' }\n* ]\n* });\n*\n* const standardBlocks = convertToV1FromResponsesChunk(messageChunk);\n* // Returns:\n* // [\n* // { type: \"text\", text: \"Hello\" },\n* // { type: \"tool_call_chunk\", id: \"call_123\", name: \"calculator\", args: '{\"a\": 1' }\n* // ]\n* ```\n*/\nfunction convertToV1FromResponsesChunk(message) {\n\tfunction* iterateContent() {\n\t\tyield* convertToV1FromResponses(message);\n\t\tfor (const toolCallChunk of message.tool_call_chunks ?? []) yield {\n\t\t\ttype: \"tool_call_chunk\",\n\t\t\tid: toolCallChunk.id,\n\t\t\tname: toolCallChunk.name,\n\t\t\targs: toolCallChunk.args\n\t\t};\n\t}\n\treturn Array.from(iterateContent());\n}\nconst ChatOpenAITranslator = {\n\ttranslateContent: (message) => {\n\t\tif (typeof message.content === \"string\") return convertToV1FromChatCompletions(message);\n\t\treturn convertToV1FromResponses(message);\n\t},\n\ttranslateContentChunk: (message) => {\n\t\tif (typeof message.content === \"string\") return convertToV1FromChatCompletionsChunk(message);\n\t\treturn convertToV1FromResponsesChunk(message);\n\t}\n};\n\n//#endregion\nexport { ChatOpenAITranslator, convertToV1FromChatCompletionsInput };\n//# sourceMappingURL=openai.js.map","//#region src/messages/message.ts\n/**\n* Type guard to check if a value is a valid Message object.\n*\n* @param message - The value to check\n* @returns true if the value is a valid Message object, false otherwise\n*/\nfunction isMessage(message) {\n\treturn typeof message === \"object\" && message !== null && \"type\" in message && \"content\" in message && (typeof message.content === \"string\" || Array.isArray(message.content));\n}\n\n//#endregion\nexport { isMessage };\n//# sourceMappingURL=message.js.map","//#region src/messages/format.ts\nfunction convertToFormattedString(message, format = \"pretty\") {\n\tif (format === \"pretty\") return convertToPrettyString(message);\n\treturn JSON.stringify(message);\n}\nfunction convertToPrettyString(message) {\n\tconst lines = [];\n\tconst title = ` ${message.type.charAt(0).toUpperCase() + message.type.slice(1)} Message `;\n\tconst sepLen = Math.floor((80 - title.length) / 2);\n\tconst sep = \"=\".repeat(sepLen);\n\tconst secondSep = title.length % 2 === 0 ? sep : `${sep}=`;\n\tlines.push(`${sep}${title}${secondSep}`);\n\tif (message.type === \"ai\") {\n\t\tconst aiMessage = message;\n\t\tif (aiMessage.tool_calls && aiMessage.tool_calls.length > 0) {\n\t\t\tlines.push(\"Tool Calls:\");\n\t\t\tfor (const tc of aiMessage.tool_calls) {\n\t\t\t\tlines.push(` ${tc.name} (${tc.id})`);\n\t\t\t\tlines.push(` Call ID: ${tc.id}`);\n\t\t\t\tlines.push(\" Args:\");\n\t\t\t\tfor (const [key, value] of Object.entries(tc.args)) lines.push(` ${key}: ${typeof value === \"object\" ? JSON.stringify(value) : value}`);\n\t\t\t}\n\t\t}\n\t}\n\tif (message.type === \"tool\") {\n\t\tconst toolMessage = message;\n\t\tif (toolMessage.name) lines.push(`Name: ${toolMessage.name}`);\n\t}\n\tif (typeof message.content === \"string\" && message.content.trim()) {\n\t\tif (lines.length > 1) lines.push(\"\");\n\t\tlines.push(message.content);\n\t}\n\treturn lines.join(\"\\n\");\n}\n\n//#endregion\nexport { convertToFormattedString };\n//# sourceMappingURL=format.js.map","import { Serializable } from \"../load/serializable.js\";\nimport { isDataContentBlock } from \"./content/data.js\";\nimport { convertToV1FromAnthropicInput } from \"./block_translators/anthropic.js\";\nimport { convertToV1FromDataContent } from \"./block_translators/data.js\";\nimport { convertToV1FromChatCompletionsInput } from \"./block_translators/openai.js\";\nimport { isMessage } from \"./message.js\";\nimport { convertToFormattedString } from \"./format.js\";\n\n//#region src/messages/base.ts\n/** @internal */\nconst MESSAGE_SYMBOL = Symbol.for(\"langchain.message\");\nfunction mergeContent(firstContent, secondContent) {\n\tif (typeof firstContent === \"string\") {\n\t\tif (firstContent === \"\") return secondContent;\n\t\tif (typeof secondContent === \"string\") return firstContent + secondContent;\n\t\telse if (Array.isArray(secondContent) && secondContent.length === 0) return firstContent;\n\t\telse if (Array.isArray(secondContent) && secondContent.some((c) => isDataContentBlock(c))) return [{\n\t\t\ttype: \"text\",\n\t\t\tsource_type: \"text\",\n\t\t\ttext: firstContent\n\t\t}, ...secondContent];\n\t\telse return [{\n\t\t\ttype: \"text\",\n\t\t\ttext: firstContent\n\t\t}, ...secondContent];\n\t} else if (Array.isArray(secondContent)) return _mergeLists(firstContent, secondContent) ?? [...firstContent, ...secondContent];\n\telse if (secondContent === \"\") return firstContent;\n\telse if (Array.isArray(firstContent) && firstContent.some((c) => isDataContentBlock(c))) return [...firstContent, {\n\t\ttype: \"file\",\n\t\tsource_type: \"text\",\n\t\ttext: secondContent\n\t}];\n\telse return [...firstContent, {\n\t\ttype: \"text\",\n\t\ttext: secondContent\n\t}];\n}\n/**\n* 'Merge' two statuses. If either value passed is 'error', it will return 'error'. Else\n* it will return 'success'.\n*\n* @param {\"success\" | \"error\" | undefined} left The existing value to 'merge' with the new value.\n* @param {\"success\" | \"error\" | undefined} right The new value to 'merge' with the existing value\n* @returns {\"success\" | \"error\"} The 'merged' value.\n*/\nfunction _mergeStatus(left, right) {\n\tif (left === \"error\" || right === \"error\") return \"error\";\n\treturn \"success\";\n}\nfunction stringifyWithDepthLimit(obj, depthLimit) {\n\tfunction helper(obj$1, currentDepth) {\n\t\tif (typeof obj$1 !== \"object\" || obj$1 === null || obj$1 === void 0) return obj$1;\n\t\tif (currentDepth >= depthLimit) {\n\t\t\tif (Array.isArray(obj$1)) return \"[Array]\";\n\t\t\treturn \"[Object]\";\n\t\t}\n\t\tif (Array.isArray(obj$1)) return obj$1.map((item) => helper(item, currentDepth + 1));\n\t\tconst result = {};\n\t\tfor (const key of Object.keys(obj$1)) result[key] = helper(obj$1[key], currentDepth + 1);\n\t\treturn result;\n\t}\n\treturn JSON.stringify(helper(obj, 0), null, 2);\n}\n/**\n* Base class for all types of messages in a conversation. It includes\n* properties like `content`, `name`, and `additional_kwargs`. It also\n* includes methods like `toDict()` and `_getType()`.\n*/\nvar BaseMessage = class extends Serializable {\n\tlc_namespace = [\"langchain_core\", \"messages\"];\n\tlc_serializable = true;\n\tget lc_aliases() {\n\t\treturn {\n\t\t\tadditional_kwargs: \"additional_kwargs\",\n\t\t\tresponse_metadata: \"response_metadata\"\n\t\t};\n\t}\n\t[MESSAGE_SYMBOL] = true;\n\tid;\n\tname;\n\tcontent;\n\tadditional_kwargs;\n\tresponse_metadata;\n\t/**\n\t* @deprecated Use .getType() instead or import the proper typeguard.\n\t* For example:\n\t*\n\t* ```ts\n\t* import { isAIMessage } from \"@langchain/core/messages\";\n\t*\n\t* const message = new AIMessage(\"Hello!\");\n\t* isAIMessage(message); // true\n\t* ```\n\t*/\n\t_getType() {\n\t\treturn this.type;\n\t}\n\t/**\n\t* @deprecated Use .type instead\n\t* The type of the message.\n\t*/\n\tgetType() {\n\t\treturn this._getType();\n\t}\n\tconstructor(arg) {\n\t\tconst fields = typeof arg === \"string\" || Array.isArray(arg) ? { content: arg } : arg;\n\t\tif (!fields.additional_kwargs) fields.additional_kwargs = {};\n\t\tif (!fields.response_metadata) fields.response_metadata = {};\n\t\tsuper(fields);\n\t\tthis.name = fields.name;\n\t\tif (fields.content === void 0 && fields.contentBlocks !== void 0) {\n\t\t\tthis.content = fields.contentBlocks;\n\t\t\tthis.response_metadata = {\n\t\t\t\toutput_version: \"v1\",\n\t\t\t\t...fields.response_metadata\n\t\t\t};\n\t\t} else if (fields.content !== void 0) {\n\t\t\tthis.content = fields.content ?? [];\n\t\t\tthis.response_metadata = fields.response_metadata;\n\t\t} else {\n\t\t\tthis.content = [];\n\t\t\tthis.response_metadata = fields.response_metadata;\n\t\t}\n\t\tthis.additional_kwargs = fields.additional_kwargs;\n\t\tthis.id = fields.id;\n\t}\n\t/** Get text content of the message. */\n\tget text() {\n\t\tif (typeof this.content === \"string\") return this.content;\n\t\tif (!Array.isArray(this.content)) return \"\";\n\t\treturn this.content.map((c) => {\n\t\t\tif (typeof c === \"string\") return c;\n\t\t\tif (c.type === \"text\") return c.text;\n\t\t\treturn \"\";\n\t\t}).join(\"\");\n\t}\n\tget contentBlocks() {\n\t\tconst blocks = typeof this.content === \"string\" ? [{\n\t\t\ttype: \"text\",\n\t\t\ttext: this.content\n\t\t}] : this.content;\n\t\tconst parsingSteps = [\n\t\t\tconvertToV1FromDataContent,\n\t\t\tconvertToV1FromChatCompletionsInput,\n\t\t\tconvertToV1FromAnthropicInput\n\t\t];\n\t\tconst parsedBlocks = parsingSteps.reduce((blocks$1, step) => step(blocks$1), blocks);\n\t\treturn parsedBlocks;\n\t}\n\ttoDict() {\n\t\treturn {\n\t\t\ttype: this.getType(),\n\t\t\tdata: this.toJSON().kwargs\n\t\t};\n\t}\n\tstatic lc_name() {\n\t\treturn \"BaseMessage\";\n\t}\n\tget _printableFields() {\n\t\treturn {\n\t\t\tid: this.id,\n\t\t\tcontent: this.content,\n\t\t\tname: this.name,\n\t\t\tadditional_kwargs: this.additional_kwargs,\n\t\t\tresponse_metadata: this.response_metadata\n\t\t};\n\t}\n\tstatic isInstance(obj) {\n\t\treturn typeof obj === \"object\" && obj !== null && MESSAGE_SYMBOL in obj && obj[MESSAGE_SYMBOL] === true && isMessage(obj);\n\t}\n\t_updateId(value) {\n\t\tthis.id = value;\n\t\tthis.lc_kwargs.id = value;\n\t}\n\tget [Symbol.toStringTag]() {\n\t\treturn this.constructor.lc_name();\n\t}\n\t[Symbol.for(\"nodejs.util.inspect.custom\")](depth) {\n\t\tif (depth === null) return this;\n\t\tconst printable = stringifyWithDepthLimit(this._printableFields, Math.max(4, depth));\n\t\treturn `${this.constructor.lc_name()} ${printable}`;\n\t}\n\ttoFormattedString(format = \"pretty\") {\n\t\treturn convertToFormattedString(this, format);\n\t}\n};\nfunction isOpenAIToolCallArray(value) {\n\treturn Array.isArray(value) && value.every((v) => typeof v.index === \"number\");\n}\nfunction _mergeDicts(left = {}, right = {}) {\n\tconst merged = { ...left };\n\tfor (const [key, value] of Object.entries(right)) if (merged[key] == null) merged[key] = value;\n\telse if (value == null) continue;\n\telse if (typeof merged[key] !== typeof value || Array.isArray(merged[key]) !== Array.isArray(value)) throw new Error(`field[${key}] already exists in the message chunk, but with a different type.`);\n\telse if (typeof merged[key] === \"string\") if (key === \"type\") continue;\n\telse if ([\n\t\t\"id\",\n\t\t\"name\",\n\t\t\"output_version\",\n\t\t\"model_provider\"\n\t].includes(key)) {\n\t\tif (value) merged[key] = value;\n\t} else merged[key] += value;\n\telse if (typeof merged[key] === \"object\" && !Array.isArray(merged[key])) merged[key] = _mergeDicts(merged[key], value);\n\telse if (Array.isArray(merged[key])) merged[key] = _mergeLists(merged[key], value);\n\telse if (merged[key] === value) continue;\n\telse console.warn(`field[${key}] already exists in this message chunk and value has unsupported type.`);\n\treturn merged;\n}\nfunction _mergeLists(left, right) {\n\tif (left === void 0 && right === void 0) return void 0;\n\telse if (left === void 0 || right === void 0) return left || right;\n\telse {\n\t\tconst merged = [...left];\n\t\tfor (const item of right) if (typeof item === \"object\" && item !== null && \"index\" in item && typeof item.index === \"number\") {\n\t\t\tconst toMerge = merged.findIndex((leftItem) => {\n\t\t\t\tconst isObject = typeof leftItem === \"object\";\n\t\t\t\tconst indiciesMatch = \"index\" in leftItem && leftItem.index === item.index;\n\t\t\t\tconst idsMatch = \"id\" in leftItem && \"id\" in item && leftItem?.id === item?.id;\n\t\t\t\tconst eitherItemMissingID = !(\"id\" in leftItem) || !leftItem?.id || !(\"id\" in item) || !item?.id;\n\t\t\t\treturn isObject && indiciesMatch && (idsMatch || eitherItemMissingID);\n\t\t\t});\n\t\t\tif (toMerge !== -1 && typeof merged[toMerge] === \"object\" && merged[toMerge] !== null) merged[toMerge] = _mergeDicts(merged[toMerge], item);\n\t\t\telse merged.push(item);\n\t\t} else if (typeof item === \"object\" && item !== null && \"text\" in item && item.text === \"\") continue;\n\t\telse merged.push(item);\n\t\treturn merged;\n\t}\n}\nfunction _mergeObj(left, right) {\n\tif (left === void 0 && right === void 0) return void 0;\n\tif (left === void 0 || right === void 0) return left ?? right;\n\telse if (typeof left !== typeof right) throw new Error(`Cannot merge objects of different types.\\nLeft ${typeof left}\\nRight ${typeof right}`);\n\telse if (typeof left === \"string\" && typeof right === \"string\") return left + right;\n\telse if (Array.isArray(left) && Array.isArray(right)) return _mergeLists(left, right);\n\telse if (typeof left === \"object\" && typeof right === \"object\") return _mergeDicts(left, right);\n\telse if (left === right) return left;\n\telse throw new Error(`Can not merge objects of different types.\\nLeft ${left}\\nRight ${right}`);\n}\n/**\n* Represents a chunk of a message, which can be concatenated with other\n* message chunks. It includes a method `_merge_kwargs_dict()` for merging\n* additional keyword arguments from another `BaseMessageChunk` into this\n* one. It also overrides the `__add__()` method to support concatenation\n* of `BaseMessageChunk` instances.\n*/\nvar BaseMessageChunk = class BaseMessageChunk extends BaseMessage {\n\tstatic isInstance(obj) {\n\t\tif (!super.isInstance(obj)) return false;\n\t\tlet proto = Object.getPrototypeOf(obj);\n\t\twhile (proto !== null) {\n\t\t\tif (proto === BaseMessageChunk.prototype) return true;\n\t\t\tproto = Object.getPrototypeOf(proto);\n\t\t}\n\t\treturn false;\n\t}\n};\nfunction _isMessageFieldWithRole(x) {\n\treturn typeof x.role === \"string\";\n}\n/**\n* @deprecated Use {@link BaseMessage.isInstance} instead\n*/\nfunction isBaseMessage(messageLike) {\n\treturn typeof messageLike?._getType === \"function\";\n}\n/**\n* @deprecated Use {@link BaseMessageChunk.isInstance} instead\n*/\nfunction isBaseMessageChunk(messageLike) {\n\treturn BaseMessageChunk.isInstance(messageLike);\n}\n\n//#endregion\nexport { BaseMessage, BaseMessageChunk, _isMessageFieldWithRole, _mergeDicts, _mergeLists, _mergeObj, _mergeStatus, isBaseMessage, isBaseMessageChunk, isOpenAIToolCallArray, mergeContent };\n//# sourceMappingURL=base.js.map","import { __export } from \"../_virtual/rolldown_runtime.js\";\nimport { BaseMessage, BaseMessageChunk, _mergeDicts, _mergeObj, _mergeStatus, mergeContent } from \"./base.js\";\n\n//#region src/messages/tool.ts\nvar tool_exports = {};\n__export(tool_exports, {\n\tToolMessage: () => ToolMessage,\n\tToolMessageChunk: () => ToolMessageChunk,\n\tdefaultToolCallParser: () => defaultToolCallParser,\n\tisDirectToolOutput: () => isDirectToolOutput,\n\tisToolMessage: () => isToolMessage,\n\tisToolMessageChunk: () => isToolMessageChunk\n});\nfunction isDirectToolOutput(x) {\n\treturn x != null && typeof x === \"object\" && \"lc_direct_tool_output\" in x && x.lc_direct_tool_output === true;\n}\n/**\n* Represents a tool message in a conversation.\n*/\nvar ToolMessage = class extends BaseMessage {\n\tstatic lc_name() {\n\t\treturn \"ToolMessage\";\n\t}\n\tget lc_aliases() {\n\t\treturn { tool_call_id: \"tool_call_id\" };\n\t}\n\tlc_direct_tool_output = true;\n\ttype = \"tool\";\n\t/**\n\t* Status of the tool invocation.\n\t* @version 0.2.19\n\t*/\n\tstatus;\n\ttool_call_id;\n\tmetadata;\n\t/**\n\t* Artifact of the Tool execution which is not meant to be sent to the model.\n\t*\n\t* Should only be specified if it is different from the message content, e.g. if only\n\t* a subset of the full tool output is being passed as message content but the full\n\t* output is needed in other parts of the code.\n\t*/\n\tartifact;\n\tconstructor(fields, tool_call_id, name) {\n\t\tconst toolMessageFields = typeof fields === \"string\" || Array.isArray(fields) ? {\n\t\t\tcontent: fields,\n\t\t\tname,\n\t\t\ttool_call_id\n\t\t} : fields;\n\t\tsuper(toolMessageFields);\n\t\tthis.tool_call_id = toolMessageFields.tool_call_id;\n\t\tthis.artifact = toolMessageFields.artifact;\n\t\tthis.status = toolMessageFields.status;\n\t\tthis.metadata = toolMessageFields.metadata;\n\t}\n\tstatic isInstance(message) {\n\t\treturn super.isInstance(message) && message.type === \"tool\";\n\t}\n\tget _printableFields() {\n\t\treturn {\n\t\t\t...super._printableFields,\n\t\t\ttool_call_id: this.tool_call_id,\n\t\t\tartifact: this.artifact\n\t\t};\n\t}\n};\n/**\n* Represents a chunk of a tool message, which can be concatenated\n* with other tool message chunks.\n*/\nvar ToolMessageChunk = class extends BaseMessageChunk {\n\ttype = \"tool\";\n\ttool_call_id;\n\t/**\n\t* Status of the tool invocation.\n\t* @version 0.2.19\n\t*/\n\tstatus;\n\t/**\n\t* Artifact of the Tool execution which is not meant to be sent to the model.\n\t*\n\t* Should only be specified if it is different from the message content, e.g. if only\n\t* a subset of the full tool output is being passed as message content but the full\n\t* output is needed in other parts of the code.\n\t*/\n\tartifact;\n\tconstructor(fields) {\n\t\tsuper(fields);\n\t\tthis.tool_call_id = fields.tool_call_id;\n\t\tthis.artifact = fields.artifact;\n\t\tthis.status = fields.status;\n\t}\n\tstatic lc_name() {\n\t\treturn \"ToolMessageChunk\";\n\t}\n\tconcat(chunk) {\n\t\tconst Cls = this.constructor;\n\t\treturn new Cls({\n\t\t\tcontent: mergeContent(this.content, chunk.content),\n\t\t\tadditional_kwargs: _mergeDicts(this.additional_kwargs, chunk.additional_kwargs),\n\t\t\tresponse_metadata: _mergeDicts(this.response_metadata, chunk.response_metadata),\n\t\t\tartifact: _mergeObj(this.artifact, chunk.artifact),\n\t\t\ttool_call_id: this.tool_call_id,\n\t\t\tid: this.id ?? chunk.id,\n\t\t\tstatus: _mergeStatus(this.status, chunk.status)\n\t\t});\n\t}\n\tget _printableFields() {\n\t\treturn {\n\t\t\t...super._printableFields,\n\t\t\ttool_call_id: this.tool_call_id,\n\t\t\tartifact: this.artifact\n\t\t};\n\t}\n};\nfunction defaultToolCallParser(rawToolCalls) {\n\tconst toolCalls = [];\n\tconst invalidToolCalls = [];\n\tfor (const toolCall of rawToolCalls) if (!toolCall.function) continue;\n\telse {\n\t\tconst functionName = toolCall.function.name;\n\t\ttry {\n\t\t\tconst functionArgs = JSON.parse(toolCall.function.arguments);\n\t\t\ttoolCalls.push({\n\t\t\t\tname: functionName || \"\",\n\t\t\t\targs: functionArgs || {},\n\t\t\t\tid: toolCall.id\n\t\t\t});\n\t\t} catch {\n\t\t\tinvalidToolCalls.push({\n\t\t\t\tname: functionName,\n\t\t\t\targs: toolCall.function.arguments,\n\t\t\t\tid: toolCall.id,\n\t\t\t\terror: \"Malformed args.\"\n\t\t\t});\n\t\t}\n\t}\n\treturn [toolCalls, invalidToolCalls];\n}\n/**\n* @deprecated Use {@link ToolMessage.isInstance} instead\n*/\nfunction isToolMessage(x) {\n\treturn typeof x === \"object\" && x !== null && \"getType\" in x && typeof x.getType === \"function\" && x.getType() === \"tool\";\n}\n/**\n* @deprecated Use {@link ToolMessageChunk.isInstance} instead\n*/\nfunction isToolMessageChunk(x) {\n\treturn x._getType() === \"tool\";\n}\n\n//#endregion\nexport { ToolMessage, ToolMessageChunk, defaultToolCallParser, isDirectToolOutput, isToolMessage, isToolMessageChunk, tool_exports };\n//# sourceMappingURL=tool.js.map","import { type ToolCall } from '@langchain/core/messages/tool';\n\n/**\n * When an interrupt occurs during task execution, the system generates an InterruptPayload.\n```json\n{\n \"type\": \"event\",\n \"event\": \"on_interrupt\",\n \"data\": {\n \"tasks\": [\n {\n \"id\": \"9c4d2ac5-8808-5b6f-855c-4d48aa3d77a7\",\n \"name\": \"Middleware_wPzR2bIXqE_after_model\",\n \"path\": [\"__pregel_pull\", \"Middleware_wPzR2bIXqE_after_model\"],\n \"interrupts\": [\n {\n \"id\": \"b42f7887d65e57ed11cf08b8927763db\",\n \"value\": {\n \"toolCalls\": [\n {\n \"name\": \"getUserStation\",\n \"args\": {\n \"input\": \"Query the site selected by the user\"\n },\n \"id\": \"call_00_swcaUjIaACXOHHaZyNmQB3Vm\",\n \"type\": \"tool_call\"\n }\n ]\n }\n }\n ]\n }\n ]\n }\n}\n```\n */\nexport interface InterruptPayload {\n tasks: Array<{\n id: string;\n name: string;\n path: string[];\n interrupts: Array<{\n id: string;\n value: ClientToolRequest\n }>;\n }>;\n}\n\nexport interface ClientToolRequest {\n clientToolCalls: ToolCall[];\n}\n\nexport interface ClientToolMessageInput {\n content: unknown\n name?: string\n tool_call_id?: string\n status?: 'success' | 'error'\n artifact?: unknown\n}\n\nexport interface ClientToolResponse {\n toolMessages: ClientToolMessageInput[]\n}\n\nexport function isClientToolRequest(value: any): value is ClientToolRequest {\n return (\n value &&\n Array.isArray(value.clientToolCalls)\n );\n}","export enum ChatMessageTypeEnum {\n // LOG = 'log',\n MESSAGE = 'message',\n EVENT = 'event'\n}\n\n/**\n * https://js.langchain.com/docs/how_to/streaming/#event-reference\n */\nexport enum ChatMessageEventTypeEnum {\n ON_CONVERSATION_START = 'on_conversation_start',\n ON_CONVERSATION_END = 'on_conversation_end',\n ON_MESSAGE_START = 'on_message_start',\n ON_MESSAGE_END = 'on_message_end',\n ON_TOOL_START = 'on_tool_start',\n ON_TOOL_END = 'on_tool_end',\n ON_TOOL_ERROR = 'on_tool_error',\n /**\n * Step message in tool call\n */\n ON_TOOL_MESSAGE = 'on_tool_message',\n ON_AGENT_START = 'on_agent_start',\n ON_AGENT_END = 'on_agent_end',\n ON_RETRIEVER_START = 'on_retriever_start',\n ON_RETRIEVER_END = 'on_retriever_end',\n ON_RETRIEVER_ERROR = 'on_retriever_error',\n ON_INTERRUPT = 'on_interrupt',\n ON_ERROR = 'on_error',\n ON_CHAT_EVENT = 'on_chat_event',\n}\n\n/**\n * Category of step message: determines the display components of computer use\n */\nexport enum ChatMessageStepCategory {\n /**\n * List of items: urls, files, etc.\n */\n List = 'list',\n /**\n * Websearch results\n */\n WebSearch = 'web_search',\n /**\n * Files list\n */\n Files = 'files',\n /**\n * View a file\n */\n File = 'file',\n /**\n * Program Execution\n */\n Program = 'program',\n /**\n * Iframe\n */\n Iframe = 'iframe',\n\n Memory = 'memory',\n\n Tasks = 'tasks',\n\n /**\n * Knowledges (knowledge base retriever results)\n */\n Knowledges = 'knowledges'\n}\n\n/**\n * Step message type, in canvas and ai message.\n */\nexport type TChatMessageStep<T = any> = TMessageComponent<TMessageComponentStep<T>>\n\nexport type ImageDetail = \"auto\" | \"low\" | \"high\";\nexport type MessageContentText = {\n type: \"text\";\n text: string;\n};\nexport type MessageContentImageUrl = {\n type: \"image_url\";\n image_url: string | {\n url: string;\n detail?: ImageDetail;\n };\n};\n\n/**\n * Similar to {@link MessageContentText} | {@link MessageContentImageUrl}, which together form {@link MessageContentComplex}\n */\nexport type TMessageContentComponent<T extends object = object> = {\n id: string\n type: 'component'\n data: TMessageComponent<T>\n xpertName?: string\n agentKey?: string;\n}\n\n/**\n * Defines the data type of the sub-message of `component` type in the message `content` {@link MessageContentComplex}\n */\nexport type TMessageComponent<T extends object = object> = T & {\n id?: string\n category: 'Dashboard' | 'Computer' | 'Tool'\n type?: string\n created_date?: Date | string\n}\n\nexport type TMessageContentText = {\n id?: string\n xpertName?: string\n agentKey?: string\n type: \"text\";\n text: string;\n};\nexport type TMessageContentMemory = {\n id?: string\n agentKey?: string\n type: \"memory\";\n data: any[];\n};\nexport type TMessageContentReasoning = {\n id?: string\n xpertName?: string\n agentKey?: string\n type: \"reasoning\";\n text: string;\n};\n/**\n * Enhance {@link MessageContentComplex} in Langchain.js\n */\nexport type TMessageContentComplex = (TMessageContentText | TMessageContentReasoning | MessageContentImageUrl | TMessageContentComponent | TMessageContentMemory | (Record<string, any> & {\n type?: \"text\" | \"image_url\" | string;\n}) | (Record<string, any> & {\n type?: never;\n})) & {\n id?: string\n xpertName?: string\n agentKey?: string;\n created_date?: Date | string\n}\n\n/**\n * Enhance {@link MessageContent} in Langchain.js\n * \n * @deprecated use {@link TMessageItems} instead\n */\nexport type TMessageContent = string | TMessageContentComplex[];\n\nexport type TMessageComponentIframe = {\n type: 'iframe'\n title: string\n url?: string\n data?: {\n url?: string\n }\n}\n\nexport type TMessageComponentStep<T = unknown> = {\n type: ChatMessageStepCategory\n toolset: string\n toolset_id: string\n tool?: string\n title: string\n message: string\n status: 'success' | 'fail' | 'running'\n created_date: Date | string\n end_date: Date | string\n error?: string\n data?: T\n input?: any\n output?: string\n artifact?: any\n}\n\n/**\n * Data type for chat event message\n */\nexport type TChatEventMessage = {\n type?: string\n title?: string\n message?: string\n status?: 'success' | 'fail' | 'running'\n created_date?: Date | string\n end_date?: Date | string\n error?: string\n}\n\nexport interface ChatkitMessage {\n status?: string\n content: TMessageItems\n reasoning?: TMessageContentReasoning[]\n type: 'user' | 'assistant' | 'system' | 'tool' | 'event'\n id: string\n}\n\nexport type TMessageItems = TMessageContentComplex[];"],"names":["__defProp","camelcaseModule","Serializable","_a","BaseMessageChunk","ChatMessageTypeEnum","ChatMessageEventTypeEnum","ChatMessageStepCategory"],"mappings":";;;AAAA;AACA,IAAIA,aAAY,OAAO;AACvB,IAAI,WAAW,CAAC,QAAQ,QAAQ;AAC/B,WAAS,QAAQ,IAAK,CAAAA,WAAU,QAAQ,MAAM;AAAA,IAC7C,KAAK,IAAI,IAAI;AAAA,IACb,YAAY;AAAA,EACd,CAAE;AACF;;;;ACNA,IAAA,aAAiB,SAAU,KAAK,KAAK;AACpC,MAAI,OAAO,QAAQ,UAAU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AC1E,SACE,SACA,MAAM,QAAQ,MAAM,eAAe;AAEvC;ACtEO,IAAK,wCAAAC,yBAAL;AAELA,uBAAA,SAAA,IAAU;AACVA,uBAAA,OAAA,IAAQ;AAHE,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AASL,IAAK,6CAAAC,8BAAL;AACLA,4BAAA,uBAAA,IAAwB;AACxBA,4BAAA,qBAAA,IAAsB;AACtBA,4BAAA,kBAAA,IAAmB;AACnBA,4BAAA,gBAAA,IAAiB;AACjBA,4BAAA,eAAA,IAAgB;AAChBA,4BAAA,aAAA,IAAc;AACdA,4BAAA,eAAA,IAAgB;AAIhBA,4BAAA,iBAAA,IAAkB;AAClBA,4BAAA,gBAAA,IAAiB;AACjBA,4BAAA,cAAA,IAAe;AACfA,4BAAA,oBAAA,IAAqB;AACrBA,4BAAA,kBAAA,IAAmB;AACnBA,4BAAA,oBAAA,IAAqB;AACrBA,4BAAA,cAAA,IAAe;AACfA,4BAAA,UAAA,IAAW;AACXA,4BAAA,eAAA,IAAgB;AAnBN,SAAAA;AAAA,GAAA,4BAAA,CAAA,CAAA;AAyBL,IAAK,4CAAAC,6BAAL;AAILA,2BAAA,MAAA,IAAO;AAIPA,2BAAA,WAAA,IAAY;AAIZA,2BAAA,OAAA,IAAQ;AAIRA,2BAAA,MAAA,IAAO;AAIPA,2BAAA,SAAA,IAAU;AAIVA,2BAAA,QAAA,IAAS;AAETA,2BAAA,QAAA,IAAS;AAETA,2BAAA,OAAA,IAAQ;AAKRA,2BAAA,YAAA,IAAa;AAjCH,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/chatkit-types",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Type definitions for the ChatKit Web Component.",
5
5
  "sideEffects": false,
6
6
  "type": "module",