@langchain/langgraph-sdk 0.0.37 → 0.0.39

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.
Files changed (46) hide show
  1. package/dist/client.cjs +10 -66
  2. package/dist/client.d.ts +19 -24
  3. package/dist/client.js +10 -66
  4. package/dist/index.cjs +3 -1
  5. package/dist/index.d.ts +5 -1
  6. package/dist/index.js +1 -0
  7. package/dist/react/debug.cjs +32 -0
  8. package/dist/react/debug.d.ts +23 -0
  9. package/dist/react/debug.js +28 -0
  10. package/dist/react/index.cjs +5 -0
  11. package/dist/react/index.d.ts +1 -0
  12. package/dist/react/index.js +1 -0
  13. package/dist/react/stream.cjs +411 -0
  14. package/dist/react/stream.d.ts +46 -0
  15. package/dist/react/stream.js +407 -0
  16. package/dist/schema.d.ts +7 -7
  17. package/dist/singletons/fetch.cjs +27 -0
  18. package/dist/singletons/fetch.d.ts +11 -0
  19. package/dist/singletons/fetch.js +22 -0
  20. package/dist/types.d.ts +6 -16
  21. package/dist/types.messages.d.ts +88 -0
  22. package/dist/types.stream.cjs +2 -0
  23. package/dist/types.stream.d.ts +156 -0
  24. package/dist/types.stream.js +1 -0
  25. package/dist/utils/async_caller.cjs +2 -1
  26. package/dist/utils/async_caller.js +2 -1
  27. package/dist/utils/sse.cjs +151 -0
  28. package/dist/utils/sse.d.ts +11 -0
  29. package/dist/utils/sse.js +146 -0
  30. package/package.json +23 -3
  31. package/react.cjs +1 -0
  32. package/react.d.cts +1 -0
  33. package/react.d.ts +1 -0
  34. package/react.js +1 -0
  35. package/dist/utils/eventsource-parser/index.cjs +0 -7
  36. package/dist/utils/eventsource-parser/index.d.ts +0 -2
  37. package/dist/utils/eventsource-parser/index.js +0 -3
  38. package/dist/utils/eventsource-parser/parse.cjs +0 -150
  39. package/dist/utils/eventsource-parser/parse.d.ts +0 -18
  40. package/dist/utils/eventsource-parser/parse.js +0 -146
  41. package/dist/utils/eventsource-parser/stream.cjs +0 -34
  42. package/dist/utils/eventsource-parser/stream.d.ts +0 -17
  43. package/dist/utils/eventsource-parser/stream.js +0 -30
  44. package/dist/utils/eventsource-parser/types.d.ts +0 -81
  45. /package/dist/{utils/eventsource-parser/types.cjs → types.messages.cjs} +0 -0
  46. /package/dist/{utils/eventsource-parser/types.js → types.messages.js} +0 -0
