@agent-native/core 0.84.54 → 0.84.55
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/core/CHANGELOG.md +6 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/client/AssistantChat.tsx +58 -32
- package/corpus/core/src/client/agent-chat-adapter.ts +14 -4
- package/corpus/core/src/client/chat/message-components.tsx +5 -1
- package/corpus/core/src/client/sse-event-processor.ts +11 -4
- package/corpus/core/src/client/use-agent-engine-configured.ts +54 -12
- package/corpus/core/src/server/agent-chat-plugin.ts +9 -5
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +33 -20
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +12 -2
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +5 -1
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +9 -4
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/client/use-agent-engine-configured.d.ts +10 -1
- package/dist/client/use-agent-engine-configured.d.ts.map +1 -1
- package/dist/client/use-agent-engine-configured.js +35 -10
- package/dist/client/use-agent-engine-configured.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 +2 -2
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +9 -2
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/package.json +1 -1
package/corpus/core/CHANGELOG.md
CHANGED
package/corpus/core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.84.
|
|
3
|
+
"version": "0.84.55",
|
|
4
4
|
"description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -89,6 +89,7 @@ import {
|
|
|
89
89
|
AssistantMessage,
|
|
90
90
|
SelectionAttachedPill,
|
|
91
91
|
RunningActivityStatus,
|
|
92
|
+
displayableUserMessageText,
|
|
92
93
|
} from "./chat/message-components.js";
|
|
93
94
|
import {
|
|
94
95
|
repoHasAssistantMessage,
|
|
@@ -178,6 +179,8 @@ export {
|
|
|
178
179
|
|
|
179
180
|
export { displayableUserMessageText } from "./chat/message-components.js";
|
|
180
181
|
|
|
182
|
+
type AuthSessionCheckResult = "available" | "missing" | "unknown";
|
|
183
|
+
|
|
181
184
|
const useBrowserLayoutEffect =
|
|
182
185
|
typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
183
186
|
|
|
@@ -492,13 +495,14 @@ function getMessageText(message: unknown): string {
|
|
|
492
495
|
const msg = (message as { message?: unknown })?.message ?? message;
|
|
493
496
|
const content = (msg as { content?: unknown })?.content;
|
|
494
497
|
if (Array.isArray(content)) {
|
|
495
|
-
return
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
498
|
+
return displayableUserMessageText(
|
|
499
|
+
content
|
|
500
|
+
.filter((p: any) => p?.type === "text" && typeof p.text === "string")
|
|
501
|
+
.map((p: any) => p.text)
|
|
502
|
+
.join("\n"),
|
|
503
|
+
);
|
|
500
504
|
}
|
|
501
|
-
return typeof content === "string" ? content
|
|
505
|
+
return typeof content === "string" ? displayableUserMessageText(content) : "";
|
|
502
506
|
}
|
|
503
507
|
|
|
504
508
|
function contentPartFollowKey(part: any): string {
|
|
@@ -1263,6 +1267,7 @@ const AssistantChatInner = forwardRef<
|
|
|
1263
1267
|
}, [threadRuntime]);
|
|
1264
1268
|
const agentEngineConfigured = useAgentEngineConfigured(
|
|
1265
1269
|
providerStatusChecksEnabled,
|
|
1270
|
+
{ tabId, threadId },
|
|
1266
1271
|
);
|
|
1267
1272
|
const missingApiKey = agentEngineConfigured.missing;
|
|
1268
1273
|
const isComposerDisabled = missingApiKey || composerDisabled;
|
|
@@ -1294,10 +1299,19 @@ const AssistantChatInner = forwardRef<
|
|
|
1294
1299
|
setComposerError(LLM_MISSING_CREDENTIALS_MESSAGE);
|
|
1295
1300
|
setMissingKeyBouncePulse((p) => p + 1);
|
|
1296
1301
|
if (typeof window !== "undefined") {
|
|
1297
|
-
window.dispatchEvent(
|
|
1302
|
+
window.dispatchEvent(
|
|
1303
|
+
new CustomEvent("agent-chat:missing-api-key", {
|
|
1304
|
+
detail: { tabId, threadId },
|
|
1305
|
+
}),
|
|
1306
|
+
);
|
|
1298
1307
|
}
|
|
1299
1308
|
return false;
|
|
1300
|
-
}, [
|
|
1309
|
+
}, [
|
|
1310
|
+
agentEngineConfigured.state,
|
|
1311
|
+
providerStatusChecksEnabled,
|
|
1312
|
+
tabId,
|
|
1313
|
+
threadId,
|
|
1314
|
+
]);
|
|
1301
1315
|
const [authError, setAuthError] = useState<{
|
|
1302
1316
|
sessionExpired?: boolean;
|
|
1303
1317
|
} | null>(null);
|
|
@@ -2443,23 +2457,31 @@ const AssistantChatInner = forwardRef<
|
|
|
2443
2457
|
}, []);
|
|
2444
2458
|
|
|
2445
2459
|
// Listen for auth error events from the adapter
|
|
2446
|
-
const checkAuthSession =
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2460
|
+
const checkAuthSession =
|
|
2461
|
+
useCallback(async (): Promise<AuthSessionCheckResult> => {
|
|
2462
|
+
try {
|
|
2463
|
+
const res = await fetch(
|
|
2464
|
+
agentNativePath("/_agent-native/auth/session"),
|
|
2465
|
+
{
|
|
2466
|
+
cache: "no-store",
|
|
2467
|
+
},
|
|
2468
|
+
);
|
|
2469
|
+
if (!res.ok) {
|
|
2470
|
+
return res.status === 401 || res.status === 403
|
|
2471
|
+
? "missing"
|
|
2472
|
+
: "unknown";
|
|
2473
|
+
}
|
|
2474
|
+
const data = await res.json().catch(() => null);
|
|
2475
|
+
const hasSession = !!data && !data.error;
|
|
2476
|
+
setAuthSessionAvailable(hasSession);
|
|
2477
|
+
if (hasSession) {
|
|
2478
|
+
setAuthError(null);
|
|
2479
|
+
}
|
|
2480
|
+
return hasSession ? "available" : "missing";
|
|
2481
|
+
} catch {
|
|
2482
|
+
return "unknown";
|
|
2457
2483
|
}
|
|
2458
|
-
|
|
2459
|
-
} catch {
|
|
2460
|
-
return false;
|
|
2461
|
-
}
|
|
2462
|
-
}, []);
|
|
2484
|
+
}, []);
|
|
2463
2485
|
|
|
2464
2486
|
useEffect(() => {
|
|
2465
2487
|
const handler = (e: Event) => {
|
|
@@ -2481,9 +2503,12 @@ const AssistantChatInner = forwardRef<
|
|
|
2481
2503
|
) {
|
|
2482
2504
|
return;
|
|
2483
2505
|
}
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2506
|
+
void (async () => {
|
|
2507
|
+
const sessionState = await checkAuthSession();
|
|
2508
|
+
if (sessionState !== "missing") return;
|
|
2509
|
+
setAuthSessionAvailable(false);
|
|
2510
|
+
setAuthError({ sessionExpired: detail?.reason === "session-expired" });
|
|
2511
|
+
})();
|
|
2487
2512
|
};
|
|
2488
2513
|
window.addEventListener("agent-chat:auth-error", handler);
|
|
2489
2514
|
return () => window.removeEventListener("agent-chat:auth-error", handler);
|
|
@@ -2499,8 +2524,9 @@ const AssistantChatInner = forwardRef<
|
|
|
2499
2524
|
// symptom we want signal on.
|
|
2500
2525
|
const stuckCapture = window.setTimeout(() => {
|
|
2501
2526
|
void (async () => {
|
|
2502
|
-
const
|
|
2503
|
-
if (
|
|
2527
|
+
const sessionState = await checkAuthSession();
|
|
2528
|
+
if (sessionState === "available") return;
|
|
2529
|
+
if (sessionState !== "missing") return;
|
|
2504
2530
|
if (!shouldCaptureStuckAuthCard) return;
|
|
2505
2531
|
captureError(new Error("agent-chat:auth_error_card_stuck"), {
|
|
2506
2532
|
tags: {
|
|
@@ -3790,9 +3816,9 @@ const AssistantChatInner = forwardRef<
|
|
|
3790
3816
|
<RunningActivityStatus label={runningStatusLabel} />
|
|
3791
3817
|
)}
|
|
3792
3818
|
{queuedMessages.map((msg) => {
|
|
3793
|
-
const displayText =
|
|
3794
|
-
.
|
|
3795
|
-
|
|
3819
|
+
const displayText = displayableUserMessageText(
|
|
3820
|
+
msg.text,
|
|
3821
|
+
);
|
|
3796
3822
|
return (
|
|
3797
3823
|
<div
|
|
3798
3824
|
key={msg.id}
|
|
@@ -1526,6 +1526,18 @@ export function createAgentChatAdapter(
|
|
|
1526
1526
|
);
|
|
1527
1527
|
};
|
|
1528
1528
|
|
|
1529
|
+
const dispatchMissingApiKey = () => {
|
|
1530
|
+
if (typeof window === "undefined") return;
|
|
1531
|
+
window.dispatchEvent(
|
|
1532
|
+
new CustomEvent("agent-chat:missing-api-key", {
|
|
1533
|
+
detail: {
|
|
1534
|
+
...(tabId ? { tabId } : {}),
|
|
1535
|
+
...(threadId ? { threadId } : {}),
|
|
1536
|
+
},
|
|
1537
|
+
}),
|
|
1538
|
+
);
|
|
1539
|
+
};
|
|
1540
|
+
|
|
1529
1541
|
const tryRecoverAuthOnce = async (): Promise<boolean> => {
|
|
1530
1542
|
if (authRecoveryAttempted || abortSignal.aborted) return false;
|
|
1531
1543
|
authRecoveryAttempted = true;
|
|
@@ -2418,9 +2430,7 @@ export function createAgentChatAdapter(
|
|
|
2418
2430
|
if (isMissingCredentialMessage(body)) {
|
|
2419
2431
|
const failure = missingCredentialFailure(body);
|
|
2420
2432
|
if (typeof window !== "undefined") {
|
|
2421
|
-
|
|
2422
|
-
new Event("agent-chat:missing-api-key"),
|
|
2423
|
-
);
|
|
2433
|
+
dispatchMissingApiKey();
|
|
2424
2434
|
window.dispatchEvent(
|
|
2425
2435
|
new CustomEvent("agent-chat:run-error", {
|
|
2426
2436
|
detail: { ...failure.runError, tabId },
|
|
@@ -2633,7 +2643,7 @@ export function createAgentChatAdapter(
|
|
|
2633
2643
|
if (isMissingCredentialMessage(errMsg)) {
|
|
2634
2644
|
const failure = missingCredentialFailure(errMsg);
|
|
2635
2645
|
if (typeof window !== "undefined") {
|
|
2636
|
-
|
|
2646
|
+
dispatchMissingApiKey();
|
|
2637
2647
|
window.dispatchEvent(
|
|
2638
2648
|
new CustomEvent("agent-chat:run-error", {
|
|
2639
2649
|
detail: { ...failure.runError, tabId },
|
|
@@ -75,7 +75,11 @@ const PENDING_SELECTION_KEY = "pending-selection-context";
|
|
|
75
75
|
// ─── displayableUserMessageText ───────────────────────────────────────────────
|
|
76
76
|
|
|
77
77
|
export function displayableUserMessageText(text: string): string {
|
|
78
|
-
return text
|
|
78
|
+
return text
|
|
79
|
+
.replace(/<context\b[^>]*>[\s\S]*?<\/context>\n?/gi, "")
|
|
80
|
+
.replace(/<context\b[^>]*>[\s\S]*$/gi, "")
|
|
81
|
+
.replace(/<\/context>/gi, "")
|
|
82
|
+
.trim();
|
|
79
83
|
}
|
|
80
84
|
|
|
81
85
|
// ─── Message timestamp helpers ────────────────────────────────────────────────
|
|
@@ -601,6 +601,15 @@ function dispatchActivityClear(tabId: string | undefined) {
|
|
|
601
601
|
);
|
|
602
602
|
}
|
|
603
603
|
|
|
604
|
+
function dispatchMissingApiKey(tabId: string | undefined) {
|
|
605
|
+
if (typeof window === "undefined") return;
|
|
606
|
+
window.dispatchEvent(
|
|
607
|
+
new CustomEvent("agent-chat:missing-api-key", {
|
|
608
|
+
detail: { tabId },
|
|
609
|
+
}),
|
|
610
|
+
);
|
|
611
|
+
}
|
|
612
|
+
|
|
604
613
|
function pendingToolNames(content: ContentPart[]): {
|
|
605
614
|
activity: string[];
|
|
606
615
|
running: string[];
|
|
@@ -1056,7 +1065,7 @@ export function processEvent(
|
|
|
1056
1065
|
errorCode,
|
|
1057
1066
|
};
|
|
1058
1067
|
if (typeof window !== "undefined") {
|
|
1059
|
-
|
|
1068
|
+
dispatchMissingApiKey(tabId);
|
|
1060
1069
|
window.dispatchEvent(
|
|
1061
1070
|
new CustomEvent("agent-chat:run-error", {
|
|
1062
1071
|
detail: { ...runError, tabId },
|
|
@@ -1156,9 +1165,7 @@ export function processEvent(
|
|
|
1156
1165
|
}
|
|
1157
1166
|
const normalized = normalizeChatError(errMsg, ev.errorCode);
|
|
1158
1167
|
if (isMissingCredentialText(errMsg, ev.errorCode)) {
|
|
1159
|
-
|
|
1160
|
-
window.dispatchEvent(new Event("agent-chat:missing-api-key"));
|
|
1161
|
-
}
|
|
1168
|
+
dispatchMissingApiKey(tabId);
|
|
1162
1169
|
}
|
|
1163
1170
|
const runError = {
|
|
1164
1171
|
message: normalized.message,
|
|
@@ -15,10 +15,20 @@ export interface UseAgentEngineConfiguredResult {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface FetchAgentEngineConfiguredStateOptions {
|
|
18
|
+
/**
|
|
19
|
+
* Legacy hint from explicit missing-key stream events. Kept for API
|
|
20
|
+
* compatibility, but missing state still requires authoritative status
|
|
21
|
+
* responses so transient endpoint failures do not clobber connected state.
|
|
22
|
+
*/
|
|
18
23
|
missingFallback?: boolean;
|
|
19
24
|
timeoutMs?: number;
|
|
20
25
|
}
|
|
21
26
|
|
|
27
|
+
export interface UseAgentEngineConfiguredOptions {
|
|
28
|
+
tabId?: string | null;
|
|
29
|
+
threadId?: string | null;
|
|
30
|
+
}
|
|
31
|
+
|
|
22
32
|
const DEFAULT_STATUS_CHECK_TIMEOUT_MS = 2500;
|
|
23
33
|
|
|
24
34
|
async function fetchStatusJson(
|
|
@@ -60,6 +70,27 @@ function hasConfiguredFlag(value: unknown): value is { configured: boolean } {
|
|
|
60
70
|
);
|
|
61
71
|
}
|
|
62
72
|
|
|
73
|
+
function missingKeyEventMatchesScope(
|
|
74
|
+
event: Event,
|
|
75
|
+
options: UseAgentEngineConfiguredOptions | undefined,
|
|
76
|
+
): boolean {
|
|
77
|
+
const detail = (event as CustomEvent).detail as
|
|
78
|
+
| { tabId?: unknown; threadId?: unknown }
|
|
79
|
+
| undefined;
|
|
80
|
+
const eventTabId = typeof detail?.tabId === "string" ? detail.tabId : null;
|
|
81
|
+
const eventThreadId =
|
|
82
|
+
typeof detail?.threadId === "string" ? detail.threadId : null;
|
|
83
|
+
if (!eventTabId && !eventThreadId) return true;
|
|
84
|
+
|
|
85
|
+
const tabId = options?.tabId ?? null;
|
|
86
|
+
const threadId = options?.threadId ?? null;
|
|
87
|
+
if (!tabId && !threadId) return true;
|
|
88
|
+
return (
|
|
89
|
+
(eventTabId != null && eventTabId === tabId) ||
|
|
90
|
+
(eventThreadId != null && eventThreadId === threadId)
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
63
94
|
export async function fetchAgentEngineConfiguredState(
|
|
64
95
|
enabled = true,
|
|
65
96
|
options?: FetchAgentEngineConfiguredStateOptions,
|
|
@@ -76,22 +107,31 @@ export async function fetchAgentEngineConfiguredState(
|
|
|
76
107
|
fetchStatusJson("/_agent-native/agent-engine/status", timeoutMs),
|
|
77
108
|
]);
|
|
78
109
|
|
|
79
|
-
// All three failed — likely a flaky network; keep the caller in unknown
|
|
80
|
-
//
|
|
110
|
+
// All three failed — likely a flaky network; keep the caller in unknown.
|
|
111
|
+
// Even an explicit missing-key stream event should not pin the composer into
|
|
112
|
+
// setup without a fresh authoritative status response.
|
|
81
113
|
if (envKeys == null && builderStatus == null && engineStatus == null) {
|
|
82
|
-
return
|
|
114
|
+
return "unknown";
|
|
83
115
|
}
|
|
84
116
|
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
117
|
+
const envKeysKnown = Array.isArray(envKeys);
|
|
118
|
+
const builderStatusKnown = hasConfiguredFlag(builderStatus);
|
|
119
|
+
const engineStatusKnown = hasConfiguredFlag(engineStatus);
|
|
120
|
+
const keys = envKeysKnown
|
|
121
|
+
? (envKeys as Array<{
|
|
122
|
+
key: string;
|
|
123
|
+
configured: boolean;
|
|
124
|
+
}>)
|
|
125
|
+
: [];
|
|
89
126
|
const llmKeys = keys.filter((k) => PROVIDER_ENV_VAR_SET.has(k.key));
|
|
90
127
|
const anyConfigured =
|
|
91
128
|
llmKeys.some((k) => k.configured) ||
|
|
92
|
-
(
|
|
93
|
-
(
|
|
94
|
-
|
|
129
|
+
(builderStatusKnown && builderStatus.configured) ||
|
|
130
|
+
(engineStatusKnown && engineStatus.configured);
|
|
131
|
+
if (anyConfigured) return "configured";
|
|
132
|
+
return envKeysKnown && builderStatusKnown && engineStatusKnown
|
|
133
|
+
? "missing"
|
|
134
|
+
: "unknown";
|
|
95
135
|
}
|
|
96
136
|
|
|
97
137
|
/**
|
|
@@ -103,6 +143,7 @@ export async function fetchAgentEngineConfiguredState(
|
|
|
103
143
|
*/
|
|
104
144
|
export function useAgentEngineConfigured(
|
|
105
145
|
enabled = true,
|
|
146
|
+
options?: UseAgentEngineConfiguredOptions,
|
|
106
147
|
): UseAgentEngineConfiguredResult {
|
|
107
148
|
const [state, setState] = useState<AgentEngineConfiguredState>("unknown");
|
|
108
149
|
|
|
@@ -119,7 +160,8 @@ export function useAgentEngineConfigured(
|
|
|
119
160
|
const onConfiguredChanged = () => {
|
|
120
161
|
void check();
|
|
121
162
|
};
|
|
122
|
-
const onMissing = () => {
|
|
163
|
+
const onMissing = (event: Event) => {
|
|
164
|
+
if (!missingKeyEventMatchesScope(event, options)) return;
|
|
123
165
|
if (!enabled) {
|
|
124
166
|
setState("configured");
|
|
125
167
|
return;
|
|
@@ -143,7 +185,7 @@ export function useAgentEngineConfigured(
|
|
|
143
185
|
);
|
|
144
186
|
window.removeEventListener("agent-chat:missing-api-key", onMissing);
|
|
145
187
|
};
|
|
146
|
-
}, [enabled]);
|
|
188
|
+
}, [enabled, options?.tabId, options?.threadId]);
|
|
147
189
|
|
|
148
190
|
return { missing: state === "missing", state };
|
|
149
191
|
}
|
|
@@ -7124,11 +7124,15 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
|
|
|
7124
7124
|
setResponseStatus(event, 400);
|
|
7125
7125
|
return { error: "message is required" };
|
|
7126
7126
|
}
|
|
7127
|
-
// Strip mention markup
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7127
|
+
// Strip hidden context and mention markup before title generation.
|
|
7128
|
+
// Fallback titles are often direct truncations, so never let injected
|
|
7129
|
+
// prompt context become a visible tab label.
|
|
7130
|
+
const cleanMessage = message
|
|
7131
|
+
.replace(/<context\b[^>]*>[\s\S]*?<\/context>\n?/gi, "")
|
|
7132
|
+
.replace(/<context\b[^>]*>[\s\S]*$/gi, "")
|
|
7133
|
+
.replace(/<\/context>/gi, "")
|
|
7134
|
+
.replace(/@\[([^\]|]+)\|[^\]]*\]/g, "@$1")
|
|
7135
|
+
.trim();
|
|
7132
7136
|
// Mirror the chat-run resolution so BYO-key users have title
|
|
7133
7137
|
// generation billed to their own key instead of the platform key.
|
|
7134
7138
|
const { getOwnerActiveApiKey } =
|
|
@@ -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;AAYrE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAQL,KAAK,oBAAoB,EAC1B,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantChat.d.ts","sourceRoot":"","sources":["../../src/client/AssistantChat.tsx"],"names":[],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3B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAC;IACxE,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,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;AAk/F7B,eAAO,MAAM,aAAa,gGA2GxB,CAAC"}
|
|
@@ -14,7 +14,7 @@ import { AGENT_CHAT_VIEW_TRANSITION_PREPARE_EVENT } from "./chat-view-transition
|
|
|
14
14
|
// ─── chat/ module imports ─────────────────────────────────────────────────────
|
|
15
15
|
import { DownscalingImageAttachmentAdapter, BinaryDocumentAttachmentAdapter, MAX_ESTIMATED_BODY_BYTES, AGGRESSIVE_MAX_IMAGE_DIMENSION, AGGRESSIVE_JPEG_QUALITY, transcodeImageToDataURL, createAgentImageAttachments, serializeQueuedAttachments, estimateAttachmentBodyBytes, } from "./chat/attachment-adapters.js";
|
|
16
16
|
import { TextStreamingContext } from "./chat/markdown-renderer.js";
|
|
17
|
-
import { CheckpointContext, MessageActionsContext, UserMessage, AssistantMessage, SelectionAttachedPill, RunningActivityStatus, } from "./chat/message-components.js";
|
|
17
|
+
import { CheckpointContext, MessageActionsContext, UserMessage, AssistantMessage, SelectionAttachedPill, RunningActivityStatus, displayableUserMessageText, } from "./chat/message-components.js";
|
|
18
18
|
import { repoHasAssistantMessage, getRepoMessages, getRepoMessage, shouldImportServerThreadData, dedupeRepoMessagesById, dropEmptyAssistantMessages, } from "./chat/repo-helpers.js";
|
|
19
19
|
import { BuilderSetupCard, LoopLimitContinueCard, RunErrorRecoveryCard, PlanModeCallout, getLoopLimitMetadata, getRunErrorMetadata, getRequestModeMetadata, } from "./chat/run-recovery.js";
|
|
20
20
|
import { createAgentChatRuntimeAdapter, } from "./chat/runtime.js";
|
|
@@ -200,13 +200,12 @@ function getMessageText(message) {
|
|
|
200
200
|
const msg = message?.message ?? message;
|
|
201
201
|
const content = msg?.content;
|
|
202
202
|
if (Array.isArray(content)) {
|
|
203
|
-
return content
|
|
203
|
+
return displayableUserMessageText(content
|
|
204
204
|
.filter((p) => p?.type === "text" && typeof p.text === "string")
|
|
205
205
|
.map((p) => p.text)
|
|
206
|
-
.join("\n")
|
|
207
|
-
.trim();
|
|
206
|
+
.join("\n"));
|
|
208
207
|
}
|
|
209
|
-
return typeof content === "string" ? content
|
|
208
|
+
return typeof content === "string" ? displayableUserMessageText(content) : "";
|
|
210
209
|
}
|
|
211
210
|
function contentPartFollowKey(part) {
|
|
212
211
|
const type = typeof part?.type === "string" ? part.type : "unknown";
|
|
@@ -611,7 +610,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
611
610
|
}
|
|
612
611
|
};
|
|
613
612
|
}, [threadRuntime]);
|
|
614
|
-
const agentEngineConfigured = useAgentEngineConfigured(providerStatusChecksEnabled);
|
|
613
|
+
const agentEngineConfigured = useAgentEngineConfigured(providerStatusChecksEnabled, { tabId, threadId });
|
|
615
614
|
const missingApiKey = agentEngineConfigured.missing;
|
|
616
615
|
const isComposerDisabled = missingApiKey || composerDisabled;
|
|
617
616
|
// Once a provider connects, `useAgentEngineConfigured` flips to "configured"
|
|
@@ -639,10 +638,17 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
639
638
|
setComposerError(LLM_MISSING_CREDENTIALS_MESSAGE);
|
|
640
639
|
setMissingKeyBouncePulse((p) => p + 1);
|
|
641
640
|
if (typeof window !== "undefined") {
|
|
642
|
-
window.dispatchEvent(new
|
|
641
|
+
window.dispatchEvent(new CustomEvent("agent-chat:missing-api-key", {
|
|
642
|
+
detail: { tabId, threadId },
|
|
643
|
+
}));
|
|
643
644
|
}
|
|
644
645
|
return false;
|
|
645
|
-
}, [
|
|
646
|
+
}, [
|
|
647
|
+
agentEngineConfigured.state,
|
|
648
|
+
providerStatusChecksEnabled,
|
|
649
|
+
tabId,
|
|
650
|
+
threadId,
|
|
651
|
+
]);
|
|
646
652
|
const [authError, setAuthError] = useState(null);
|
|
647
653
|
const [authSessionAvailable, setAuthSessionAvailable] = useState(false);
|
|
648
654
|
const [queuedMessages, setQueuedMessages] = useState([]);
|
|
@@ -1684,18 +1690,21 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1684
1690
|
const res = await fetch(agentNativePath("/_agent-native/auth/session"), {
|
|
1685
1691
|
cache: "no-store",
|
|
1686
1692
|
});
|
|
1687
|
-
if (!res.ok)
|
|
1688
|
-
return
|
|
1693
|
+
if (!res.ok) {
|
|
1694
|
+
return res.status === 401 || res.status === 403
|
|
1695
|
+
? "missing"
|
|
1696
|
+
: "unknown";
|
|
1697
|
+
}
|
|
1689
1698
|
const data = await res.json().catch(() => null);
|
|
1690
1699
|
const hasSession = !!data && !data.error;
|
|
1691
1700
|
setAuthSessionAvailable(hasSession);
|
|
1692
1701
|
if (hasSession) {
|
|
1693
1702
|
setAuthError(null);
|
|
1694
1703
|
}
|
|
1695
|
-
return hasSession;
|
|
1704
|
+
return hasSession ? "available" : "missing";
|
|
1696
1705
|
}
|
|
1697
1706
|
catch {
|
|
1698
|
-
return
|
|
1707
|
+
return "unknown";
|
|
1699
1708
|
}
|
|
1700
1709
|
}, []);
|
|
1701
1710
|
useEffect(() => {
|
|
@@ -1708,9 +1717,13 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1708
1717
|
eventThreadId !== threadId) {
|
|
1709
1718
|
return;
|
|
1710
1719
|
}
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1720
|
+
void (async () => {
|
|
1721
|
+
const sessionState = await checkAuthSession();
|
|
1722
|
+
if (sessionState !== "missing")
|
|
1723
|
+
return;
|
|
1724
|
+
setAuthSessionAvailable(false);
|
|
1725
|
+
setAuthError({ sessionExpired: detail?.reason === "session-expired" });
|
|
1726
|
+
})();
|
|
1714
1727
|
};
|
|
1715
1728
|
window.addEventListener("agent-chat:auth-error", handler);
|
|
1716
1729
|
return () => window.removeEventListener("agent-chat:auth-error", handler);
|
|
@@ -1725,8 +1738,10 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1725
1738
|
// symptom we want signal on.
|
|
1726
1739
|
const stuckCapture = window.setTimeout(() => {
|
|
1727
1740
|
void (async () => {
|
|
1728
|
-
const
|
|
1729
|
-
if (
|
|
1741
|
+
const sessionState = await checkAuthSession();
|
|
1742
|
+
if (sessionState === "available")
|
|
1743
|
+
return;
|
|
1744
|
+
if (sessionState !== "missing")
|
|
1730
1745
|
return;
|
|
1731
1746
|
if (!shouldCaptureStuckAuthCard)
|
|
1732
1747
|
return;
|
|
@@ -2619,9 +2634,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2619
2634
|
reconnectContent.length > 0 && (_jsx(ReconnectStreamMessage, { content: reconnectContent })), (isReconnecting || reconnectFrozen) &&
|
|
2620
2635
|
reconnectContent.length === 0 &&
|
|
2621
2636
|
reconnectActivityContent.length > 0 && (_jsx(ReconnectStreamMessage, { content: reconnectActivityContent })), showRunningInUI && (_jsx(RunningActivityStatus, { label: runningStatusLabel })), queuedMessages.map((msg) => {
|
|
2622
|
-
const displayText = msg.text
|
|
2623
|
-
.replace(/<context>[\s\S]*?<\/context>\n?/g, "")
|
|
2624
|
-
.trim();
|
|
2637
|
+
const displayText = displayableUserMessageText(msg.text);
|
|
2625
2638
|
return (_jsxs("div", { className: "group flex items-start justify-end gap-1.5", children: [_jsx("button", { type: "button", onClick: () => applyLocalQueuedMessages((prev) => prev.filter((m) => m.id !== msg.id)), "aria-label": "Remove from queue", className: "mt-1.5 flex h-5 w-5 items-center justify-center rounded-full border border-border bg-background text-muted-foreground opacity-0 shadow-sm transition-opacity hover:bg-accent hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100", children: _jsx(IconX, { className: "h-3 w-3" }) }), _jsxs("div", { className: "max-w-[85%] rounded-lg bg-accent/50 px-3 py-2 text-sm leading-relaxed text-foreground/60 whitespace-pre-wrap break-words", children: [displayText, msg.images && msg.images.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-1.5 mt-1.5", children: msg.images.map((img, j) => (_jsx("img", { src: img, alt: "", className: "h-12 w-12 rounded object-cover border border-border/50" }, j))) }))] })] }, msg.id));
|
|
2626
2639
|
}), resolvedThreadFooterSlot ? (_jsx("div", { className: "agent-thread-footer-slot", children: resolvedThreadFooterSlot })) : null] })) }), showScrollToBottom && (_jsx("div", { className: "shrink-0 flex justify-center -mb-1", children: _jsx("button", { type: "button", onClick: scrollToBottom, className: "flex h-7 w-7 items-center justify-center rounded-full border border-border bg-background shadow-sm hover:bg-accent", "aria-label": "Scroll to bottom", children: _jsx(IconChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" }) }) })), showComposerSlot ? composerSlot : null, showCenteredEmptyThreadFooterSlot ? (_jsx("div", { className: "agent-thread-footer-slot agent-thread-footer-slot--centered-empty", children: resolvedThreadFooterSlot })) : null, guidedQuestions && guidedQuestions.length > 0 && (_jsx("div", { className: "shrink-0 px-3 pb-2", children: _jsx(GuidedQuestionFlow, { questions: guidedQuestions, onSubmit: handleGuidedQuestionsSubmit, onSkip: handleGuidedQuestionsSkip, ...(guidedQuestionsTitle
|
|
2627
2640
|
? { title: guidedQuestionsTitle }
|