@langchain/angular 0.1.3 → 0.3.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 (166) hide show
  1. package/README.md +275 -16
  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 +94 -0
  5. package/dist/context.cjs.map +1 -0
  6. package/dist/context.d.cts +130 -0
  7. package/dist/context.d.cts.map +1 -0
  8. package/dist/context.d.ts +130 -0
  9. package/dist/context.d.ts.map +1 -0
  10. package/dist/context.js +91 -0
  11. package/dist/context.js.map +1 -0
  12. package/dist/index.cjs +212 -386
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +317 -16
  15. package/dist/index.d.cts.map +1 -1
  16. package/dist/index.d.ts +317 -16
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +203 -390
  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 +54 -137
  155. package/dist/stream.custom.cjs.map +1 -1
  156. package/dist/stream.custom.d.cts +45 -0
  157. package/dist/stream.custom.d.cts.map +1 -0
  158. package/dist/stream.custom.d.ts +45 -0
  159. package/dist/stream.custom.d.ts.map +1 -0
  160. package/dist/stream.custom.js +55 -139
  161. package/dist/stream.custom.js.map +1 -1
  162. package/dist/subagent-types.d.cts +15 -0
  163. package/dist/subagent-types.d.cts.map +1 -0
  164. package/dist/subagent-types.d.ts +15 -0
  165. package/dist/subagent-types.d.ts.map +1 -0
  166. package/package.json +9 -11
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # @langchain/angular
2
2
 
3
- Angular SDK for building AI-powered applications with [LangChain](https://js.langchain.com/) and [LangGraph](https://langchain-ai.github.io/langgraphjs/). Provides a `useStream` function that manages streaming, state, branching, and interrupts using Angular's Signals API.
3
+ Angular SDK for building AI-powered applications with [Deep Agents](https://docs.langchain.com/oss/javascript/deepagents/overview), [LangChain](https://docs.langchain.com/oss/javascript/langchain/overview) and [LangGraph](https://docs.langchain.com/oss/javascript/langgraph/overview). It provides an `injectStream` function that manages streaming, state, branching, and interrupts using Angular's Signals API.
4
+
5
+ > **Migration note:** `useStream` has been renamed to `injectStream` to follow Angular's `inject*` naming convention. `useStream` is still available as a deprecated alias for backwards compatibility.
4
6
 
5
7
  ## Installation
6
8
 
@@ -14,7 +16,7 @@ npm install @langchain/angular @langchain/core
14
16
 
15
17
  ```typescript
16
18
  import { Component } from "@angular/core";
17
- import { useStream } from "@langchain/angular";
19
+ import { injectStream } from "@langchain/angular";
18
20
 
19
21
  @Component({
20
22
  standalone: true,
@@ -34,7 +36,7 @@ import { useStream } from "@langchain/angular";
34
36
  `,
35
37
  })
