@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
package/dist/index.d.ts
CHANGED
|
@@ -1,330 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AgentServerOptions, AnyStream, CustomAdapterOptions, STREAM_CONTROLLER, StateOf, StreamApi, ThreadStream, UseStreamOptions, UseStreamResult, UseStreamReturn, useStream } from "./use-stream.js";
|
|
2
|
+
import { injectStream } from "./inject-stream.js";
|
|
3
|
+
import { injectProjection } from "./inject-projection.js";
|
|
4
|
+
import { SelectorTarget, injectAudio, injectChannel, injectExtension, injectFiles, injectImages, injectMessages, injectToolCalls, injectValues, injectVideo } from "./selectors.js";
|
|
5
|
+
import { InjectSubmissionQueueReturn, SubmissionQueueEntry, SubmissionQueueSnapshot, injectSubmissionQueue } from "./selectors-queue.js";
|
|
6
|
+
import { MessageMetadata, MessageMetadataMap, injectMessageMetadata } from "./selectors-metadata.js";
|
|
7
|
+
import { injectMediaUrl } from "./inject-media-url.js";
|
|
2
8
|
import { STREAM_DEFAULTS, STREAM_INSTANCE, StreamDefaults, provideStream, provideStreamDefaults } from "./context.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { AIMessage, BaseMessage, ToolMessage } from "@langchain/core/messages";
|
|
8
|
-
|
|
9
|
-
//#region src/index.d.ts
|
|
10
|
-
type AngularWritableKeys = "isLoading" | "branch";
|
|
11
|
-
type AngularPlainKeys = "submit" | "stop" | "joinStream" | "switchThread" | "setBranch" | "getMessagesMetadata" | "getToolCalls" | "getSubagent" | "getSubagentsByType" | "getSubagentsByMessage" | "client" | "assistantId";
|
|
12
|
-
type AngularQueueInterface<T> = T extends {
|
|
13
|
-
entries: infer E;
|
|
14
|
-
size: infer S;
|
|
15
|
-
cancel: infer C;
|
|
16
|
-
clear: infer Cl;
|
|
17
|
-
} ? {
|
|
18
|
-
entries: WritableSignal<E>;
|
|
19
|
-
size: WritableSignal<S>;
|
|
20
|
-
cancel: C;
|
|
21
|
-
clear: Cl;
|
|
22
|
-
} : T;
|
|
23
|
-
type AngularSignalWrap<T> = { [K in keyof T]: K extends AngularPlainKeys ? T[K] : K extends AngularWritableKeys ? WritableSignal<T[K]> : K extends "queue" ? AngularQueueInterface<T[K]> : Signal<T[K]> };
|
|
24
|
-
/**
|
|
25
|
-
* Injects the shared stream instance from the nearest ancestor that provided
|
|
26
|
-
* one via {@link provideStream}. Throws if no ancestor provides a stream
|
|
27
|
-
* instance.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* import { Component } from "@angular/core";
|
|
32
|
-
* import { injectStream } from "@langchain/angular";
|
|
33
|
-
*
|
|
34
|
-
* @Component({
|
|
35
|
-
* template: `
|
|
36
|
-
* @for (msg of stream.messages(); track msg.id) {
|
|
37
|
-
* <div>{{ msg.content }}</div>
|
|
38
|
-
* }
|
|
39
|
-
* <button
|
|
40
|
-
* [disabled]="stream.isLoading()"
|
|
41
|
-
* (click)="onSubmit()"
|
|
42
|
-
* >Send</button>
|
|
43
|
-
* `,
|
|
44
|
-
* })
|
|
45
|
-
* export class ChatComponent {
|
|
46
|
-
* stream = injectStream();
|
|
47
|
-
*
|
|
48
|
-
* onSubmit() {
|
|
49
|
-
* void this.stream.submit({
|
|
50
|
-
* messages: [{ type: "human", content: "Hello!" }],
|
|
51
|
-
* });
|
|
52
|
-
* }
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* @example With type parameters for full type safety:
|
|
57
|
-
* ```typescript
|
|
58
|
-
* import type { agent } from "./agent";
|
|
59
|
-
*
|
|
60
|
-
* export class ChatComponent {
|
|
61
|
-
* stream = injectStream<typeof agent>();
|
|
62
|
-
* // stream.messages() returns typed messages
|
|
63
|
-
* }
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
declare function injectStream<T = Record<string, unknown>, Bag extends BagTemplate = BagTemplate>(): AngularSignalWrap<WithClassMessages<ResolveStreamInterface$1<T, InferBag$1<T, Bag>>>>;
|
|
67
|
-
/**
|
|
68
|
-
* Angular entry point for LangGraph streaming. Call from a component, directive,
|
|
69
|
-
* or service field initializer to get a **Signals-based** stream controller
|
|
70
|
-
* connected to the LangGraph Platform (HTTP + threads API).
|
|
71
|
-
*
|
|
72
|
-
* The returned object mirrors the shared `useStream` API from
|
|
73
|
-
* `@langchain/langgraph-sdk/ui`, but reactive fields are
|
|
74
|
-
* {@link https://angular.dev/guide/signals | Angular `Signal`s}:
|
|
75
|
-
* read state with calls like `stream.messages()`, `stream.values()`, and
|
|
76
|
-
* `stream.isLoading()`, and use `WritableSignal` setters where exposed (for
|
|
77
|
-
* example `stream.branch` for branch selection).
|
|
78
|
-
*
|
|
79
|
-
* ## Typing with `createDeepAgent`
|
|
80
|
-
*
|
|
81
|
-
* Expect `export const agent = createDeepAgent({ ... })` from `deepagents`. In
|
|
82
|
-
* UI code, `import { type agent } from "./agent"` (or `import type { agent }`)
|
|
83
|
-
* is a **type-only** import: it is erased when compiling, so the agent module
|
|
84
|
-
* does not run in the browser. You still pass **`typeof agent`** to
|
|
85
|
-
* `injectStream`, not `agent` alone — `agent` is a value; TypeScript only
|
|
86
|
-
* accepts it in a type position via `typeof` (otherwise: *refers to a value,
|
|
87
|
-
* but is being used as a type*). If you prefer a named type in generics, add
|
|
88
|
-
* `export type Agent = typeof agent` next to the const and use
|
|
89
|
-
* `injectStream<Agent>(...)`.
|
|
90
|
-
*
|
|
91
|
-
* @example
|
|
92
|
-
* ```typescript
|
|
93
|
-
* // agent.ts
|
|
94
|
-
* import { createDeepAgent } from "deepagents";
|
|
95
|
-
* import { tool } from "langchain";
|
|
96
|
-
* import { z } from "zod";
|
|
97
|
-
*
|
|
98
|
-
* const getWeather = tool(
|
|
99
|
-
* async ({ location }) => `Weather in ${location}`,
|
|
100
|
-
* { name: "get_weather", schema: z.object({ location: z.string() }) },
|
|
101
|
-
* );
|
|
102
|
-
*
|
|
103
|
-
* export const agent = createDeepAgent({
|
|
104
|
-
* model: "openai:gpt-4o",
|
|
105
|
-
* tools: [getWeather],
|
|
106
|
-
* });
|
|
107
|
-
*
|
|
108
|
-
* // chat.component.ts — type-only import; no agent runtime in the frontend
|
|
109
|
-
* import { Component } from "@angular/core";
|
|
110
|
-
* import { injectStream } from "@langchain/angular";
|
|
111
|
-
* import { type agent } from "./agent";
|
|
112
|
-
*
|
|
113
|
-
* @Component({
|
|
114
|
-
* standalone: true,
|
|
115
|
-
* template: `
|
|
116
|
-
* @for (msg of stream.messages(); track msg.id ?? $index) {
|
|
117
|
-
* <p>{{ msg.content }}</p>
|
|
118
|
-
* }
|
|
119
|
-
* `,
|
|
120
|
-
* })
|
|
121
|
-
* export class ChatComponent {
|
|
122
|
-
* readonly stream = injectStream<typeof agent>({
|
|
123
|
-
* assistantId: "agent",
|
|
124
|
-
* apiUrl: "http://localhost:2024",
|
|
125
|
-
* });
|
|
126
|
-
* // stream.toolCalls()[0].call.name is typed as "get_weather"
|
|
127
|
-
* }
|
|
128
|
-
* ```
|
|
129
|
-
*
|
|
130
|
-
* ## Typing with `StateGraph` / custom graph state
|
|
131
|
-
*
|
|
132
|
-
* Use your graph state interface as `T` and embed tool call unions in
|
|
133
|
-
* `Message<...>[]` when you need discriminated tool types.
|
|
134
|
-
*
|
|
135
|
-
* @example
|
|
136
|
-
* ```typescript
|
|
137
|
-
* import { Message } from "@langchain/langgraph-sdk";
|
|
138
|
-
* import { Component } from "@angular/core";
|
|
139
|
-
* import { injectStream } from "@langchain/angular";
|
|
140
|
-
*
|
|
141
|
-
* type MyToolCalls =
|
|
142
|
-
* | { name: "search"; args: { query: string }; id?: string }
|
|
143
|
-
* | { name: "calculate"; args: { expression: string }; id?: string };
|
|
144
|
-
*
|
|
145
|
-
* interface MyGraphState {
|
|
146
|
-
* messages: Message<MyToolCalls>[];
|
|
147
|
-
* context?: string;
|
|
148
|
-
* }
|
|
149
|
-
*
|
|
150
|
-
* @Component({ standalone: true, template: "" })
|
|
151
|
-
* export class ChatComponent {
|
|
152
|
-
* readonly stream = injectStream<MyGraphState>({
|
|
153
|
-
* assistantId: "my-graph",
|
|
154
|
-
* apiUrl: "http://localhost:2024",
|
|
155
|
-
* });
|
|
156
|
-
* // stream.values() is typed as MyGraphState | null
|
|
157
|
-
* }
|
|
158
|
-
* ```
|
|
159
|
-
*
|
|
160
|
-
* @example
|
|
161
|
-
* ```typescript
|
|
162
|
-
* // Optional bag for interrupts, configurable, custom events, and updates
|
|
163
|
-
* import { Component } from "@angular/core";
|
|
164
|
-
* import { injectStream } from "@langchain/angular";
|
|
165
|
-
* import type { Message } from "@langchain/langgraph-sdk";
|
|
166
|
-
*
|
|
167
|
-
* interface MyGraphState {
|
|
168
|
-
* messages: Message[];
|
|
169
|
-
* }
|
|
170
|
-
*
|
|
171
|
-
* @Component({ standalone: true, template: "" })
|
|
172
|
-
* export class ChatComponent {
|
|
173
|
-
* readonly stream = injectStream<
|
|
174
|
-
* MyGraphState,
|
|
175
|
-
* {
|
|
176
|
-
* InterruptType: { question: string };
|
|
177
|
-
* ConfigurableType: { userId: string };
|
|
178
|
-
* }
|
|
179
|
-
* >({
|
|
180
|
-
* assistantId: "my-graph",
|
|
181
|
-
* apiUrl: "http://localhost:2024",
|
|
182
|
-
* });
|
|
183
|
-
* // stream.interrupt() is typed as { question: string } | undefined
|
|
184
|
-
* }
|
|
185
|
-
* ```
|
|
186
|
-
*
|
|
187
|
-
* ## Subagent streaming
|
|
188
|
-
*
|
|
189
|
-
* For `createDeepAgent` agents with `subagents`, set `filterSubagentMessages`
|
|
190
|
-
* and use `streamSubgraphs` on `submit` to populate `stream.subagents` and
|
|
191
|
-
* related helpers.
|
|
192
|
-
*
|
|
193
|
-
* @example
|
|
194
|
-
* ```typescript
|
|
195
|
-
* import { Component } from "@angular/core";
|
|
196
|
-
* import { injectStream } from "@langchain/angular";
|
|
197
|
-
* import { type agent } from "./agent";
|
|
198
|
-
*
|
|
199
|
-
* @Component({ standalone: true, template: "" })
|
|
200
|
-
* export class DeepAgentChatComponent {
|
|
201
|
-
* readonly stream = injectStream<typeof agent>({
|
|
202
|
-
* assistantId: "deepagent",
|
|
203
|
-
* apiUrl: "http://localhost:2024",
|
|
204
|
-
* filterSubagentMessages: true,
|
|
205
|
-
* });
|
|
206
|
-
*
|
|
207
|
-
* send(content: string) {
|
|
208
|
-
* void this.stream.submit(
|
|
209
|
-
* { messages: [{ content, type: "human" }] },
|
|
210
|
-
* { streamSubgraphs: true },
|
|
211
|
-
* );
|
|
212
|
-
* }
|
|
213
|
-
* }
|
|
214
|
-
* ```
|
|
215
|
-
*
|
|
216
|
-
* @param options - LangGraph Platform client options (`apiUrl` or `client`),
|
|
217
|
-
* `assistantId`, stream modes, history, reconnect, subagent settings, etc.
|
|
218
|
-
*
|
|
219
|
-
* @returns A stream controller backed by Signals: graph values, messages,
|
|
220
|
-
* loading and error state, interrupts, tool calls, branching, queue, and
|
|
221
|
-
* `submit` / `stop` / `switchThread` helpers (writable where the UI layer
|
|
222
|
-
* requires mutation).
|
|
223
|
-
*
|
|
224
|
-
* @template T Agent type (with `~agentTypes`) from `createDeepAgent` or
|
|
225
|
-
* `createAgent`, or a state shape extending `Record<string, unknown>`.
|
|
226
|
-
* @template Bag Optional configuration bag:
|
|
227
|
-
* - `ConfigurableType` — `config.configurable` typing
|
|
228
|
-
* - `InterruptType` — human-in-the-loop interrupt payloads
|
|
229
|
-
* - `CustomEventType` — custom stream events
|
|
230
|
-
* - `UpdateType` — payload typing for `submit`
|
|
231
|
-
*
|
|
232
|
-
* @see {@link https://docs.langchain.com/oss/javascript/langgraph/overview | LangGraph JavaScript overview}
|
|
233
|
-
* @see {@link https://docs.langchain.com/oss/javascript/langchain/overview | LangChain JavaScript overview}
|
|
234
|
-
* @see {@link https://docs.langchain.com/oss/javascript/deepagents/overview | Deep Agents JavaScript overview}
|
|
235
|
-
*/
|
|
236
|
-
declare function injectStream<T = Record<string, unknown>, Bag extends BagTemplate = BagTemplate>(options: ResolveStreamOptions$1<T, InferBag$1<T, Bag>>): AngularSignalWrap<WithClassMessages<ResolveStreamInterface$1<T, InferBag$1<T, Bag>>>>;
|
|
237
|
-
/**
|
|
238
|
-
* Overload for a **custom transport** (`options.transport`), for example
|
|
239
|
-
* {@link FetchStreamTransport} or any implementation compatible with
|
|
240
|
-
* {@link injectStreamCustom}. Prefer {@link injectStreamCustom} directly when
|
|
241
|
-
* you only use custom transports and want a narrower import.
|
|
242
|
-
*
|
|
243
|
-
* @param options - Custom transport and stream options (must include
|
|
244
|
-
* `transport`).
|
|
245
|
-
*
|
|
246
|
-
* @returns The same Signals-based controller shape as the LangGraph Platform
|
|
247
|
-
* overload.
|
|
248
|
-
*
|
|
249
|
-
* @template T Agent type or state shape, matching the custom transport.
|
|
250
|
-
* @template Bag Same optional bag as the platform overload.
|
|
251
|
-
*
|
|
252
|
-
* @see {@link injectStreamCustom}
|
|
253
|
-
*/
|
|
254
|
-
declare function injectStream<T = Record<string, unknown>, Bag extends BagTemplate = BagTemplate>(options: UseStreamCustomOptions$1<InferStateType$1<T>, InferBag$1<T, Bag>>): AngularSignalWrap<WithClassMessages<ResolveStreamInterface$1<T, InferBag$1<T, Bag>>>>;
|
|
255
|
-
/**
|
|
256
|
-
* @deprecated Use `injectStream` instead. `useStream` will be removed in a
|
|
257
|
-
* future major version. `injectStream` follows Angular's `inject*` naming
|
|
258
|
-
* convention for injection-based patterns.
|
|
259
|
-
*/
|
|
260
|
-
declare const useStream: typeof injectStream;
|
|
261
|
-
/**
|
|
262
|
-
* Injectable Angular service that wraps {@link injectStream}.
|
|
263
|
-
*
|
|
264
|
-
* Extend this class with your own `@Injectable()` service and call
|
|
265
|
-
* `super(options)` in the constructor:
|
|
266
|
-
*
|
|
267
|
-
* ```ts
|
|
268
|
-
* \@Injectable({ providedIn: 'root' })
|
|
269
|
-
* export class ChatService extends StreamService {
|
|
270
|
-
* constructor() {
|
|
271
|
-
* super({ assistantId: 'agent', apiUrl: '...' });
|
|
272
|
-
* }
|
|
273
|
-
* }
|
|
274
|
-
* ```
|
|
275
|
-
*
|
|
276
|
-
* The service exposes the same signals and methods as `injectStream`
|
|
277
|
-
* (e.g. `values`, `messages`, `isLoading`, `submit`, `stop`).
|
|
278
|
-
*
|
|
279
|
-
* Must be created within an Angular injection context (via DI or
|
|
280
|
-
* `runInInjectionContext`).
|
|
281
|
-
*/
|
|
282
|
-
declare class StreamService<T = Record<string, unknown>, Bag extends BagTemplate = BagTemplate> {
|
|
283
|
-
private readonly _stream;
|
|
284
|
-
constructor(options: ResolveStreamOptions$1<T, InferBag$1<T, Bag>> | UseStreamCustomOptions$1<InferStateType$1<T>, InferBag$1<T, Bag>>);
|
|
285
|
-
get values(): Signal<T>;
|
|
286
|
-
get messages(): Signal<BaseMessage[]>;
|
|
287
|
-
get isLoading(): WritableSignal<boolean>;
|
|
288
|
-
get error(): Signal<unknown>;
|
|
289
|
-
get branch(): WritableSignal<string>;
|
|
290
|
-
get interrupt(): Signal<Interrupt<GetInterruptType<Bag>> | undefined>;
|
|
291
|
-
get interrupts(): Signal<Interrupt<GetInterruptType<Bag>>[]>;
|
|
292
|
-
get toolCalls(): Signal<ToolCallWithResult$1<DefaultToolCall$1>[]>;
|
|
293
|
-
get queue(): AngularQueueInterface<{
|
|
294
|
-
entries: readonly {
|
|
295
|
-
id: string;
|
|
296
|
-
values: Partial<T> | null | undefined;
|
|
297
|
-
}[];
|
|
298
|
-
size: number;
|
|
299
|
-
cancel: (id: string) => Promise<boolean>;
|
|
300
|
-
clear: () => Promise<void>;
|
|
301
|
-
}>;
|
|
302
|
-
get subagents(): Signal<ReadonlyMap<string, SubagentStreamInterface$1>>;
|
|
303
|
-
get activeSubagents(): Signal<readonly SubagentStreamInterface$1[]>;
|
|
304
|
-
get history(): Signal<unknown>;
|
|
305
|
-
get isThreadLoading(): Signal<boolean>;
|
|
306
|
-
get experimental_branchTree(): Signal<unknown>;
|
|
307
|
-
get client(): Client;
|
|
308
|
-
get assistantId(): string;
|
|
309
|
-
submit(values: AcceptBaseMessages<Exclude<T, null | undefined>> | null | undefined, options?: SubmitOptions<T extends Record<string, unknown> ? T : Record<string, unknown>, GetConfigurableType<Bag>>): ReturnType<typeof this._stream.submit>;
|
|
310
|
-
stop(): Promise<void>;
|
|
311
|
-
setBranch(value: string): void;
|
|
312
|
-
switchThread(newThreadId: string | null): void;
|
|
313
|
-
joinStream(runId: string, lastEventId?: string, options?: {
|
|
314
|
-
streamMode?: StreamMode | StreamMode[];
|
|
315
|
-
filter?: (event: {
|
|
316
|
-
id?: string;
|
|
317
|
-
event: StreamEvent;
|
|
318
|
-
data: unknown;
|
|
319
|
-
}) => boolean;
|
|
320
|
-
}): Promise<void>;
|
|
321
|
-
getMessagesMetadata(message: BaseMessage, index?: number): MessageMetadata$1<T extends Record<string, unknown> ? T : Record<string, unknown>> | undefined;
|
|
322
|
-
getToolCalls(message: BaseMessage): ToolCallWithResult$1<DefaultToolCall$1>[];
|
|
323
|
-
getSubagent(toolCallId: string): SubagentStreamInterface$1 | undefined;
|
|
324
|
-
getSubagentsByType(type: string): SubagentStreamInterface$1[];
|
|
325
|
-
getSubagentsByMessage(messageId: string): SubagentStreamInterface$1[];
|
|
326
|
-
}
|
|
327
|
-
type ToolCallWithResult<ToolCall = DefaultToolCall$1> = ToolCallWithResult$1<ToolCall, ToolMessage, AIMessage>;
|
|
328
|
-
//#endregion
|
|
329
|
-
export { type AgentTypeConfigLike, type AnyHeadlessToolImplementation, type BaseStream, type BaseSubagentState, type ClassSubagentStreamInterface, type CompiledSubAgentLike, type DeepAgentTypeConfigLike, type DefaultSubagentStates, type DefaultToolCall, type ExtractAgentConfig, type ExtractDeepAgentConfig, type ExtractSubAgentMiddleware, FetchStreamTransport, type FlushPendingHeadlessToolInterruptsOptions, type GetToolCallsType, type HeadlessToolImplementation, type HeadlessToolInterrupt, type InferAgentToolCalls, type InferBag, type InferDeepAgentSubagents, type InferNodeNames, type InferStateType, type InferSubagentByName, type InferSubagentNames, type InferSubagentState, type InferSubagentStates, type InferToolCalls, type IsAgentLike, type IsDeepAgentLike, type MessageMetadata, type OnToolCallback, type QueueEntry, type QueueInterface, type ResolveStreamInterface, type ResolveStreamOptions, STREAM_DEFAULTS, STREAM_INSTANCE, type StreamDefaults, StreamService, type SubAgentLike, type SubagentApi, SubagentManager, type SubagentStateMap, type SubagentStatus, type SubagentStream, type SubagentStreamInterface, type SubagentToolCall, type ToolCallFromTool, type ToolCallState, ToolCallWithResult, type ToolCallsFromTools, type ToolEvent, type UseAgentStream, type UseAgentStreamOptions, type UseDeepAgentStream, type UseDeepAgentStreamOptions, type UseStreamCustomOptions, type UseStreamOptions, type UseStreamThread, type UseStreamTransport, calculateDepthFromNamespace, executeHeadlessTool, extractParentIdFromNamespace, extractToolCallIdFromNamespace, filterOutHeadlessToolInterrupts, findHeadlessTool, flushPendingHeadlessToolInterrupts, handleHeadlessToolInterrupt, headlessToolResumeCommand, injectStream, injectStreamCustom, isHeadlessToolInterrupt, isSubagentNamespace, parseHeadlessToolInterruptPayload, provideStream, provideStreamDefaults, useStream, useStreamCustom, useStreamLGP };
|
|
330
|
-
//# sourceMappingURL=index.d.ts.map
|
|
9
|
+
import { StreamService } from "./stream-service.js";
|
|
10
|
+
import { AnyHeadlessToolImplementation, DefaultToolCall, FlushPendingHeadlessToolInterruptsOptions, HeadlessToolImplementation, HeadlessToolInterrupt, HttpAgentServerAdapter, HttpAgentServerAdapterOptions, OnToolCallback, ToolCallFromTool, ToolCallState, ToolCallsFromTools, ToolEvent, executeHeadlessTool, filterOutHeadlessToolInterrupts, findHeadlessTool, flushPendingHeadlessToolInterrupts, handleHeadlessToolInterrupt, headlessToolResumeCommand, isHeadlessToolInterrupt, parseHeadlessToolInterruptPayload } from "@langchain/langgraph-sdk";
|
|
11
|
+
import { AgentServerAdapter, AnyMediaHandle, AssembledToolCall, AudioMedia, Channel, Event, FileMedia, ImageMedia, InferStateType, InferSubagentStates, InferToolCalls, MediaAssemblyError, MediaAssemblyErrorKind, MediaBase, MediaBlockType, StreamSubmitOptions, SubagentDiscoverySnapshot, SubgraphDiscoverySnapshot, ToolCallStatus, VideoMedia, WidenUpdateMessages } from "@langchain/langgraph-sdk/stream";
|
|
12
|
+
export { type AgentServerAdapter, type AgentServerOptions, type AnyHeadlessToolImplementation, type AnyMediaHandle, type AnyStream, type AssembledToolCall, type AudioMedia, type Channel, type CustomAdapterOptions, type DefaultToolCall, type Event, type FileMedia, type FlushPendingHeadlessToolInterruptsOptions, type HeadlessToolImplementation, type HeadlessToolInterrupt, HttpAgentServerAdapter, type HttpAgentServerAdapterOptions, type ImageMedia, type InferStateType, type InferSubagentStates, type InferToolCalls, type InjectSubmissionQueueReturn, MediaAssemblyError, type MediaAssemblyErrorKind, type MediaBase, type MediaBlockType, type MessageMetadata, type MessageMetadataMap, type OnToolCallback, STREAM_CONTROLLER, STREAM_DEFAULTS, STREAM_INSTANCE, type SelectorTarget, type StateOf, type StreamApi, type StreamDefaults, StreamService, type StreamSubmitOptions, type SubagentDiscoverySnapshot, type SubgraphDiscoverySnapshot, type SubmissionQueueEntry, type SubmissionQueueSnapshot, type ThreadStream, type ToolCallFromTool, type ToolCallState, type ToolCallStatus, type ToolCallsFromTools, type ToolEvent, type UseStreamOptions, type UseStreamResult, type UseStreamReturn, type VideoMedia, type WidenUpdateMessages, executeHeadlessTool, filterOutHeadlessToolInterrupts, findHeadlessTool, flushPendingHeadlessToolInterrupts, handleHeadlessToolInterrupt, headlessToolResumeCommand, injectAudio, injectChannel, injectExtension, injectFiles, injectImages, injectMediaUrl, injectMessageMetadata, injectMessages, injectProjection, injectStream, injectSubmissionQueue, injectToolCalls, injectValues, injectVideo, isHeadlessToolInterrupt, parseHeadlessToolInterruptPayload, provideStream, provideStreamDefaults, useStream };
|
package/dist/index.js
CHANGED
|
@@ -1,115 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useStreamLGP } from "./stream.lgp.js";
|
|
1
|
+
import { STREAM_CONTROLLER, useStream } from "./use-stream.js";
|
|
3
2
|
import { STREAM_DEFAULTS, STREAM_INSTANCE, provideStream, provideStreamDefaults } from "./context.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const instance = inject(STREAM_INSTANCE, { optional: true });
|
|
15
|
-
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 injectStream(options) directly.");
|
|
16
|
-
return instance;
|
|
17
|
-
}
|
|
18
|
-
if ("transport" in options) return injectStreamCustom(options);
|
|
19
|
-
return useStreamLGP(options);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated Use `injectStream` instead. `useStream` will be removed in a
|
|
23
|
-
* future major version. `injectStream` follows Angular's `inject*` naming
|
|
24
|
-
* convention for injection-based patterns.
|
|
25
|
-
*/
|
|
26
|
-
const useStream = injectStream;
|
|
27
|
-
let StreamService = class StreamService {
|
|
28
|
-
_stream;
|
|
29
|
-
constructor(options) {
|
|
30
|
-
this._stream = injectStream(options);
|
|
31
|
-
}
|
|
32
|
-
get values() {
|
|
33
|
-
return this._stream.values;
|
|
34
|
-
}
|
|
35
|
-
get messages() {
|
|
36
|
-
return this._stream.messages;
|
|
37
|
-
}
|
|
38
|
-
get isLoading() {
|
|
39
|
-
return this._stream.isLoading;
|
|
40
|
-
}
|
|
41
|
-
get error() {
|
|
42
|
-
return this._stream.error;
|
|
43
|
-
}
|
|
44
|
-
get branch() {
|
|
45
|
-
return this._stream.branch;
|
|
46
|
-
}
|
|
47
|
-
get interrupt() {
|
|
48
|
-
return this._stream.interrupt;
|
|
49
|
-
}
|
|
50
|
-
get interrupts() {
|
|
51
|
-
return this._stream.interrupts;
|
|
52
|
-
}
|
|
53
|
-
get toolCalls() {
|
|
54
|
-
return this._stream.toolCalls;
|
|
55
|
-
}
|
|
56
|
-
get queue() {
|
|
57
|
-
return this._stream.queue;
|
|
58
|
-
}
|
|
59
|
-
get subagents() {
|
|
60
|
-
return this._stream.subagents;
|
|
61
|
-
}
|
|
62
|
-
get activeSubagents() {
|
|
63
|
-
return this._stream.activeSubagents;
|
|
64
|
-
}
|
|
65
|
-
get history() {
|
|
66
|
-
return this._stream.history;
|
|
67
|
-
}
|
|
68
|
-
get isThreadLoading() {
|
|
69
|
-
return this._stream.isThreadLoading;
|
|
70
|
-
}
|
|
71
|
-
get experimental_branchTree() {
|
|
72
|
-
return this._stream.experimental_branchTree;
|
|
73
|
-
}
|
|
74
|
-
get client() {
|
|
75
|
-
return this._stream.client;
|
|
76
|
-
}
|
|
77
|
-
get assistantId() {
|
|
78
|
-
return this._stream.assistantId;
|
|
79
|
-
}
|
|
80
|
-
submit(values, options) {
|
|
81
|
-
return this._stream.submit(values, options);
|
|
82
|
-
}
|
|
83
|
-
async stop() {
|
|
84
|
-
await this._stream.stop();
|
|
85
|
-
}
|
|
86
|
-
setBranch(value) {
|
|
87
|
-
this._stream.setBranch(value);
|
|
88
|
-
}
|
|
89
|
-
switchThread(newThreadId) {
|
|
90
|
-
this._stream.switchThread(newThreadId);
|
|
91
|
-
}
|
|
92
|
-
joinStream(runId, lastEventId, options) {
|
|
93
|
-
return this._stream.joinStream(runId, lastEventId, options);
|
|
94
|
-
}
|
|
95
|
-
getMessagesMetadata(message, index) {
|
|
96
|
-
return this._stream.getMessagesMetadata(message, index);
|
|
97
|
-
}
|
|
98
|
-
getToolCalls(message) {
|
|
99
|
-
return this._stream.getToolCalls(message);
|
|
100
|
-
}
|
|
101
|
-
getSubagent(toolCallId) {
|
|
102
|
-
return this._stream.getSubagent(toolCallId);
|
|
103
|
-
}
|
|
104
|
-
getSubagentsByType(type) {
|
|
105
|
-
return this._stream.getSubagentsByType(type);
|
|
106
|
-
}
|
|
107
|
-
getSubagentsByMessage(messageId) {
|
|
108
|
-
return this._stream.getSubagentsByMessage(messageId);
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
StreamService = __decorate([Injectable()], StreamService);
|
|
112
|
-
//#endregion
|
|
113
|
-
export { FetchStreamTransport, STREAM_DEFAULTS, STREAM_INSTANCE, StreamService, SubagentManager, calculateDepthFromNamespace, executeHeadlessTool, extractParentIdFromNamespace, extractToolCallIdFromNamespace, filterOutHeadlessToolInterrupts, findHeadlessTool, flushPendingHeadlessToolInterrupts, handleHeadlessToolInterrupt, headlessToolResumeCommand, injectStream, injectStreamCustom, isHeadlessToolInterrupt, isSubagentNamespace, parseHeadlessToolInterruptPayload, provideStream, provideStreamDefaults, useStream, useStreamCustom, useStreamLGP };
|
|
114
|
-
|
|
115
|
-
//# sourceMappingURL=index.js.map
|
|
3
|
+
import { injectStream } from "./inject-stream.js";
|
|
4
|
+
import { injectProjection } from "./inject-projection.js";
|
|
5
|
+
import { injectAudio, injectChannel, injectExtension, injectFiles, injectImages, injectMessages, injectToolCalls, injectValues, injectVideo } from "./selectors.js";
|
|
6
|
+
import { injectSubmissionQueue } from "./selectors-queue.js";
|
|
7
|
+
import { injectMessageMetadata } from "./selectors-metadata.js";
|
|
8
|
+
import { injectMediaUrl } from "./inject-media-url.js";
|
|
9
|
+
import { StreamService } from "./stream-service.js";
|
|
10
|
+
import { HttpAgentServerAdapter, executeHeadlessTool, filterOutHeadlessToolInterrupts, findHeadlessTool, flushPendingHeadlessToolInterrupts, handleHeadlessToolInterrupt, headlessToolResumeCommand, isHeadlessToolInterrupt, parseHeadlessToolInterruptPayload } from "@langchain/langgraph-sdk";
|
|
11
|
+
import { MediaAssemblyError } from "@langchain/langgraph-sdk/stream";
|
|
12
|
+
export { HttpAgentServerAdapter, MediaAssemblyError, STREAM_CONTROLLER, STREAM_DEFAULTS, STREAM_INSTANCE, StreamService, executeHeadlessTool, filterOutHeadlessToolInterrupts, findHeadlessTool, flushPendingHeadlessToolInterrupts, handleHeadlessToolInterrupt, headlessToolResumeCommand, injectAudio, injectChannel, injectExtension, injectFiles, injectImages, injectMediaUrl, injectMessageMetadata, injectMessages, injectProjection, injectStream, injectSubmissionQueue, injectToolCalls, injectValues, injectVideo, isHeadlessToolInterrupt, parseHeadlessToolInterruptPayload, provideStream, provideStreamDefaults, useStream };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
let _angular_core = require("@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 = (0, _angular_core.signal)(void 0);
|
|
31
|
+
const read = (0, _angular_core.isSignal)(media) ? media : () => media;
|
|
32
|
+
(0, _angular_core.effect)((onCleanup) => {
|
|
33
|
+
const next = read();
|
|
34
|
+
(0, _angular_core.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
|
+
exports.injectMediaUrl = injectMediaUrl;
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=inject-media-url.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-media-url.cjs","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,OAAA,GAAA,cAAA,QAAiC,KAAA,EAAU;CAEjD,MAAM,QAAA,GAAA,cAAA,UAAgB,MAAM,GACvB,cACK;AAEV,EAAA,GAAA,cAAA,SAAQ,cAAc;EACpB,MAAM,OAAQ,MAAsC;AAEpD,GAAA,GAAA,cAAA,iBAAgB;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,34 @@
|
|
|
1
|
+
import { MediaBase } from "@langchain/langgraph-sdk/stream";
|
|
2
|
+
import { Signal } from "@angular/core";
|
|
3
|
+
|
|
4
|
+
//#region src/inject-media-url.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Resolve the lazy {@link MediaBase.objectURL} promise into a string
|
|
7
|
+
* suitable for direct use in `<audio src>` / `<img src>` /
|
|
8
|
+
* `<video src>` / `<a href download>`. Returns `undefined` until the
|
|
9
|
+
* URL is available.
|
|
10
|
+
*
|
|
11
|
+
* Lifecycle:
|
|
12
|
+
* - On first read (or when `media` changes) the helper awaits
|
|
13
|
+
* `media.objectURL`, then commits the resolved string to the
|
|
14
|
+
* returned signal.
|
|
15
|
+
* - On destroy (or when `media` changes) the helper calls
|
|
16
|
+
* `media.revoke()` to free the object URL slot. The next consumer
|
|
17
|
+
* that accesses `media.objectURL` mints a fresh URL from the same
|
|
18
|
+
* `Blob`, so live re-renders just work.
|
|
19
|
+
* - If the underlying handle errored before settling, the promise
|
|
20
|
+
* rejects and `injectMediaUrl` stays at `undefined`. Inspect
|
|
21
|
+
* `media.error` to surface the failure.
|
|
22
|
+
*
|
|
23
|
+
* Pair with {@link injectAudio} / {@link injectImages} /
|
|
24
|
+
* {@link injectVideo} / {@link injectFiles} to bridge SDK media
|
|
25
|
+
* handles into Angular templates without manual
|
|
26
|
+
* `URL.createObjectURL` bookkeeping.
|
|
27
|
+
*
|
|
28
|
+
* `media` accepts a plain handle or a `Signal<MediaBase | undefined>`
|
|
29
|
+
* so callers can feed a `computed(() => stream.audio()[0])`.
|
|
30
|
+
*/
|
|
31
|
+
declare function injectMediaUrl(media: MediaBase | undefined | Signal<MediaBase | undefined>): Signal<string | undefined>;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { injectMediaUrl };
|
|
34
|
+
//# sourceMappingURL=inject-media-url.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-media-url.d.cts","names":[],"sources":["../src/inject-media-url.ts"],"mappings":";;;;;;AAmCA;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,cAAA,CACd,KAAA,EAAO,SAAA,eAAwB,MAAA,CAAO,SAAA,gBACrC,MAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Signal } from "@angular/core";
|
|
2
|
+
import { MediaBase } from "@langchain/langgraph-sdk/stream";
|
|
3
|
+
|
|
4
|
+
//#region src/inject-media-url.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Resolve the lazy {@link MediaBase.objectURL} promise into a string
|
|
7
|
+
* suitable for direct use in `<audio src>` / `<img src>` /
|
|
8
|
+
* `<video src>` / `<a href download>`. Returns `undefined` until the
|
|
9
|
+
* URL is available.
|
|
10
|
+
*
|
|
11
|
+
* Lifecycle:
|
|
12
|
+
* - On first read (or when `media` changes) the helper awaits
|
|
13
|
+
* `media.objectURL`, then commits the resolved string to the
|
|
14
|
+
* returned signal.
|
|
15
|
+
* - On destroy (or when `media` changes) the helper calls
|
|
16
|
+
* `media.revoke()` to free the object URL slot. The next consumer
|
|
17
|
+
* that accesses `media.objectURL` mints a fresh URL from the same
|
|
18
|
+
* `Blob`, so live re-renders just work.
|
|
19
|
+
* - If the underlying handle errored before settling, the promise
|
|
20
|
+
* rejects and `injectMediaUrl` stays at `undefined`. Inspect
|
|
21
|
+
* `media.error` to surface the failure.
|
|
22
|
+
*
|
|
23
|
+
* Pair with {@link injectAudio} / {@link injectImages} /
|
|
24
|
+
* {@link injectVideo} / {@link injectFiles} to bridge SDK media
|
|
25
|
+
* handles into Angular templates without manual
|
|
26
|
+
* `URL.createObjectURL` bookkeeping.
|
|
27
|
+
*
|
|
28
|
+
* `media` accepts a plain handle or a `Signal<MediaBase | undefined>`
|
|
29
|
+
* so callers can feed a `computed(() => stream.audio()[0])`.
|
|
30
|
+
*/
|
|
31
|
+
declare function injectMediaUrl(media: MediaBase | undefined | Signal<MediaBase | undefined>): Signal<string | undefined>;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { injectMediaUrl };
|
|
34
|
+
//# sourceMappingURL=inject-media-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-media-url.d.ts","names":[],"sources":["../src/inject-media-url.ts"],"mappings":";;;;;;AAmCA;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,cAAA,CACd,KAAA,EAAO,SAAA,eAAwB,MAAA,CAAO,SAAA,gBACrC,MAAA"}
|