@langchain/react 0.3.5 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -523
- package/dist/context.cjs +12 -30
- package/dist/context.cjs.map +1 -1
- package/dist/context.d.cts +22 -39
- package/dist/context.d.cts.map +1 -1
- package/dist/context.d.ts +22 -39
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +11 -29
- package/dist/context.js.map +1 -1
- package/dist/index.cjs +29 -30
- package/dist/index.d.cts +10 -7
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +10 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -6
- package/dist/selectors.cjs +178 -0
- package/dist/selectors.cjs.map +1 -0
- package/dist/selectors.d.cts +183 -0
- package/dist/selectors.d.cts.map +1 -0
- package/dist/selectors.d.ts +183 -0
- package/dist/selectors.d.ts.map +1 -0
- package/dist/selectors.js +168 -0
- package/dist/selectors.js.map +1 -0
- package/dist/suspense-stream.cjs +34 -159
- package/dist/suspense-stream.cjs.map +1 -1
- package/dist/suspense-stream.d.cts +15 -71
- package/dist/suspense-stream.d.cts.map +1 -1
- package/dist/suspense-stream.d.ts +15 -71
- package/dist/suspense-stream.d.ts.map +1 -1
- package/dist/suspense-stream.js +35 -158
- package/dist/suspense-stream.js.map +1 -1
- package/dist/use-audio-player.cjs +679 -0
- package/dist/use-audio-player.cjs.map +1 -0
- package/dist/use-audio-player.d.cts +161 -0
- package/dist/use-audio-player.d.cts.map +1 -0
- package/dist/use-audio-player.d.ts +161 -0
- package/dist/use-audio-player.d.ts.map +1 -0
- package/dist/use-audio-player.js +679 -0
- package/dist/use-audio-player.js.map +1 -0
- package/dist/use-media-url.cjs +49 -0
- package/dist/use-media-url.cjs.map +1 -0
- package/dist/use-media-url.d.cts +28 -0
- package/dist/use-media-url.d.cts.map +1 -0
- package/dist/use-media-url.d.ts +28 -0
- package/dist/use-media-url.d.ts.map +1 -0
- package/dist/use-media-url.js +49 -0
- package/dist/use-media-url.js.map +1 -0
- package/dist/use-projection.cjs +41 -0
- package/dist/use-projection.cjs.map +1 -0
- package/dist/use-projection.d.cts +27 -0
- package/dist/use-projection.d.cts.map +1 -0
- package/dist/use-projection.d.ts +27 -0
- package/dist/use-projection.d.ts.map +1 -0
- package/dist/use-projection.js +41 -0
- package/dist/use-projection.js.map +1 -0
- package/dist/use-stream.cjs +185 -0
- package/dist/use-stream.cjs.map +1 -0
- package/dist/use-stream.d.cts +184 -0
- package/dist/use-stream.d.cts.map +1 -0
- package/dist/use-stream.d.ts +184 -0
- package/dist/use-stream.d.ts.map +1 -0
- package/dist/use-stream.js +183 -0
- package/dist/use-stream.js.map +1 -0
- package/dist/use-video-player.cjs +218 -0
- package/dist/use-video-player.cjs.map +1 -0
- package/dist/use-video-player.d.cts +65 -0
- package/dist/use-video-player.d.cts.map +1 -0
- package/dist/use-video-player.d.ts +65 -0
- package/dist/use-video-player.d.ts.map +1 -0
- package/dist/use-video-player.js +218 -0
- package/dist/use-video-player.js.map +1 -0
- package/package.json +9 -8
- package/dist/stream.cjs +0 -18
- package/dist/stream.cjs.map +0 -1
- package/dist/stream.custom.cjs +0 -209
- package/dist/stream.custom.cjs.map +0 -1
- package/dist/stream.custom.d.cts +0 -3
- package/dist/stream.custom.d.ts +0 -3
- package/dist/stream.custom.js +0 -209
- package/dist/stream.custom.js.map +0 -1
- package/dist/stream.d.cts +0 -174
- package/dist/stream.d.cts.map +0 -1
- package/dist/stream.d.ts +0 -174
- package/dist/stream.d.ts.map +0 -1
- package/dist/stream.js +0 -18
- package/dist/stream.js.map +0 -1
- package/dist/stream.lgp.cjs +0 -671
- package/dist/stream.lgp.cjs.map +0 -1
- package/dist/stream.lgp.js +0 -671
- package/dist/stream.lgp.js.map +0 -1
- package/dist/thread.cjs +0 -18
- package/dist/thread.cjs.map +0 -1
- package/dist/thread.js +0 -18
- package/dist/thread.js.map +0 -1
- package/dist/types.d.cts +0 -109
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.ts +0 -109
- package/dist/types.d.ts.map +0 -1
package/dist/context.cjs
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const
|
|
2
|
+
const require_use_stream = require("./use-stream.cjs");
|
|
3
3
|
let react = require("react");
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
5
|
//#region src/context.tsx
|
|
6
6
|
const StreamContext = (0, react.createContext)(null);
|
|
7
7
|
/**
|
|
8
|
-
* Provides a shared
|
|
8
|
+
* Provides a shared {@link useStream} instance to all descendants via
|
|
9
|
+
* React Context.
|
|
9
10
|
*
|
|
10
|
-
* Use `StreamProvider` when multiple components in a subtree need
|
|
11
|
-
* same stream state (messages, loading status, errors,
|
|
12
|
-
* prop drilling.
|
|
11
|
+
* Use `StreamProvider` when multiple components in a subtree need
|
|
12
|
+
* access to the same stream state (messages, loading status, errors,
|
|
13
|
+
* interrupts, …) without prop drilling.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* ```tsx
|
|
@@ -34,20 +35,6 @@ const StreamContext = (0, react.createContext)(null);
|
|
|
34
35
|
* </header>
|
|
35
36
|
* );
|
|
36
37
|
* }
|
|
37
|
-
*
|
|
38
|
-
* function MessageList() {
|
|
39
|
-
* const { messages } = useStreamContext();
|
|
40
|
-
* return messages.map((msg, i) => <div key={msg.id ?? i}>{msg.content}</div>);
|
|
41
|
-
* }
|
|
42
|
-
*
|
|
43
|
-
* function MessageInput() {
|
|
44
|
-
* const { submit } = useStreamContext();
|
|
45
|
-
* return (
|
|
46
|
-
* <button onClick={() => submit({ messages: [{ type: "human", content: "Hi" }] })}>
|
|
47
|
-
* Send
|
|
48
|
-
* </button>
|
|
49
|
-
* );
|
|
50
|
-
* }
|
|
51
38
|
* ```
|
|
52
39
|
*
|
|
53
40
|
* Multiple providers can be nested for multi-agent scenarios:
|
|
@@ -64,35 +51,30 @@ const StreamContext = (0, react.createContext)(null);
|
|
|
64
51
|
*/
|
|
65
52
|
function StreamProvider(props) {
|
|
66
53
|
const { children, ...options } = props;
|
|
67
|
-
const stream =
|
|
54
|
+
const stream = require_use_stream.useStream(options);
|
|
68
55
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StreamContext.Provider, {
|
|
69
56
|
value: stream,
|
|
70
57
|
children
|
|
71
58
|
});
|
|
72
59
|
}
|
|
73
60
|
/**
|
|
74
|
-
* Accesses the shared stream instance from the nearest
|
|
75
|
-
*
|
|
76
|
-
* Throws if called outside of a `StreamProvider`.
|
|
61
|
+
* Accesses the shared stream instance from the nearest
|
|
62
|
+
* {@link StreamProvider}. Throws if called outside of one.
|
|
77
63
|
*
|
|
78
64
|
* @example
|
|
79
65
|
* ```tsx
|
|
80
66
|
* function MessageList() {
|
|
81
|
-
* const { messages
|
|
82
|
-
* return messages.map((
|
|
83
|
-
* const metadata = getMessagesMetadata(msg, i);
|
|
84
|
-
* return <div key={msg.id ?? i}>{msg.content}</div>;
|
|
85
|
-
* });
|
|
67
|
+
* const { messages } = useStreamContext();
|
|
68
|
+
* return messages.map((m, i) => <div key={m.id ?? i}>{String(m.content)}</div>);
|
|
86
69
|
* }
|
|
87
70
|
* ```
|
|
88
71
|
*
|
|
89
|
-
* @example With type
|
|
72
|
+
* @example With a type parameter for full type safety:
|
|
90
73
|
* ```tsx
|
|
91
74
|
* import type { agent } from "./agent";
|
|
92
75
|
*
|
|
93
76
|
* function Chat() {
|
|
94
77
|
* const { toolCalls } = useStreamContext<typeof agent>();
|
|
95
|
-
* // toolCalls are fully typed from the agent's tools
|
|
96
78
|
* }
|
|
97
79
|
* ```
|
|
98
80
|
*/
|
package/dist/context.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.cjs","names":["useStream"],"sources":["../src/context.tsx"],"sourcesContent":["/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */\n\n\"use client\";\n\nimport { createContext, useContext, type ReactNode } from \"react\";\nimport
|
|
1
|
+
{"version":3,"file":"context.cjs","names":["useStream"],"sources":["../src/context.tsx"],"sourcesContent":["/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */\n\n\"use client\";\n\nimport { createContext, useContext, type ReactNode } from \"react\";\nimport {\n useStream,\n type UseStreamOptions,\n type UseStreamReturn,\n type AgentServerOptions,\n type CustomAdapterOptions,\n} from \"./use-stream.js\";\nimport type { InferStateType } from \"@langchain/langgraph-sdk/stream\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst StreamContext = createContext<any | null>(null);\n\n/**\n * Props for {@link StreamProvider} when talking to the default\n * LangGraph Platform agent server. Mirrors {@link AgentServerOptions}\n * plus `children`.\n */\nexport type StreamProviderProps<T = Record<string, unknown>> =\n AgentServerOptions<InferStateType<T>> & {\n children: ReactNode;\n };\n\n/**\n * Props for {@link StreamProvider} when wiring a custom\n * {@link AgentServerAdapter}. Mirrors {@link CustomAdapterOptions}\n * plus `children`.\n */\nexport type StreamProviderCustomProps<T = Record<string, unknown>> =\n CustomAdapterOptions<InferStateType<T>> & {\n children: ReactNode;\n };\n\n/**\n * Provides a shared {@link useStream} instance to all descendants via\n * React Context.\n *\n * Use `StreamProvider` when multiple components in a subtree need\n * access to the same stream state (messages, loading status, errors,\n * interrupts, …) without prop drilling.\n *\n * @example\n * ```tsx\n * import { StreamProvider, useStreamContext } from \"@langchain/react\";\n *\n * function App() {\n * return (\n * <StreamProvider assistantId=\"agent\" apiUrl=\"http://localhost:2024\">\n * <ChatHeader />\n * <MessageList />\n * <MessageInput />\n * </StreamProvider>\n * );\n * }\n *\n * function ChatHeader() {\n * const { isLoading, error } = useStreamContext();\n * return (\n * <header>\n * {isLoading && <span>Thinking...</span>}\n * {error && <span>Error</span>}\n * </header>\n * );\n * }\n * ```\n *\n * Multiple providers can be nested for multi-agent scenarios:\n *\n * @example\n * ```tsx\n * <StreamProvider assistantId=\"researcher\" apiUrl=\"http://localhost:2024\">\n * <ResearchPanel />\n * </StreamProvider>\n * <StreamProvider assistantId=\"writer\" apiUrl=\"http://localhost:2024\">\n * <WriterPanel />\n * </StreamProvider>\n * ```\n */\nexport function StreamProvider<T = Record<string, unknown>>(\n props: StreamProviderProps<T> | StreamProviderCustomProps<T>\n): ReactNode {\n const { children, ...options } = props;\n const stream = useStream<T>(options as UseStreamOptions<InferStateType<T>>);\n\n return (\n <StreamContext.Provider value={stream}>{children}</StreamContext.Provider>\n );\n}\n\n/**\n * Accesses the shared stream instance from the nearest\n * {@link StreamProvider}. Throws if called outside of one.\n *\n * @example\n * ```tsx\n * function MessageList() {\n * const { messages } = useStreamContext();\n * return messages.map((m, i) => <div key={m.id ?? i}>{String(m.content)}</div>);\n * }\n * ```\n *\n * @example With a type parameter for full type safety:\n * ```tsx\n * import type { agent } from \"./agent\";\n *\n * function Chat() {\n * const { toolCalls } = useStreamContext<typeof agent>();\n * }\n * ```\n */\nexport function useStreamContext<\n T = Record<string, unknown>,\n>(): UseStreamReturn<T> {\n const context = useContext(StreamContext);\n if (context === null) {\n throw new Error(\n \"useStreamContext must be used within a <StreamProvider>. \" +\n \"Wrap your component tree with <StreamProvider> or use useStream() directly.\"\n );\n }\n return context as UseStreamReturn<T>;\n}\n"],"mappings":";;;;;AAeA,MAAM,iBAAA,GAAA,MAAA,eAA0C,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmErD,SAAgB,eACd,OACW;CACX,MAAM,EAAE,UAAU,GAAG,YAAY;CACjC,MAAM,SAASA,mBAAAA,UAAa,QAA+C;AAE3E,QACE,iBAAA,GAAA,kBAAA,KAAC,cAAc,UAAf;EAAwB,OAAO;EAAS;EAAkC,CAAA;;;;;;;;;;;;;;;;;;;;;;;AAyB9E,SAAgB,mBAEQ;CACtB,MAAM,WAAA,GAAA,MAAA,YAAqB,cAAc;AACzC,KAAI,YAAY,KACd,OAAM,IAAI,MACR,uIAED;AAEH,QAAO"}
|
package/dist/context.d.cts
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { InferBag, InferStateType, ResolveStreamOptions, UseStreamCustomOptions } from "@langchain/langgraph-sdk/ui";
|
|
1
|
+
import { AgentServerOptions as AgentServerOptions$1, CustomAdapterOptions as CustomAdapterOptions$1, UseStreamReturn } from "./use-stream.cjs";
|
|
2
|
+
import { InferStateType } from "@langchain/langgraph-sdk/stream";
|
|
4
3
|
import { ReactNode } from "react";
|
|
5
4
|
|
|
6
5
|
//#region src/context.d.ts
|
|
7
6
|
/**
|
|
8
|
-
* Props for
|
|
9
|
-
*
|
|
7
|
+
* Props for {@link StreamProvider} when talking to the default
|
|
8
|
+
* LangGraph Platform agent server. Mirrors {@link AgentServerOptions}
|
|
9
|
+
* plus `children`.
|
|
10
10
|
*/
|
|
11
|
-
type StreamProviderProps<T = Record<string, unknown
|
|
11
|
+
type StreamProviderProps<T = Record<string, unknown>> = AgentServerOptions$1<InferStateType<T>> & {
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
* Props for
|
|
16
|
-
*
|
|
15
|
+
* Props for {@link StreamProvider} when wiring a custom
|
|
16
|
+
* {@link AgentServerAdapter}. Mirrors {@link CustomAdapterOptions}
|
|
17
|
+
* plus `children`.
|
|
17
18
|
*/
|
|
18
|
-
type StreamProviderCustomProps<T = Record<string, unknown
|
|
19
|
+
type StreamProviderCustomProps<T = Record<string, unknown>> = CustomAdapterOptions$1<InferStateType<T>> & {
|
|
19
20
|
children: ReactNode;
|
|
20
21
|
};
|
|
21
22
|
/**
|
|
22
|
-
* Provides a shared
|
|
23
|
+
* Provides a shared {@link useStream} instance to all descendants via
|
|
24
|
+
* React Context.
|
|
23
25
|
*
|
|
24
|
-
* Use `StreamProvider` when multiple components in a subtree need
|
|
25
|
-
* same stream state (messages, loading status, errors,
|
|
26
|
-
* prop drilling.
|
|
26
|
+
* Use `StreamProvider` when multiple components in a subtree need
|
|
27
|
+
* access to the same stream state (messages, loading status, errors,
|
|
28
|
+
* interrupts, …) without prop drilling.
|
|
27
29
|
*
|
|
28
30
|
* @example
|
|
29
31
|
* ```tsx
|
|
@@ -48,20 +50,6 @@ type StreamProviderCustomProps<T = Record<string, unknown>, Bag extends BagTempl
|
|
|
48
50
|
* </header>
|
|
49
51
|
* );
|
|
50
52
|
* }
|
|
51
|
-
*
|
|
52
|
-
* function MessageList() {
|
|
53
|
-
* const { messages } = useStreamContext();
|
|
54
|
-
* return messages.map((msg, i) => <div key={msg.id ?? i}>{msg.content}</div>);
|
|
55
|
-
* }
|
|
56
|
-
*
|
|
57
|
-
* function MessageInput() {
|
|
58
|
-
* const { submit } = useStreamContext();
|
|
59
|
-
* return (
|
|
60
|
-
* <button onClick={() => submit({ messages: [{ type: "human", content: "Hi" }] })}>
|
|
61
|
-
* Send
|
|
62
|
-
* </button>
|
|
63
|
-
* );
|
|
64
|
-
* }
|
|
65
53
|
* ```
|
|
66
54
|
*
|
|
67
55
|
* Multiple providers can be nested for multi-agent scenarios:
|
|
@@ -76,34 +64,29 @@ type StreamProviderCustomProps<T = Record<string, unknown>, Bag extends BagTempl
|
|
|
76
64
|
* </StreamProvider>
|
|
77
65
|
* ```
|
|
78
66
|
*/
|
|
79
|
-
declare function StreamProvider<T = Record<string, unknown
|
|
67
|
+
declare function StreamProvider<T = Record<string, unknown>>(props: StreamProviderProps<T> | StreamProviderCustomProps<T>): ReactNode;
|
|
80
68
|
/**
|
|
81
|
-
* Accesses the shared stream instance from the nearest
|
|
82
|
-
*
|
|
83
|
-
* Throws if called outside of a `StreamProvider`.
|
|
69
|
+
* Accesses the shared stream instance from the nearest
|
|
70
|
+
* {@link StreamProvider}. Throws if called outside of one.
|
|
84
71
|
*
|
|
85
72
|
* @example
|
|
86
73
|
* ```tsx
|
|
87
74
|
* function MessageList() {
|
|
88
|
-
* const { messages
|
|
89
|
-
* return messages.map((
|
|
90
|
-
* const metadata = getMessagesMetadata(msg, i);
|
|
91
|
-
* return <div key={msg.id ?? i}>{msg.content}</div>;
|
|
92
|
-
* });
|
|
75
|
+
* const { messages } = useStreamContext();
|
|
76
|
+
* return messages.map((m, i) => <div key={m.id ?? i}>{String(m.content)}</div>);
|
|
93
77
|
* }
|
|
94
78
|
* ```
|
|
95
79
|
*
|
|
96
|
-
* @example With type
|
|
80
|
+
* @example With a type parameter for full type safety:
|
|
97
81
|
* ```tsx
|
|
98
82
|
* import type { agent } from "./agent";
|
|
99
83
|
*
|
|
100
84
|
* function Chat() {
|
|
101
85
|
* const { toolCalls } = useStreamContext<typeof agent>();
|
|
102
|
-
* // toolCalls are fully typed from the agent's tools
|
|
103
86
|
* }
|
|
104
87
|
* ```
|
|
105
88
|
*/
|
|
106
|
-
declare function useStreamContext<T = Record<string, unknown
|
|
89
|
+
declare function useStreamContext<T = Record<string, unknown>>(): UseStreamReturn<T>;
|
|
107
90
|
//#endregion
|
|
108
91
|
export { StreamProvider, StreamProviderCustomProps, StreamProviderProps, useStreamContext };
|
|
109
92
|
//# sourceMappingURL=context.d.cts.map
|
package/dist/context.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.cts","names":[],"sources":["../src/context.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.cts","names":[],"sources":["../src/context.tsx"],"mappings":";;;;;;;AAsBA;;;KAAY,mBAAA,KAAwB,MAAA,qBAClC,oBAAA,CAAmB,cAAA,CAAe,CAAA;EAChC,QAAA,EAAU,SAAA;AAAA;;;;;;KAQF,yBAAA,KAA8B,MAAA,qBACxC,sBAAA,CAAqB,cAAA,CAAe,CAAA;EAClC,QAAA,EAAU,SAAA;AAAA;;;;;;AAFd;;;;;;;;;;;;;;;;;;;AAkDA;;;;;;;;;;;;;;;;;;;;;iBAAgB,cAAA,KAAmB,MAAA,kBAAA,CACjC,KAAA,EAAO,mBAAA,CAAoB,CAAA,IAAK,yBAAA,CAA0B,CAAA,IACzD,SAAA;;;;;;;;;;;;;;;;;;;;;;iBA8Ba,gBAAA,KACV,MAAA,kBAAA,CAAA,GACD,eAAA,CAAgB,CAAA"}
|
package/dist/context.d.ts
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AgentServerOptions as AgentServerOptions$1, CustomAdapterOptions as CustomAdapterOptions$1, UseStreamReturn } from "./use-stream.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { BagTemplate } from "@langchain/langgraph-sdk";
|
|
3
|
+
import { InferStateType } from "@langchain/langgraph-sdk/stream";
|
|
5
4
|
|
|
6
5
|
//#region src/context.d.ts
|
|
7
6
|
/**
|
|
8
|
-
* Props for
|
|
9
|
-
*
|
|
7
|
+
* Props for {@link StreamProvider} when talking to the default
|
|
8
|
+
* LangGraph Platform agent server. Mirrors {@link AgentServerOptions}
|
|
9
|
+
* plus `children`.
|
|
10
10
|
*/
|
|
11
|
-
type StreamProviderProps<T = Record<string, unknown
|
|
11
|
+
type StreamProviderProps<T = Record<string, unknown>> = AgentServerOptions$1<InferStateType<T>> & {
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
* Props for
|
|
16
|
-
*
|
|
15
|
+
* Props for {@link StreamProvider} when wiring a custom
|
|
16
|
+
* {@link AgentServerAdapter}. Mirrors {@link CustomAdapterOptions}
|
|
17
|
+
* plus `children`.
|
|
17
18
|
*/
|
|
18
|
-
type StreamProviderCustomProps<T = Record<string, unknown
|
|
19
|
+
type StreamProviderCustomProps<T = Record<string, unknown>> = CustomAdapterOptions$1<InferStateType<T>> & {
|
|
19
20
|
children: ReactNode;
|
|
20
21
|
};
|
|
21
22
|
/**
|
|
22
|
-
* Provides a shared
|
|
23
|
+
* Provides a shared {@link useStream} instance to all descendants via
|
|
24
|
+
* React Context.
|
|
23
25
|
*
|
|
24
|
-
* Use `StreamProvider` when multiple components in a subtree need
|
|
25
|
-
* same stream state (messages, loading status, errors,
|
|
26
|
-
* prop drilling.
|
|
26
|
+
* Use `StreamProvider` when multiple components in a subtree need
|
|
27
|
+
* access to the same stream state (messages, loading status, errors,
|
|
28
|
+
* interrupts, …) without prop drilling.
|
|
27
29
|
*
|
|
28
30
|
* @example
|
|
29
31
|
* ```tsx
|
|
@@ -48,20 +50,6 @@ type StreamProviderCustomProps<T = Record<string, unknown>, Bag extends BagTempl
|
|
|
48
50
|
* </header>
|
|
49
51
|
* );
|
|
50
52
|
* }
|
|
51
|
-
*
|
|
52
|
-
* function MessageList() {
|
|
53
|
-
* const { messages } = useStreamContext();
|
|
54
|
-
* return messages.map((msg, i) => <div key={msg.id ?? i}>{msg.content}</div>);
|
|
55
|
-
* }
|
|
56
|
-
*
|
|
57
|
-
* function MessageInput() {
|
|
58
|
-
* const { submit } = useStreamContext();
|
|
59
|
-
* return (
|
|
60
|
-
* <button onClick={() => submit({ messages: [{ type: "human", content: "Hi" }] })}>
|
|
61
|
-
* Send
|
|
62
|
-
* </button>
|
|
63
|
-
* );
|
|
64
|
-
* }
|
|
65
53
|
* ```
|
|
66
54
|
*
|
|
67
55
|
* Multiple providers can be nested for multi-agent scenarios:
|
|
@@ -76,34 +64,29 @@ type StreamProviderCustomProps<T = Record<string, unknown>, Bag extends BagTempl
|
|
|
76
64
|
* </StreamProvider>
|
|
77
65
|
* ```
|
|
78
66
|
*/
|
|
79
|
-
declare function StreamProvider<T = Record<string, unknown
|
|
67
|
+
declare function StreamProvider<T = Record<string, unknown>>(props: StreamProviderProps<T> | StreamProviderCustomProps<T>): ReactNode;
|
|
80
68
|
/**
|
|
81
|
-
* Accesses the shared stream instance from the nearest
|
|
82
|
-
*
|
|
83
|
-
* Throws if called outside of a `StreamProvider`.
|
|
69
|
+
* Accesses the shared stream instance from the nearest
|
|
70
|
+
* {@link StreamProvider}. Throws if called outside of one.
|
|
84
71
|
*
|
|
85
72
|
* @example
|
|
86
73
|
* ```tsx
|
|
87
74
|
* function MessageList() {
|
|
88
|
-
* const { messages
|
|
89
|
-
* return messages.map((
|
|
90
|
-
* const metadata = getMessagesMetadata(msg, i);
|
|
91
|
-
* return <div key={msg.id ?? i}>{msg.content}</div>;
|
|
92
|
-
* });
|
|
75
|
+
* const { messages } = useStreamContext();
|
|
76
|
+
* return messages.map((m, i) => <div key={m.id ?? i}>{String(m.content)}</div>);
|
|
93
77
|
* }
|
|
94
78
|
* ```
|
|
95
79
|
*
|
|
96
|
-
* @example With type
|
|
80
|
+
* @example With a type parameter for full type safety:
|
|
97
81
|
* ```tsx
|
|
98
82
|
* import type { agent } from "./agent";
|
|
99
83
|
*
|
|
100
84
|
* function Chat() {
|
|
101
85
|
* const { toolCalls } = useStreamContext<typeof agent>();
|
|
102
|
-
* // toolCalls are fully typed from the agent's tools
|
|
103
86
|
* }
|
|
104
87
|
* ```
|
|
105
88
|
*/
|
|
106
|
-
declare function useStreamContext<T = Record<string, unknown
|
|
89
|
+
declare function useStreamContext<T = Record<string, unknown>>(): UseStreamReturn<T>;
|
|
107
90
|
//#endregion
|
|
108
91
|
export { StreamProvider, StreamProviderCustomProps, StreamProviderProps, useStreamContext };
|
|
109
92
|
//# sourceMappingURL=context.d.ts.map
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","names":[],"sources":["../src/context.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","names":[],"sources":["../src/context.tsx"],"mappings":";;;;;;;AAsBA;;;KAAY,mBAAA,KAAwB,MAAA,qBAClC,oBAAA,CAAmB,cAAA,CAAe,CAAA;EAChC,QAAA,EAAU,SAAA;AAAA;;;;;;KAQF,yBAAA,KAA8B,MAAA,qBACxC,sBAAA,CAAqB,cAAA,CAAe,CAAA;EAClC,QAAA,EAAU,SAAA;AAAA;;;;;;AAFd;;;;;;;;;;;;;;;;;;;AAkDA;;;;;;;;;;;;;;;;;;;;;iBAAgB,cAAA,KAAmB,MAAA,kBAAA,CACjC,KAAA,EAAO,mBAAA,CAAoB,CAAA,IAAK,yBAAA,CAA0B,CAAA,IACzD,SAAA;;;;;;;;;;;;;;;;;;;;;;iBA8Ba,gBAAA,KACV,MAAA,kBAAA,CAAA,GACD,eAAA,CAAgB,CAAA"}
|
package/dist/context.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useStream } from "./stream.js";
|
|
2
|
+
import { useStream } from "./use-stream.js";
|
|
3
3
|
import { createContext, useContext } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/context.tsx
|
|
6
6
|
const StreamContext = createContext(null);
|
|
7
7
|
/**
|
|
8
|
-
* Provides a shared
|
|
8
|
+
* Provides a shared {@link useStream} instance to all descendants via
|
|
9
|
+
* React Context.
|
|
9
10
|
*
|
|
10
|
-
* Use `StreamProvider` when multiple components in a subtree need
|
|
11
|
-
* same stream state (messages, loading status, errors,
|
|
12
|
-
* prop drilling.
|
|
11
|
+
* Use `StreamProvider` when multiple components in a subtree need
|
|
12
|
+
* access to the same stream state (messages, loading status, errors,
|
|
13
|
+
* interrupts, …) without prop drilling.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* ```tsx
|
|
@@ -34,20 +35,6 @@ const StreamContext = createContext(null);
|
|
|
34
35
|
* </header>
|
|
35
36
|
* );
|
|
36
37
|
* }
|
|
37
|
-
*
|
|
38
|
-
* function MessageList() {
|
|
39
|
-
* const { messages } = useStreamContext();
|
|
40
|
-
* return messages.map((msg, i) => <div key={msg.id ?? i}>{msg.content}</div>);
|
|
41
|
-
* }
|
|
42
|
-
*
|
|
43
|
-
* function MessageInput() {
|
|
44
|
-
* const { submit } = useStreamContext();
|
|
45
|
-
* return (
|
|
46
|
-
* <button onClick={() => submit({ messages: [{ type: "human", content: "Hi" }] })}>
|
|
47
|
-
* Send
|
|
48
|
-
* </button>
|
|
49
|
-
* );
|
|
50
|
-
* }
|
|
51
38
|
* ```
|
|
52
39
|
*
|
|
53
40
|
* Multiple providers can be nested for multi-agent scenarios:
|
|
@@ -71,28 +58,23 @@ function StreamProvider(props) {
|
|
|
71
58
|
});
|
|
72
59
|
}
|
|
73
60
|
/**
|
|
74
|
-
* Accesses the shared stream instance from the nearest
|
|
75
|
-
*
|
|
76
|
-
* Throws if called outside of a `StreamProvider`.
|
|
61
|
+
* Accesses the shared stream instance from the nearest
|
|
62
|
+
* {@link StreamProvider}. Throws if called outside of one.
|
|
77
63
|
*
|
|
78
64
|
* @example
|
|
79
65
|
* ```tsx
|
|
80
66
|
* function MessageList() {
|
|
81
|
-
* const { messages
|
|
82
|
-
* return messages.map((
|
|
83
|
-
* const metadata = getMessagesMetadata(msg, i);
|
|
84
|
-
* return <div key={msg.id ?? i}>{msg.content}</div>;
|
|
85
|
-
* });
|
|
67
|
+
* const { messages } = useStreamContext();
|
|
68
|
+
* return messages.map((m, i) => <div key={m.id ?? i}>{String(m.content)}</div>);
|
|
86
69
|
* }
|
|
87
70
|
* ```
|
|
88
71
|
*
|
|
89
|
-
* @example With type
|
|
72
|
+
* @example With a type parameter for full type safety:
|
|
90
73
|
* ```tsx
|
|
91
74
|
* import type { agent } from "./agent";
|
|
92
75
|
*
|
|
93
76
|
* function Chat() {
|
|
94
77
|
* const { toolCalls } = useStreamContext<typeof agent>();
|
|
95
|
-
* // toolCalls are fully typed from the agent's tools
|
|
96
78
|
* }
|
|
97
79
|
* ```
|
|
98
80
|
*/
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","names":[],"sources":["../src/context.tsx"],"sourcesContent":["/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */\n\n\"use client\";\n\nimport { createContext, useContext, type ReactNode } from \"react\";\nimport
|
|
1
|
+
{"version":3,"file":"context.js","names":[],"sources":["../src/context.tsx"],"sourcesContent":["/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */\n\n\"use client\";\n\nimport { createContext, useContext, type ReactNode } from \"react\";\nimport {\n useStream,\n type UseStreamOptions,\n type UseStreamReturn,\n type AgentServerOptions,\n type CustomAdapterOptions,\n} from \"./use-stream.js\";\nimport type { InferStateType } from \"@langchain/langgraph-sdk/stream\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst StreamContext = createContext<any | null>(null);\n\n/**\n * Props for {@link StreamProvider} when talking to the default\n * LangGraph Platform agent server. Mirrors {@link AgentServerOptions}\n * plus `children`.\n */\nexport type StreamProviderProps<T = Record<string, unknown>> =\n AgentServerOptions<InferStateType<T>> & {\n children: ReactNode;\n };\n\n/**\n * Props for {@link StreamProvider} when wiring a custom\n * {@link AgentServerAdapter}. Mirrors {@link CustomAdapterOptions}\n * plus `children`.\n */\nexport type StreamProviderCustomProps<T = Record<string, unknown>> =\n CustomAdapterOptions<InferStateType<T>> & {\n children: ReactNode;\n };\n\n/**\n * Provides a shared {@link useStream} instance to all descendants via\n * React Context.\n *\n * Use `StreamProvider` when multiple components in a subtree need\n * access to the same stream state (messages, loading status, errors,\n * interrupts, …) without prop drilling.\n *\n * @example\n * ```tsx\n * import { StreamProvider, useStreamContext } from \"@langchain/react\";\n *\n * function App() {\n * return (\n * <StreamProvider assistantId=\"agent\" apiUrl=\"http://localhost:2024\">\n * <ChatHeader />\n * <MessageList />\n * <MessageInput />\n * </StreamProvider>\n * );\n * }\n *\n * function ChatHeader() {\n * const { isLoading, error } = useStreamContext();\n * return (\n * <header>\n * {isLoading && <span>Thinking...</span>}\n * {error && <span>Error</span>}\n * </header>\n * );\n * }\n * ```\n *\n * Multiple providers can be nested for multi-agent scenarios:\n *\n * @example\n * ```tsx\n * <StreamProvider assistantId=\"researcher\" apiUrl=\"http://localhost:2024\">\n * <ResearchPanel />\n * </StreamProvider>\n * <StreamProvider assistantId=\"writer\" apiUrl=\"http://localhost:2024\">\n * <WriterPanel />\n * </StreamProvider>\n * ```\n */\nexport function StreamProvider<T = Record<string, unknown>>(\n props: StreamProviderProps<T> | StreamProviderCustomProps<T>\n): ReactNode {\n const { children, ...options } = props;\n const stream = useStream<T>(options as UseStreamOptions<InferStateType<T>>);\n\n return (\n <StreamContext.Provider value={stream}>{children}</StreamContext.Provider>\n );\n}\n\n/**\n * Accesses the shared stream instance from the nearest\n * {@link StreamProvider}. Throws if called outside of one.\n *\n * @example\n * ```tsx\n * function MessageList() {\n * const { messages } = useStreamContext();\n * return messages.map((m, i) => <div key={m.id ?? i}>{String(m.content)}</div>);\n * }\n * ```\n *\n * @example With a type parameter for full type safety:\n * ```tsx\n * import type { agent } from \"./agent\";\n *\n * function Chat() {\n * const { toolCalls } = useStreamContext<typeof agent>();\n * }\n * ```\n */\nexport function useStreamContext<\n T = Record<string, unknown>,\n>(): UseStreamReturn<T> {\n const context = useContext(StreamContext);\n if (context === null) {\n throw new Error(\n \"useStreamContext must be used within a <StreamProvider>. \" +\n \"Wrap your component tree with <StreamProvider> or use useStream() directly.\"\n );\n }\n return context as UseStreamReturn<T>;\n}\n"],"mappings":";;;;;AAeA,MAAM,gBAAgB,cAA0B,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmErD,SAAgB,eACd,OACW;CACX,MAAM,EAAE,UAAU,GAAG,YAAY;CACjC,MAAM,SAAS,UAAa,QAA+C;AAE3E,QACE,oBAAC,cAAc,UAAf;EAAwB,OAAO;EAAS;EAAkC,CAAA;;;;;;;;;;;;;;;;;;;;;;;AAyB9E,SAAgB,mBAEQ;CACtB,MAAM,UAAU,WAAW,cAAc;AACzC,KAAI,YAAY,KACd,OAAM,IAAI,MACR,uIAED;AAEH,QAAO"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,43 +1,34 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("./stream.
|
|
3
|
-
const
|
|
2
|
+
const require_use_stream = require("./use-stream.cjs");
|
|
3
|
+
const require_use_projection = require("./use-projection.cjs");
|
|
4
|
+
const require_selectors = require("./selectors.cjs");
|
|
5
|
+
const require_use_media_url = require("./use-media-url.cjs");
|
|
6
|
+
const require_use_audio_player = require("./use-audio-player.cjs");
|
|
7
|
+
const require_use_video_player = require("./use-video-player.cjs");
|
|
4
8
|
const require_suspense_stream = require("./suspense-stream.cjs");
|
|
5
9
|
const require_context = require("./context.cjs");
|
|
6
|
-
let _langchain_langgraph_sdk_ui = require("@langchain/langgraph-sdk/ui");
|
|
7
10
|
let _langchain_langgraph_sdk = require("@langchain/langgraph-sdk");
|
|
8
|
-
|
|
9
|
-
exports
|
|
10
|
-
Object.defineProperty(exports, "SubagentManager", {
|
|
11
|
+
let _langchain_langgraph_sdk_stream = require("@langchain/langgraph-sdk/stream");
|
|
12
|
+
Object.defineProperty(exports, "HttpAgentServerAdapter", {
|
|
11
13
|
enumerable: true,
|
|
12
14
|
get: function() {
|
|
13
|
-
return
|
|
15
|
+
return _langchain_langgraph_sdk.HttpAgentServerAdapter;
|
|
14
16
|
}
|
|
15
17
|
});
|
|
16
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "MediaAssemblyError", {
|
|
17
19
|
enumerable: true,
|
|
18
20
|
get: function() {
|
|
19
|
-
return
|
|
21
|
+
return _langchain_langgraph_sdk_stream.MediaAssemblyError;
|
|
20
22
|
}
|
|
21
23
|
});
|
|
22
|
-
exports.
|
|
24
|
+
exports.STREAM_CONTROLLER = require_use_stream.STREAM_CONTROLLER;
|
|
25
|
+
exports.StreamProvider = require_context.StreamProvider;
|
|
23
26
|
Object.defineProperty(exports, "executeHeadlessTool", {
|
|
24
27
|
enumerable: true,
|
|
25
28
|
get: function() {
|
|
26
29
|
return _langchain_langgraph_sdk.executeHeadlessTool;
|
|
27
30
|
}
|
|
28
31
|
});
|
|
29
|
-
Object.defineProperty(exports, "extractParentIdFromNamespace", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function() {
|
|
32
|
-
return _langchain_langgraph_sdk_ui.extractParentIdFromNamespace;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
Object.defineProperty(exports, "extractToolCallIdFromNamespace", {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
get: function() {
|
|
38
|
-
return _langchain_langgraph_sdk_ui.extractToolCallIdFromNamespace;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
32
|
Object.defineProperty(exports, "filterOutHeadlessToolInterrupts", {
|
|
42
33
|
enumerable: true,
|
|
43
34
|
get: function() {
|
|
@@ -68,25 +59,33 @@ Object.defineProperty(exports, "headlessToolResumeCommand", {
|
|
|
68
59
|
return _langchain_langgraph_sdk.headlessToolResumeCommand;
|
|
69
60
|
}
|
|
70
61
|
});
|
|
71
|
-
exports.invalidateSuspenseCache = require_suspense_stream.invalidateSuspenseCache;
|
|
72
62
|
Object.defineProperty(exports, "isHeadlessToolInterrupt", {
|
|
73
63
|
enumerable: true,
|
|
74
64
|
get: function() {
|
|
75
65
|
return _langchain_langgraph_sdk.isHeadlessToolInterrupt;
|
|
76
66
|
}
|
|
77
67
|
});
|
|
78
|
-
Object.defineProperty(exports, "isSubagentNamespace", {
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function() {
|
|
81
|
-
return _langchain_langgraph_sdk_ui.isSubagentNamespace;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
68
|
Object.defineProperty(exports, "parseHeadlessToolInterruptPayload", {
|
|
85
69
|
enumerable: true,
|
|
86
70
|
get: function() {
|
|
87
71
|
return _langchain_langgraph_sdk.parseHeadlessToolInterruptPayload;
|
|
88
72
|
}
|
|
89
73
|
});
|
|
90
|
-
exports.
|
|
74
|
+
exports.useAudio = require_selectors.useAudio;
|
|
75
|
+
exports.useAudioPlayer = require_use_audio_player.useAudioPlayer;
|
|
76
|
+
exports.useChannel = require_selectors.useChannel;
|
|
77
|
+
exports.useExtension = require_selectors.useExtension;
|
|
78
|
+
exports.useFiles = require_selectors.useFiles;
|
|
79
|
+
exports.useImages = require_selectors.useImages;
|
|
80
|
+
exports.useMediaURL = require_use_media_url.useMediaURL;
|
|
81
|
+
exports.useMessageMetadata = require_selectors.useMessageMetadata;
|
|
82
|
+
exports.useMessages = require_selectors.useMessages;
|
|
83
|
+
exports.useProjection = require_use_projection.useProjection;
|
|
84
|
+
exports.useStream = require_use_stream.useStream;
|
|
91
85
|
exports.useStreamContext = require_context.useStreamContext;
|
|
86
|
+
exports.useSubmissionQueue = require_selectors.useSubmissionQueue;
|
|
92
87
|
exports.useSuspenseStream = require_suspense_stream.useSuspenseStream;
|
|
88
|
+
exports.useToolCalls = require_selectors.useToolCalls;
|
|
89
|
+
exports.useValues = require_selectors.useValues;
|
|
90
|
+
exports.useVideo = require_selectors.useVideo;
|
|
91
|
+
exports.useVideoPlayer = require_use_video_player.useVideoPlayer;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { AgentServerOptions, AnyStream, CustomAdapterOptions, STREAM_CONTROLLER, UseStreamOptions, UseStreamResult, UseStreamReturn, useStream } from "./use-stream.cjs";
|
|
2
|
+
import { useProjection } from "./use-projection.cjs";
|
|
3
|
+
import { SelectorTarget, SubmissionQueueEntry, SubmissionQueueSnapshot, UseSubmissionQueueReturn, useAudio, useChannel, useExtension, useFiles, useImages, useMessageMetadata, useMessages, useSubmissionQueue, useToolCalls, useValues, useVideo } from "./selectors.cjs";
|
|
4
|
+
import { useMediaURL } from "./use-media-url.cjs";
|
|
5
|
+
import { AudioPlayerHandle, PlayerStatus, UseAudioPlayerOptions, useAudioPlayer } from "./use-audio-player.cjs";
|
|
6
|
+
import { UseVideoPlayerOptions, VideoPlayerHandle, useVideoPlayer } from "./use-video-player.cjs";
|
|
7
|
+
import { UseSuspenseStreamReturn, useSuspenseStream } from "./suspense-stream.cjs";
|
|
5
8
|
import { StreamProvider, StreamProviderCustomProps, StreamProviderProps, useStreamContext } from "./context.cjs";
|
|
6
9
|
import { AIMessage, ToolMessage } from "@langchain/core/messages";
|
|
7
|
-
import { AnyHeadlessToolImplementation, DefaultToolCall, DefaultToolCall as DefaultToolCall$1, FlushPendingHeadlessToolInterruptsOptions, HeadlessToolImplementation, HeadlessToolInterrupt, OnToolCallback, ToolCallFromTool, ToolCallState, ToolCallWithResult as ToolCallWithResult$1, ToolCallsFromTools, ToolEvent, executeHeadlessTool, filterOutHeadlessToolInterrupts, findHeadlessTool, flushPendingHeadlessToolInterrupts, handleHeadlessToolInterrupt, headlessToolResumeCommand, isHeadlessToolInterrupt, parseHeadlessToolInterruptPayload } from "@langchain/langgraph-sdk";
|
|
8
|
-
import {
|
|
10
|
+
import { AnyHeadlessToolImplementation, DefaultToolCall, DefaultToolCall as DefaultToolCall$1, FlushPendingHeadlessToolInterruptsOptions, HeadlessToolImplementation, HeadlessToolInterrupt, HttpAgentServerAdapter, HttpAgentServerAdapterOptions, OnToolCallback, ToolCallFromTool, ToolCallState, ToolCallWithResult as ToolCallWithResult$1, 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, MessageMetadata, MessageMetadataMap, StreamSubmitOptions, SubagentDiscoverySnapshot, SubgraphDiscoverySnapshot, ToolCallStatus, VideoMedia, WidenUpdateMessages } from "@langchain/langgraph-sdk/stream";
|
|
9
12
|
|
|
10
13
|
//#region src/index.d.ts
|
|
11
14
|
type ToolCallWithResult<ToolCall = DefaultToolCall$1> = ToolCallWithResult$1<ToolCall, ToolMessage, AIMessage>;
|
|
12
15
|
//#endregion
|
|
13
|
-
export { type
|
|
16
|
+
export { type AgentServerAdapter, type AgentServerOptions, type AnyHeadlessToolImplementation, type AnyMediaHandle, type AnyStream, type AssembledToolCall, type AudioMedia, type AudioPlayerHandle, 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, MediaAssemblyError, type MediaAssemblyErrorKind, type MediaBase, type MediaBlockType, type MessageMetadata, type MessageMetadataMap, type OnToolCallback, type PlayerStatus, STREAM_CONTROLLER, type SelectorTarget, StreamProvider, type StreamProviderCustomProps, type StreamProviderProps, type StreamSubmitOptions, type SubagentDiscoverySnapshot, type SubgraphDiscoverySnapshot, type SubmissionQueueEntry, type SubmissionQueueSnapshot, type ToolCallFromTool, type ToolCallState, type ToolCallStatus, ToolCallWithResult, type ToolCallsFromTools, type ToolEvent, type UseAudioPlayerOptions, type UseStreamOptions, type UseStreamResult, type UseStreamReturn, type UseSubmissionQueueReturn, type UseSuspenseStreamReturn, type UseVideoPlayerOptions, type VideoMedia, type VideoPlayerHandle, type WidenUpdateMessages, executeHeadlessTool, filterOutHeadlessToolInterrupts, findHeadlessTool, flushPendingHeadlessToolInterrupts, handleHeadlessToolInterrupt, headlessToolResumeCommand, isHeadlessToolInterrupt, parseHeadlessToolInterruptPayload, useAudio, useAudioPlayer, useChannel, useExtension, useFiles, useImages, useMediaURL, useMessageMetadata, useMessages, useProjection, useStream, useStreamContext, useSubmissionQueue, useSuspenseStream, useToolCalls, useValues, useVideo, useVideoPlayer };
|
|
14
17
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;KAkGY,kBAAA,YAA8B,iBAAA,IACxC,oBAAA,CAAoB,QAAA,EAAU,WAAA,EAAiB,SAAA"}
|