1 |
- {"ast":null,"code":"import _asyncToGenerator from \"F:/workspace/202226701027/huinongbao-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { zodToJsonSchema } from \"zod-to-json-schema\";\nimport { v4 as uuidv4, validate as isUuid } from \"uuid\";\nimport { isRunnableInterface } from \"./utils.js\";\nimport { drawMermaid, drawMermaidPng } from \"./graph_mermaid.js\";\nfunction nodeDataStr(id, data) {\n if (id !== undefined && !isUuid(id)) {\n return id;\n } else if (isRunnableInterface(data)) {\n try {\n let dataStr = data.getName();\n dataStr = dataStr.startsWith(\"Runnable\") ? dataStr.slice(\"Runnable\".length) : dataStr;\n return dataStr;\n } catch (error) {\n return data.getName();\n }\n } else {\n var _data$name;\n return (_data$name = data.name) !== null && _data$name !== void 0 ? _data$name : \"UnknownSchema\";\n }\n}\nfunction nodeDataJson(node) {\n // if node.data implements Runnable\n if (isRunnableInterface(node.data)) {\n return {\n type: \"runnable\",\n data: {\n id: node.data.lc_id,\n name: node.data.getName()\n }\n };\n } else {\n return {\n type: \"schema\",\n data: {\n ...zodToJsonSchema(node.data.schema),\n title: node.data.name\n }\n };\n }\n}\nexport class Graph {\n constructor(params) {\n var _params$nodes, _params$edges;\n Object.defineProperty(this, \"nodes\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n Object.defineProperty(this, \"edges\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: []\n });\n this.nodes = (_params$nodes = params === null || params === void 0 ? void 0 : params.nodes) !== null && _params$nodes !== void 0 ? _params$nodes : this.nodes;\n this.edges = (_params$edges = params === null || params === void 0 ? void 0 : params.edges) !== null && _params$edges !== void 0 ? _params$edges : this.edges;\n }\n // Convert the graph to a JSON-serializable format.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n toJSON() {\n const stableNodeIds = {};\n Object.values(this.nodes).forEach((node, i) => {\n stableNodeIds[node.id] = isUuid(node.id) ? i : node.id;\n });\n return {\n nodes: Object.values(this.nodes).map(node => ({\n id: stableNodeIds[node.id],\n ...nodeDataJson(node)\n })),\n edges: this.edges.map(edge => {\n const item = {\n source: stableNodeIds[edge.source],\n target: stableNodeIds[edge.target]\n };\n if (typeof edge.data !== \"undefined\") {\n item.data = edge.data;\n }\n if (typeof edge.conditional !== \"undefined\") {\n item.conditional = edge.conditional;\n }\n return item;\n })\n };\n }\n addNode(data, id,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n metadata) {\n if (id !== undefined && this.nodes[id] !== undefined) {\n throw new Error(`Node with id ${id} already exists`);\n }\n const nodeId = id !== null && id !== void 0 ? id : uuidv4();\n const node = {\n id: nodeId,\n data,\n name: nodeDataStr(id, data),\n metadata\n };\n this.nodes[nodeId] = node;\n return node;\n }\n removeNode(node) {\n // Remove the node from the nodes map\n delete this.nodes[node.id];\n // Filter out edges connected to the node\n this.edges = this.edges.filter(edge => edge.source !== node.id && edge.target !== node.id);\n }\n addEdge(source, target, data, conditional) {\n if (this.nodes[source.id] === undefined) {\n throw new Error(`Source node ${source.id} not in graph`);\n }\n if (this.nodes[target.id] === undefined) {\n throw new Error(`Target node ${target.id} not in graph`);\n }\n const edge = {\n source: source.id,\n target: target.id,\n data,\n conditional\n };\n this.edges.push(edge);\n return edge;\n }\n firstNode() {\n return _firstNode(this);\n }\n lastNode() {\n return _lastNode(this);\n }\n /**\n * Add all nodes and edges from another graph.\n * Note this doesn't check for duplicates, nor does it connect the graphs.\n */\n extend(graph, prefix = \"\") {\n let finalPrefix = prefix;\n const nodeIds = Object.values(graph.nodes).map(node => node.id);\n if (nodeIds.every(isUuid)) {\n finalPrefix = \"\";\n }\n const prefixed = id => {\n return finalPrefix ? `${finalPrefix}:${id}` : id;\n };\n Object.entries(graph.nodes).forEach(([key, value]) => {\n this.nodes[prefixed(key)] = {\n ...value,\n id: prefixed(key)\n };\n });\n const newEdges = graph.edges.map(edge => {\n return {\n ...edge,\n source: prefixed(edge.source),\n target: prefixed(edge.target)\n };\n });\n // Add all edges from the other graph\n this.edges = [...this.edges, ...newEdges];\n const first = graph.firstNode();\n const last = graph.lastNode();\n return [first ? {\n id: prefixed(first.id),\n data: first.data\n } : undefined, last ? {\n id: prefixed(last.id),\n data: last.data\n } : undefined];\n }\n trimFirstNode() {\n const firstNode = this.firstNode();\n if (firstNode && _firstNode(this, [firstNode.id])) {\n this.removeNode(firstNode);\n }\n }\n trimLastNode() {\n const lastNode = this.lastNode();\n if (lastNode && _lastNode(this, [lastNode.id])) {\n this.removeNode(lastNode);\n }\n }\n /**\n * Return a new graph with all nodes re-identified,\n * using their unique, readable names where possible.\n */\n reid() {\n const nodeLabels = Object.fromEntries(Object.values(this.nodes).map(node => [node.id, node.name]));\n const nodeLabelCounts = new Map();\n Object.values(nodeLabels).forEach(label => {\n nodeLabelCounts.set(label, (nodeLabelCounts.get(label) || 0) + 1);\n });\n const getNodeId = nodeId => {\n const label = nodeLabels[nodeId];\n if (isUuid(nodeId) && nodeLabelCounts.get(label) === 1) {\n return label;\n } else {\n return nodeId;\n }\n };\n return new Graph({\n nodes: Object.fromEntries(Object.entries(this.nodes).map(([id, node]) => [getNodeId(id), {\n ...node,\n id: getNodeId(id)\n }])),\n edges: this.edges.map(edge => ({\n ...edge,\n source: getNodeId(edge.source),\n target: getNodeId(edge.target)\n }))\n });\n }\n drawMermaid(params) {\n const {\n withStyles,\n curveStyle,\n nodeColors = {\n default: \"fill:#f2f0ff,line-height:1.2\",\n first: \"fill-opacity:0\",\n last: \"fill:#bfb6fc\"\n },\n wrapLabelNWords\n } = params !== null && params !== void 0 ? params : {};\n const graph = this.reid();\n const firstNode = graph.firstNode();\n const lastNode = graph.lastNode();\n return drawMermaid(graph.nodes, graph.edges, {\n firstNode: firstNode === null || firstNode === void 0 ? void 0 : firstNode.id,\n lastNode: lastNode === null || lastNode === void 0 ? void 0 : lastNode.id,\n withStyles,\n curveStyle,\n nodeColors,\n wrapLabelNWords\n });\n }\n drawMermaidPng(params) {\n var _this = this;\n return _asyncToGenerator(function* () {\n const mermaidSyntax = _this.drawMermaid(params);\n return drawMermaidPng(mermaidSyntax, {\n backgroundColor: params === null || params === void 0 ? void 0 : params.backgroundColor\n });\n })();\n }\n}\n/**\n * Find the single node that is not a target of any edge.\n * Exclude nodes/sources with ids in the exclude list.\n * If there is no such node, or there are multiple, return undefined.\n * When drawing the graph, this node would be the origin.\n */\nfunction _firstNode(graph, exclude = []) {\n const targets = new Set(graph.edges.filter(edge => !exclude.includes(edge.source)).map(edge => edge.target));\n const found = [];\n for (const node of Object.values(graph.nodes)) {\n if (!exclude.includes(node.id) && !targets.has(node.id)) {\n found.push(node);\n }\n }\n return found.length === 1 ? found[0] : undefined;\n}\n/**\n * Find the single node that is not a source of any edge.\n * Exclude nodes/targets with ids in the exclude list.\n * If there is no such node, or there are multiple, return undefined.\n * When drawing the graph, this node would be the destination.\n */\nfunction _lastNode(graph, exclude = []) {\n const sources = new Set(graph.edges.filter(edge => !exclude.includes(edge.target)).map(edge => edge.source));\n const found = [];\n for (const node of Object.values(graph.nodes)) {\n if (!exclude.includes(node.id) && !sources.has(node.id)) {\n found.push(node);\n }\n }\n return found.length === 1 ? found[0] : undefined;\n}","map":{"version":3,"names":["zodToJsonSchema","v4","uuidv4","validate","isUuid","isRunnableInterface","drawMermaid","drawMermaidPng","nodeDataStr","id","data","undefined","dataStr","getName","startsWith","slice","length","error","_data$name","name","nodeDataJson","node","type","lc_id","schema","title","Graph","constructor","params","_params$nodes","_params$edges","Object","defineProperty","enumerable","configurable","writable","value","nodes","edges","toJSON","stableNodeIds","values","forEach","i","map","edge","item","source","target","conditional","addNode","metadata","Error","nodeId","removeNode","filter","addEdge","push","firstNode","_firstNode","lastNode","_lastNode","extend","graph","prefix","finalPrefix","nodeIds","every","prefixed","entries","key","newEdges","first","last","trimFirstNode","trimLastNode","reid","nodeLabels","fromEntries","nodeLabelCounts","Map","label","set","get","getNodeId","withStyles","curveStyle","nodeColors","default","wrapLabelNWords","_this","_asyncToGenerator","mermaidSyntax","backgroundColor","exclude","targets","Set","includes","found","has","sources"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@langchain/core/dist/runnables/graph.js"],"sourcesContent":["import { zodToJsonSchema } from \"zod-to-json-schema\";\nimport { v4 as uuidv4, validate as isUuid } from \"uuid\";\nimport { isRunnableInterface } from \"./utils.js\";\nimport { drawMermaid, drawMermaidPng } from \"./graph_mermaid.js\";\nfunction nodeDataStr(id, data) {\n if (id !== undefined && !isUuid(id)) {\n return id;\n }\n else if (isRunnableInterface(data)) {\n try {\n let dataStr = data.getName();\n dataStr = dataStr.startsWith(\"Runnable\")\n ? dataStr.slice(\"Runnable\".length)\n : dataStr;\n return dataStr;\n }\n catch (error) {\n return data.getName();\n }\n }\n else {\n return data.name ?? \"UnknownSchema\";\n }\n}\nfunction nodeDataJson(node) {\n // if node.data implements Runnable\n if (isRunnableInterface(node.data)) {\n return {\n type: \"runnable\",\n data: {\n id: node.data.lc_id,\n name: node.data.getName(),\n },\n };\n }\n else {\n return {\n type: \"schema\",\n data: { ...zodToJsonSchema(node.data.schema), title: node.data.name },\n };\n }\n}\nexport class Graph {\n constructor(params) {\n Object.defineProperty(this, \"nodes\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n Object.defineProperty(this, \"edges\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: []\n });\n this.nodes = params?.nodes ?? this.nodes;\n this.edges = params?.edges ?? this.edges;\n }\n // Convert the graph to a JSON-serializable format.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n toJSON() {\n const stableNodeIds = {};\n Object.values(this.nodes).forEach((node, i) => {\n stableNodeIds[node.id] = isUuid(node.id) ? i : node.id;\n });\n return {\n nodes: Object.values(this.nodes).map((node) => ({\n id: stableNodeIds[node.id],\n ...nodeDataJson(node),\n })),\n edges: this.edges.map((edge) => {\n const item = {\n source: stableNodeIds[edge.source],\n target: stableNodeIds[edge.target],\n };\n if (typeof edge.data !== \"undefined\") {\n item.data = edge.data;\n }\n if (typeof edge.conditional !== \"undefined\") {\n item.conditional = edge.conditional;\n }\n return item;\n }),\n };\n }\n addNode(data, id, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n metadata) {\n if (id !== undefined && this.nodes[id] !== undefined) {\n throw new Error(`Node with id ${id} already exists`);\n }\n const nodeId = id ?? uuidv4();\n const node = {\n id: nodeId,\n data,\n name: nodeDataStr(id, data),\n metadata,\n };\n this.nodes[nodeId] = node;\n return node;\n }\n removeNode(node) {\n // Remove the node from the nodes map\n delete this.nodes[node.id];\n // Filter out edges connected to the node\n this.edges = this.edges.filter((edge) => edge.source !== node.id && edge.target !== node.id);\n }\n addEdge(source, target, data, conditional) {\n if (this.nodes[source.id] === undefined) {\n throw new Error(`Source node ${source.id} not in graph`);\n }\n if (this.nodes[target.id] === undefined) {\n throw new Error(`Target node ${target.id} not in graph`);\n }\n const edge = {\n source: source.id,\n target: target.id,\n data,\n conditional,\n };\n this.edges.push(edge);\n return edge;\n }\n firstNode() {\n return _firstNode(this);\n }\n lastNode() {\n return _lastNode(this);\n }\n /**\n * Add all nodes and edges from another graph.\n * Note this doesn't check for duplicates, nor does it connect the graphs.\n */\n extend(graph, prefix = \"\") {\n let finalPrefix = prefix;\n const nodeIds = Object.values(graph.nodes).map((node) => node.id);\n if (nodeIds.every(isUuid)) {\n finalPrefix = \"\";\n }\n const prefixed = (id) => {\n return finalPrefix ? `${finalPrefix}:${id}` : id;\n };\n Object.entries(graph.nodes).forEach(([key, value]) => {\n this.nodes[prefixed(key)] = { ...value, id: prefixed(key) };\n });\n const newEdges = graph.edges.map((edge) => {\n return {\n ...edge,\n source: prefixed(edge.source),\n target: prefixed(edge.target),\n };\n });\n // Add all edges from the other graph\n this.edges = [...this.edges, ...newEdges];\n const first = graph.firstNode();\n const last = graph.lastNode();\n return [\n first ? { id: prefixed(first.id), data: first.data } : undefined,\n last ? { id: prefixed(last.id), data: last.data } : undefined,\n ];\n }\n trimFirstNode() {\n const firstNode = this.firstNode();\n if (firstNode && _firstNode(this, [firstNode.id])) {\n this.removeNode(firstNode);\n }\n }\n trimLastNode() {\n const lastNode = this.lastNode();\n if (lastNode && _lastNode(this, [lastNode.id])) {\n this.removeNode(lastNode);\n }\n }\n /**\n * Return a new graph with all nodes re-identified,\n * using their unique, readable names where possible.\n */\n reid() {\n const nodeLabels = Object.fromEntries(Object.values(this.nodes).map((node) => [node.id, node.name]));\n const nodeLabelCounts = new Map();\n Object.values(nodeLabels).forEach((label) => {\n nodeLabelCounts.set(label, (nodeLabelCounts.get(label) || 0) + 1);\n });\n const getNodeId = (nodeId) => {\n const label = nodeLabels[nodeId];\n if (isUuid(nodeId) && nodeLabelCounts.get(label) === 1) {\n return label;\n }\n else {\n return nodeId;\n }\n };\n return new Graph({\n nodes: Object.fromEntries(Object.entries(this.nodes).map(([id, node]) => [\n getNodeId(id),\n { ...node, id: getNodeId(id) },\n ])),\n edges: this.edges.map((edge) => ({\n ...edge,\n source: getNodeId(edge.source),\n target: getNodeId(edge.target),\n })),\n });\n }\n drawMermaid(params) {\n const { withStyles, curveStyle, nodeColors = {\n default: \"fill:#f2f0ff,line-height:1.2\",\n first: \"fill-opacity:0\",\n last: \"fill:#bfb6fc\",\n }, wrapLabelNWords, } = params ?? {};\n const graph = this.reid();\n const firstNode = graph.firstNode();\n const lastNode = graph.lastNode();\n return drawMermaid(graph.nodes, graph.edges, {\n firstNode: firstNode?.id,\n lastNode: lastNode?.id,\n withStyles,\n curveStyle,\n nodeColors,\n wrapLabelNWords,\n });\n }\n async drawMermaidPng(params) {\n const mermaidSyntax = this.drawMermaid(params);\n return drawMermaidPng(mermaidSyntax, {\n backgroundColor: params?.backgroundColor,\n });\n }\n}\n/**\n * Find the single node that is not a target of any edge.\n * Exclude nodes/sources with ids in the exclude list.\n * If there is no such node, or there are multiple, return undefined.\n * When drawing the graph, this node would be the origin.\n */\nfunction _firstNode(graph, exclude = []) {\n const targets = new Set(graph.edges\n .filter((edge) => !exclude.includes(edge.source))\n .map((edge) => edge.target));\n const found = [];\n for (const node of Object.values(graph.nodes)) {\n if (!exclude.includes(node.id) && !targets.has(node.id)) {\n found.push(node);\n }\n }\n return found.length === 1 ? found[0] : undefined;\n}\n/**\n * Find the single node that is not a source of any edge.\n * Exclude nodes/targets with ids in the exclude list.\n * If there is no such node, or there are multiple, return undefined.\n * When drawing the graph, this node would be the destination.\n */\nfunction _lastNode(graph, exclude = []) {\n const sources = new Set(graph.edges\n .filter((edge) => !exclude.includes(edge.target))\n .map((edge) => edge.source));\n const found = [];\n for (const node of Object.values(graph.nodes)) {\n if (!exclude.includes(node.id) && !sources.has(node.id)) {\n found.push(node);\n }\n }\n return found.length === 1 ? found[0] : undefined;\n}\n"],"mappings":";AAAA,SAASA,eAAe,QAAQ,oBAAoB;AACpD,SAASC,EAAE,IAAIC,MAAM,EAAEC,QAAQ,IAAIC,MAAM,QAAQ,MAAM;AACvD,SAASC,mBAAmB,QAAQ,YAAY;AAChD,SAASC,WAAW,EAAEC,cAAc,QAAQ,oBAAoB;AAChE,SAASC,WAAWA,CAACC,EAAE,EAAEC,IAAI,EAAE;EAC3B,IAAID,EAAE,KAAKE,SAAS,IAAI,CAACP,MAAM,CAACK,EAAE,CAAC,EAAE;IACjC,OAAOA,EAAE;EACb,CAAC,MACI,IAAIJ,mBAAmB,CAACK,IAAI,CAAC,EAAE;IAChC,IAAI;MACA,IAAIE,OAAO,GAAGF,IAAI,CAACG,OAAO,CAAC,CAAC;MAC5BD,OAAO,GAAGA,OAAO,CAACE,UAAU,CAAC,UAAU,CAAC,GAClCF,OAAO,CAACG,KAAK,CAAC,UAAU,CAACC,MAAM,CAAC,GAChCJ,OAAO;MACb,OAAOA,OAAO;IAClB,CAAC,CACD,OAAOK,KAAK,EAAE;MACV,OAAOP,IAAI,CAACG,OAAO,CAAC,CAAC;IACzB;EACJ,CAAC,MACI;IAAA,IAAAK,UAAA;IACD,QAAAA,UAAA,GAAOR,IAAI,CAACS,IAAI,cAAAD,UAAA,cAAAA,UAAA,GAAI,eAAe;EACvC;AACJ;AACA,S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