@langchain/angular 0.1.2 → 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.
- package/README.md +260 -3
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.cjs +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.js +9 -0
- package/dist/context.cjs +143 -0
- package/dist/context.cjs.map +1 -0
- package/dist/context.d.cts +175 -0
- package/dist/context.d.cts.map +1 -0
- package/dist/context.d.ts +175 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +139 -0
- package/dist/context.js.map +1 -0
- package/dist/index.cjs +112 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +73 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +73 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +104 -6
- package/dist/index.js.map +1 -1
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/ZodError.d.cts +155 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/ZodError.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/ZodError.d.ts +155 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/ZodError.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/errorUtil.d.cts +13 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/errorUtil.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/errorUtil.d.ts +13 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/errorUtil.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/parseUtil.d.cts +63 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/parseUtil.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/parseUtil.d.ts +63 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/parseUtil.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/typeAliases.d.cts +5 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/typeAliases.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/typeAliases.d.ts +5 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/typeAliases.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/util.d.cts +64 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/util.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/util.d.ts +64 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/util.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/standard-schema.d.cts +106 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/standard-schema.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/standard-schema.d.ts +106 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/standard-schema.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/types.d.cts +291 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/types.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/types.d.ts +291 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/types.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.cts +29 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.ts +29 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.cts +29 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.ts +29 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.cts +105 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.ts +105 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.cts +70 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.ts +70 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.cts +24 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.ts +24 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.cts +97 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.ts +97 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.cts +79 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.ts +79 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.cts +52 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.ts +52 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.cts +17 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.ts +17 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.cts +9 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.ts +9 -0
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.ts.map +1 -0
- package/dist/stream.custom.cjs +23 -2
- package/dist/stream.custom.cjs.map +1 -1
- package/dist/stream.custom.js +23 -2
- package/dist/stream.custom.js.map +1 -1
- 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"}
|
package/dist/context.js
ADDED
|
@@ -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)
|
|
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) => {
|
|
@@ -370,7 +383,7 @@ function useStreamLGP(options) {
|
|
|
370
383
|
});
|
|
371
384
|
const historyList = (0, _angular_core.computed)(() => {
|
|
372
385
|
if (historyLimit === false) throw new Error("`fetchStateHistory` must be set to `true` to use `history`");
|
|
373
|
-
return branchContext().flatHistory;
|
|
386
|
+
return (0, _langchain_langgraph_sdk_ui.ensureHistoryMessageInstances)(branchContext().flatHistory, options.messagesKey ?? "messages");
|
|
374
387
|
});
|
|
375
388
|
const isThreadLoading = (0, _angular_core.computed)(() => history().isLoading && history().data == null);
|
|
376
389
|
const experimentalBranchTree = (0, _angular_core.computed)(() => {
|
|
@@ -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
|
|