@tutti-os/agent-gui 0.0.68 → 0.0.69
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/agent-conversation/index.d.ts +2 -2
- package/dist/agent-conversation/index.js +5 -5
- package/dist/agent-message-center/index.js +7 -7
- package/dist/{agentGuiNodeTypes-BTHu_g4m.d.ts → agentGuiNodeTypes-BipgG2ib.d.ts} +8 -1
- package/dist/app/renderer/agentactivity.css +41 -4
- package/dist/app/renderer/assets/icons/agents/opencode-flat-filled.svg +4 -0
- package/dist/{chunk-C2M2ELXF.js → chunk-547R2HOD.js} +2 -2
- package/dist/{chunk-J335PQ5H.js → chunk-6XRTDIDR.js} +11 -26
- package/dist/chunk-6XRTDIDR.js.map +1 -0
- package/dist/{chunk-KJLSZETD.js → chunk-DAPKF2SN.js} +2 -2
- package/dist/{chunk-GOEL3BO7.js → chunk-EHLJL76A.js} +2 -2
- package/dist/{chunk-GXHZNIWT.js → chunk-ERBUQOIL.js} +2 -2
- package/dist/{chunk-TB7PKP6F.js → chunk-FRAG4UFU.js} +4 -4
- package/dist/{chunk-A2KZVRUO.js → chunk-HAKNLXW7.js} +2 -2
- package/dist/{chunk-DYX6466P.js → chunk-JA6Z3QA7.js} +3 -3
- package/dist/{chunk-3QPN2Y7R.js → chunk-KAPBUKIT.js} +21 -15
- package/dist/chunk-KAPBUKIT.js.map +1 -0
- package/dist/{chunk-LQRD4X6R.js → chunk-KTIHLBCN.js} +2 -2
- package/dist/{chunk-D22A3KGQ.js → chunk-KTIKZNGS.js} +2 -2
- package/dist/{chunk-YE5JSME7.js → chunk-N37A62BK.js} +17 -1
- package/dist/chunk-N37A62BK.js.map +1 -0
- package/dist/{chunk-AIR6A4NP.js → chunk-NH3XBJTZ.js} +2 -2
- package/dist/{chunk-VRV6GBF5.js → chunk-NROZAN34.js} +8 -1
- package/dist/chunk-NROZAN34.js.map +1 -0
- package/dist/{chunk-QGKK6FHC.js → chunk-S32FLJRP.js} +4 -4
- package/dist/context-mention-palette/index.js +6 -6
- package/dist/i18n/index.d.ts +20 -14
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +8 -5
- package/dist/index.js +492 -191
- package/dist/index.js.map +1 -1
- package/dist/opencode-flat-filled-CYAJPX45.svg +4 -0
- package/dist/queued-prompt-runtime.d.ts +2 -2
- package/dist/{types-BwDrG654.d.ts → types-DZ79b8Zn.d.ts} +6 -1
- package/dist/workbench/contribution.d.ts +1 -1
- package/dist/workbench/contribution.js +4 -4
- package/dist/workbench/index.d.ts +1 -1
- package/dist/workbench/index.js +7 -7
- package/dist/workbench/launch.d.ts +1 -1
- package/dist/workbench/providerCatalog.d.ts +1 -1
- package/dist/workbench/sessionTitle.d.ts +1 -1
- package/dist/workbench/sessionTitle.js +3 -3
- package/dist/workbench/state.d.ts +1 -1
- package/dist/workbench/state.js +2 -2
- package/dist/workbench/types.d.ts +1 -1
- package/dist/workspace-agent-generated-files.js +3 -3
- package/package.json +12 -12
- package/dist/chunk-3QPN2Y7R.js.map +0 -1
- package/dist/chunk-J335PQ5H.js.map +0 -1
- package/dist/chunk-VRV6GBF5.js.map +0 -1
- package/dist/chunk-YE5JSME7.js.map +0 -1
- /package/dist/{chunk-C2M2ELXF.js.map → chunk-547R2HOD.js.map} +0 -0
- /package/dist/{chunk-KJLSZETD.js.map → chunk-DAPKF2SN.js.map} +0 -0
- /package/dist/{chunk-GOEL3BO7.js.map → chunk-EHLJL76A.js.map} +0 -0
- /package/dist/{chunk-GXHZNIWT.js.map → chunk-ERBUQOIL.js.map} +0 -0
- /package/dist/{chunk-TB7PKP6F.js.map → chunk-FRAG4UFU.js.map} +0 -0
- /package/dist/{chunk-A2KZVRUO.js.map → chunk-HAKNLXW7.js.map} +0 -0
- /package/dist/{chunk-DYX6466P.js.map → chunk-JA6Z3QA7.js.map} +0 -0
- /package/dist/{chunk-LQRD4X6R.js.map → chunk-KTIHLBCN.js.map} +0 -0
- /package/dist/{chunk-D22A3KGQ.js.map → chunk-KTIKZNGS.js.map} +0 -0
- /package/dist/{chunk-AIR6A4NP.js.map → chunk-NH3XBJTZ.js.map} +0 -0
- /package/dist/{chunk-QGKK6FHC.js.map → chunk-S32FLJRP.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
resolveAgentGuiSessionProviderFlatIconUrl,
|
|
11
11
|
resolveNextAgentGUIConversationRailWidthPx,
|
|
12
12
|
shouldAutoCollapseAgentGUIConversationRail
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-NROZAN34.js";
|
|
14
14
|
import {
|
|
15
15
|
agentGUIDefaultTargetProviders,
|
|
16
16
|
agentGUIProviderTargetRefsEqual,
|
|
@@ -22,11 +22,11 @@ import {
|
|
|
22
22
|
localAgentGUIProviderTargetId,
|
|
23
23
|
normalizeAgentGUIProviderTargets,
|
|
24
24
|
resolveAgentGUIProviderTarget
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-N37A62BK.js";
|
|
26
26
|
import {
|
|
27
27
|
AgentInteractivePromptSurface,
|
|
28
28
|
approvalOptionDisplayLabel
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-JA6Z3QA7.js";
|
|
30
30
|
import {
|
|
31
31
|
PLAN_IMPLEMENTATION_ACTION_FEEDBACK,
|
|
32
32
|
PLAN_IMPLEMENTATION_ACTION_IMPLEMENT,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
resolveAgentGUIExplicitConversationTitle,
|
|
46
46
|
resolveAgentGUIProviderDisplayLabel,
|
|
47
47
|
resolveAgentGUIProviderIdentity
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-KTIKZNGS.js";
|
|
49
49
|
import {
|
|
50
50
|
AgentConversationFlow,
|
|
51
51
|
Button,
|
|
@@ -66,14 +66,14 @@ import {
|
|
|
66
66
|
skillTriggerForPrefix,
|
|
67
67
|
toLocalShortDateTime,
|
|
68
68
|
useProjectedAgentConversation
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-6XRTDIDR.js";
|
|
70
70
|
import {
|
|
71
71
|
AgentMessageMarkdown,
|
|
72
72
|
AgentTargetPresentationProvider,
|
|
73
73
|
ZoomableImage,
|
|
74
74
|
cn,
|
|
75
75
|
resolveWorkspaceLinkAction
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-DAPKF2SN.js";
|
|
77
77
|
import {
|
|
78
78
|
openAgentEnvPanel
|
|
79
79
|
} from "./chunk-PSLAWU25.js";
|
|
@@ -84,12 +84,12 @@ import {
|
|
|
84
84
|
DEFAULT_AGENT_MENTION_FILTER,
|
|
85
85
|
agentMentionItemKey,
|
|
86
86
|
preloadAgentMentionBrowse
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-S32FLJRP.js";
|
|
88
88
|
import {
|
|
89
89
|
buildWorkspaceAgentActivityListViewModel,
|
|
90
90
|
isWorkspaceAgentUntitledTask
|
|
91
|
-
} from "./chunk-
|
|
92
|
-
import "./chunk-
|
|
91
|
+
} from "./chunk-ERBUQOIL.js";
|
|
92
|
+
import "./chunk-HAKNLXW7.js";
|
|
93
93
|
import {
|
|
94
94
|
resolveWorkspaceAgentSessionSortTimeUnixMs
|
|
95
95
|
} from "./chunk-IBIMGLCD.js";
|
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
mentionItemToAttrs,
|
|
101
101
|
normalizeAgentSessionMentionTitle,
|
|
102
102
|
parseMentionItemFromHref
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-547R2HOD.js";
|
|
104
104
|
import "./chunk-Y35GDLP2.js";
|
|
105
105
|
import "./chunk-LUGELG5V.js";
|
|
106
106
|
import {
|
|
@@ -139,14 +139,14 @@ import {
|
|
|
139
139
|
agentGuiI18nResources,
|
|
140
140
|
translate,
|
|
141
141
|
useTranslation
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-NH3XBJTZ.js";
|
|
143
143
|
import "./chunk-PJP5BUU6.js";
|
|
144
144
|
import {
|
|
145
145
|
agentColorfulUrl,
|
|
146
146
|
cursorColorfulUrl,
|
|
147
147
|
normalizeManagedAgentProvider
|
|
148
148
|
} from "./chunk-4I2VCAMW.js";
|
|
149
|
-
import "./chunk-
|
|
149
|
+
import "./chunk-KAPBUKIT.js";
|
|
150
150
|
import {
|
|
151
151
|
AGENT_CONTEXT_MENTION_PROVIDER_IDS
|
|
152
152
|
} from "./chunk-JM24HADP.js";
|
|
@@ -3121,7 +3121,7 @@ function emptyAgentComposerDraft() {
|
|
|
3121
3121
|
return { prompt: "", images: [], files: [] };
|
|
3122
3122
|
}
|
|
3123
3123
|
function agentComposerDraftHasContent(draft) {
|
|
3124
|
-
return draft.prompt.trim() !== "" || draft.images.length > 0 || (draft.files?.length ?? 0) > 0;
|
|
3124
|
+
return draft.prompt.trim() !== "" || draft.images.length > 0 || (draft.files?.length ?? 0) > 0 || (draft.largeTexts?.some((item) => item.text.trim() !== "") ?? false);
|
|
3125
3125
|
}
|
|
3126
3126
|
function normalizeAgentPromptContentBlocks(content) {
|
|
3127
3127
|
const result = [];
|
|
@@ -3229,9 +3229,35 @@ function agentComposerDraftToPromptContent(input) {
|
|
|
3229
3229
|
...file.sizeBytes ? { sizeBytes: file.sizeBytes } : {},
|
|
3230
3230
|
name: file.name,
|
|
3231
3231
|
kind: "file"
|
|
3232
|
-
}))
|
|
3232
|
+
})),
|
|
3233
|
+
...largeTextPromptContent(input.draft.largeTexts ?? [])
|
|
3233
3234
|
]);
|
|
3234
3235
|
}
|
|
3236
|
+
function agentComposerDraftSubmittedText(draft) {
|
|
3237
|
+
return agentPromptContentDisplayText(
|
|
3238
|
+
normalizeAgentPromptContentBlocks([
|
|
3239
|
+
...textPromptContent(draft.prompt),
|
|
3240
|
+
...largeTextPromptContent(draft.largeTexts ?? [])
|
|
3241
|
+
])
|
|
3242
|
+
);
|
|
3243
|
+
}
|
|
3244
|
+
function agentComposerDraftDisplayPrompt(draft) {
|
|
3245
|
+
const largeTexts = draft.largeTexts?.filter(
|
|
3246
|
+
(item) => item.text.trim() !== ""
|
|
3247
|
+
);
|
|
3248
|
+
if (!largeTexts?.length) {
|
|
3249
|
+
return void 0;
|
|
3250
|
+
}
|
|
3251
|
+
const parts = [draft.prompt.trim()].filter(Boolean);
|
|
3252
|
+
parts.push(
|
|
3253
|
+
...largeTexts.map((item, index) => {
|
|
3254
|
+
const name = item.name.trim() || `pasted-text-${index + 1}.txt`;
|
|
3255
|
+
const sizeLabel = typeof item.sizeBytes === "number" && Number.isFinite(item.sizeBytes) ? ` \xB7 ${formatAgentComposerDraftBytes(item.sizeBytes)}` : "";
|
|
3256
|
+
return `[${name}${sizeLabel}]`;
|
|
3257
|
+
})
|
|
3258
|
+
);
|
|
3259
|
+
return parts.join("\n");
|
|
3260
|
+
}
|
|
3235
3261
|
function agentPromptFileBlocks(content) {
|
|
3236
3262
|
return normalizeAgentPromptContentBlocks(content).filter(
|
|
3237
3263
|
(block) => block.type === "file" && (typeof block.path === "string" || typeof block.hostPath === "string")
|
|
@@ -3269,6 +3295,30 @@ function textPromptContent(prompt) {
|
|
|
3269
3295
|
const text = prompt.trim();
|
|
3270
3296
|
return text ? [{ type: "text", text }] : [];
|
|
3271
3297
|
}
|
|
3298
|
+
function largeTextPromptContent(largeTexts) {
|
|
3299
|
+
return largeTexts.filter((item) => item.text.trim() !== "").map((item, index) => {
|
|
3300
|
+
const name = item.name.trim() || `pasted-text-${index + 1}.txt`;
|
|
3301
|
+
return {
|
|
3302
|
+
type: "text",
|
|
3303
|
+
text: `${translate("agentHost.agentGui.pastedTextPromptAttachment", {
|
|
3304
|
+
name
|
|
3305
|
+
})}
|
|
3306
|
+
|
|
3307
|
+
${item.text}`
|
|
3308
|
+
};
|
|
3309
|
+
});
|
|
3310
|
+
}
|
|
3311
|
+
function formatAgentComposerDraftBytes(sizeBytes) {
|
|
3312
|
+
if (sizeBytes < 1024) {
|
|
3313
|
+
return `${sizeBytes} B`;
|
|
3314
|
+
}
|
|
3315
|
+
const kib = sizeBytes / 1024;
|
|
3316
|
+
if (kib < 1024) {
|
|
3317
|
+
return `${kib.toFixed(kib >= 10 ? 0 : 1)} KB`;
|
|
3318
|
+
}
|
|
3319
|
+
const mib = kib / 1024;
|
|
3320
|
+
return `${mib.toFixed(mib >= 10 ? 0 : 1)} MB`;
|
|
3321
|
+
}
|
|
3272
3322
|
function agentPromptImageBlockToDraftImage(image, idPrefix, index) {
|
|
3273
3323
|
return {
|
|
3274
3324
|
id: `${idPrefix}:image:${index}`,
|
|
@@ -7309,7 +7359,7 @@ function shouldClearSubmittedDraft(input) {
|
|
|
7309
7359
|
const submittedPrompt = agentPromptContentDisplayText(
|
|
7310
7360
|
input.submittedContent
|
|
7311
7361
|
).trim();
|
|
7312
|
-
if (currentDraft.
|
|
7362
|
+
if (agentComposerDraftSubmittedText(currentDraft).trim() !== submittedPrompt) {
|
|
7313
7363
|
return false;
|
|
7314
7364
|
}
|
|
7315
7365
|
const submittedImages = input.submittedContent.filter(
|
|
@@ -8615,6 +8665,8 @@ var EMPTY_QUEUED_PROMPTS = Object.freeze(
|
|
|
8615
8665
|
function areAgentComposerDraftsEqual(left, right) {
|
|
8616
8666
|
const leftFiles = left.files ?? [];
|
|
8617
8667
|
const rightFiles = right.files ?? [];
|
|
8668
|
+
const leftLargeTexts = left.largeTexts ?? [];
|
|
8669
|
+
const rightLargeTexts = right.largeTexts ?? [];
|
|
8618
8670
|
return left.prompt === right.prompt && left.images.length === right.images.length && left.images.every((image, index) => {
|
|
8619
8671
|
const other = right.images[index];
|
|
8620
8672
|
if (!other) {
|
|
@@ -8627,6 +8679,12 @@ function areAgentComposerDraftsEqual(left, right) {
|
|
|
8627
8679
|
return false;
|
|
8628
8680
|
}
|
|
8629
8681
|
return file.id === other.id && file.name === other.name && file.mimeType === other.mimeType && file.path === other.path && file.hostPath === other.hostPath && file.assetId === other.assetId && file.sizeBytes === other.sizeBytes && file.uploading === other.uploading && file.uploadError === other.uploadError;
|
|
8682
|
+
}) && leftLargeTexts.length === rightLargeTexts.length && leftLargeTexts.every((item, index) => {
|
|
8683
|
+
const other = rightLargeTexts[index];
|
|
8684
|
+
if (!other) {
|
|
8685
|
+
return false;
|
|
8686
|
+
}
|
|
8687
|
+
return item.id === other.id && item.name === other.name && item.text === other.text && item.sizeBytes === other.sizeBytes;
|
|
8630
8688
|
});
|
|
8631
8689
|
}
|
|
8632
8690
|
function nodeDefaultDraftKey(agentProvider, agentTargetId) {
|
|
@@ -17537,7 +17595,10 @@ var styles3 = {
|
|
|
17537
17595
|
providerRailAvatar: "agent-gui-node__provider-rail-avatar",
|
|
17538
17596
|
providerRailAvatarIcon: "agent-gui-node__provider-rail-avatar-icon",
|
|
17539
17597
|
providerRailAvatarImage: "agent-gui-node__provider-rail-avatar-image",
|
|
17598
|
+
providerRailBadge: "agent-gui-node__provider-rail-badge",
|
|
17599
|
+
providerRailBadgeImage: "agent-gui-node__provider-rail-badge-image",
|
|
17540
17600
|
providerRailLaunchpadIcon: "agent-gui-node__provider-rail-launchpad-icon",
|
|
17601
|
+
emptyHeroIconSlot: "agent-gui-node__empty-hero-icon-slot",
|
|
17541
17602
|
emptyHeroLaunchpadIcon: "agent-gui-node__empty-hero-launchpad-icon",
|
|
17542
17603
|
providerRailLaunchpadItem: "agent-gui-node__provider-rail-launchpad-item",
|
|
17543
17604
|
providerRailConfigButton: "agent-gui-node__provider-rail-config-button",
|
|
@@ -19240,6 +19301,16 @@ function fileToBase64(file) {
|
|
|
19240
19301
|
|
|
19241
19302
|
// agent-gui/agentGuiNode/agentRichText/AgentRichTextEditor.tsx
|
|
19242
19303
|
import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
19304
|
+
var AGENT_RICH_TEXT_LARGE_PASTE_MIN_CHARS = 2e3;
|
|
19305
|
+
var AGENT_RICH_TEXT_LARGE_PASTE_MIN_LINES = 12;
|
|
19306
|
+
function isAgentRichTextLargeTextPaste(text) {
|
|
19307
|
+
const trimmed = text.trim();
|
|
19308
|
+
if (trimmed.length < AGENT_RICH_TEXT_LARGE_PASTE_MIN_CHARS) {
|
|
19309
|
+
const lineCount = trimmed ? trimmed.split(/\r\n|\r|\n/).length : 0;
|
|
19310
|
+
return lineCount >= AGENT_RICH_TEXT_LARGE_PASTE_MIN_LINES;
|
|
19311
|
+
}
|
|
19312
|
+
return true;
|
|
19313
|
+
}
|
|
19243
19314
|
function buildWorkspaceFileMentionDropContent(entries, options = {}) {
|
|
19244
19315
|
return entries.flatMap((entry, index) => [
|
|
19245
19316
|
...index === 0 && options.prefixCaretAnchor ? [
|
|
@@ -19525,6 +19596,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
19525
19596
|
promptImagesSupported = true,
|
|
19526
19597
|
onPromptImagesUnsupported,
|
|
19527
19598
|
onPasteImages,
|
|
19599
|
+
onPasteLargeText,
|
|
19528
19600
|
getReferenceForFile,
|
|
19529
19601
|
onDropFiles
|
|
19530
19602
|
}, ref) {
|
|
@@ -19545,6 +19617,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
19545
19617
|
const onLinkClickRef = useRef8(onLinkClick);
|
|
19546
19618
|
const onPromptImagesUnsupportedRef = useRef8(onPromptImagesUnsupported);
|
|
19547
19619
|
const onPasteImagesRef = useRef8(onPasteImages);
|
|
19620
|
+
const onPasteLargeTextRef = useRef8(onPasteLargeText);
|
|
19548
19621
|
const onDropFilesRef = useRef8(onDropFiles);
|
|
19549
19622
|
const promptImagesSupportedRef = useRef8(promptImagesSupported);
|
|
19550
19623
|
const getReferenceForFileRef = useRef8(getReferenceForFile);
|
|
@@ -19563,6 +19636,10 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
19563
19636
|
if (!currentEditor || currentEditor.isDestroyed || !text) {
|
|
19564
19637
|
return;
|
|
19565
19638
|
}
|
|
19639
|
+
if (onPasteLargeTextRef.current && isAgentRichTextLargeTextPaste(text)) {
|
|
19640
|
+
onPasteLargeTextRef.current(text);
|
|
19641
|
+
return;
|
|
19642
|
+
}
|
|
19566
19643
|
suppressPastedAtSuggestionRef.current = text.includes("@") && !text.endsWith("@");
|
|
19567
19644
|
if (suppressPastedAtSuggestionRef.current) {
|
|
19568
19645
|
window.setTimeout(() => {
|
|
@@ -19662,6 +19739,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
19662
19739
|
onLinkClickRef.current = onLinkClick;
|
|
19663
19740
|
onPromptImagesUnsupportedRef.current = onPromptImagesUnsupported;
|
|
19664
19741
|
onPasteImagesRef.current = onPasteImages;
|
|
19742
|
+
onPasteLargeTextRef.current = onPasteLargeText;
|
|
19665
19743
|
onDropFilesRef.current = onDropFiles;
|
|
19666
19744
|
promptImagesSupportedRef.current = promptImagesSupported;
|
|
19667
19745
|
getReferenceForFileRef.current = getReferenceForFile;
|
|
@@ -19822,6 +19900,10 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
19822
19900
|
return false;
|
|
19823
19901
|
}
|
|
19824
19902
|
event.preventDefault();
|
|
19903
|
+
if (onPasteLargeTextRef.current && isAgentRichTextLargeTextPaste(text)) {
|
|
19904
|
+
onPasteLargeTextRef.current(text);
|
|
19905
|
+
return true;
|
|
19906
|
+
}
|
|
19825
19907
|
const currentEditor = editorRef.current;
|
|
19826
19908
|
if (!currentEditor) {
|
|
19827
19909
|
return true;
|
|
@@ -21039,6 +21121,13 @@ var DOCK_COMPOSER_TEXT_VIEWPORT_MAX_HEIGHT = DOCK_COMPOSER_TEXT_LINE_HEIGHT * DO
|
|
|
21039
21121
|
var DOCK_COMPOSER_INPUT_MAX_HEIGHT = DOCK_COMPOSER_INPUT_TEXT_CHROME_HEIGHT + DOCK_COMPOSER_TEXT_VIEWPORT_MAX_HEIGHT;
|
|
21040
21122
|
var DOCK_COMPOSER_INPUT_BORDER_HEIGHT = 2;
|
|
21041
21123
|
var DOCK_COMPOSER_INPUT_PADDING_BLOCK_HEIGHT = 24;
|
|
21124
|
+
var AGENT_COMPOSER_PASTED_TEXT_FILE_PREFIX = "pasted-text";
|
|
21125
|
+
function agentComposerTextByteLength(text) {
|
|
21126
|
+
if (typeof TextEncoder !== "undefined") {
|
|
21127
|
+
return new TextEncoder().encode(text).byteLength;
|
|
21128
|
+
}
|
|
21129
|
+
return text.length;
|
|
21130
|
+
}
|
|
21042
21131
|
function agentUsageChipLevel(percentUsed) {
|
|
21043
21132
|
if (percentUsed >= USAGE_CRITICAL_PERCENT) {
|
|
21044
21133
|
return "critical";
|
|
@@ -21194,8 +21283,10 @@ function AgentUsageChip({
|
|
|
21194
21283
|
PopoverContent,
|
|
21195
21284
|
{
|
|
21196
21285
|
ref: usagePopoverContentRef,
|
|
21197
|
-
side: "
|
|
21198
|
-
align: "
|
|
21286
|
+
side: "top",
|
|
21287
|
+
align: "center",
|
|
21288
|
+
sideOffset: 8,
|
|
21289
|
+
collisionPadding: 16,
|
|
21199
21290
|
className: "w-[320px] max-w-[calc(100vw-32px)] gap-3 text-xs",
|
|
21200
21291
|
"data-testid": "agent-gui-usage-popover",
|
|
21201
21292
|
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
@@ -21488,6 +21579,7 @@ function AgentComposer({
|
|
|
21488
21579
|
const isGoalModeActive = goalDraftObjective !== null;
|
|
21489
21580
|
const draftImages = draftContent.images;
|
|
21490
21581
|
const draftFiles = draftContent.files ?? [];
|
|
21582
|
+
const draftLargeTexts = draftContent.largeTexts ?? [];
|
|
21491
21583
|
const agentActivityRuntime = useOptionalAgentActivityRuntime();
|
|
21492
21584
|
const agentHostApi = useOptionalAgentHostApi();
|
|
21493
21585
|
const getReferenceForFile = agentHostApi?.workspace.getReferenceForFile;
|
|
@@ -21535,6 +21627,8 @@ function AgentComposer({
|
|
|
21535
21627
|
const draftPromptRef = useRef11(draftPrompt);
|
|
21536
21628
|
const draftImagesRef = useRef11(draftImages);
|
|
21537
21629
|
const draftFilesRef = useRef11(draftFiles);
|
|
21630
|
+
const draftLargeTextsRef = useRef11(draftLargeTexts);
|
|
21631
|
+
const nextDraftLargeTextIndexRef = useRef11(draftLargeTexts.length);
|
|
21538
21632
|
const promptTipRef = useRef11(null);
|
|
21539
21633
|
const mentionControllerRef = useRef11(
|
|
21540
21634
|
null
|
|
@@ -21777,6 +21871,13 @@ function AgentComposer({
|
|
|
21777
21871
|
useEffect13(() => {
|
|
21778
21872
|
draftFilesRef.current = draftFiles;
|
|
21779
21873
|
}, [draftFiles]);
|
|
21874
|
+
useEffect13(() => {
|
|
21875
|
+
draftLargeTextsRef.current = draftLargeTexts;
|
|
21876
|
+
nextDraftLargeTextIndexRef.current = Math.max(
|
|
21877
|
+
nextDraftLargeTextIndexRef.current,
|
|
21878
|
+
draftLargeTexts.length
|
|
21879
|
+
);
|
|
21880
|
+
}, [draftLargeTexts]);
|
|
21780
21881
|
useEffect13(() => {
|
|
21781
21882
|
if (previousSlashStatusAgentSessionIdRef.current === slashStatusAgentSessionId) {
|
|
21782
21883
|
return;
|
|
@@ -21978,6 +22079,7 @@ function AgentComposer({
|
|
|
21978
22079
|
const canSubmitWhileSending = canQueueWhileBusy && isSendingTurn;
|
|
21979
22080
|
const currentDraftImages = draftImagesRef.current;
|
|
21980
22081
|
const currentDraftFiles = draftFilesRef.current;
|
|
22082
|
+
const currentDraftLargeTexts = draftLargeTextsRef.current;
|
|
21981
22083
|
const hasUploadingImages = currentDraftImages.some(
|
|
21982
22084
|
(image) => image.uploading
|
|
21983
22085
|
);
|
|
@@ -21996,7 +22098,8 @@ function AgentComposer({
|
|
|
21996
22098
|
...draftContent,
|
|
21997
22099
|
prompt: nextPrompt,
|
|
21998
22100
|
images: currentDraftImages,
|
|
21999
|
-
files: currentDraftFiles
|
|
22101
|
+
files: currentDraftFiles,
|
|
22102
|
+
largeTexts: currentDraftLargeTexts
|
|
22000
22103
|
};
|
|
22001
22104
|
if (!agentComposerDraftHasContent(nextDraftContent)) {
|
|
22002
22105
|
return;
|
|
@@ -22031,18 +22134,28 @@ function AgentComposer({
|
|
|
22031
22134
|
provider,
|
|
22032
22135
|
skills: availableSkills
|
|
22033
22136
|
});
|
|
22137
|
+
const submitDisplayPrompt = agentComposerDraftDisplayPrompt(nextDraftContent);
|
|
22034
22138
|
if (options?.guidance === true) {
|
|
22035
22139
|
if (!onSubmitGuidance) {
|
|
22036
22140
|
return;
|
|
22037
22141
|
}
|
|
22038
|
-
|
|
22142
|
+
if (submitDisplayPrompt) {
|
|
22143
|
+
onSubmitGuidance(submitContent, submitDisplayPrompt);
|
|
22144
|
+
} else {
|
|
22145
|
+
onSubmitGuidance(submitContent);
|
|
22146
|
+
}
|
|
22039
22147
|
} else {
|
|
22040
|
-
|
|
22148
|
+
if (submitDisplayPrompt) {
|
|
22149
|
+
onSubmit(submitContent, submitDisplayPrompt);
|
|
22150
|
+
} else {
|
|
22151
|
+
onSubmit(submitContent);
|
|
22152
|
+
}
|
|
22041
22153
|
}
|
|
22042
22154
|
if (hasActiveConversation) {
|
|
22043
22155
|
draftPromptRef.current = "";
|
|
22044
22156
|
draftImagesRef.current = [];
|
|
22045
22157
|
draftFilesRef.current = [];
|
|
22158
|
+
draftLargeTextsRef.current = [];
|
|
22046
22159
|
setPaletteDraftPrompt("");
|
|
22047
22160
|
onDraftContentChange(emptyAgentComposerDraft());
|
|
22048
22161
|
}
|
|
@@ -22441,7 +22554,8 @@ function AgentComposer({
|
|
|
22441
22554
|
onDraftContentChange({
|
|
22442
22555
|
prompt: draftPromptRef.current,
|
|
22443
22556
|
images: nextDraftImages,
|
|
22444
|
-
files: draftFilesRef.current
|
|
22557
|
+
files: draftFilesRef.current,
|
|
22558
|
+
largeTexts: draftLargeTextsRef.current
|
|
22445
22559
|
});
|
|
22446
22560
|
if (!uploadPromptContent) {
|
|
22447
22561
|
return;
|
|
@@ -22479,7 +22593,8 @@ function AgentComposer({
|
|
|
22479
22593
|
onDraftContentChange({
|
|
22480
22594
|
prompt: draftPromptRef.current,
|
|
22481
22595
|
images: uploadedDraftImages,
|
|
22482
|
-
files: draftFilesRef.current
|
|
22596
|
+
files: draftFilesRef.current,
|
|
22597
|
+
largeTexts: draftLargeTextsRef.current
|
|
22483
22598
|
});
|
|
22484
22599
|
}).catch((error) => {
|
|
22485
22600
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -22494,7 +22609,8 @@ function AgentComposer({
|
|
|
22494
22609
|
onDraftContentChange({
|
|
22495
22610
|
prompt: draftPromptRef.current,
|
|
22496
22611
|
images: failedDraftImages,
|
|
22497
|
-
files: draftFilesRef.current
|
|
22612
|
+
files: draftFilesRef.current,
|
|
22613
|
+
largeTexts: draftLargeTextsRef.current
|
|
22498
22614
|
});
|
|
22499
22615
|
});
|
|
22500
22616
|
}
|
|
@@ -22516,7 +22632,8 @@ function AgentComposer({
|
|
|
22516
22632
|
onDraftContentChange({
|
|
22517
22633
|
prompt: draftPromptRef.current,
|
|
22518
22634
|
images: nextDraftImages,
|
|
22519
|
-
files: draftFilesRef.current
|
|
22635
|
+
files: draftFilesRef.current,
|
|
22636
|
+
largeTexts: draftLargeTextsRef.current
|
|
22520
22637
|
});
|
|
22521
22638
|
},
|
|
22522
22639
|
[onDraftContentChange]
|
|
@@ -22530,7 +22647,50 @@ function AgentComposer({
|
|
|
22530
22647
|
onDraftContentChange({
|
|
22531
22648
|
prompt: draftPromptRef.current,
|
|
22532
22649
|
images: draftImagesRef.current,
|
|
22533
|
-
files: nextDraftFiles
|
|
22650
|
+
files: nextDraftFiles,
|
|
22651
|
+
largeTexts: draftLargeTextsRef.current
|
|
22652
|
+
});
|
|
22653
|
+
},
|
|
22654
|
+
[onDraftContentChange]
|
|
22655
|
+
);
|
|
22656
|
+
const removeDraftLargeText = useCallback9(
|
|
22657
|
+
(id) => {
|
|
22658
|
+
const nextDraftLargeTexts = draftLargeTextsRef.current.filter(
|
|
22659
|
+
(item) => item.id !== id
|
|
22660
|
+
);
|
|
22661
|
+
draftLargeTextsRef.current = nextDraftLargeTexts;
|
|
22662
|
+
onDraftContentChange({
|
|
22663
|
+
prompt: draftPromptRef.current,
|
|
22664
|
+
images: draftImagesRef.current,
|
|
22665
|
+
files: draftFilesRef.current,
|
|
22666
|
+
largeTexts: nextDraftLargeTexts
|
|
22667
|
+
});
|
|
22668
|
+
},
|
|
22669
|
+
[onDraftContentChange]
|
|
22670
|
+
);
|
|
22671
|
+
const handlePastedLargeText = useCallback9(
|
|
22672
|
+
(text) => {
|
|
22673
|
+
const normalizedText = text.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
22674
|
+
if (!normalizedText.trim()) {
|
|
22675
|
+
return;
|
|
22676
|
+
}
|
|
22677
|
+
const nextIndex = nextDraftLargeTextIndexRef.current + 1;
|
|
22678
|
+
nextDraftLargeTextIndexRef.current = nextIndex;
|
|
22679
|
+
const nextDraftLargeTexts = [
|
|
22680
|
+
...draftLargeTextsRef.current,
|
|
22681
|
+
{
|
|
22682
|
+
id: `${AGENT_COMPOSER_PASTED_TEXT_FILE_PREFIX}-${nextIndex}`,
|
|
22683
|
+
name: `${AGENT_COMPOSER_PASTED_TEXT_FILE_PREFIX}-${nextIndex}.txt`,
|
|
22684
|
+
text: normalizedText,
|
|
22685
|
+
sizeBytes: agentComposerTextByteLength(normalizedText)
|
|
22686
|
+
}
|
|
22687
|
+
];
|
|
22688
|
+
draftLargeTextsRef.current = nextDraftLargeTexts;
|
|
22689
|
+
onDraftContentChange({
|
|
22690
|
+
prompt: draftPromptRef.current,
|
|
22691
|
+
images: draftImagesRef.current,
|
|
22692
|
+
files: draftFilesRef.current,
|
|
22693
|
+
largeTexts: nextDraftLargeTexts
|
|
22534
22694
|
});
|
|
22535
22695
|
},
|
|
22536
22696
|
[onDraftContentChange]
|
|
@@ -23048,7 +23208,13 @@ function AgentComposer({
|
|
|
23048
23208
|
resizeObserver?.disconnect();
|
|
23049
23209
|
window.removeEventListener("resize", measure);
|
|
23050
23210
|
};
|
|
23051
|
-
}, [
|
|
23211
|
+
}, [
|
|
23212
|
+
draftFiles.length,
|
|
23213
|
+
draftImages.length,
|
|
23214
|
+
draftLargeTexts.length,
|
|
23215
|
+
isHeroLayout,
|
|
23216
|
+
paletteDraftPrompt
|
|
23217
|
+
]);
|
|
23052
23218
|
const inputShellStyle = useMemo8(
|
|
23053
23219
|
() => showFileMentionPalette || showFloatingCommandMenu ? { zIndex: composerPaletteZIndex } : void 0,
|
|
23054
23220
|
[showFileMentionPalette, showFloatingCommandMenu]
|
|
@@ -23086,6 +23252,7 @@ function AgentComposer({
|
|
|
23086
23252
|
const disabledReasonText = disabledReason?.trim() ?? "";
|
|
23087
23253
|
const effectivePlaceholder = disabledReasonText || placeholder;
|
|
23088
23254
|
const visibleDraftFiles = draftFiles;
|
|
23255
|
+
const visibleDraftLargeTexts = draftLargeTexts;
|
|
23089
23256
|
useEffect13(() => {
|
|
23090
23257
|
if (previousSelectedProjectPathRef.current === selectedProjectPath) {
|
|
23091
23258
|
return;
|
|
@@ -23347,54 +23514,86 @@ function AgentComposer({
|
|
|
23347
23514
|
))
|
|
23348
23515
|
}
|
|
23349
23516
|
) : null,
|
|
23350
|
-
visibleDraftFiles.length > 0 ? /* @__PURE__ */
|
|
23517
|
+
visibleDraftFiles.length > 0 || visibleDraftLargeTexts.length > 0 ? /* @__PURE__ */ jsxs18(
|
|
23351
23518
|
"div",
|
|
23352
23519
|
{
|
|
23353
23520
|
className: "mb-2 flex max-w-[520px] flex-wrap gap-2",
|
|
23354
23521
|
"data-testid": "agent-gui-composer-file-drafts",
|
|
23355
|
-
children:
|
|
23356
|
-
|
|
23357
|
-
|
|
23358
|
-
|
|
23359
|
-
"group inline-flex max-w-full items-center gap-2 rounded-[6px] border border-[var(--line-1)] bg-[var(--background-fronted)] px-2 py-1 text-xs text-[var(--text-primary)]",
|
|
23360
|
-
|
|
23361
|
-
|
|
23362
|
-
|
|
23363
|
-
|
|
23364
|
-
|
|
23365
|
-
|
|
23366
|
-
|
|
23367
|
-
|
|
23368
|
-
|
|
23369
|
-
|
|
23370
|
-
|
|
23371
|
-
|
|
23372
|
-
|
|
23373
|
-
|
|
23374
|
-
|
|
23375
|
-
|
|
23376
|
-
|
|
23377
|
-
|
|
23378
|
-
|
|
23379
|
-
|
|
23380
|
-
|
|
23522
|
+
children: [
|
|
23523
|
+
visibleDraftLargeTexts.map((item) => /* @__PURE__ */ jsxs18(
|
|
23524
|
+
"div",
|
|
23525
|
+
{
|
|
23526
|
+
className: "group inline-flex max-w-full items-center gap-2 rounded-[6px] border border-[var(--line-1)] bg-[var(--background-fronted)] px-2 py-1 text-xs text-[var(--text-primary)]",
|
|
23527
|
+
"data-testid": "agent-gui-composer-large-text-draft",
|
|
23528
|
+
title: item.name,
|
|
23529
|
+
children: [
|
|
23530
|
+
/* @__PURE__ */ jsx30(
|
|
23531
|
+
"span",
|
|
23532
|
+
{
|
|
23533
|
+
className: "size-2 shrink-0 rounded-full bg-[var(--text-tertiary)]",
|
|
23534
|
+
"aria-hidden": true
|
|
23535
|
+
}
|
|
23536
|
+
),
|
|
23537
|
+
/* @__PURE__ */ jsx30("span", { className: "min-w-0 max-w-[220px] truncate", children: item.name }),
|
|
23538
|
+
/* @__PURE__ */ jsx30(
|
|
23539
|
+
"button",
|
|
23540
|
+
{
|
|
23541
|
+
type: "button",
|
|
23542
|
+
className: "inline-flex size-5 shrink-0 items-center justify-center rounded-full text-[var(--text-secondary)] transition hover:bg-[var(--transparency-hover)] hover:text-[var(--text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:color-mix(in_srgb,var(--text-primary)_34%,transparent)]",
|
|
23543
|
+
"aria-label": labels.removeMention,
|
|
23544
|
+
title: labels.removeMention,
|
|
23545
|
+
onClick: () => removeDraftLargeText(item.id),
|
|
23546
|
+
children: /* @__PURE__ */ jsx30(X, { size: 12, strokeWidth: 2.4, "aria-hidden": true })
|
|
23547
|
+
}
|
|
23548
|
+
)
|
|
23549
|
+
]
|
|
23550
|
+
},
|
|
23551
|
+
item.id
|
|
23552
|
+
)),
|
|
23553
|
+
visibleDraftFiles.map((file) => /* @__PURE__ */ jsxs18(
|
|
23554
|
+
"div",
|
|
23555
|
+
{
|
|
23556
|
+
className: cn(
|
|
23557
|
+
"group inline-flex max-w-full items-center gap-2 rounded-[6px] border border-[var(--line-1)] bg-[var(--background-fronted)] px-2 py-1 text-xs text-[var(--text-primary)]",
|
|
23558
|
+
file.uploadError && "border-[color:color-mix(in_srgb,var(--danger)_55%,var(--line-1))]"
|
|
23381
23559
|
),
|
|
23382
|
-
|
|
23383
|
-
|
|
23384
|
-
|
|
23385
|
-
|
|
23386
|
-
|
|
23387
|
-
|
|
23388
|
-
|
|
23389
|
-
|
|
23390
|
-
|
|
23391
|
-
|
|
23392
|
-
|
|
23393
|
-
|
|
23394
|
-
|
|
23395
|
-
|
|
23396
|
-
|
|
23397
|
-
|
|
23560
|
+
"data-uploading": file.uploading ? "true" : void 0,
|
|
23561
|
+
"data-upload-error": file.uploadError ? "true" : void 0,
|
|
23562
|
+
title: file.hostPath ?? file.path ?? file.name,
|
|
23563
|
+
children: [
|
|
23564
|
+
file.uploading ? /* @__PURE__ */ jsx30(
|
|
23565
|
+
Spinner,
|
|
23566
|
+
{
|
|
23567
|
+
className: "shrink-0 text-[var(--text-primary)]",
|
|
23568
|
+
size: 14,
|
|
23569
|
+
strokeWidth: 2.4,
|
|
23570
|
+
trackColor: "var(--transparency-hover)",
|
|
23571
|
+
testId: "agent-gui-composer-file-upload-spinner"
|
|
23572
|
+
}
|
|
23573
|
+
) : /* @__PURE__ */ jsx30(
|
|
23574
|
+
"span",
|
|
23575
|
+
{
|
|
23576
|
+
className: "size-2 shrink-0 rounded-full bg-[var(--text-tertiary)]",
|
|
23577
|
+
"aria-hidden": true
|
|
23578
|
+
}
|
|
23579
|
+
),
|
|
23580
|
+
/* @__PURE__ */ jsx30("span", { className: "min-w-0 max-w-[220px] truncate", children: file.name }),
|
|
23581
|
+
/* @__PURE__ */ jsx30(
|
|
23582
|
+
"button",
|
|
23583
|
+
{
|
|
23584
|
+
type: "button",
|
|
23585
|
+
className: "inline-flex size-5 shrink-0 items-center justify-center rounded-full text-[var(--text-secondary)] transition hover:bg-[var(--transparency-hover)] hover:text-[var(--text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:color-mix(in_srgb,var(--text-primary)_34%,transparent)]",
|
|
23586
|
+
"aria-label": labels.removeMention,
|
|
23587
|
+
title: labels.removeMention,
|
|
23588
|
+
onClick: () => removeDraftFile(file.id),
|
|
23589
|
+
children: /* @__PURE__ */ jsx30(X, { size: 12, strokeWidth: 2.4, "aria-hidden": true })
|
|
23590
|
+
}
|
|
23591
|
+
)
|
|
23592
|
+
]
|
|
23593
|
+
},
|
|
23594
|
+
file.id
|
|
23595
|
+
))
|
|
23596
|
+
]
|
|
23398
23597
|
}
|
|
23399
23598
|
) : null,
|
|
23400
23599
|
/* @__PURE__ */ jsxs18(
|
|
@@ -23426,6 +23625,7 @@ function AgentComposer({
|
|
|
23426
23625
|
promptImagesSupported,
|
|
23427
23626
|
onPromptImagesUnsupported,
|
|
23428
23627
|
onPasteImages: handlePastedImages,
|
|
23628
|
+
onPasteLargeText: handlePastedLargeText,
|
|
23429
23629
|
getReferenceForFile,
|
|
23430
23630
|
onDropFiles: promptFilesSupported ? applyDroppedFileReferences : void 0
|
|
23431
23631
|
}
|
|
@@ -23667,93 +23867,98 @@ function AgentComposer({
|
|
|
23667
23867
|
/* @__PURE__ */ jsx30(TooltipContent3, { side: "top", children: labels.mentionPalette })
|
|
23668
23868
|
] }) })
|
|
23669
23869
|
] }),
|
|
23670
|
-
showHandoffSelect ? /* @__PURE__ */ jsxs18(
|
|
23671
|
-
|
|
23672
|
-
|
|
23673
|
-
|
|
23674
|
-
|
|
23675
|
-
|
|
23676
|
-
|
|
23677
|
-
|
|
23678
|
-
|
|
23679
|
-
|
|
23680
|
-
|
|
23681
|
-
|
|
23682
|
-
onHandoffConversation?.(target);
|
|
23683
|
-
},
|
|
23684
|
-
children: [
|
|
23685
|
-
/* @__PURE__ */ jsx30(
|
|
23686
|
-
SelectTrigger2,
|
|
23687
|
-
{
|
|
23688
|
-
size: "sm",
|
|
23689
|
-
"aria-label": effectiveHandoffLabel,
|
|
23690
|
-
title: effectiveHandoffLabel,
|
|
23691
|
-
onBlur: () => {
|
|
23692
|
-
setIsHandoffIconPlaying(false);
|
|
23693
|
-
},
|
|
23694
|
-
onFocus: () => {
|
|
23695
|
-
setIsHandoffIconPlaying(true);
|
|
23696
|
-
},
|
|
23697
|
-
onMouseEnter: () => {
|
|
23698
|
-
setIsHandoffIconPlaying(true);
|
|
23699
|
-
},
|
|
23700
|
-
onMouseLeave: () => {
|
|
23701
|
-
setIsHandoffIconPlaying(false);
|
|
23702
|
-
},
|
|
23703
|
-
className: cn(
|
|
23704
|
-
AgentGUINode_styles_default.composerMenuTrigger,
|
|
23705
|
-
AgentGUINode_styles_default.composerProviderSelect,
|
|
23706
|
-
AgentGUINode_styles_default.composerHandoffTrigger,
|
|
23707
|
-
"w-auto max-w-[180px] [&>svg:last-child]:hidden"
|
|
23708
|
-
),
|
|
23709
|
-
children: /* @__PURE__ */ jsxs18("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
23710
|
-
/* @__PURE__ */ jsx30(
|
|
23711
|
-
AgentComposerHandoffIcon,
|
|
23712
|
-
{
|
|
23713
|
-
disabled: handoffDisabled,
|
|
23714
|
-
isPlaying: isHandoffIconPlaying
|
|
23715
|
-
}
|
|
23716
|
-
),
|
|
23717
|
-
/* @__PURE__ */ jsx30("span", { className: "min-w-0 truncate", children: effectiveHandoffLabel })
|
|
23718
|
-
] })
|
|
23870
|
+
showHandoffSelect ? /* @__PURE__ */ jsx30(TooltipProvider2, { children: /* @__PURE__ */ jsxs18(Tooltip3, { children: [
|
|
23871
|
+
/* @__PURE__ */ jsxs18(
|
|
23872
|
+
Select2,
|
|
23873
|
+
{
|
|
23874
|
+
value: HANDOFF_SELECT_IDLE_VALUE,
|
|
23875
|
+
disabled: handoffDisabled,
|
|
23876
|
+
onValueChange: (nextTargetId) => {
|
|
23877
|
+
const target = handoffMenuTargets.find(
|
|
23878
|
+
(candidate) => candidate.targetId === nextTargetId
|
|
23879
|
+
);
|
|
23880
|
+
if (!target || target.disabled === true) {
|
|
23881
|
+
return;
|
|
23719
23882
|
}
|
|
23720
|
-
|
|
23721
|
-
|
|
23722
|
-
|
|
23723
|
-
{
|
|
23724
|
-
|
|
23725
|
-
|
|
23726
|
-
|
|
23727
|
-
|
|
23728
|
-
|
|
23729
|
-
|
|
23730
|
-
|
|
23731
|
-
children: handoffMenuTargets.map((target) => /* @__PURE__ */ jsx30(
|
|
23732
|
-
SelectItem2,
|
|
23733
|
-
{
|
|
23734
|
-
value: target.targetId,
|
|
23735
|
-
className: cn(AgentGUINode_styles_default.composerMenuItem, "gap-2"),
|
|
23736
|
-
disabled: target.disabled === true,
|
|
23737
|
-
children: /* @__PURE__ */ jsxs18("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
23738
|
-
/* @__PURE__ */ jsx30(
|
|
23739
|
-
"img",
|
|
23740
|
-
{
|
|
23741
|
-
alt: "",
|
|
23742
|
-
"aria-hidden": "true",
|
|
23743
|
-
className: "size-4 shrink-0 rounded-[4px]",
|
|
23744
|
-
src: resolveComposerProviderTargetIconUrl(target)
|
|
23745
|
-
}
|
|
23746
|
-
),
|
|
23747
|
-
/* @__PURE__ */ jsx30("span", { className: "min-w-0 truncate", children: target.label })
|
|
23748
|
-
] })
|
|
23883
|
+
onHandoffConversation?.(target);
|
|
23884
|
+
},
|
|
23885
|
+
children: [
|
|
23886
|
+
/* @__PURE__ */ jsx30(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */ jsx30(
|
|
23887
|
+
SelectTrigger2,
|
|
23888
|
+
{
|
|
23889
|
+
size: "sm",
|
|
23890
|
+
"aria-label": effectiveHandoffLabel,
|
|
23891
|
+
title: labels.handoffConversationTooltip,
|
|
23892
|
+
onBlur: () => {
|
|
23893
|
+
setIsHandoffIconPlaying(false);
|
|
23749
23894
|
},
|
|
23750
|
-
|
|
23751
|
-
|
|
23752
|
-
|
|
23753
|
-
|
|
23754
|
-
|
|
23755
|
-
|
|
23756
|
-
|
|
23895
|
+
onFocus: () => {
|
|
23896
|
+
setIsHandoffIconPlaying(true);
|
|
23897
|
+
},
|
|
23898
|
+
onMouseEnter: () => {
|
|
23899
|
+
setIsHandoffIconPlaying(true);
|
|
23900
|
+
},
|
|
23901
|
+
onMouseLeave: () => {
|
|
23902
|
+
setIsHandoffIconPlaying(false);
|
|
23903
|
+
},
|
|
23904
|
+
className: cn(
|
|
23905
|
+
AgentGUINode_styles_default.composerMenuTrigger,
|
|
23906
|
+
AgentGUINode_styles_default.composerProviderSelect,
|
|
23907
|
+
AgentGUINode_styles_default.composerHandoffTrigger,
|
|
23908
|
+
"w-auto max-w-[180px] [&>svg:last-child]:hidden"
|
|
23909
|
+
),
|
|
23910
|
+
children: /* @__PURE__ */ jsxs18("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
23911
|
+
/* @__PURE__ */ jsx30(
|
|
23912
|
+
AgentComposerHandoffIcon,
|
|
23913
|
+
{
|
|
23914
|
+
disabled: handoffDisabled,
|
|
23915
|
+
isPlaying: isHandoffIconPlaying
|
|
23916
|
+
}
|
|
23917
|
+
),
|
|
23918
|
+
/* @__PURE__ */ jsx30("span", { className: "min-w-0 truncate", children: effectiveHandoffLabel })
|
|
23919
|
+
] })
|
|
23920
|
+
}
|
|
23921
|
+
) }),
|
|
23922
|
+
/* @__PURE__ */ jsx30(
|
|
23923
|
+
SelectContent2,
|
|
23924
|
+
{
|
|
23925
|
+
align: "start",
|
|
23926
|
+
className: cn(
|
|
23927
|
+
AgentGUINode_styles_default.composerMenuContent,
|
|
23928
|
+
AgentGUINode_styles_default.composerHandoffMenuContent,
|
|
23929
|
+
"min-w-[190px]"
|
|
23930
|
+
),
|
|
23931
|
+
"aria-label": effectiveHandoffMenuLabel,
|
|
23932
|
+
children: handoffMenuTargets.map((target) => /* @__PURE__ */ jsx30(
|
|
23933
|
+
SelectItem2,
|
|
23934
|
+
{
|
|
23935
|
+
value: target.targetId,
|
|
23936
|
+
className: cn(AgentGUINode_styles_default.composerMenuItem, "gap-2"),
|
|
23937
|
+
disabled: target.disabled === true,
|
|
23938
|
+
children: /* @__PURE__ */ jsxs18("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
23939
|
+
/* @__PURE__ */ jsx30(
|
|
23940
|
+
"img",
|
|
23941
|
+
{
|
|
23942
|
+
alt: "",
|
|
23943
|
+
"aria-hidden": "true",
|
|
23944
|
+
className: "size-4 shrink-0 rounded-[4px]",
|
|
23945
|
+
src: resolveComposerProviderTargetIconUrl(
|
|
23946
|
+
target
|
|
23947
|
+
)
|
|
23948
|
+
}
|
|
23949
|
+
),
|
|
23950
|
+
/* @__PURE__ */ jsx30("span", { className: "min-w-0 truncate", children: target.label })
|
|
23951
|
+
] })
|
|
23952
|
+
},
|
|
23953
|
+
`${target.provider}:${target.targetId}`
|
|
23954
|
+
))
|
|
23955
|
+
}
|
|
23956
|
+
)
|
|
23957
|
+
]
|
|
23958
|
+
}
|
|
23959
|
+
),
|
|
23960
|
+
/* @__PURE__ */ jsx30(TooltipContent3, { side: "top", children: labels.handoffConversationTooltip })
|
|
23961
|
+
] }) }) : showProviderSelect && selectedProviderSwitchTarget ? /* @__PURE__ */ jsxs18(
|
|
23757
23962
|
Select2,
|
|
23758
23963
|
{
|
|
23759
23964
|
value: selectedProviderSwitchTarget.targetId,
|
|
@@ -24912,6 +25117,7 @@ function AgentGUINodeView({
|
|
|
24912
25117
|
isAgentProviderReady,
|
|
24913
25118
|
slashStatusLimits = [],
|
|
24914
25119
|
slashStatusLimitsLoading = false,
|
|
25120
|
+
providerAuthAccountLabels,
|
|
24915
25121
|
railConfigProvider,
|
|
24916
25122
|
railSlashStatusLimits,
|
|
24917
25123
|
slashStatusUsageCapturedAtUnixMs = null,
|
|
@@ -25071,7 +25277,7 @@ function AgentGUINodeView({
|
|
|
25071
25277
|
[viewModel.data.provider, viewModel.openclawGateway]
|
|
25072
25278
|
);
|
|
25073
25279
|
const isOpenclawGatewayBlocking = openclawGateway !== null && openclawGateway.status !== "ready";
|
|
25074
|
-
const createConversationDisabled = viewModel.isCreatingConversation || isOpenclawGatewayBlocking;
|
|
25280
|
+
const createConversationDisabled = viewModel.isCreatingConversation || viewModel.selectedProviderTarget.disabled === true || isOpenclawGatewayBlocking;
|
|
25075
25281
|
const createConversationAction = useStableEventCallback2(
|
|
25076
25282
|
actions.createConversation
|
|
25077
25283
|
);
|
|
@@ -25273,7 +25479,20 @@ function AgentGUINodeView({
|
|
|
25273
25479
|
};
|
|
25274
25480
|
const effectiveRailConfigProvider = railConfigProvider === void 0 ? viewModel.data.provider : railConfigProvider;
|
|
25275
25481
|
const effectiveRailSlashStatusLimits = railSlashStatusLimits ?? slashStatusLimits;
|
|
25276
|
-
const
|
|
25482
|
+
const shouldShowProviderRailConfigButton = viewModel.conversationFilter.kind === "all" || viewModel.selectedProviderTarget?.disabled !== true;
|
|
25483
|
+
const shouldShowProviderRailConfigMenu = shouldShowProviderRailConfigButton && viewModel.conversationFilter.kind !== "all";
|
|
25484
|
+
const effectiveProviderAuthAccountLabel = useMemo9(() => {
|
|
25485
|
+
const provider = (effectiveRailConfigProvider ?? viewModel.data.provider)?.trim() ?? "";
|
|
25486
|
+
if (!provider) {
|
|
25487
|
+
return null;
|
|
25488
|
+
}
|
|
25489
|
+
const label = providerAuthAccountLabels?.[provider]?.trim();
|
|
25490
|
+
return label || null;
|
|
25491
|
+
}, [
|
|
25492
|
+
effectiveRailConfigProvider,
|
|
25493
|
+
providerAuthAccountLabels,
|
|
25494
|
+
viewModel.data.provider
|
|
25495
|
+
]);
|
|
25277
25496
|
const enabledProviderTargets = viewModel.providerTargets.filter(
|
|
25278
25497
|
(target) => target.disabled !== true && ((target.agentTargetId?.trim() ?? "") || (target.targetId?.trim() ?? ""))
|
|
25279
25498
|
);
|
|
@@ -25415,12 +25634,12 @@ function AgentGUINodeView({
|
|
|
25415
25634
|
onRequestComposerFocus: requestComposerFocus
|
|
25416
25635
|
}
|
|
25417
25636
|
),
|
|
25418
|
-
|
|
25637
|
+
shouldShowProviderRailConfigButton ? /* @__PURE__ */ jsx33(
|
|
25419
25638
|
"div",
|
|
25420
25639
|
{
|
|
25421
25640
|
className: `${AgentGUINode_styles_default.providerRailFooter} nodrag tsh-desktop-no-drag`,
|
|
25422
25641
|
"data-testid": "agent-gui-config-footer",
|
|
25423
|
-
children: /* @__PURE__ */ jsx33(
|
|
25642
|
+
children: shouldShowProviderRailConfigMenu ? /* @__PURE__ */ jsx33(
|
|
25424
25643
|
AgentGUIConfigMenu,
|
|
25425
25644
|
{
|
|
25426
25645
|
labels,
|
|
@@ -25430,11 +25649,30 @@ function AgentGUINodeView({
|
|
|
25430
25649
|
slashStatusUsageCapturedAtUnixMs,
|
|
25431
25650
|
slashStatusUsageDidFail,
|
|
25432
25651
|
slashStatusUsageAttempted,
|
|
25652
|
+
providerAuthAccountLabel: effectiveProviderAuthAccountLabel,
|
|
25433
25653
|
onAgentConfigMenuOpen,
|
|
25434
25654
|
onAgentUsageRefresh,
|
|
25435
25655
|
onOpenAgentEnvSetup: openAgentEnvSetup,
|
|
25436
25656
|
onOpenAgentSettings: openAgentSettings
|
|
25437
25657
|
}
|
|
25658
|
+
) : /* @__PURE__ */ jsx33(
|
|
25659
|
+
"button",
|
|
25660
|
+
{
|
|
25661
|
+
type: "button",
|
|
25662
|
+
"aria-label": labels.agentSettingsMenu,
|
|
25663
|
+
className: `${AgentGUINode_styles_default.providerRailConfigButton} nodrag tsh-desktop-no-drag`,
|
|
25664
|
+
title: labels.agentSettingsMenu,
|
|
25665
|
+
disabled: previewMode,
|
|
25666
|
+
onClick: openAgentSettings,
|
|
25667
|
+
children: /* @__PURE__ */ jsx33(
|
|
25668
|
+
SettingsLinedIcon,
|
|
25669
|
+
{
|
|
25670
|
+
"aria-hidden": "true",
|
|
25671
|
+
width: 18,
|
|
25672
|
+
height: 18
|
|
25673
|
+
}
|
|
25674
|
+
)
|
|
25675
|
+
}
|
|
25438
25676
|
)
|
|
25439
25677
|
}
|
|
25440
25678
|
) : null,
|
|
@@ -25658,6 +25896,8 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
25658
25896
|
const timelineScrollAnchorRef = useRef12(null);
|
|
25659
25897
|
const submittedPromptScrollConversationRef = useRef12(null);
|
|
25660
25898
|
const pendingPrependScrollAnchorRef = useRef12(null);
|
|
25899
|
+
const timelineScrollPositionsRef = useRef12(/* @__PURE__ */ new Map());
|
|
25900
|
+
const pendingRestoreScrollRef = useRef12(null);
|
|
25661
25901
|
const [isTimelineScrolledToTop, setIsTimelineScrolledToTop] = useState13(true);
|
|
25662
25902
|
const [isTimelineScrolledToBottom, setIsTimelineScrolledToBottom] = useState13(true);
|
|
25663
25903
|
const [
|
|
@@ -25972,6 +26212,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
25972
26212
|
slashStatusBaseUrl: labels.slashStatusBaseUrl,
|
|
25973
26213
|
slashStatusContext: labels.slashStatusContext,
|
|
25974
26214
|
slashStatusLimits: labels.slashStatusLimits,
|
|
26215
|
+
slashStatusAccount: labels.slashStatusAccount,
|
|
25975
26216
|
slashStatusClose: labels.slashStatusClose,
|
|
25976
26217
|
slashStatusContextValue: labels.slashStatusContextValue,
|
|
25977
26218
|
slashStatusContextUnavailable: labels.slashStatusContextUnavailable,
|
|
@@ -25994,6 +26235,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
25994
26235
|
addContent: labels.addContent,
|
|
25995
26236
|
referenceWorkspaceFiles: labels.referenceWorkspaceFiles,
|
|
25996
26237
|
handoffConversation: labels.handoffConversation,
|
|
26238
|
+
handoffConversationTooltip: labels.handoffConversationTooltip,
|
|
25997
26239
|
handoffConversationMenu: labels.handoffConversationMenu,
|
|
25998
26240
|
providerSwitchLabel: labels.providerSwitchLabel,
|
|
25999
26241
|
projectLocked: labels.projectLocked,
|
|
@@ -26015,6 +26257,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
26015
26257
|
labels.fileMentionPalette,
|
|
26016
26258
|
labels.fileMentionTabHint,
|
|
26017
26259
|
labels.handoffConversation,
|
|
26260
|
+
labels.handoffConversationTooltip,
|
|
26018
26261
|
labels.handoffConversationMenu,
|
|
26019
26262
|
labels.inheritedUnavailable,
|
|
26020
26263
|
labels.loadingConversation,
|
|
@@ -26315,6 +26558,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
26315
26558
|
isComposerSending,
|
|
26316
26559
|
labels.followupPlaceholder,
|
|
26317
26560
|
labels.handoffConversation,
|
|
26561
|
+
labels.handoffConversationTooltip,
|
|
26318
26562
|
labels.handoffConversationMenu,
|
|
26319
26563
|
labels.initialPlaceholder,
|
|
26320
26564
|
labels.promptTips,
|
|
@@ -26445,13 +26689,40 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
26445
26689
|
const prependAnchor = pendingPrependScrollAnchorRef.current;
|
|
26446
26690
|
const shouldScrollSubmittedPromptToBottom = submittedPromptScrollConversationRef.current === activeConversationId;
|
|
26447
26691
|
let nextScrollTop = timeline.scrollTop;
|
|
26692
|
+
const savedScrollPosition = shouldScrollSubmittedPromptToBottom ? void 0 : timelineScrollPositionsRef.current.get(activeConversationId);
|
|
26448
26693
|
if (!anchor || anchor.conversationId !== activeConversationId || shouldScrollSubmittedPromptToBottom) {
|
|
26449
|
-
|
|
26450
|
-
|
|
26694
|
+
if (savedScrollPosition && !savedScrollPosition.atBottom && !showTimelineSkeleton) {
|
|
26695
|
+
nextScrollTop = Math.min(maxScrollTop, savedScrollPosition.scrollTop);
|
|
26696
|
+
timeline.scrollTop = nextScrollTop;
|
|
26697
|
+
pendingRestoreScrollRef.current = null;
|
|
26698
|
+
} else if (savedScrollPosition && !savedScrollPosition.atBottom) {
|
|
26699
|
+
pendingRestoreScrollRef.current = {
|
|
26700
|
+
conversationId: activeConversationId,
|
|
26701
|
+
scrollTop: savedScrollPosition.scrollTop
|
|
26702
|
+
};
|
|
26703
|
+
setTimelineScrollTopInstantly(timeline, maxScrollTop);
|
|
26704
|
+
nextScrollTop = maxScrollTop;
|
|
26705
|
+
} else {
|
|
26706
|
+
setTimelineScrollTopInstantly(timeline, maxScrollTop);
|
|
26707
|
+
nextScrollTop = maxScrollTop;
|
|
26708
|
+
pendingRestoreScrollRef.current = null;
|
|
26709
|
+
}
|
|
26451
26710
|
submittedPromptScrollConversationRef.current = null;
|
|
26452
26711
|
if (shouldScrollSubmittedPromptToBottom) {
|
|
26453
26712
|
pendingPrependScrollAnchorRef.current = null;
|
|
26454
26713
|
}
|
|
26714
|
+
} else if (pendingRestoreScrollRef.current?.conversationId === activeConversationId) {
|
|
26715
|
+
if (showTimelineSkeleton) {
|
|
26716
|
+
setTimelineScrollTopInstantly(timeline, maxScrollTop);
|
|
26717
|
+
nextScrollTop = maxScrollTop;
|
|
26718
|
+
} else {
|
|
26719
|
+
nextScrollTop = Math.min(
|
|
26720
|
+
maxScrollTop,
|
|
26721
|
+
pendingRestoreScrollRef.current.scrollTop
|
|
26722
|
+
);
|
|
26723
|
+
timeline.scrollTop = nextScrollTop;
|
|
26724
|
+
pendingRestoreScrollRef.current = null;
|
|
26725
|
+
}
|
|
26455
26726
|
} else if (prependAnchor?.conversationId === activeConversationId) {
|
|
26456
26727
|
const nextScrollHeight = timeline.scrollHeight;
|
|
26457
26728
|
const delta = nextScrollHeight - prependAnchor.scrollHeight;
|
|
@@ -26604,12 +26875,17 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
26604
26875
|
scrollTop,
|
|
26605
26876
|
clientHeight: timeline.clientHeight
|
|
26606
26877
|
};
|
|
26878
|
+
const atBottom = timeline.scrollHeight - scrollTop - timeline.clientHeight <= AGENT_GUI_STICK_TO_BOTTOM_THRESHOLD_PX;
|
|
26607
26879
|
setIsTimelineScrolledToTop(
|
|
26608
26880
|
scrollTop <= AGENT_GUI_TOP_MASK_SCROLL_EPSILON_PX
|
|
26609
26881
|
);
|
|
26610
|
-
setIsTimelineScrolledToBottom(
|
|
26611
|
-
|
|
26612
|
-
|
|
26882
|
+
setIsTimelineScrolledToBottom(atBottom);
|
|
26883
|
+
if (pendingRestoreScrollRef.current?.conversationId !== activeConversationId) {
|
|
26884
|
+
timelineScrollPositionsRef.current.set(activeConversationId, {
|
|
26885
|
+
scrollTop,
|
|
26886
|
+
atBottom
|
|
26887
|
+
});
|
|
26888
|
+
}
|
|
26613
26889
|
if (viewModel.hasOlderMessages && !viewModel.isLoadingOlderMessages && scrollTop <= AGENT_GUI_TOP_HISTORY_PREFETCH_THRESHOLD_PX) {
|
|
26614
26890
|
pendingPrependScrollAnchorRef.current = {
|
|
26615
26891
|
conversationId: activeConversationId,
|
|
@@ -26895,7 +27171,7 @@ var AgentGUIEmptyHeroPane = memo(function AgentGUIEmptyHeroPane2({
|
|
|
26895
27171
|
const heroIconPresentations = iconPresentations.length > 0 ? iconPresentations : [agentGUIProviderIconPresentation(provider)];
|
|
26896
27172
|
const heroIconAnimationKey = heroIconPresentations.map((icon) => `${icon.provider}:${icon.iconUrl}`).join("|");
|
|
26897
27173
|
return /* @__PURE__ */ jsx33("div", { className: AgentGUINode_styles_default.emptyHero, children: /* @__PURE__ */ jsxs20("div", { className: AgentGUINode_styles_default.emptyHeroBody, children: [
|
|
26898
|
-
heroIconPresentations.length > 1 ? /* @__PURE__ */ jsx33(
|
|
27174
|
+
/* @__PURE__ */ jsx33("div", { className: AgentGUINode_styles_default.emptyHeroIconSlot, children: heroIconPresentations.length > 1 ? /* @__PURE__ */ jsx33(
|
|
26899
27175
|
AgentGUIAllProviderGridIcon,
|
|
26900
27176
|
{
|
|
26901
27177
|
activeProvider: provider,
|
|
@@ -26911,7 +27187,7 @@ var AgentGUIEmptyHeroPane = memo(function AgentGUIEmptyHeroPane2({
|
|
|
26911
27187
|
icon: heroIconPresentations[0]
|
|
26912
27188
|
},
|
|
26913
27189
|
heroIconAnimationKey
|
|
26914
|
-
),
|
|
27190
|
+
) }),
|
|
26915
27191
|
/* @__PURE__ */ jsx33("h2", { className: AgentGUINode_styles_default.emptyHeroTitle, children: /* @__PURE__ */ jsx33(
|
|
26916
27192
|
EmptyHeroTitle,
|
|
26917
27193
|
{
|
|
@@ -26984,7 +27260,7 @@ var AgentGUIProviderReadinessGatePane = memo(
|
|
|
26984
27260
|
),
|
|
26985
27261
|
/* @__PURE__ */ jsx33("h2", { className: AgentGUINode_styles_default.emptyHeroTitle, children: content.title }),
|
|
26986
27262
|
/* @__PURE__ */ jsx33("p", { className: AgentGUINode_styles_default.emptyProviderGateDescription, children: content.description }),
|
|
26987
|
-
pendingLabel ? /* @__PURE__ */ jsx33(
|
|
27263
|
+
pendingLabel && !action ? /* @__PURE__ */ jsx33(
|
|
26988
27264
|
"div",
|
|
26989
27265
|
{
|
|
26990
27266
|
className: AgentGUINode_styles_default.emptyProviderGateStatus,
|
|
@@ -27726,6 +28002,13 @@ function agentGUIProviderRailLabel(provider, targetLabel, labels) {
|
|
|
27726
28002
|
}
|
|
27727
28003
|
return targetLabel;
|
|
27728
28004
|
}
|
|
28005
|
+
function agentGUIProviderRailAriaLabel(label, badgeLabel) {
|
|
28006
|
+
const normalizedBadgeLabel = badgeLabel?.trim() ?? "";
|
|
28007
|
+
if (!normalizedBadgeLabel || normalizedBadgeLabel === label) {
|
|
28008
|
+
return label;
|
|
28009
|
+
}
|
|
28010
|
+
return `${label}, ${normalizedBadgeLabel}`;
|
|
28011
|
+
}
|
|
27729
28012
|
function agentGUIProviderTargetMatchesConversationFilter(target, filter) {
|
|
27730
28013
|
return filter.kind === "agentTarget" && (target.agentTargetId?.trim() ?? "") === filter.agentTargetId;
|
|
27731
28014
|
}
|
|
@@ -28128,12 +28411,16 @@ var AgentGUIProviderRail = memo(function AgentGUIProviderRail2({
|
|
|
28128
28411
|
target.label,
|
|
28129
28412
|
labels
|
|
28130
28413
|
);
|
|
28414
|
+
const ariaLabel = agentGUIProviderRailAriaLabel(
|
|
28415
|
+
label,
|
|
28416
|
+
target.badge?.label
|
|
28417
|
+
);
|
|
28131
28418
|
const tile = /* @__PURE__ */ jsx33(
|
|
28132
28419
|
"button",
|
|
28133
28420
|
{
|
|
28134
28421
|
type: "button",
|
|
28135
28422
|
role: "tab",
|
|
28136
|
-
"aria-label":
|
|
28423
|
+
"aria-label": ariaLabel,
|
|
28137
28424
|
"aria-selected": providerSelected,
|
|
28138
28425
|
className: AgentGUINode_styles_default.providerRailTile,
|
|
28139
28426
|
"data-disabled": target.disabled === true ? "true" : void 0,
|
|
@@ -28148,17 +28435,28 @@ var AgentGUIProviderRail = memo(function AgentGUIProviderRail2({
|
|
|
28148
28435
|
onDragEnd: clearProviderRailDragState,
|
|
28149
28436
|
onDragOver: (event) => handleProviderRailDragOver(event, target),
|
|
28150
28437
|
onDragStart: (event) => handleProviderRailDragStart(event, target),
|
|
28151
|
-
children: /* @__PURE__ */
|
|
28152
|
-
|
|
28153
|
-
|
|
28154
|
-
|
|
28155
|
-
|
|
28156
|
-
|
|
28157
|
-
|
|
28158
|
-
|
|
28159
|
-
|
|
28160
|
-
|
|
28161
|
-
|
|
28438
|
+
children: /* @__PURE__ */ jsxs20("span", { className: AgentGUINode_styles_default.providerRailAvatar, children: [
|
|
28439
|
+
/* @__PURE__ */ jsx33(
|
|
28440
|
+
AgentGUIProviderIconVisual,
|
|
28441
|
+
{
|
|
28442
|
+
ariaHidden: true,
|
|
28443
|
+
imageClassName: AgentGUINode_styles_default.providerRailAvatarImage,
|
|
28444
|
+
icon: agentGUIProviderRailIconPresentation(
|
|
28445
|
+
target.provider,
|
|
28446
|
+
target.iconUrl
|
|
28447
|
+
)
|
|
28448
|
+
}
|
|
28449
|
+
),
|
|
28450
|
+
target.badge?.iconUrl ? /* @__PURE__ */ jsx33("span", { "aria-hidden": "true", className: AgentGUINode_styles_default.providerRailBadge, children: /* @__PURE__ */ jsx33(
|
|
28451
|
+
"img",
|
|
28452
|
+
{
|
|
28453
|
+
alt: "",
|
|
28454
|
+
className: AgentGUINode_styles_default.providerRailBadgeImage,
|
|
28455
|
+
draggable: false,
|
|
28456
|
+
src: target.badge.iconUrl
|
|
28457
|
+
}
|
|
28458
|
+
) }) : null
|
|
28459
|
+
] })
|
|
28162
28460
|
},
|
|
28163
28461
|
`${target.provider}:${target.targetId}`
|
|
28164
28462
|
);
|
|
@@ -28447,6 +28745,7 @@ function AgentGUIConfigMenu({
|
|
|
28447
28745
|
slashStatusUsageCapturedAtUnixMs,
|
|
28448
28746
|
slashStatusUsageDidFail,
|
|
28449
28747
|
slashStatusUsageAttempted,
|
|
28748
|
+
providerAuthAccountLabel,
|
|
28450
28749
|
onAgentConfigMenuOpen,
|
|
28451
28750
|
onAgentUsageRefresh,
|
|
28452
28751
|
onOpenAgentEnvSetup,
|
|
@@ -28480,6 +28779,13 @@ function AgentGUIConfigMenu({
|
|
|
28480
28779
|
className: "w-[300px] max-w-[calc(100vw-32px)] gap-3 p-1 text-xs",
|
|
28481
28780
|
"data-testid": "agent-gui-config-menu",
|
|
28482
28781
|
children: /* @__PURE__ */ jsxs20("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
28782
|
+
providerAuthAccountLabel ? /* @__PURE__ */ jsxs20(Fragment9, { children: [
|
|
28783
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex min-w-0 flex-col gap-2 p-2", children: [
|
|
28784
|
+
/* @__PURE__ */ jsx33("span", { className: "text-[13px] font-semibold leading-4", children: labels.slashStatusAccount }),
|
|
28785
|
+
/* @__PURE__ */ jsx33("span", { className: "text-[13px] leading-5 text-[var(--text-secondary)]", children: providerAuthAccountLabel })
|
|
28786
|
+
] }),
|
|
28787
|
+
slashStatusLimits.length > 0 || slashStatusUsageAttempted || slashStatusLimitsLoading ? /* @__PURE__ */ jsx33("div", { className: "px-2", children: /* @__PURE__ */ jsx33("span", { className: "block h-px bg-[var(--border-1)]" }) }) : null
|
|
28788
|
+
] }) : null,
|
|
28483
28789
|
slashStatusLimits.length > 0 || slashStatusUsageAttempted || slashStatusLimitsLoading ? /* @__PURE__ */ jsxs20(Fragment9, { children: [
|
|
28484
28790
|
/* @__PURE__ */ jsxs20("div", { className: "flex min-w-0 flex-col gap-2 p-2", children: [
|
|
28485
28791
|
/* @__PURE__ */ jsxs20("div", { className: "flex min-w-0 items-center justify-between gap-2", children: [
|
|
@@ -29046,18 +29352,7 @@ var AgentGUIConversationRailPane = memo(
|
|
|
29046
29352
|
}
|
|
29047
29353
|
)
|
|
29048
29354
|
] }),
|
|
29049
|
-
openclawGateway?.status === "
|
|
29050
|
-
/* @__PURE__ */ jsx33(
|
|
29051
|
-
StatusDot,
|
|
29052
|
-
{
|
|
29053
|
-
tone: "blue",
|
|
29054
|
-
pulse: true,
|
|
29055
|
-
size: "sm",
|
|
29056
|
-
ariaLabel: labels.openclawGatewayStarting
|
|
29057
|
-
}
|
|
29058
|
-
),
|
|
29059
|
-
/* @__PURE__ */ jsx33("span", { children: labels.openclawGatewayStarting })
|
|
29060
|
-
] }) : openclawGateway?.status === "failed" ? /* @__PURE__ */ jsxs20("div", { className: AgentGUINode_styles_default.gatewayStatus, "data-state": "failed", children: [
|
|
29355
|
+
openclawGateway?.status === "failed" ? /* @__PURE__ */ jsxs20("div", { className: AgentGUINode_styles_default.gatewayStatus, "data-state": "failed", children: [
|
|
29061
29356
|
/* @__PURE__ */ jsx33("span", { children: openclawGateway.error || labels.openclawGatewayFailed }),
|
|
29062
29357
|
/* @__PURE__ */ jsx33(
|
|
29063
29358
|
"button",
|
|
@@ -30601,7 +30896,7 @@ function composerOverridesByAgentTargetIdEqual(left, right) {
|
|
|
30601
30896
|
return true;
|
|
30602
30897
|
}
|
|
30603
30898
|
function areAgentGUINodePropsEqual(previous, next) {
|
|
30604
|
-
return previous.nodeId === next.nodeId && previous.workspaceId === next.workspaceId && previous.currentUserId === next.currentUserId && previous.workspacePath === next.workspacePath && previous.workspaceFileReferenceAdapter === next.workspaceFileReferenceAdapter && previous.resolveDroppedFileReferences === next.resolveDroppedFileReferences && previous.selectProjectDirectory === next.selectProjectDirectory && previous.referenceSourceAggregator === next.referenceSourceAggregator && previous.resolveWorkspaceReferenceEntryIconUrl === next.resolveWorkspaceReferenceEntryIconUrl && previous.resolveMentionReferenceTarget === next.resolveMentionReferenceTarget && previous.resolveWorkspaceReferenceInitialTarget === next.resolveWorkspaceReferenceInitialTarget && previous.onWorkspaceFileReferencesAdded === next.onWorkspaceFileReferencesAdded && previous.agentSettings.avoidGroupingEdits === next.agentSettings.avoidGroupingEdits && previous.title === next.title && agentGuiStateEquals(previous.state, next.state) && previous.position.x === next.position.x && previous.position.y === next.position.y && previous.width === next.width && previous.height === next.height && previous.desktopSize.width === next.desktopSize.width && previous.desktopSize.height === next.desktopSize.height && previous.onLinkAction === next.onLinkAction && previous.onHandoffConversation === next.onHandoffConversation && previous.onCapabilitySettingsRequest === next.onCapabilitySettingsRequest && previous.onAgentProviderLogin === next.onAgentProviderLogin && previous.accountMenuState === next.accountMenuState && previous.providerTargets === next.providerTargets && previous.providerTargetsLoading === next.providerTargetsLoading && previous.renderSidebarFooter === next.renderSidebarFooter && previous.providerRailMode === next.providerRailMode && previous.renderProviderRailEmpty === next.renderProviderRailEmpty && previous.comingSoonProviders === next.comingSoonProviders && previous.providerReadinessGates === next.providerReadinessGates && previous.defaultProviderTargetId === next.defaultProviderTargetId && previous.onClose === next.onClose && previous.onResize === next.onResize && previous.onUpdateNode === next.onUpdateNode && previous.onRememberComposerDefaults === next.onRememberComposerDefaults && previous.onOpenConversationWindow === next.onOpenConversationWindow && previous.isMaximized === next.isMaximized && previous.isMuted === next.isMuted && previous.onMinimize === next.onMinimize && previous.onToggleMaximize === next.onToggleMaximize && previous.onShowMessage === next.onShowMessage && previous.workspaceAgentProbes === next.workspaceAgentProbes && previous.onAgentProbeDemandChange === next.onAgentProbeDemandChange && previous.onAgentProbeRefreshRequest === next.onAgentProbeRefreshRequest && previous.managedAgentsState === next.managedAgentsState && previous.contextMentionProviders === next.contextMentionProviders && previous.workspaceAppIcons === next.workspaceAppIcons && previous.embedded === next.embedded && previous.previewMode === next.previewMode && previous.isActive === next.isActive && previous.composerFocusRequestSequence === next.composerFocusRequestSequence && previous.newConversationRequestSequence === next.newConversationRequestSequence && previous.openSessionRequest === next.openSessionRequest && previous.prefillPromptRequest === next.prefillPromptRequest;
|
|
30899
|
+
return previous.nodeId === next.nodeId && previous.workspaceId === next.workspaceId && previous.currentUserId === next.currentUserId && previous.workspacePath === next.workspacePath && previous.workspaceFileReferenceAdapter === next.workspaceFileReferenceAdapter && previous.resolveDroppedFileReferences === next.resolveDroppedFileReferences && previous.selectProjectDirectory === next.selectProjectDirectory && previous.referenceSourceAggregator === next.referenceSourceAggregator && previous.resolveWorkspaceReferenceEntryIconUrl === next.resolveWorkspaceReferenceEntryIconUrl && previous.resolveMentionReferenceTarget === next.resolveMentionReferenceTarget && previous.resolveWorkspaceReferenceInitialTarget === next.resolveWorkspaceReferenceInitialTarget && previous.onWorkspaceFileReferencesAdded === next.onWorkspaceFileReferencesAdded && previous.agentSettings.avoidGroupingEdits === next.agentSettings.avoidGroupingEdits && previous.title === next.title && agentGuiStateEquals(previous.state, next.state) && previous.position.x === next.position.x && previous.position.y === next.position.y && previous.width === next.width && previous.height === next.height && previous.desktopSize.width === next.desktopSize.width && previous.desktopSize.height === next.desktopSize.height && previous.onLinkAction === next.onLinkAction && previous.onHandoffConversation === next.onHandoffConversation && previous.onCapabilitySettingsRequest === next.onCapabilitySettingsRequest && previous.onAgentProviderLogin === next.onAgentProviderLogin && previous.accountMenuState === next.accountMenuState && previous.providerTargets === next.providerTargets && previous.providerTargetsLoading === next.providerTargetsLoading && previous.renderSidebarFooter === next.renderSidebarFooter && previous.providerRailMode === next.providerRailMode && previous.renderProviderRailEmpty === next.renderProviderRailEmpty && previous.comingSoonProviders === next.comingSoonProviders && previous.providerReadinessGates === next.providerReadinessGates && previous.defaultProviderTargetId === next.defaultProviderTargetId && previous.onClose === next.onClose && previous.onResize === next.onResize && previous.onUpdateNode === next.onUpdateNode && previous.onRememberComposerDefaults === next.onRememberComposerDefaults && previous.onOpenConversationWindow === next.onOpenConversationWindow && previous.isMaximized === next.isMaximized && previous.isMuted === next.isMuted && previous.onMinimize === next.onMinimize && previous.onToggleMaximize === next.onToggleMaximize && previous.onShowMessage === next.onShowMessage && previous.workspaceAgentProbes === next.workspaceAgentProbes && previous.onAgentProbeDemandChange === next.onAgentProbeDemandChange && previous.onAgentProbeRefreshRequest === next.onAgentProbeRefreshRequest && previous.providerAuthAccountLabels === next.providerAuthAccountLabels && previous.managedAgentsState === next.managedAgentsState && previous.contextMentionProviders === next.contextMentionProviders && previous.workspaceAppIcons === next.workspaceAppIcons && previous.embedded === next.embedded && previous.previewMode === next.previewMode && previous.isActive === next.isActive && previous.composerFocusRequestSequence === next.composerFocusRequestSequence && previous.newConversationRequestSequence === next.newConversationRequestSequence && previous.openSessionRequest === next.openSessionRequest && previous.prefillPromptRequest === next.prefillPromptRequest;
|
|
30605
30900
|
}
|
|
30606
30901
|
var AgentGUINode = memo2(function AgentGUINode2({
|
|
30607
30902
|
nodeId,
|
|
@@ -30656,6 +30951,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
30656
30951
|
workspaceAgentProbes,
|
|
30657
30952
|
onAgentProbeDemandChange,
|
|
30658
30953
|
onAgentProbeRefreshRequest,
|
|
30954
|
+
providerAuthAccountLabels,
|
|
30659
30955
|
managedAgentsState,
|
|
30660
30956
|
contextMentionProviders,
|
|
30661
30957
|
workspaceAppIcons,
|
|
@@ -31013,6 +31309,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
31013
31309
|
slashStatusBaseUrl: t("agentHost.agentGui.slashStatusBaseUrl"),
|
|
31014
31310
|
slashStatusContext: t("agentHost.agentGui.slashStatusContext"),
|
|
31015
31311
|
slashStatusLimits: t("agentHost.agentGui.slashStatusLimits"),
|
|
31312
|
+
slashStatusAccount: t("agentHost.agentGui.slashStatusAccount"),
|
|
31016
31313
|
slashStatusClose: t("agentHost.agentGui.slashStatusClose"),
|
|
31017
31314
|
slashStatusContextValue: (input) => t("agentHost.agentGui.slashStatusContextValue", {
|
|
31018
31315
|
percentLeft: input.percentLeft,
|
|
@@ -31431,6 +31728,9 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
31431
31728
|
addContent: t("agentHost.agentGui.addContent"),
|
|
31432
31729
|
referenceWorkspaceFiles: t("agentHost.issue.referenceWorkspaceFiles"),
|
|
31433
31730
|
handoffConversation: t("agentHost.agentGui.handoffConversation"),
|
|
31731
|
+
handoffConversationTooltip: t(
|
|
31732
|
+
"agentHost.agentGui.handoffConversationTooltip"
|
|
31733
|
+
),
|
|
31434
31734
|
handoffConversationMenu: t("agentHost.agentGui.handoffConversationMenu")
|
|
31435
31735
|
}),
|
|
31436
31736
|
[displayProviderLabel, fallbackAgentTitle, t]
|
|
@@ -31666,6 +31966,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
31666
31966
|
slashStatusUsageCapturedAtUnixMs,
|
|
31667
31967
|
slashStatusUsageDidFail,
|
|
31668
31968
|
slashStatusUsageAttempted,
|
|
31969
|
+
providerAuthAccountLabels,
|
|
31669
31970
|
onAgentConfigMenuOpen: handleAgentConfigMenuOpen,
|
|
31670
31971
|
onAgentUsageRefresh: handleAgentUsageRefresh,
|
|
31671
31972
|
previewMode,
|