@@ -0,0 +1,156 @@
1
+ import type { Message } from "./types.messages.js";
2
+ /**
3
+ * Stream modes
4
+ * - "values": Stream only the state values.
5
+ * - "messages": Stream complete messages.
6
+ * - "messages-tuple": Stream (message chunk, metadata) tuples.
7
+ * - "updates": Stream updates to the state.
8
+ * - "events": Stream events occurring during execution.
9
+ * - "debug": Stream detailed debug information.
10
+ * - "custom": Stream custom events.
11
+ */
12
+ export type StreamMode = "values" | "messages" | "updates" | "events" | "debug" | "custom" | "messages-tuple";
13
+ type MessageTupleMetadata = {
14
+ tags: string[];
15
+ [key: string]: unknown;
16
+ };
17
+ type AsSubgraph<TEvent extends {
18
+ event: string;
19
+ data: unknown;
20
+ }> = {
21
+ event: TEvent["event"] | `${TEvent["event"]}|${string}`;
22
+ data: TEvent["data"];
23
+ };
24
+ /**
25
+ * Stream event with values after completion of each step.
26
+ */
27
+ export type ValuesStreamEvent<StateType> = {
28
+ event: "values";
29
+ data: StateType;
30
+ };
31
+ /** @internal */
32
+ export type SubgraphValuesStreamEvent<StateType> = AsSubgraph<ValuesStreamEvent<StateType>>;
33
+ /**
34
+ * Stream event with message chunks coming from LLM invocations inside nodes.
35
+ */
36
+ export type MessagesTupleStreamEvent = {
37
+ event: "messages";
38
+ data: [message: Message, config: MessageTupleMetadata];
39
+ };
40
+ /** @internal */
41
+ export type SubgraphMessagesTupleStreamEvent = AsSubgraph<MessagesTupleStreamEvent>;
42
+ /**
43
+ * Metadata stream event with information about the run and thread
44
+ */
45
+ export type MetadataStreamEvent = {
46
+ event: "metadata";
47
+ data: {
48
+ run_id: string;
49
+ thread_id: string;
50
+ };
51
+ };
52
+ /**
53
+ * Stream event with error information.
54
+ */
55
+ export type ErrorStreamEvent = {
56
+ event: "error";
57
+ data: {
58
+ error: string;
59
+ message: string;
60
+ };
61
+ };
62
+ /** @internal */
63
+ export type SubgraphErrorStreamEvent = AsSubgraph<ErrorStreamEvent>;
64
+ /**
65
+ * Stream event with updates to the state after each step.
66
+ * The streamed outputs include the name of the node that
67
+ * produced the update as well as the update.
68
+ */
69
+ export type UpdatesStreamEvent<UpdateType> = {
70
+ event: "updates";
71
+ data: {
72
+ [node: string]: UpdateType;
73
+ };
74
+ };
75
+ /** @internal */
76
+ export type SubgraphUpdatesStreamEvent<UpdateType> = AsSubgraph<UpdatesStreamEvent<UpdateType>>;
77
+ /**
78
+ * Streaming custom data from inside the nodes.
79
+ */
80
+ export type CustomStreamEvent<T> = {
81
+ event: "custom";
82
+ data: T;
83
+ };
84
+ /** @internal */
85
+ export type SubgraphCustomStreamEvent<T> = AsSubgraph<CustomStreamEvent<T>>;
86
+ type MessagesMetadataStreamEvent = {
87
+ event: "messages/metadata";
88
+ data: {
89
+ [messageId: string]: {
90
+ metadata: unknown;
91
+ };
92
+ };
93
+ };
94
+ type MessagesCompleteStreamEvent = {
95
+ event: "messages/complete";
96
+ data: Message[];
97
+ };
98
+ type MessagesPartialStreamEvent = {
99
+ event: "messages/partial";
100
+ data: Message[];
101
+ };
102
+ /**
103
+ * Message stream event specific to LangGraph Server.
104
+ * @deprecated Use `streamMode: "messages-tuple"` instead.
105
+ */
106
+ export type MessagesStreamEvent = MessagesMetadataStreamEvent | MessagesCompleteStreamEvent | MessagesPartialStreamEvent;
107
+ /** @internal */
108
+ export type SubgraphMessagesStreamEvent = AsSubgraph<MessagesMetadataStreamEvent> | AsSubgraph<MessagesCompleteStreamEvent> | AsSubgraph<MessagesPartialStreamEvent>;
109
+ /**
110
+ * Stream event with detailed debug information.
111
+ */
112
+ export type DebugStreamEvent = {
113
+ event: "debug";
114
+ data: unknown;
115
+ };
116
+ /** @internal */
117
+ export type SubgraphDebugStreamEvent = AsSubgraph<DebugStreamEvent>;
118
+ /**
119
+ * Stream event with events occurring during execution.
120
+ */
121
+ export type EventsStreamEvent = {
122
+ event: "events";
123
+ data: unknown;
124
+ };
125
+ /** @internal */
126
+ export type SubgraphEventsStreamEvent = AsSubgraph<EventsStreamEvent>;
127
+ /**
128
+ * Stream event with a feedback key to signed URL map. Set `feedbackKeys` in
129
+ * the `RunsStreamPayload` to receive this event.
130
+ */
131
+ export type FeedbackStreamEvent = {
132
+ event: "feedback";
133
+ data: {
134
+ [feedbackKey: string]: string;
135
+ };
136
+ };
137
+ type GetStreamModeMap<TStreamMode extends StreamMode | StreamMode[], TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = {
138
+ values: ValuesStreamEvent<TStateType>;
139
+ updates: UpdatesStreamEvent<TUpdateType>;
140
+ custom: CustomStreamEvent<TCustomType>;
141
+ debug: DebugStreamEvent;
142
+ messages: MessagesStreamEvent;
143
+ "messages-tuple": MessagesTupleStreamEvent;
144
+ events: EventsStreamEvent;
145
+ }[TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode] | ErrorStreamEvent | MetadataStreamEvent | FeedbackStreamEvent;
146
+ type GetSubgraphsStreamModeMap<TStreamMode extends StreamMode | StreamMode[], TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = {
147
+ values: SubgraphValuesStreamEvent<TStateType>;
148
+ updates: SubgraphUpdatesStreamEvent<TUpdateType>;
149
+ custom: SubgraphCustomStreamEvent<TCustomType>;
150
+ debug: SubgraphDebugStreamEvent;
151
+ messages: SubgraphMessagesStreamEvent;
152
+ "messages-tuple": SubgraphMessagesTupleStreamEvent;
153
+ events: SubgraphEventsStreamEvent;
154
+ }[TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode] | SubgraphErrorStreamEvent | MetadataStreamEvent | FeedbackStreamEvent;
155
+ export type TypedAsyncGenerator<TStreamMode extends StreamMode | StreamMode[] = [], TSubgraphs extends boolean = false, TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = AsyncGenerator<TSubgraphs extends true ? GetSubgraphsStreamModeMap<TStreamMode, TStateType, TUpdateType, TCustomType> : GetStreamModeMap<TStreamMode, TStateType, TUpdateType, TCustomType>>;
156
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AsyncCaller = void 0;
7
7
  const p_retry_1 = __importDefault(require("p-retry"));