36
38
  export class ChatComponent {
37
- stream = useStream({
39
+ stream = injectStream({
38
40
  assistantId: "agent",
39
41
  apiUrl: "http://localhost:2024",
40
42
  });
@@ -51,7 +53,7 @@ export class ChatComponent {
51
53
  }
52
54
  ```
53
55
 
54
- ## `useStream` Options
56
+ ## `injectStream` Options
55
57
 
56
58
  | Option | Type | Description |
57
59
  |---|---|---|
@@ -105,7 +107,7 @@ interface MyState {
105
107
 
106
108
  @Component({ /* ... */ })
107
109
  export class ChatComponent {
108
- stream = useStream<MyState>({
110
+ stream = injectStream<MyState>({
109
111
  assistantId: "my-graph",
110
112
  apiUrl: "http://localhost:2024",
111
113
  });
@@ -119,7 +121,7 @@ import type { BaseMessage } from "langchain";
119
121
 
120
122
  @Component({ /* ... */ })
121
123
  export class ChatComponent {
122
- stream = useStream<
124
+ stream = injectStream<
123
125
  { messages: BaseMessage[] },
124
126
  { InterruptType: { question: string } }
125
127
  >({
@@ -136,7 +138,7 @@ export class ChatComponent {
136
138
  ```typescript
137
139
  import { Component } from "@angular/core";
138
140
  import type { BaseMessage } from "langchain";
139
- import { useStream } from "@langchain/angular";
141
+ import { injectStream } from "@langchain/angular";
140
142
 
141
143
  @Component({
142
144
  standalone: true,
@@ -158,7 +160,7 @@ import { useStream } from "@langchain/angular";
158
160
  `,
159
161
  })
160
162
  export class ChatComponent {
161
- stream = useStream<
163
+ stream = injectStream<
162
164
  { messages: BaseMessage[] },
163
165
  { InterruptType: { question: string } }
164
166
  >({
@@ -188,7 +190,7 @@ Enable conversation branching with `fetchStateHistory: true`:
188
190
 
189
191
  ```typescript
190
192
  import { Component } from "@angular/core";
191
- import { useStream } from "@langchain/angular";
193
+ import { injectStream } from "@langchain/angular";
192
194
 
193
195
  @Component({
194
196
  standalone: true,
@@ -211,7 +213,7 @@ import { useStream } from "@langchain/angular";
211
213
  `,
212
214
  })
213
215
  export class ChatComponent {
214
- stream = useStream({
216
+ stream = injectStream({
215
217
  assistantId: "agent",
216
218
  apiUrl: "http://localhost:2024",
217
219
  fetchStateHistory: true,
@@ -257,7 +259,7 @@ When `submit()` is called while a stream is already active, the SDK automaticall
257
259
 
258
260
  ```typescript
259
261
  import { Component } from "@angular/core";
260
- import { useStream } from "@langchain/angular";
262
+ import { injectStream } from "@langchain/angular";
261
263
 
262
264
  @Component({
263
265
  standalone: true,
@@ -285,7 +287,7 @@ import { useStream } from "@langchain/angular";
285
287
  `,
286
288
  })
287
289
  export class ChatComponent {
288
- stream = useStream({
290
+ stream = injectStream({
289
291
  assistantId: "agent",
290
292
  apiUrl: "http://localhost:2024",
291
293
  });
@@ -312,13 +314,149 @@ export class ChatComponent {
312
314
 
313
315
  Switching threads via `switchThread()` cancels all pending runs and clears the queue.
314
316
 
317
+ ## Service Pattern
318
+
319
+ For projects that prefer Angular's dependency injection, `StreamService` provides an `@Injectable()` base class that wraps `useStream`. Extend it with your own service to enable DI, testability, and shared state across components:
320
+
321
+ ```typescript
322
+ import { Injectable, Component, inject } from "@angular/core";
323
+ import { StreamService } from "@langchain/angular";
324
+ import type { BaseMessage } from "langchain";
325
+
326
+ interface ChatState {
327
+ messages: BaseMessage[];
328
+ }
329
+
330
+ @Injectable({ providedIn: "root" })
331
+ export class ChatService extends StreamService<ChatState> {
332
+ constructor() {
333
+ super({
334
+ assistantId: "agent",
335
+ apiUrl: "http://localhost:2024",
336
+ });
337
+ }
338
+ }
339
+
340
+ @Component({
341
+ standalone: true,
342
+ template: `
343
+ <div>
344
+ @for (msg of chat.messages(); track msg.id ?? $index) {
345
+ <div>{{ str(msg.content) }}</div>
346
+ }
347
+
348
+ <button
349
+ [disabled]="chat.isLoading()"
350
+ (click)="onSubmit()"
351
+ >
352
+ Send
353
+ </button>
354
+ </div>
355
+ `,
356
+ })
357
+ export class ChatComponent {
358
+ chat = inject(ChatService);
359
+
360
+ str(v: unknown) {
361
+ return typeof v === "string" ? v : JSON.stringify(v);
362
+ }
363
+
364
+ onSubmit() {
365
+ void this.chat.submit({
366
+ messages: [{ type: "human", content: "Hello!" }],
367
+ });
368
+ }
369
+ }
370
+ ```
371
+
372
+ The service exposes the same signals and methods as `useStream` (`values`, `messages`, `isLoading`, `submit`, `stop`, etc.).
373
+
374
+ ### Shared State Across Components
375
+
376
+ Because the service is provided through DI, multiple components can inject the same instance and share stream state:
377
+
378
+ ```typescript
379
+ @Component({
380
+ standalone: true,
381
+ selector: "app-message-list",
382
+ template: `
383
+ @for (msg of chat.messages(); track msg.id ?? $index) {
384
+ <div>{{ msg.content }}</div>
385
+ }
386
+ `,
387
+ })
388
+ export class MessageListComponent {
389
+ chat = inject(ChatService);
390
+ }
391
+
392
+ @Component({
393
+ standalone: true,
394
+ imports: [MessageListComponent],
395
+ template: `
396
+ <app-message-list />
397
+ <button (click)="onSubmit()">Send</button>
398
+ `,
399
+ })
400
+ export class ChatPageComponent {
401
+ chat = inject(ChatService);
402
+
403
+ onSubmit() {
404
+ void this.chat.submit({
405
+ messages: [{ type: "human", content: "Hello!" }],
406
+ });
407
+ }
408
+ }
409
+ ```
410
+
411
+ ### Custom Transport with StreamService
412
+
413
+ ```typescript
414
+ import { Injectable } from "@angular/core";
415
+ import { StreamService, FetchStreamTransport } from "@langchain/angular";
416
+ import type { BaseMessage } from "langchain";
417
+
418
+ @Injectable({ providedIn: "root" })
419
+ export class CustomChatService extends StreamService<{
420
+ messages: BaseMessage[];
421
+ }> {
422
+ constructor() {
423
+ super({
424
+ transport: new FetchStreamTransport({
425
+ url: "https://my-api.example.com/stream",
426
+ }),
427
+ threadId: null,
428
+ onThreadId: (id) => console.log("Thread created:", id),
429
+ });
430
+ }
431
+ }
432
+ ```
433
+
434
+ ### Testing
435
+
436
+ Services can be mocked or overridden in tests using Angular's standard DI testing utilities:
437
+
438
+ ```typescript
439
+ import { TestBed } from "@angular/core/testing";
440
+
441
+ const mockService = {
442
+ messages: signal([]),
443
+ isLoading: signal(false),
444
+ submit: vi.fn(),
445
+ stop: vi.fn(),
446
+ };
447
+
448
+ TestBed.configureTestingModule({
449
+ providers: [{ provide: ChatService, useValue: mockService }],
450
+ });
451
+ ```
452
+
315
453
  ## Custom Transport
316
454
 
317
455
  Instead of connecting to a LangGraph API, you can provide your own streaming transport. Pass a `transport` object instead of `assistantId` to use a custom backend:
318
456
 
319
457
  ```typescript
320
458
  import { Component } from "@angular/core";
321
- import { useStream, FetchStreamTransport } from "@langchain/angular";
459
+ import { injectStream, FetchStreamTransport } from "@langchain/angular";
322
460
  import type { BaseMessage } from "langchain";
323
461
 
324
462
  @Component({
@@ -346,7 +484,7 @@ import type { BaseMessage } from "langchain";
346
484
  `,
347
485
  })
348
486
  export class ChatComponent {
349
- stream = useStream<{ messages: BaseMessage[] }>({
487
+ stream = injectStream<{ messages: BaseMessage[] }>({
350
488
  transport: new FetchStreamTransport({
351
489
  url: "https://my-api.example.com/stream",
352
490
  }),
@@ -371,11 +509,132 @@ export class ChatComponent {
371
509
  }
372
510
  ```
373
511
 
374
- The custom transport interface returns the same properties as the standard `useStream` function, including `getMessagesMetadata`, `branch`, `setBranch`, `switchThread`, and all message/interrupt/subagent helpers. When using a custom transport, `getMessagesMetadata` returns stream metadata sent alongside messages during streaming; `branch` and `setBranch` provide local branch state management.
512
+ The custom transport interface returns the same properties as the standard `injectStream` function, including `getMessagesMetadata`, `branch`, `setBranch`, `switchThread`, and all message/interrupt/subagent helpers. When using a custom transport, `getMessagesMetadata` returns stream metadata sent alongside messages during streaming; `branch` and `setBranch` provide local branch state management. `onFinish` is also supported and receives a synthetic `ThreadState` built from the final locally streamed values; the run metadata argument is `undefined`.
513
+
514
+ ## Sharing State with `provideStream`
515
+
516
+ When multiple components need the same stream (a message list, a header, an input bar), use `provideStream` and `injectStream` to share a single stream instance via Angular's dependency injection:
517
+
518
+ ```typescript
519
+ import { Component } from "@angular/core";
520
+ import { provideStream, injectStream } from "@langchain/angular";
521
+
522
+ @Component({
523
+ selector: "app-chat-container",
524
+ providers: [provideStream({ assistantId: "agent", apiUrl: "http://localhost:2024" })],
525
+ template: `
526
+ <app-chat-header />
527
+ <app-message-list />
528
+ <app-message-input />
529
+ `,
530
+ })
531
+ export class ChatContainerComponent {}
532
+
533
+ @Component({
534
+ selector: "app-chat-header",
535
+ template: `
536
+ <header>
537
+ <h1>Chat</h1>
538
+ @if (stream.isLoading()) {
539
+ <span>Thinking...</span>
540
+ }
541
+ @if (stream.error()) {
542
+ <span>Error occurred</span>
543
+ }
544
+ </header>
545
+ `,
546
+ })
547
+ export class ChatHeaderComponent {
548
+ stream = injectStream();
549
+ }
550
+
551
+ @Component({
552
+ selector: "app-message-list",
553
+ template: `
554
+ @for (msg of stream.messages(); track msg.id ?? $index) {
555
+ <div>{{ str(msg.content) }}</div>
556
+ }
557
+ `,
558
+ })
559
+ export class MessageListComponent {
560
+ stream = injectStream();
561
+
562
+ str(v: unknown) {
563
+ return typeof v === "string" ? v : JSON.stringify(v);
564
+ }
565
+ }
566
+
567
+ @Component({
568
+ selector: "app-message-input",
569
+ template: `
570
+ <button
571
+ [disabled]="stream.isLoading()"
572
+ (click)="onSubmit()"
573
+ >Send</button>
574
+ `,
575
+ })
576
+ export class MessageInputComponent {
577
+ stream = injectStream();
578
+
579
+ onSubmit() {
580
+ void this.stream.submit({
581
+ messages: [{ type: "human", content: "Hello!" }],
582
+ });
583
+ }
584
+ }
585
+ ```
586
+
587
+ ### App-Level Configuration with `provideStreamDefaults`
588
+
589
+ Set default configuration for all `useStream` and `injectStream` calls application-wide:
590
+
591
+ ```typescript
592
+ // app.config.ts
593
+ import { ApplicationConfig } from "@angular/core";
594
+ import { provideStreamDefaults } from "@langchain/angular";
595
+
596
+ export const appConfig: ApplicationConfig = {
597
+ providers: [
598
+ provideStreamDefaults({
599
+ apiUrl: "http://localhost:2024",
600
+ }),
601
+ ],
602
+ };
603
+ ```
604
+
605
+ Then in components, `apiUrl` is inherited automatically:
606
+
607
+ ```typescript
608
+ @Component({
609
+ providers: [provideStream({ assistantId: "agent" })],
610
+ template: `...`,
611
+ })
612
+ export class ChatComponent {}
613
+ ```
614
+
615
+ ### Multiple Agents
616
+
617
+ Use separate `provideStream` entries on different components — Angular's hierarchical injector ensures each subtree gets its own isolated stream:
618
+
619
+ ```typescript
620
+ @Component({
621
+ selector: "app-research-panel",
622
+ providers: [provideStream({ assistantId: "researcher", apiUrl: "http://localhost:2024" })],
623
+ template: `<app-message-list /> <app-message-input />`,
624
+ })
625
+ export class ResearchPanelComponent {}
626
+
627
+ @Component({
628
+ selector: "app-writer-panel",
629
+ providers: [provideStream({ assistantId: "writer", apiUrl: "http://localhost:2024" })],
630
+ template: `<app-message-list /> <app-message-input />`,
631
+ })
632
+ export class WriterPanelComponent {}
633
+ ```
375
634
 
376
635
  ## Playground
377
636
 
378
- For complete end-to-end examples with full agentic UIs, visit the [LangGraph Playground](https://github.com/langchain-ai/langgraphjs).
637
+ For complete end-to-end examples with full agentic UIs, visit the [LangChain UI Playground](https://docs.langchain.com/playground).
379
638
 
380
639
  ## License
381
640
 
@@ -0,0 +1,9 @@
1
+ //#region \0@oxc-project+runtime@0.115.0/helpers/decorate.js
2
+ function __decorate(decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ }
8
+ //#endregion
9
+ exports.__decorate = __decorate;
@@ -0,0 +1,9 @@
1
+ //#region \0@oxc-project+runtime@0.115.0/helpers/decorate.js
2
+ function __decorate(decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ }
8
+ //#endregion
9
+ export { __decorate };
@@ -0,0 +1,94 @@
1
+ const require_index = require("./index.cjs");
2
+ let _angular_core = require("@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 _angular_core.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 _angular_core.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 (0, _angular_core.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 = (0, _angular_core.inject)(STREAM_DEFAULTS, { optional: true });
79
+ return require_index.useStream({
80
+ ...defaults ?? {},
81
+ ...options,
82
+ apiUrl: options.apiUrl ?? defaults?.apiUrl,
83
+ client: options.client ?? defaults?.client
84
+ });
85
+ }
86
+ };
87
+ }
88
+ //#endregion
89
+ exports.STREAM_DEFAULTS = STREAM_DEFAULTS;
90
+ exports.STREAM_INSTANCE = STREAM_INSTANCE;
91
+ exports.provideStream = provideStream;
92
+ exports.provideStreamDefaults = provideStreamDefaults;
93
+
94
+ //# sourceMappingURL=context.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.cjs","names":["InjectionToken","useStream"],"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"],"mappings":";;;;;;;AAgCA,MAAa,kBAAkB,IAAIA,cAAAA,eACjC,4BACD;;;;;AAOD,MAAa,kBAAkB,IAAIA,cAAAA,eACjC,4BACD;;;;;;;;;;;;;;;;;;;;;;AAuBD,SAAgB,sBACd,UACsB;AACtB,SAAA,GAAA,cAAA,0BAAgC,CAC9B;EAAE,SAAS;EAAiB,UAAU;EAAU,CACjD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCJ,SAAgB,cAId,SAGA;AACA,QAAO;EACL,SAAS;EACT,kBAAkB;GAChB,MAAM,YAAA,GAAA,cAAA,QAAyB,iBAAiB,EAAE,UAAU,MAAM,CAAC;AAQnE,UAAOC,cAAAA,UAPQ;IACb,GAAI,YAAY,EAAE;IAClB,GAAG;IACH,QAAS,QAAoC,UAAU,UAAU;IACjE,QAAS,QAAoC,UAAU,UAAU;IAClE,CAE8B;;EAElC"}
@@ -0,0 +1,130 @@
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.cjs";
2
+ import * as _langchain_langgraph_sdk0 from "@langchain/langgraph-sdk";
3
+ import { BagTemplate, Client } from "@langchain/langgraph-sdk";
4
+ import * as _langchain_core_messages0 from "@langchain/core/messages";
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 _angular_core0 from "@angular/core";
8
+ import { EnvironmentProviders, InjectionToken } from "@angular/core";
9
+
10
+ //#region src/context.d.ts
11
+ /**
12
+ * Configuration defaults for `useStream` and `injectStream` calls.
13
+ */
14
+ interface StreamDefaults {
15
+ /** Base URL of the LangGraph API. */
16
+ apiUrl?: string;
17
+ /** API key for authenticating with the LangGraph API. */
18
+ apiKey?: string;
19
+ /** Pre-configured Client instance. */
20
+ client?: Client;
21
+ }
22
+ /**
23
+ * Injection token for stream default configuration.
24
+ * Provide via `provideStreamDefaults()` in your application config.
25
+ */
26
+ declare const STREAM_DEFAULTS: InjectionToken<StreamDefaults>;
27
+ /**
28
+ * Injection token for a shared stream instance.
29
+ * Provide via `provideStream()` at the component level.
30
+ */
31
+ declare const STREAM_INSTANCE: InjectionToken<any>;
32
+ /**
33
+ * Provides default LangGraph configuration at the application level.
34
+ *
35
+ * Use this in your application's `providers` array to set defaults like
36
+ * `apiUrl` that will be used by all `useStream` and `injectStream` calls.
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * // app.config.ts
41
+ * import { ApplicationConfig } from "@angular/core";
42
+ * import { provideStreamDefaults } from "@langchain/angular";
43
+ *
44
+ * export const appConfig: ApplicationConfig = {
45
+ * providers: [
46
+ * provideStreamDefaults({
47
+ * apiUrl: "http://localhost:2024",
48
+ * }),
49
+ * ],
50
+ * };
51
+ * ```
52
+ */
53
+ declare function provideStreamDefaults(defaults: StreamDefaults): EnvironmentProviders;
54
+ /**
55
+ * Creates a provider for a shared `useStream` instance at the component level.
56
+ *
57
+ * Add the returned provider to a component's `providers` array so that all
58
+ * child components can access the same stream via `injectStream()`.
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * import { Component } from "@angular/core";
63
+ * import { provideStream, injectStream } from "@langchain/angular";
64
+ *
65
+ * @Component({
66
+ * providers: [provideStream({ assistantId: "agent" })],
67
+ * template: `
68
+ * <app-message-list />
69
+ * <app-message-input />
70
+ * `,
71
+ * })
72
+ * export class ChatContainer {}
73
+ *
74
+ * // In child components:
75
+ * @Component({
76
+ * template: `
77
+ * @for (msg of stream.messages(); track msg.id) {
78
+ * <div>{{ msg.content }}</div>
79
+ * }
80
+ * `,
81
+ * })
82
+ * export class MessageListComponent {
83
+ * stream = injectStream();
84
+ * }
85
+ * ```
86
+ */
87
+ declare function provideStream<T = Record<string, unknown>, Bag extends BagTemplate = BagTemplate>(options: ResolveStreamOptions<T, InferBag<T, Bag>> | UseStreamCustomOptions<InferStateType<T>, InferBag<T, Bag>>): {
88
+ provide: InjectionToken<any>;
89
+ useFactory: () => {
90
+ values: _angular_core0.Signal<Record<string, unknown>>;
91
+ error: _angular_core0.Signal<unknown>;
92
+ isLoading: _angular_core0.WritableSignal<boolean>;
93
+ isThreadLoading: _angular_core0.Signal<boolean>;
94
+ interrupt: _angular_core0.Signal<_langchain_langgraph_sdk0.Interrupt<unknown> | undefined>;
95
+ interrupts: _angular_core0.Signal<_langchain_langgraph_sdk0.Interrupt<unknown>[]>;
96
+ stop: () => Promise<void>;
97
+ branch: _angular_core0.WritableSignal<string>;
98
+ setBranch: (branch: string) => void;
99
+ experimental_branchTree: _angular_core0.Signal<_langchain_langgraph_sdk_ui0.Sequence<Record<string, unknown>>>;
100
+ toolProgress: _angular_core0.Signal<_langchain_langgraph_sdk0.ToolProgress[]>;
101
+ client: Client<_langchain_langgraph_sdk0.DefaultValues, _langchain_langgraph_sdk0.DefaultValues, unknown>;
102
+ assistantId: string;
103
+ joinStream: (runId: string, lastEventId?: string | undefined, options?: {
104
+ streamMode?: _langchain_langgraph_sdk0.StreamMode[] | _langchain_langgraph_sdk0.StreamMode | undefined;
105
+ filter?: ((event: {
106
+ id?: string | undefined;
107
+ event: _langchain_langgraph_sdk0.StreamEvent;
108
+ data: unknown;
109
+ }) => boolean) | undefined;
110
+ } | undefined) => Promise<void>;
111
+ switchThread: (newThreadId: string | null) => void;
112
+ queue: {
113
+ entries: _angular_core0.WritableSignal<readonly _langchain_langgraph_sdk_ui0.QueueEntry<Record<string, unknown>, _langchain_langgraph_sdk_ui0.SubmitOptions<Record<string, unknown>, Record<string, unknown>>>[]>;
114
+ size: _angular_core0.WritableSignal<number>;
115
+ cancel: (id: string) => Promise<boolean>;
116
+ clear: () => Promise<void>;
117
+ };
118
+ messages: _angular_core0.Signal<BaseMessage$1<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[]>;
119
+ 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;
120
+ history: _angular_core0.Signal<_langchain_langgraph_sdk0.ThreadState<Omit<Record<string, unknown>, "messages"> & {
121
+ messages: BaseMessage$1<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[];
122
+ }>[]>;
123
+ submit: (values: {
124
+ [x: string]: unknown;
125
+ } | null | undefined, options?: _langchain_langgraph_sdk_ui0.SubmitOptions<Record<string, unknown>, Record<string, unknown>> | undefined) => Promise<void>;
126
+ };
127
+ };
128
+ //#endregion
129
+ export { STREAM_DEFAULTS, STREAM_INSTANCE, StreamDefaults, provideStream, provideStreamDefaults };
130
+ //# sourceMappingURL=context.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.cts","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"}