langchain_agentx_stream_ui 0.3.5 → 0.3.7
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/{chunk-6PWGGGUK.js → chunk-24FLS4TF.js} +58 -5
- package/dist/chunk-24FLS4TF.js.map +1 -0
- package/dist/{chunk-GBY5DJ7L.js → chunk-4RIOBLGB.js} +1 -1
- package/dist/chunk-4RIOBLGB.js.map +1 -0
- package/dist/{chunk-FT6UUKPS.js → chunk-7QYE5PN5.js} +5 -5
- package/dist/chunk-7QYE5PN5.js.map +1 -0
- package/dist/{chunk-6Z4ZF36Z.js → chunk-DP7V33X7.js} +1 -1
- package/dist/chunk-DP7V33X7.js.map +1 -0
- package/dist/{chunk-TCKOXX7O.js → chunk-MRGHYRSV.js} +4 -4
- package/dist/chunk-MRGHYRSV.js.map +1 -0
- package/dist/{chunk-FL2G7SV3.js → chunk-QL3DIGFI.js} +2 -2
- package/dist/chunk-QL3DIGFI.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/{multi-session-CerO558Y.d.ts → multi-session-CsPvSE9d.d.ts} +9 -3
- package/dist/multi-session.d.ts +1 -1
- package/dist/multi-session.js +6 -6
- package/dist/tools-presentation.js +2 -2
- package/dist/tools.js +4 -4
- package/dist/virtual.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-6PWGGGUK.js.map +0 -1
- package/dist/chunk-6Z4ZF36Z.js.map +0 -1
- package/dist/chunk-FL2G7SV3.js.map +0 -1
- package/dist/chunk-FT6UUKPS.js.map +0 -1
- package/dist/chunk-GBY5DJ7L.js.map +0 -1
- package/dist/chunk-TCKOXX7O.js.map +0 -1
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
extractLastToolInfoFromProgress,
|
|
16
16
|
formatExploreSummaryText,
|
|
17
17
|
formatThoughtDurationPrefix
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QL3DIGFI.js";
|
|
19
19
|
|
|
20
20
|
// src/types/tree.ts
|
|
21
21
|
function createEmptyTree() {
|
|
@@ -77,6 +77,8 @@ var DEFAULT_EVENT_TIERS = {
|
|
|
77
77
|
"subagent-model-step": "collapsed",
|
|
78
78
|
"hook-progress": "debug",
|
|
79
79
|
"hook-finished": "debug",
|
|
80
|
+
"api-retry": "debug",
|
|
81
|
+
"assistant-turn-superseded": "main",
|
|
80
82
|
"compact-start": "debug",
|
|
81
83
|
"compact-end": "debug",
|
|
82
84
|
"task-started": "debug",
|
|
@@ -483,23 +485,31 @@ function parseSnapshotTasks(rawTasks) {
|
|
|
483
485
|
}
|
|
484
486
|
|
|
485
487
|
// src/types/modelRetry.ts
|
|
486
|
-
function
|
|
487
|
-
if (data.name !== "model_retry") return null;
|
|
488
|
+
function parseModelRetryFields(data, timestampMs) {
|
|
488
489
|
const attempt = typeof data.attempt === "number" ? data.attempt : Number(data.attempt);
|
|
489
490
|
const maxRetries = typeof data.max_retries === "number" ? data.max_retries : Number(data.max_retries);
|
|
490
491
|
const retryDelayMs = typeof data.retry_delay_ms === "number" ? data.retry_delay_ms : Number(data.retry_delay_ms ?? 0);
|
|
491
492
|
if (!Number.isFinite(attempt) || !Number.isFinite(maxRetries)) return null;
|
|
493
|
+
const errorCategory = typeof data.error_category === "string" ? data.error_category : typeof data.error === "string" ? data.error : "api_error";
|
|
492
494
|
return {
|
|
493
495
|
attempt: Math.max(1, Math.floor(attempt)),
|
|
494
496
|
maxRetries: Math.max(1, Math.floor(maxRetries)),
|
|
495
497
|
retryDelayMs: Number.isFinite(retryDelayMs) ? Math.max(0, retryDelayMs) : 0,
|
|
496
|
-
errorCategory
|
|
498
|
+
errorCategory,
|
|
497
499
|
errorMessage: typeof data.error_message === "string" ? data.error_message : "",
|
|
498
500
|
errorStatus: typeof data.error_status === "number" ? data.error_status : data.error_status != null ? Number(data.error_status) : null,
|
|
499
501
|
phase: typeof data.phase === "string" ? data.phase : "scheduled",
|
|
500
502
|
updatedAt: timestampMs
|
|
501
503
|
};
|
|
502
504
|
}
|
|
505
|
+
function parseApiRetryEventData(data, timestampMs) {
|
|
506
|
+
if (data.subtype !== "api_retry") return null;
|
|
507
|
+
return parseModelRetryFields(data, timestampMs);
|
|
508
|
+
}
|
|
509
|
+
function parseModelRetryHookData(data, timestampMs) {
|
|
510
|
+
if (data.name !== "model_retry") return null;
|
|
511
|
+
return parseModelRetryFields(data, timestampMs);
|
|
512
|
+
}
|
|
503
513
|
function formatModelRetryCategoryLabel(category) {
|
|
504
514
|
switch (category) {
|
|
505
515
|
case "server_overload":
|
|
@@ -787,6 +797,43 @@ function appendTaskDebugEvent(tree, event, eventIndex) {
|
|
|
787
797
|
data: event.data
|
|
788
798
|
});
|
|
789
799
|
}
|
|
800
|
+
function findLastMainStageTextNodeId(tree) {
|
|
801
|
+
const childIds = getActiveChildIds(tree);
|
|
802
|
+
for (let i = childIds.length - 1; i >= 0; i -= 1) {
|
|
803
|
+
const node = tree.byId[childIds[i]];
|
|
804
|
+
if (node?.kind === "text") {
|
|
805
|
+
return node.id;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
return void 0;
|
|
809
|
+
}
|
|
810
|
+
function removeMainStageTextNode(tree, nodeId) {
|
|
811
|
+
delete tree.byId[nodeId];
|
|
812
|
+
tree.rootChildren = tree.rootChildren.filter((id) => id !== nodeId);
|
|
813
|
+
}
|
|
814
|
+
function handleAssistantTurnSuperseded(tree) {
|
|
815
|
+
clearModelRetry(tree);
|
|
816
|
+
const hadDeferredPartial = Boolean(tree.deferredMainText);
|
|
817
|
+
tree.deferredMainText = "";
|
|
818
|
+
const streaming = findStreamingNode(tree, "text");
|
|
819
|
+
if (streaming) {
|
|
820
|
+
removeMainStageTextNode(tree, streaming.id);
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
if (!hadDeferredPartial) {
|
|
824
|
+
const lastTextId = findLastMainStageTextNodeId(tree);
|
|
825
|
+
if (lastTextId) {
|
|
826
|
+
removeMainStageTextNode(tree, lastTextId);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
function handleApiRetry(tree, event) {
|
|
831
|
+
const data = event.data;
|
|
832
|
+
const modelRetry = parseApiRetryEventData(data, eventTimeToMs(event.timestamp));
|
|
833
|
+
if (modelRetry) {
|
|
834
|
+
tree.modelRetry = modelRetry;
|
|
835
|
+
}
|
|
836
|
+
}
|
|
790
837
|
function handleHookProgress(tree, event) {
|
|
791
838
|
const data = event.data;
|
|
792
839
|
const modelRetry = parseModelRetryHookData(data, eventTimeToMs(event.timestamp));
|
|
@@ -1346,6 +1393,9 @@ function handleDebug(tree, event, eventIndex, parentNodeId, collectDebug) {
|
|
|
1346
1393
|
appendTaskDebugEvent(tree, event, eventIndex);
|
|
1347
1394
|
}
|
|
1348
1395
|
switch (event.event_type) {
|
|
1396
|
+
case "api-retry":
|
|
1397
|
+
handleApiRetry(tree, event);
|
|
1398
|
+
break;
|
|
1349
1399
|
case "hook-progress":
|
|
1350
1400
|
handleHookProgress(tree, event);
|
|
1351
1401
|
break;
|
|
@@ -1542,6 +1592,9 @@ function applyClassified(tree, classified, eventIndex, options) {
|
|
|
1542
1592
|
handleTextEnd(tree, event);
|
|
1543
1593
|
break;
|
|
1544
1594
|
}
|
|
1595
|
+
case "assistant-turn-superseded":
|
|
1596
|
+
handleAssistantTurnSuperseded(tree);
|
|
1597
|
+
break;
|
|
1545
1598
|
case "reasoning-start":
|
|
1546
1599
|
if (isDroppedByEmitterRoute(event.data)) break;
|
|
1547
1600
|
if (isSubagentScopedReasoningEvent(event.data)) break;
|
|
@@ -5507,4 +5560,4 @@ export {
|
|
|
5507
5560
|
VirtualTimeline,
|
|
5508
5561
|
SessionTimeline
|
|
5509
5562
|
};
|
|
5510
|
-
//# sourceMappingURL=chunk-
|
|
5563
|
+
//# sourceMappingURL=chunk-24FLS4TF.js.map
|