8
8
  const p_queue_1 = __importDefault(require("p-queue"));
9
+ const fetch_js_1 = require("../singletons/fetch.cjs");
9
10
  const STATUS_NO_RETRY = [
10
11
  400, // Bad Request
11
12
  401, // Unauthorized
@@ -189,7 +190,7 @@ class AsyncCaller {
189
190
  return this.call(callable, ...args);
190
191
  }
191
192
  fetch(...args) {
192
- const fetchFn = this.customFetch ?? fetch;
193
+ const fetchFn = this.customFetch ?? (0, fetch_js_1._getFetchImplementation)();
193
194
  return this.call(() => fetchFn(...args).then((res) => (res.ok ? res : Promise.reject(res))));
194
195
  }
195
196
  }
@@ -1,5 +1,6 @@
1
1
  import pRetry from "p-retry";
2
2
  import PQueueMod from "p-queue";
3
+ import { _getFetchImplementation } from "../singletons/fetch.js";
3
4
  const STATUS_NO_RETRY = [
4
5
  400, // Bad Request
5
6
  401, // Unauthorized
@@ -183,7 +184,7 @@ export class AsyncCaller {
183
184
  return this.call(callable, ...args);
184
185
  }
185
186
  fetch(...args) {
186
- const fetchFn = this.customFetch ?? fetch;
187
+ const fetchFn = this.customFetch ?? _getFetchImplementation();
187
188
  return this.call(() => fetchFn(...args).then((res) => (res.ok ? res : Promise.reject(res))));
188
189
  }
189
190
  }
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SSEDecoder = exports.BytesLineDecoder = void 0;
4
+ const mergeArrays = (a, b) => {
5
+ const mergedArray = new Uint8Array(a.length + b.length);
6
+ mergedArray.set(a);
7
+ mergedArray.set(b, a.length);
8
+ return mergedArray;
9
+ };
10
+ const CR = "\r".charCodeAt(0);
11
+ const LF = "\n".charCodeAt(0);
12
+ const NULL = "\0".charCodeAt(0);
13
+ const COLON = ":".charCodeAt(0);
14
+ const SPACE = " ".charCodeAt(0);
15
+ const TRAILING_NEWLINE = [CR, LF];
16
+ class BytesLineDecoder extends TransformStream {
17
+ constructor() {
18
+ let buffer = new Uint8Array();
19
+ let trailingCr = false;
20
+ super({
21
+ start() {
22
+ buffer = new Uint8Array();
23
+ trailingCr = false;
24
+ },
25
+ transform(chunk, controller) {
26
+ // See https://docs.python.org/3/glossary.html#term-universal-newlines
27
+ let text = chunk;
28
+ // Handle trailing CR from previous chunk
29
+ if (trailingCr) {
30
+ text = mergeArrays([CR], text);
31
+ trailingCr = false;
32
+ }
33
+ // Check for trailing CR in current chunk
34
+ if (text.length > 0 && text.at(-1) === CR) {
35
+ trailingCr = true;
36
+ text = text.subarray(0, -1);
37
+ }
38
+ if (!text.length)
39
+ return;
40
+ const trailingNewline = TRAILING_NEWLINE.includes(text.at(-1));
41
+ // Pre-allocate lines array with estimated capacity
42
+ let lines = [];
43
+ for (let offset = 0; offset < text.byteLength;) {
44
+ let idx = text.indexOf(CR, offset);
45
+ if (idx === -1)
46
+ idx = text.indexOf(LF, offset);
47
+ if (idx === -1) {
48
+ lines.push(text.subarray(offset));
49
+ break;
50
+ }
51
+ lines.push(text.subarray(offset, idx));
52
+ if (text[idx] === CR && text[idx + 1] === LF) {
53
+ offset = idx + 2;
54
+ }
55
+ else {
56
+ offset = idx + 1;
57
+ }
58
+ }
59
+ if (lines.length === 1 && !trailingNewline) {
60
+ buffer = mergeArrays(buffer, lines[0]);
61
+ return;
62
+ }
63
+ if (buffer.length) {
64
+ // Include existing buffer in first line
65
+ buffer = mergeArrays(buffer, lines[0]);
66
+ lines = lines.slice(1);
67
+ lines.unshift(buffer);
68
+ buffer = new Uint8Array();
69
+ }
70
+ if (!trailingNewline) {
71
+ // If the last segment is not newline terminated,
72
+ // buffer it for the next chunk
73
+ if (lines.length)
74
+ buffer = lines.pop();
75
+ }
76
+ // Enqueue complete lines
77
+ for (const line of lines) {
78
+ controller.enqueue(line);
79
+ }
80
+ },
81
+ flush(controller) {
82
+ if (buffer.length) {
83
+ controller.enqueue(buffer);
84
+ }
85
+ },
86
+ });
87
+ }
88
+ }
89
+ exports.BytesLineDecoder = BytesLineDecoder;
90
+ class SSEDecoder extends TransformStream {
91
+ constructor() {
92
+ let event = "";
93
+ let data = new Uint8Array();
94
+ let lastEventId = "";
95
+ let retry = null;
96
+ const decoder = new TextDecoder();
97
+ super({
98
+ transform(chunk, controller) {
99
+ // Handle empty line case
100
+ if (!chunk.length) {
101
+ if (!event && !data.length && !lastEventId && retry == null)
102
+ return;
103
+ const sse = {
104
+ event,
105
+ data: data.length ? JSON.parse(decoder.decode(data)) : null,
106
+ };
107
+ // NOTE: as per the SSE spec, do not reset lastEventId
108
+ event = "";
109
+ data = new Uint8Array();
110
+ retry = null;
111
+ controller.enqueue(sse);
112
+ return;
113
+ }
114
+ // Ignore comments
115
+ if (chunk[0] === COLON)
116
+ return;
117
+ const sepIdx = chunk.indexOf(COLON);
118
+ if (sepIdx === -1)
119
+ return;
120
+ const fieldName = decoder.decode(chunk.subarray(0, sepIdx));
121
+ let value = chunk.subarray(sepIdx + 1);
122
+ if (value[0] === SPACE)
123
+ value = value.subarray(1);
124
+ if (fieldName === "event") {
125
+ event = decoder.decode(value);
126
+ }
127
+ else if (fieldName === "data") {
128
+ data = mergeArrays(data, value);
129
+ }
130
+ else if (fieldName === "id") {
131
+ if (value.indexOf(NULL) === -1)
132
+ lastEventId = decoder.decode(value);
133
+ }
134
+ else if (fieldName === "retry") {
135
+ const retryNum = Number.parseInt(decoder.decode(value));
136
+ if (!Number.isNaN(retryNum))
137
+ retry = retryNum;
138
+ }
139
+ },
140
+ flush(controller) {
141
+ if (event) {
142
+ controller.enqueue({
143
+ event,
144
+ data: data.length ? JSON.parse(decoder.decode(data)) : null,
145
+ });
146
+ }
147
+ },
148
+ });
149
+ }
150
+ }
151
+ exports.SSEDecoder = SSEDecoder;
@@ -0,0 +1,11 @@
1
+ export declare class BytesLineDecoder extends TransformStream<Uint8Array, Uint8Array> {
2
+ constructor();
3
+ }
4
+ interface StreamPart {
5
+ event: string;
6
+ data: unknown;
7
+ }
8
+ export declare class SSEDecoder extends TransformStream<Uint8Array, StreamPart> {
9
+ constructor();
10
+ }
11
+ export {};
@@ -0,0 +1,146 @@
1
+ const mergeArrays = (a, b) => {
2
+ const mergedArray = new Uint8Array(a.length + b.length);
3
+ mergedArray.set(a);
4
+ mergedArray.set(b, a.length);
5
+ return mergedArray;
6
+ };
7
+ const CR = "\r".charCodeAt(0);
8
+ const LF = "\n".charCodeAt(0);
9
+ const NULL = "\0".charCodeAt(0);
10
+ const COLON = ":".charCodeAt(0);
11
+ const SPACE = " ".charCodeAt(0);
12
+ const TRAILING_NEWLINE = [CR, LF];
13
+ export class BytesLineDecoder extends TransformStream {
14
+ constructor() {
15
+ let buffer = new Uint8Array();
16
+ let trailingCr = false;
17
+ super({
18
+ start() {
19
+ buffer = new Uint8Array();
20
+ trailingCr = false;
21
+ },
22
+ transform(chunk, controller) {
23
+ // See https://docs.python.org/3/glossary.html#term-universal-newlines
24
+ let text = chunk;
25
+ // Handle trailing CR from previous chunk
26
+ if (trailingCr) {
27
+ text = mergeArrays([CR], text);
28
+ trailingCr = false;
29
+ }
30
+ // Check for trailing CR in current chunk
31
+ if (text.length > 0 && text.at(-1) === CR) {
32
+ trailingCr = true;
33
+ text = text.subarray(0, -1);
34
+ }
35
+ if (!text.length)
36
+ return;
37
+ const trailingNewline = TRAILING_NEWLINE.includes(text.at(-1));
38
+ // Pre-allocate lines array with estimated capacity
39
+ let lines = [];
40
+ for (let offset = 0; offset < text.byteLength;) {
41
+ let idx = text.indexOf(CR, offset);
42
+ if (idx === -1)
43
+ idx = text.indexOf(LF, offset);
44
+ if (idx === -1) {
45
+ lines.push(text.subarray(offset));
46
+ break;
47
+ }
48
+ lines.push(text.subarray(offset, idx));
49
+ if (text[idx] === CR && text[idx + 1] === LF) {
50
+ offset = idx + 2;
51
+ }
52
+ else {
53
+ offset = idx + 1;
54
+ }
55
+ }
56
+ if (lines.length === 1 && !trailingNewline) {
57
+ buffer = mergeArrays(buffer, lines[0]);
58
+ return;
59
+ }
60
+ if (buffer.length) {
61
+ // Include existing buffer in first line
62
+ buffer = mergeArrays(buffer, lines[0]);
63
+ lines = lines.slice(1);
64
+ lines.unshift(buffer);
65
+ buffer = new Uint8Array();
66
+ }
67
+ if (!trailingNewline) {
68
+ // If the last segment is not newline terminated,
69
+ // buffer it for the next chunk
70
+ if (lines.length)
71
+ buffer = lines.pop();
72
+ }
73
+ // Enqueue complete lines
74
+ for (const line of lines) {
75
+ controller.enqueue(line);
76
+ }
77
+ },
78
+ flush(controller) {
79
+ if (buffer.length) {
80
+ controller.enqueue(buffer);
81
+ }
82
+ },
83
+ });
84
+ }
85
+ }
86
+ export class SSEDecoder extends TransformStream {
87
+ constructor() {
88
+ let event = "";
89
+ let data = new Uint8Array();
90
+ let lastEventId = "";
91
+ let retry = null;
92
+ const decoder = new TextDecoder();
93
+ super({
94
+ transform(chunk, controller) {
95
+ // Handle empty line case
96
+ if (!chunk.length) {
97
+ if (!event && !data.length && !lastEventId && retry == null)
98
+ return;
99
+ const sse = {
100
+ event,
101
+ data: data.length ? JSON.parse(decoder.decode(data)) : null,
102
+ };
103
+ // NOTE: as per the SSE spec, do not reset lastEventId
104
+ event = "";
105
+ data = new Uint8Array();
106
+ retry = null;
107
+ controller.enqueue(sse);
108
+ return;
109
+ }
110
+ // Ignore comments
111
+ if (chunk[0] === COLON)
112
+ return;
113
+ const sepIdx = chunk.indexOf(COLON);
114
+ if (sepIdx === -1)
115
+ return;
116
+ const fieldName = decoder.decode(chunk.subarray(0, sepIdx));
117
+ let value = chunk.subarray(sepIdx + 1);
118
+ if (value[0] === SPACE)
119
+ value = value.subarray(1);
120
+ if (fieldName === "event") {
121
+ event = decoder.decode(value);
122
+ }
123
+ else if (fieldName === "data") {
124
+ data = mergeArrays(data, value);
125
+ }
126
+ else if (fieldName === "id") {
127
+ if (value.indexOf(NULL) === -1)
128
+ lastEventId = decoder.decode(value);
129
+ }
130
+ else if (fieldName === "retry") {
131
+ const retryNum = Number.parseInt(decoder.decode(value));
132
+ if (!Number.isNaN(retryNum))
133
+ retry = retryNum;
134
+ }
135
+ },
136
+ flush(controller) {
137
+ if (event) {
138
+ controller.enqueue({
139
+ event,
140
+ data: data.length ? JSON.parse(decoder.decode(data)) : null,
141
+ });
142
+ }
143
+ },
144
+ });
145
+ }
146
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph-sdk",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "description": "Client library for interacting with the LangGraph API",
5
5
  "type": "module",
6
6
  "packageManager": "yarn@1.22.19",
@@ -22,18 +22,25 @@
22
22
  },
