@langchain/angular 0.1.3 → 0.2.0

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.
Files changed (158) hide show
  1. package/README.md +260 -3
  2. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.cjs +9 -0
  3. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.js +9 -0
  4. package/dist/context.cjs +143 -0
  5. package/dist/context.cjs.map +1 -0
  6. package/dist/context.d.cts +175 -0
  7. package/dist/context.d.cts.map +1 -0
  8. package/dist/context.d.ts +175 -0
  9. package/dist/context.d.ts.map +1 -0
  10. package/dist/context.js +139 -0
  11. package/dist/context.js.map +1 -0
  12. package/dist/index.cjs +111 -2
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +68 -1
  15. package/dist/index.d.cts.map +1 -1
  16. package/dist/index.d.ts +68 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +102 -4
  19. package/dist/index.js.map +1 -1
  20. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/channels/base.d.cts +83 -0
  21. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/channels/base.d.cts.map +1 -0
  22. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/channels/base.d.ts +83 -0
  23. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/channels/base.d.ts.map +1 -0
  24. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/constants.d.cts +42 -0
  25. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/constants.d.cts.map +1 -0
  26. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/constants.d.ts +42 -0
  27. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/constants.d.ts.map +1 -0
  28. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/graph/zod/index.d.cts +2 -0
  29. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/graph/zod/index.d.ts +2 -0
  30. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/graph/zod/meta.d.cts +109 -0
  31. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/graph/zod/meta.d.cts.map +1 -0
  32. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/graph/zod/meta.d.ts +109 -0
  33. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/graph/zod/meta.d.ts.map +1 -0
  34. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/graph/zod/plugin.d.cts +31 -0
  35. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/graph/zod/plugin.d.cts.map +1 -0
  36. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/graph/zod/plugin.d.ts +31 -0
  37. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/graph/zod/plugin.d.ts.map +1 -0
  38. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/graph/zod/zod-registry.d.cts +49 -0
  39. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/graph/zod/zod-registry.d.cts.map +1 -0
  40. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/graph/zod/zod-registry.d.ts +49 -0
  41. package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.1_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27._db5dc2b7d473236f1e1bf7d3e1a7ed18/node_modules/@langchain/langgraph/dist/graph/zod/zod-registry.d.ts.map +1 -0
  42. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/ReactAgent.d.cts +1 -0
  43. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/ReactAgent.d.ts +1 -0
  44. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/index.d.cts +1 -0
  45. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/index.d.ts +1 -0
  46. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/contextEditing.d.cts +1 -0
  47. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/contextEditing.d.ts +1 -0
  48. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/dynamicSystemPrompt.d.cts +1 -0
  49. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/dynamicSystemPrompt.d.ts +1 -0
  50. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/hitl.d.cts +1 -0
  51. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/hitl.d.ts +1 -0
  52. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/llmToolSelector.d.cts +1 -0
  53. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/llmToolSelector.d.ts +1 -0
  54. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/modelCallLimit.d.cts +1 -0
  55. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/modelCallLimit.d.ts +1 -0
  56. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/modelFallback.d.cts +1 -0
  57. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/modelFallback.d.ts +1 -0
  58. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/modelRetry.d.cts +1 -0
  59. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/modelRetry.d.ts +1 -0
  60. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/pii.d.cts +1 -0
  61. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/pii.d.ts +1 -0
  62. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/piiRedaction.d.cts +1 -0
  63. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/piiRedaction.d.ts +1 -0
  64. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/provider/anthropic/promptCaching.d.cts +1 -0
  65. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/provider/anthropic/promptCaching.d.ts +1 -0
  66. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/provider/openai/moderation.d.cts +1 -0
  67. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/provider/openai/moderation.d.ts +1 -0
  68. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/summarization.d.cts +1 -0
  69. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/summarization.d.ts +1 -0
  70. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/todoListMiddleware.d.cts +1 -0
  71. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/todoListMiddleware.d.ts +1 -0
  72. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/toolCallLimit.d.cts +1 -0
  73. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/toolCallLimit.d.ts +1 -0
  74. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/toolEmulator.d.cts +1 -0
  75. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/toolEmulator.d.ts +1 -0
  76. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/toolRetry.d.cts +1 -0
  77. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/toolRetry.d.ts +1 -0
  78. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/types.d.cts +2 -0
  79. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware/types.d.ts +2 -0
  80. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware.d.cts +1 -0
  81. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/middleware.d.ts +1 -0
  82. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/types.d.cts +2 -0
  83. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/agents/types.d.ts +2 -0
  84. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/index.d.cts +2 -0
  85. package/dist/node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/index.d.ts +2 -0
  86. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/ZodError.d.cts +155 -0
  87. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/ZodError.d.cts.map +1 -0
  88. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/ZodError.d.ts +155 -0
  89. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/ZodError.d.ts.map +1 -0
  90. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/errorUtil.d.cts +13 -0
  91. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/errorUtil.d.cts.map +1 -0
  92. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/errorUtil.d.ts +13 -0
  93. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/errorUtil.d.ts.map +1 -0
  94. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/parseUtil.d.cts +63 -0
  95. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/parseUtil.d.cts.map +1 -0
  96. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/parseUtil.d.ts +63 -0
  97. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/parseUtil.d.ts.map +1 -0
  98. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/typeAliases.d.cts +5 -0
  99. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/typeAliases.d.cts.map +1 -0
  100. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/typeAliases.d.ts +5 -0
  101. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/typeAliases.d.ts.map +1 -0
  102. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/util.d.cts +64 -0
  103. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/util.d.cts.map +1 -0
  104. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/util.d.ts +64 -0
  105. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/util.d.ts.map +1 -0
  106. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/standard-schema.d.cts +106 -0
  107. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/standard-schema.d.cts.map +1 -0
  108. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/standard-schema.d.ts +106 -0
  109. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/standard-schema.d.ts.map +1 -0
  110. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/types.d.cts +291 -0
  111. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/types.d.cts.map +1 -0
  112. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/types.d.ts +291 -0
  113. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/types.d.ts.map +1 -0
  114. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.cts +29 -0
  115. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.cts.map +1 -0
  116. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.ts +29 -0
  117. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.ts.map +1 -0
  118. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.cts +29 -0
  119. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.cts.map +1 -0
  120. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.ts +29 -0
  121. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.ts.map +1 -0
  122. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.cts +105 -0
  123. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.cts.map +1 -0
  124. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.ts +105 -0
  125. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.ts.map +1 -0
  126. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.cts +70 -0
  127. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.cts.map +1 -0
  128. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.ts +70 -0
  129. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.ts.map +1 -0
  130. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.cts +24 -0
  131. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.cts.map +1 -0
  132. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.ts +24 -0
  133. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.ts.map +1 -0
  134. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.cts +97 -0
  135. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.cts.map +1 -0
  136. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.ts +97 -0
  137. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.ts.map +1 -0
  138. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.cts +79 -0
  139. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.cts.map +1 -0
  140. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.ts +79 -0
  141. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.ts.map +1 -0
  142. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.cts +52 -0
  143. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.cts.map +1 -0
  144. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.ts +52 -0
  145. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.ts.map +1 -0
  146. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.cts +17 -0
  147. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.cts.map +1 -0
  148. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.ts +17 -0
  149. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.ts.map +1 -0
  150. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.cts +9 -0
  151. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.cts.map +1 -0
  152. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.ts +9 -0
  153. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.ts.map +1 -0
  154. package/dist/stream.custom.cjs +22 -1
  155. package/dist/stream.custom.cjs.map +1 -1
  156. package/dist/stream.custom.js +22 -1
  157. package/dist/stream.custom.js.map +1 -1
  158. package/package.json +9 -11
