@xpert-ai/chatkit-types 0.0.4 → 0.0.5
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.d.ts +1173 -1
- package/dist/index.js +1357 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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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,6,7,8,9,10,11,12,13]}
|
|
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","../../../node_modules/.pnpm/@a2ui+lit@0.8.1_signal-polyfill@0.2.2/node_modules/@a2ui/lit/dist/src/0.8/events/events.js","../../../node_modules/.pnpm/@a2ui+lit@0.8.1_signal-polyfill@0.2.2/node_modules/@a2ui/lit/dist/src/0.8/styles/behavior.js","../../../node_modules/.pnpm/@a2ui+lit@0.8.1_signal-polyfill@0.2.2/node_modules/@a2ui/lit/dist/src/0.8/styles/shared.js","../../../node_modules/.pnpm/@a2ui+lit@0.8.1_signal-polyfill@0.2.2/node_modules/@a2ui/lit/dist/src/0.8/styles/border.js","../../../node_modules/.pnpm/@a2ui+lit@0.8.1_signal-polyfill@0.2.2/node_modules/@a2ui/lit/dist/src/0.8/types/colors.js","../../../node_modules/.pnpm/@a2ui+lit@0.8.1_signal-polyfill@0.2.2/node_modules/@a2ui/lit/dist/src/0.8/styles/utils.js","../../../node_modules/.pnpm/@a2ui+lit@0.8.1_signal-polyfill@0.2.2/node_modules/@a2ui/lit/dist/src/0.8/styles/colors.js","../../../node_modules/.pnpm/@a2ui+lit@0.8.1_signal-polyfill@0.2.2/node_modules/@a2ui/lit/dist/src/0.8/styles/layout.js","../../../node_modules/.pnpm/@a2ui+lit@0.8.1_signal-polyfill@0.2.2/node_modules/@a2ui/lit/dist/src/0.8/styles/opacity.js","../../../node_modules/.pnpm/@a2ui+lit@0.8.1_signal-polyfill@0.2.2/node_modules/@a2ui/lit/dist/src/0.8/styles/type.js","../../../node_modules/.pnpm/signal-polyfill@0.2.2/node_modules/signal-polyfill/dist/index.js","../../../node_modules/.pnpm/signal-utils@0.21.1_signal-polyfill@0.2.2/node_modules/signal-utils/dist/-private/util.ts.js","../../../node_modules/.pnpm/signal-utils@0.21.1_signal-polyfill@0.2.2/node_modules/signal-utils/dist/array.ts.js","../../../node_modules/.pnpm/signal-utils@0.21.1_signal-polyfill@0.2.2/node_modules/signal-utils/dist/map.ts.js","../../../node_modules/.pnpm/signal-utils@0.21.1_signal-polyfill@0.2.2/node_modules/signal-utils/dist/set.ts.js","../src/message.ts","../src/filterPlaygroundOptions.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}","/*\n Copyright 2025 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\nconst eventInit = {\n bubbles: true,\n cancelable: true,\n composed: true,\n};\nexport class StateEvent extends CustomEvent {\n static { this.eventName = \"a2uiaction\"; }\n constructor(payload) {\n super(StateEvent.eventName, { detail: payload, ...eventInit });\n this.payload = payload;\n }\n}\n//# sourceMappingURL=events.js.map","/*\n Copyright 2025 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\nconst opacityBehavior = `\n &:not([disabled]) {\n cursor: pointer;\n opacity: var(--opacity, 0);\n transition: opacity var(--speed, 0.2s) cubic-bezier(0, 0, 0.3, 1);\n\n &:hover,\n &:focus {\n opacity: 1;\n }\n }`;\nexport const behavior = `\n ${new Array(21)\n .fill(0)\n .map((_, idx) => {\n return `.behavior-ho-${idx * 5} {\n --opacity: ${idx / 20};\n ${opacityBehavior}\n }`;\n})\n .join(\"\\n\")}\n\n .behavior-o-s {\n overflow: scroll;\n }\n\n .behavior-o-a {\n overflow: auto;\n }\n\n .behavior-o-h {\n overflow: hidden;\n }\n\n .behavior-sw-n {\n scrollbar-width: none;\n }\n`;\n//# sourceMappingURL=behavior.js.map","/*\n Copyright 2025 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\nexport const grid = 4;\n//# sourceMappingURL=shared.js.map","/*\n Copyright 2025 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\nimport { grid } from \"./shared.js\";\nexport const border = `\n ${new Array(25)\n .fill(0)\n .map((_, idx) => {\n return `\n .border-bw-${idx} { border-width: ${idx}px; }\n .border-btw-${idx} { border-top-width: ${idx}px; }\n .border-bbw-${idx} { border-bottom-width: ${idx}px; }\n .border-blw-${idx} { border-left-width: ${idx}px; }\n .border-brw-${idx} { border-right-width: ${idx}px; }\n\n .border-ow-${idx} { outline-width: ${idx}px; }\n .border-br-${idx} { border-radius: ${idx * grid}px; overflow: hidden;}`;\n})\n .join(\"\\n\")}\n\n .border-br-50pc {\n border-radius: 50%;\n }\n\n .border-bs-s {\n border-style: solid;\n }\n`;\n//# sourceMappingURL=border.js.map","/*\n Copyright 2025 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\nexport const shades = [\n 0, 5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 95, 98, 99, 100,\n];\n//# sourceMappingURL=colors.js.map","/*\n Copyright 2025 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\nexport function merge(...classes) {\n const styles = {};\n for (const clazz of classes) {\n for (const [key, val] of Object.entries(clazz)) {\n const prefix = key.split(\"-\").with(-1, \"\").join(\"-\");\n const existingKeys = Object.keys(styles).filter((key) => key.startsWith(prefix));\n for (const existingKey of existingKeys) {\n delete styles[existingKey];\n }\n styles[key] = val;\n }\n }\n return styles;\n}\nexport function appendToAll(target, exclusions, ...classes) {\n const updatedTarget = structuredClone(target);\n // Step through each of the new blocks we've been handed.\n for (const clazz of classes) {\n // For each of the items in the list, create the prefix value, e.g., for\n // typography-f-s reduce to typography-f-. This will allow us to find any\n // and all matches across the target that have the same prefix and swap them\n // out for the updated item.\n for (const key of Object.keys(clazz)) {\n const prefix = key.split(\"-\").with(-1, \"\").join(\"-\");\n // Now we have the prefix step through all iteme in the target, and\n // replace the value in the array when we find it.\n for (const [tagName, classesToAdd] of Object.entries(updatedTarget)) {\n if (exclusions.includes(tagName)) {\n continue;\n }\n let found = false;\n for (let t = 0; t < classesToAdd.length; t++) {\n if (classesToAdd[t].startsWith(prefix)) {\n found = true;\n // In theory we should be able to break after finding a single\n // entry here because we shouldn't have items with the same prefix\n // in the array, but for safety we'll run to the end of the array\n // and ensure we've captured all possible items with the prefix.\n classesToAdd[t] = key;\n }\n }\n if (!found) {\n classesToAdd.push(key);\n }\n }\n }\n }\n return updatedTarget;\n}\nexport function createThemeStyles(palettes) {\n const styles = {};\n for (const palette of Object.values(palettes)) {\n for (const [key, val] of Object.entries(palette)) {\n const prop = toProp(key);\n styles[prop] = val;\n }\n }\n return styles;\n}\nexport function toProp(key) {\n if (key.startsWith(\"nv\")) {\n return `--nv-${key.slice(2)}`;\n }\n return `--${key[0]}-${key.slice(1)}`;\n}\n//# sourceMappingURL=utils.js.map","/*\n Copyright 2025 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\nimport { shades } from \"../types/colors.js\";\nimport { toProp } from \"./utils.js\";\nconst color = (src) => `\n ${src\n .map((key) => {\n const inverseKey = getInverseKey(key);\n return `.color-bc-${key} { border-color: light-dark(var(${toProp(key)}), var(${toProp(inverseKey)})); }`;\n})\n .join(\"\\n\")}\n\n ${src\n .map((key) => {\n const inverseKey = getInverseKey(key);\n const vals = [\n `.color-bgc-${key} { background-color: light-dark(var(${toProp(key)}), var(${toProp(inverseKey)})); }`,\n `.color-bbgc-${key}::backdrop { background-color: light-dark(var(${toProp(key)}), var(${toProp(inverseKey)})); }`,\n ];\n for (let o = 0.1; o < 1; o += 0.1) {\n vals.push(`.color-bbgc-${key}_${(o * 100).toFixed(0)}::backdrop {\n background-color: light-dark(oklch(from var(${toProp(key)}) l c h / calc(alpha * ${o.toFixed(1)})), oklch(from var(${toProp(inverseKey)}) l c h / calc(alpha * ${o.toFixed(1)})) );\n }\n `);\n }\n return vals.join(\"\\n\");\n})\n .join(\"\\n\")}\n\n ${src\n .map((key) => {\n const inverseKey = getInverseKey(key);\n return `.color-c-${key} { color: light-dark(var(${toProp(key)}), var(${toProp(inverseKey)})); }`;\n})\n .join(\"\\n\")}\n `;\nconst getInverseKey = (key) => {\n const match = key.match(/^([a-z]+)(\\d+)$/);\n if (!match)\n return key;\n const [, prefix, shadeStr] = match;\n const shade = parseInt(shadeStr, 10);\n const target = 100 - shade;\n const inverseShade = shades.reduce((prev, curr) => Math.abs(curr - target) < Math.abs(prev - target) ? curr : prev);\n return `${prefix}${inverseShade}`;\n};\nconst keyFactory = (prefix) => {\n return shades.map((v) => `${prefix}${v}`);\n};\nexport const colors = [\n color(keyFactory(\"p\")),\n color(keyFactory(\"s\")),\n color(keyFactory(\"t\")),\n color(keyFactory(\"n\")),\n color(keyFactory(\"nv\")),\n color(keyFactory(\"e\")),\n `\n .color-bgc-transparent {\n background-color: transparent;\n }\n\n :host {\n color-scheme: var(--color-scheme);\n }\n `,\n];\n//# sourceMappingURL=colors.js.map","/*\n Copyright 2025 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\nimport { grid } from \"./shared.js\";\nexport const layout = `\n :host {\n ${new Array(16)\n .fill(0)\n .map((_, idx) => {\n return `--g-${idx + 1}: ${(idx + 1) * grid}px;`;\n})\n .join(\"\\n\")}\n }\n\n ${new Array(49)\n .fill(0)\n .map((_, index) => {\n const idx = index - 24;\n const lbl = idx < 0 ? `n${Math.abs(idx)}` : idx.toString();\n return `\n .layout-p-${lbl} { --padding: ${idx * grid}px; padding: var(--padding); }\n .layout-pt-${lbl} { padding-top: ${idx * grid}px; }\n .layout-pr-${lbl} { padding-right: ${idx * grid}px; }\n .layout-pb-${lbl} { padding-bottom: ${idx * grid}px; }\n .layout-pl-${lbl} { padding-left: ${idx * grid}px; }\n\n .layout-m-${lbl} { --margin: ${idx * grid}px; margin: var(--margin); }\n .layout-mt-${lbl} { margin-top: ${idx * grid}px; }\n .layout-mr-${lbl} { margin-right: ${idx * grid}px; }\n .layout-mb-${lbl} { margin-bottom: ${idx * grid}px; }\n .layout-ml-${lbl} { margin-left: ${idx * grid}px; }\n\n .layout-t-${lbl} { top: ${idx * grid}px; }\n .layout-r-${lbl} { right: ${idx * grid}px; }\n .layout-b-${lbl} { bottom: ${idx * grid}px; }\n .layout-l-${lbl} { left: ${idx * grid}px; }`;\n})\n .join(\"\\n\")}\n\n ${new Array(25)\n .fill(0)\n .map((_, idx) => {\n return `\n .layout-g-${idx} { gap: ${idx * grid}px; }`;\n})\n .join(\"\\n\")}\n\n ${new Array(8)\n .fill(0)\n .map((_, idx) => {\n return `\n .layout-grd-col${idx + 1} { grid-template-columns: ${\"1fr \"\n .repeat(idx + 1)\n .trim()}; }`;\n})\n .join(\"\\n\")}\n\n .layout-pos-a {\n position: absolute;\n }\n\n .layout-pos-rel {\n position: relative;\n }\n\n .layout-dsp-none {\n display: none;\n }\n\n .layout-dsp-block {\n display: block;\n }\n\n .layout-dsp-grid {\n display: grid;\n }\n\n .layout-dsp-iflex {\n display: inline-flex;\n }\n\n .layout-dsp-flexvert {\n display: flex;\n flex-direction: column;\n }\n\n .layout-dsp-flexhor {\n display: flex;\n flex-direction: row;\n }\n\n .layout-fw-w {\n flex-wrap: wrap;\n }\n\n .layout-al-fs {\n align-items: start;\n }\n\n .layout-al-fe {\n align-items: end;\n }\n\n .layout-al-c {\n align-items: center;\n }\n\n .layout-as-n {\n align-self: normal;\n }\n\n .layout-js-c {\n justify-self: center;\n }\n\n .layout-sp-c {\n justify-content: center;\n }\n\n .layout-sp-ev {\n justify-content: space-evenly;\n }\n\n .layout-sp-bt {\n justify-content: space-between;\n }\n\n .layout-sp-s {\n justify-content: start;\n }\n\n .layout-sp-e {\n justify-content: end;\n }\n\n .layout-ji-e {\n justify-items: end;\n }\n\n .layout-r-none {\n resize: none;\n }\n\n .layout-fs-c {\n field-sizing: content;\n }\n\n .layout-fs-n {\n field-sizing: none;\n }\n\n .layout-flx-0 {\n flex: 0 0 auto;\n }\n\n .layout-flx-1 {\n flex: 1 0 auto;\n }\n\n .layout-c-s {\n contain: strict;\n }\n\n /** Widths **/\n\n ${new Array(10)\n .fill(0)\n .map((_, idx) => {\n const weight = (idx + 1) * 10;\n return `.layout-w-${weight} { width: ${weight}%; max-width: ${weight}%; }`;\n})\n .join(\"\\n\")}\n\n ${new Array(16)\n .fill(0)\n .map((_, idx) => {\n const weight = idx * grid;\n return `.layout-wp-${idx} { width: ${weight}px; }`;\n})\n .join(\"\\n\")}\n\n /** Heights **/\n\n ${new Array(10)\n .fill(0)\n .map((_, idx) => {\n const height = (idx + 1) * 10;\n return `.layout-h-${height} { height: ${height}%; }`;\n})\n .join(\"\\n\")}\n\n ${new Array(16)\n .fill(0)\n .map((_, idx) => {\n const height = idx * grid;\n return `.layout-hp-${idx} { height: ${height}px; }`;\n})\n .join(\"\\n\")}\n\n .layout-el-cv {\n & img,\n & video {\n width: 100%;\n height: 100%;\n object-fit: cover;\n margin: 0;\n }\n }\n\n .layout-ar-sq {\n aspect-ratio: 1 / 1;\n }\n\n .layout-ex-fb {\n margin: calc(var(--padding) * -1) 0 0 calc(var(--padding) * -1);\n width: calc(100% + var(--padding) * 2);\n height: calc(100% + var(--padding) * 2);\n }\n`;\n//# sourceMappingURL=layout.js.map","/*\n Copyright 2025 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\nexport const opacity = `\n ${new Array(21)\n .fill(0)\n .map((_, idx) => {\n return `.opacity-el-${idx * 5} { opacity: ${idx / 20}; }`;\n})\n .join(\"\\n\")}\n`;\n//# sourceMappingURL=opacity.js.map","/*\n Copyright 2025 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\nexport const type = `\n :host {\n --default-font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n --default-font-family-mono: \"Courier New\", Courier, monospace;\n }\n\n .typography-f-s {\n font-family: var(--font-family, var(--default-font-family));\n font-optical-sizing: auto;\n font-variation-settings: \"slnt\" 0, \"wdth\" 100, \"GRAD\" 0;\n }\n\n .typography-f-sf {\n font-family: var(--font-family-flex, var(--default-font-family));\n font-optical-sizing: auto;\n }\n\n .typography-f-c {\n font-family: var(--font-family-mono, var(--default-font-family));\n font-optical-sizing: auto;\n font-variation-settings: \"slnt\" 0, \"wdth\" 100, \"GRAD\" 0;\n }\n\n .typography-v-r {\n font-variation-settings: \"slnt\" 0, \"wdth\" 100, \"GRAD\" 0, \"ROND\" 100;\n }\n\n .typography-ta-s {\n text-align: start;\n }\n\n .typography-ta-c {\n text-align: center;\n }\n\n .typography-fs-n {\n font-style: normal;\n }\n\n .typography-fs-i {\n font-style: italic;\n }\n\n .typography-sz-ls {\n font-size: 11px;\n line-height: 16px;\n }\n\n .typography-sz-lm {\n font-size: 12px;\n line-height: 16px;\n }\n\n .typography-sz-ll {\n font-size: 14px;\n line-height: 20px;\n }\n\n .typography-sz-bs {\n font-size: 12px;\n line-height: 16px;\n }\n\n .typography-sz-bm {\n font-size: 14px;\n line-height: 20px;\n }\n\n .typography-sz-bl {\n font-size: 16px;\n line-height: 24px;\n }\n\n .typography-sz-ts {\n font-size: 14px;\n line-height: 20px;\n }\n\n .typography-sz-tm {\n font-size: 16px;\n line-height: 24px;\n }\n\n .typography-sz-tl {\n font-size: 22px;\n line-height: 28px;\n }\n\n .typography-sz-hs {\n font-size: 24px;\n line-height: 32px;\n }\n\n .typography-sz-hm {\n font-size: 28px;\n line-height: 36px;\n }\n\n .typography-sz-hl {\n font-size: 32px;\n line-height: 40px;\n }\n\n .typography-sz-ds {\n font-size: 36px;\n line-height: 44px;\n }\n\n .typography-sz-dm {\n font-size: 45px;\n line-height: 52px;\n }\n\n .typography-sz-dl {\n font-size: 57px;\n line-height: 64px;\n }\n\n .typography-ws-p {\n white-space: pre-line;\n }\n\n .typography-ws-nw {\n white-space: nowrap;\n }\n\n .typography-td-none {\n text-decoration: none;\n }\n\n /** Weights **/\n\n ${new Array(9)\n .fill(0)\n .map((_, idx) => {\n const weight = (idx + 1) * 100;\n return `.typography-w-${weight} { font-weight: ${weight}; }`;\n})\n .join(\"\\n\")}\n`;\n//# sourceMappingURL=type.js.map","var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nvar __accessCheck = (obj, member, msg) => {\n if (!member.has(obj))\n throw TypeError(\"Cannot \" + msg);\n};\nvar __privateIn = (member, obj) => {\n if (Object(obj) !== obj)\n throw TypeError('Cannot use the \"in\" operator on this value');\n return member.has(obj);\n};\nvar __privateAdd = (obj, member, value) => {\n if (member.has(obj))\n throw TypeError(\"Cannot add the same private member more than once\");\n member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n};\nvar __privateMethod = (obj, member, method) => {\n __accessCheck(obj, member, \"access private method\");\n return method;\n};\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction defaultEquals(a, b) {\n return Object.is(a, b);\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nlet activeConsumer = null;\nlet inNotificationPhase = false;\nlet epoch = 1;\nconst SIGNAL = /* @__PURE__ */ Symbol(\"SIGNAL\");\nfunction setActiveConsumer(consumer) {\n const prev = activeConsumer;\n activeConsumer = consumer;\n return prev;\n}\nfunction getActiveConsumer() {\n return activeConsumer;\n}\nfunction isInNotificationPhase() {\n return inNotificationPhase;\n}\nconst REACTIVE_NODE = {\n version: 0,\n lastCleanEpoch: 0,\n dirty: false,\n producerNode: void 0,\n producerLastReadVersion: void 0,\n producerIndexOfThis: void 0,\n nextProducerIndex: 0,\n liveConsumerNode: void 0,\n liveConsumerIndexOfThis: void 0,\n consumerAllowSignalWrites: false,\n consumerIsAlwaysLive: false,\n producerMustRecompute: () => false,\n producerRecomputeValue: () => {\n },\n consumerMarkedDirty: () => {\n },\n consumerOnSignalRead: () => {\n }\n};\nfunction producerAccessed(node) {\n if (inNotificationPhase) {\n throw new Error(\n typeof ngDevMode !== \"undefined\" && ngDevMode ? `Assertion error: signal read during notification phase` : \"\"\n );\n }\n if (activeConsumer === null) {\n return;\n }\n activeConsumer.consumerOnSignalRead(node);\n const idx = activeConsumer.nextProducerIndex++;\n assertConsumerNode(activeConsumer);\n if (idx < activeConsumer.producerNode.length && activeConsumer.producerNode[idx] !== node) {\n if (consumerIsLive(activeConsumer)) {\n const staleProducer = activeConsumer.producerNode[idx];\n producerRemoveLiveConsumerAtIndex(staleProducer, activeConsumer.producerIndexOfThis[idx]);\n }\n }\n if (activeConsumer.producerNode[idx] !== node) {\n activeConsumer.producerNode[idx] = node;\n activeConsumer.producerIndexOfThis[idx] = consumerIsLive(activeConsumer) ? producerAddLiveConsumer(node, activeConsumer, idx) : 0;\n }\n activeConsumer.producerLastReadVersion[idx] = node.version;\n}\nfunction producerIncrementEpoch() {\n epoch++;\n}\nfunction producerUpdateValueVersion(node) {\n if (!node.dirty && node.lastCleanEpoch === epoch) {\n return;\n }\n if (!node.producerMustRecompute(node) && !consumerPollProducersForChange(node)) {\n node.dirty = false;\n node.lastCleanEpoch = epoch;\n return;\n }\n node.producerRecomputeValue(node);\n node.dirty = false;\n node.lastCleanEpoch = epoch;\n}\nfunction producerNotifyConsumers(node) {\n if (node.liveConsumerNode === void 0) {\n return;\n }\n const prev = inNotificationPhase;\n inNotificationPhase = true;\n try {\n for (const consumer of node.liveConsumerNode) {\n if (!consumer.dirty) {\n consumerMarkDirty(consumer);\n }\n }\n } finally {\n inNotificationPhase = prev;\n }\n}\nfunction producerUpdatesAllowed() {\n return (activeConsumer == null ? void 0 : activeConsumer.consumerAllowSignalWrites) !== false;\n}\nfunction consumerMarkDirty(node) {\n var _a;\n node.dirty = true;\n producerNotifyConsumers(node);\n (_a = node.consumerMarkedDirty) == null ? void 0 : _a.call(node.wrapper ?? node);\n}\nfunction consumerBeforeComputation(node) {\n node && (node.nextProducerIndex = 0);\n return setActiveConsumer(node);\n}\nfunction consumerAfterComputation(node, prevConsumer) {\n setActiveConsumer(prevConsumer);\n if (!node || node.producerNode === void 0 || node.producerIndexOfThis === void 0 || node.producerLastReadVersion === void 0) {\n return;\n }\n if (consumerIsLive(node)) {\n for (let i = node.nextProducerIndex; i < node.producerNode.length; i++) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n }\n }\n while (node.producerNode.length > node.nextProducerIndex) {\n node.producerNode.pop();\n node.producerLastReadVersion.pop();\n node.producerIndexOfThis.pop();\n }\n}\nfunction consumerPollProducersForChange(node) {\n assertConsumerNode(node);\n for (let i = 0; i < node.producerNode.length; i++) {\n const producer = node.producerNode[i];\n const seenVersion = node.producerLastReadVersion[i];\n if (seenVersion !== producer.version) {\n return true;\n }\n producerUpdateValueVersion(producer);\n if (seenVersion !== producer.version) {\n return true;\n }\n }\n return false;\n}\nfunction producerAddLiveConsumer(node, consumer, indexOfThis) {\n var _a;\n assertProducerNode(node);\n assertConsumerNode(node);\n if (node.liveConsumerNode.length === 0) {\n (_a = node.watched) == null ? void 0 : _a.call(node.wrapper);\n for (let i = 0; i < node.producerNode.length; i++) {\n node.producerIndexOfThis[i] = producerAddLiveConsumer(node.producerNode[i], node, i);\n }\n }\n node.liveConsumerIndexOfThis.push(indexOfThis);\n return node.liveConsumerNode.push(consumer) - 1;\n}\nfunction producerRemoveLiveConsumerAtIndex(node, idx) {\n var _a;\n assertProducerNode(node);\n assertConsumerNode(node);\n if (typeof ngDevMode !== \"undefined\" && ngDevMode && idx >= node.liveConsumerNode.length) {\n throw new Error(\n `Assertion error: active consumer index ${idx} is out of bounds of ${node.liveConsumerNode.length} consumers)`\n );\n }\n if (node.liveConsumerNode.length === 1) {\n (_a = node.unwatched) == null ? void 0 : _a.call(node.wrapper);\n for (let i = 0; i < node.producerNode.length; i++) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n }\n }\n const lastIdx = node.liveConsumerNode.length - 1;\n node.liveConsumerNode[idx] = node.liveConsumerNode[lastIdx];\n node.liveConsumerIndexOfThis[idx] = node.liveConsumerIndexOfThis[lastIdx];\n node.liveConsumerNode.length--;\n node.liveConsumerIndexOfThis.length--;\n if (idx < node.liveConsumerNode.length) {\n const idxProducer = node.liveConsumerIndexOfThis[idx];\n const consumer = node.liveConsumerNode[idx];\n assertConsumerNode(consumer);\n consumer.producerIndexOfThis[idxProducer] = idx;\n }\n}\nfunction consumerIsLive(node) {\n var _a;\n return node.consumerIsAlwaysLive || (((_a = node == null ? void 0 : node.liveConsumerNode) == null ? void 0 : _a.length) ?? 0) > 0;\n}\nfunction assertConsumerNode(node) {\n node.producerNode ?? (node.producerNode = []);\n node.producerIndexOfThis ?? (node.producerIndexOfThis = []);\n node.producerLastReadVersion ?? (node.producerLastReadVersion = []);\n}\nfunction assertProducerNode(node) {\n node.liveConsumerNode ?? (node.liveConsumerNode = []);\n node.liveConsumerIndexOfThis ?? (node.liveConsumerIndexOfThis = []);\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction computedGet(node) {\n producerUpdateValueVersion(node);\n producerAccessed(node);\n if (node.value === ERRORED) {\n throw node.error;\n }\n return node.value;\n}\nfunction createComputed(computation) {\n const node = Object.create(COMPUTED_NODE);\n node.computation = computation;\n const computed = () => computedGet(node);\n computed[SIGNAL] = node;\n return computed;\n}\nconst UNSET = /* @__PURE__ */ Symbol(\"UNSET\");\nconst COMPUTING = /* @__PURE__ */ Symbol(\"COMPUTING\");\nconst ERRORED = /* @__PURE__ */ Symbol(\"ERRORED\");\nconst COMPUTED_NODE = /* @__PURE__ */ (() => {\n return {\n ...REACTIVE_NODE,\n value: UNSET,\n dirty: true,\n error: null,\n equal: defaultEquals,\n producerMustRecompute(node) {\n return node.value === UNSET || node.value === COMPUTING;\n },\n producerRecomputeValue(node) {\n if (node.value === COMPUTING) {\n throw new Error(\"Detected cycle in computations.\");\n }\n const oldValue = node.value;\n node.value = COMPUTING;\n const prevConsumer = consumerBeforeComputation(node);\n let newValue;\n let wasEqual = false;\n try {\n newValue = node.computation.call(node.wrapper);\n const oldOk = oldValue !== UNSET && oldValue !== ERRORED;\n wasEqual = oldOk && node.equal.call(node.wrapper, oldValue, newValue);\n } catch (err) {\n newValue = ERRORED;\n node.error = err;\n } finally {\n consumerAfterComputation(node, prevConsumer);\n }\n if (wasEqual) {\n node.value = oldValue;\n return;\n }\n node.value = newValue;\n node.version++;\n }\n };\n})();\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction defaultThrowError() {\n throw new Error();\n}\nlet throwInvalidWriteToSignalErrorFn = defaultThrowError;\nfunction throwInvalidWriteToSignalError() {\n throwInvalidWriteToSignalErrorFn();\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction createSignal(initialValue) {\n const node = Object.create(SIGNAL_NODE);\n node.value = initialValue;\n const getter = () => {\n producerAccessed(node);\n return node.value;\n };\n getter[SIGNAL] = node;\n return getter;\n}\nfunction signalGetFn() {\n producerAccessed(this);\n return this.value;\n}\nfunction signalSetFn(node, newValue) {\n if (!producerUpdatesAllowed()) {\n throwInvalidWriteToSignalError();\n }\n if (!node.equal.call(node.wrapper, node.value, newValue)) {\n node.value = newValue;\n signalValueChanged(node);\n }\n}\nconst SIGNAL_NODE = /* @__PURE__ */ (() => {\n return {\n ...REACTIVE_NODE,\n equal: defaultEquals,\n value: void 0\n };\n})();\nfunction signalValueChanged(node) {\n node.version++;\n producerIncrementEpoch();\n producerNotifyConsumers(node);\n}\n/**\n * @license\n * Copyright 2024 Bloomberg Finance L.P.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst NODE = Symbol(\"node\");\nvar Signal;\n((Signal2) => {\n var _a, _brand, brand_fn, _b, _brand2, brand_fn2;\n class State {\n constructor(initialValue, options = {}) {\n __privateAdd(this, _brand);\n __publicField(this, _a);\n const ref = createSignal(initialValue);\n const node = ref[SIGNAL];\n this[NODE] = node;\n node.wrapper = this;\n if (options) {\n const equals = options.equals;\n if (equals) {\n node.equal = equals;\n }\n node.watched = options[Signal2.subtle.watched];\n node.unwatched = options[Signal2.subtle.unwatched];\n }\n }\n get() {\n if (!(0, Signal2.isState)(this))\n throw new TypeError(\"Wrong receiver type for Signal.State.prototype.get\");\n return signalGetFn.call(this[NODE]);\n }\n set(newValue) {\n if (!(0, Signal2.isState)(this))\n throw new TypeError(\"Wrong receiver type for Signal.State.prototype.set\");\n if (isInNotificationPhase()) {\n throw new Error(\"Writes to signals not permitted during Watcher callback\");\n }\n const ref = this[NODE];\n signalSetFn(ref, newValue);\n }\n }\n _a = NODE;\n _brand = new WeakSet();\n brand_fn = function() {\n };\n Signal2.isState = (s) => typeof s === \"object\" && __privateIn(_brand, s);\n Signal2.State = State;\n class Computed {\n // Create a Signal which evaluates to the value returned by the callback.\n // Callback is called with this signal as the parameter.\n constructor(computation, options) {\n __privateAdd(this, _brand2);\n __publicField(this, _b);\n const ref = createComputed(computation);\n const node = ref[SIGNAL];\n node.consumerAllowSignalWrites = true;\n this[NODE] = node;\n node.wrapper = this;\n if (options) {\n const equals = options.equals;\n if (equals) {\n node.equal = equals;\n }\n node.watched = options[Signal2.subtle.watched];\n node.unwatched = options[Signal2.subtle.unwatched];\n }\n }\n get() {\n if (!(0, Signal2.isComputed)(this))\n throw new TypeError(\"Wrong receiver type for Signal.Computed.prototype.get\");\n return computedGet(this[NODE]);\n }\n }\n _b = NODE;\n _brand2 = new WeakSet();\n brand_fn2 = function() {\n };\n Signal2.isComputed = (c) => typeof c === \"object\" && __privateIn(_brand2, c);\n Signal2.Computed = Computed;\n ((subtle2) => {\n var _a2, _brand3, brand_fn3, _assertSignals, assertSignals_fn;\n function untrack(cb) {\n let output;\n let prevActiveConsumer = null;\n try {\n prevActiveConsumer = setActiveConsumer(null);\n output = cb();\n } finally {\n setActiveConsumer(prevActiveConsumer);\n }\n return output;\n }\n subtle2.untrack = untrack;\n function introspectSources(sink) {\n var _a3;\n if (!(0, Signal2.isComputed)(sink) && !(0, Signal2.isWatcher)(sink)) {\n throw new TypeError(\"Called introspectSources without a Computed or Watcher argument\");\n }\n return ((_a3 = sink[NODE].producerNode) == null ? void 0 : _a3.map((n) => n.wrapper)) ?? [];\n }\n subtle2.introspectSources = introspectSources;\n function introspectSinks(signal) {\n var _a3;\n if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isState)(signal)) {\n throw new TypeError(\"Called introspectSinks without a Signal argument\");\n }\n return ((_a3 = signal[NODE].liveConsumerNode) == null ? void 0 : _a3.map((n) => n.wrapper)) ?? [];\n }\n subtle2.introspectSinks = introspectSinks;\n function hasSinks(signal) {\n if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isState)(signal)) {\n throw new TypeError(\"Called hasSinks without a Signal argument\");\n }\n const liveConsumerNode = signal[NODE].liveConsumerNode;\n if (!liveConsumerNode)\n return false;\n return liveConsumerNode.length > 0;\n }\n subtle2.hasSinks = hasSinks;\n function hasSources(signal) {\n if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isWatcher)(signal)) {\n throw new TypeError(\"Called hasSources without a Computed or Watcher argument\");\n }\n const producerNode = signal[NODE].producerNode;\n if (!producerNode)\n return false;\n return producerNode.length > 0;\n }\n subtle2.hasSources = hasSources;\n class Watcher {\n // When a (recursive) source of Watcher is written to, call this callback,\n // if it hasn't already been called since the last `watch` call.\n // No signals may be read or written during the notify.\n constructor(notify) {\n __privateAdd(this, _brand3);\n __privateAdd(this, _assertSignals);\n __publicField(this, _a2);\n let node = Object.create(REACTIVE_NODE);\n node.wrapper = this;\n node.consumerMarkedDirty = notify;\n node.consumerIsAlwaysLive = true;\n node.consumerAllowSignalWrites = false;\n node.producerNode = [];\n this[NODE] = node;\n }\n // Add these signals to the Watcher's set, and set the watcher to run its\n // notify callback next time any signal in the set (or one of its dependencies) changes.\n // Can be called with no arguments just to reset the \"notified\" state, so that\n // the notify callback will be invoked again.\n watch(...signals) {\n if (!(0, Signal2.isWatcher)(this)) {\n throw new TypeError(\"Called unwatch without Watcher receiver\");\n }\n __privateMethod(this, _assertSignals, assertSignals_fn).call(this, signals);\n const node = this[NODE];\n node.dirty = false;\n const prev = setActiveConsumer(node);\n for (const signal of signals) {\n producerAccessed(signal[NODE]);\n }\n setActiveConsumer(prev);\n }\n // Remove these signals from the watched set (e.g., for an effect which is disposed)\n unwatch(...signals) {\n if (!(0, Signal2.isWatcher)(this)) {\n throw new TypeError(\"Called unwatch without Watcher receiver\");\n }\n __privateMethod(this, _assertSignals, assertSignals_fn).call(this, signals);\n const node = this[NODE];\n assertConsumerNode(node);\n for (let i = node.producerNode.length - 1; i >= 0; i--) {\n if (signals.includes(node.producerNode[i].wrapper)) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n const lastIdx = node.producerNode.length - 1;\n node.producerNode[i] = node.producerNode[lastIdx];\n node.producerIndexOfThis[i] = node.producerIndexOfThis[lastIdx];\n node.producerNode.length--;\n node.producerIndexOfThis.length--;\n node.nextProducerIndex--;\n if (i < node.producerNode.length) {\n const idxConsumer = node.producerIndexOfThis[i];\n const producer = node.producerNode[i];\n assertProducerNode(producer);\n producer.liveConsumerIndexOfThis[idxConsumer] = i;\n }\n }\n }\n }\n // Returns the set of computeds in the Watcher's set which are still yet\n // to be re-evaluated\n getPending() {\n if (!(0, Signal2.isWatcher)(this)) {\n throw new TypeError(\"Called getPending without Watcher receiver\");\n }\n const node = this[NODE];\n return node.producerNode.filter((n) => n.dirty).map((n) => n.wrapper);\n }\n }\n _a2 = NODE;\n _brand3 = new WeakSet();\n brand_fn3 = function() {\n };\n _assertSignals = new WeakSet();\n assertSignals_fn = function(signals) {\n for (const signal of signals) {\n if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isState)(signal)) {\n throw new TypeError(\"Called watch/unwatch without a Computed or State argument\");\n }\n }\n };\n Signal2.isWatcher = (w) => __privateIn(_brand3, w);\n subtle2.Watcher = Watcher;\n function currentComputed() {\n var _a3;\n return (_a3 = getActiveConsumer()) == null ? void 0 : _a3.wrapper;\n }\n subtle2.currentComputed = currentComputed;\n subtle2.watched = Symbol(\"watched\");\n subtle2.unwatched = Symbol(\"unwatched\");\n })(Signal2.subtle || (Signal2.subtle = {}));\n})(Signal || (Signal = {}));\nexport {\n Signal\n};\n","import { Signal } from 'signal-polyfill';\n\n/**\n * equality check here is always false so that we can dirty the storage\n * via setting to _anything_\n *\n *\n * This is for a pattern where we don't *directly* use signals to back the values used in collections\n * so that instanceof checks and getters and other native features \"just work\" without having\n * to do nested proxying.\n *\n * (though, see deep.ts for nested / deep behavior)\n */\nconst createStorage = (initial = null) => new Signal.State(initial, {\n equals: () => false\n});\n\n/**\n * Just an alias for brevity\n */\n\nconst BOUND_FUNS = new WeakMap();\nfunction fnCacheFor(context) {\n let fnCache = BOUND_FUNS.get(context);\n if (!fnCache) {\n fnCache = new Map();\n BOUND_FUNS.set(context, fnCache);\n }\n return fnCache; // as Map<keyof T, T[keyof T]>;\n}\n\nexport { createStorage, fnCacheFor };\n//# sourceMappingURL=util.ts.js.map\n","import { createStorage } from './-private/util.ts.js';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n// Unfortunately, TypeScript's ability to do inference *or* type-checking in a\n// `Proxy`'s body is very limited, so we have to use a number of casts `as any`\n// to make the internal accesses work. The type safety of these is guaranteed at\n// the *call site* instead of within the body: you cannot do `Array.blah` in TS,\n// and it will blow up in JS in exactly the same way, so it is safe to assume\n// that properties within the getter have the correct type in TS.\n\nconst ARRAY_GETTER_METHODS = new Set([Symbol.iterator, \"concat\", \"entries\", \"every\", \"filter\", \"find\", \"findIndex\", \"flat\", \"flatMap\", \"forEach\", \"includes\", \"indexOf\", \"join\", \"keys\", \"lastIndexOf\", \"map\", \"reduce\", \"reduceRight\", \"slice\", \"some\", \"values\"]);\n\n// For these methods, `Array` itself immediately gets the `.length` to return\n// after invoking them.\nconst ARRAY_WRITE_THEN_READ_METHODS = new Set([\"fill\", \"push\", \"unshift\"]);\nfunction convertToInt(prop) {\n if (typeof prop === \"symbol\") return null;\n const num = Number(prop);\n if (isNaN(num)) return null;\n return num % 1 === 0 ? num : null;\n}\n\n// This rule is correct in the general case, but it doesn't understand\n// declaration merging, which is how we're using the interface here. This says\n// `SignalArray` acts just like `Array<T>`, but also has the properties\n// declared via the `class` declaration above -- but without the cost of a\n// subclass, which is much slower than the proxied array behavior. That is: a\n// `SignalArray` *is* an `Array`, just with a proxy in front of accessors and\n// setters, rather than a subclass of an `Array` which would be de-optimized by\n// the browsers.\n//\n\nclass SignalArray {\n /**\n * Creates an array from an iterable object.\n * @param iterable An iterable object to convert to an array.\n */\n\n /**\n * Creates an array from an iterable object.\n * @param iterable An iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n\n static from(iterable, mapfn, thisArg) {\n return mapfn ? new SignalArray(Array.from(iterable, mapfn, thisArg)) : new SignalArray(Array.from(iterable));\n }\n static of(...arr) {\n return new SignalArray(arr);\n }\n constructor(arr = []) {\n let clone = arr.slice();\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let self = this;\n let boundFns = new Map();\n\n /**\n Flag to track whether we have *just* intercepted a call to `.push()` or\n `.unshift()`, since in those cases (and only those cases!) the `Array`\n itself checks `.length` to return from the function call.\n */\n let nativelyAccessingLengthFromPushOrUnshift = false;\n return new Proxy(clone, {\n get(target, prop /*, _receiver */) {\n let index = convertToInt(prop);\n if (index !== null) {\n self.#readStorageFor(index);\n self.#collection.get();\n return target[index];\n }\n if (prop === \"length\") {\n // If we are reading `.length`, it may be a normal user-triggered\n // read, or it may be a read triggered by Array itself. In the latter\n // case, it is because we have just done `.push()` or `.unshift()`; in\n // that case it is safe not to mark this as a *read* operation, since\n // calling `.push()` or `.unshift()` cannot otherwise be part of a\n // \"read\" operation safely, and if done during an *existing* read\n // (e.g. if the user has already checked `.length` *prior* to this),\n // that will still trigger the mutation-after-consumption assertion.\n if (nativelyAccessingLengthFromPushOrUnshift) {\n nativelyAccessingLengthFromPushOrUnshift = false;\n } else {\n self.#collection.get();\n }\n return target[prop];\n }\n\n // Here, track that we are doing a `.push()` or `.unshift()` by setting\n // the flag to `true` so that when the `.length` is read by `Array` (see\n // immediately above), it knows not to dirty the collection.\n if (ARRAY_WRITE_THEN_READ_METHODS.has(prop)) {\n nativelyAccessingLengthFromPushOrUnshift = true;\n }\n if (ARRAY_GETTER_METHODS.has(prop)) {\n let fn = boundFns.get(prop);\n if (fn === undefined) {\n fn = (...args) => {\n self.#collection.get();\n return target[prop](...args);\n };\n boundFns.set(prop, fn);\n }\n return fn;\n }\n return target[prop];\n },\n set(target, prop, value /*, _receiver */) {\n target[prop] = value;\n let index = convertToInt(prop);\n if (index !== null) {\n self.#dirtyStorageFor(index);\n self.#collection.set(null);\n } else if (prop === \"length\") {\n self.#collection.set(null);\n }\n return true;\n },\n getPrototypeOf() {\n return SignalArray.prototype;\n }\n });\n }\n #collection = createStorage();\n #storages = new Map();\n #readStorageFor(index) {\n let storage = this.#storages.get(index);\n if (storage === undefined) {\n storage = createStorage();\n this.#storages.set(index, storage);\n }\n storage.get();\n }\n #dirtyStorageFor(index) {\n const storage = this.#storages.get(index);\n if (storage) {\n storage.set(null);\n }\n }\n}\n\n// Ensure instanceof works correctly\nObject.setPrototypeOf(SignalArray.prototype, Array.prototype);\nfunction signalArray(x) {\n return new SignalArray(x);\n}\n\nexport { SignalArray, signalArray };\n//# sourceMappingURL=array.ts.js.map\n","import { createStorage } from './-private/util.ts.js';\n\nclass SignalMap {\n collection = createStorage();\n storages = new Map();\n vals;\n readStorageFor(key) {\n const {\n storages\n } = this;\n let storage = storages.get(key);\n if (storage === undefined) {\n storage = createStorage();\n storages.set(key, storage);\n }\n storage.get();\n }\n dirtyStorageFor(key) {\n const storage = this.storages.get(key);\n if (storage) {\n storage.set(null);\n }\n }\n constructor(existing) {\n // TypeScript doesn't correctly resolve the overloads for calling the `Map`\n // constructor for the no-value constructor. This resolves that.\n this.vals = existing ? new Map(existing) : new Map();\n }\n\n // **** KEY GETTERS ****\n get(key) {\n // entangle the storage for the key\n this.readStorageFor(key);\n return this.vals.get(key);\n }\n has(key) {\n this.readStorageFor(key);\n return this.vals.has(key);\n }\n\n // **** ALL GETTERS ****\n entries() {\n this.collection.get();\n return this.vals.entries();\n }\n keys() {\n this.collection.get();\n return this.vals.keys();\n }\n values() {\n this.collection.get();\n return this.vals.values();\n }\n forEach(fn) {\n this.collection.get();\n this.vals.forEach(fn);\n }\n get size() {\n this.collection.get();\n return this.vals.size;\n }\n [Symbol.iterator]() {\n this.collection.get();\n return this.vals[Symbol.iterator]();\n }\n get [Symbol.toStringTag]() {\n return this.vals[Symbol.toStringTag];\n }\n\n // **** KEY SETTERS ****\n set(key, value) {\n this.dirtyStorageFor(key);\n this.collection.set(null);\n this.vals.set(key, value);\n return this;\n }\n delete(key) {\n this.dirtyStorageFor(key);\n this.collection.set(null);\n return this.vals.delete(key);\n }\n\n // **** ALL SETTERS ****\n clear() {\n this.storages.forEach(s => s.set(null));\n this.collection.set(null);\n this.vals.clear();\n }\n}\n\n// So instanceof works\nObject.setPrototypeOf(SignalMap.prototype, Map.prototype);\n\nexport { SignalMap };\n//# sourceMappingURL=map.ts.js.map\n","import { createStorage } from './-private/util.ts.js';\n\nclass SignalSet {\n collection = createStorage();\n storages = new Map();\n vals;\n storageFor(key) {\n const storages = this.storages;\n let storage = storages.get(key);\n if (storage === undefined) {\n storage = createStorage();\n storages.set(key, storage);\n }\n return storage;\n }\n dirtyStorageFor(key) {\n const storage = this.storages.get(key);\n if (storage) {\n storage.set(null);\n }\n }\n constructor(existing) {\n this.vals = new Set(existing);\n }\n\n // **** KEY GETTERS ****\n has(value) {\n this.storageFor(value).get();\n return this.vals.has(value);\n }\n\n // **** ALL GETTERS ****\n entries() {\n this.collection.get();\n return this.vals.entries();\n }\n keys() {\n this.collection.get();\n return this.vals.keys();\n }\n values() {\n this.collection.get();\n return this.vals.values();\n }\n forEach(fn) {\n this.collection.get();\n this.vals.forEach(fn);\n }\n get size() {\n this.collection.get();\n return this.vals.size;\n }\n [Symbol.iterator]() {\n this.collection.get();\n return this.vals[Symbol.iterator]();\n }\n get [Symbol.toStringTag]() {\n return this.vals[Symbol.toStringTag];\n }\n\n // **** KEY SETTERS ****\n add(value) {\n this.dirtyStorageFor(value);\n this.collection.set(null);\n this.vals.add(value);\n return this;\n }\n delete(value) {\n this.dirtyStorageFor(value);\n this.collection.set(null);\n return this.vals.delete(value);\n }\n\n // **** ALL SETTERS ****\n clear() {\n this.storages.forEach(s => s.set(null));\n this.collection.set(null);\n this.vals.clear();\n }\n}\n\n// So instanceof works\nObject.setPrototypeOf(SignalSet.prototype, Set.prototype);\n\nexport { SignalSet };\n//# sourceMappingURL=set.ts.js.map\n","import type { ToolCall } from \"@langchain/core/messages/tool\";\nimport { Types } from '@a2ui/lit/0.8';\n\nexport 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 ON_CLIENT_EFFECT = 'on_client_effect',\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 TMessageComponentWidgetItem = {\n name: string\n config: Types.Surface\n values?: Record<string, unknown>\n}\n\nexport type TMessageComponentWidgetData = {\n type: 'Widget'\n mode?: string\n widgets: TMessageComponentWidgetItem[]\n executionId?: string\n}\n\nexport type TMessageComponentWidget = TMessageComponent<TMessageComponentWidgetData>\n\nexport type TMessageContentWidget = TMessageContentComponent<TMessageComponentWidgetData>\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[];\n\n\nexport const STATE_VARIABLE_HUMAN = 'human'\n\n/**\n * Human input message, include parameters and attachments\n */\nexport type TChatRequestHuman = {\n input?: string\n files?: Partial<File>[]\n [key: string]: unknown\n}\n\n/**\n * Command to resume with streaming after human decision\n */\nexport type TInterruptCommand = {\n resume?: any\n update?: any\n toolCalls?: ToolCall[]\n agentKey?: string\n}\n\nexport type TChatRequest = {\n /**\n * The human input, include parameters\n */\n input: TChatRequestHuman\n /**\n * Custom graph state\n */\n state?: {[STATE_VARIABLE_HUMAN]: TChatRequestHuman} & Record<string, any>\n agentKey?: string\n projectId?: string\n conversationId?: string\n environmentId?: string\n id?: string\n executionId?: string\n confirm?: boolean\n command?: TInterruptCommand\n retry?: boolean\n}\n\n/**\n * Data type for client effect message\n */\nexport type TClientEeffectMessage = {\n name: string\n args: Record<string, any>\n tool_call_id?: string\n agentKey?: string;\n created_date?: Date | string\n}\n","import type { ChatKitOptions, ChatKitTheme, ColorScheme } from './options';\n\n/**\n * Playground 配置白名单 - 只允许这些配置项从 playground 复制过来生效\n * 过滤掉: locale, initialThread, header, history, threadItemActions, disclaimer, entities, widgets, onClientTool\n */\n\n/**\n * 允许从 Playground 配置的选项类型\n */\nexport type PlaygroundAllowedOptions = {\n api?: ChatKitOptions['api'];\n theme?: ColorScheme | ChatKitTheme;\n composer?: ChatKitOptions['composer'];\n startScreen?: ChatKitOptions['startScreen'];\n};\n\n/**\n * 白名单配置项 key 列表\n */\nconst ALLOWED_KEYS: (keyof PlaygroundAllowedOptions)[] = [\n 'api',\n 'theme',\n 'composer',\n 'startScreen',\n];\n\n/**\n * 从 Playground 复制的配置中过滤出允许的配置项\n *\n * @param options - 从 playground 复制的完整配置\n * @returns 只包含白名单配置项的对象\n *\n * @example\n * ```ts\n * // 从 playground 复制的配置\n * const playgroundConfig = {\n * theme: { colorScheme: 'light', radius: 'pill' },\n * threadItemActions: { feedback: true }, // 会被过滤掉\n * startScreen: { greeting: 'Hello!' },\n * };\n *\n * const filtered = filterPlaygroundOptions(playgroundConfig);\n * // 结果: { theme: { colorScheme: 'light', radius: 'pill' }, startScreen: { greeting: 'Hello!' } }\n * ```\n */\nexport function filterPlaygroundOptions<T extends Partial<ChatKitOptions>>(\n options: T\n): PlaygroundAllowedOptions {\n const filtered: PlaygroundAllowedOptions = {};\n\n for (const key of ALLOWED_KEYS) {\n if (key in options && options[key] !== undefined) {\n // @ts-expect-error - 动态赋值\n filtered[key] = options[key];\n }\n }\n\n // fontSources is preserved - user must provide their own font URLs\n\n return filtered;\n}\n\n/**\n * 合并 Playground 配置与本地配置\n * Playground 配置会覆盖本地配置中的对应项(只限白名单内的配置)\n *\n * @param localOptions - 本地项目中的基础配置(可包含 onClientTool, header 等)\n * @param playgroundOptions - 从 playground 复制的配置\n * @returns 合并后的配置\n *\n * @example\n * ```ts\n * const localConfig = {\n * api: { getClientSecret: async () => '...' },\n * onClientTool: async () => { ... }, // 保留\n * header: { enabled: true }, // 保留\n * };\n *\n * const playgroundConfig = {\n * theme: { colorScheme: 'dark' },\n * threadItemActions: { feedback: true }, // 被过滤\n * };\n *\n * const merged = mergeWithPlaygroundOptions(localConfig, playgroundConfig);\n * // 结果: { api, onClientTool, header, theme }\n * ```\n */\nexport function mergeWithPlaygroundOptions<T extends Partial<ChatKitOptions>>(\n localOptions: T,\n playgroundOptions: Partial<ChatKitOptions>\n): T & PlaygroundAllowedOptions {\n const filteredPlayground = filterPlaygroundOptions(playgroundOptions);\n\n return {\n ...localOptions,\n ...filteredPlayground,\n };\n}\n"],"names":["__defProp","camelcaseModule","Serializable","_a","BaseMessageChunk","__defNormalProp","__publicField","__accessCheck","__privateAdd","__privateMethod","_a2","ChatMessageTypeEnum","ChatMessageEventTypeEnum","ChatM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