@agent-native/core 0.84.23 → 0.84.24
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/client/AssistantChat.tsx +45 -12
- package/corpus/core/src/client/active-run-state.ts +22 -0
- package/corpus/core/src/client/chat/message-components.tsx +2 -1
- package/corpus/core/src/client/chat/tool-call-display.tsx +18 -2
- package/corpus/core/src/client/sse-event-processor.ts +157 -40
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +15 -13
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +2 -2
- package/corpus/templates/clips/app/i18n/ar-SA.ts +1 -0
- package/corpus/templates/clips/app/i18n/de-DE.ts +1 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +1 -0
- package/corpus/templates/clips/app/i18n/es-ES.ts +1 -0
- package/corpus/templates/clips/app/i18n/fr-FR.ts +1 -0
- package/corpus/templates/clips/app/i18n/hi-IN.ts +1 -0
- package/corpus/templates/clips/app/i18n/ja-JP.ts +1 -0
- package/corpus/templates/clips/app/i18n/ko-KR.ts +1 -0
- package/corpus/templates/clips/app/i18n/pt-BR.ts +1 -0
- package/corpus/templates/clips/app/i18n/zh-CN.ts +1 -0
- package/corpus/templates/clips/app/i18n/zh-TW.ts +1 -0
- package/corpus/templates/clips/app/routes/embed.$shareId.tsx +31 -3
- package/corpus/templates/clips/changelog/2026-07-01-clip-embeds-now-render-as-a-clean-video-only-player-without-.md +6 -0
- package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -1
- package/corpus/templates/clips/chrome-extension/src/github-preview-content.ts +2 -2
- package/corpus/templates/clips/chrome-extension/src/github-preview.ts +41 -31
- package/dist/client/AssistantChat.d.ts +2 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +37 -15
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/active-run-state.d.ts +2 -0
- package/dist/client/active-run-state.d.ts.map +1 -1
- package/dist/client/active-run-state.js +17 -0
- package/dist/client/active-run-state.js.map +1 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +3 -1
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +3 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +8 -8
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts +1 -0
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +136 -35
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +5 -5
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/package.json +1 -1
|
@@ -121,36 +121,39 @@ function renderPreview(
|
|
|
121
121
|
root.textContent = "";
|
|
122
122
|
|
|
123
123
|
const card = document.createElement("section");
|
|
124
|
-
card.className =
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
124
|
+
card.className =
|
|
125
|
+
state.kind === "playable"
|
|
126
|
+
? "clips-preview-card clips-preview-card--player"
|
|
127
|
+
: "clips-preview-card";
|
|
128
|
+
|
|
129
|
+
if (state.kind !== "playable") {
|
|
130
|
+
const header = document.createElement("header");
|
|
131
|
+
header.className = "clips-preview-header";
|
|
132
|
+
|
|
133
|
+
const titleWrap = document.createElement("div");
|
|
134
|
+
titleWrap.className = "clips-preview-title-wrap";
|
|
135
|
+
|
|
136
|
+
const title = document.createElement("div");
|
|
137
|
+
title.className = "clips-preview-title";
|
|
138
|
+
title.textContent =
|
|
139
|
+
state.kind === "unavailable" ? state.title : "Clips preview";
|
|
140
|
+
|
|
141
|
+
const subtitle = document.createElement("div");
|
|
142
|
+
subtitle.className = "clips-preview-subtitle";
|
|
143
|
+
subtitle.textContent = preview.host;
|
|
144
|
+
|
|
145
|
+
titleWrap.append(title, subtitle);
|
|
146
|
+
|
|
147
|
+
const open = document.createElement("a");
|
|
148
|
+
open.className = "clips-preview-open";
|
|
149
|
+
open.href = preview.sourceUrl.toString();
|
|
150
|
+
open.target = "_blank";
|
|
151
|
+
open.rel = "noreferrer noopener";
|
|
152
|
+
open.textContent = "Open clip";
|
|
153
|
+
|
|
154
|
+
header.append(titleWrap, open);
|
|
155
|
+
card.append(header);
|
|
156
|
+
}
|
|
154
157
|
|
|
155
158
|
if (state.kind === "playable") {
|
|
156
159
|
const player = document.createElement("div");
|
|
@@ -161,6 +164,7 @@ function renderPreview(
|
|
|
161
164
|
frame.src = preview.embedUrl.toString();
|
|
162
165
|
frame.allow = "autoplay; fullscreen; picture-in-picture";
|
|
163
166
|
frame.allowFullscreen = true;
|
|
167
|
+
frame.scrolling = "no";
|
|
164
168
|
frame.referrerPolicy = "no-referrer";
|
|
165
169
|
|
|
166
170
|
player.append(frame);
|
|
@@ -273,6 +277,7 @@ function installStyles(): void {
|
|
|
273
277
|
body {
|
|
274
278
|
margin: 0;
|
|
275
279
|
min-width: 0;
|
|
280
|
+
width: 100%;
|
|
276
281
|
background: transparent;
|
|
277
282
|
}
|
|
278
283
|
|
|
@@ -292,6 +297,12 @@ function installStyles(): void {
|
|
|
292
297
|
box-shadow: var(--clips-shadow);
|
|
293
298
|
}
|
|
294
299
|
|
|
300
|
+
.clips-preview-card--player {
|
|
301
|
+
border: 0;
|
|
302
|
+
background: #000000;
|
|
303
|
+
box-shadow: none;
|
|
304
|
+
}
|
|
305
|
+
|
|
295
306
|
.clips-preview-header {
|
|
296
307
|
display: flex;
|
|
297
308
|
align-items: center;
|
|
@@ -348,7 +359,6 @@ function installStyles(): void {
|
|
|
348
359
|
position: relative;
|
|
349
360
|
width: 100%;
|
|
350
361
|
aspect-ratio: 16 / 9;
|
|
351
|
-
min-height: 240px;
|
|
352
362
|
background: #000000;
|
|
353
363
|
}
|
|
354
364
|
|
|
@@ -38,12 +38,13 @@ export declare function resolveAssistantChatSubmitIntent({ isRunning, requestedI
|
|
|
38
38
|
isRunning: boolean;
|
|
39
39
|
requestedIntent?: ComposerSubmitIntent;
|
|
40
40
|
}): ComposerSubmitIntent;
|
|
41
|
-
export declare function resolveAssistantChatRunningState({ forceStopped, isRuntimeRunning, isReconnecting, optimisticRunning, isAutoResuming, }: {
|
|
41
|
+
export declare function resolveAssistantChatRunningState({ forceStopped, isRuntimeRunning, isReconnecting, optimisticRunning, isAutoResuming, hasActiveServerRun, }: {
|
|
42
42
|
forceStopped: boolean;
|
|
43
43
|
isRuntimeRunning: boolean;
|
|
44
44
|
isReconnecting: boolean;
|
|
45
45
|
optimisticRunning: boolean;
|
|
46
46
|
isAutoResuming: boolean;
|
|
47
|
+
hasActiveServerRun?: boolean;
|
|
47
48
|
}): {
|
|
48
49
|
isRunning: boolean;
|
|
49
50
|
showRunningInUI: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantChat.d.ts","sourceRoot":"","sources":["../../src/client/AssistantChat.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAEV,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,qBAAqB,CAAC;AAW7B,OAAO,KASN,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|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MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,kFAAkF;IAClF,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAsDjD,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,QAI9C;AAkDD,OAAO,EACL,iBAAiB,EAElB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAy1F7B,eAAO,MAAM,aAAa,gGA2GxB,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { CompositeAttachmentAdapter } from "@assistant-ui/react";
|
|
|
4
4
|
import { IconMessage, IconX, IconPlayerStop, IconChevronDown, IconTerminal, IconAlertTriangle, IconRefresh, } from "@tabler/icons-react";
|
|
5
5
|
import { useState, useRef, useEffect, useCallback, useMemo, useLayoutEffect, forwardRef, useImperativeHandle, } from "react";
|
|
6
6
|
import { LLM_MISSING_CREDENTIALS_MESSAGE } from "../agent/engine/credential-errors.js";
|
|
7
|
-
import { getActiveRunActivityTool, getActiveRun, resolveReconnectAfterSeq, setActiveRun, updateActiveRunActivity, updateActiveRunSeq, } from "./active-run-state.js";
|
|
7
|
+
import { ACTIVE_RUN_STATE_EVENT, clearActiveRunIfMatches, getActiveRunActivityTool, getActiveRun, resolveReconnectAfterSeq, setActiveRun, updateActiveRunActivity, updateActiveRunSeq, } from "./active-run-state.js";
|
|
8
8
|
import { createAgentChatAdapter, } from "./agent-chat-adapter.js";
|
|
9
9
|
import { appendAgentChatContextToMessage, formatAgentChatContextItemsForPrompt, getAgentChatContextState, normalizeAgentChatContextItem, publishAgentChatContextItems, refreshAgentChatContext, subscribeAgentChatContext, } from "./agent-chat.js";
|
|
10
10
|
import { captureError } from "./analytics.js";
|
|
@@ -96,6 +96,9 @@ export function reconnectProgressTimedOut(args) {
|
|
|
96
96
|
const threshold = args.thresholdMs ?? ACTIVE_RUN_STUCK_THRESHOLD_MS;
|
|
97
97
|
return args.now - args.lastProgressAt >= threshold;
|
|
98
98
|
}
|
|
99
|
+
function activeRunMatchesThread(state, threadId) {
|
|
100
|
+
return Boolean(threadId && state?.threadId === threadId && state.runId);
|
|
101
|
+
}
|
|
99
102
|
function isAssistantUiDuplicateMessageIdError(error) {
|
|
100
103
|
const message = error instanceof Error ? error.message : String(error ?? "");
|
|
101
104
|
return (message.includes("MessageRepository") &&
|
|
@@ -305,8 +308,12 @@ export function resolveAssistantChatSubmitIntent({ isRunning, requestedIntent, }
|
|
|
305
308
|
return "queued";
|
|
306
309
|
return requestedIntent ?? "immediate";
|
|
307
310
|
}
|
|
308
|
-
export function resolveAssistantChatRunningState({ forceStopped, isRuntimeRunning, isReconnecting, optimisticRunning, isAutoResuming, }) {
|
|
309
|
-
const isRunning = !forceStopped &&
|
|
311
|
+
export function resolveAssistantChatRunningState({ forceStopped, isRuntimeRunning, isReconnecting, optimisticRunning, isAutoResuming, hasActiveServerRun, }) {
|
|
312
|
+
const isRunning = !forceStopped &&
|
|
313
|
+
(isRuntimeRunning ||
|
|
314
|
+
isReconnecting ||
|
|
315
|
+
optimisticRunning ||
|
|
316
|
+
Boolean(hasActiveServerRun));
|
|
310
317
|
return {
|
|
311
318
|
isRunning,
|
|
312
319
|
// During auto-continuation, assistant-ui can briefly mark the message done
|
|
@@ -771,13 +778,31 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
771
778
|
// When stop is clicked during reconnect, keep content visible (don't wipe it)
|
|
772
779
|
const [reconnectFrozen, setReconnectFrozen] = useState(false);
|
|
773
780
|
const reconnectRunIdRef = useRef(null);
|
|
774
|
-
const [reconnectAfterSeq, setReconnectAfterSeq] = useState(0);
|
|
775
781
|
const reconnectAbortRef = useRef(null);
|
|
776
782
|
// Nuclear stop: user clicked stop. Clears the stop button/indicator AND
|
|
777
783
|
// lets new submissions go through immediately — prevents the "stuck
|
|
778
784
|
// queueing forever" state where isReconnecting or isRuntimeRunning gets
|
|
779
785
|
// wedged (e.g. after a tab refresh + stop during reconnect).
|
|
780
786
|
const [forceStopped, setForceStopped] = useState(false);
|
|
787
|
+
const [hasActiveServerRun, setHasActiveServerRun] = useState(() => activeRunMatchesThread(getActiveRun(), threadId));
|
|
788
|
+
useEffect(() => {
|
|
789
|
+
const syncActiveRun = (state = getActiveRun()) => {
|
|
790
|
+
setHasActiveServerRun(activeRunMatchesThread(state, threadId));
|
|
791
|
+
};
|
|
792
|
+
syncActiveRun();
|
|
793
|
+
const handler = (event) => {
|
|
794
|
+
const state = event
|
|
795
|
+
.detail?.state;
|
|
796
|
+
syncActiveRun(state ?? null);
|
|
797
|
+
};
|
|
798
|
+
const storageHandler = () => syncActiveRun();
|
|
799
|
+
window.addEventListener(ACTIVE_RUN_STATE_EVENT, handler);
|
|
800
|
+
window.addEventListener("storage", storageHandler);
|
|
801
|
+
return () => {
|
|
802
|
+
window.removeEventListener(ACTIVE_RUN_STATE_EVENT, handler);
|
|
803
|
+
window.removeEventListener("storage", storageHandler);
|
|
804
|
+
};
|
|
805
|
+
}, [threadId]);
|
|
781
806
|
// Real running state drives submission/queue gating; UI running also covers
|
|
782
807
|
// short auto-continuation gaps so the latest assistant message does not flash
|
|
783
808
|
// into a done state while the agent is still working.
|
|
@@ -787,14 +812,14 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
787
812
|
isReconnecting,
|
|
788
813
|
optimisticRunning,
|
|
789
814
|
isAutoResuming,
|
|
815
|
+
hasActiveServerRun,
|
|
790
816
|
});
|
|
791
817
|
const textStreaming = showRunningInUI || externalStreaming;
|
|
792
818
|
// A revealed activity label wins; otherwise stay a steady "Thinking" by
|
|
793
819
|
// default. We only surface "Reconnecting" while we are actively replaying
|
|
794
820
|
// recovered content (reconnectContent populated). A bare reconnect with no
|
|
795
|
-
// replayed content
|
|
796
|
-
//
|
|
797
|
-
// ongoing work, so it must read as "Thinking", never a perpetual "Working".
|
|
821
|
+
// replayed content is normal ongoing work, so it must read as "Thinking",
|
|
822
|
+
// never a perpetual "Working".
|
|
798
823
|
const runningStatusLabel = runningActivityLabel
|
|
799
824
|
? runningActivityLabel
|
|
800
825
|
: isAutoResuming
|
|
@@ -1035,7 +1060,6 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1035
1060
|
const afterSeq = resolveReconnectAfterSeq(threadId, runId);
|
|
1036
1061
|
const storedActivityTool = getActiveRunActivityTool(threadId, runId);
|
|
1037
1062
|
setRunningActivityTool(storedActivityTool);
|
|
1038
|
-
setReconnectAfterSeq(afterSeq);
|
|
1039
1063
|
setActiveRun({
|
|
1040
1064
|
threadId,
|
|
1041
1065
|
runId,
|
|
@@ -1112,8 +1136,6 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1112
1136
|
let rafPending = false;
|
|
1113
1137
|
let latestSnapshot = [];
|
|
1114
1138
|
const scheduleUpdate = (snapshot) => {
|
|
1115
|
-
if (afterSeq > 0)
|
|
1116
|
-
return;
|
|
1117
1139
|
latestSnapshot = snapshot;
|
|
1118
1140
|
if (rafPending)
|
|
1119
1141
|
return;
|
|
@@ -1193,10 +1215,10 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1193
1215
|
runId,
|
|
1194
1216
|
});
|
|
1195
1217
|
setDismissedRunErrorKey(null);
|
|
1218
|
+
clearActiveRunIfMatches(threadId, runId);
|
|
1196
1219
|
reconnectAbortRef.current = null;
|
|
1197
1220
|
setIsReconnecting(false);
|
|
1198
1221
|
reconnectRunIdRef.current = null;
|
|
1199
|
-
setReconnectAfterSeq(0);
|
|
1200
1222
|
window.dispatchEvent(new CustomEvent("agentNative.chatRunning", {
|
|
1201
1223
|
detail: { isRunning: false, tabId: tabId || threadId },
|
|
1202
1224
|
}));
|
|
@@ -1217,10 +1239,10 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1217
1239
|
}
|
|
1218
1240
|
}
|
|
1219
1241
|
if (reconnectRunIdRef.current === runId) {
|
|
1242
|
+
clearActiveRunIfMatches(threadId, runId);
|
|
1220
1243
|
reconnectAbortRef.current = null;
|
|
1221
1244
|
setIsReconnecting(false);
|
|
1222
1245
|
reconnectRunIdRef.current = null;
|
|
1223
|
-
setReconnectAfterSeq(0);
|
|
1224
1246
|
window.dispatchEvent(new CustomEvent("agentNative.chatRunning", {
|
|
1225
1247
|
detail: { isRunning: false, tabId: tabId || threadId },
|
|
1226
1248
|
}));
|
|
@@ -1979,6 +2001,8 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1979
2001
|
setRunErrorInfo(null);
|
|
1980
2002
|
setDismissedRunErrorKey(null);
|
|
1981
2003
|
if (runIdToAbort) {
|
|
2004
|
+
if (threadId)
|
|
2005
|
+
clearActiveRunIfMatches(threadId, runIdToAbort);
|
|
1982
2006
|
fetch(`${apiUrl}/runs/${encodeURIComponent(runIdToAbort)}/abort`, {
|
|
1983
2007
|
method: "POST",
|
|
1984
2008
|
}).catch(() => { });
|
|
@@ -1987,7 +2011,6 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1987
2011
|
reconnectAbortRef.current?.abort();
|
|
1988
2012
|
reconnectAbortRef.current = null;
|
|
1989
2013
|
reconnectRunIdRef.current = null;
|
|
1990
|
-
setReconnectAfterSeq(0);
|
|
1991
2014
|
setIsReconnecting(false);
|
|
1992
2015
|
setReconnectFrozen(reconnectContent.length > 0);
|
|
1993
2016
|
}
|
|
@@ -2480,9 +2503,8 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2480
2503
|
}
|
|
2481
2504
|
setRunErrorInfo(null);
|
|
2482
2505
|
} })), (isReconnecting || reconnectFrozen) &&
|
|
2483
|
-
reconnectAfterSeq === 0 &&
|
|
2484
2506
|
reconnectContent.length > 0 && (_jsx(ReconnectStreamMessage, { content: reconnectContent })), (isReconnecting || reconnectFrozen) &&
|
|
2485
|
-
|
|
2507
|
+
reconnectContent.length === 0 &&
|
|
2486
2508
|
reconnectActivityContent.length > 0 && (_jsx(ReconnectStreamMessage, { content: reconnectActivityContent })), showRunningInUI && (_jsx(RunningActivityStatus, { label: runningStatusLabel })), queuedMessages.map((msg) => {
|
|
2487
2509
|
const displayText = msg.text
|
|
2488
2510
|
.replace(/<context>[\s\S]*?<\/context>\n?/g, "")
|