@@ -0,0 +1,175 @@
1
+ import { BaseMessage as BaseMessage$1 } from "./node_modules/.pnpm/langchain@1.2.30_@langchain_core@1.1.31_@opentelemetry_api@1.9.0_openai@6.27.0_ws@8.19._0520fb05d9e85da5f9e061dfe28cdbc8/node_modules/langchain/dist/index.js";
2
+ import { useStream } from "./index.js";
3
+ import * as _angular_core0 from "@angular/core";
4
+ import { EnvironmentProviders, InjectionToken } from "@angular/core";
5
+ import * as _langchain_langgraph_sdk_ui0 from "@langchain/langgraph-sdk/ui";
6
+ import { InferBag, InferStateType, ResolveStreamOptions, UseStreamCustomOptions } from "@langchain/langgraph-sdk/ui";
7
+ import * as _langchain_langgraph_sdk0 from "@langchain/langgraph-sdk";
8
+ import { BagTemplate, Client } from "@langchain/langgraph-sdk";
9
+ import * as _langchain_core_messages0 from "@langchain/core/messages";
10
+
11
+ //#region src/context.d.ts
12
+ /**
13
+ * Configuration defaults for `useStream` and `injectStream` calls.
14
+ */
15
+ interface StreamDefaults {
16
+ /** Base URL of the LangGraph API. */
17
+ apiUrl?: string;
18
+ /** API key for authenticating with the LangGraph API. */
19
+ apiKey?: string;
20
+ /** Pre-configured Client instance. */
21
+ client?: Client;
22
+ }
23
+ /**
24
+ * Injection token for stream default configuration.
25
+ * Provide via `provideStreamDefaults()` in your application config.
26
+ */
27
+ declare const STREAM_DEFAULTS: InjectionToken<StreamDefaults>;
28
+ /**
29
+ * Injection token for a shared stream instance.
30
+ * Provide via `provideStream()` at the component level.
31
+ */
32
+ declare const STREAM_INSTANCE: InjectionToken<any>;
33
+ /**
34
+ * Provides default LangGraph configuration at the application level.
35
+ *
36
+ * Use this in your application's `providers` array to set defaults like
37
+ * `apiUrl` that will be used by all `useStream` and `injectStream` calls.
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * // app.config.ts
42
+ * import { ApplicationConfig } from "@angular/core";
43
+ * import { provideStreamDefaults } from "@langchain/angular";
44
+ *
45
+ * export const appConfig: ApplicationConfig = {
46
+ * providers: [
47
+ * provideStreamDefaults({
48
+ * apiUrl: "http://localhost:2024",
49
+ * }),
50
+ * ],
51
+ * };
52
+ * ```
53
+ */
54
+ declare function provideStreamDefaults(defaults: StreamDefaults): EnvironmentProviders;
55
+ /**
56
+ * Creates a provider for a shared `useStream` instance at the component level.
57
+ *
58
+ * Add the returned provider to a component's `providers` array so that all
59
+ * child components can access the same stream via `injectStream()`.
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * import { Component } from "@angular/core";
64
+ * import { provideStream, injectStream } from "@langchain/angular";
65
+ *
66
+ * @Component({
67
+ * providers: [provideStream({ assistantId: "agent" })],
68
+ * template: `
69
+ * <app-message-list />
70
+ * <app-message-input />
71
+ * `,
72
+ * })
73
+ * export class ChatContainer {}
74
+ *
75
+ * // In child components:
76
+ * @Component({
77
+ * template: `
78
+ * @for (msg of stream.messages(); track msg.id) {
79
+ * <div>{{ msg.content }}</div>
80
+ * }
81
+ * `,
82
+ * })
83
+ * export class MessageListComponent {
84
+ * stream = injectStream();
85
+ * }
86
+ * ```
87
+ */
88
+ declare function provideStream<T = Record<string, unknown>, Bag extends BagTemplate = BagTemplate>(options: ResolveStreamOptions<T, InferBag<T, Bag>> | UseStreamCustomOptions<InferStateType<T>, InferBag<T, Bag>>): {
89
+ provide: InjectionToken<any>;
90
+ useFactory: () => {
91
+ values: _angular_core0.Signal<Record<string, unknown>>;
92
+ error: _angular_core0.Signal<unknown>;
93
+ isLoading: _angular_core0.WritableSignal<boolean>;
94
+ isThreadLoading: _angular_core0.Signal<boolean>;
95
+ interrupt: _angular_core0.Signal<_langchain_langgraph_sdk0.Interrupt<unknown> | undefined>;
96
+ interrupts: _angular_core0.Signal<_langchain_langgraph_sdk0.Interrupt<unknown>[]>;
97
+ stop: () => Promise<void>;
98
+ branch: _angular_core0.WritableSignal<string>;
99
+ setBranch: (branch: string) => void;
100
+ experimental_branchTree: _angular_core0.Signal<_langchain_langgraph_sdk_ui0.Sequence<Record<string, unknown>>>;
101
+ toolProgress: _angular_core0.Signal<_langchain_langgraph_sdk0.ToolProgress[]>;
102
+ client: Client<_langchain_langgraph_sdk0.DefaultValues, _langchain_langgraph_sdk0.DefaultValues, unknown>;
103
+ assistantId: string;
104
+ joinStream: (runId: string, lastEventId?: string | undefined, options?: {
105
+ streamMode?: _langchain_langgraph_sdk0.StreamMode[] | _langchain_langgraph_sdk0.StreamMode | undefined;
106
+ filter?: ((event: {
107
+ id?: string | undefined;
108
+ event: _langchain_langgraph_sdk0.StreamEvent;
109
+ data: unknown;
110
+ }) => boolean) | undefined;
111
+ } | undefined) => Promise<void>;
112
+ switchThread: (newThreadId: string | null) => void;
113
+ queue: {
114
+ entries: _angular_core0.WritableSignal<readonly _langchain_langgraph_sdk_ui0.QueueEntry<Record<string, unknown>, _langchain_langgraph_sdk_ui0.SubmitOptions<Record<string, unknown>, Record<string, unknown>>>[]>;
115
+ size: _angular_core0.WritableSignal<number>;
116
+ cancel: (id: string) => Promise<boolean>;
117
+ clear: () => Promise<void>;
118
+ };
119
+ messages: _angular_core0.Signal<BaseMessage$1<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[]>;
120
+ getMessagesMetadata: (message: BaseMessage$1<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>, index?: number | undefined) => _langchain_langgraph_sdk_ui0.MessageMetadata<Record<string, unknown>> | undefined;
121
+ history: _angular_core0.Signal<_langchain_langgraph_sdk0.ThreadState<Omit<Record<string, unknown>, "messages"> & {
122
+ messages: BaseMessage$1<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[];
123
+ }>[]>;
124
+ submit: (values: {
125
+ [x: string]: unknown;
126
+ } | null | undefined, options?: _langchain_langgraph_sdk_ui0.SubmitOptions<Record<string, unknown>, Record<string, unknown>> | undefined) => Promise<void>;
127
+ };
128
+ };
129
+ /**
130
+ * Injects the shared stream instance from the nearest ancestor that
131
+ * provided one via `provideStream()`.
132
+ *
133
+ * Throws if no ancestor provides a stream instance.
134
+ *
135
+ * @example
136
+ * ```typescript
137
+ * import { Component } from "@angular/core";
138
+ * import { injectStream } from "@langchain/angular";
139
+ *
140
+ * @Component({
141
+ * template: `
142
+ * @for (msg of stream.messages(); track msg.id) {
143
+ * <div>{{ msg.content }}</div>
144
+ * }
145
+ * <button
146
+ * [disabled]="stream.isLoading()"
147
+ * (click)="onSubmit()"
148
+ * >Send</button>
149
+ * `,
150
+ * })
151
+ * export class ChatComponent {
152
+ * stream = injectStream();
153
+ *
154
+ * onSubmit() {
155
+ * void this.stream.submit({
156
+ * messages: [{ type: "human", content: "Hello!" }],
157
+ * });
158
+ * }
159
+ * }
160
+ * ```
161
+ *
162
+ * @example With type parameters for full type safety:
163
+ * ```typescript
164
+ * import type { agent } from "./agent";
165
+ *
166
+ * export class ChatComponent {
167
+ * stream = injectStream<typeof agent>();
168
+ * // stream.messages() returns typed messages
169
+ * }
170
+ * ```
171
+ */
172
+ declare function injectStream<T = Record<string, unknown>, Bag extends BagTemplate = BagTemplate>(): ReturnType<typeof useStream<T, Bag>>;
173
+ //#endregion
174
+ export { STREAM_DEFAULTS, STREAM_INSTANCE, StreamDefaults, injectStream, provideStream, provideStreamDefaults };
175
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","names":[],"sources":["../src/context.ts"],"mappings":";;;;;;;;;;;;;;UAmBiB,cAAA;;EAEf,MAAA;EAFe;EAIf,MAAA;;EAEA,MAAA,GAAS,MAAA;AAAA;;;;;cAOE,eAAA,EAAe,cAAA,CAAA,cAAA;AAA5B;;;;AAAA,cASa,eAAA,EAAe,cAAA;AAA5B;;;;;AAyBA;;;;;;;;;AAyCA;;;;;;;AAlEA,iBAyBgB,qBAAA,CACd,QAAA,EAAU,cAAA,GACT,oBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuCa,aAAA,KACV,MAAA,+BACQ,WAAA,GAAc,WAAA,CAAA,CAE1B,OAAA,EACI,oBAAA,CAAqB,CAAA,EAAG,QAAA,CAAS,CAAA,EAAG,GAAA,KACpC,sBAAA,CAAuB,cAAA,CAAe,CAAA,GAAI,QAAA,CAAS,CAAA,EAAG,GAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6D5C,YAAA,KACV,MAAA,+BACQ,WAAA,GAAc,WAAA,CAAA,CAAA,GACvB,UAAA,QAAkB,SAAA,CAAU,CAAA,EAAG,GAAA"}
@@ -0,0 +1,139 @@
1
+ import { useStream } from "./index.js";
2
+ import { InjectionToken, inject, makeEnvironmentProviders } from "@angular/core";
3
+ //#region src/context.ts
4
+ /**
5
+ * Injection token for stream default configuration.
6
+ * Provide via `provideStreamDefaults()` in your application config.
7
+ */
8
+ const STREAM_DEFAULTS = new InjectionToken("LANGCHAIN_STREAM_DEFAULTS");
9
+ /**
10
+ * Injection token for a shared stream instance.
11
+ * Provide via `provideStream()` at the component level.
12
+ */
13
+ const STREAM_INSTANCE = new InjectionToken("LANGCHAIN_STREAM_INSTANCE");
14
+ /**
15
+ * Provides default LangGraph configuration at the application level.
16
+ *
17
+ * Use this in your application's `providers` array to set defaults like
18
+ * `apiUrl` that will be used by all `useStream` and `injectStream` calls.
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * // app.config.ts
23
+ * import { ApplicationConfig } from "@angular/core";
24
+ * import { provideStreamDefaults } from "@langchain/angular";
25
+ *
26
+ * export const appConfig: ApplicationConfig = {
27
+ * providers: [
28
+ * provideStreamDefaults({
29
+ * apiUrl: "http://localhost:2024",
30
+ * }),
31
+ * ],
32
+ * };
33
+ * ```
34
+ */
35
+ function provideStreamDefaults(defaults) {
36
+ return makeEnvironmentProviders([{
37
+ provide: STREAM_DEFAULTS,
38
+ useValue: defaults
39
+ }]);
40
+ }
41
+ /**
42
+ * Creates a provider for a shared `useStream` instance at the component level.
43
+ *
44
+ * Add the returned provider to a component's `providers` array so that all
45
+ * child components can access the same stream via `injectStream()`.
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * import { Component } from "@angular/core";
50
+ * import { provideStream, injectStream } from "@langchain/angular";
51
+ *
52
+ * @Component({
53
+ * providers: [provideStream({ assistantId: "agent" })],
54
+ * template: `
55
+ * <app-message-list />
56
+ * <app-message-input />
57
+ * `,
58
+ * })
59
+ * export class ChatContainer {}
60
+ *
61
+ * // In child components:
62
+ * @Component({
63
+ * template: `
64
+ * @for (msg of stream.messages(); track msg.id) {
65
+ * <div>{{ msg.content }}</div>
66
+ * }
67
+ * `,
68
+ * })
69
+ * export class MessageListComponent {
70
+ * stream = injectStream();
71
+ * }
72
+ * ```
73
+ */
74
+ function provideStream(options) {
75
+ return {
76
+ provide: STREAM_INSTANCE,
77
+ useFactory: () => {
78
+ const defaults = inject(STREAM_DEFAULTS, { optional: true });
79
+ return useStream({
80
+ ...defaults ?? {},
81
+ ...options,
82
+ apiUrl: options.apiUrl ?? defaults?.apiUrl,
83
+ client: options.client ?? defaults?.client
84
+ });
85
+ }
86
+ };
87
+ }
88
+ /**
89
+ * Injects the shared stream instance from the nearest ancestor that
90
+ * provided one via `provideStream()`.
91
+ *
92
+ * Throws if no ancestor provides a stream instance.
93
+ *
94
+ * @example
95
+ * ```typescript
96
+ * import { Component } from "@angular/core";
97
+ * import { injectStream } from "@langchain/angular";
98
+ *
99
+ * @Component({
100
+ * template: `
101
+ * @for (msg of stream.messages(); track msg.id) {
102
+ * <div>{{ msg.content }}</div>
103
+ * }
104
+ * <button
105
+ * [disabled]="stream.isLoading()"
106
+ * (click)="onSubmit()"
107
+ * >Send</button>
108
+ * `,
109
+ * })
110
+ * export class ChatComponent {
111
+ * stream = injectStream();
112
+ *
113
+ * onSubmit() {
114
+ * void this.stream.submit({
115
+ * messages: [{ type: "human", content: "Hello!" }],
116
+ * });
117
+ * }
118
+ * }
119
+ * ```
120
+ *
121
+ * @example With type parameters for full type safety:
122
+ * ```typescript
123
+ * import type { agent } from "./agent";
124
+ *
125
+ * export class ChatComponent {
126
+ * stream = injectStream<typeof agent>();
127
+ * // stream.messages() returns typed messages
128
+ * }
129
+ * ```
130
+ */
131
+ function injectStream() {
132
+ const instance = inject(STREAM_INSTANCE, { optional: true });
133
+ if (instance == null) throw new Error("injectStream() requires an ancestor component to provide a stream via provideStream(). Add provideStream({ assistantId: '...' }) to the providers array of a parent component, or use useStream() directly.");
134
+ return instance;
135
+ }
136
+ //#endregion
137
+ export { STREAM_DEFAULTS, STREAM_INSTANCE, injectStream, provideStream, provideStreamDefaults };
138
+
139
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","names":["angularInject"],"sources":["../src/context.ts"],"sourcesContent":["import {\n InjectionToken,\n inject as angularInject,\n type EnvironmentProviders,\n makeEnvironmentProviders,\n} from \"@angular/core\";\nimport type { BagTemplate } from \"@langchain/langgraph-sdk\";\nimport { Client } from \"@langchain/langgraph-sdk\";\nimport type {\n ResolveStreamOptions,\n InferBag,\n InferStateType,\n UseStreamCustomOptions,\n} from \"@langchain/langgraph-sdk/ui\";\nimport { useStream } from \"./index.js\";\n\n/**\n * Configuration defaults for `useStream` and `injectStream` calls.\n */\nexport interface StreamDefaults {\n /** Base URL of the LangGraph API. */\n apiUrl?: string;\n /** API key for authenticating with the LangGraph API. */\n apiKey?: string;\n /** Pre-configured Client instance. */\n client?: Client;\n}\n\n/**\n * Injection token for stream default configuration.\n * Provide via `provideStreamDefaults()` in your application config.\n */\nexport const STREAM_DEFAULTS = new InjectionToken<StreamDefaults>(\n \"LANGCHAIN_STREAM_DEFAULTS\",\n);\n\n/**\n * Injection token for a shared stream instance.\n * Provide via `provideStream()` at the component level.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const STREAM_INSTANCE = new InjectionToken<any>(\n \"LANGCHAIN_STREAM_INSTANCE\",\n);\n\n/**\n * Provides default LangGraph configuration at the application level.\n *\n * Use this in your application's `providers` array to set defaults like\n * `apiUrl` that will be used by all `useStream` and `injectStream` calls.\n *\n * @example\n * ```typescript\n * // app.config.ts\n * import { ApplicationConfig } from \"@angular/core\";\n * import { provideStreamDefaults } from \"@langchain/angular\";\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideStreamDefaults({\n * apiUrl: \"http://localhost:2024\",\n * }),\n * ],\n * };\n * ```\n */\nexport function provideStreamDefaults(\n defaults: StreamDefaults,\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: STREAM_DEFAULTS, useValue: defaults },\n ]);\n}\n\n/**\n * Creates a provider for a shared `useStream` instance at the component level.\n *\n * Add the returned provider to a component's `providers` array so that all\n * child components can access the same stream via `injectStream()`.\n *\n * @example\n * ```typescript\n * import { Component } from \"@angular/core\";\n * import { provideStream, injectStream } from \"@langchain/angular\";\n *\n * @Component({\n * providers: [provideStream({ assistantId: \"agent\" })],\n * template: `\n * <app-message-list />\n * <app-message-input />\n * `,\n * })\n * export class ChatContainer {}\n *\n * // In child components:\n * @Component({\n * template: `\n * @for (msg of stream.messages(); track msg.id) {\n * <div>{{ msg.content }}</div>\n * }\n * `,\n * })\n * export class MessageListComponent {\n * stream = injectStream();\n * }\n * ```\n */\nexport function provideStream<\n T = Record<string, unknown>,\n Bag extends BagTemplate = BagTemplate,\n>(\n options:\n | ResolveStreamOptions<T, InferBag<T, Bag>>\n | UseStreamCustomOptions<InferStateType<T>, InferBag<T, Bag>>,\n) {\n return {\n provide: STREAM_INSTANCE,\n useFactory: () => {\n const defaults = angularInject(STREAM_DEFAULTS, { optional: true });\n const merged = {\n ...(defaults ?? {}),\n ...options,\n apiUrl: (options as Record<string, unknown>).apiUrl ?? defaults?.apiUrl,\n client: (options as Record<string, unknown>).client ?? defaults?.client,\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return useStream(merged as any);\n },\n };\n}\n\n/**\n * Injects the shared stream instance from the nearest ancestor that\n * provided one via `provideStream()`.\n *\n * Throws if no ancestor provides a stream instance.\n *\n * @example\n * ```typescript\n * import { Component } from \"@angular/core\";\n * import { injectStream } from \"@langchain/angular\";\n *\n * @Component({\n * template: `\n * @for (msg of stream.messages(); track msg.id) {\n * <div>{{ msg.content }}</div>\n * }\n * <button\n * [disabled]=\"stream.isLoading()\"\n * (click)=\"onSubmit()\"\n * >Send</button>\n * `,\n * })\n * export class ChatComponent {\n * stream = injectStream();\n *\n * onSubmit() {\n * void this.stream.submit({\n * messages: [{ type: \"human\", content: \"Hello!\" }],\n * });\n * }\n * }\n * ```\n *\n * @example With type parameters for full type safety:\n * ```typescript\n * import type { agent } from \"./agent\";\n *\n * export class ChatComponent {\n * stream = injectStream<typeof agent>();\n * // stream.messages() returns typed messages\n * }\n * ```\n */\nexport function injectStream<\n T = Record<string, unknown>,\n Bag extends BagTemplate = BagTemplate,\n>(): ReturnType<typeof useStream<T, Bag>> {\n const instance = angularInject(STREAM_INSTANCE, { optional: true });\n if (instance == null) {\n throw new Error(\n \"injectStream() requires an ancestor component to provide a stream via provideStream(). \" +\n \"Add provideStream({ assistantId: '...' }) to the providers array of a parent component, \" +\n \"or use useStream() directly.\",\n );\n }\n return instance;\n}\n"],"mappings":";;;;;;;AAgCA,MAAa,kBAAkB,IAAI,eACjC,4BACD;;;;;AAOD,MAAa,kBAAkB,IAAI,eACjC,4BACD;;;;;;;;;;;;;;;;;;;;;;AAuBD,SAAgB,sBACd,UACsB;AACtB,QAAO,yBAAyB,CAC9B;EAAE,SAAS;EAAiB,UAAU;EAAU,CACjD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCJ,SAAgB,cAId,SAGA;AACA,QAAO;EACL,SAAS;EACT,kBAAkB;GAChB,MAAM,WAAWA,OAAc,iBAAiB,EAAE,UAAU,MAAM,CAAC;AAQnE,UAAO,UAPQ;IACb,GAAI,YAAY,EAAE;IAClB,GAAG;IACH,QAAS,QAAoC,UAAU,UAAU;IACjE,QAAS,QAAoC,UAAU,UAAU;IAClE,CAE8B;;EAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CH,SAAgB,eAG0B;CACxC,MAAM,WAAWA,OAAc,iBAAiB,EAAE,UAAU,MAAM,CAAC;AACnE,KAAI,YAAY,KACd,OAAM,IAAI,MACR,8MAGD;AAEH,QAAO"}
package/dist/index.cjs CHANGED
@@ -1,5 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_stream_custom = require("./stream.custom.cjs");
3
+ const require_decorate = require("./_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.cjs");
4
+ const require_context = require("./context.cjs");
3
5
  let _angular_core = require("@angular/core");
