UNPKG

@langchain/core

Version:
1 lines 1.07 kB
{"version":3,"file":"context.cjs","names":["AsyncLocalStorageProviderSingleton","AsyncLocalStorage"],"sources":["../src/context.ts"],"sourcesContent":["/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */\n\n/**\n * This file exists as a convenient public entrypoint for functionality\n * related to context variables.\n *\n * Because it automatically initializes AsyncLocalStorage, internal\n * functionality SHOULD NEVER import from this file outside of tests.\n */\n\nimport { AsyncLocalStorage } from \"node:async_hooks\";\nimport { AsyncLocalStorageProviderSingleton } from \"./singletons/index.js\";\nimport {\n getContextVariable,\n setContextVariable,\n type ConfigureHook,\n registerConfigureHook,\n} from \"./singletons/async_local_storage/context.js\";\n\nAsyncLocalStorageProviderSingleton.initializeGlobalInstance(\n new AsyncLocalStorage()\n);\n\nexport {\n getContextVariable,\n setContextVariable,\n registerConfigureHook,\n type ConfigureHook,\n};\n\nexport const foo = \"bar\";\n"],"mappings":";;;;;;;AAmBAA,iDAAmC,yBACjC,IAAIC,qCACL;AASD,MAAa,MAAM"}