@langchain/angular 0.4.7 → 1.0.1
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 +79 -584
- package/dist/context.cjs +13 -11
- package/dist/context.cjs.map +1 -1
- package/dist/context.d.cts +7 -76
- package/dist/context.d.cts.map +1 -1
- package/dist/context.d.ts +7 -76
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +13 -11
- package/dist/context.js.map +1 -1
- package/dist/index.cjs +33 -149
- package/dist/index.d.cts +11 -329
- package/dist/index.d.ts +11 -329
- package/dist/index.js +11 -114
- package/dist/inject-media-url.cjs +54 -0
- package/dist/inject-media-url.cjs.map +1 -0
- package/dist/inject-media-url.d.cts +34 -0
- package/dist/inject-media-url.d.cts.map +1 -0
- package/dist/inject-media-url.d.ts +34 -0
- package/dist/inject-media-url.d.ts.map +1 -0
- package/dist/inject-media-url.js +54 -0
- package/dist/inject-media-url.js.map +1 -0
- package/dist/inject-projection.cjs +74 -0
- package/dist/inject-projection.cjs.map +1 -0
- package/dist/inject-projection.d.cts +34 -0
- package/dist/inject-projection.d.cts.map +1 -0
- package/dist/inject-projection.d.ts +34 -0
- package/dist/inject-projection.d.ts.map +1 -0
- package/dist/inject-projection.js +74 -0
- package/dist/inject-projection.js.map +1 -0
- package/dist/inject-stream.cjs +27 -0
- package/dist/inject-stream.cjs.map +1 -0
- package/dist/inject-stream.d.cts +31 -0
- package/dist/inject-stream.d.cts.map +1 -0
- package/dist/inject-stream.d.ts +31 -0
- package/dist/inject-stream.d.ts.map +1 -0
- package/dist/inject-stream.js +27 -0
- package/dist/inject-stream.js.map +1 -0
- package/dist/selectors-metadata.cjs +39 -0
- package/dist/selectors-metadata.cjs.map +1 -0
- package/dist/selectors-metadata.d.cts +28 -0
- package/dist/selectors-metadata.d.cts.map +1 -0
- package/dist/selectors-metadata.d.ts +28 -0
- package/dist/selectors-metadata.d.ts.map +1 -0
- package/dist/selectors-metadata.js +39 -0
- package/dist/selectors-metadata.js.map +1 -0
- package/dist/selectors-queue.cjs +21 -0
- package/dist/selectors-queue.cjs.map +1 -0
- package/dist/selectors-queue.d.cts +36 -0
- package/dist/selectors-queue.d.cts.map +1 -0
- package/dist/selectors-queue.d.ts +36 -0
- package/dist/selectors-queue.d.ts.map +1 -0
- package/dist/selectors-queue.js +21 -0
- package/dist/selectors-queue.js.map +1 -0
- package/dist/selectors.cjs +144 -0
- package/dist/selectors.cjs.map +1 -0
- package/dist/selectors.d.cts +111 -0
- package/dist/selectors.d.cts.map +1 -0
- package/dist/selectors.d.ts +111 -0
- package/dist/selectors.d.ts.map +1 -0
- package/dist/selectors.js +136 -0
- package/dist/selectors.js.map +1 -0
- package/dist/stream-service.cjs +84 -0
- package/dist/stream-service.cjs.map +1 -0
- package/dist/stream-service.d.cts +67 -0
- package/dist/stream-service.d.cts.map +1 -0
- package/dist/stream-service.d.ts +67 -0
- package/dist/stream-service.d.ts.map +1 -0
- package/dist/stream-service.js +79 -0
- package/dist/stream-service.js.map +1 -0
- package/dist/use-stream.cjs +155 -0
- package/dist/use-stream.cjs.map +1 -0
- package/dist/use-stream.d.cts +97 -0
- package/dist/use-stream.d.cts.map +1 -0
- package/dist/use-stream.d.ts +97 -0
- package/dist/use-stream.d.ts.map +1 -0
- package/dist/use-stream.js +153 -0
- package/dist/use-stream.js.map +1 -0
- package/package.json +26 -25
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/channels/base.d.cts +0 -83
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/channels/base.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/channels/base.d.ts +0 -83
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/channels/base.d.ts.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/constants.d.cts +0 -42
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/constants.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/constants.d.ts +0 -42
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/constants.d.ts.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/graph/zod/index.d.cts +0 -2
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/graph/zod/index.d.ts +0 -2
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/graph/zod/meta.d.cts +0 -109
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/graph/zod/meta.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/graph/zod/meta.d.ts +0 -109
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/graph/zod/meta.d.ts.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/graph/zod/zod-registry.d.cts +0 -49
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/graph/zod/zod-registry.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/graph/zod/zod-registry.d.ts +0 -49
- package/dist/node_modules/.pnpm/@langchain_langgraph@1.2.6_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33._a807b9e815d3fdb40e51117306822e31/node_modules/@langchain/langgraph/dist/graph/zod/zod-registry.d.ts.map +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/ReactAgent.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/ReactAgent.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/index.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/index.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/contextEditing.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/contextEditing.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/dynamicSystemPrompt.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/dynamicSystemPrompt.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/hitl.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/hitl.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/llmToolSelector.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/llmToolSelector.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/modelCallLimit.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/modelCallLimit.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/modelFallback.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/modelFallback.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/modelRetry.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/modelRetry.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/pii.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/pii.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/piiRedaction.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/piiRedaction.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/provider/anthropic/promptCaching.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/provider/anthropic/promptCaching.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/provider/openai/moderation.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/provider/openai/moderation.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/summarization.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/summarization.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/todoListMiddleware.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/todoListMiddleware.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/toolCallLimit.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/toolCallLimit.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/toolEmulator.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/toolEmulator.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/toolRetry.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/toolRetry.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/types.d.cts +0 -2
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware/types.d.ts +0 -2
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware.d.cts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/middleware.d.ts +0 -1
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/types.d.cts +0 -2
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/agents/types.d.ts +0 -2
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/index.d.cts +0 -2
- package/dist/node_modules/.pnpm/langchain@1.3.0_@langchain_core@1.1.40_@opentelemetry_api@1.9.0_openai@6.33.0_ws@8.19.0_41511a57baf32de01f36b804226da973/node_modules/langchain/dist/index.d.ts +0 -2
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.cts +0 -29
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.ts +0 -29
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.ts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.cts +0 -29
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.ts +0 -29
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.ts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.cts +0 -105
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.ts +0 -105
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.ts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.cts +0 -70
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.ts +0 -70
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.ts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.cts +0 -24
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.ts +0 -24
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.ts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.cts +0 -97
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.ts +0 -97
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.ts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.cts +0 -79
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.ts +0 -79
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.ts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.cts +0 -52
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.ts +0 -52
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.ts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.cts +0 -17
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.ts +0 -17
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.ts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.cts +0 -9
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.ts +0 -9
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.ts.map +0 -1
- package/dist/stream-service-instance.d.cts +0 -70
- package/dist/stream-service-instance.d.cts.map +0 -1
- package/dist/stream-service-instance.d.ts +0 -70
- package/dist/stream-service-instance.d.ts.map +0 -1
- package/dist/stream.custom.cjs +0 -117
- package/dist/stream.custom.cjs.map +0 -1
- package/dist/stream.custom.d.cts +0 -45
- package/dist/stream.custom.d.cts.map +0 -1
- package/dist/stream.custom.d.ts +0 -45
- package/dist/stream.custom.d.ts.map +0 -1
- package/dist/stream.custom.js +0 -116
- package/dist/stream.custom.js.map +0 -1
- package/dist/stream.lgp.cjs +0 -174
- package/dist/stream.lgp.cjs.map +0 -1
- package/dist/stream.lgp.d.cts +0 -57
- package/dist/stream.lgp.d.cts.map +0 -1
- package/dist/stream.lgp.d.ts +0 -57
- package/dist/stream.lgp.d.ts.map +0 -1
- package/dist/stream.lgp.js +0 -174
- package/dist/stream.lgp.js.map +0 -1
- package/dist/subagents.cjs +0 -76
- package/dist/subagents.cjs.map +0 -1
- package/dist/subagents.js +0 -76
- package/dist/subagents.js.map +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { effect, isSignal, signal, untracked } from "@angular/core";
|
|
2
|
+
//#region src/inject-media-url.ts
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the lazy {@link MediaBase.objectURL} promise into a string
|
|
5
|
+
* suitable for direct use in `<audio src>` / `<img src>` /
|
|
6
|
+
* `<video src>` / `<a href download>`. Returns `undefined` until the
|
|
7
|
+
* URL is available.
|
|
8
|
+
*
|
|
9
|
+
* Lifecycle:
|
|
10
|
+
* - On first read (or when `media` changes) the helper awaits
|
|
11
|
+
* `media.objectURL`, then commits the resolved string to the
|
|
12
|
+
* returned signal.
|
|
13
|
+
* - On destroy (or when `media` changes) the helper calls
|
|
14
|
+
* `media.revoke()` to free the object URL slot. The next consumer
|
|
15
|
+
* that accesses `media.objectURL` mints a fresh URL from the same
|
|
16
|
+
* `Blob`, so live re-renders just work.
|
|
17
|
+
* - If the underlying handle errored before settling, the promise
|
|
18
|
+
* rejects and `injectMediaUrl` stays at `undefined`. Inspect
|
|
19
|
+
* `media.error` to surface the failure.
|
|
20
|
+
*
|
|
21
|
+
* Pair with {@link injectAudio} / {@link injectImages} /
|
|
22
|
+
* {@link injectVideo} / {@link injectFiles} to bridge SDK media
|
|
23
|
+
* handles into Angular templates without manual
|
|
24
|
+
* `URL.createObjectURL` bookkeeping.
|
|
25
|
+
*
|
|
26
|
+
* `media` accepts a plain handle or a `Signal<MediaBase | undefined>`
|
|
27
|
+
* so callers can feed a `computed(() => stream.audio()[0])`.
|
|
28
|
+
*/
|
|
29
|
+
function injectMediaUrl(media) {
|
|
30
|
+
const url = signal(void 0);
|
|
31
|
+
const read = isSignal(media) ? media : () => media;
|
|
32
|
+
effect((onCleanup) => {
|
|
33
|
+
const next = read();
|
|
34
|
+
untracked(() => {
|
|
35
|
+
url.set(void 0);
|
|
36
|
+
if (next == null) return;
|
|
37
|
+
let cancelled = false;
|
|
38
|
+
next.objectURL.then((resolved) => {
|
|
39
|
+
if (!cancelled) url.set(resolved);
|
|
40
|
+
}, () => {});
|
|
41
|
+
onCleanup(() => {
|
|
42
|
+
cancelled = true;
|
|
43
|
+
try {
|
|
44
|
+
next.revoke();
|
|
45
|
+
} catch {}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
return url;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { injectMediaUrl };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=inject-media-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-media-url.js","names":[],"sources":["../src/inject-media-url.ts"],"sourcesContent":["import {\n effect,\n isSignal,\n signal,\n untracked,\n type Signal,\n} from \"@angular/core\";\nimport type { MediaBase } from \"@langchain/langgraph-sdk/stream\";\n\n/**\n * Resolve the lazy {@link MediaBase.objectURL} promise into a string\n * suitable for direct use in `<audio src>` / `<img src>` /\n * `<video src>` / `<a href download>`. Returns `undefined` until the\n * URL is available.\n *\n * Lifecycle:\n * - On first read (or when `media` changes) the helper awaits\n * `media.objectURL`, then commits the resolved string to the\n * returned signal.\n * - On destroy (or when `media` changes) the helper calls\n * `media.revoke()` to free the object URL slot. The next consumer\n * that accesses `media.objectURL` mints a fresh URL from the same\n * `Blob`, so live re-renders just work.\n * - If the underlying handle errored before settling, the promise\n * rejects and `injectMediaUrl` stays at `undefined`. Inspect\n * `media.error` to surface the failure.\n *\n * Pair with {@link injectAudio} / {@link injectImages} /\n * {@link injectVideo} / {@link injectFiles} to bridge SDK media\n * handles into Angular templates without manual\n * `URL.createObjectURL` bookkeeping.\n *\n * `media` accepts a plain handle or a `Signal<MediaBase | undefined>`\n * so callers can feed a `computed(() => stream.audio()[0])`.\n */\nexport function injectMediaUrl(\n media: MediaBase | undefined | Signal<MediaBase | undefined>\n): Signal<string | undefined> {\n const url = signal<string | undefined>(undefined);\n\n const read = isSignal(media)\n ? (media as Signal<MediaBase | undefined>)\n : () => media as MediaBase | undefined;\n\n effect((onCleanup) => {\n const next = (read as () => MediaBase | undefined)();\n\n untracked(() => {\n url.set(undefined);\n if (next == null) return;\n\n let cancelled = false;\n next.objectURL.then(\n (resolved) => {\n if (!cancelled) url.set(resolved);\n },\n () => {\n // Errors surfaced via `media.error`; keep `url` undefined\n // so consumers fall through to a no-src render.\n }\n );\n\n onCleanup(() => {\n cancelled = true;\n try {\n next.revoke();\n } catch {\n // best-effort\n }\n });\n });\n });\n\n return url;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAgB,eACd,OAC4B;CAC5B,MAAM,MAAM,OAA2B,KAAA,EAAU;CAEjD,MAAM,OAAO,SAAS,MAAM,GACvB,cACK;AAEV,SAAQ,cAAc;EACpB,MAAM,OAAQ,MAAsC;AAEpD,kBAAgB;AACd,OAAI,IAAI,KAAA,EAAU;AAClB,OAAI,QAAQ,KAAM;GAElB,IAAI,YAAY;AAChB,QAAK,UAAU,MACZ,aAAa;AACZ,QAAI,CAAC,UAAW,KAAI,IAAI,SAAS;YAE7B,GAIP;AAED,mBAAgB;AACd,gBAAY;AACZ,QAAI;AACF,UAAK,QAAQ;YACP;KAGR;IACF;GACF;AAEF,QAAO"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
let _angular_core = require("@angular/core");
|
|
2
|
+
//#region src/inject-projection.ts
|
|
3
|
+
/**
|
|
4
|
+
* Angular-side primitive that composes {@link ChannelRegistry.acquire}
|
|
5
|
+
* with Angular Signals + {@link DestroyRef}.
|
|
6
|
+
*
|
|
7
|
+
* Contract (mirrors the React `useProjection` hook and the Vue
|
|
8
|
+
* `useProjection` composable, but adapted to Angular's injection
|
|
9
|
+
* context):
|
|
10
|
+
*
|
|
11
|
+
* - Must be called in an injection context (component / directive /
|
|
12
|
+
* service field initializer, or `runInInjectionContext(...)`).
|
|
13
|
+
* - On first read (or when `registry` / `key` change) acquires a
|
|
14
|
+
* ref-counted projection from the registry and subscribes to its
|
|
15
|
+
* store. A `computed` view over the snapshot signal is returned.
|
|
16
|
+
* - On destroy (or when `registry` / `key` change) the previous
|
|
17
|
+
* acquisition is released. If this was the last consumer of that
|
|
18
|
+
* spec, the registry closes the underlying server subscription.
|
|
19
|
+
* - When `registry` is `null`/`undefined` the projection stays at
|
|
20
|
+
* `initialValue`. This is the happy path for root-served
|
|
21
|
+
* projections (`injectMessages`, `injectToolCalls`,
|
|
22
|
+
* `injectValues`) which delegate to the always-on root snapshot
|
|
23
|
+
* instead of acquiring a new registry projection.
|
|
24
|
+
*
|
|
25
|
+
* Reactive inputs: `registry` and `key` accept either a plain value
|
|
26
|
+
* or a `Signal` so selector helpers can feed a computed target (e.g.
|
|
27
|
+
* a subagent snapshot tracked on a signal) and rebind automatically.
|
|
28
|
+
*/
|
|
29
|
+
function injectProjection(registry, specFactory, key, initialValue) {
|
|
30
|
+
const state = (0, _angular_core.signal)(initialValue);
|
|
31
|
+
const destroyRef = (0, _angular_core.inject)(_angular_core.DestroyRef);
|
|
32
|
+
const registrySignal = (0, _angular_core.isSignal)(registry) ? registry : () => registry;
|
|
33
|
+
const keySignal = (0, _angular_core.isSignal)(key) ? key : () => key;
|
|
34
|
+
let currentRegistry;
|
|
35
|
+
let currentKey;
|
|
36
|
+
let currentRelease;
|
|
37
|
+
let currentUnsubscribe;
|
|
38
|
+
const detach = () => {
|
|
39
|
+
currentUnsubscribe?.();
|
|
40
|
+
currentUnsubscribe = void 0;
|
|
41
|
+
currentRelease?.();
|
|
42
|
+
currentRelease = void 0;
|
|
43
|
+
};
|
|
44
|
+
const attach = (nextRegistry, nextKey) => {
|
|
45
|
+
if (nextRegistry === currentRegistry && nextKey === currentKey) return;
|
|
46
|
+
detach();
|
|
47
|
+
currentRegistry = nextRegistry;
|
|
48
|
+
currentKey = nextKey;
|
|
49
|
+
if (nextRegistry == null) {
|
|
50
|
+
state.set(initialValue);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const acquired = nextRegistry.acquire(specFactory());
|
|
54
|
+
state.set(acquired.store.getSnapshot());
|
|
55
|
+
currentUnsubscribe = acquired.store.subscribe(() => {
|
|
56
|
+
state.set(acquired.store.getSnapshot());
|
|
57
|
+
});
|
|
58
|
+
currentRelease = acquired.release;
|
|
59
|
+
};
|
|
60
|
+
attach(registrySignal(), keySignal());
|
|
61
|
+
destroyRef.onDestroy(detach);
|
|
62
|
+
(0, _angular_core.effect)(() => {
|
|
63
|
+
const nextRegistry = registrySignal();
|
|
64
|
+
const nextKey = keySignal();
|
|
65
|
+
(0, _angular_core.untracked)(() => {
|
|
66
|
+
attach(nextRegistry, nextKey);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
return (0, _angular_core.computed)(() => state());
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
exports.injectProjection = injectProjection;
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=inject-projection.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-projection.cjs","names":["DestroyRef"],"sources":["../src/inject-projection.ts"],"sourcesContent":["import {\n DestroyRef,\n computed,\n effect,\n inject,\n isSignal,\n signal,\n untracked,\n type Signal,\n} from \"@angular/core\";\nimport type {\n ChannelRegistry,\n ProjectionSpec,\n} from \"@langchain/langgraph-sdk/stream\";\n\n/**\n * Angular-side primitive that composes {@link ChannelRegistry.acquire}\n * with Angular Signals + {@link DestroyRef}.\n *\n * Contract (mirrors the React `useProjection` hook and the Vue\n * `useProjection` composable, but adapted to Angular's injection\n * context):\n *\n * - Must be called in an injection context (component / directive /\n * service field initializer, or `runInInjectionContext(...)`).\n * - On first read (or when `registry` / `key` change) acquires a\n * ref-counted projection from the registry and subscribes to its\n * store. A `computed` view over the snapshot signal is returned.\n * - On destroy (or when `registry` / `key` change) the previous\n * acquisition is released. If this was the last consumer of that\n * spec, the registry closes the underlying server subscription.\n * - When `registry` is `null`/`undefined` the projection stays at\n * `initialValue`. This is the happy path for root-served\n * projections (`injectMessages`, `injectToolCalls`,\n * `injectValues`) which delegate to the always-on root snapshot\n * instead of acquiring a new registry projection.\n *\n * Reactive inputs: `registry` and `key` accept either a plain value\n * or a `Signal` so selector helpers can feed a computed target (e.g.\n * a subagent snapshot tracked on a signal) and rebind automatically.\n */\nexport function injectProjection<T>(\n registry:\n | ChannelRegistry\n | null\n | undefined\n | Signal<ChannelRegistry | null | undefined>,\n specFactory: () => ProjectionSpec<T>,\n key: string | Signal<string>,\n initialValue: T\n): Signal<T> {\n const state = signal<T>(initialValue);\n const destroyRef = inject(DestroyRef);\n\n const registrySignal: () => ChannelRegistry | null | undefined = isSignal(\n registry\n )\n ? (registry as Signal<ChannelRegistry | null | undefined>)\n : () => registry as ChannelRegistry | null | undefined;\n const keySignal: () => string = isSignal(key)\n ? (key as Signal<string>)\n : () => key as string;\n\n let currentRegistry: ChannelRegistry | null | undefined;\n let currentKey: string | undefined;\n let currentRelease: (() => void) | undefined;\n let currentUnsubscribe: (() => void) | undefined;\n\n const detach = () => {\n currentUnsubscribe?.();\n currentUnsubscribe = undefined;\n currentRelease?.();\n currentRelease = undefined;\n };\n\n const attach = (\n nextRegistry: ChannelRegistry | null | undefined,\n nextKey: string\n ) => {\n if (nextRegistry === currentRegistry && nextKey === currentKey) return;\n detach();\n currentRegistry = nextRegistry;\n currentKey = nextKey;\n\n if (nextRegistry == null) {\n state.set(initialValue);\n return;\n }\n\n const acquired = nextRegistry.acquire(specFactory());\n state.set(acquired.store.getSnapshot());\n currentUnsubscribe = acquired.store.subscribe(() => {\n state.set(acquired.store.getSnapshot());\n });\n currentRelease = acquired.release;\n };\n\n // Acquire synchronously so selectors are subscribed before a user can\n // submit and emit short-lived custom/projection events.\n attach(registrySignal(), keySignal());\n destroyRef.onDestroy(detach);\n\n effect(() => {\n const nextRegistry = registrySignal();\n const nextKey = keySignal();\n untracked(() => {\n attach(nextRegistry, nextKey);\n });\n });\n\n return computed(() => state());\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,SAAgB,iBACd,UAKA,aACA,KACA,cACW;CACX,MAAM,SAAA,GAAA,cAAA,QAAkB,aAAa;CACrC,MAAM,cAAA,GAAA,cAAA,QAAoBA,cAAAA,WAAW;CAErC,MAAM,kBAAA,GAAA,cAAA,UACJ,SACD,GACI,iBACK;CACV,MAAM,aAAA,GAAA,cAAA,UAAmC,IAAI,GACxC,YACK;CAEV,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,MAAM,eAAe;AACnB,wBAAsB;AACtB,uBAAqB,KAAA;AACrB,oBAAkB;AAClB,mBAAiB,KAAA;;CAGnB,MAAM,UACJ,cACA,YACG;AACH,MAAI,iBAAiB,mBAAmB,YAAY,WAAY;AAChE,UAAQ;AACR,oBAAkB;AAClB,eAAa;AAEb,MAAI,gBAAgB,MAAM;AACxB,SAAM,IAAI,aAAa;AACvB;;EAGF,MAAM,WAAW,aAAa,QAAQ,aAAa,CAAC;AACpD,QAAM,IAAI,SAAS,MAAM,aAAa,CAAC;AACvC,uBAAqB,SAAS,MAAM,gBAAgB;AAClD,SAAM,IAAI,SAAS,MAAM,aAAa,CAAC;IACvC;AACF,mBAAiB,SAAS;;AAK5B,QAAO,gBAAgB,EAAE,WAAW,CAAC;AACrC,YAAW,UAAU,OAAO;AAE5B,EAAA,GAAA,cAAA,cAAa;EACX,MAAM,eAAe,gBAAgB;EACrC,MAAM,UAAU,WAAW;AAC3B,GAAA,GAAA,cAAA,iBAAgB;AACd,UAAO,cAAc,QAAQ;IAC7B;GACF;AAEF,SAAA,GAAA,cAAA,gBAAsB,OAAO,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ChannelRegistry, ProjectionSpec } from "@langchain/langgraph-sdk/stream";
|
|
2
|
+
import { Signal } from "@angular/core";
|
|
3
|
+
|
|
4
|
+
//#region src/inject-projection.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Angular-side primitive that composes {@link ChannelRegistry.acquire}
|
|
7
|
+
* with Angular Signals + {@link DestroyRef}.
|
|
8
|
+
*
|
|
9
|
+
* Contract (mirrors the React `useProjection` hook and the Vue
|
|
10
|
+
* `useProjection` composable, but adapted to Angular's injection
|
|
11
|
+
* context):
|
|
12
|
+
*
|
|
13
|
+
* - Must be called in an injection context (component / directive /
|
|
14
|
+
* service field initializer, or `runInInjectionContext(...)`).
|
|
15
|
+
* - On first read (or when `registry` / `key` change) acquires a
|
|
16
|
+
* ref-counted projection from the registry and subscribes to its
|
|
17
|
+
* store. A `computed` view over the snapshot signal is returned.
|
|
18
|
+
* - On destroy (or when `registry` / `key` change) the previous
|
|
19
|
+
* acquisition is released. If this was the last consumer of that
|
|
20
|
+
* spec, the registry closes the underlying server subscription.
|
|
21
|
+
* - When `registry` is `null`/`undefined` the projection stays at
|
|
22
|
+
* `initialValue`. This is the happy path for root-served
|
|
23
|
+
* projections (`injectMessages`, `injectToolCalls`,
|
|
24
|
+
* `injectValues`) which delegate to the always-on root snapshot
|
|
25
|
+
* instead of acquiring a new registry projection.
|
|
26
|
+
*
|
|
27
|
+
* Reactive inputs: `registry` and `key` accept either a plain value
|
|
28
|
+
* or a `Signal` so selector helpers can feed a computed target (e.g.
|
|
29
|
+
* a subagent snapshot tracked on a signal) and rebind automatically.
|
|
30
|
+
*/
|
|
31
|
+
declare function injectProjection<T>(registry: ChannelRegistry | null | undefined | Signal<ChannelRegistry | null | undefined>, specFactory: () => ProjectionSpec<T>, key: string | Signal<string>, initialValue: T): Signal<T>;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { injectProjection };
|
|
34
|
+
//# sourceMappingURL=inject-projection.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-projection.d.cts","names":[],"sources":["../src/inject-projection.ts"],"mappings":";;;;;;AAyCA;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,gBAAA,GAAA,CACd,QAAA,EACI,eAAA,sBAGA,MAAA,CAAO,eAAA,sBACX,WAAA,QAAmB,cAAA,CAAe,CAAA,GAClC,GAAA,WAAc,MAAA,UACd,YAAA,EAAc,CAAA,GACb,MAAA,CAAO,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Signal } from "@angular/core";
|
|
2
|
+
import { ChannelRegistry, ProjectionSpec } from "@langchain/langgraph-sdk/stream";
|
|
3
|
+
|
|
4
|
+
//#region src/inject-projection.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Angular-side primitive that composes {@link ChannelRegistry.acquire}
|
|
7
|
+
* with Angular Signals + {@link DestroyRef}.
|
|
8
|
+
*
|
|
9
|
+
* Contract (mirrors the React `useProjection` hook and the Vue
|
|
10
|
+
* `useProjection` composable, but adapted to Angular's injection
|
|
11
|
+
* context):
|
|
12
|
+
*
|
|
13
|
+
* - Must be called in an injection context (component / directive /
|
|
14
|
+
* service field initializer, or `runInInjectionContext(...)`).
|
|
15
|
+
* - On first read (or when `registry` / `key` change) acquires a
|
|
16
|
+
* ref-counted projection from the registry and subscribes to its
|
|
17
|
+
* store. A `computed` view over the snapshot signal is returned.
|
|
18
|
+
* - On destroy (or when `registry` / `key` change) the previous
|
|
19
|
+
* acquisition is released. If this was the last consumer of that
|
|
20
|
+
* spec, the registry closes the underlying server subscription.
|
|
21
|
+
* - When `registry` is `null`/`undefined` the projection stays at
|
|
22
|
+
* `initialValue`. This is the happy path for root-served
|
|
23
|
+
* projections (`injectMessages`, `injectToolCalls`,
|
|
24
|
+
* `injectValues`) which delegate to the always-on root snapshot
|
|
25
|
+
* instead of acquiring a new registry projection.
|
|
26
|
+
*
|
|
27
|
+
* Reactive inputs: `registry` and `key` accept either a plain value
|
|
28
|
+
* or a `Signal` so selector helpers can feed a computed target (e.g.
|
|
29
|
+
* a subagent snapshot tracked on a signal) and rebind automatically.
|
|
30
|
+
*/
|
|
31
|
+
declare function injectProjection<T>(registry: ChannelRegistry | null | undefined | Signal<ChannelRegistry | null | undefined>, specFactory: () => ProjectionSpec<T>, key: string | Signal<string>, initialValue: T): Signal<T>;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { injectProjection };
|
|
34
|
+
//# sourceMappingURL=inject-projection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-projection.d.ts","names":[],"sources":["../src/inject-projection.ts"],"mappings":";;;;;;AAyCA;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,gBAAA,GAAA,CACd,QAAA,EACI,eAAA,sBAGA,MAAA,CAAO,eAAA,sBACX,WAAA,QAAmB,cAAA,CAAe,CAAA,GAClC,GAAA,WAAc,MAAA,UACd,YAAA,EAAc,CAAA,GACb,MAAA,CAAO,CAAA"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { DestroyRef, computed, effect, inject, isSignal, signal, untracked } from "@angular/core";
|
|
2
|
+
//#region src/inject-projection.ts
|
|
3
|
+
/**
|
|
4
|
+
* Angular-side primitive that composes {@link ChannelRegistry.acquire}
|
|
5
|
+
* with Angular Signals + {@link DestroyRef}.
|
|
6
|
+
*
|
|
7
|
+
* Contract (mirrors the React `useProjection` hook and the Vue
|
|
8
|
+
* `useProjection` composable, but adapted to Angular's injection
|
|
9
|
+
* context):
|
|
10
|
+
*
|
|
11
|
+
* - Must be called in an injection context (component / directive /
|
|
12
|
+
* service field initializer, or `runInInjectionContext(...)`).
|
|
13
|
+
* - On first read (or when `registry` / `key` change) acquires a
|
|
14
|
+
* ref-counted projection from the registry and subscribes to its
|
|
15
|
+
* store. A `computed` view over the snapshot signal is returned.
|
|
16
|
+
* - On destroy (or when `registry` / `key` change) the previous
|
|
17
|
+
* acquisition is released. If this was the last consumer of that
|
|
18
|
+
* spec, the registry closes the underlying server subscription.
|
|
19
|
+
* - When `registry` is `null`/`undefined` the projection stays at
|
|
20
|
+
* `initialValue`. This is the happy path for root-served
|
|
21
|
+
* projections (`injectMessages`, `injectToolCalls`,
|
|
22
|
+
* `injectValues`) which delegate to the always-on root snapshot
|
|
23
|
+
* instead of acquiring a new registry projection.
|
|
24
|
+
*
|
|
25
|
+
* Reactive inputs: `registry` and `key` accept either a plain value
|
|
26
|
+
* or a `Signal` so selector helpers can feed a computed target (e.g.
|
|
27
|
+
* a subagent snapshot tracked on a signal) and rebind automatically.
|
|
28
|
+
*/
|
|
29
|
+
function injectProjection(registry, specFactory, key, initialValue) {
|
|
30
|
+
const state = signal(initialValue);
|
|
31
|
+
const destroyRef = inject(DestroyRef);
|
|
32
|
+
const registrySignal = isSignal(registry) ? registry : () => registry;
|
|
33
|
+
const keySignal = isSignal(key) ? key : () => key;
|
|
34
|
+
let currentRegistry;
|
|
35
|
+
let currentKey;
|
|
36
|
+
let currentRelease;
|
|
37
|
+
let currentUnsubscribe;
|
|
38
|
+
const detach = () => {
|
|
39
|
+
currentUnsubscribe?.();
|
|
40
|
+
currentUnsubscribe = void 0;
|
|
41
|
+
currentRelease?.();
|
|
42
|
+
currentRelease = void 0;
|
|
43
|
+
};
|
|
44
|
+
const attach = (nextRegistry, nextKey) => {
|
|
45
|
+
if (nextRegistry === currentRegistry && nextKey === currentKey) return;
|
|
46
|
+
detach();
|
|
47
|
+
currentRegistry = nextRegistry;
|
|
48
|
+
currentKey = nextKey;
|
|
49
|
+
if (nextRegistry == null) {
|
|
50
|
+
state.set(initialValue);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const acquired = nextRegistry.acquire(specFactory());
|
|
54
|
+
state.set(acquired.store.getSnapshot());
|
|
55
|
+
currentUnsubscribe = acquired.store.subscribe(() => {
|
|
56
|
+
state.set(acquired.store.getSnapshot());
|
|
57
|
+
});
|
|
58
|
+
currentRelease = acquired.release;
|
|
59
|
+
};
|
|
60
|
+
attach(registrySignal(), keySignal());
|
|
61
|
+
destroyRef.onDestroy(detach);
|
|
62
|
+
effect(() => {
|
|
63
|
+
const nextRegistry = registrySignal();
|
|
64
|
+
const nextKey = keySignal();
|
|
65
|
+
untracked(() => {
|
|
66
|
+
attach(nextRegistry, nextKey);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
return computed(() => state());
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { injectProjection };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=inject-projection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-projection.js","names":[],"sources":["../src/inject-projection.ts"],"sourcesContent":["import {\n DestroyRef,\n computed,\n effect,\n inject,\n isSignal,\n signal,\n untracked,\n type Signal,\n} from \"@angular/core\";\nimport type {\n ChannelRegistry,\n ProjectionSpec,\n} from \"@langchain/langgraph-sdk/stream\";\n\n/**\n * Angular-side primitive that composes {@link ChannelRegistry.acquire}\n * with Angular Signals + {@link DestroyRef}.\n *\n * Contract (mirrors the React `useProjection` hook and the Vue\n * `useProjection` composable, but adapted to Angular's injection\n * context):\n *\n * - Must be called in an injection context (component / directive /\n * service field initializer, or `runInInjectionContext(...)`).\n * - On first read (or when `registry` / `key` change) acquires a\n * ref-counted projection from the registry and subscribes to its\n * store. A `computed` view over the snapshot signal is returned.\n * - On destroy (or when `registry` / `key` change) the previous\n * acquisition is released. If this was the last consumer of that\n * spec, the registry closes the underlying server subscription.\n * - When `registry` is `null`/`undefined` the projection stays at\n * `initialValue`. This is the happy path for root-served\n * projections (`injectMessages`, `injectToolCalls`,\n * `injectValues`) which delegate to the always-on root snapshot\n * instead of acquiring a new registry projection.\n *\n * Reactive inputs: `registry` and `key` accept either a plain value\n * or a `Signal` so selector helpers can feed a computed target (e.g.\n * a subagent snapshot tracked on a signal) and rebind automatically.\n */\nexport function injectProjection<T>(\n registry:\n | ChannelRegistry\n | null\n | undefined\n | Signal<ChannelRegistry | null | undefined>,\n specFactory: () => ProjectionSpec<T>,\n key: string | Signal<string>,\n initialValue: T\n): Signal<T> {\n const state = signal<T>(initialValue);\n const destroyRef = inject(DestroyRef);\n\n const registrySignal: () => ChannelRegistry | null | undefined = isSignal(\n registry\n )\n ? (registry as Signal<ChannelRegistry | null | undefined>)\n : () => registry as ChannelRegistry | null | undefined;\n const keySignal: () => string = isSignal(key)\n ? (key as Signal<string>)\n : () => key as string;\n\n let currentRegistry: ChannelRegistry | null | undefined;\n let currentKey: string | undefined;\n let currentRelease: (() => void) | undefined;\n let currentUnsubscribe: (() => void) | undefined;\n\n const detach = () => {\n currentUnsubscribe?.();\n currentUnsubscribe = undefined;\n currentRelease?.();\n currentRelease = undefined;\n };\n\n const attach = (\n nextRegistry: ChannelRegistry | null | undefined,\n nextKey: string\n ) => {\n if (nextRegistry === currentRegistry && nextKey === currentKey) return;\n detach();\n currentRegistry = nextRegistry;\n currentKey = nextKey;\n\n if (nextRegistry == null) {\n state.set(initialValue);\n return;\n }\n\n const acquired = nextRegistry.acquire(specFactory());\n state.set(acquired.store.getSnapshot());\n currentUnsubscribe = acquired.store.subscribe(() => {\n state.set(acquired.store.getSnapshot());\n });\n currentRelease = acquired.release;\n };\n\n // Acquire synchronously so selectors are subscribed before a user can\n // submit and emit short-lived custom/projection events.\n attach(registrySignal(), keySignal());\n destroyRef.onDestroy(detach);\n\n effect(() => {\n const nextRegistry = registrySignal();\n const nextKey = keySignal();\n untracked(() => {\n attach(nextRegistry, nextKey);\n });\n });\n\n return computed(() => state());\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,SAAgB,iBACd,UAKA,aACA,KACA,cACW;CACX,MAAM,QAAQ,OAAU,aAAa;CACrC,MAAM,aAAa,OAAO,WAAW;CAErC,MAAM,iBAA2D,SAC/D,SACD,GACI,iBACK;CACV,MAAM,YAA0B,SAAS,IAAI,GACxC,YACK;CAEV,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,MAAM,eAAe;AACnB,wBAAsB;AACtB,uBAAqB,KAAA;AACrB,oBAAkB;AAClB,mBAAiB,KAAA;;CAGnB,MAAM,UACJ,cACA,YACG;AACH,MAAI,iBAAiB,mBAAmB,YAAY,WAAY;AAChE,UAAQ;AACR,oBAAkB;AAClB,eAAa;AAEb,MAAI,gBAAgB,MAAM;AACxB,SAAM,IAAI,aAAa;AACvB;;EAGF,MAAM,WAAW,aAAa,QAAQ,aAAa,CAAC;AACpD,QAAM,IAAI,SAAS,MAAM,aAAa,CAAC;AACvC,uBAAqB,SAAS,MAAM,gBAAgB;AAClD,SAAM,IAAI,SAAS,MAAM,aAAa,CAAC;IACvC;AACF,mBAAiB,SAAS;;AAK5B,QAAO,gBAAgB,EAAE,WAAW,CAAC;AACrC,YAAW,UAAU,OAAO;AAE5B,cAAa;EACX,MAAM,eAAe,gBAAgB;EACrC,MAAM,UAAU,WAAW;AAC3B,kBAAgB;AACd,UAAO,cAAc,QAAQ;IAC7B;GACF;AAEF,QAAO,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const require_use_stream = require("./use-stream.cjs");
|
|
2
|
+
const require_context = require("./context.cjs");
|
|
3
|
+
let _angular_core = require("@angular/core");
|
|
4
|
+
//#region src/inject-stream.ts
|
|
5
|
+
function injectStream(options) {
|
|
6
|
+
if (options == null) {
|
|
7
|
+
const shared = (0, _angular_core.inject)(require_context.STREAM_INSTANCE, { optional: true });
|
|
8
|
+
if (shared == null) throw new Error("injectStream() requires an ancestor to call provideStream(). Add provideStream({ assistantId: '...' }) to a parent component's providers array, or call injectStream(options) directly.");
|
|
9
|
+
return shared;
|
|
10
|
+
}
|
|
11
|
+
return require_use_stream.useStream(mergeDefaults(options, (0, _angular_core.inject)(require_context.STREAM_DEFAULTS, { optional: true }) ?? void 0));
|
|
12
|
+
}
|
|
13
|
+
function mergeDefaults(options, defaults) {
|
|
14
|
+
if (defaults == null) return options;
|
|
15
|
+
if (options.transport != null && typeof options.transport !== "string") return options;
|
|
16
|
+
const bag = options;
|
|
17
|
+
return {
|
|
18
|
+
...bag,
|
|
19
|
+
apiUrl: bag.apiUrl ?? defaults.apiUrl,
|
|
20
|
+
apiKey: bag.apiKey ?? defaults.apiKey,
|
|
21
|
+
client: bag.client ?? defaults.client
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
exports.injectStream = injectStream;
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=inject-stream.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-stream.cjs","names":["STREAM_INSTANCE","useStream","STREAM_DEFAULTS"],"sources":["../src/inject-stream.ts"],"sourcesContent":["import { inject } from \"@angular/core\";\nimport type { InferStateType } from \"@langchain/langgraph-sdk/stream\";\nimport {\n STREAM_DEFAULTS,\n STREAM_INSTANCE,\n type StreamDefaults,\n} from \"./context.js\";\nimport {\n useStream,\n type StreamApi,\n type UseStreamOptions,\n} from \"./use-stream.js\";\n\n/**\n * Angular entry point for the v2-native stream runtime.\n *\n * Call from a component, directive, or service field initializer to\n * attach an {@link StreamApi} bound to the current {@link DestroyRef}:\n *\n * ```ts\n * @Component({ template: `<div>{{ stream.messages() | json }}</div>` })\n * export class Chat {\n * readonly stream = injectStream({\n * assistantId: \"agent\",\n * apiUrl: \"http://localhost:2024\",\n * });\n * }\n * ```\n *\n * When called with no arguments, looks up a shared `StreamApi`\n * previously registered via {@link provideStream}. Throws if no\n * ancestor provider exists.\n *\n * Must always run inside an Angular injection context.\n */\nexport function injectStream<\n T = Record<string, unknown>,\n InterruptType = unknown,\n ConfigurableType extends object = Record<string, unknown>,\n>(): StreamApi<T, InterruptType, ConfigurableType>;\nexport function injectStream<\n T = Record<string, unknown>,\n InterruptType = unknown,\n ConfigurableType extends object = Record<string, unknown>,\n>(\n options: UseStreamOptions<InferStateType<T>>\n): StreamApi<T, InterruptType, ConfigurableType>;\nexport function injectStream(\n options?: UseStreamOptions<Record<string, unknown>>\n): StreamApi {\n if (options == null) {\n const shared = inject(STREAM_INSTANCE, { optional: true });\n if (shared == null) {\n throw new Error(\n \"injectStream() requires an ancestor to call provideStream(). \" +\n \"Add provideStream({ assistantId: '...' }) to a parent component's \" +\n \"providers array, or call injectStream(options) directly.\"\n );\n }\n return shared as StreamApi;\n }\n\n const defaults = inject(STREAM_DEFAULTS, { optional: true }) ?? undefined;\n const merged = mergeDefaults(options, defaults);\n return useStream(merged) as StreamApi;\n}\n\nfunction mergeDefaults<S extends object>(\n options: UseStreamOptions<S>,\n defaults: StreamDefaults | undefined\n): UseStreamOptions<S> {\n if (defaults == null) return options;\n // Only merge into the agent-server branch — the custom-adapter\n // branch owns its own wire and must not inherit `apiUrl` / `client`.\n if (\n (options as { transport?: unknown }).transport != null &&\n typeof (options as { transport: unknown }).transport !== \"string\"\n ) {\n return options;\n }\n const bag = options as unknown as Record<string, unknown>;\n return {\n ...bag,\n apiUrl: bag.apiUrl ?? defaults.apiUrl,\n apiKey: bag.apiKey ?? defaults.apiKey,\n client: bag.client ?? defaults.client,\n } as unknown as UseStreamOptions<S>;\n}\n"],"mappings":";;;;AA+CA,SAAgB,aACd,SACW;AACX,KAAI,WAAW,MAAM;EACnB,MAAM,UAAA,GAAA,cAAA,QAAgBA,gBAAAA,iBAAiB,EAAE,UAAU,MAAM,CAAC;AAC1D,MAAI,UAAU,KACZ,OAAM,IAAI,MACR,0LAGD;AAEH,SAAO;;AAKT,QAAOC,mBAAAA,UADQ,cAAc,UAAA,GAAA,cAAA,QADLC,gBAAAA,iBAAiB,EAAE,UAAU,MAAM,CAAC,IAAI,KAAA,EACjB,CACvB;;AAG1B,SAAS,cACP,SACA,UACqB;AACrB,KAAI,YAAY,KAAM,QAAO;AAG7B,KACG,QAAoC,aAAa,QAClD,OAAQ,QAAmC,cAAc,SAEzD,QAAO;CAET,MAAM,MAAM;AACZ,QAAO;EACL,GAAG;EACH,QAAQ,IAAI,UAAU,SAAS;EAC/B,QAAQ,IAAI,UAAU,SAAS;EAC/B,QAAQ,IAAI,UAAU,SAAS;EAChC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { StreamApi, UseStreamOptions as UseStreamOptions$1 } from "./use-stream.cjs";
|
|
2
|
+
import { InferStateType } from "@langchain/langgraph-sdk/stream";
|
|
3
|
+
|
|
4
|
+
//#region src/inject-stream.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Angular entry point for the v2-native stream runtime.
|
|
7
|
+
*
|
|
8
|
+
* Call from a component, directive, or service field initializer to
|
|
9
|
+
* attach an {@link StreamApi} bound to the current {@link DestroyRef}:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* @Component({ template: `<div>{{ stream.messages() | json }}</div>` })
|
|
13
|
+
* export class Chat {
|
|
14
|
+
* readonly stream = injectStream({
|
|
15
|
+
* assistantId: "agent",
|
|
16
|
+
* apiUrl: "http://localhost:2024",
|
|
17
|
+
* });
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* When called with no arguments, looks up a shared `StreamApi`
|
|
22
|
+
* previously registered via {@link provideStream}. Throws if no
|
|
23
|
+
* ancestor provider exists.
|
|
24
|
+
*
|
|
25
|
+
* Must always run inside an Angular injection context.
|
|
26
|
+
*/
|
|
27
|
+
declare function injectStream<T = Record<string, unknown>, InterruptType = unknown, ConfigurableType extends object = Record<string, unknown>>(): StreamApi<T, InterruptType, ConfigurableType>;
|
|
28
|
+
declare function injectStream<T = Record<string, unknown>, InterruptType = unknown, ConfigurableType extends object = Record<string, unknown>>(options: UseStreamOptions$1<InferStateType<T>>): StreamApi<T, InterruptType, ConfigurableType>;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { injectStream };
|
|
31
|
+
//# sourceMappingURL=inject-stream.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-stream.d.cts","names":[],"sources":["../src/inject-stream.ts"],"mappings":";;;;;;AAmCA;;;;;;;;;;;;;;;;;;;;iBAAgB,YAAA,KACV,MAAA,8EAE8B,MAAA,kBAAA,CAAA,GAC/B,SAAA,CAAU,CAAA,EAAG,aAAA,EAAe,gBAAA;AAAA,iBACjB,YAAA,KACV,MAAA,8EAE8B,MAAA,kBAAA,CAElC,OAAA,EAAS,kBAAA,CAAiB,cAAA,CAAe,CAAA,KACxC,SAAA,CAAU,CAAA,EAAG,aAAA,EAAe,gBAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { StreamApi, UseStreamOptions as UseStreamOptions$1 } from "./use-stream.js";
|
|
2
|
+
import { InferStateType } from "@langchain/langgraph-sdk/stream";
|
|
3
|
+
|
|
4
|
+
//#region src/inject-stream.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Angular entry point for the v2-native stream runtime.
|
|
7
|
+
*
|
|
8
|
+
* Call from a component, directive, or service field initializer to
|
|
9
|
+
* attach an {@link StreamApi} bound to the current {@link DestroyRef}:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* @Component({ template: `<div>{{ stream.messages() | json }}</div>` })
|
|
13
|
+
* export class Chat {
|
|
14
|
+
* readonly stream = injectStream({
|
|
15
|
+
* assistantId: "agent",
|
|
16
|
+
* apiUrl: "http://localhost:2024",
|
|
17
|
+
* });
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* When called with no arguments, looks up a shared `StreamApi`
|
|
22
|
+
* previously registered via {@link provideStream}. Throws if no
|
|
23
|
+
* ancestor provider exists.
|
|
24
|
+
*
|
|
25
|
+
* Must always run inside an Angular injection context.
|
|
26
|
+
*/
|
|
27
|
+
declare function injectStream<T = Record<string, unknown>, InterruptType = unknown, ConfigurableType extends object = Record<string, unknown>>(): StreamApi<T, InterruptType, ConfigurableType>;
|
|
28
|
+
declare function injectStream<T = Record<string, unknown>, InterruptType = unknown, ConfigurableType extends object = Record<string, unknown>>(options: UseStreamOptions$1<InferStateType<T>>): StreamApi<T, InterruptType, ConfigurableType>;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { injectStream };
|
|
31
|
+
//# sourceMappingURL=inject-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-stream.d.ts","names":[],"sources":["../src/inject-stream.ts"],"mappings":";;;;;;AAmCA;;;;;;;;;;;;;;;;;;;;iBAAgB,YAAA,KACV,MAAA,8EAE8B,MAAA,kBAAA,CAAA,GAC/B,SAAA,CAAU,CAAA,EAAG,aAAA,EAAe,gBAAA;AAAA,iBACjB,YAAA,KACV,MAAA,8EAE8B,MAAA,kBAAA,CAElC,OAAA,EAAS,kBAAA,CAAiB,cAAA,CAAe,CAAA,KACxC,SAAA,CAAU,CAAA,EAAG,aAAA,EAAe,gBAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useStream } from "./use-stream.js";
|
|
2
|
+
import { STREAM_DEFAULTS, STREAM_INSTANCE } from "./context.js";
|
|
3
|
+
import { inject } from "@angular/core";
|
|
4
|
+
//#region src/inject-stream.ts
|
|
5
|
+
function injectStream(options) {
|
|
6
|
+
if (options == null) {
|
|
7
|
+
const shared = inject(STREAM_INSTANCE, { optional: true });
|
|
8
|
+
if (shared == null) throw new Error("injectStream() requires an ancestor to call provideStream(). Add provideStream({ assistantId: '...' }) to a parent component's providers array, or call injectStream(options) directly.");
|
|
9
|
+
return shared;
|
|
10
|
+
}
|
|
11
|
+
return useStream(mergeDefaults(options, inject(STREAM_DEFAULTS, { optional: true }) ?? void 0));
|
|
12
|
+
}
|
|
13
|
+
function mergeDefaults(options, defaults) {
|
|
14
|
+
if (defaults == null) return options;
|
|
15
|
+
if (options.transport != null && typeof options.transport !== "string") return options;
|
|
16
|
+
const bag = options;
|
|
17
|
+
return {
|
|
18
|
+
...bag,
|
|
19
|
+
apiUrl: bag.apiUrl ?? defaults.apiUrl,
|
|
20
|
+
apiKey: bag.apiKey ?? defaults.apiKey,
|
|
21
|
+
client: bag.client ?? defaults.client
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { injectStream };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=inject-stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-stream.js","names":[],"sources":["../src/inject-stream.ts"],"sourcesContent":["import { inject } from \"@angular/core\";\nimport type { InferStateType } from \"@langchain/langgraph-sdk/stream\";\nimport {\n STREAM_DEFAULTS,\n STREAM_INSTANCE,\n type StreamDefaults,\n} from \"./context.js\";\nimport {\n useStream,\n type StreamApi,\n type UseStreamOptions,\n} from \"./use-stream.js\";\n\n/**\n * Angular entry point for the v2-native stream runtime.\n *\n * Call from a component, directive, or service field initializer to\n * attach an {@link StreamApi} bound to the current {@link DestroyRef}:\n *\n * ```ts\n * @Component({ template: `<div>{{ stream.messages() | json }}</div>` })\n * export class Chat {\n * readonly stream = injectStream({\n * assistantId: \"agent\",\n * apiUrl: \"http://localhost:2024\",\n * });\n * }\n * ```\n *\n * When called with no arguments, looks up a shared `StreamApi`\n * previously registered via {@link provideStream}. Throws if no\n * ancestor provider exists.\n *\n * Must always run inside an Angular injection context.\n */\nexport function injectStream<\n T = Record<string, unknown>,\n InterruptType = unknown,\n ConfigurableType extends object = Record<string, unknown>,\n>(): StreamApi<T, InterruptType, ConfigurableType>;\nexport function injectStream<\n T = Record<string, unknown>,\n InterruptType = unknown,\n ConfigurableType extends object = Record<string, unknown>,\n>(\n options: UseStreamOptions<InferStateType<T>>\n): StreamApi<T, InterruptType, ConfigurableType>;\nexport function injectStream(\n options?: UseStreamOptions<Record<string, unknown>>\n): StreamApi {\n if (options == null) {\n const shared = inject(STREAM_INSTANCE, { optional: true });\n if (shared == null) {\n throw new Error(\n \"injectStream() requires an ancestor to call provideStream(). \" +\n \"Add provideStream({ assistantId: '...' }) to a parent component's \" +\n \"providers array, or call injectStream(options) directly.\"\n );\n }\n return shared as StreamApi;\n }\n\n const defaults = inject(STREAM_DEFAULTS, { optional: true }) ?? undefined;\n const merged = mergeDefaults(options, defaults);\n return useStream(merged) as StreamApi;\n}\n\nfunction mergeDefaults<S extends object>(\n options: UseStreamOptions<S>,\n defaults: StreamDefaults | undefined\n): UseStreamOptions<S> {\n if (defaults == null) return options;\n // Only merge into the agent-server branch — the custom-adapter\n // branch owns its own wire and must not inherit `apiUrl` / `client`.\n if (\n (options as { transport?: unknown }).transport != null &&\n typeof (options as { transport: unknown }).transport !== \"string\"\n ) {\n return options;\n }\n const bag = options as unknown as Record<string, unknown>;\n return {\n ...bag,\n apiUrl: bag.apiUrl ?? defaults.apiUrl,\n apiKey: bag.apiKey ?? defaults.apiKey,\n client: bag.client ?? defaults.client,\n } as unknown as UseStreamOptions<S>;\n}\n"],"mappings":";;;;AA+CA,SAAgB,aACd,SACW;AACX,KAAI,WAAW,MAAM;EACnB,MAAM,SAAS,OAAO,iBAAiB,EAAE,UAAU,MAAM,CAAC;AAC1D,MAAI,UAAU,KACZ,OAAM,IAAI,MACR,0LAGD;AAEH,SAAO;;AAKT,QAAO,UADQ,cAAc,SADZ,OAAO,iBAAiB,EAAE,UAAU,MAAM,CAAC,IAAI,KAAA,EACjB,CACvB;;AAG1B,SAAS,cACP,SACA,UACqB;AACrB,KAAI,YAAY,KAAM,QAAO;AAG7B,KACG,QAAoC,aAAa,QAClD,OAAQ,QAAmC,cAAc,SAEzD,QAAO;CAET,MAAM,MAAM;AACZ,QAAO;EACL,GAAG;EACH,QAAQ,IAAI,UAAU,SAAS;EAC/B,QAAQ,IAAI,UAAU,SAAS;EAC/B,QAAQ,IAAI,UAAU,SAAS;EAChC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const require_use_stream = require("./use-stream.cjs");
|
|
2
|
+
let _angular_core = require("@angular/core");
|
|
3
|
+
//#region src/selectors-metadata.ts
|
|
4
|
+
/**
|
|
5
|
+
* Read metadata recorded for a specific message id — today exposes
|
|
6
|
+
* `parentCheckpointId`, the checkpoint the message was first seen on.
|
|
7
|
+
* Designed for fork / edit flows:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* readonly meta = injectMessageMetadata(this.stream, () => this.msg().id);
|
|
11
|
+
* // meta()?.parentCheckpointId
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* `messageId` accepts a raw string, a `Signal<string | undefined>`,
|
|
15
|
+
* or a plain getter — the binding re-evaluates whenever the id
|
|
16
|
+
* changes.
|
|
17
|
+
*
|
|
18
|
+
* Returns `undefined` when the id isn't known yet (e.g. the server
|
|
19
|
+
* hasn't emitted `parent_checkpoint` for that message, or the message
|
|
20
|
+
* arrived via `messages`-channel deltas only and no `values` snapshot
|
|
21
|
+
* has landed for it yet).
|
|
22
|
+
*/
|
|
23
|
+
function injectMessageMetadata(stream, messageId) {
|
|
24
|
+
const destroyRef = (0, _angular_core.inject)(_angular_core.DestroyRef);
|
|
25
|
+
const store = stream[require_use_stream.STREAM_CONTROLLER].messageMetadataStore;
|
|
26
|
+
const mapSignal = (0, _angular_core.signal)(store.getSnapshot());
|
|
27
|
+
const unsubscribe = store.subscribe(() => mapSignal.set(store.getSnapshot()));
|
|
28
|
+
destroyRef.onDestroy(unsubscribe);
|
|
29
|
+
const read = (0, _angular_core.isSignal)(messageId) ? messageId : typeof messageId === "function" ? messageId : () => messageId;
|
|
30
|
+
return (0, _angular_core.computed)(() => {
|
|
31
|
+
const id = read();
|
|
32
|
+
if (id == null) return void 0;
|
|
33
|
+
return mapSignal().get(id);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
exports.injectMessageMetadata = injectMessageMetadata;
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=selectors-metadata.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors-metadata.cjs","names":["DestroyRef","STREAM_CONTROLLER"],"sources":["../src/selectors-metadata.ts"],"sourcesContent":["import {\n DestroyRef,\n computed,\n inject,\n isSignal,\n signal,\n type Signal,\n} from \"@angular/core\";\nimport type {\n MessageMetadata,\n MessageMetadataMap,\n} from \"@langchain/langgraph-sdk/stream\";\nimport { STREAM_CONTROLLER, type AnyStream } from \"./use-stream.js\";\n\n/**\n * Read metadata recorded for a specific message id — today exposes\n * `parentCheckpointId`, the checkpoint the message was first seen on.\n * Designed for fork / edit flows:\n *\n * ```ts\n * readonly meta = injectMessageMetadata(this.stream, () => this.msg().id);\n * // meta()?.parentCheckpointId\n * ```\n *\n * `messageId` accepts a raw string, a `Signal<string | undefined>`,\n * or a plain getter — the binding re-evaluates whenever the id\n * changes.\n *\n * Returns `undefined` when the id isn't known yet (e.g. the server\n * hasn't emitted `parent_checkpoint` for that message, or the message\n * arrived via `messages`-channel deltas only and no `values` snapshot\n * has landed for it yet).\n */\nexport function injectMessageMetadata(\n stream: AnyStream,\n messageId:\n | string\n | undefined\n | Signal<string | undefined>\n | (() => string | undefined)\n): Signal<MessageMetadata | undefined> {\n const destroyRef = inject(DestroyRef);\n const store = stream[STREAM_CONTROLLER].messageMetadataStore;\n\n const mapSignal = signal<MessageMetadataMap>(store.getSnapshot());\n const unsubscribe = store.subscribe(() => mapSignal.set(store.getSnapshot()));\n destroyRef.onDestroy(unsubscribe);\n\n const read: () => string | undefined = isSignal(messageId)\n ? (messageId as Signal<string | undefined>)\n : typeof messageId === \"function\"\n ? (messageId as () => string | undefined)\n : () => messageId as string | undefined;\n\n return computed(() => {\n const id = read();\n if (id == null) return undefined;\n return mapSignal().get(id);\n });\n}\n\nexport type { MessageMetadata, MessageMetadataMap };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,SAAgB,sBACd,QACA,WAKqC;CACrC,MAAM,cAAA,GAAA,cAAA,QAAoBA,cAAAA,WAAW;CACrC,MAAM,QAAQ,OAAOC,mBAAAA,mBAAmB;CAExC,MAAM,aAAA,GAAA,cAAA,QAAuC,MAAM,aAAa,CAAC;CACjE,MAAM,cAAc,MAAM,gBAAgB,UAAU,IAAI,MAAM,aAAa,CAAC,CAAC;AAC7E,YAAW,UAAU,YAAY;CAEjC,MAAM,QAAA,GAAA,cAAA,UAA0C,UAAU,GACrD,YACD,OAAO,cAAc,aAClB,kBACK;AAEZ,SAAA,GAAA,cAAA,gBAAsB;EACpB,MAAM,KAAK,MAAM;AACjB,MAAI,MAAM,KAAM,QAAO,KAAA;AACvB,SAAO,WAAW,CAAC,IAAI,GAAG;GAC1B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AnyStream } from "./use-stream.cjs";
|
|
2
|
+
import { MessageMetadata, MessageMetadataMap } from "@langchain/langgraph-sdk/stream";
|
|
3
|
+
import { Signal } from "@angular/core";
|
|
4
|
+
|
|
5
|
+
//#region src/selectors-metadata.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Read metadata recorded for a specific message id — today exposes
|
|
8
|
+
* `parentCheckpointId`, the checkpoint the message was first seen on.
|
|
9
|
+
* Designed for fork / edit flows:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* readonly meta = injectMessageMetadata(this.stream, () => this.msg().id);
|
|
13
|
+
* // meta()?.parentCheckpointId
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* `messageId` accepts a raw string, a `Signal<string | undefined>`,
|
|
17
|
+
* or a plain getter — the binding re-evaluates whenever the id
|
|
18
|
+
* changes.
|
|
19
|
+
*
|
|
20
|
+
* Returns `undefined` when the id isn't known yet (e.g. the server
|
|
21
|
+
* hasn't emitted `parent_checkpoint` for that message, or the message
|
|
22
|
+
* arrived via `messages`-channel deltas only and no `values` snapshot
|
|
23
|
+
* has landed for it yet).
|
|
24
|
+
*/
|
|
25
|
+
declare function injectMessageMetadata(stream: AnyStream, messageId: string | undefined | Signal<string | undefined> | (() => string | undefined)): Signal<MessageMetadata | undefined>;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { type MessageMetadata, type MessageMetadataMap, injectMessageMetadata };
|
|
28
|
+
//# sourceMappingURL=selectors-metadata.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors-metadata.d.cts","names":[],"sources":["../src/selectors-metadata.ts"],"mappings":";;;;;;;AAiCA;;;;;;;;;;;;;;;;;iBAAgB,qBAAA,CACd,MAAA,EAAQ,SAAA,EACR,SAAA,uBAGI,MAAA,oDAEH,MAAA,CAAO,eAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AnyStream } from "./use-stream.js";
|
|
2
|
+
import { Signal } from "@angular/core";
|
|
3
|
+
import { MessageMetadata, MessageMetadataMap } from "@langchain/langgraph-sdk/stream";
|
|
4
|
+
|
|
5
|
+
//#region src/selectors-metadata.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Read metadata recorded for a specific message id — today exposes
|
|
8
|
+
* `parentCheckpointId`, the checkpoint the message was first seen on.
|
|
9
|
+
* Designed for fork / edit flows:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* readonly meta = injectMessageMetadata(this.stream, () => this.msg().id);
|
|
13
|
+
* // meta()?.parentCheckpointId
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* `messageId` accepts a raw string, a `Signal<string | undefined>`,
|
|
17
|
+
* or a plain getter — the binding re-evaluates whenever the id
|
|
18
|
+
* changes.
|
|
19
|
+
*
|
|
20
|
+
* Returns `undefined` when the id isn't known yet (e.g. the server
|
|
21
|
+
* hasn't emitted `parent_checkpoint` for that message, or the message
|
|
22
|
+
* arrived via `messages`-channel deltas only and no `values` snapshot
|
|
23
|
+
* has landed for it yet).
|
|
24
|
+
*/
|
|
25
|
+
declare function injectMessageMetadata(stream: AnyStream, messageId: string | undefined | Signal<string | undefined> | (() => string | undefined)): Signal<MessageMetadata | undefined>;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { type MessageMetadata, type MessageMetadataMap, injectMessageMetadata };
|
|
28
|
+
//# sourceMappingURL=selectors-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors-metadata.d.ts","names":[],"sources":["../src/selectors-metadata.ts"],"mappings":";;;;;;;AAiCA;;;;;;;;;;;;;;;;;iBAAgB,qBAAA,CACd,MAAA,EAAQ,SAAA,EACR,SAAA,uBAGI,MAAA,oDAEH,MAAA,CAAO,eAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { STREAM_CONTROLLER } from "./use-stream.js";
|
|
2
|
+
import { DestroyRef, computed, inject, isSignal, signal } from "@angular/core";
|
|
3
|
+
//#region src/selectors-metadata.ts
|
|
4
|
+
/**
|
|
5
|
+
* Read metadata recorded for a specific message id — today exposes
|
|
6
|
+
* `parentCheckpointId`, the checkpoint the message was first seen on.
|
|
7
|
+
* Designed for fork / edit flows:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* readonly meta = injectMessageMetadata(this.stream, () => this.msg().id);
|
|
11
|
+
* // meta()?.parentCheckpointId
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* `messageId` accepts a raw string, a `Signal<string | undefined>`,
|
|
15
|
+
* or a plain getter — the binding re-evaluates whenever the id
|
|
16
|
+
* changes.
|
|
17
|
+
*
|
|
18
|
+
* Returns `undefined` when the id isn't known yet (e.g. the server
|
|
19
|
+
* hasn't emitted `parent_checkpoint` for that message, or the message
|
|
20
|
+
* arrived via `messages`-channel deltas only and no `values` snapshot
|
|
21
|
+
* has landed for it yet).
|
|
22
|
+
*/
|
|
23
|
+
function injectMessageMetadata(stream, messageId) {
|
|
24
|
+
const destroyRef = inject(DestroyRef);
|
|
25
|
+
const store = stream[STREAM_CONTROLLER].messageMetadataStore;
|
|
26
|
+
const mapSignal = signal(store.getSnapshot());
|
|
27
|
+
const unsubscribe = store.subscribe(() => mapSignal.set(store.getSnapshot()));
|
|
28
|
+
destroyRef.onDestroy(unsubscribe);
|
|
29
|
+
const read = isSignal(messageId) ? messageId : typeof messageId === "function" ? messageId : () => messageId;
|
|
30
|
+
return computed(() => {
|
|
31
|
+
const id = read();
|
|
32
|
+
if (id == null) return void 0;
|
|
33
|
+
return mapSignal().get(id);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { injectMessageMetadata };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=selectors-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors-metadata.js","names":[],"sources":["../src/selectors-metadata.ts"],"sourcesContent":["import {\n DestroyRef,\n computed,\n inject,\n isSignal,\n signal,\n type Signal,\n} from \"@angular/core\";\nimport type {\n MessageMetadata,\n MessageMetadataMap,\n} from \"@langchain/langgraph-sdk/stream\";\nimport { STREAM_CONTROLLER, type AnyStream } from \"./use-stream.js\";\n\n/**\n * Read metadata recorded for a specific message id — today exposes\n * `parentCheckpointId`, the checkpoint the message was first seen on.\n * Designed for fork / edit flows:\n *\n * ```ts\n * readonly meta = injectMessageMetadata(this.stream, () => this.msg().id);\n * // meta()?.parentCheckpointId\n * ```\n *\n * `messageId` accepts a raw string, a `Signal<string | undefined>`,\n * or a plain getter — the binding re-evaluates whenever the id\n * changes.\n *\n * Returns `undefined` when the id isn't known yet (e.g. the server\n * hasn't emitted `parent_checkpoint` for that message, or the message\n * arrived via `messages`-channel deltas only and no `values` snapshot\n * has landed for it yet).\n */\nexport function injectMessageMetadata(\n stream: AnyStream,\n messageId:\n | string\n | undefined\n | Signal<string | undefined>\n | (() => string | undefined)\n): Signal<MessageMetadata | undefined> {\n const destroyRef = inject(DestroyRef);\n const store = stream[STREAM_CONTROLLER].messageMetadataStore;\n\n const mapSignal = signal<MessageMetadataMap>(store.getSnapshot());\n const unsubscribe = store.subscribe(() => mapSignal.set(store.getSnapshot()));\n destroyRef.onDestroy(unsubscribe);\n\n const read: () => string | undefined = isSignal(messageId)\n ? (messageId as Signal<string | undefined>)\n : typeof messageId === \"function\"\n ? (messageId as () => string | undefined)\n : () => messageId as string | undefined;\n\n return computed(() => {\n const id = read();\n if (id == null) return undefined;\n return mapSignal().get(id);\n });\n}\n\nexport type { MessageMetadata, MessageMetadataMap };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,SAAgB,sBACd,QACA,WAKqC;CACrC,MAAM,aAAa,OAAO,WAAW;CACrC,MAAM,QAAQ,OAAO,mBAAmB;CAExC,MAAM,YAAY,OAA2B,MAAM,aAAa,CAAC;CACjE,MAAM,cAAc,MAAM,gBAAgB,UAAU,IAAI,MAAM,aAAa,CAAC,CAAC;AAC7E,YAAW,UAAU,YAAY;CAEjC,MAAM,OAAiC,SAAS,UAAU,GACrD,YACD,OAAO,cAAc,aAClB,kBACK;AAEZ,QAAO,eAAe;EACpB,MAAM,KAAK,MAAM;AACjB,MAAI,MAAM,KAAM,QAAO,KAAA;AACvB,SAAO,WAAW,CAAC,IAAI,GAAG;GAC1B"}
|