@langchain/langgraph-sdk 1.7.4 → 1.8.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/dist/react/stream.custom.cjs +21 -1
- package/dist/react/stream.custom.cjs.map +1 -1
- package/dist/react/stream.custom.js +21 -1
- package/dist/react/stream.custom.js.map +1 -1
- package/dist/react/stream.lgp.cjs +11 -1
- package/dist/react/stream.lgp.cjs.map +1 -1
- package/dist/react/stream.lgp.js +11 -1
- package/dist/react/stream.lgp.js.map +1 -1
- package/dist/ui/index.cjs +4 -0
- package/dist/ui/index.d.cts +3 -1
- package/dist/ui/index.d.ts +3 -1
- package/dist/ui/index.js +3 -1
- package/dist/ui/manager.cjs +181 -0
- package/dist/ui/manager.cjs.map +1 -1
- package/dist/ui/manager.d.cts +41 -0
- package/dist/ui/manager.d.cts.map +1 -1
- package/dist/ui/manager.d.ts +41 -0
- package/dist/ui/manager.d.ts.map +1 -1
- package/dist/ui/manager.js +181 -0
- package/dist/ui/manager.js.map +1 -1
- package/dist/ui/orchestrator-custom.cjs +372 -0
- package/dist/ui/orchestrator-custom.cjs.map +1 -0
- package/dist/ui/orchestrator-custom.d.cts +185 -0
- package/dist/ui/orchestrator-custom.d.cts.map +1 -0
- package/dist/ui/orchestrator-custom.d.ts +185 -0
- package/dist/ui/orchestrator-custom.d.ts.map +1 -0
- package/dist/ui/orchestrator-custom.js +372 -0
- package/dist/ui/orchestrator-custom.js.map +1 -0
- package/dist/ui/orchestrator.cjs +866 -0
- package/dist/ui/orchestrator.cjs.map +1 -0
- package/dist/ui/orchestrator.d.cts +366 -0
- package/dist/ui/orchestrator.d.cts.map +1 -0
- package/dist/ui/orchestrator.d.ts +366 -0
- package/dist/ui/orchestrator.d.ts.map +1 -0
- package/dist/ui/orchestrator.js +866 -0
- package/dist/ui/orchestrator.js.map +1 -0
- package/dist/ui/subagents.cjs +24 -1
- package/dist/ui/subagents.cjs.map +1 -1
- package/dist/ui/subagents.d.cts +13 -0
- package/dist/ui/subagents.d.cts.map +1 -1
- package/dist/ui/subagents.d.ts +13 -0
- package/dist/ui/subagents.d.ts.map +1 -1
- package/dist/ui/subagents.js +24 -1
- package/dist/ui/subagents.js.map +1 -1
- package/dist/ui/types.d.cts +3 -2
- package/dist/ui/types.d.cts.map +1 -1
- package/dist/ui/types.d.ts +3 -2
- package/dist/ui/types.d.ts.map +1 -1
- package/package.json +2 -6
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { Interrupt } from "../schema.cjs";
|
|
2
|
+
import { DefaultToolCall, Message, ToolCallWithResult } from "../types.messages.cjs";
|
|
3
|
+
import { BagTemplate } from "../types.template.cjs";
|
|
4
|
+
import { AnyStreamCustomOptions, CustomSubmitOptions, GetConfigurableType, GetInterruptType, GetUpdateType, MessageMetadata, SubagentStreamInterface } from "./types.cjs";
|
|
5
|
+
import { MessageTupleManager } from "./messages.cjs";
|
|
6
|
+
import { StreamManager } from "./manager.cjs";
|
|
7
|
+
import { BaseMessage } from "@langchain/core/messages";
|
|
8
|
+
|
|
9
|
+
//#region src/ui/orchestrator-custom.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* Framework-agnostic orchestrator for custom transport streams.
|
|
12
|
+
*
|
|
13
|
+
* Encapsulates all business logic shared across React, Vue, Svelte, and Angular
|
|
14
|
+
* for custom transport (non-LGP) streaming.
|
|
15
|
+
*/
|
|
16
|
+
declare class CustomStreamOrchestrator<StateType extends Record<string, unknown> = Record<string, unknown>, Bag extends BagTemplate = BagTemplate> {
|
|
17
|
+
#private;
|
|
18
|
+
readonly stream: StreamManager<StateType, Bag>;
|
|
19
|
+
readonly messageManager: MessageTupleManager;
|
|
20
|
+
/**
|
|
21
|
+
* Create a new {@link CustomStreamOrchestrator} instance.
|
|
22
|
+
*
|
|
23
|
+
* @param options - Configuration options for the custom transport stream,
|
|
24
|
+
* including thread ID, transport, callbacks, and subagent settings.
|
|
25
|
+
*/
|
|
26
|
+
constructor(options: AnyStreamCustomOptions<StateType, Bag>);
|
|
27
|
+
/**
|
|
28
|
+
* Register a listener that is called whenever the orchestrator state changes.
|
|
29
|
+
*
|
|
30
|
+
* @param listener - Callback invoked on each state change.
|
|
31
|
+
* @returns An unsubscribe function that removes the listener.
|
|
32
|
+
*/
|
|
33
|
+
subscribe: (listener: () => void) => () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Return the current version number, incremented on each state change.
|
|
36
|
+
* Useful as a cache key for external sync (e.g. `useSyncExternalStore`).
|
|
37
|
+
*
|
|
38
|
+
* @returns The current version counter.
|
|
39
|
+
*/
|
|
40
|
+
getSnapshot: () => number;
|
|
41
|
+
/**
|
|
42
|
+
* Synchronize the external thread ID with the orchestrator.
|
|
43
|
+
* If the ID has changed, the current stream is cleared and listeners
|
|
44
|
+
* are notified.
|
|
45
|
+
*
|
|
46
|
+
* @param newId - The new thread ID, or `null` to clear.
|
|
47
|
+
*/
|
|
48
|
+
syncThreadId(newId: string | null): void;
|
|
49
|
+
/**
|
|
50
|
+
* The current stream state values, falling back to an empty object
|
|
51
|
+
* when no stream values are available.
|
|
52
|
+
*/
|
|
53
|
+
get values(): StateType;
|
|
54
|
+
/**
|
|
55
|
+
* The raw stream state values, or `null` if no stream has been started
|
|
56
|
+
* or values have not yet been received.
|
|
57
|
+
*/
|
|
58
|
+
get streamValues(): StateType | null;
|
|
59
|
+
/** The most recent stream error, or `undefined` if no error occurred. */
|
|
60
|
+
get error(): unknown;
|
|
61
|
+
/** Whether a stream is currently in progress. */
|
|
62
|
+
get isLoading(): boolean;
|
|
63
|
+
/** The current branch identifier. */
|
|
64
|
+
get branch(): string;
|
|
65
|
+
/**
|
|
66
|
+
* Update the current branch and notify listeners.
|
|
67
|
+
*
|
|
68
|
+
* @param value - The new branch identifier.
|
|
69
|
+
*/
|
|
70
|
+
setBranch(value: string): void;
|
|
71
|
+
/**
|
|
72
|
+
* All messages from the current stream values, converted to
|
|
73
|
+
* {@link BaseMessage} instances. Returns an empty array when no
|
|
74
|
+
* stream values are available.
|
|
75
|
+
*/
|
|
76
|
+
get messages(): BaseMessage[];
|
|
77
|
+
/**
|
|
78
|
+
* All tool calls paired with their results extracted from the
|
|
79
|
+
* current stream messages.
|
|
80
|
+
*/
|
|
81
|
+
get toolCalls(): ToolCallWithResult<DefaultToolCall>[];
|
|
82
|
+
/**
|
|
83
|
+
* Get tool calls (with results) that belong to a specific AI message.
|
|
84
|
+
*
|
|
85
|
+
* @param message - The AI message whose tool calls to retrieve.
|
|
86
|
+
* @returns Tool calls associated with the given message.
|
|
87
|
+
*/
|
|
88
|
+
getToolCalls(message: Message): ToolCallWithResult<DefaultToolCall>[];
|
|
89
|
+
/**
|
|
90
|
+
* All active interrupts from the current stream values.
|
|
91
|
+
* Returns a single breakpoint interrupt when the interrupt array is
|
|
92
|
+
* present but empty, or an empty array when no interrupts exist.
|
|
93
|
+
*/
|
|
94
|
+
get interrupts(): Interrupt<GetInterruptType<Bag>>[];
|
|
95
|
+
/**
|
|
96
|
+
* The first active interrupt extracted from the current stream values,
|
|
97
|
+
* or `undefined` if there are no interrupts.
|
|
98
|
+
*/
|
|
99
|
+
get interrupt(): Interrupt<GetInterruptType<Bag>> | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Retrieve stream-level metadata for a given message.
|
|
102
|
+
*
|
|
103
|
+
* @param message - The message to look up metadata for.
|
|
104
|
+
* @param index - Optional positional index used as fallback message ID.
|
|
105
|
+
* @returns The metadata associated with the message, or `undefined`
|
|
106
|
+
* if no stream metadata is available.
|
|
107
|
+
*/
|
|
108
|
+
getMessagesMetadata(message: Message, index?: number): MessageMetadata<StateType> | undefined;
|
|
109
|
+
/** A map of all tracked subagent streams, keyed by tool call ID. */
|
|
110
|
+
get subagents(): Map<string, SubagentStreamInterface>;
|
|
111
|
+
/** The subset of subagent streams that are currently active (loading). */
|
|
112
|
+
get activeSubagents(): SubagentStreamInterface[];
|
|
113
|
+
/**
|
|
114
|
+
* Look up a single subagent stream by its tool call ID.
|
|
115
|
+
*
|
|
116
|
+
* @param toolCallId - The tool call ID that initiated the subagent.
|
|
117
|
+
* @returns The subagent stream, or `undefined` if not found.
|
|
118
|
+
*/
|
|
119
|
+
getSubagent(toolCallId: string): SubagentStreamInterface<Record<string, unknown>, DefaultToolCall, string> | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Retrieve all subagent streams matching a given tool name / type.
|
|
122
|
+
*
|
|
123
|
+
* @param type - The subagent type (tool name) to filter by.
|
|
124
|
+
* @returns An array of matching subagent streams.
|
|
125
|
+
*/
|
|
126
|
+
getSubagentsByType(type: string): SubagentStreamInterface<Record<string, unknown>, DefaultToolCall, string>[];
|
|
127
|
+
/**
|
|
128
|
+
* Retrieve all subagent streams associated with a specific AI message.
|
|
129
|
+
*
|
|
130
|
+
* @param messageId - The ID of the parent AI message.
|
|
131
|
+
* @returns An array of subagent streams linked to the message.
|
|
132
|
+
*/
|
|
133
|
+
getSubagentsByMessage(messageId: string): SubagentStreamInterface<Record<string, unknown>, DefaultToolCall, string>[];
|
|
134
|
+
/**
|
|
135
|
+
* Reconstruct subagent streams from history values when subagent
|
|
136
|
+
* filtering is enabled and the stream is not currently loading.
|
|
137
|
+
* This is a no-op if subagents are already populated.
|
|
138
|
+
*/
|
|
139
|
+
reconstructSubagentsIfNeeded(): void;
|
|
140
|
+
/**
|
|
141
|
+
* Abort the current stream and invoke the `onStop` callback
|
|
142
|
+
* if one was provided in the options.
|
|
143
|
+
*/
|
|
144
|
+
stop(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Switch to a different thread. If the thread ID actually changed,
|
|
147
|
+
* the current stream is cleared and listeners are notified.
|
|
148
|
+
*
|
|
149
|
+
* @param newThreadId - The thread ID to switch to, or `null` to clear.
|
|
150
|
+
*/
|
|
151
|
+
switchThread(newThreadId: string | null): void;
|
|
152
|
+
/**
|
|
153
|
+
* Start a new stream run against the custom transport.
|
|
154
|
+
*
|
|
155
|
+
* This is the low-level submit entry point that handles thread ID
|
|
156
|
+
* resolution, optimistic value merging, and transport invocation.
|
|
157
|
+
* Prefer {@link submit} unless you need to bypass higher-level wrappers.
|
|
158
|
+
*
|
|
159
|
+
* @param values - The input values to send, or `null`/`undefined` for
|
|
160
|
+
* a resume-style invocation.
|
|
161
|
+
* @param submitOptions - Optional per-call overrides such as
|
|
162
|
+
* `optimisticValues`, `config`, `command`, and error callbacks.
|
|
163
|
+
*/
|
|
164
|
+
submitDirect(values: GetUpdateType<Bag, StateType> | null | undefined, submitOptions?: CustomSubmitOptions<StateType, GetConfigurableType<Bag>>): Promise<void>;
|
|
165
|
+
/**
|
|
166
|
+
* Submit input values and start a new stream run.
|
|
167
|
+
*
|
|
168
|
+
* Delegates to {@link submitDirect}. Override or wrap this method
|
|
169
|
+
* in framework adapters to add queuing or other middleware.
|
|
170
|
+
*
|
|
171
|
+
* @param values - The input values to send, or `null`/`undefined` for
|
|
172
|
+
* a resume-style invocation.
|
|
173
|
+
* @param submitOptions - Optional per-call overrides.
|
|
174
|
+
*/
|
|
175
|
+
submit(values: GetUpdateType<Bag, StateType> | null | undefined, submitOptions?: CustomSubmitOptions<StateType, GetConfigurableType<Bag>>): Promise<void>;
|
|
176
|
+
/**
|
|
177
|
+
* Tear down the orchestrator. Marks the instance as disposed,
|
|
178
|
+
* unsubscribes from the stream, and aborts any in-progress stream.
|
|
179
|
+
* After calling this method, no further notifications will be emitted.
|
|
180
|
+
*/
|
|
181
|
+
dispose(): void;
|
|
182
|
+
}
|
|
183
|
+
//#endregion
|
|
184
|
+
export { CustomStreamOrchestrator };
|
|
185
|
+
//# sourceMappingURL=orchestrator-custom.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator-custom.d.cts","names":[],"sources":["../../src/ui/orchestrator-custom.ts"],"mappings":";;;;;;;;;;;AAuDA;;;;cAAa,wBAAA,mBACO,MAAA,oBAA0B,MAAA,+BAChC,WAAA,GAAc,WAAA;EAAA;WAEjB,MAAA,EAAQ,aAAA,CAAc,SAAA,EAAW,G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A,mBAAA,eAAA;EApBvC;;;;;EA6BA,4BAAA,CAAA;EAnBmB;;;;EAkCnB,IAAA,CAAA;EAxBsB;;;;;;EAoCtB,YAAA,CAAa,WAAA;EAAA;;;;;;;;;;;;EAoBP,YAAA,CACJ,MAAA,EAAQ,aAAA,CAAc,GAAA,EAAK,SAAA,sBAC3B,aAAA,GAAgB,mBAAA,CAAoB,SAAA,EAAW,mBAAA,CAAoB,GAAA,KAClE,OAAA;EAyFO;;;;;;;;;;EADJ,MAAA,CACJ,MAAA,EAAQ,aAAA,CAAc,GAAA,EAAK,SAAA,sBAC3B,aAAA,GAAgB,mBAAA,CAAoB,SAAA,EAAW,mBAAA,CAAoB,GAAA,KAClE,OAAA;EASI;;;;;EAAP,OAAA,CAAA;AAAA"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { Interrupt } from "../schema.js";
|
|
2
|
+
import { DefaultToolCall, Message, ToolCallWithResult } from "../types.messages.js";
|
|
3
|
+
import { BagTemplate } from "../types.template.js";
|
|
4
|
+
import { AnyStreamCustomOptions, CustomSubmitOptions, GetConfigurableType, GetInterruptType, GetUpdateType, MessageMetadata, SubagentStreamInterface } from "./types.js";
|
|
5
|
+
import { MessageTupleManager } from "./messages.js";
|
|
6
|
+
import { StreamManager } from "./manager.js";
|
|
7
|
+
import { BaseMessage } from "@langchain/core/messages";
|
|
8
|
+
|
|
9
|
+
//#region src/ui/orchestrator-custom.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* Framework-agnostic orchestrator for custom transport streams.
|
|
12
|
+
*
|
|
13
|
+
* Encapsulates all business logic shared across React, Vue, Svelte, and Angular
|
|
14
|
+
* for custom transport (non-LGP) streaming.
|
|
15
|
+
*/
|
|
16
|
+
declare class CustomStreamOrchestrator<StateType extends Record<string, unknown> = Record<string, unknown>, Bag extends BagTemplate = BagTemplate> {
|
|
17
|
+
#private;
|
|
18
|
+
readonly stream: StreamManager<StateType, Bag>;
|
|
19
|
+
readonly messageManager: MessageTupleManager;
|
|
20
|
+
/**
|
|
21
|
+
* Create a new {@link CustomStreamOrchestrator} instance.
|
|
22
|
+
*
|
|
23
|
+
* @param options - Configuration options for the custom transport stream,
|
|
24
|
+
* including thread ID, transport, callbacks, and subagent settings.
|
|
25
|
+
*/
|
|
26
|
+
constructor(options: AnyStreamCustomOptions<StateType, Bag>);
|
|
27
|
+
/**
|
|
28
|
+
* Register a listener that is called whenever the orchestrator state changes.
|
|
29
|
+
*
|
|
30
|
+
* @param listener - Callback invoked on each state change.
|
|
31
|
+
* @returns An unsubscribe function that removes the listener.
|
|
32
|
+
*/
|
|
33
|
+
subscribe: (listener: () => void) => () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Return the current version number, incremented on each state change.
|
|
36
|
+
* Useful as a cache key for external sync (e.g. `useSyncExternalStore`).
|
|
37
|
+
*
|
|
38
|
+
* @returns The current version counter.
|
|
39
|
+
*/
|
|
40
|
+
getSnapshot: () => number;
|
|
41
|
+
/**
|
|
42
|
+
* Synchronize the external thread ID with the orchestrator.
|
|
43
|
+
* If the ID has changed, the current stream is cleared and listeners
|
|
44
|
+
* are notified.
|
|
45
|
+
*
|
|
46
|
+
* @param newId - The new thread ID, or `null` to clear.
|
|
47
|
+
*/
|
|
48
|
+
syncThreadId(newId: string | null): void;
|
|
49
|
+
/**
|
|
50
|
+
* The current stream state values, falling back to an empty object
|
|
51
|
+
* when no stream values are available.
|
|
52
|
+
*/
|
|
53
|
+
get values(): StateType;
|
|
54
|
+
/**
|
|
55
|
+
* The raw stream state values, or `null` if no stream has been started
|
|
56
|
+
* or values have not yet been received.
|
|
57
|
+
*/
|
|
58
|
+
get streamValues(): StateType | null;
|
|
59
|
+
/** The most recent stream error, or `undefined` if no error occurred. */
|
|
60
|
+
get error(): unknown;
|
|
61
|
+
/** Whether a stream is currently in progress. */
|
|
62
|
+
get isLoading(): boolean;
|
|
63
|
+
/** The current branch identifier. */
|
|
64
|
+
get branch(): string;
|
|
65
|
+
/**
|
|
66
|
+
* Update the current branch and notify listeners.
|
|
67
|
+
*
|
|
68
|
+
* @param value - The new branch identifier.
|
|
69
|
+
*/
|
|
70
|
+
setBranch(value: string): void;
|
|
71
|
+
/**
|
|
72
|
+
* All messages from the current stream values, converted to
|
|
73
|
+
* {@link BaseMessage} instances. Returns an empty array when no
|
|
74
|
+
* stream values are available.
|
|
75
|
+
*/
|
|
76
|
+
get messages(): BaseMessage[];
|
|
77
|
+
/**
|
|
78
|
+
* All tool calls paired with their results extracted from the
|
|
79
|
+
* current stream messages.
|
|
80
|
+
*/
|
|
81
|
+
get toolCalls(): ToolCallWithResult<DefaultToolCall>[];
|
|
82
|
+
/**
|
|
83
|
+
* Get tool calls (with results) that belong to a specific AI message.
|
|
84
|
+
*
|
|
85
|
+
* @param message - The AI message whose tool calls to retrieve.
|
|
86
|
+
* @returns Tool calls associated with the given message.
|
|
87
|
+
*/
|
|
88
|
+
getToolCalls(message: Message): ToolCallWithResult<DefaultToolCall>[];
|
|
89
|
+
/**
|
|
90
|
+
* All active interrupts from the current stream values.
|
|
91
|
+
* Returns a single breakpoint interrupt when the interrupt array is
|
|
92
|
+
* present but empty, or an empty array when no interrupts exist.
|
|
93
|
+
*/
|
|
94
|
+
get interrupts(): Interrupt<GetInterruptType<Bag>>[];
|
|
95
|
+
/**
|
|
96
|
+
* The first active interrupt extracted from the current stream values,
|
|
97
|
+
* or `undefined` if there are no interrupts.
|
|
98
|
+
*/
|
|
99
|
+
get interrupt(): Interrupt<GetInterruptType<Bag>> | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Retrieve stream-level metadata for a given message.
|
|
102
|
+
*
|
|
103
|
+
* @param message - The message to look up metadata for.
|
|
104
|
+
* @param index - Optional positional index used as fallback message ID.
|
|
105
|
+
* @returns The metadata associated with the message, or `undefined`
|
|
106
|
+
* if no stream metadata is available.
|
|
107
|
+
*/
|
|
108
|
+
getMessagesMetadata(message: Message, index?: number): MessageMetadata<StateType> | undefined;
|
|
109
|
+
/** A map of all tracked subagent streams, keyed by tool call ID. */
|
|
110
|
+
get subagents(): Map<string, SubagentStreamInterface>;
|
|
111
|
+
/** The subset of subagent streams that are currently active (loading). */
|
|
112
|
+
get activeSubagents(): SubagentStreamInterface[];
|
|
113
|
+
/**
|
|
114
|
+
* Look up a single subagent stream by its tool call ID.
|
|
115
|
+
*
|
|
116
|
+
* @param toolCallId - The tool call ID that initiated the subagent.
|
|
117
|
+
* @returns The subagent stream, or `undefined` if not found.
|
|
118
|
+
*/
|
|
119
|
+
getSubagent(toolCallId: string): SubagentStreamInterface<Record<string, unknown>, DefaultToolCall, string> | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Retrieve all subagent streams matching a given tool name / type.
|
|
122
|
+
*
|
|
123
|
+
* @param type - The subagent type (tool name) to filter by.
|
|
124
|
+
* @returns An array of matching subagent streams.
|
|
125
|
+
*/
|
|
126
|
+
getSubagentsByType(type: string): SubagentStreamInterface<Record<string, unknown>, DefaultToolCall, string>[];
|
|
127
|
+
/**
|
|
128
|
+
* Retrieve all subagent streams associated with a specific AI message.
|
|
129
|
+
*
|
|
130
|
+
* @param messageId - The ID of the parent AI message.
|
|
131
|
+
* @returns An array of subagent streams linked to the message.
|
|
132
|
+
*/
|
|
133
|
+
getSubagentsByMessage(messageId: string): SubagentStreamInterface<Record<string, unknown>, DefaultToolCall, string>[];
|
|
134
|
+
/**
|
|
135
|
+
* Reconstruct subagent streams from history values when subagent
|
|
136
|
+
* filtering is enabled and the stream is not currently loading.
|
|
137
|
+
* This is a no-op if subagents are already populated.
|
|
138
|
+
*/
|
|
139
|
+
reconstructSubagentsIfNeeded(): void;
|
|
140
|
+
/**
|
|
141
|
+
* Abort the current stream and invoke the `onStop` callback
|
|
142
|
+
* if one was provided in the options.
|
|
143
|
+
*/
|
|
144
|
+
stop(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Switch to a different thread. If the thread ID actually changed,
|
|
147
|
+
* the current stream is cleared and listeners are notified.
|
|
148
|
+
*
|
|
149
|
+
* @param newThreadId - The thread ID to switch to, or `null` to clear.
|
|
150
|
+
*/
|
|
151
|
+
switchThread(newThreadId: string | null): void;
|
|
152
|
+
/**
|
|
153
|
+
* Start a new stream run against the custom transport.
|
|
154
|
+
*
|
|
155
|
+
* This is the low-level submit entry point that handles thread ID
|
|
156
|
+
* resolution, optimistic value merging, and transport invocation.
|
|
157
|
+
* Prefer {@link submit} unless you need to bypass higher-level wrappers.
|
|
158
|
+
*
|
|
159
|
+
* @param values - The input values to send, or `null`/`undefined` for
|
|
160
|
+
* a resume-style invocation.
|
|
161
|
+
* @param submitOptions - Optional per-call overrides such as
|
|
162
|
+
* `optimisticValues`, `config`, `command`, and error callbacks.
|
|
163
|
+
*/
|
|
164
|
+
submitDirect(values: GetUpdateType<Bag, StateType> | null | undefined, submitOptions?: CustomSubmitOptions<StateType, GetConfigurableType<Bag>>): Promise<void>;
|
|
165
|
+
/**
|
|
166
|
+
* Submit input values and start a new stream run.
|
|
167
|
+
*
|
|
168
|
+
* Delegates to {@link submitDirect}. Override or wrap this method
|
|
169
|
+
* in framework adapters to add queuing or other middleware.
|
|
170
|
+
*
|
|
171
|
+
* @param values - The input values to send, or `null`/`undefined` for
|
|
172
|
+
* a resume-style invocation.
|
|
173
|
+
* @param submitOptions - Optional per-call overrides.
|
|
174
|
+
*/
|
|
175
|
+
submit(values: GetUpdateType<Bag, StateType> | null | undefined, submitOptions?: CustomSubmitOptions<StateType, GetConfigurableType<Bag>>): Promise<void>;
|
|
176
|
+
/**
|
|
177
|
+
* Tear down the orchestrator. Marks the instance as disposed,
|
|
178
|
+
* unsubscribes from the stream, and aborts any in-progress stream.
|
|
179
|
+
* After calling this method, no further notifications will be emitted.
|
|
180
|
+
*/
|
|
181
|
+
dispose(): void;
|
|
182
|
+
}
|
|
183
|
+
//#endregion
|
|
184
|
+
export { CustomStreamOrchestrator };
|
|
185
|
+
//# sourceMappingURL=orchestrator-custom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"or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