4
6
  let _langchain_langgraph_sdk_ui = require("@langchain/langgraph-sdk/ui");
5
7
  let _langchain_langgraph_sdk = require("@langchain/langgraph-sdk");
@@ -120,9 +122,20 @@ function useStreamLGP(options) {
120
122
  queueEntries.set(pendingRuns.entries);
121
123
  queueSize.set(pendingRuns.size);
122
124
  });
123
- (0, _angular_core.effect)(() => {
125
+ (0, _angular_core.effect)((onCleanup) => {
124
126
  const hvMessages = getMessages(historyValues());
125
- if (options.filterSubagentMessages && !isLoading() && !history().isLoading && hvMessages.length > 0) stream.reconstructSubagents(hvMessages, { skipIfPopulated: true });
127
+ if (options.filterSubagentMessages && !isLoading() && !history().isLoading && hvMessages.length > 0) {
128
+ stream.reconstructSubagents(hvMessages, { skipIfPopulated: true });
129
+ const tid = threadId();
130
+ if (tid) {
131
+ const controller = new AbortController();
132
+ stream.fetchSubagentHistory(client.threads, tid, {
133
+ messagesKey: options.messagesKey ?? "messages",
134
+ signal: controller.signal
135
+ });
136
+ onCleanup(() => controller.abort());
137
+ }
138
+ }
126
139
  });
127
140
  function stop() {
128
141
  return stream.stop(historyValues(), { onStop: (args) => {
@@ -449,6 +462,91 @@ function useStreamLGP(options) {
449
462
  }
450
463
  };
451
464
  }
465
+ let StreamService = class StreamService {
466
+ _stream;
467
+ constructor(options) {
468
+ this._stream = useStream(options);
469
+ }
470
+ get values() {
471
+ return this._stream.values;
472
+ }
473
+ get messages() {
474
+ return this._stream.messages;
475
+ }
476
+ get isLoading() {
477
+ return this._stream.isLoading;
478
+ }
479
+ get error() {
480
+ return this._stream.error;
481
+ }
482
+ get branch() {
483
+ return this._stream.branch;
484
+ }
485
+ get interrupt() {
486
+ return this._stream.interrupt;
487
+ }
488
+ get interrupts() {
489
+ return this._stream.interrupts;
490
+ }
491
+ get toolCalls() {
492
+ return this._stream.toolCalls;
493
+ }
494
+ get queue() {
495
+ return this._stream.queue;
496
+ }
497
+ get subagents() {
498
+ return this._stream.subagents;
499
+ }
500
+ get activeSubagents() {
501
+ return this._stream.activeSubagents;
502
+ }
503
+ get history() {
504
+ return this._stream.history;
505
+ }
506
+ get isThreadLoading() {
507
+ return this._stream.isThreadLoading;
508
+ }
509
+ get experimental_branchTree() {
510
+ return this._stream.experimental_branchTree;
511
+ }
512
+ get client() {
513
+ return this._stream.client;
514
+ }
515
+ get assistantId() {
516
+ return this._stream.assistantId;
517
+ }
518
+ submit(values, options) {
519
+ return this._stream.submit(values, options);
520
+ }
521
+ stop() {
522
+ return this._stream.stop();
523
+ }
524
+ setBranch(value) {
525
+ this._stream.setBranch(value);
526
+ }
527
+ switchThread(newThreadId) {
528
+ this._stream.switchThread(newThreadId);
529
+ }
530
+ joinStream(runId, lastEventId, options) {
531
+ return this._stream.joinStream(runId, lastEventId, options);
532
+ }
533
+ getMessagesMetadata(message, index) {
534
+ return this._stream.getMessagesMetadata(message, index);
535
+ }
536
+ getToolCalls(message) {
537
+ return this._stream.getToolCalls(message);
538
+ }
539
+ getSubagent(toolCallId) {
540
+ return this._stream.getSubagent(toolCallId);
541
+ }
542
+ getSubagentsByType(type) {
543
+ return this._stream.getSubagentsByType(type);
544
+ }
545
+ getSubagentsByMessage(messageId) {
546
+ return this._stream.getSubagentsByMessage(messageId);
547
+ }
548
+ };
549
+ StreamService = require_decorate.__decorate([(0, _angular_core.Injectable)()], StreamService);
452
550
  //#endregion
453
551
  Object.defineProperty(exports, "FetchStreamTransport", {
454
552
  enumerable: true,
@@ -456,6 +554,14 @@ Object.defineProperty(exports, "FetchStreamTransport", {
456
554
  return _langchain_langgraph_sdk_ui.FetchStreamTransport;
457
555
  }
458
556
  });
557
+ exports.STREAM_DEFAULTS = require_context.STREAM_DEFAULTS;
558
+ exports.STREAM_INSTANCE = require_context.STREAM_INSTANCE;
559
+ Object.defineProperty(exports, "StreamService", {
560
+ enumerable: true,
561
+ get: function() {
562
+ return StreamService;
563
+ }
564
+ });
459
565
  Object.defineProperty(exports, "SubagentManager", {
460
566
  enumerable: true,
461
567
  get: function() {
@@ -480,12 +586,15 @@ Object.defineProperty(exports, "extractToolCallIdFromNamespace", {
480
586
  return _langchain_langgraph_sdk_ui.extractToolCallIdFromNamespace;
481
587
  }
482
588
  });
589
+ exports.injectStream = require_context.injectStream;
483
590
  Object.defineProperty(exports, "isSubagentNamespace", {
484
591
  enumerable: true,
485
592
  get: function() {
486
593
  return _langchain_langgraph_sdk_ui.isSubagentNamespace;
487
594
  }
488
595
  });
596
+ exports.provideStream = require_context.provideStream;
597
+ exports.provideStreamDefaults = require_context.provideStreamDefaults;
489
598
  exports.useStream = useStream;
490
599
  exports.useStreamLGP = useStreamLGP;
491
600