@agent-native/core 0.84.24 → 0.84.25
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/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +6 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/production-agent.ts +8 -6
- package/corpus/core/src/agent/run-manager.ts +57 -6
- package/corpus/core/src/client/AssistantChat.tsx +37 -3
- package/corpus/core/src/client/sse-event-processor.ts +43 -15
- package/corpus/core/src/client/tool-display.ts +1 -1
- package/corpus/templates/clips/.agents/skills/video-sharing/SKILL.md +4 -2
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +9 -0
- package/corpus/templates/clips/app/i18n/ar-SA.ts +3 -0
- package/corpus/templates/clips/app/i18n/de-DE.ts +3 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +3 -0
- package/corpus/templates/clips/app/i18n/es-ES.ts +3 -0
- package/corpus/templates/clips/app/i18n/fr-FR.ts +3 -0
- package/corpus/templates/clips/app/i18n/hi-IN.ts +3 -0
- package/corpus/templates/clips/app/i18n/ja-JP.ts +3 -0
- package/corpus/templates/clips/app/i18n/ko-KR.ts +3 -0
- package/corpus/templates/clips/app/i18n/pt-BR.ts +3 -0
- package/corpus/templates/clips/app/i18n/zh-CN.ts +3 -0
- package/corpus/templates/clips/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/clips/changelog/2026-07-01-shared-clips-can-now-copy-a-ready-to-send-prompt-that-tells-.md +6 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +8 -6
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +56 -4
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +37 -3
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +31 -14
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/client/tool-display.js +1 -1
- package/dist/client/tool-display.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +2 -2
- package/dist/observability/routes.d.ts +5 -5
- package/package.json +1 -1
|
@@ -778,6 +778,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
778
778
|
// When stop is clicked during reconnect, keep content visible (don't wipe it)
|
|
779
779
|
const [reconnectFrozen, setReconnectFrozen] = useState(false);
|
|
780
780
|
const reconnectRunIdRef = useRef(null);
|
|
781
|
+
const reconnectCanMaterializeRef = useRef(false);
|
|
781
782
|
const reconnectAbortRef = useRef(null);
|
|
782
783
|
// Nuclear stop: user clicked stop. Clears the stop button/indicator AND
|
|
783
784
|
// lets new submissions go through immediately — prevents the "stuck
|
|
@@ -1058,6 +1059,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1058
1059
|
return true;
|
|
1059
1060
|
reconnectRunIdRef.current = runId;
|
|
1060
1061
|
const afterSeq = resolveReconnectAfterSeq(threadId, runId);
|
|
1062
|
+
reconnectCanMaterializeRef.current = afterSeq === 0;
|
|
1061
1063
|
const storedActivityTool = getActiveRunActivityTool(threadId, runId);
|
|
1062
1064
|
setRunningActivityTool(storedActivityTool);
|
|
1063
1065
|
setActiveRun({
|
|
@@ -1207,6 +1209,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1207
1209
|
settleInterruptedToolCalls(latestContent);
|
|
1208
1210
|
setReconnectContent([...latestContent]);
|
|
1209
1211
|
setReconnectFrozen(latestContent.length > 0);
|
|
1212
|
+
reconnectCanMaterializeRef.current = latestContent.length > 0;
|
|
1210
1213
|
}
|
|
1211
1214
|
setRunErrorInfo({
|
|
1212
1215
|
message: "The previous agent run stopped producing visible progress while reconnecting, so it was stopped before it could keep looping.",
|
|
@@ -1219,12 +1222,15 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1219
1222
|
reconnectAbortRef.current = null;
|
|
1220
1223
|
setIsReconnecting(false);
|
|
1221
1224
|
reconnectRunIdRef.current = null;
|
|
1225
|
+
if (afterSeq > 0) {
|
|
1226
|
+
reconnectCanMaterializeRef.current = false;
|
|
1227
|
+
}
|
|
1222
1228
|
window.dispatchEvent(new CustomEvent("agentNative.chatRunning", {
|
|
1223
1229
|
detail: { isRunning: false, tabId: tabId || threadId },
|
|
1224
1230
|
}));
|
|
1225
1231
|
return;
|
|
1226
1232
|
}
|
|
1227
|
-
setReconnectFrozen(
|
|
1233
|
+
setReconnectFrozen(afterSeq === 0);
|
|
1228
1234
|
let loaded = false;
|
|
1229
1235
|
for (let attempt = 0; attempt < 10; attempt++) {
|
|
1230
1236
|
await new Promise((r) => setTimeout(r, 500));
|
|
@@ -1234,21 +1240,34 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1234
1240
|
if (repoHasAssistantMessage(repo)) {
|
|
1235
1241
|
setReconnectContent([]);
|
|
1236
1242
|
setReconnectFrozen(false);
|
|
1243
|
+
reconnectCanMaterializeRef.current = false;
|
|
1237
1244
|
loaded = true;
|
|
1238
1245
|
break;
|
|
1239
1246
|
}
|
|
1240
1247
|
}
|
|
1241
1248
|
if (reconnectRunIdRef.current === runId) {
|
|
1249
|
+
if (afterSeq > 0) {
|
|
1250
|
+
setReconnectContent([]);
|
|
1251
|
+
setReconnectFrozen(false);
|
|
1252
|
+
}
|
|
1242
1253
|
clearActiveRunIfMatches(threadId, runId);
|
|
1243
1254
|
reconnectAbortRef.current = null;
|
|
1244
1255
|
setIsReconnecting(false);
|
|
1245
1256
|
reconnectRunIdRef.current = null;
|
|
1257
|
+
if (loaded || afterSeq > 0 || latestContent.length === 0) {
|
|
1258
|
+
reconnectCanMaterializeRef.current = false;
|
|
1259
|
+
}
|
|
1246
1260
|
window.dispatchEvent(new CustomEvent("agentNative.chatRunning", {
|
|
1247
1261
|
detail: { isRunning: false, tabId: tabId || threadId },
|
|
1248
1262
|
}));
|
|
1249
1263
|
}
|
|
1250
1264
|
if (!loaded) {
|
|
1251
|
-
await refreshThreadFromServer();
|
|
1265
|
+
const repo = await refreshThreadFromServer();
|
|
1266
|
+
if (afterSeq > 0 || repoHasAssistantMessage(repo)) {
|
|
1267
|
+
setReconnectContent([]);
|
|
1268
|
+
setReconnectFrozen(false);
|
|
1269
|
+
reconnectCanMaterializeRef.current = false;
|
|
1270
|
+
}
|
|
1252
1271
|
}
|
|
1253
1272
|
};
|
|
1254
1273
|
void streamReconnect();
|
|
@@ -1907,6 +1926,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1907
1926
|
if (reconnectFrozen) {
|
|
1908
1927
|
setReconnectFrozen(false);
|
|
1909
1928
|
setReconnectContent([]);
|
|
1929
|
+
reconnectCanMaterializeRef.current = false;
|
|
1910
1930
|
}
|
|
1911
1931
|
if (forceStopped) {
|
|
1912
1932
|
setForceStopped(false);
|
|
@@ -1926,6 +1946,11 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1926
1946
|
const materializeFrozenReconnectContent = useCallback(() => {
|
|
1927
1947
|
if (!reconnectFrozen || reconnectContent.length === 0)
|
|
1928
1948
|
return;
|
|
1949
|
+
if (!reconnectCanMaterializeRef.current) {
|
|
1950
|
+
setReconnectFrozen(false);
|
|
1951
|
+
setReconnectContent([]);
|
|
1952
|
+
return;
|
|
1953
|
+
}
|
|
1929
1954
|
try {
|
|
1930
1955
|
const frozenContent = cloneContentParts(reconnectContent);
|
|
1931
1956
|
settleInterruptedToolCalls(frozenContent);
|
|
@@ -1963,6 +1988,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1963
1988
|
threadRuntime.import(ensureMessageMetadata(repo));
|
|
1964
1989
|
setReconnectFrozen(false);
|
|
1965
1990
|
setReconnectContent([]);
|
|
1991
|
+
reconnectCanMaterializeRef.current = false;
|
|
1966
1992
|
}
|
|
1967
1993
|
catch (err) {
|
|
1968
1994
|
captureError(err, {
|
|
@@ -2012,7 +2038,15 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2012
2038
|
reconnectAbortRef.current = null;
|
|
2013
2039
|
reconnectRunIdRef.current = null;
|
|
2014
2040
|
setIsReconnecting(false);
|
|
2015
|
-
|
|
2041
|
+
const shouldFreezeReconnectContent = reconnectCanMaterializeRef.current && reconnectContent.length > 0;
|
|
2042
|
+
if (shouldFreezeReconnectContent) {
|
|
2043
|
+
setReconnectFrozen(true);
|
|
2044
|
+
}
|
|
2045
|
+
else {
|
|
2046
|
+
setReconnectFrozen(false);
|
|
2047
|
+
setReconnectContent([]);
|
|
2048
|
+
reconnectCanMaterializeRef.current = false;
|
|
2049
|
+
}
|
|
2016
2050
|
}
|
|
2017
2051
|
threadRuntime.cancelRun();
|
|
2018
2052
|
if (typeof window !== "undefined") {
|