@langchain/langgraph 1.3.6 → 1.4.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/channels/base.cjs +78 -2
- package/dist/channels/base.cjs.map +1 -1
- package/dist/channels/base.d.cts +35 -2
- package/dist/channels/base.d.cts.map +1 -1
- package/dist/channels/base.d.ts +35 -2
- package/dist/channels/base.d.ts.map +1 -1
- package/dist/channels/base.js +77 -4
- package/dist/channels/base.js.map +1 -1
- package/dist/channels/delta.cjs +136 -0
- package/dist/channels/delta.cjs.map +1 -0
- package/dist/channels/delta.d.cts +99 -0
- package/dist/channels/delta.d.cts.map +1 -0
- package/dist/channels/delta.d.ts +99 -0
- package/dist/channels/delta.d.ts.map +1 -0
- package/dist/channels/delta.js +136 -0
- package/dist/channels/delta.js.map +1 -0
- package/dist/channels/index.cjs +5 -0
- package/dist/channels/index.d.cts +3 -2
- package/dist/channels/index.d.ts +3 -2
- package/dist/channels/index.js +3 -2
- package/dist/constants.cjs +62 -4
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +33 -2
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.ts +33 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +59 -5
- package/dist/constants.js.map +1 -1
- package/dist/errors.cjs +128 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +86 -1
- package/dist/errors.d.cts.map +1 -1
- package/dist/errors.d.ts +86 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +123 -1
- package/dist/errors.js.map +1 -1
- package/dist/func/index.cjs +9 -2
- package/dist/func/index.cjs.map +1 -1
- package/dist/func/index.d.cts +14 -0
- package/dist/func/index.d.cts.map +1 -1
- package/dist/func/index.d.ts +14 -0
- package/dist/func/index.d.ts.map +1 -1
- package/dist/func/index.js +9 -2
- package/dist/func/index.js.map +1 -1
- package/dist/graph/graph.cjs +44 -7
- package/dist/graph/graph.cjs.map +1 -1
- package/dist/graph/graph.d.cts +24 -2
- package/dist/graph/graph.d.cts.map +1 -1
- package/dist/graph/graph.d.ts +24 -2
- package/dist/graph/graph.d.ts.map +1 -1
- package/dist/graph/graph.js +44 -7
- package/dist/graph/graph.js.map +1 -1
- package/dist/graph/index.d.ts +3 -3
- package/dist/graph/messages_reducer.cjs +55 -0
- package/dist/graph/messages_reducer.cjs.map +1 -1
- package/dist/graph/messages_reducer.d.cts +28 -1
- package/dist/graph/messages_reducer.d.cts.map +1 -1
- package/dist/graph/messages_reducer.d.ts +28 -1
- package/dist/graph/messages_reducer.d.ts.map +1 -1
- package/dist/graph/messages_reducer.js +56 -2
- package/dist/graph/messages_reducer.js.map +1 -1
- package/dist/graph/state.cjs +174 -7
- package/dist/graph/state.cjs.map +1 -1
- package/dist/graph/state.d.cts +193 -17
- package/dist/graph/state.d.cts.map +1 -1
- package/dist/graph/state.d.ts +193 -17
- package/dist/graph/state.d.ts.map +1 -1
- package/dist/graph/state.js +175 -8
- package/dist/graph/state.js.map +1 -1
- package/dist/graph/zod/schema.cjs +5 -0
- package/dist/graph/zod/schema.cjs.map +1 -1
- package/dist/graph/zod/schema.d.cts.map +1 -1
- package/dist/graph/zod/schema.d.ts.map +1 -1
- package/dist/graph/zod/schema.js +5 -0
- package/dist/graph/zod/schema.js.map +1 -1
- package/dist/index.cjs +11 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -8
- package/dist/index.d.ts +11 -8
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/prebuilt/react_agent_executor.d.cts +1 -1
- package/dist/pregel/algo.cjs +182 -21
- package/dist/pregel/algo.cjs.map +1 -1
- package/dist/pregel/algo.d.cts +1 -1
- package/dist/pregel/algo.d.cts.map +1 -1
- package/dist/pregel/algo.d.ts +1 -1
- package/dist/pregel/algo.d.ts.map +1 -1
- package/dist/pregel/algo.js +185 -25
- package/dist/pregel/algo.js.map +1 -1
- package/dist/pregel/call.cjs +2 -1
- package/dist/pregel/call.cjs.map +1 -1
- package/dist/pregel/call.js +2 -1
- package/dist/pregel/call.js.map +1 -1
- package/dist/pregel/index.cjs +15 -3
- package/dist/pregel/index.cjs.map +1 -1
- package/dist/pregel/index.d.cts.map +1 -1
- package/dist/pregel/index.d.ts.map +1 -1
- package/dist/pregel/index.js +17 -5
- package/dist/pregel/index.js.map +1 -1
- package/dist/pregel/loop.cjs +362 -41
- package/dist/pregel/loop.cjs.map +1 -1
- package/dist/pregel/loop.js +365 -44
- package/dist/pregel/loop.js.map +1 -1
- package/dist/pregel/messages-v2.cjs +1 -1
- package/dist/pregel/messages-v2.js +1 -1
- package/dist/pregel/messages.cjs +1 -1
- package/dist/pregel/messages.js +1 -1
- package/dist/pregel/read.cjs +15 -5
- package/dist/pregel/read.cjs.map +1 -1
- package/dist/pregel/read.d.cts +9 -0
- package/dist/pregel/read.d.cts.map +1 -1
- package/dist/pregel/read.d.ts +9 -0
- package/dist/pregel/read.d.ts.map +1 -1
- package/dist/pregel/read.js +15 -5
- package/dist/pregel/read.js.map +1 -1
- package/dist/pregel/remote-run-stream.cjs +107 -0
- package/dist/pregel/remote-run-stream.cjs.map +1 -0
- package/dist/pregel/remote-run-stream.d.cts +33 -0
- package/dist/pregel/remote-run-stream.d.cts.map +1 -0
- package/dist/pregel/remote-run-stream.d.ts +33 -0
- package/dist/pregel/remote-run-stream.d.ts.map +1 -0
- package/dist/pregel/remote-run-stream.js +107 -0
- package/dist/pregel/remote-run-stream.js.map +1 -0
- package/dist/pregel/remote.cjs +61 -1
- package/dist/pregel/remote.cjs.map +1 -1
- package/dist/pregel/remote.d.cts +17 -0
- package/dist/pregel/remote.d.cts.map +1 -1
- package/dist/pregel/remote.d.ts +17 -0
- package/dist/pregel/remote.d.ts.map +1 -1
- package/dist/pregel/remote.js +61 -1
- package/dist/pregel/remote.js.map +1 -1
- package/dist/pregel/replay.cjs +62 -0
- package/dist/pregel/replay.cjs.map +1 -0
- package/dist/pregel/replay.js +62 -0
- package/dist/pregel/replay.js.map +1 -0
- package/dist/pregel/retry.cjs +8 -6
- package/dist/pregel/retry.cjs.map +1 -1
- package/dist/pregel/retry.js +8 -6
- package/dist/pregel/retry.js.map +1 -1
- package/dist/pregel/runnable_types.d.cts +20 -0
- package/dist/pregel/runnable_types.d.cts.map +1 -1
- package/dist/pregel/runnable_types.d.ts +20 -0
- package/dist/pregel/runnable_types.d.ts.map +1 -1
- package/dist/pregel/runner.cjs +48 -7
- package/dist/pregel/runner.cjs.map +1 -1
- package/dist/pregel/runner.js +50 -9
- package/dist/pregel/runner.js.map +1 -1
- package/dist/pregel/runtime.cjs +64 -0
- package/dist/pregel/runtime.cjs.map +1 -0
- package/dist/pregel/runtime.d.cts +57 -0
- package/dist/pregel/runtime.d.cts.map +1 -0
- package/dist/pregel/runtime.d.ts +57 -0
- package/dist/pregel/runtime.d.ts.map +1 -0
- package/dist/pregel/runtime.js +64 -0
- package/dist/pregel/runtime.js.map +1 -0
- package/dist/pregel/stream.cjs +2 -0
- package/dist/pregel/stream.cjs.map +1 -1
- package/dist/pregel/stream.js +2 -0
- package/dist/pregel/stream.js.map +1 -1
- package/dist/pregel/timeout.cjs +216 -0
- package/dist/pregel/timeout.cjs.map +1 -0
- package/dist/pregel/timeout.js +216 -0
- package/dist/pregel/timeout.js.map +1 -0
- package/dist/pregel/types.cjs +3 -1
- package/dist/pregel/types.cjs.map +1 -1
- package/dist/pregel/types.d.cts +13 -0
- package/dist/pregel/types.d.cts.map +1 -1
- package/dist/pregel/types.d.ts +14 -1
- package/dist/pregel/types.d.ts.map +1 -1
- package/dist/pregel/types.js +3 -1
- package/dist/pregel/types.js.map +1 -1
- package/dist/pregel/utils/config.cjs +3 -1
- package/dist/pregel/utils/config.cjs.map +1 -1
- package/dist/pregel/utils/config.d.cts.map +1 -1
- package/dist/pregel/utils/config.d.ts.map +1 -1
- package/dist/pregel/utils/config.js +3 -1
- package/dist/pregel/utils/config.js.map +1 -1
- package/dist/pregel/utils/index.cjs +1 -0
- package/dist/pregel/utils/index.cjs.map +1 -1
- package/dist/pregel/utils/index.d.cts +6 -1
- package/dist/pregel/utils/index.d.cts.map +1 -1
- package/dist/pregel/utils/index.d.ts +6 -1
- package/dist/pregel/utils/index.d.ts.map +1 -1
- package/dist/pregel/utils/index.js +1 -0
- package/dist/pregel/utils/index.js.map +1 -1
- package/dist/pregel/utils/timeout.cjs +34 -0
- package/dist/pregel/utils/timeout.cjs.map +1 -0
- package/dist/pregel/utils/timeout.d.cts +45 -0
- package/dist/pregel/utils/timeout.d.cts.map +1 -0
- package/dist/pregel/utils/timeout.d.ts +45 -0
- package/dist/pregel/utils/timeout.d.ts.map +1 -0
- package/dist/pregel/utils/timeout.js +34 -0
- package/dist/pregel/utils/timeout.js.map +1 -0
- package/dist/stream/index.cjs +1 -0
- package/dist/stream/index.d.cts +2 -1
- package/dist/stream/index.d.ts +2 -1
- package/dist/stream/index.js +1 -0
- package/dist/stream/stream-channel.d.cts +9 -1
- package/dist/stream/stream-channel.d.cts.map +1 -1
- package/dist/stream/stream-channel.d.ts +9 -1
- package/dist/stream/stream-channel.d.ts.map +1 -1
- package/dist/stream/subscription.cjs +136 -0
- package/dist/stream/subscription.cjs.map +1 -0
- package/dist/stream/subscription.d.cts +94 -0
- package/dist/stream/subscription.d.cts.map +1 -0
- package/dist/stream/subscription.d.ts +94 -0
- package/dist/stream/subscription.d.ts.map +1 -0
- package/dist/stream/subscription.js +131 -0
- package/dist/stream/subscription.js.map +1 -0
- package/dist/stream/types.d.cts +1 -1
- package/dist/stream/types.d.ts +1 -1
- package/dist/stream.cjs +16 -0
- package/dist/stream.d.cts +5 -0
- package/dist/stream.d.ts +5 -0
- package/dist/stream.js +4 -0
- package/dist/web.cjs +11 -0
- package/dist/web.d.cts +11 -8
- package/dist/web.d.ts +11 -8
- package/dist/web.js +5 -3
- package/package.json +18 -6
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Namespace } from "./types.cjs";
|
|
2
|
+
import { Channel, SubscribeParams } from "@langchain/protocol";
|
|
3
|
+
|
|
4
|
+
//#region src/stream/subscription.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Minimal protocol-event shape consumed by {@link inferChannel} and
|
|
7
|
+
* {@link matchesSubscription}.
|
|
8
|
+
*
|
|
9
|
+
* Both the core {@link ProtocolEvent} and the wire-level `Event` from
|
|
10
|
+
* `@langchain/protocol` structurally satisfy this contract, so the same
|
|
11
|
+
* predicates can drive in-process fan-out, buffered replay, and server-side
|
|
12
|
+
* (SSE / WebSocket) event-sink filtering without coupling to a single event
|
|
13
|
+
* type.
|
|
14
|
+
*/
|
|
15
|
+
interface MatchableEvent {
|
|
16
|
+
/** Logical stream channel; see {@link inferChannel}. */
|
|
17
|
+
readonly method: string;
|
|
18
|
+
/** Monotonic sequence number, when present. Used by the `since` cursor. */
|
|
19
|
+
readonly seq?: number;
|
|
20
|
+
readonly params: {
|
|
21
|
+
/** Namespace of the node or scope that emitted this event. */readonly namespace: Namespace; /** Opaque channel payload; shape depends on `method`. */
|
|
22
|
+
readonly data?: unknown;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Strip dynamic suffixes (after `:`) from a namespace segment.
|
|
27
|
+
*
|
|
28
|
+
* Server-emitted namespaces contain runtime-generated suffixes like
|
|
29
|
+
* `"fetcher:abc-uuid"`, while user-supplied subscription filters are typically
|
|
30
|
+
* static names (`"fetcher"`). Mirrors `normalize_namespace_segment` in
|
|
31
|
+
* `api/langgraph_api/protocol/namespace.py`.
|
|
32
|
+
*
|
|
33
|
+
* @param segment - Raw namespace segment.
|
|
34
|
+
* @returns The stable graph-oriented portion of the segment.
|
|
35
|
+
*/
|
|
36
|
+
declare function normalizeNamespaceSegment(segment: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Whether `namespace` starts with `prefix`.
|
|
39
|
+
*
|
|
40
|
+
* Segments are compared literally first; if the prefix segment itself contains
|
|
41
|
+
* no `:`, the candidate segment is also compared after its dynamic suffix is
|
|
42
|
+
* stripped (see {@link normalizeNamespaceSegment}). This mirrors
|
|
43
|
+
* `is_prefix_match` in `api/langgraph_api/protocol/namespace.py` so server-side
|
|
44
|
+
* filtering and client-side per-subscription narrowing stay consistent.
|
|
45
|
+
*
|
|
46
|
+
* @param namespace - Event namespace to test.
|
|
47
|
+
* @param prefix - Subscription namespace prefix.
|
|
48
|
+
*/
|
|
49
|
+
declare function isPrefixMatch(namespace: Namespace, prefix: Namespace): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The base protocol subscription channels, excluding the templated
|
|
52
|
+
* `custom:<name>` form. This is the runtime counterpart to the `Channel`
|
|
53
|
+
* union from `@langchain/protocol` and mirrors the channel set a server
|
|
54
|
+
* recognizes when filtering its event sinks.
|
|
55
|
+
*/
|
|
56
|
+
declare const SUPPORTED_CHANNELS: Set<Channel>;
|
|
57
|
+
/**
|
|
58
|
+
* Whether `value` names a protocol subscription channel — either a base
|
|
59
|
+
* channel (`"messages"`, `"values"`, …) or a named custom channel
|
|
60
|
+
* (`"custom:<name>"`). Unknown/future method names return `false`,
|
|
61
|
+
* mirroring {@link inferChannel}.
|
|
62
|
+
*
|
|
63
|
+
* @param value - Candidate channel name.
|
|
64
|
+
*/
|
|
65
|
+
declare function isSupportedChannel(value: string): value is Channel;
|
|
66
|
+
/**
|
|
67
|
+
* Maps a protocol event method to its subscription {@link Channel}.
|
|
68
|
+
*
|
|
69
|
+
* Returns `undefined` for unrecognized methods so that new server-side
|
|
70
|
+
* channels (e.g. from extension transformers) don't break existing
|
|
71
|
+
* subscribers. The `custom` method resolves to the named `custom:<name>`
|
|
72
|
+
* channel when the payload carries a `name`, otherwise the bare `custom`
|
|
73
|
+
* channel. Both `"input"` and the wire-level `"input.requested"` map to the
|
|
74
|
+
* `input` channel.
|
|
75
|
+
*
|
|
76
|
+
* @param event - Event whose method should be mapped to a channel.
|
|
77
|
+
*/
|
|
78
|
+
declare function inferChannel(event: MatchableEvent): Channel | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Returns whether an event should be delivered for a subscription definition.
|
|
81
|
+
*
|
|
82
|
+
* When the definition carries a `since` replay cursor, events at or before
|
|
83
|
+
* that sequence number are excluded — letting the same predicate drive both
|
|
84
|
+
* live fan-out and buffered replay over a {@link StreamChannel}.
|
|
85
|
+
*
|
|
86
|
+
* @param event - Event being checked for delivery.
|
|
87
|
+
* @param definition - Subscription filter definition to evaluate against.
|
|
88
|
+
* The optional `since` field (a `seq` cursor) is read leniently because it
|
|
89
|
+
* is not a declared field on the base {@link SubscribeParams} shape.
|
|
90
|
+
*/
|
|
91
|
+
declare function matchesSubscription(event: MatchableEvent, definition: SubscribeParams): boolean;
|
|
92
|
+
//#endregion
|
|
93
|
+
export { MatchableEvent, SUPPORTED_CHANNELS, inferChannel, isPrefixMatch, isSupportedChannel, matchesSubscription, normalizeNamespaceSegment };
|
|
94
|
+
//# sourceMappingURL=subscription.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.d.cts","names":[],"sources":["../../src/stream/subscription.ts"],"mappings":";;;;;AAsDA;;;;;AAiBA;;;;UA5CiB,cAAA;EA6Cf;EAAA,SA3CS,MAAA;EA4CT;EAAA,SAzCS,GAAA;EAAA,SAEA,MAAA;IA2EE,uEAzEA,SAAA,EAAW,SAAA,EAyEO;IAAA,SAtElB,IAAA;EAAA;AAAA;;;;;;;;;AA4Gb;;;iBA7FgB,yBAAA,CAA0B,OAAA;;;;;;AAqI1C;;;;;;;iBApHgB,aAAA,CACd,SAAA,EAAW,SAAA,EACX,MAAA,EAAQ,SAAA;;;;;;;cAoCG,kBAAA,EAAkB,GAAA,CAAA,OAAA;;;;;;;;;iBAoBf,kBAAA,CAAmB,KAAA,WAAgB,KAAA,IAAS,OAAA;;;;;;;;;;;;;iBAkB5C,YAAA,CAAa,KAAA,EAAO,cAAA,GAAiB,OAAA;;;;;;;;;;;;;iBAwCrC,mBAAA,CACd,KAAA,EAAO,cAAA,EACP,UAAA,EAAY,eAAA"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Namespace } from "./types.js";
|
|
2
|
+
import { Channel, SubscribeParams } from "@langchain/protocol";
|
|
3
|
+
|
|
4
|
+
//#region src/stream/subscription.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Minimal protocol-event shape consumed by {@link inferChannel} and
|
|
7
|
+
* {@link matchesSubscription}.
|
|
8
|
+
*
|
|
9
|
+
* Both the core {@link ProtocolEvent} and the wire-level `Event` from
|
|
10
|
+
* `@langchain/protocol` structurally satisfy this contract, so the same
|
|
11
|
+
* predicates can drive in-process fan-out, buffered replay, and server-side
|
|
12
|
+
* (SSE / WebSocket) event-sink filtering without coupling to a single event
|
|
13
|
+
* type.
|
|
14
|
+
*/
|
|
15
|
+
interface MatchableEvent {
|
|
16
|
+
/** Logical stream channel; see {@link inferChannel}. */
|
|
17
|
+
readonly method: string;
|
|
18
|
+
/** Monotonic sequence number, when present. Used by the `since` cursor. */
|
|
19
|
+
readonly seq?: number;
|
|
20
|
+
readonly params: {
|
|
21
|
+
/** Namespace of the node or scope that emitted this event. */readonly namespace: Namespace; /** Opaque channel payload; shape depends on `method`. */
|
|
22
|
+
readonly data?: unknown;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Strip dynamic suffixes (after `:`) from a namespace segment.
|
|
27
|
+
*
|
|
28
|
+
* Server-emitted namespaces contain runtime-generated suffixes like
|
|
29
|
+
* `"fetcher:abc-uuid"`, while user-supplied subscription filters are typically
|
|
30
|
+
* static names (`"fetcher"`). Mirrors `normalize_namespace_segment` in
|
|
31
|
+
* `api/langgraph_api/protocol/namespace.py`.
|
|
32
|
+
*
|
|
33
|
+
* @param segment - Raw namespace segment.
|
|
34
|
+
* @returns The stable graph-oriented portion of the segment.
|
|
35
|
+
*/
|
|
36
|
+
declare function normalizeNamespaceSegment(segment: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Whether `namespace` starts with `prefix`.
|
|
39
|
+
*
|
|
40
|
+
* Segments are compared literally first; if the prefix segment itself contains
|
|
41
|
+
* no `:`, the candidate segment is also compared after its dynamic suffix is
|
|
42
|
+
* stripped (see {@link normalizeNamespaceSegment}). This mirrors
|
|
43
|
+
* `is_prefix_match` in `api/langgraph_api/protocol/namespace.py` so server-side
|
|
44
|
+
* filtering and client-side per-subscription narrowing stay consistent.
|
|
45
|
+
*
|
|
46
|
+
* @param namespace - Event namespace to test.
|
|
47
|
+
* @param prefix - Subscription namespace prefix.
|
|
48
|
+
*/
|
|
49
|
+
declare function isPrefixMatch(namespace: Namespace, prefix: Namespace): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The base protocol subscription channels, excluding the templated
|
|
52
|
+
* `custom:<name>` form. This is the runtime counterpart to the `Channel`
|
|
53
|
+
* union from `@langchain/protocol` and mirrors the channel set a server
|
|
54
|
+
* recognizes when filtering its event sinks.
|
|
55
|
+
*/
|
|
56
|
+
declare const SUPPORTED_CHANNELS: Set<Channel>;
|
|
57
|
+
/**
|
|
58
|
+
* Whether `value` names a protocol subscription channel — either a base
|
|
59
|
+
* channel (`"messages"`, `"values"`, …) or a named custom channel
|
|
60
|
+
* (`"custom:<name>"`). Unknown/future method names return `false`,
|
|
61
|
+
* mirroring {@link inferChannel}.
|
|
62
|
+
*
|
|
63
|
+
* @param value - Candidate channel name.
|
|
64
|
+
*/
|
|
65
|
+
declare function isSupportedChannel(value: string): value is Channel;
|
|
66
|
+
/**
|
|
67
|
+
* Maps a protocol event method to its subscription {@link Channel}.
|
|
68
|
+
*
|
|
69
|
+
* Returns `undefined` for unrecognized methods so that new server-side
|
|
70
|
+
* channels (e.g. from extension transformers) don't break existing
|
|
71
|
+
* subscribers. The `custom` method resolves to the named `custom:<name>`
|
|
72
|
+
* channel when the payload carries a `name`, otherwise the bare `custom`
|
|
73
|
+
* channel. Both `"input"` and the wire-level `"input.requested"` map to the
|
|
74
|
+
* `input` channel.
|
|
75
|
+
*
|
|
76
|
+
* @param event - Event whose method should be mapped to a channel.
|
|
77
|
+
*/
|
|
78
|
+
declare function inferChannel(event: MatchableEvent): Channel | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Returns whether an event should be delivered for a subscription definition.
|
|
81
|
+
*
|
|
82
|
+
* When the definition carries a `since` replay cursor, events at or before
|
|
83
|
+
* that sequence number are excluded — letting the same predicate drive both
|
|
84
|
+
* live fan-out and buffered replay over a {@link StreamChannel}.
|
|
85
|
+
*
|
|
86
|
+
* @param event - Event being checked for delivery.
|
|
87
|
+
* @param definition - Subscription filter definition to evaluate against.
|
|
88
|
+
* The optional `since` field (a `seq` cursor) is read leniently because it
|
|
89
|
+
* is not a declared field on the base {@link SubscribeParams} shape.
|
|
90
|
+
*/
|
|
91
|
+
declare function matchesSubscription(event: MatchableEvent, definition: SubscribeParams): boolean;
|
|
92
|
+
//#endregion
|
|
93
|
+
export { MatchableEvent, SUPPORTED_CHANNELS, inferChannel, isPrefixMatch, isSupportedChannel, matchesSubscription, normalizeNamespaceSegment };
|
|
94
|
+
//# sourceMappingURL=subscription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.d.ts","names":[],"sources":["../../src/stream/subscription.ts"],"mappings":";;;;;AAsDA;;;;;AAiBA;;;;UA5CiB,cAAA;EA6Cf;EAAA,SA3CS,MAAA;EA4CT;EAAA,SAzCS,GAAA;EAAA,SAEA,MAAA;IA2EE,uEAzEA,SAAA,EAAW,SAAA,EAyEO;IAAA,SAtElB,IAAA;EAAA;AAAA;;;;;;;;;AA4Gb;;;iBA7FgB,yBAAA,CAA0B,OAAA;;;;;;AAqI1C;;;;;;;iBApHgB,aAAA,CACd,SAAA,EAAW,SAAA,EACX,MAAA,EAAQ,SAAA;;;;;;;cAoCG,kBAAA,EAAkB,GAAA,CAAA,OAAA;;;;;;;;;iBAoBf,kBAAA,CAAmB,KAAA,WAAgB,KAAA,IAAS,OAAA;;;;;;;;;;;;;iBAkB5C,YAAA,CAAa,KAAA,EAAO,cAAA,GAAiB,OAAA;;;;;;;;;;;;;iBAwCrC,mBAAA,CACd,KAAA,EAAO,cAAA,EACP,UAAA,EAAY,eAAA"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
//#region src/stream/subscription.ts
|
|
2
|
+
/**
|
|
3
|
+
* Strip dynamic suffixes (after `:`) from a namespace segment.
|
|
4
|
+
*
|
|
5
|
+
* Server-emitted namespaces contain runtime-generated suffixes like
|
|
6
|
+
* `"fetcher:abc-uuid"`, while user-supplied subscription filters are typically
|
|
7
|
+
* static names (`"fetcher"`). Mirrors `normalize_namespace_segment` in
|
|
8
|
+
* `api/langgraph_api/protocol/namespace.py`.
|
|
9
|
+
*
|
|
10
|
+
* @param segment - Raw namespace segment.
|
|
11
|
+
* @returns The stable graph-oriented portion of the segment.
|
|
12
|
+
*/
|
|
13
|
+
function normalizeNamespaceSegment(segment) {
|
|
14
|
+
const idx = segment.indexOf(":");
|
|
15
|
+
return idx === -1 ? segment : segment.slice(0, idx);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Whether `namespace` starts with `prefix`.
|
|
19
|
+
*
|
|
20
|
+
* Segments are compared literally first; if the prefix segment itself contains
|
|
21
|
+
* no `:`, the candidate segment is also compared after its dynamic suffix is
|
|
22
|
+
* stripped (see {@link normalizeNamespaceSegment}). This mirrors
|
|
23
|
+
* `is_prefix_match` in `api/langgraph_api/protocol/namespace.py` so server-side
|
|
24
|
+
* filtering and client-side per-subscription narrowing stay consistent.
|
|
25
|
+
*
|
|
26
|
+
* @param namespace - Event namespace to test.
|
|
27
|
+
* @param prefix - Subscription namespace prefix.
|
|
28
|
+
*/
|
|
29
|
+
function isPrefixMatch(namespace, prefix) {
|
|
30
|
+
if (prefix.length > namespace.length) return false;
|
|
31
|
+
for (let i = 0; i < prefix.length; i += 1) {
|
|
32
|
+
const segment = prefix[i];
|
|
33
|
+
const candidate = namespace[i];
|
|
34
|
+
if (candidate === segment) continue;
|
|
35
|
+
if (segment.includes(":")) return false;
|
|
36
|
+
if (normalizeNamespaceSegment(candidate) === segment) continue;
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
function namespaceMatches(eventNamespace, prefixes, depth) {
|
|
42
|
+
if (!prefixes || prefixes.length === 0) return true;
|
|
43
|
+
return prefixes.some((prefix) => {
|
|
44
|
+
if (!isPrefixMatch(eventNamespace, prefix)) return false;
|
|
45
|
+
if (depth === void 0) return true;
|
|
46
|
+
return eventNamespace.length - prefix.length <= depth;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The base protocol subscription channels, excluding the templated
|
|
51
|
+
* `custom:<name>` form. This is the runtime counterpart to the `Channel`
|
|
52
|
+
* union from `@langchain/protocol` and mirrors the channel set a server
|
|
53
|
+
* recognizes when filtering its event sinks.
|
|
54
|
+
*/
|
|
55
|
+
const SUPPORTED_CHANNELS = new Set([
|
|
56
|
+
"values",
|
|
57
|
+
"updates",
|
|
58
|
+
"messages",
|
|
59
|
+
"tools",
|
|
60
|
+
"lifecycle",
|
|
61
|
+
"input",
|
|
62
|
+
"checkpoints",
|
|
63
|
+
"tasks",
|
|
64
|
+
"custom"
|
|
65
|
+
]);
|
|
66
|
+
/**
|
|
67
|
+
* Whether `value` names a protocol subscription channel — either a base
|
|
68
|
+
* channel (`"messages"`, `"values"`, …) or a named custom channel
|
|
69
|
+
* (`"custom:<name>"`). Unknown/future method names return `false`,
|
|
70
|
+
* mirroring {@link inferChannel}.
|
|
71
|
+
*
|
|
72
|
+
* @param value - Candidate channel name.
|
|
73
|
+
*/
|
|
74
|
+
function isSupportedChannel(value) {
|
|
75
|
+
return SUPPORTED_CHANNELS.has(value) || value.startsWith("custom:");
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Maps a protocol event method to its subscription {@link Channel}.
|
|
79
|
+
*
|
|
80
|
+
* Returns `undefined` for unrecognized methods so that new server-side
|
|
81
|
+
* channels (e.g. from extension transformers) don't break existing
|
|
82
|
+
* subscribers. The `custom` method resolves to the named `custom:<name>`
|
|
83
|
+
* channel when the payload carries a `name`, otherwise the bare `custom`
|
|
84
|
+
* channel. Both `"input"` and the wire-level `"input.requested"` map to the
|
|
85
|
+
* `input` channel.
|
|
86
|
+
*
|
|
87
|
+
* @param event - Event whose method should be mapped to a channel.
|
|
88
|
+
*/
|
|
89
|
+
function inferChannel(event) {
|
|
90
|
+
switch (event.method) {
|
|
91
|
+
case "values": return "values";
|
|
92
|
+
case "checkpoints": return "checkpoints";
|
|
93
|
+
case "updates": return "updates";
|
|
94
|
+
case "messages": return "messages";
|
|
95
|
+
case "tools": return "tools";
|
|
96
|
+
case "custom": {
|
|
97
|
+
const data = event.params.data;
|
|
98
|
+
return data?.name != null ? `custom:${data.name}` : "custom";
|
|
99
|
+
}
|
|
100
|
+
case "lifecycle": return "lifecycle";
|
|
101
|
+
case "input":
|
|
102
|
+
case "input.requested": return "input";
|
|
103
|
+
case "tasks": return "tasks";
|
|
104
|
+
default: return;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Returns whether an event should be delivered for a subscription definition.
|
|
109
|
+
*
|
|
110
|
+
* When the definition carries a `since` replay cursor, events at or before
|
|
111
|
+
* that sequence number are excluded — letting the same predicate drive both
|
|
112
|
+
* live fan-out and buffered replay over a {@link StreamChannel}.
|
|
113
|
+
*
|
|
114
|
+
* @param event - Event being checked for delivery.
|
|
115
|
+
* @param definition - Subscription filter definition to evaluate against.
|
|
116
|
+
* The optional `since` field (a `seq` cursor) is read leniently because it
|
|
117
|
+
* is not a declared field on the base {@link SubscribeParams} shape.
|
|
118
|
+
*/
|
|
119
|
+
function matchesSubscription(event, definition) {
|
|
120
|
+
const since = definition.since;
|
|
121
|
+
if (typeof since === "number" && (event.seq ?? 0) <= since) return false;
|
|
122
|
+
const channel = inferChannel(event);
|
|
123
|
+
if (channel === void 0) return false;
|
|
124
|
+
const channels = definition.channels;
|
|
125
|
+
if (!(channels.includes(channel) || channel.startsWith("custom:") && channels.includes("custom"))) return false;
|
|
126
|
+
return namespaceMatches(event.params.namespace, definition.namespaces, definition.depth);
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
export { SUPPORTED_CHANNELS, inferChannel, isPrefixMatch, isSupportedChannel, matchesSubscription, normalizeNamespaceSegment };
|
|
130
|
+
|
|
131
|
+
//# sourceMappingURL=subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.js","names":[],"sources":["../../src/stream/subscription.ts"],"sourcesContent":["/**\n * Subscription matching and channel inference for the v2 streaming protocol.\n *\n * These helpers are the building blocks a custom transport / server needs to\n * fan protocol events out to subscribers: map an event to its logical\n * {@link Channel} ({@link inferChannel}) and decide whether a buffered event\n * should be delivered for a given {@link SubscribeParams} filter\n * ({@link matchesSubscription}). They are typed against the minimal\n * {@link MatchableEvent} shape so the same predicate works on the core\n * {@link ProtocolEvent} produced by {@link convertToProtocolEvent} /\n * {@link StreamChannel} and on the wire-level `Event` from\n * `@langchain/protocol`.\n */\n\nimport type { Channel, SubscribeParams } from \"@langchain/protocol\";\nimport type { Namespace } from \"./types.js\";\n\n/**\n * Minimal protocol-event shape consumed by {@link inferChannel} and\n * {@link matchesSubscription}.\n *\n * Both the core {@link ProtocolEvent} and the wire-level `Event` from\n * `@langchain/protocol` structurally satisfy this contract, so the same\n * predicates can drive in-process fan-out, buffered replay, and server-side\n * (SSE / WebSocket) event-sink filtering without coupling to a single event\n * type.\n */\nexport interface MatchableEvent {\n /** Logical stream channel; see {@link inferChannel}. */\n readonly method: string;\n\n /** Monotonic sequence number, when present. Used by the `since` cursor. */\n readonly seq?: number;\n\n readonly params: {\n /** Namespace of the node or scope that emitted this event. */\n readonly namespace: Namespace;\n\n /** Opaque channel payload; shape depends on `method`. */\n readonly data?: unknown;\n };\n}\n\n/**\n * Strip dynamic suffixes (after `:`) from a namespace segment.\n *\n * Server-emitted namespaces contain runtime-generated suffixes like\n * `\"fetcher:abc-uuid\"`, while user-supplied subscription filters are typically\n * static names (`\"fetcher\"`). Mirrors `normalize_namespace_segment` in\n * `api/langgraph_api/protocol/namespace.py`.\n *\n * @param segment - Raw namespace segment.\n * @returns The stable graph-oriented portion of the segment.\n */\nexport function normalizeNamespaceSegment(segment: string): string {\n const idx = segment.indexOf(\":\");\n return idx === -1 ? segment : segment.slice(0, idx);\n}\n\n/**\n * Whether `namespace` starts with `prefix`.\n *\n * Segments are compared literally first; if the prefix segment itself contains\n * no `:`, the candidate segment is also compared after its dynamic suffix is\n * stripped (see {@link normalizeNamespaceSegment}). This mirrors\n * `is_prefix_match` in `api/langgraph_api/protocol/namespace.py` so server-side\n * filtering and client-side per-subscription narrowing stay consistent.\n *\n * @param namespace - Event namespace to test.\n * @param prefix - Subscription namespace prefix.\n */\nexport function isPrefixMatch(\n namespace: Namespace,\n prefix: Namespace\n): boolean {\n if (prefix.length > namespace.length) return false;\n for (let i = 0; i < prefix.length; i += 1) {\n const segment = prefix[i]!;\n const candidate = namespace[i]!;\n if (candidate === segment) continue;\n if (segment.includes(\":\")) return false;\n if (normalizeNamespaceSegment(candidate) === segment) continue;\n return false;\n }\n return true;\n}\n\nfunction namespaceMatches(\n eventNamespace: Namespace,\n prefixes: Namespace[] | undefined,\n depth: number | undefined\n): boolean {\n if (!prefixes || prefixes.length === 0) {\n return true;\n }\n\n return prefixes.some((prefix) => {\n if (!isPrefixMatch(eventNamespace, prefix)) return false;\n if (depth === undefined) return true;\n return eventNamespace.length - prefix.length <= depth;\n });\n}\n\n/**\n * The base protocol subscription channels, excluding the templated\n * `custom:<name>` form. This is the runtime counterpart to the `Channel`\n * union from `@langchain/protocol` and mirrors the channel set a server\n * recognizes when filtering its event sinks.\n */\nexport const SUPPORTED_CHANNELS = new Set<Channel>([\n \"values\",\n \"updates\",\n \"messages\",\n \"tools\",\n \"lifecycle\",\n \"input\",\n \"checkpoints\",\n \"tasks\",\n \"custom\",\n]);\n\n/**\n * Whether `value` names a protocol subscription channel — either a base\n * channel (`\"messages\"`, `\"values\"`, …) or a named custom channel\n * (`\"custom:<name>\"`). Unknown/future method names return `false`,\n * mirroring {@link inferChannel}.\n *\n * @param value - Candidate channel name.\n */\nexport function isSupportedChannel(value: string): value is Channel {\n return (\n SUPPORTED_CHANNELS.has(value as Channel) || value.startsWith(\"custom:\")\n );\n}\n\n/**\n * Maps a protocol event method to its subscription {@link Channel}.\n *\n * Returns `undefined` for unrecognized methods so that new server-side\n * channels (e.g. from extension transformers) don't break existing\n * subscribers. The `custom` method resolves to the named `custom:<name>`\n * channel when the payload carries a `name`, otherwise the bare `custom`\n * channel. Both `\"input\"` and the wire-level `\"input.requested\"` map to the\n * `input` channel.\n *\n * @param event - Event whose method should be mapped to a channel.\n */\nexport function inferChannel(event: MatchableEvent): Channel | undefined {\n switch (event.method) {\n case \"values\":\n return \"values\";\n case \"checkpoints\":\n return \"checkpoints\";\n case \"updates\":\n return \"updates\";\n case \"messages\":\n return \"messages\";\n case \"tools\":\n return \"tools\";\n case \"custom\": {\n const data = event.params.data as { name?: string } | undefined;\n return data?.name != null ? `custom:${data.name}` : \"custom\";\n }\n case \"lifecycle\":\n return \"lifecycle\";\n case \"input\":\n case \"input.requested\":\n return \"input\";\n case \"tasks\":\n return \"tasks\";\n default:\n return undefined;\n }\n}\n\n/**\n * Returns whether an event should be delivered for a subscription definition.\n *\n * When the definition carries a `since` replay cursor, events at or before\n * that sequence number are excluded — letting the same predicate drive both\n * live fan-out and buffered replay over a {@link StreamChannel}.\n *\n * @param event - Event being checked for delivery.\n * @param definition - Subscription filter definition to evaluate against.\n * The optional `since` field (a `seq` cursor) is read leniently because it\n * is not a declared field on the base {@link SubscribeParams} shape.\n */\nexport function matchesSubscription(\n event: MatchableEvent,\n definition: SubscribeParams\n): boolean {\n const since = (definition as { since?: unknown }).since;\n if (typeof since === \"number\" && (event.seq ?? 0) <= since) {\n return false;\n }\n\n const channel = inferChannel(event);\n if (channel === undefined) return false;\n\n const channels = definition.channels;\n const channelMatched =\n channels.includes(channel) ||\n (channel.startsWith(\"custom:\") && channels.includes(\"custom\"));\n if (!channelMatched) {\n return false;\n }\n\n return namespaceMatches(\n event.params.namespace,\n definition.namespaces,\n definition.depth\n );\n}\n"],"mappings":";;;;;;;;;;;;AAsDA,SAAgB,0BAA0B,SAAyB;CACjE,MAAM,MAAM,QAAQ,QAAQ,IAAI;AAChC,QAAO,QAAQ,KAAK,UAAU,QAAQ,MAAM,GAAG,IAAI;;;;;;;;;;;;;;AAerD,SAAgB,cACd,WACA,QACS;AACT,KAAI,OAAO,SAAS,UAAU,OAAQ,QAAO;AAC7C,MAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK,GAAG;EACzC,MAAM,UAAU,OAAO;EACvB,MAAM,YAAY,UAAU;AAC5B,MAAI,cAAc,QAAS;AAC3B,MAAI,QAAQ,SAAS,IAAI,CAAE,QAAO;AAClC,MAAI,0BAA0B,UAAU,KAAK,QAAS;AACtD,SAAO;;AAET,QAAO;;AAGT,SAAS,iBACP,gBACA,UACA,OACS;AACT,KAAI,CAAC,YAAY,SAAS,WAAW,EACnC,QAAO;AAGT,QAAO,SAAS,MAAM,WAAW;AAC/B,MAAI,CAAC,cAAc,gBAAgB,OAAO,CAAE,QAAO;AACnD,MAAI,UAAU,KAAA,EAAW,QAAO;AAChC,SAAO,eAAe,SAAS,OAAO,UAAU;GAChD;;;;;;;;AASJ,MAAa,qBAAqB,IAAI,IAAa;CACjD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;;;;;;;;;AAUF,SAAgB,mBAAmB,OAAiC;AAClE,QACE,mBAAmB,IAAI,MAAiB,IAAI,MAAM,WAAW,UAAU;;;;;;;;;;;;;;AAgB3E,SAAgB,aAAa,OAA4C;AACvE,SAAQ,MAAM,QAAd;EACE,KAAK,SACH,QAAO;EACT,KAAK,cACH,QAAO;EACT,KAAK,UACH,QAAO;EACT,KAAK,WACH,QAAO;EACT,KAAK,QACH,QAAO;EACT,KAAK,UAAU;GACb,MAAM,OAAO,MAAM,OAAO;AAC1B,UAAO,MAAM,QAAQ,OAAO,UAAU,KAAK,SAAS;;EAEtD,KAAK,YACH,QAAO;EACT,KAAK;EACL,KAAK,kBACH,QAAO;EACT,KAAK,QACH,QAAO;EACT,QACE;;;;;;;;;;;;;;;AAgBN,SAAgB,oBACd,OACA,YACS;CACT,MAAM,QAAS,WAAmC;AAClD,KAAI,OAAO,UAAU,aAAa,MAAM,OAAO,MAAM,MACnD,QAAO;CAGT,MAAM,UAAU,aAAa,MAAM;AACnC,KAAI,YAAY,KAAA,EAAW,QAAO;CAElC,MAAM,WAAW,WAAW;AAI5B,KAAI,EAFF,SAAS,SAAS,QAAQ,IACzB,QAAQ,WAAW,UAAU,IAAI,SAAS,SAAS,SAAS,EAE7D,QAAO;AAGT,QAAO,iBACL,MAAM,OAAO,WACb,WAAW,YACX,WAAW,MACZ"}
|
package/dist/stream/types.d.cts
CHANGED
|
@@ -251,5 +251,5 @@ interface InterruptPayload<TPayload = unknown> {
|
|
|
251
251
|
payload: TPayload;
|
|
252
252
|
}
|
|
253
253
|
//#endregion
|
|
254
|
-
export { type AgentStatus$1 as AgentStatus, ChatModelStream$1 as ChatModelStream, ChatModelStreamHandle, InferExtensions, InterruptPayload, type LifecycleCause, type LifecycleData$1 as LifecycleData, type MessagesEventData, Namespace, NativeStreamTransformer, ProtocolEvent, StreamEmitter, StreamTransformer, ToolCallStatus, ToolCallStream, type ToolsEventData, type UpdatesEventData, type UsageInfo, isNativeTransformer };
|
|
254
|
+
export { type AgentStatus$1 as AgentStatus, ChatModelStream$1 as ChatModelStream, ChatModelStreamHandle, InferExtensions, InterruptPayload, type LifecycleCause, type LifecycleData$1 as LifecycleData, type MessagesEventData, Namespace, NativeStreamTransformer, ProtocolEvent, ProtocolMethod, StreamEmitter, StreamTransformer, ToolCallStatus, ToolCallStream, type ToolsEventData, type UpdatesEventData, type UsageInfo, isNativeTransformer };
|
|
255
255
|
//# sourceMappingURL=types.d.cts.map
|
package/dist/stream/types.d.ts
CHANGED
|
@@ -251,5 +251,5 @@ interface InterruptPayload<TPayload = unknown> {
|
|
|
251
251
|
payload: TPayload;
|
|
252
252
|
}
|
|
253
253
|
//#endregion
|
|
254
|
-
export { type AgentStatus$1 as AgentStatus, ChatModelStream$1 as ChatModelStream, ChatModelStreamHandle, InferExtensions, InterruptPayload, type LifecycleCause, type LifecycleData$1 as LifecycleData, type MessagesEventData, Namespace, NativeStreamTransformer, ProtocolEvent, StreamEmitter, StreamTransformer, ToolCallStatus, ToolCallStream, type ToolsEventData, type UpdatesEventData, type UsageInfo, isNativeTransformer };
|
|
254
|
+
export { type AgentStatus$1 as AgentStatus, ChatModelStream$1 as ChatModelStream, ChatModelStreamHandle, InferExtensions, InterruptPayload, type LifecycleCause, type LifecycleData$1 as LifecycleData, type MessagesEventData, Namespace, NativeStreamTransformer, ProtocolEvent, ProtocolMethod, StreamEmitter, StreamTransformer, ToolCallStatus, ToolCallStream, type ToolsEventData, type UpdatesEventData, type UsageInfo, isNativeTransformer };
|
|
255
255
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/stream.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_convert = require("./stream/convert.cjs");
|
|
3
|
+
const require_stream_channel = require("./stream/stream-channel.cjs");
|
|
4
|
+
const require_subscription = require("./stream/subscription.cjs");
|
|
5
|
+
exports.EventLog = require_stream_channel.StreamChannel;
|
|
6
|
+
exports.STREAM_EVENTS_V3_MODES = require_convert.STREAM_EVENTS_V3_MODES;
|
|
7
|
+
exports.SUPPORTED_CHANNELS = require_subscription.SUPPORTED_CHANNELS;
|
|
8
|
+
exports.StreamChannel = require_stream_channel.StreamChannel;
|
|
9
|
+
exports.convertToProtocolEvent = require_convert.convertToProtocolEvent;
|
|
10
|
+
exports.inferChannel = require_subscription.inferChannel;
|
|
11
|
+
exports.isCheckpointEnvelope = require_convert.isCheckpointEnvelope;
|
|
12
|
+
exports.isPrefixMatch = require_subscription.isPrefixMatch;
|
|
13
|
+
exports.isStreamChannel = require_stream_channel.isStreamChannel;
|
|
14
|
+
exports.isSupportedChannel = require_subscription.isSupportedChannel;
|
|
15
|
+
exports.matchesSubscription = require_subscription.matchesSubscription;
|
|
16
|
+
exports.normalizeNamespaceSegment = require_subscription.normalizeNamespaceSegment;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Namespace, ProtocolEvent, ProtocolMethod } from "./stream/types.cjs";
|
|
2
|
+
import { StreamChannel, isStreamChannel } from "./stream/stream-channel.cjs";
|
|
3
|
+
import { ConvertToProtocolEventOptions, STREAM_EVENTS_V3_MODES, convertToProtocolEvent, isCheckpointEnvelope } from "./stream/convert.cjs";
|
|
4
|
+
import { MatchableEvent, SUPPORTED_CHANNELS, inferChannel, isPrefixMatch, isSupportedChannel, matchesSubscription, normalizeNamespaceSegment } from "./stream/subscription.cjs";
|
|
5
|
+
export { type ConvertToProtocolEventOptions, StreamChannel as EventLog, type MatchableEvent, type Namespace, type ProtocolEvent, type ProtocolMethod, STREAM_EVENTS_V3_MODES, SUPPORTED_CHANNELS, StreamChannel, convertToProtocolEvent, inferChannel, isCheckpointEnvelope, isPrefixMatch, isStreamChannel, isSupportedChannel, matchesSubscription, normalizeNamespaceSegment };
|
package/dist/stream.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Namespace, ProtocolEvent, ProtocolMethod } from "./stream/types.js";
|
|
2
|
+
import { StreamChannel, isStreamChannel } from "./stream/stream-channel.js";
|
|
3
|
+
import { ConvertToProtocolEventOptions, STREAM_EVENTS_V3_MODES, convertToProtocolEvent, isCheckpointEnvelope } from "./stream/convert.js";
|
|
4
|
+
import { MatchableEvent, SUPPORTED_CHANNELS, inferChannel, isPrefixMatch, isSupportedChannel, matchesSubscription, normalizeNamespaceSegment } from "./stream/subscription.js";
|
|
5
|
+
export { type ConvertToProtocolEventOptions, StreamChannel as EventLog, type MatchableEvent, type Namespace, type ProtocolEvent, type ProtocolMethod, STREAM_EVENTS_V3_MODES, SUPPORTED_CHANNELS, StreamChannel, convertToProtocolEvent, inferChannel, isCheckpointEnvelope, isPrefixMatch, isStreamChannel, isSupportedChannel, matchesSubscription, normalizeNamespaceSegment };
|
package/dist/stream.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { STREAM_EVENTS_V3_MODES, convertToProtocolEvent, isCheckpointEnvelope } from "./stream/convert.js";
|
|
2
|
+
import { StreamChannel, isStreamChannel } from "./stream/stream-channel.js";
|
|
3
|
+
import { SUPPORTED_CHANNELS, inferChannel, isPrefixMatch, isSupportedChannel, matchesSubscription, normalizeNamespaceSegment } from "./stream/subscription.js";
|
|
4
|
+
export { StreamChannel as EventLog, STREAM_EVENTS_V3_MODES, SUPPORTED_CHANNELS, StreamChannel, convertToProtocolEvent, inferChannel, isCheckpointEnvelope, isPrefixMatch, isStreamChannel, isSupportedChannel, matchesSubscription, normalizeNamespaceSegment };
|
package/dist/web.cjs
CHANGED
|
@@ -5,6 +5,7 @@ const require_base = require("./channels/base.cjs");
|
|
|
5
5
|
const require_binop = require("./channels/binop.cjs");
|
|
6
6
|
const require_annotation = require("./graph/annotation.cjs");
|
|
7
7
|
const require_config = require("./pregel/utils/config.cjs");
|
|
8
|
+
const require_runtime = require("./pregel/runtime.cjs");
|
|
8
9
|
const require_convert = require("./stream/convert.cjs");
|
|
9
10
|
const require_stream_channel = require("./stream/stream-channel.cjs");
|
|
10
11
|
const require_lifecycle = require("./stream/transformers/lifecycle.cjs");
|
|
@@ -18,6 +19,7 @@ const require_interrupt = require("./interrupt.cjs");
|
|
|
18
19
|
const require_graph = require("./graph/graph.cjs");
|
|
19
20
|
const require_types$1 = require("./state/types.cjs");
|
|
20
21
|
const require_adapter = require("./state/adapter.cjs");
|
|
22
|
+
const require_delta = require("./channels/delta.cjs");
|
|
21
23
|
const require_untracked_value = require("./channels/untracked_value.cjs");
|
|
22
24
|
require("./channels/index.cjs");
|
|
23
25
|
const require_reduced = require("./state/values/reduced.cjs");
|
|
@@ -66,12 +68,14 @@ Object.defineProperty(exports, "ChatModelStreamImpl", {
|
|
|
66
68
|
exports.Command = require_constants.Command;
|
|
67
69
|
exports.CommandInstance = require_constants.CommandInstance;
|
|
68
70
|
exports.CompiledStateGraph = require_state.CompiledStateGraph;
|
|
71
|
+
exports.DeltaChannel = require_delta.DeltaChannel;
|
|
69
72
|
exports.END = require_constants.END;
|
|
70
73
|
exports.EmptyChannelError = require_errors.EmptyChannelError;
|
|
71
74
|
exports.EmptyInputError = require_errors.EmptyInputError;
|
|
72
75
|
exports.EventLog = require_stream_channel.StreamChannel;
|
|
73
76
|
exports.Graph = require_graph.Graph;
|
|
74
77
|
exports.GraphBubbleUp = require_errors.GraphBubbleUp;
|
|
78
|
+
exports.GraphDrained = require_errors.GraphDrained;
|
|
75
79
|
exports.GraphInterrupt = require_errors.GraphInterrupt;
|
|
76
80
|
exports.GraphRecursionError = require_errors.GraphRecursionError;
|
|
77
81
|
exports.GraphRunStream = require_run_stream.GraphRunStream;
|
|
@@ -96,12 +100,15 @@ exports.MessagesValue = require_messages$1.MessagesValue;
|
|
|
96
100
|
exports.MessagesZodMeta = require_messages_annotation.MessagesZodMeta;
|
|
97
101
|
exports.MessagesZodState = require_messages_annotation.MessagesZodState;
|
|
98
102
|
exports.MultipleSubgraphsError = require_errors.MultipleSubgraphsError;
|
|
103
|
+
exports.NodeError = require_errors.NodeError;
|
|
99
104
|
exports.NodeInterrupt = require_errors.NodeInterrupt;
|
|
105
|
+
exports.NodeTimeoutError = require_errors.NodeTimeoutError;
|
|
100
106
|
exports.Overwrite = require_constants.Overwrite;
|
|
101
107
|
exports.ParentCommand = require_errors.ParentCommand;
|
|
102
108
|
exports.REMOVE_ALL_MESSAGES = require_messages_reducer.REMOVE_ALL_MESSAGES;
|
|
103
109
|
exports.ReducedValue = require_reduced.ReducedValue;
|
|
104
110
|
exports.RemoteException = require_errors.RemoteException;
|
|
111
|
+
exports.RunControl = require_runtime.RunControl;
|
|
105
112
|
exports.START = require_constants.START;
|
|
106
113
|
exports.STREAM_EVENTS_V3_MODES = require_convert.STREAM_EVENTS_V3_MODES;
|
|
107
114
|
exports.Send = require_constants.Send;
|
|
@@ -147,12 +154,16 @@ exports.interrupt = require_interrupt.interrupt;
|
|
|
147
154
|
exports.isCheckpointEnvelope = require_convert.isCheckpointEnvelope;
|
|
148
155
|
exports.isCommand = require_constants.isCommand;
|
|
149
156
|
exports.isGraphBubbleUp = require_errors.isGraphBubbleUp;
|
|
157
|
+
exports.isGraphDrained = require_errors.isGraphDrained;
|
|
150
158
|
exports.isGraphInterrupt = require_errors.isGraphInterrupt;
|
|
151
159
|
exports.isInterrupted = require_constants.isInterrupted;
|
|
152
160
|
exports.isNativeTransformer = require_types.isNativeTransformer;
|
|
161
|
+
exports.isNodeError = require_errors.isNodeError;
|
|
162
|
+
exports.isNodeTimeoutError = require_errors.isNodeTimeoutError;
|
|
153
163
|
exports.isParentCommand = require_errors.isParentCommand;
|
|
154
164
|
exports.isSerializableSchema = require_types$1.isSerializableSchema;
|
|
155
165
|
exports.isStandardSchema = require_types$1.isStandardSchema;
|
|
166
|
+
exports.messagesDeltaReducer = require_messages_reducer.messagesDeltaReducer;
|
|
156
167
|
exports.messagesStateReducer = require_messages_reducer.messagesStateReducer;
|
|
157
168
|
exports.pushMessage = require_message.pushMessage;
|
|
158
169
|
exports.task = require_index$3.task;
|
package/dist/web.d.cts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BaseChannel } from "./channels/base.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { TimeoutPolicy } from "./pregel/utils/timeout.cjs";
|
|
3
|
+
import { COMMAND_SYMBOL, Command, CommandInstance, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, START, Send, SendOptions, isCommand, isInterrupted } from "./constants.cjs";
|
|
4
|
+
import { DeltaChannel, DeltaReducer } from "./channels/delta.cjs";
|
|
3
5
|
import { BinaryOperator, BinaryOperatorAggregate } from "./channels/binop.cjs";
|
|
4
6
|
import { AnyValue } from "./channels/any_value.cjs";
|
|
5
7
|
import { LastValue } from "./channels/last_value.cjs";
|
|
@@ -8,6 +10,7 @@ import { EphemeralValue } from "./channels/ephemeral_value.cjs";
|
|
|
8
10
|
import { NamedBarrierValue } from "./channels/named_barrier_value.cjs";
|
|
9
11
|
import { Topic } from "./channels/topic.cjs";
|
|
10
12
|
import { UntrackedValueChannel } from "./channels/untracked_value.cjs";
|
|
13
|
+
import { RunControl } from "./pregel/runtime.cjs";
|
|
11
14
|
import { ExecutionInfo, LangGraphRunnableConfig, Runtime, ServerInfo } from "./pregel/runnable_types.cjs";
|
|
12
15
|
import { Annotation, AnnotationRoot, NodeType, SingleReducer, StateDefinition, StateType, UpdateType } from "./graph/annotation.cjs";
|
|
13
16
|
import { CachePolicy, RetryPolicy } from "./pregel/utils/index.cjs";
|
|
@@ -24,22 +27,22 @@ import { createValuesTransformer } from "./stream/transformers/values.cjs";
|
|
|
24
27
|
import { CreateGraphRunStreamOptions, GraphRunStream, SubgraphRunStream, createGraphRunStream } from "./stream/run-stream.cjs";
|
|
25
28
|
import { ChatModelStreamImpl } from "./stream/index.cjs";
|
|
26
29
|
import { Pregel } from "./pregel/index.cjs";
|
|
27
|
-
import {
|
|
28
|
-
import { InferInterruptInputType, InferInterruptResumeType, interrupt } from "./interrupt.cjs";
|
|
29
|
-
import { InferWriterType, writer } from "./writer.cjs";
|
|
30
|
+
import { BaseLangGraphError, BaseLangGraphErrorFields, EmptyChannelError, EmptyInputError, GraphBubbleUp, GraphDrained, GraphInterrupt, GraphRecursionError, GraphValueError, InvalidUpdateError, MultipleSubgraphsError, NodeError, NodeInterrupt, NodeTimeoutError, ParentCommand, RemoteException, StateGraphInputError, UnreachableNodeError, getSubgraphsSeenSet, isGraphBubbleUp, isGraphDrained, isGraphInterrupt, isNodeError, isNodeTimeoutError, isParentCommand } from "./errors.cjs";
|
|
30
31
|
import { isSerializableSchema, isStandardSchema } from "./state/types.cjs";
|
|
31
32
|
import { ReducedValue, ReducedValueInit } from "./state/values/reduced.cjs";
|
|
32
33
|
import { UntrackedValue, UntrackedValueInit } from "./state/values/untracked.cjs";
|
|
33
34
|
import { AnyStateSchema, InferStateSchemaUpdate, InferStateSchemaValue, StateSchema, StateSchemaField, StateSchemaFieldToChannel, StateSchemaFields, StateSchemaFieldsToStateDefinition } from "./state/schema.cjs";
|
|
34
35
|
import { ConditionalEdgeRouter, ConditionalEdgeRouterTypes, ContextSchemaInit, ExtractStateType, ExtractUpdateType, GraphNode, GraphNodeReturnValue, GraphNodeTypes, StateDefinitionInit, StateGraphInit, StateGraphOptions, ToStateDefinition } from "./graph/types.cjs";
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
36
|
+
import { AddNodeOptions, CompiledGraph, CompiledGraphType, Graph, NodeSpec } from "./graph/graph.cjs";
|
|
37
|
+
import { InferInterruptInputType, InferInterruptResumeType, interrupt } from "./interrupt.cjs";
|
|
38
|
+
import { InferWriterType, writer } from "./writer.cjs";
|
|
39
|
+
import { CompiledStateGraph, NodePolicyOptions, StateGraph, StateGraphAddNodeOptions, StateGraphArgs, StateGraphArgsWithInputOutputSchemas, StateGraphArgsWithStateSchema, StateGraphNodeSpec } from "./graph/state.cjs";
|
|
40
|
+
import { Messages, REMOVE_ALL_MESSAGES, messagesDeltaReducer, messagesStateReducer } from "./graph/messages_reducer.cjs";
|
|
37
41
|
import { MessageGraph, pushMessage } from "./graph/message.cjs";
|
|
38
|
-
import { BaseLangGraphError, BaseLangGraphErrorFields, EmptyChannelError, EmptyInputError, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, InvalidUpdateError, MultipleSubgraphsError, NodeInterrupt, ParentCommand, RemoteException, StateGraphInputError, UnreachableNodeError, getSubgraphsSeenSet, isGraphBubbleUp, isGraphInterrupt, isParentCommand } from "./errors.cjs";
|
|
39
42
|
import { EntrypointOptions, TaskOptions, entrypoint, getPreviousState, task } from "./func/index.cjs";
|
|
40
43
|
import { MessagesAnnotation, MessagesZodMeta, MessagesZodState } from "./graph/messages_annotation.cjs";
|
|
41
44
|
import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter.cjs";
|
|
42
45
|
import { MessagesValue } from "./state/prebuilt/messages.cjs";
|
|
43
46
|
import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.cjs";
|
|
44
47
|
import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "@langchain/langgraph-checkpoint";
|
|
45
|
-
export { type AddNodeOptions, type AgentStatus, Annotation, type AnnotationRoot, AnyStateSchema, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, type CachePolicy, type ChatModelStream, ChatModelStreamImpl, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, CommandInstance, type CommandParams, type CompiledGraph, type CompiledGraphType, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type ConvertToProtocolEventOptions, type CreateGraphRunStreamOptions, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, StreamChannel as EventLog, type ExecutionInfo, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphRunStream, GraphValueError, INTERRUPT, InMemoryStore, type InferExtensions, type InferInterruptInputType, type InferInterruptResumeType, InferStateSchemaUpdate, InferStateSchemaValue, type InferWriterType, type Interrupt, type InterruptPayload, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type LifecycleCause, type LifecycleData, type LifecycleEntry, type LifecycleProjection, type LifecycleTransformerOptions, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, type MessagesEventData, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type Namespace, type NamespaceMatchType, type NativeStreamTransformer, NodeInterrupt, type NodeSpec, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type ProtocolEvent, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, type Runtime, START, STREAM_EVENTS_V3_MODES, type SearchOperation, Send, type ServerInfo, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphAddNodeOptions, type StateGraphArgs, type StateGraphArgsWithInputOutputSchemas, type StateGraphArgsWithStateSchema, type StateGraphInit, StateGraphInputError, type StateGraphNodeSpec, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFieldToChannel, StateSchemaFields, StateSchemaFieldsToStateDefinition, type StateSnapshot, type StateType, StreamChannel, type StreamEmitter, type StreamMode, type StreamOutputMap, type StreamTransformer, type SubgraphDiscoveryProjection, type SubgraphDiscoveryTransformerOptions, SubgraphRunStream, type TaskOptions, type ToStateDefinition, type ToolCallStatus, type ToolCallStream, type ToolsEventData, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type UpdatesEventData, type UsageInfo, type WaitForNames, messagesStateReducer as addMessages, convertToProtocolEvent, copyCheckpoint, createGraphRunStream, createLifecycleTransformer, createMessagesTransformer, createSubgraphDiscoveryTransformer, createValuesTransformer, emptyCheckpoint, entrypoint, filterLifecycleEntries, filterSubgraphHandles, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCheckpointEnvelope, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isNativeTransformer, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
|
|
48
|
+
export { type AddNodeOptions, type AgentStatus, Annotation, type AnnotationRoot, AnyStateSchema, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, type CachePolicy, type ChatModelStream, ChatModelStreamImpl, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, CommandInstance, type CommandParams, type CompiledGraph, type CompiledGraphType, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type ConvertToProtocolEventOptions, type CreateGraphRunStreamOptions, DeltaChannel, type DeltaReducer, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, StreamChannel as EventLog, type ExecutionInfo, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphDrained, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphRunStream, GraphValueError, INTERRUPT, InMemoryStore, type InferExtensions, type InferInterruptInputType, type InferInterruptResumeType, InferStateSchemaUpdate, InferStateSchemaValue, type InferWriterType, type Interrupt, type InterruptPayload, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type LifecycleCause, type LifecycleData, type LifecycleEntry, type LifecycleProjection, type LifecycleTransformerOptions, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, type MessagesEventData, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type Namespace, type NamespaceMatchType, type NativeStreamTransformer, NodeError, NodeInterrupt, type NodePolicyOptions, type NodeSpec, NodeTimeoutError, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type ProtocolEvent, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, RunControl, type Runtime, START, STREAM_EVENTS_V3_MODES, type SearchOperation, Send, type SendOptions, type ServerInfo, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphAddNodeOptions, type StateGraphArgs, type StateGraphArgsWithInputOutputSchemas, type StateGraphArgsWithStateSchema, type StateGraphInit, StateGraphInputError, type StateGraphNodeSpec, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFieldToChannel, StateSchemaFields, StateSchemaFieldsToStateDefinition, type StateSnapshot, type StateType, StreamChannel, type StreamEmitter, type StreamMode, type StreamOutputMap, type StreamTransformer, type SubgraphDiscoveryProjection, type SubgraphDiscoveryTransformerOptions, SubgraphRunStream, type TaskOptions, type TimeoutPolicy, type ToStateDefinition, type ToolCallStatus, type ToolCallStream, type ToolsEventData, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type UpdatesEventData, type UsageInfo, type WaitForNames, messagesStateReducer as addMessages, convertToProtocolEvent, copyCheckpoint, createGraphRunStream, createLifecycleTransformer, createMessagesTransformer, createSubgraphDiscoveryTransformer, createValuesTransformer, emptyCheckpoint, entrypoint, filterLifecycleEntries, filterSubgraphHandles, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCheckpointEnvelope, isCommand, isGraphBubbleUp, isGraphDrained, isGraphInterrupt, isInterrupted, isNativeTransformer, isNodeError, isNodeTimeoutError, isParentCommand, isSerializableSchema, isStandardSchema, messagesDeltaReducer, messagesStateReducer, pushMessage, task, writer };
|
package/dist/web.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BaseChannel } from "./channels/base.js";
|
|
2
|
-
import {
|
|
2
|
+
import { TimeoutPolicy } from "./pregel/utils/timeout.js";
|
|
3
|
+
import { COMMAND_SYMBOL, Command, CommandInstance, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, START, Send, SendOptions, isCommand, isInterrupted } from "./constants.js";
|
|
4
|
+
import { DeltaChannel, DeltaReducer } from "./channels/delta.js";
|
|
3
5
|
import { BinaryOperator, BinaryOperatorAggregate } from "./channels/binop.js";
|
|
4
6
|
import { AnyValue } from "./channels/any_value.js";
|
|
5
7
|
import { LastValue } from "./channels/last_value.js";
|
|
@@ -8,6 +10,7 @@ import { EphemeralValue } from "./channels/ephemeral_value.js";
|
|
|
8
10
|
import { NamedBarrierValue } from "./channels/named_barrier_value.js";
|
|
9
11
|
import { Topic } from "./channels/topic.js";
|
|
10
12
|
import { UntrackedValueChannel } from "./channels/untracked_value.js";
|
|
13
|
+
import { RunControl } from "./pregel/runtime.js";
|
|
11
14
|
import { ExecutionInfo, LangGraphRunnableConfig, Runtime, ServerInfo } from "./pregel/runnable_types.js";
|
|
12
15
|
import { Annotation, AnnotationRoot, NodeType, SingleReducer, StateDefinition, StateType, UpdateType } from "./graph/annotation.js";
|
|
13
16
|
import { CachePolicy, RetryPolicy } from "./pregel/utils/index.js";
|
|
@@ -24,22 +27,22 @@ import { createValuesTransformer } from "./stream/transformers/values.js";
|
|
|
24
27
|
import { CreateGraphRunStreamOptions, GraphRunStream, SubgraphRunStream, createGraphRunStream } from "./stream/run-stream.js";
|
|
25
28
|
import { ChatModelStreamImpl } from "./stream/index.js";
|
|
26
29
|
import { Pregel } from "./pregel/index.js";
|
|
27
|
-
import {
|
|
28
|
-
import { InferInterruptInputType, InferInterruptResumeType, interrupt } from "./interrupt.js";
|
|
29
|
-
import { InferWriterType, writer } from "./writer.js";
|
|
30
|
+
import { BaseLangGraphError, BaseLangGraphErrorFields, EmptyChannelError, EmptyInputError, GraphBubbleUp, GraphDrained, GraphInterrupt, GraphRecursionError, GraphValueError, InvalidUpdateError, MultipleSubgraphsError, NodeError, NodeInterrupt, NodeTimeoutError, ParentCommand, RemoteException, StateGraphInputError, UnreachableNodeError, getSubgraphsSeenSet, isGraphBubbleUp, isGraphDrained, isGraphInterrupt, isNodeError, isNodeTimeoutError, isParentCommand } from "./errors.js";
|
|
30
31
|
import { isSerializableSchema, isStandardSchema } from "./state/types.js";
|
|
31
32
|
import { ReducedValue, ReducedValueInit } from "./state/values/reduced.js";
|
|
32
33
|
import { UntrackedValue, UntrackedValueInit } from "./state/values/untracked.js";
|
|
33
34
|
import { AnyStateSchema, InferStateSchemaUpdate, InferStateSchemaValue, StateSchema, StateSchemaField, StateSchemaFieldToChannel, StateSchemaFields, StateSchemaFieldsToStateDefinition } from "./state/schema.js";
|
|
34
35
|
import { ConditionalEdgeRouter, ConditionalEdgeRouterTypes, ContextSchemaInit, ExtractStateType, ExtractUpdateType, GraphNode, GraphNodeReturnValue, GraphNodeTypes, StateDefinitionInit, StateGraphInit, StateGraphOptions, ToStateDefinition } from "./graph/types.js";
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
36
|
+
import { AddNodeOptions, CompiledGraph, CompiledGraphType, Graph, NodeSpec } from "./graph/graph.js";
|
|
37
|
+
import { InferInterruptInputType, InferInterruptResumeType, interrupt } from "./interrupt.js";
|
|
38
|
+
import { InferWriterType, writer } from "./writer.js";
|
|
39
|
+
import { CompiledStateGraph, NodePolicyOptions, StateGraph, StateGraphAddNodeOptions, StateGraphArgs, StateGraphArgsWithInputOutputSchemas, StateGraphArgsWithStateSchema, StateGraphNodeSpec } from "./graph/state.js";
|
|
40
|
+
import { Messages, REMOVE_ALL_MESSAGES, messagesDeltaReducer, messagesStateReducer } from "./graph/messages_reducer.js";
|
|
37
41
|
import { MessageGraph, pushMessage } from "./graph/message.js";
|
|
38
|
-
import { BaseLangGraphError, BaseLangGraphErrorFields, EmptyChannelError, EmptyInputError, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, InvalidUpdateError, MultipleSubgraphsError, NodeInterrupt, ParentCommand, RemoteException, StateGraphInputError, UnreachableNodeError, getSubgraphsSeenSet, isGraphBubbleUp, isGraphInterrupt, isParentCommand } from "./errors.js";
|
|
39
42
|
import { EntrypointOptions, TaskOptions, entrypoint, getPreviousState, task } from "./func/index.js";
|
|
40
43
|
import { MessagesAnnotation, MessagesZodMeta, MessagesZodState } from "./graph/messages_annotation.js";
|
|
41
44
|
import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter.js";
|
|
42
45
|
import { MessagesValue } from "./state/prebuilt/messages.js";
|
|
43
46
|
import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.js";
|
|
44
47
|
import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "@langchain/langgraph-checkpoint";
|
|
45
|
-
export { type AddNodeOptions, type AgentStatus, Annotation, type AnnotationRoot, AnyStateSchema, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, type CachePolicy, type ChatModelStream, ChatModelStreamImpl, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, CommandInstance, type CommandParams, type CompiledGraph, type CompiledGraphType, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type ConvertToProtocolEventOptions, type CreateGraphRunStreamOptions, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, StreamChannel as EventLog, type ExecutionInfo, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphRunStream, GraphValueError, INTERRUPT, InMemoryStore, type InferExtensions, type InferInterruptInputType, type InferInterruptResumeType, InferStateSchemaUpdate, InferStateSchemaValue, type InferWriterType, type Interrupt, type InterruptPayload, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type LifecycleCause, type LifecycleData, type LifecycleEntry, type LifecycleProjection, type LifecycleTransformerOptions, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, type MessagesEventData, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type Namespace, type NamespaceMatchType, type NativeStreamTransformer, NodeInterrupt, type NodeSpec, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type ProtocolEvent, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, type Runtime, START, STREAM_EVENTS_V3_MODES, type SearchOperation, Send, type ServerInfo, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphAddNodeOptions, type StateGraphArgs, type StateGraphArgsWithInputOutputSchemas, type StateGraphArgsWithStateSchema, type StateGraphInit, StateGraphInputError, type StateGraphNodeSpec, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFieldToChannel, StateSchemaFields, StateSchemaFieldsToStateDefinition, type StateSnapshot, type StateType, StreamChannel, type StreamEmitter, type StreamMode, type StreamOutputMap, type StreamTransformer, type SubgraphDiscoveryProjection, type SubgraphDiscoveryTransformerOptions, SubgraphRunStream, type TaskOptions, type ToStateDefinition, type ToolCallStatus, type ToolCallStream, type ToolsEventData, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type UpdatesEventData, type UsageInfo, type WaitForNames, messagesStateReducer as addMessages, convertToProtocolEvent, copyCheckpoint, createGraphRunStream, createLifecycleTransformer, createMessagesTransformer, createSubgraphDiscoveryTransformer, createValuesTransformer, emptyCheckpoint, entrypoint, filterLifecycleEntries, filterSubgraphHandles, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCheckpointEnvelope, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isNativeTransformer, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
|
|
48
|
+
export { type AddNodeOptions, type AgentStatus, Annotation, type AnnotationRoot, AnyStateSchema, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, type CachePolicy, type ChatModelStream, ChatModelStreamImpl, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, CommandInstance, type CommandParams, type CompiledGraph, type CompiledGraphType, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type ConvertToProtocolEventOptions, type CreateGraphRunStreamOptions, DeltaChannel, type DeltaReducer, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, StreamChannel as EventLog, type ExecutionInfo, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphDrained, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphRunStream, GraphValueError, INTERRUPT, InMemoryStore, type InferExtensions, type InferInterruptInputType, type InferInterruptResumeType, InferStateSchemaUpdate, InferStateSchemaValue, type InferWriterType, type Interrupt, type InterruptPayload, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type LifecycleCause, type LifecycleData, type LifecycleEntry, type LifecycleProjection, type LifecycleTransformerOptions, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, type MessagesEventData, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type Namespace, type NamespaceMatchType, type NativeStreamTransformer, NodeError, NodeInterrupt, type NodePolicyOptions, type NodeSpec, NodeTimeoutError, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type ProtocolEvent, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, RunControl, type Runtime, START, STREAM_EVENTS_V3_MODES, type SearchOperation, Send, type SendOptions, type ServerInfo, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphAddNodeOptions, type StateGraphArgs, type StateGraphArgsWithInputOutputSchemas, type StateGraphArgsWithStateSchema, type StateGraphInit, StateGraphInputError, type StateGraphNodeSpec, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFieldToChannel, StateSchemaFields, StateSchemaFieldsToStateDefinition, type StateSnapshot, type StateType, StreamChannel, type StreamEmitter, type StreamMode, type StreamOutputMap, type StreamTransformer, type SubgraphDiscoveryProjection, type SubgraphDiscoveryTransformerOptions, SubgraphRunStream, type TaskOptions, type TimeoutPolicy, type ToStateDefinition, type ToolCallStatus, type ToolCallStream, type ToolsEventData, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type UpdatesEventData, type UsageInfo, type WaitForNames, messagesStateReducer as addMessages, convertToProtocolEvent, copyCheckpoint, createGraphRunStream, createLifecycleTransformer, createMessagesTransformer, createSubgraphDiscoveryTransformer, createValuesTransformer, emptyCheckpoint, entrypoint, filterLifecycleEntries, filterSubgraphHandles, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCheckpointEnvelope, isCommand, isGraphBubbleUp, isGraphDrained, isGraphInterrupt, isInterrupted, isNativeTransformer, isNodeError, isNodeTimeoutError, isParentCommand, isSerializableSchema, isStandardSchema, messagesDeltaReducer, messagesStateReducer, pushMessage, task, writer };
|