@axiom-lattice/react-sdk 10.0.1 → 10.0.2
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/{AgentDetailSideApp-RJDUVH6V.mjs → AgentDetailSideApp-TBRWTSRK.mjs} +11 -11
- package/dist/AgentGovernanceWorkbench-AHFQR42S.mjs +24 -0
- package/dist/{LangfuseDashboard-LK6FMAUK.mjs → LangfuseDashboard-IQVQ65ZY.mjs} +2 -2
- package/dist/{MessageGraph-KTEIZSCZ.mjs → MessageGraph-SOU3QSYM.mjs} +7 -7
- package/dist/{ReactChart-HZBWORWI.mjs → ReactChart-33DCEDLY.mjs} +7 -7
- package/dist/SkillFlow-KWMQYLOM.mjs +14 -0
- package/dist/{TasksSideApp-SBPJZOKE.mjs → TasksSideApp-66BUD5LP.mjs} +8 -8
- package/dist/ThreadMaintenancePanel-ISI24BAC.mjs +12 -0
- package/dist/{TopologyRuntimeView-IONHOJFM.mjs → TopologyRuntimeView-ANIQQMP5.mjs} +8 -8
- package/dist/WorkflowAutomationView-I6CODQ2V.mjs +22 -0
- package/dist/{chunk-WQEPGDQ7.mjs → chunk-3L3D2DOF.mjs} +221 -85
- package/dist/chunk-3L3D2DOF.mjs.map +1 -0
- package/dist/{chunk-ZHGPRA23.mjs → chunk-75Q63EWC.mjs} +3 -3
- package/dist/{chunk-FFMVKPES.mjs → chunk-7RJ6O6NC.mjs} +7 -7
- package/dist/{chunk-VUYGRLOR.mjs → chunk-B3YV6ACN.mjs} +4 -4
- package/dist/{chunk-X5U6JFUH.mjs → chunk-K3N4JG7L.mjs} +3 -3
- package/dist/{chunk-SWNS75PP.mjs → chunk-MALQGEZT.mjs} +4 -4
- package/dist/{chunk-Z4X6WD6O.mjs → chunk-OAZGMAMX.mjs} +10 -10
- package/dist/{chunk-ZSCS4Z7B.mjs → chunk-OOMJJ4W3.mjs} +3 -3
- package/dist/{chunk-VO6IQKQE.mjs → chunk-PN5AX2AV.mjs} +4 -4
- package/dist/{chunk-4JSHDMRW.mjs → chunk-RJQSM4Z6.mjs} +2 -2
- package/dist/{chunk-ET6QYRK3.mjs → chunk-RXELOKHZ.mjs} +8 -8
- package/dist/{chunk-ARD4OJRP.mjs → chunk-RZIYUI3J.mjs} +3 -3
- package/dist/{chunk-6GMM7FIQ.mjs → chunk-S44KQ2OB.mjs} +3 -3
- package/dist/{chunk-2R3WX6FB.mjs → chunk-XWELHNBD.mjs} +3 -3
- package/dist/{embed-page-AgentDetailSideApp-L37KFUAY.js → embed-page-AgentDetailSideApp-RTJXIZJ6.js} +1 -1
- package/dist/{embed-page-AgentGovernanceWorkbench-LDNC3EUU.js → embed-page-AgentGovernanceWorkbench-IVML6LV6.js} +1 -1
- package/dist/{embed-page-LangfuseDashboard-CZUVA4MI.js → embed-page-LangfuseDashboard-NJSQW3LX.js} +1 -1
- package/dist/{embed-page-MessageGraph-KSPQ5GHB.js → embed-page-MessageGraph-CATE2Z5W.js} +1 -1
- package/dist/{embed-page-ReactChart-MH7DGSYJ.js → embed-page-ReactChart-6H2GVFRY.js} +1 -1
- package/dist/{embed-page-SkillFlow-TFHDI63I.js → embed-page-SkillFlow-Z5GOUWPH.js} +1 -1
- package/dist/{embed-page-TasksSideApp-ZOQ34RII.js → embed-page-TasksSideApp-S6ZAHIYP.js} +1 -1
- package/dist/{embed-page-ThreadMaintenancePanel-PTUGZRLJ.js → embed-page-ThreadMaintenancePanel-NRNZHEND.js} +1 -1
- package/dist/{embed-page-TopologyRuntimeView-EHN2VA2Z.js → embed-page-TopologyRuntimeView-5UWD6CMT.js} +1 -1
- package/dist/{embed-page-WorkflowAutomationView-IUGJ54RV.js → embed-page-WorkflowAutomationView-2EWPK4ZK.js} +1 -1
- package/dist/{embed-page-chunk-K74FZI4X.js → embed-page-chunk-4D5PY2CF.js} +1 -1
- package/dist/{embed-page-chunk-3E5B2KJT.js → embed-page-chunk-7XPK5RLA.js} +1 -1
- package/dist/{embed-page-chunk-UJCEOILF.js → embed-page-chunk-HKFKNIOM.js} +1 -1
- package/dist/embed-page-chunk-JPRKPIYC.js +6947 -0
- package/dist/{embed-page-chunk-VEBSRO4A.js → embed-page-chunk-PSWN2QFI.js} +1 -1
- package/dist/{embed-page-chunk-5DSJCBZF.js → embed-page-chunk-PY2HBRFF.js} +1 -1
- package/dist/{embed-page-chunk-3PGODDQW.js → embed-page-chunk-RFN7O6VH.js} +1 -1
- package/dist/{embed-page-chunk-XVDCWRYF.js → embed-page-chunk-VQMQROAS.js} +1 -1
- package/dist/{embed-page-chunk-5GAHI45T.js → embed-page-chunk-WR44MKDA.js} +1 -1
- package/dist/{embed-page-chunk-FU755EE4.js → embed-page-chunk-YCEMHL2H.js} +1 -1
- package/dist/{embed-page-en-XKIIMNZ7.js → embed-page-en-TQ2XQQ5G.js} +1 -1
- package/dist/{embed-page-zh-F4WCA6SW.js → embed-page-zh-HRXFYKH4.js} +1 -1
- package/dist/embed-page.js +1 -1
- package/dist/{en-BN5NSY7L.mjs → en-NQWIZVRF.mjs} +5 -2
- package/dist/{en-BN5NSY7L.mjs.map → en-NQWIZVRF.mjs.map} +1 -1
- package/dist/index.d.mts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +1894 -1752
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -14
- package/dist/web-app.js +8 -2
- package/dist/web-app.js.map +1 -1
- package/dist/web-app.mjs +2 -2
- package/dist/{zh-MRVMQMO7.mjs → zh-33HUODZ6.mjs} +5 -2
- package/dist/{zh-MRVMQMO7.mjs.map → zh-33HUODZ6.mjs.map} +1 -1
- package/package.json +3 -3
- package/dist/AgentGovernanceWorkbench-SM54EUAP.mjs +0 -24
- package/dist/SkillFlow-R6WFP542.mjs +0 -14
- package/dist/ThreadMaintenancePanel-P27YA2AI.mjs +0 -12
- package/dist/WorkflowAutomationView-EMCAY3OI.mjs +0 -22
- package/dist/chunk-WQEPGDQ7.mjs.map +0 -1
- package/dist/embed-page-chunk-4N7B6POU.js +0 -6947
- /package/dist/{AgentDetailSideApp-RJDUVH6V.mjs.map → AgentDetailSideApp-TBRWTSRK.mjs.map} +0 -0
- /package/dist/{AgentGovernanceWorkbench-SM54EUAP.mjs.map → AgentGovernanceWorkbench-AHFQR42S.mjs.map} +0 -0
- /package/dist/{LangfuseDashboard-LK6FMAUK.mjs.map → LangfuseDashboard-IQVQ65ZY.mjs.map} +0 -0
- /package/dist/{MessageGraph-KTEIZSCZ.mjs.map → MessageGraph-SOU3QSYM.mjs.map} +0 -0
- /package/dist/{ReactChart-HZBWORWI.mjs.map → ReactChart-33DCEDLY.mjs.map} +0 -0
- /package/dist/{SkillFlow-R6WFP542.mjs.map → SkillFlow-KWMQYLOM.mjs.map} +0 -0
- /package/dist/{TasksSideApp-SBPJZOKE.mjs.map → TasksSideApp-66BUD5LP.mjs.map} +0 -0
- /package/dist/{ThreadMaintenancePanel-P27YA2AI.mjs.map → ThreadMaintenancePanel-ISI24BAC.mjs.map} +0 -0
- /package/dist/{TopologyRuntimeView-IONHOJFM.mjs.map → TopologyRuntimeView-ANIQQMP5.mjs.map} +0 -0
- /package/dist/{WorkflowAutomationView-EMCAY3OI.mjs.map → WorkflowAutomationView-I6CODQ2V.mjs.map} +0 -0
- /package/dist/{chunk-ZHGPRA23.mjs.map → chunk-75Q63EWC.mjs.map} +0 -0
- /package/dist/{chunk-FFMVKPES.mjs.map → chunk-7RJ6O6NC.mjs.map} +0 -0
- /package/dist/{chunk-VUYGRLOR.mjs.map → chunk-B3YV6ACN.mjs.map} +0 -0
- /package/dist/{chunk-X5U6JFUH.mjs.map → chunk-K3N4JG7L.mjs.map} +0 -0
- /package/dist/{chunk-SWNS75PP.mjs.map → chunk-MALQGEZT.mjs.map} +0 -0
- /package/dist/{chunk-Z4X6WD6O.mjs.map → chunk-OAZGMAMX.mjs.map} +0 -0
- /package/dist/{chunk-ZSCS4Z7B.mjs.map → chunk-OOMJJ4W3.mjs.map} +0 -0
- /package/dist/{chunk-VO6IQKQE.mjs.map → chunk-PN5AX2AV.mjs.map} +0 -0
- /package/dist/{chunk-4JSHDMRW.mjs.map → chunk-RJQSM4Z6.mjs.map} +0 -0
- /package/dist/{chunk-ET6QYRK3.mjs.map → chunk-RXELOKHZ.mjs.map} +0 -0
- /package/dist/{chunk-ARD4OJRP.mjs.map → chunk-RZIYUI3J.mjs.map} +0 -0
- /package/dist/{chunk-6GMM7FIQ.mjs.map → chunk-S44KQ2OB.mjs.map} +0 -0
- /package/dist/{chunk-2R3WX6FB.mjs.map → chunk-XWELHNBD.mjs.map} +0 -0
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
useTenantBranding,
|
|
20
20
|
useWorkspaceContext,
|
|
21
21
|
useWorkspaceContextOptional
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-75Q63EWC.mjs";
|
|
23
23
|
import {
|
|
24
24
|
CreateSkillModal,
|
|
25
25
|
useApi
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-OOMJJ4W3.mjs";
|
|
27
27
|
import {
|
|
28
28
|
AxiomLatticeProvider,
|
|
29
29
|
DEFAULT_MIDDLEWARE_TYPES,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
useClient,
|
|
35
35
|
useLatticeChatShellContext,
|
|
36
36
|
useOptionalClient
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-K3N4JG7L.mjs";
|
|
38
38
|
import {
|
|
39
39
|
XMarkdown_default,
|
|
40
40
|
formatErrorMessage,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
import {
|
|
44
44
|
useLocale,
|
|
45
45
|
useT
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-RZIYUI3J.mjs";
|
|
47
47
|
|
|
48
48
|
// src/AppRegistry.ts
|
|
49
49
|
var AppRegistryImpl = class {
|
|
@@ -975,6 +975,7 @@ function AgentThreadProvider({
|
|
|
975
975
|
isLoading: false,
|
|
976
976
|
error: null,
|
|
977
977
|
stopReason: null,
|
|
978
|
+
stopPending: false,
|
|
978
979
|
interrupts: void 0,
|
|
979
980
|
interruptNotice: null,
|
|
980
981
|
agentState: null,
|
|
@@ -1041,6 +1042,10 @@ function AgentThreadProvider({
|
|
|
1041
1042
|
onStreamCompletedRef.current = onStreamCompleted;
|
|
1042
1043
|
const pendingIdsRef = useRef2(/* @__PURE__ */ new Set());
|
|
1043
1044
|
const activeRunsRef = useRef2(/* @__PURE__ */ new Map());
|
|
1045
|
+
const stopPendingRef = useRef2(false);
|
|
1046
|
+
const stopRequestSeqRef = useRef2(0);
|
|
1047
|
+
const stopConfirmationTimerRef = useRef2(null);
|
|
1048
|
+
const stopPollTimerRef = useRef2(null);
|
|
1044
1049
|
const commandRunObservationRef = useRef2(null);
|
|
1045
1050
|
const inFlightRef = useRef2(0);
|
|
1046
1051
|
const dismissedInterruptIdsRef = useRef2(/* @__PURE__ */ new Set());
|
|
@@ -1111,6 +1116,83 @@ function AgentThreadProvider({
|
|
|
1111
1116
|
const getOwnedLoading = useCallback2(() => historyLoadingRef.current || inFlightRef.current > 0 || streamActiveRef.current, []);
|
|
1112
1117
|
const activeRunRecordsRef = useRef2([]);
|
|
1113
1118
|
activeRunRecordsRef.current = state2.activeRuns;
|
|
1119
|
+
const clearStopWait = useCallback2(() => {
|
|
1120
|
+
if (stopConfirmationTimerRef.current !== null) {
|
|
1121
|
+
clearTimeout(stopConfirmationTimerRef.current);
|
|
1122
|
+
stopConfirmationTimerRef.current = null;
|
|
1123
|
+
}
|
|
1124
|
+
if (stopPollTimerRef.current !== null) {
|
|
1125
|
+
clearTimeout(stopPollTimerRef.current);
|
|
1126
|
+
stopPollTimerRef.current = null;
|
|
1127
|
+
}
|
|
1128
|
+
}, []);
|
|
1129
|
+
const settleStop = useCallback2(() => {
|
|
1130
|
+
if (!stopPendingRef.current) return;
|
|
1131
|
+
stopPendingRef.current = false;
|
|
1132
|
+
clearStopWait();
|
|
1133
|
+
streamStopGenerationRef.current += 1;
|
|
1134
|
+
streamActiveRef.current = false;
|
|
1135
|
+
activeRunsRef.current.clear();
|
|
1136
|
+
pendingIdsRef.current.clear();
|
|
1137
|
+
threadStreamRef.current?.stop();
|
|
1138
|
+
const isLoading = getOwnedLoading();
|
|
1139
|
+
isLoadingRef.current = isLoading;
|
|
1140
|
+
setState((prev) => ({
|
|
1141
|
+
...prev,
|
|
1142
|
+
messages: chunkMessageMerger.current.getMessages(),
|
|
1143
|
+
isLoading,
|
|
1144
|
+
stopPending: false,
|
|
1145
|
+
stopReason: "aborted",
|
|
1146
|
+
error: null,
|
|
1147
|
+
interruptNotice: null,
|
|
1148
|
+
pendingMessages: [],
|
|
1149
|
+
activeRuns: []
|
|
1150
|
+
}));
|
|
1151
|
+
}, [clearStopWait, getOwnedLoading]);
|
|
1152
|
+
const failStop = useCallback2((messageKey) => {
|
|
1153
|
+
if (!stopPendingRef.current) return;
|
|
1154
|
+
stopPendingRef.current = false;
|
|
1155
|
+
clearStopWait();
|
|
1156
|
+
setState((prev) => ({
|
|
1157
|
+
...prev,
|
|
1158
|
+
stopPending: false,
|
|
1159
|
+
stopReason: null,
|
|
1160
|
+
error: new Error(tRef.current(messageKey))
|
|
1161
|
+
}));
|
|
1162
|
+
}, [clearStopWait]);
|
|
1163
|
+
const startStopWait = useCallback2((requestId, targetAssistantId) => {
|
|
1164
|
+
clearStopWait();
|
|
1165
|
+
const timeoutMs = options.stopConfirmationTimeoutMs ?? 15e3;
|
|
1166
|
+
const deadline = Date.now() + timeoutMs;
|
|
1167
|
+
const failIfStale = () => requestId !== stopRequestSeqRef.current || !stopPendingRef.current;
|
|
1168
|
+
const poll = async () => {
|
|
1169
|
+
if (failIfStale()) return;
|
|
1170
|
+
if (typeof client.runs?.listActive === "function") {
|
|
1171
|
+
try {
|
|
1172
|
+
const runs = await client.runs.listActive(threadId, targetAssistantId);
|
|
1173
|
+
if (failIfStale()) return;
|
|
1174
|
+
if (Array.isArray(runs) && runs.length === 0) {
|
|
1175
|
+
settleStop();
|
|
1176
|
+
return;
|
|
1177
|
+
}
|
|
1178
|
+
} catch {
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
if (failIfStale()) return;
|
|
1182
|
+
if (Date.now() >= deadline) {
|
|
1183
|
+
failStop("chat.error.stopTimeout");
|
|
1184
|
+
return;
|
|
1185
|
+
}
|
|
1186
|
+
stopPollTimerRef.current = setTimeout(() => {
|
|
1187
|
+
void poll();
|
|
1188
|
+
}, 300);
|
|
1189
|
+
};
|
|
1190
|
+
stopConfirmationTimerRef.current = setTimeout(() => {
|
|
1191
|
+
if (failIfStale()) return;
|
|
1192
|
+
failStop("chat.error.stopTimeout");
|
|
1193
|
+
}, timeoutMs);
|
|
1194
|
+
void poll();
|
|
1195
|
+
}, [clearStopWait, client, failStop, options.stopConfirmationTimeoutMs, settleStop, threadId]);
|
|
1114
1196
|
const refreshActiveRuns = useCallback2(async () => {
|
|
1115
1197
|
const inFlight = activeRunsInFlightRef.current;
|
|
1116
1198
|
if (inFlight) return inFlight;
|
|
@@ -1243,6 +1325,10 @@ function AgentThreadProvider({
|
|
|
1243
1325
|
if (commandRunObservationRef.current) {
|
|
1244
1326
|
commandRunObservationRef.current.settledByStream = true;
|
|
1245
1327
|
}
|
|
1328
|
+
if (isStop && stopPendingRef.current) {
|
|
1329
|
+
settleStop();
|
|
1330
|
+
return;
|
|
1331
|
+
}
|
|
1246
1332
|
releaseActiveRunForChunk(anyChunk.data?.id);
|
|
1247
1333
|
const isLoading = getOwnedLoading();
|
|
1248
1334
|
isLoadingRef.current = isLoading;
|
|
@@ -1325,6 +1411,10 @@ function AgentThreadProvider({
|
|
|
1325
1411
|
const isStopSignal = interrupt !== void 0 || anyChunk.type === "message_failed" || anyChunk.type === "message_completed" || anyChunk.type === "thread_idle";
|
|
1326
1412
|
if (isStopSignal) {
|
|
1327
1413
|
if (currentThreadIdRef.current !== threadId) return;
|
|
1414
|
+
if (stopPendingRef.current) {
|
|
1415
|
+
settleStop();
|
|
1416
|
+
return;
|
|
1417
|
+
}
|
|
1328
1418
|
streamActiveRef.current = false;
|
|
1329
1419
|
if (commandRunObservationRef.current) {
|
|
1330
1420
|
commandRunObservationRef.current.settledByStream = true;
|
|
@@ -1377,6 +1467,7 @@ function AgentThreadProvider({
|
|
|
1377
1467
|
releaseActiveRunForChunk,
|
|
1378
1468
|
releaseOldestActiveRun,
|
|
1379
1469
|
refreshActiveRuns,
|
|
1470
|
+
settleStop,
|
|
1380
1471
|
t
|
|
1381
1472
|
]
|
|
1382
1473
|
);
|
|
@@ -1453,6 +1544,8 @@ function AgentThreadProvider({
|
|
|
1453
1544
|
}
|
|
1454
1545
|
}
|
|
1455
1546
|
inFlightRef.current += 1;
|
|
1547
|
+
stopPendingRef.current = false;
|
|
1548
|
+
clearStopWait();
|
|
1456
1549
|
if (wasIdle || isHitlResume) {
|
|
1457
1550
|
const isLoading = getOwnedLoading();
|
|
1458
1551
|
isLoadingRef.current = isLoading;
|
|
@@ -1460,12 +1553,13 @@ function AgentThreadProvider({
|
|
|
1460
1553
|
...prev,
|
|
1461
1554
|
isLoading,
|
|
1462
1555
|
error: null,
|
|
1556
|
+
stopPending: false,
|
|
1463
1557
|
stopReason: null,
|
|
1464
1558
|
interruptNotice: null,
|
|
1465
1559
|
interrupts: remainingInterrupts.length ? remainingInterrupts : void 0
|
|
1466
1560
|
}));
|
|
1467
1561
|
} else {
|
|
1468
|
-
setState((prev) => prev.stopReason == null && prev.interruptNotice == null ? prev : { ...prev, stopReason: null, interruptNotice: null });
|
|
1562
|
+
setState((prev) => prev.stopReason == null && prev.interruptNotice == null && !prev.stopPending ? prev : { ...prev, stopPending: false, stopReason: null, interruptNotice: null });
|
|
1469
1563
|
}
|
|
1470
1564
|
pendingIdsRef.current.add(userMessage.id);
|
|
1471
1565
|
setState((prev) => ({
|
|
@@ -1817,6 +1911,7 @@ function AgentThreadProvider({
|
|
|
1817
1911
|
observeCommandRun,
|
|
1818
1912
|
refreshActiveRuns,
|
|
1819
1913
|
trackActiveRun,
|
|
1914
|
+
clearStopWait,
|
|
1820
1915
|
t
|
|
1821
1916
|
]
|
|
1822
1917
|
);
|
|
@@ -2062,84 +2157,101 @@ function AgentThreadProvider({
|
|
|
2062
2157
|
[client, threadId, assistantId, clientAssistantId]
|
|
2063
2158
|
);
|
|
2064
2159
|
const abortAgent = useCallback2(async () => {
|
|
2065
|
-
|
|
2066
|
-
|
|
2160
|
+
if (stopPendingRef.current) return;
|
|
2161
|
+
const requestId = stopRequestSeqRef.current + 1;
|
|
2162
|
+
stopRequestSeqRef.current = requestId;
|
|
2163
|
+
stopPendingRef.current = true;
|
|
2164
|
+
clearStopWait();
|
|
2067
2165
|
commandRunObservationRef.current = null;
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
}
|
|
2166
|
+
setState((prev) => ({
|
|
2167
|
+
...prev,
|
|
2168
|
+
stopPending: true,
|
|
2169
|
+
stopReason: null,
|
|
2170
|
+
error: null,
|
|
2171
|
+
interruptNotice: null
|
|
2172
|
+
}));
|
|
2076
2173
|
const targetAssistantId = assistantId || clientAssistantId;
|
|
2077
|
-
if (targetAssistantId
|
|
2078
|
-
|
|
2174
|
+
if (!targetAssistantId || !threadId) {
|
|
2175
|
+
failStop("chat.error.stopFailed");
|
|
2176
|
+
return;
|
|
2177
|
+
}
|
|
2178
|
+
const isCurrent = () => requestId === stopRequestSeqRef.current && stopPendingRef.current;
|
|
2179
|
+
let cancelled = false;
|
|
2180
|
+
if (typeof client.runs?.cancelActive === "function") {
|
|
2181
|
+
try {
|
|
2182
|
+
const result = await client.runs.cancelActive(threadId, targetAssistantId);
|
|
2183
|
+
if (!isCurrent()) return;
|
|
2184
|
+
if (result.accepted !== false) cancelled = true;
|
|
2185
|
+
} catch (error) {
|
|
2186
|
+
console.error("Failed to cancel active runs:", error);
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
if (!cancelled && typeof client.runs?.cancel === "function") {
|
|
2190
|
+
const candidates = Array.from(activeRunsRef.current.keys());
|
|
2191
|
+
if (candidates.length === 0 && typeof client.runs.list === "function") {
|
|
2079
2192
|
try {
|
|
2080
|
-
const
|
|
2081
|
-
if (
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2193
|
+
const runs = await client.runs.list(threadId, targetAssistantId);
|
|
2194
|
+
if (!isCurrent()) return;
|
|
2195
|
+
const activeRuns = runs.filter(
|
|
2196
|
+
(run) => run.status === "pending" || run.status === "running"
|
|
2197
|
+
);
|
|
2198
|
+
const active = activeRuns.find((run) => run.status === "running") ?? [...activeRuns].sort((a, b) => b.createdAt - a.createdAt)[0];
|
|
2199
|
+
if (active) candidates.push(active.runId);
|
|
2087
2200
|
} catch (error) {
|
|
2088
|
-
console.error("Failed to
|
|
2201
|
+
console.error("Failed to discover active run:", error);
|
|
2089
2202
|
}
|
|
2090
2203
|
}
|
|
2091
|
-
const
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
for (const runId of candidates) {
|
|
2107
|
-
try {
|
|
2108
|
-
await client.runs.cancel(
|
|
2109
|
-
threadId,
|
|
2110
|
-
runId,
|
|
2111
|
-
{ action: "interrupt" },
|
|
2112
|
-
targetAssistantId
|
|
2113
|
-
);
|
|
2204
|
+
for (const runId of candidates) {
|
|
2205
|
+
try {
|
|
2206
|
+
await client.runs.cancel(
|
|
2207
|
+
threadId,
|
|
2208
|
+
runId,
|
|
2209
|
+
{ action: "interrupt" },
|
|
2210
|
+
targetAssistantId
|
|
2211
|
+
);
|
|
2212
|
+
if (!isCurrent()) return;
|
|
2213
|
+
activeRunsRef.current.delete(runId);
|
|
2214
|
+
cancelled = true;
|
|
2215
|
+
break;
|
|
2216
|
+
} catch (error) {
|
|
2217
|
+
if (!isCurrent()) return;
|
|
2218
|
+
if (isRunTerminalError(error)) {
|
|
2114
2219
|
activeRunsRef.current.delete(runId);
|
|
2115
|
-
|
|
2116
|
-
break;
|
|
2117
|
-
} catch (error) {
|
|
2118
|
-
if (isRunTerminalError(error)) {
|
|
2119
|
-
activeRunsRef.current.delete(runId);
|
|
2120
|
-
continue;
|
|
2121
|
-
}
|
|
2122
|
-
console.error("Failed to cancel run:", error);
|
|
2123
|
-
break;
|
|
2220
|
+
continue;
|
|
2124
2221
|
}
|
|
2222
|
+
console.error("Failed to cancel run:", error);
|
|
2223
|
+
break;
|
|
2125
2224
|
}
|
|
2126
2225
|
}
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
}
|
|
2134
|
-
|
|
2135
|
-
|
|
2226
|
+
}
|
|
2227
|
+
if (!cancelled) {
|
|
2228
|
+
try {
|
|
2229
|
+
await client.chat.abort({
|
|
2230
|
+
assistantId: targetAssistantId,
|
|
2231
|
+
threadId
|
|
2232
|
+
});
|
|
2233
|
+
if (!isCurrent()) return;
|
|
2234
|
+
cancelled = true;
|
|
2235
|
+
} catch (error) {
|
|
2236
|
+
if (!isCurrent()) return;
|
|
2237
|
+
console.error("Failed to abort agent:", error);
|
|
2136
2238
|
}
|
|
2137
2239
|
}
|
|
2138
|
-
|
|
2240
|
+
if (!isCurrent()) return;
|
|
2241
|
+
if (!cancelled) {
|
|
2242
|
+
failStop("chat.error.stopFailed");
|
|
2243
|
+
return;
|
|
2244
|
+
}
|
|
2245
|
+
pendingIdsRef.current.clear();
|
|
2246
|
+
setState((prev) => ({ ...prev, pendingMessages: [] }));
|
|
2247
|
+
startStopWait(requestId, targetAssistantId);
|
|
2248
|
+
}, [assistantId, clearStopWait, client, clientAssistantId, failStop, startStopWait, threadId]);
|
|
2139
2249
|
useLayoutEffect(() => {
|
|
2140
2250
|
if (threadId && state2.threadId !== threadId) {
|
|
2141
2251
|
chunkMessageMerger.current.reset();
|
|
2142
2252
|
historyLoadingRef.current = true;
|
|
2253
|
+
stopPendingRef.current = false;
|
|
2254
|
+
clearStopWait();
|
|
2143
2255
|
const isLoading = getOwnedLoading();
|
|
2144
2256
|
isLoadingRef.current = isLoading;
|
|
2145
2257
|
setState((prev) => ({
|
|
@@ -2151,11 +2263,12 @@ function AgentThreadProvider({
|
|
|
2151
2263
|
interruptNotice: null,
|
|
2152
2264
|
isLoading,
|
|
2153
2265
|
error: null,
|
|
2266
|
+
stopPending: false,
|
|
2154
2267
|
stopReason: null,
|
|
2155
2268
|
activeRuns: []
|
|
2156
2269
|
}));
|
|
2157
2270
|
}
|
|
2158
|
-
}, [getOwnedLoading, threadId, state2.threadId]);
|
|
2271
|
+
}, [clearStopWait, getOwnedLoading, threadId, state2.threadId]);
|
|
2159
2272
|
useEffect2(() => {
|
|
2160
2273
|
const capturedTid = threadId;
|
|
2161
2274
|
const capturedEpoch = threadEpochRef.current;
|
|
@@ -2171,9 +2284,11 @@ function AgentThreadProvider({
|
|
|
2171
2284
|
onRunStart: () => {
|
|
2172
2285
|
if (capturedEpoch !== threadEpochRef.current || currentThreadIdRef.current !== capturedTid || threadStreamRef.current !== stream) return;
|
|
2173
2286
|
streamActiveRef.current = true;
|
|
2287
|
+
stopPendingRef.current = false;
|
|
2288
|
+
clearStopWait();
|
|
2174
2289
|
const isLoading = getOwnedLoading();
|
|
2175
2290
|
isLoadingRef.current = isLoading;
|
|
2176
|
-
setState((prev) => ({ ...prev, isLoading, stopReason: null }));
|
|
2291
|
+
setState((prev) => ({ ...prev, isLoading, stopPending: false, stopReason: null }));
|
|
2177
2292
|
},
|
|
2178
2293
|
onRunEnd: () => {
|
|
2179
2294
|
if (capturedEpoch !== threadEpochRef.current || currentThreadIdRef.current !== capturedTid || threadStreamRef.current !== stream) return;
|
|
@@ -2186,11 +2301,18 @@ function AgentThreadProvider({
|
|
|
2186
2301
|
onConnectionEnd: (reason, error) => {
|
|
2187
2302
|
if (capturedEpoch !== threadEpochRef.current || currentThreadIdRef.current !== capturedTid || threadStreamRef.current !== stream) return;
|
|
2188
2303
|
streamActiveRef.current = false;
|
|
2304
|
+
if (stopPendingRef.current) {
|
|
2305
|
+
const code = error?.code;
|
|
2306
|
+
if (reason === "complete" || code === "aborted") {
|
|
2307
|
+
settleStop();
|
|
2308
|
+
}
|
|
2309
|
+
return;
|
|
2310
|
+
}
|
|
2189
2311
|
const isLoading = getOwnedLoading();
|
|
2190
2312
|
isLoadingRef.current = isLoading;
|
|
2191
2313
|
setState((prev) => {
|
|
2192
2314
|
if (capturedEpoch !== threadEpochRef.current || currentThreadIdRef.current !== capturedTid || threadStreamRef.current !== stream) return prev;
|
|
2193
|
-
if (reason === "error" && error
|
|
2315
|
+
if (reason === "error" && error) {
|
|
2194
2316
|
return {
|
|
2195
2317
|
...prev,
|
|
2196
2318
|
isLoading,
|
|
@@ -2226,6 +2348,8 @@ function AgentThreadProvider({
|
|
|
2226
2348
|
return () => {
|
|
2227
2349
|
threadEpochRef.current += 1;
|
|
2228
2350
|
streamStopGenerationRef.current += 1;
|
|
2351
|
+
stopPendingRef.current = false;
|
|
2352
|
+
clearStopWait();
|
|
2229
2353
|
historyGenerationRef.current += 1;
|
|
2230
2354
|
if (ownershipThreadIdRef.current === capturedTid) {
|
|
2231
2355
|
historyLoadingRef.current = false;
|
|
@@ -2238,7 +2362,7 @@ function AgentThreadProvider({
|
|
|
2238
2362
|
threadStreamRef.current = null;
|
|
2239
2363
|
}
|
|
2240
2364
|
};
|
|
2241
|
-
}, [threadId, loadMessages, clearMessages, clientAssistantId, assistantId, getOwnedLoading, refreshActiveRuns, options.chatTransport, options.runApi, options.resumeStreamPollInterval, streamReconnect, recoverFromCursorExpired]);
|
|
2365
|
+
}, [threadId, loadMessages, clearMessages, clientAssistantId, assistantId, getOwnedLoading, refreshActiveRuns, options.chatTransport, options.runApi, options.resumeStreamPollInterval, streamReconnect, recoverFromCursorExpired, clearStopWait, settleStop]);
|
|
2242
2366
|
useEffect2(() => {
|
|
2243
2367
|
if (typeof window === "undefined") return;
|
|
2244
2368
|
const handleFocus = () => {
|
|
@@ -25156,7 +25280,7 @@ import { useState as useState67, useEffect as useEffect49, useCallback as useCal
|
|
|
25156
25280
|
import { BrainCircuit, Trash2 as Trash29, Network } from "lucide-react";
|
|
25157
25281
|
import { Modal as Modal17, message as message12, Tag as Tag17, Typography as Typography20, Input as Input21, Button as Button34, Space as Space20, Spin as Spin14 } from "antd";
|
|
25158
25282
|
import { Fragment as Fragment25, jsx as jsx80, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
25159
|
-
var SkillFlow = lazy(() => import("./SkillFlow-
|
|
25283
|
+
var SkillFlow = lazy(() => import("./SkillFlow-KWMQYLOM.mjs"));
|
|
25160
25284
|
var { Text: Text20 } = Typography20;
|
|
25161
25285
|
var { TextArea: TextArea5 } = Input21;
|
|
25162
25286
|
var SkillList = () => {
|
|
@@ -29587,7 +29711,7 @@ import { Spin as Spin19 } from "antd";
|
|
|
29587
29711
|
import { ListChecks as ListChecks2 } from "lucide-react";
|
|
29588
29712
|
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
29589
29713
|
var TasksSideApp = lazy2(
|
|
29590
|
-
() => import("./TasksSideApp-
|
|
29714
|
+
() => import("./TasksSideApp-66BUD5LP.mjs").then((m) => ({ default: m.TasksSideApp }))
|
|
29591
29715
|
);
|
|
29592
29716
|
var TasksButton = () => {
|
|
29593
29717
|
const { openSideApp, sideAppVisible, sideAppSelectedCard } = useChatUIContext();
|
|
@@ -30620,7 +30744,7 @@ ${JSON.stringify(
|
|
|
30620
30744
|
// src/components/Chat/MessageViewPanel.tsx
|
|
30621
30745
|
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
30622
30746
|
var MessageGraph = React74.lazy(
|
|
30623
|
-
() => import("./MessageGraph-
|
|
30747
|
+
() => import("./MessageGraph-SOU3QSYM.mjs").then((m) => ({ default: m.MessageGraph }))
|
|
30624
30748
|
);
|
|
30625
30749
|
var MessageViewPanel = ({
|
|
30626
30750
|
messages,
|
|
@@ -31457,6 +31581,7 @@ var RunStatusBar = ({
|
|
|
31457
31581
|
isLoading,
|
|
31458
31582
|
hasInterrupts = false,
|
|
31459
31583
|
stopReason = null,
|
|
31584
|
+
stopPending = false,
|
|
31460
31585
|
activeRuns,
|
|
31461
31586
|
optimisticPending = [],
|
|
31462
31587
|
onCancelQueued
|
|
@@ -31488,6 +31613,13 @@ var RunStatusBar = ({
|
|
|
31488
31613
|
return () => clearInterval(timer);
|
|
31489
31614
|
}, [run?.runId, run?.status]);
|
|
31490
31615
|
const content = useMemo33(() => {
|
|
31616
|
+
if (stopPending) {
|
|
31617
|
+
return {
|
|
31618
|
+
icon: /* @__PURE__ */ jsx109(LoadingOutlined3, {}),
|
|
31619
|
+
text: t("chat.stop.stopping"),
|
|
31620
|
+
tone: "default"
|
|
31621
|
+
};
|
|
31622
|
+
}
|
|
31491
31623
|
if (stopReason === "aborted") {
|
|
31492
31624
|
return {
|
|
31493
31625
|
icon: /* @__PURE__ */ jsx109(InfoCircleOutlined3, {}),
|
|
@@ -31549,7 +31681,7 @@ var RunStatusBar = ({
|
|
|
31549
31681
|
text: `${t("chat.run.status.error")}: ${t(terminalRunErrorTranslationKey(run.error))}`,
|
|
31550
31682
|
tone: "error"
|
|
31551
31683
|
};
|
|
31552
|
-
}, [hasInterrupts, interactiveQueue, now, queuedCount, run, stopReason, t]);
|
|
31684
|
+
}, [hasInterrupts, interactiveQueue, now, queuedCount, run, stopPending, stopReason, t]);
|
|
31553
31685
|
if (content === null) return null;
|
|
31554
31686
|
const isError = content.tone === "error";
|
|
31555
31687
|
const isRunning = run?.status === "running";
|
|
@@ -34839,6 +34971,7 @@ var Chating = ({
|
|
|
34839
34971
|
isLoading,
|
|
34840
34972
|
error,
|
|
34841
34973
|
stopReason,
|
|
34974
|
+
stopPending,
|
|
34842
34975
|
interrupts,
|
|
34843
34976
|
interruptNotice,
|
|
34844
34977
|
tenantId,
|
|
@@ -35293,6 +35426,8 @@ ${nextContent}`;
|
|
|
35293
35426
|
shape: "circle",
|
|
35294
35427
|
icon: /* @__PURE__ */ jsx130(CloseOutlined3, {}),
|
|
35295
35428
|
onClick: abortAgent,
|
|
35429
|
+
loading: stopPending,
|
|
35430
|
+
disabled: stopPending,
|
|
35296
35431
|
style: COMPACT_CIRCLE_BUTTON_STYLE,
|
|
35297
35432
|
className: styles.rotatingBorderButton
|
|
35298
35433
|
}
|
|
@@ -35592,6 +35727,7 @@ ${nextContent}`;
|
|
|
35592
35727
|
isLoading,
|
|
35593
35728
|
hasInterrupts: Boolean(interrupts && interrupts.length > 0),
|
|
35594
35729
|
stopReason,
|
|
35730
|
+
stopPending,
|
|
35595
35731
|
activeRuns: effectiveRunApi === "single" ? activeRunList : void 0,
|
|
35596
35732
|
optimisticPending: effectiveRunApi === "single" ? pendingMessages : [],
|
|
35597
35733
|
onCancelQueued: effectiveRunApi === "single" ? cancelActiveRun : void 0
|
|
@@ -43682,7 +43818,7 @@ import { Spin as Spin30 } from "antd";
|
|
|
43682
43818
|
import { observabilityDashboardElementKey } from "@axiom-lattice/protocols";
|
|
43683
43819
|
import { jsx as jsx157 } from "react/jsx-runtime";
|
|
43684
43820
|
var LazyLangfuseDashboard = lazy3(
|
|
43685
|
-
() => import("./LangfuseDashboard-
|
|
43821
|
+
() => import("./LangfuseDashboard-IQVQ65ZY.mjs").then((module) => ({
|
|
43686
43822
|
default: module.LangfuseDashboard
|
|
43687
43823
|
}))
|
|
43688
43824
|
);
|
|
@@ -44304,19 +44440,19 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
|
|
|
44304
44440
|
];
|
|
44305
44441
|
var PanelSuspenseFallback = () => /* @__PURE__ */ jsx159("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "100%", minHeight: 120 }, children: /* @__PURE__ */ jsx159(Spin31, {}) });
|
|
44306
44442
|
var AgentGovernanceWorkbench = lazy4(
|
|
44307
|
-
() => import("./AgentGovernanceWorkbench-
|
|
44443
|
+
() => import("./AgentGovernanceWorkbench-AHFQR42S.mjs").then((m) => ({ default: m.AgentGovernanceWorkbench }))
|
|
44308
44444
|
);
|
|
44309
44445
|
var TopologyRuntimeView = lazy4(
|
|
44310
|
-
() => import("./TopologyRuntimeView-
|
|
44446
|
+
() => import("./TopologyRuntimeView-ANIQQMP5.mjs").then((m) => ({ default: m.TopologyRuntimeView }))
|
|
44311
44447
|
);
|
|
44312
44448
|
var WorkflowAutomationView = lazy4(
|
|
44313
|
-
() => import("./WorkflowAutomationView-
|
|
44449
|
+
() => import("./WorkflowAutomationView-I6CODQ2V.mjs").then((m) => ({ default: m.WorkflowAutomationView }))
|
|
44314
44450
|
);
|
|
44315
44451
|
var TasksSideApp2 = lazy4(
|
|
44316
|
-
() => import("./TasksSideApp-
|
|
44452
|
+
() => import("./TasksSideApp-66BUD5LP.mjs").then((m) => ({ default: m.TasksSideApp }))
|
|
44317
44453
|
);
|
|
44318
44454
|
var AgentDetailSideApp = lazy4(
|
|
44319
|
-
() => import("./AgentDetailSideApp-
|
|
44455
|
+
() => import("./AgentDetailSideApp-TBRWTSRK.mjs").then((m) => ({ default: m.AgentDetailSideApp }))
|
|
44320
44456
|
);
|
|
44321
44457
|
var createWrapper = (Component2) => {
|
|
44322
44458
|
return () => /* @__PURE__ */ jsx159(Suspense5, { fallback: /* @__PURE__ */ jsx159(PanelSuspenseFallback, {}), children: /* @__PURE__ */ jsx159(Component2, { ...{} }) });
|
|
@@ -52385,10 +52521,10 @@ var McpAppCard = ({ data, component_key }) => {
|
|
|
52385
52521
|
// src/components/GenUI/elements/builtIns.tsx
|
|
52386
52522
|
import { jsx as jsx195 } from "react/jsx-runtime";
|
|
52387
52523
|
var TasksSideApp3 = lazy5(
|
|
52388
|
-
() => import("./TasksSideApp-
|
|
52524
|
+
() => import("./TasksSideApp-66BUD5LP.mjs").then((m) => ({ default: m.TasksSideApp }))
|
|
52389
52525
|
);
|
|
52390
52526
|
var ThreadMaintenancePanel = lazy5(
|
|
52391
|
-
() => import("./ThreadMaintenancePanel-
|
|
52527
|
+
() => import("./ThreadMaintenancePanel-ISI24BAC.mjs").then((m) => ({
|
|
52392
52528
|
default: m.ThreadMaintenancePanel
|
|
52393
52529
|
}))
|
|
52394
52530
|
);
|
|
@@ -52706,7 +52842,7 @@ var LazyReactInfographic = lazy6(
|
|
|
52706
52842
|
() => import("./ReactInfographic-P7JL7DME.mjs").then((m) => ({ default: m.ReactInfographic }))
|
|
52707
52843
|
);
|
|
52708
52844
|
var LazyReactChart = lazy6(
|
|
52709
|
-
() => import("./ReactChart-
|
|
52845
|
+
() => import("./ReactChart-33DCEDLY.mjs").then((m) => ({ default: m.ReactChart }))
|
|
52710
52846
|
);
|
|
52711
52847
|
function BlockLoading() {
|
|
52712
52848
|
const t = useT();
|
|
@@ -53605,4 +53741,4 @@ export {
|
|
|
53605
53741
|
http://jedwatson.github.io/classnames
|
|
53606
53742
|
*)
|
|
53607
53743
|
*/
|
|
53608
|
-
//# sourceMappingURL=chunk-
|
|
53744
|
+
//# sourceMappingURL=chunk-3L3D2DOF.mjs.map
|