1 |
- {"ast":null,"code":"// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isRunnableInterface(thing) {\n return thing ? thing.lc_runnable : false;\n}\n/**\n * Utility to filter the root event in the streamEvents implementation.\n * This is simply binding the arguments to the namespace to make save on\n * a bit of typing in the streamEvents implementation.\n *\n * TODO: Refactor and remove.\n */\nexport class _RootEventFilter {\n constructor(fields) {\n Object.defineProperty(this, \"includeNames\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"includeTypes\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"includeTags\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"excludeNames\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"excludeTypes\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"excludeTags\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.includeNames = fields.includeNames;\n this.includeTypes = fields.includeTypes;\n this.includeTags = fields.includeTags;\n this.excludeNames = fields.excludeNames;\n this.excludeTypes = fields.excludeTypes;\n this.excludeTags = fields.excludeTags;\n }\n includeEvent(event, rootType) {\n var _event$tags;\n let include = this.includeNames === undefined && this.includeTypes === undefined && this.includeTags === undefined;\n const eventTags = (_event$tags = event.tags) !== null && _event$tags !== void 0 ? _event$tags : [];\n if (this.includeNames !== undefined) {\n include = include || this.includeNames.includes(event.name);\n }\n if (this.includeTypes !== undefined) {\n include = include || this.includeTypes.includes(rootType);\n }\n if (this.includeTags !== undefined) {\n include = include || eventTags.some(tag => {\n var _this$includeTags;\n return (_this$includeTags = this.includeTags) === null || _this$includeTags === void 0 ? void 0 : _this$includeTags.includes(tag);\n });\n }\n if (this.excludeNames !== undefined) {\n include = include && !this.excludeNames.includes(event.name);\n }\n if (this.excludeTypes !== undefined) {\n include = include && !this.excludeTypes.includes(rootType);\n }\n if (this.excludeTags !== undefined) {\n include = include && eventTags.every(tag => {\n var _this$excludeTags;\n return !((_this$excludeTags = this.excludeTags) !== null && _this$excludeTags !== void 0 && _this$excludeTags.includes(tag));\n });\n }\n return include;\n }\n}","map":{"version":3,"names":["isRunnableInterface","thing","lc_runnable","_RootEventFilter","constructor","fields","Object","defineProperty","enumerable","configurable","writable","value","includeNames","includeTypes","includeTags","excludeNames","excludeTypes","excludeTags","includeEvent","event","rootType","_event$tags","include","undefined","eventTags","tags","includes","name","some","tag","_this$includeTags","every","_this$excludeTags"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@langchain/core/dist/runnables/utils.js"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isRunnableInterface(thing) {\n return thing ? thing.lc_runnable : false;\n}\n/**\n * Utility to filter the root event in the streamEvents implementation.\n * This is simply binding the arguments to the namespace to make save on\n * a bit of typing in the streamEvents implementation.\n *\n * TODO: Refactor and remove.\n */\nexport class _RootEventFilter {\n constructor(fields) {\n Object.defineProperty(this, \"includeNames\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"includeTypes\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"includeTags\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"excludeNames\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"excludeTypes\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"excludeTags\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.includeNames = fields.includeNames;\n this.includeTypes = fields.includeTypes;\n this.includeTags = fields.includeTags;\n this.excludeNames = fields.excludeNames;\n this.excludeTypes = fields.excludeTypes;\n this.excludeTags = fields.excludeTags;\n }\n includeEvent(event, rootType) {\n let include = this.includeNames === undefined &&\n this.includeTypes === undefined &&\n this.includeTags === undefined;\n const eventTags = event.tags ?? [];\n if (this.includeNames !== undefined) {\n include = include || this.includeNames.includes(event.name);\n }\n if (this.includeTypes !== undefined) {\n include = include || this.includeTypes.includes(rootType);\n }\n if (this.includeTags !== undefined) {\n include =\n include || eventTags.some((tag) => this.includeTags?.includes(tag));\n }\n if (this.excludeNames !== undefined) {\n include = include && !this.excludeNames.includes(event.name);\n }\n if (this.excludeTypes !== undefined) {\n include = include && !this.excludeTypes.includes(rootType);\n }\n if (this.excludeTags !== undefined) {\n include =\n include && eventTags.every((tag) => !this.excludeTags?.includes(tag));\n }\n return include;\n }\n}\n"],"mappings":"AAAA;AACA,OAAO,SAASA,mBAAmBA,CAACC,KAAK,EAAE;EACvC,OAAOA,KAAK,GAAGA,KAAK,CAACC,WAAW,GAAG,KAAK;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CAACC,MAAM,EAAE;IAChBC,MAAM,CAACC,cAAc,CAAC,IAAI,EAAE,cAAc,EAAE;MACxCC,UAAU,EAAE,IAAI;MAChBC,YAAY,EAAE,IAAI;MAClBC,QAAQ,EAAE,IAAI;MACdC,KAAK,EAAE,KAAK;IAChB,CAAC,CAAC;IACFL,MAAM,CAACC,cAAc,CAAC,IAAI,EAAE,cAAc,EAAE;MACxCC,UAAU,EAAE,IAAI;MAChBC,YAAY,EAAE,IAAI;MAClBC,QAAQ,EAAE,IAAI;MACdC,KAAK,EAAE,KAAK;IAChB,CAAC,CAAC;IACFL,MAAM,CAACC,cAAc,CAAC,IAAI,EAAE,aAAa,EAAE;MACvCC,UAAU,EAAE,IAAI;MAChBC,YAAY,EAAE,IAAI;MAClBC,QAAQ,EAAE,IAAI;MACdC,KAAK,EAAE,KAAK;IAChB,CAAC,CAAC;IACFL,MAAM,CAACC,cAAc,CAAC,IAAI,EAAE,cAAc,EAAE;MACxCC,UAAU,EAAE,IA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