@langchain/langgraph-sdk 1.12.4 → 1.12.6
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/client/stream/handles/subagents.cjs +9 -2
- package/dist/client/stream/handles/subagents.cjs.map +1 -1
- package/dist/client/stream/handles/subagents.d.cts.map +1 -1
- package/dist/client/stream/handles/subagents.d.ts.map +1 -1
- package/dist/client/stream/handles/subagents.js +10 -3
- package/dist/client/stream/handles/subagents.js.map +1 -1
- package/dist/client/stream/handles/subgraphs.cjs +24 -2
- package/dist/client/stream/handles/subgraphs.cjs.map +1 -1
- package/dist/client/stream/handles/subgraphs.d.cts.map +1 -1
- package/dist/client/stream/handles/subgraphs.d.ts.map +1 -1
- package/dist/client/stream/handles/subgraphs.js +24 -3
- package/dist/client/stream/handles/subgraphs.js.map +1 -1
- package/dist/client/stream/index.cjs +17 -7
- package/dist/client/stream/index.cjs.map +1 -1
- package/dist/client/stream/index.d.cts.map +1 -1
- package/dist/client/stream/index.d.ts.map +1 -1
- package/dist/client/stream/index.js +17 -7
- package/dist/client/stream/index.js.map +1 -1
- package/dist/client/stream/messages.cjs +66 -2
- package/dist/client/stream/messages.cjs.map +1 -1
- package/dist/client/stream/messages.d.cts +14 -1
- package/dist/client/stream/messages.d.cts.map +1 -1
- package/dist/client/stream/messages.d.ts +14 -1
- package/dist/client/stream/messages.d.ts.map +1 -1
- package/dist/client/stream/messages.js +66 -2
- package/dist/client/stream/messages.js.map +1 -1
- package/dist/client/stream/transport/http.cjs +1 -12
- package/dist/client/stream/transport/http.cjs.map +1 -1
- package/dist/client/stream/transport/http.d.cts.map +1 -1
- package/dist/client/stream/transport/http.d.ts.map +1 -1
- package/dist/client/stream/transport/http.js +1 -12
- package/dist/client/stream/transport/http.js.map +1 -1
- package/dist/client/stream/transport/utils.cjs +12 -0
- package/dist/client/stream/transport/utils.cjs.map +1 -1
- package/dist/client/stream/transport/utils.js +12 -1
- package/dist/client/stream/transport/utils.js.map +1 -1
- package/dist/client/stream/transport/websocket.cjs +33 -3
- package/dist/client/stream/transport/websocket.cjs.map +1 -1
- package/dist/client/stream/transport/websocket.d.cts +4 -1
- package/dist/client/stream/transport/websocket.d.cts.map +1 -1
- package/dist/client/stream/transport/websocket.d.ts +4 -1
- package/dist/client/stream/transport/websocket.d.ts.map +1 -1
- package/dist/client/stream/transport/websocket.js +34 -4
- package/dist/client/stream/transport/websocket.js.map +1 -1
- package/dist/stream/controller.cjs +94 -3
- package/dist/stream/controller.cjs.map +1 -1
- package/dist/stream/controller.d.cts.map +1 -1
- package/dist/stream/controller.d.ts.map +1 -1
- package/dist/stream/controller.js +94 -3
- package/dist/stream/controller.js.map +1 -1
- package/dist/stream/lifecycle-loading-tracker.cjs +5 -0
- package/dist/stream/lifecycle-loading-tracker.cjs.map +1 -1
- package/dist/stream/lifecycle-loading-tracker.js +5 -0
- package/dist/stream/lifecycle-loading-tracker.js.map +1 -1
- package/dist/stream/projections/messages.cjs +45 -12
- package/dist/stream/projections/messages.cjs.map +1 -1
- package/dist/stream/projections/messages.js +45 -12
- package/dist/stream/projections/messages.js.map +1 -1
- package/dist/stream/root-message-projection.cjs +71 -8
- package/dist/stream/root-message-projection.cjs.map +1 -1
- package/dist/stream/root-message-projection.js +71 -8
- package/dist/stream/root-message-projection.js.map +1 -1
- package/dist/stream/submit-coordinator.cjs +7 -2
- package/dist/stream/submit-coordinator.cjs.map +1 -1
- package/dist/stream/submit-coordinator.js +7 -2
- package/dist/stream/submit-coordinator.js.map +1 -1
- package/package.json +2 -2
|
@@ -541,10 +541,17 @@ var ThreadStream = class {
|
|
|
541
541
|
this.#messagesIterable = buffer;
|
|
542
542
|
const assembler = new require_messages$1.StreamingMessageAssembler();
|
|
543
543
|
this.#startProjection(["messages", ...this.#lifecycleChannels()], (event) => {
|
|
544
|
+
if (isRootTerminalLifecycle(event)) {
|
|
545
|
+
assembler.abandonActive();
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
544
548
|
if (event.method !== "messages") return;
|
|
545
549
|
const msg = assembler.consume(event);
|
|
546
550
|
if (msg) buffer.push(require_messages$1.toStreamingMessageHandle(msg));
|
|
547
|
-
}, () =>
|
|
551
|
+
}, () => {
|
|
552
|
+
assembler.abandonActive();
|
|
553
|
+
buffer.close();
|
|
554
|
+
});
|
|
548
555
|
return buffer;
|
|
549
556
|
}
|
|
550
557
|
/**
|
|
@@ -1422,10 +1429,7 @@ var ThreadStream = class {
|
|
|
1422
1429
|
for await (const message of this.#transportAdapter.events()) this.#handleIncoming(message);
|
|
1423
1430
|
for (const subscription of this.#subscriptions.values()) subscription.close();
|
|
1424
1431
|
} catch (error) {
|
|
1425
|
-
|
|
1426
|
-
for (const pending of this.#pending.values()) pending.reject(normalized);
|
|
1427
|
-
for (const subscription of this.#subscriptions.values()) subscription.close();
|
|
1428
|
-
this.#pending.clear();
|
|
1432
|
+
this.#failThreadWithError(error);
|
|
1429
1433
|
}
|
|
1430
1434
|
}
|
|
1431
1435
|
/**
|
|
@@ -1476,7 +1480,7 @@ var ThreadStream = class {
|
|
|
1476
1480
|
subscription.push(message);
|
|
1477
1481
|
fannedToAny = true;
|
|
1478
1482
|
}
|
|
1479
|
-
if (fannedToAny && this.#terminalPauseSeq !== void 0
|
|
1483
|
+
if (fannedToAny && this.#terminalPauseSeq !== void 0) {
|
|
1480
1484
|
const eventSeq = typeof message.seq === "number" ? message.seq : void 0;
|
|
1481
1485
|
const terminalSeq = this.#terminalPauseSeq;
|
|
1482
1486
|
if (terminalSeq === null || eventSeq == null || eventSeq > terminalSeq) {
|
|
@@ -1525,7 +1529,13 @@ var ThreadStream = class {
|
|
|
1525
1529
|
reject
|
|
1526
1530
|
});
|
|
1527
1531
|
});
|
|
1528
|
-
|
|
1532
|
+
let immediate;
|
|
1533
|
+
try {
|
|
1534
|
+
immediate = await this.#transportAdapter.send(command);
|
|
1535
|
+
} catch (error) {
|
|
1536
|
+
this.#pending.delete(id);
|
|
1537
|
+
throw error;
|
|
1538
|
+
}
|
|
1529
1539
|
if (immediate) {
|
|
1530
1540
|
this.#pending.delete(id);
|
|
1531
1541
|
if (immediate.type === "error") throw new require_error.ProtocolError(immediate);
|