23
23
  "devDependencies": {
24
24
  "@jest/globals": "^29.7.0",
25
+ "@langchain/core": "^0.3.31",
25
26
  "@langchain/scripts": "^0.1.4",
26
27
  "@tsconfig/recommended": "^1.0.2",
27
28
  "@types/jest": "^29.5.12",
28
29
  "@types/node": "^20.12.12",
29
30
  "@types/uuid": "^9.0.1",
31
+ "@types/react": "18.3.2",
30
32
  "concat-md": "^0.5.1",
31
33
  "jest": "^29.7.0",
32
34
  "prettier": "^3.2.5",
33
35
  "ts-jest": "^29.1.2",
34
36
  "typedoc": "^0.26.1",
35
37
  "typedoc-plugin-markdown": "^4.1.0",
36
- "typescript": "^5.4.5"
38
+ "typescript": "^5.4.5",
39
+ "react": "^18.3.1"
40
+ },
41
+ "peerDependencies": {
42
+ "react": "^18 || ^19",
43
+ "@langchain/core": ">=0.2.31 <0.4.0"
37
44
  },
38
45
  "exports": {
39
46
  ".": {
@@ -54,6 +61,15 @@
54
61
  "import": "./client.js",
55
62
  "require": "./client.cjs"
56
63
  },
64
+ "./react": {
65
+ "types": {
66
+ "import": "./react.d.ts",
67
+ "require": "./react.d.cts",
68
+ "default": "./react.d.ts"
69
+ },
70
+ "import": "./react.js",
71
+ "require": "./react.cjs"
72
+ },
57
73
  "./package.json": "./package.json"
58
74
  },
59
75
  "files": [
@@ -65,6 +81,10 @@
65
81
  "client.cjs",
66
82
  "client.js",
67
83
  "client.d.ts",
68
- "client.d.cts"
84
+ "client.d.cts",
85
+ "react.cjs",
86
+ "react.js",
87
+ "react.d.ts",
88
+ "react.d.cts"
69
89
  ]
70
90
  }
package/react.cjs ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/react/index.cjs');
package/react.d.cts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/react/index.js'
package/react.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/react/index.js'
package/react.js ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/react/index.js'
@@ -1,7 +0,0 @@
1
- "use strict";
2
- // From https://github.com/rexxars/eventsource-parser
3
- // Inlined due to CJS import issues
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.createParser = void 0;
6
- var parse_js_1 = require("./parse.cjs");
7
- Object.defineProperty(exports, "createParser", { enumerable: true, get: function () { return parse_js_1.createParser; } });
@@ -1,2 +0,0 @@
1
- export { createParser } from "./parse.js";
2
- export type { EventSourceParseCallback, EventSourceParser, ParsedEvent, ParseEvent, ReconnectInterval, } from "./types.js";
@@ -1,3 +0,0 @@
1
- // From https://github.com/rexxars/eventsource-parser
2
- // Inlined due to CJS import issues
3
- export { createParser } from "./parse.js";