@tutti-os/agent-gui 0.0.47 → 0.0.48
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 +4 -4
- package/dist/agent-conversation/index.js +6 -6
- package/dist/agent-message-center/index.d.ts +2 -2
- package/dist/agent-message-center/index.js +35 -13
- package/dist/agent-message-center/index.js.map +1 -1
- package/dist/{agentConversationVM-BTMtRteS.d.ts → agentConversationVM-DSXrFL9v.d.ts} +5 -1
- package/dist/{agentGuiNodeTypes-B5Y6yDKy.d.ts → agentGuiNodeTypes-Bp1G8pOj.d.ts} +4 -4
- package/dist/app/renderer/agentactivity.css +62 -12
- package/dist/{chunk-XJXSR5XI.js → chunk-6YN7HQL5.js} +125 -34
- package/dist/chunk-6YN7HQL5.js.map +1 -0
- package/dist/{chunk-MCH35MAX.js → chunk-7W3VWU5R.js} +10 -6
- package/dist/chunk-7W3VWU5R.js.map +1 -0
- package/dist/{chunk-Q4X6Q4E6.js → chunk-EUOGIKT7.js} +2 -2
- package/dist/{chunk-ZAF4IVUT.js → chunk-LWMC2YA3.js} +431 -359
- package/dist/chunk-LWMC2YA3.js.map +1 -0
- package/dist/{chunk-5QTC2L52.js → chunk-N6HRVMIS.js} +2 -2
- package/dist/{chunk-KACBTC7Y.js → chunk-NETHPCSA.js} +11 -3
- package/dist/chunk-NETHPCSA.js.map +1 -0
- package/dist/{chunk-J3SJZMI5.js → chunk-OB43QOMC.js} +2 -2
- package/dist/{chunk-2FOBSURO.js → chunk-OYQZRLJQ.js} +2 -2
- package/dist/{chunk-7NCWSH7U.js → chunk-RNIY43TA.js} +5 -5
- package/dist/{chunk-VE6JY2TH.js → chunk-U6JWW45G.js} +1 -1
- package/dist/chunk-U6JWW45G.js.map +1 -0
- package/dist/{chunk-HCS3HUUX.js → chunk-VGDPBC6W.js} +37 -7
- package/dist/chunk-VGDPBC6W.js.map +1 -0
- package/dist/{chunk-KUCWRSXU.js → chunk-ZVKRNEOF.js} +2 -2
- package/dist/context-mention-palette/index.js +7 -7
- package/dist/i18n/index.d.ts +10 -2
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +290 -8
- package/dist/index.js +189 -44
- package/dist/index.js.map +1 -1
- package/dist/plan-decision-ops.d.ts +2 -2
- package/dist/queued-prompt-runtime.d.ts +3 -3
- package/dist/workbench/index.js +3 -3
- package/dist/workbench/sessionTitle.js +3 -3
- package/dist/workspace-agent-generated-files.d.ts +1 -1
- package/dist/workspace-agent-generated-files.js +3 -3
- package/dist/{workspaceAgentActivityListViewModel-DLnMBMoh.d.ts → workspaceAgentActivityListViewModel-B5viw5Da.d.ts} +1 -1
- package/package.json +12 -12
- package/dist/chunk-HCS3HUUX.js.map +0 -1
- package/dist/chunk-KACBTC7Y.js.map +0 -1
- package/dist/chunk-MCH35MAX.js.map +0 -1
- package/dist/chunk-VE6JY2TH.js.map +0 -1
- package/dist/chunk-XJXSR5XI.js.map +0 -1
- package/dist/chunk-ZAF4IVUT.js.map +0 -1
- /package/dist/{chunk-Q4X6Q4E6.js.map → chunk-EUOGIKT7.js.map} +0 -0
- /package/dist/{chunk-5QTC2L52.js.map → chunk-N6HRVMIS.js.map} +0 -0
- /package/dist/{chunk-J3SJZMI5.js.map → chunk-OB43QOMC.js.map} +0 -0
- /package/dist/{chunk-2FOBSURO.js.map → chunk-OYQZRLJQ.js.map} +0 -0
- /package/dist/{chunk-7NCWSH7U.js.map → chunk-RNIY43TA.js.map} +0 -0
- /package/dist/{chunk-KUCWRSXU.js.map → chunk-ZVKRNEOF.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
AgentInteractivePromptSurface,
|
|
24
24
|
approvalOptionDisplayLabel
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-VGDPBC6W.js";
|
|
26
26
|
import {
|
|
27
27
|
PLAN_IMPLEMENTATION_ACTION_FEEDBACK,
|
|
28
28
|
PLAN_IMPLEMENTATION_ACTION_IMPLEMENT,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
resolveAgentGUIExplicitConversationTitle,
|
|
42
42
|
resolveAgentGUIProviderDisplayLabel,
|
|
43
43
|
resolveAgentGUIProviderIdentity
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-ZVKRNEOF.js";
|
|
45
45
|
import {
|
|
46
46
|
AgentConversationFlow,
|
|
47
47
|
Button,
|
|
@@ -60,13 +60,13 @@ import {
|
|
|
60
60
|
skillTriggerForPrefix,
|
|
61
61
|
toLocalShortDateTime,
|
|
62
62
|
useProjectedAgentConversation
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-LWMC2YA3.js";
|
|
64
64
|
import {
|
|
65
65
|
AgentMessageMarkdown,
|
|
66
66
|
ZoomableImage,
|
|
67
67
|
cn,
|
|
68
68
|
resolveWorkspaceLinkAction
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-6YN7HQL5.js";
|
|
70
70
|
import {
|
|
71
71
|
AGENT_MENTION_FILTER_TAB_ORDER,
|
|
72
72
|
AgentFileMentionPalette,
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
DEFAULT_AGENT_MENTION_FILTER,
|
|
75
75
|
agentMentionItemKey,
|
|
76
76
|
preloadAgentMentionBrowse
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-RNIY43TA.js";
|
|
78
78
|
import {
|
|
79
79
|
WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN,
|
|
80
80
|
buildWorkspaceAgentActivityListViewModel,
|
|
@@ -84,13 +84,13 @@ import {
|
|
|
84
84
|
isWorkspaceAgentUntitledTask,
|
|
85
85
|
mergeWorkspaceAgentActivityDurableAndOverlayMessages,
|
|
86
86
|
selectWorkspaceAgentActivityOverlayMessages
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-7W3VWU5R.js";
|
|
88
88
|
import {
|
|
89
89
|
MANAGED_AGENT_ICON_FALLBACK_URL,
|
|
90
90
|
MANAGED_AGENT_ICON_URLS,
|
|
91
91
|
Spinner,
|
|
92
92
|
normalizeManagedAgentProvider
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-EUOGIKT7.js";
|
|
94
94
|
import {
|
|
95
95
|
resolveWorkspaceAgentSessionSortTimeUnixMs
|
|
96
96
|
} from "./chunk-IBIMGLCD.js";
|
|
@@ -102,7 +102,7 @@ import {
|
|
|
102
102
|
mentionItemToAttrs,
|
|
103
103
|
normalizeAgentSessionMentionTitle,
|
|
104
104
|
parseMentionItemFromHref
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-OYQZRLJQ.js";
|
|
106
106
|
import "./chunk-Y35GDLP2.js";
|
|
107
107
|
import "./chunk-LUGELG5V.js";
|
|
108
108
|
import {
|
|
@@ -118,7 +118,7 @@ import {
|
|
|
118
118
|
useAgentHostApi,
|
|
119
119
|
useOptionalAgentActivityRuntime,
|
|
120
120
|
useOptionalAgentHostApi
|
|
121
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-U6JWW45G.js";
|
|
122
122
|
import "./chunk-TYGL25EL.js";
|
|
123
123
|
import "./chunk-PJP5BUU6.js";
|
|
124
124
|
import {
|
|
@@ -134,8 +134,8 @@ import {
|
|
|
134
134
|
agentGuiI18nResources,
|
|
135
135
|
translate,
|
|
136
136
|
useTranslation
|
|
137
|
-
} from "./chunk-
|
|
138
|
-
import "./chunk-
|
|
137
|
+
} from "./chunk-N6HRVMIS.js";
|
|
138
|
+
import "./chunk-NETHPCSA.js";
|
|
139
139
|
|
|
140
140
|
// shared/agentActivitySnapshotProjection.ts
|
|
141
141
|
import {
|
|
@@ -3261,6 +3261,24 @@ function normalizeOptionalWorkspaceAgentStatus(input) {
|
|
|
3261
3261
|
}
|
|
3262
3262
|
return { kind: "completed" };
|
|
3263
3263
|
}
|
|
3264
|
+
const waitKind = waitingKindFromTokens([currentPhase, turnPhase]);
|
|
3265
|
+
if (waitKind) {
|
|
3266
|
+
return { kind: "waiting", waitKind };
|
|
3267
|
+
}
|
|
3268
|
+
if ([currentPhase, turnPhase].some((token) => WAITING_STATUS_TOKENS.has(token))) {
|
|
3269
|
+
return { kind: "waiting" };
|
|
3270
|
+
}
|
|
3271
|
+
if ([currentPhase, turnPhase].some((token) => WORKING_STATUS_TOKENS.has(token))) {
|
|
3272
|
+
return { kind: "working" };
|
|
3273
|
+
}
|
|
3274
|
+
if ([currentPhase, turnPhase].some((token) => CANCELED_STATUS_TOKENS.has(token))) {
|
|
3275
|
+
return { kind: "canceled" };
|
|
3276
|
+
}
|
|
3277
|
+
if ([currentPhase, turnPhase].some(
|
|
3278
|
+
(token) => COMPLETED_STATUS_TOKENS.has(token)
|
|
3279
|
+
)) {
|
|
3280
|
+
return { kind: "completed" };
|
|
3281
|
+
}
|
|
3264
3282
|
if ([lifecycleStatus, effectiveStatus, sessionStatus, currentPhase].some(
|
|
3265
3283
|
(token) => FAILED_STATUS_TOKENS.has(token)
|
|
3266
3284
|
)) {
|
|
@@ -3276,14 +3294,14 @@ function normalizeOptionalWorkspaceAgentStatus(input) {
|
|
|
3276
3294
|
)) {
|
|
3277
3295
|
return { kind: "completed" };
|
|
3278
3296
|
}
|
|
3279
|
-
const
|
|
3297
|
+
const fallbackWaitKind = waitingKindFromTokens([
|
|
3280
3298
|
currentPhase,
|
|
3281
3299
|
turnPhase,
|
|
3282
3300
|
effectiveStatus,
|
|
3283
3301
|
sessionStatus
|
|
3284
3302
|
]);
|
|
3285
|
-
if (
|
|
3286
|
-
return { kind: "waiting", waitKind };
|
|
3303
|
+
if (fallbackWaitKind) {
|
|
3304
|
+
return { kind: "waiting", waitKind: fallbackWaitKind };
|
|
3287
3305
|
}
|
|
3288
3306
|
if ([currentPhase, turnPhase, effectiveStatus, sessionStatus].some(
|
|
3289
3307
|
(token) => WAITING_STATUS_TOKENS.has(token)
|
|
@@ -6310,8 +6328,9 @@ function resolveEffectiveComposerSettings(input) {
|
|
|
6310
6328
|
input.settings.speed
|
|
6311
6329
|
) ?? null,
|
|
6312
6330
|
planMode: Boolean(input.settings.planMode),
|
|
6313
|
-
// Browser use
|
|
6331
|
+
// Browser/computer use default on; preserve explicit opt-outs.
|
|
6314
6332
|
browserUse: input.settings.browserUse ?? true,
|
|
6333
|
+
computerUse: input.settings.computerUse ?? true,
|
|
6315
6334
|
permissionModeId: normalizePermissionModeId(input.settings.permissionModeId)
|
|
6316
6335
|
};
|
|
6317
6336
|
}
|
|
@@ -6400,7 +6419,7 @@ function cloneComposerSettings(settings) {
|
|
|
6400
6419
|
return { ...settings };
|
|
6401
6420
|
}
|
|
6402
6421
|
function sameComposerSettings(left, right) {
|
|
6403
|
-
return (left?.model ?? null) === (right?.model ?? null) && (left?.reasoningEffort ?? null) === (right?.reasoningEffort ?? null) && (left?.speed ?? null) === (right?.speed ?? null) && Boolean(left?.planMode) === Boolean(right?.planMode) && (left?.browserUse ?? true) === (right?.browserUse ?? true) && (left?.permissionModeId ?? null) === (right?.permissionModeId ?? null);
|
|
6422
|
+
return (left?.model ?? null) === (right?.model ?? null) && (left?.reasoningEffort ?? null) === (right?.reasoningEffort ?? null) && (left?.speed ?? null) === (right?.speed ?? null) && Boolean(left?.planMode) === Boolean(right?.planMode) && (left?.browserUse ?? true) === (right?.browserUse ?? true) && (left?.computerUse ?? true) === (right?.computerUse ?? true) && (left?.permissionModeId ?? null) === (right?.permissionModeId ?? null);
|
|
6404
6423
|
}
|
|
6405
6424
|
function buildNodeDefaultComposerSettings(data, options) {
|
|
6406
6425
|
const composerOverrides = nodeComposerOverridesForProvider(data) ?? {};
|
|
@@ -6414,6 +6433,7 @@ function buildNodeDefaultComposerSettings(data, options) {
|
|
|
6414
6433
|
) ?? options?.defaultSpeed ?? null,
|
|
6415
6434
|
planMode: Boolean(composerOverrides.planMode),
|
|
6416
6435
|
browserUse: composerOverrides.browserUse ?? true,
|
|
6436
|
+
computerUse: composerOverrides.computerUse ?? true,
|
|
6417
6437
|
permissionModeId: normalizePermissionModeId(
|
|
6418
6438
|
composerOverrides.permissionModeId
|
|
6419
6439
|
)
|
|
@@ -6449,6 +6469,7 @@ function nodeDataFromComposerSettings(current, settings) {
|
|
|
6449
6469
|
// Raw passthrough (no Boolean coercion): undefined means "default on", so
|
|
6450
6470
|
// only an explicit false persists as an opt-out.
|
|
6451
6471
|
browserUse: settings.browserUse,
|
|
6472
|
+
computerUse: settings.computerUse,
|
|
6452
6473
|
permissionModeId: normalizePermissionModeId(settings.permissionModeId)
|
|
6453
6474
|
};
|
|
6454
6475
|
return {
|
|
@@ -12202,7 +12223,6 @@ function useAgentGUINodeController({
|
|
|
12202
12223
|
}
|
|
12203
12224
|
setIsRespondingApproval(true);
|
|
12204
12225
|
setDetailError(null);
|
|
12205
|
-
const submittedPrompt = activePendingPromptRef.current;
|
|
12206
12226
|
void Promise.resolve().then(() => {
|
|
12207
12227
|
if (!isCurrentConversation(agentSessionId)) {
|
|
12208
12228
|
return null;
|
|
@@ -12219,12 +12239,6 @@ function useAgentGUINodeController({
|
|
|
12219
12239
|
if (!result || !isCurrentConversation(agentSessionId)) {
|
|
12220
12240
|
return;
|
|
12221
12241
|
}
|
|
12222
|
-
if (submittedPrompt?.requestId === normalizedRequestId && submittedPrompt.kind === "exit-plan" && input.action === "allow") {
|
|
12223
|
-
updateComposerSettingsRef.current({
|
|
12224
|
-
planMode: false,
|
|
12225
|
-
...normalizedOptionId ? { permissionModeId: normalizedOptionId } : {}
|
|
12226
|
-
});
|
|
12227
|
-
}
|
|
12228
12242
|
void refreshMessagesFromSnapshot(agentSessionId);
|
|
12229
12243
|
void loadSessionState(agentSessionId);
|
|
12230
12244
|
void syncConversationListProjection(agentSessionId);
|
|
@@ -14282,7 +14296,10 @@ function interactivePromptFromSessionState(state) {
|
|
|
14282
14296
|
return {
|
|
14283
14297
|
kind: "exit-plan",
|
|
14284
14298
|
requestId: prompt.requestId.trim(),
|
|
14285
|
-
title: prompt.toolName?.trim() || "Exit plan mode"
|
|
14299
|
+
title: prompt.toolName?.trim() || "Exit plan mode",
|
|
14300
|
+
// Legacy exitplanmode session-state prompt carries no runtime mode
|
|
14301
|
+
// options; the surface falls back to the curated default list.
|
|
14302
|
+
options: []
|
|
14286
14303
|
};
|
|
14287
14304
|
}
|
|
14288
14305
|
if (toolName !== "askuserquestion") {
|
|
@@ -17709,7 +17726,7 @@ function createAgentFileMentionContent(items, options = {}) {
|
|
|
17709
17726
|
return [
|
|
17710
17727
|
...index === 0 && options.prefixCaretAnchor ? [
|
|
17711
17728
|
{ type: "text", text: AGENT_RICH_TEXT_CARET_ANCHOR }
|
|
17712
|
-
] :
|
|
17729
|
+
] : [],
|
|
17713
17730
|
{
|
|
17714
17731
|
type: "agentFileMention",
|
|
17715
17732
|
attrs: {
|
|
@@ -17870,6 +17887,37 @@ function nonImageFilesFromDataTransfer(dataTransfer) {
|
|
|
17870
17887
|
}
|
|
17871
17888
|
return files;
|
|
17872
17889
|
}
|
|
17890
|
+
function systemFileDragInfoFromDataTransfer(dataTransfer) {
|
|
17891
|
+
if (!dataTransfer) {
|
|
17892
|
+
return { hasImageFiles: false, hasRegularFiles: false };
|
|
17893
|
+
}
|
|
17894
|
+
const items = dataTransfer.items;
|
|
17895
|
+
if (items) {
|
|
17896
|
+
let hasImageFiles2 = false;
|
|
17897
|
+
let hasRegularFiles2 = false;
|
|
17898
|
+
for (const item of Array.from(items)) {
|
|
17899
|
+
if (item.kind !== "file") {
|
|
17900
|
+
continue;
|
|
17901
|
+
}
|
|
17902
|
+
if (supportedPromptImageMimeType(item.type)) {
|
|
17903
|
+
hasImageFiles2 = true;
|
|
17904
|
+
} else {
|
|
17905
|
+
hasRegularFiles2 = true;
|
|
17906
|
+
}
|
|
17907
|
+
}
|
|
17908
|
+
return { hasImageFiles: hasImageFiles2, hasRegularFiles: hasRegularFiles2 };
|
|
17909
|
+
}
|
|
17910
|
+
let hasImageFiles = false;
|
|
17911
|
+
let hasRegularFiles = false;
|
|
17912
|
+
for (const file of Array.from(dataTransfer.files ?? [])) {
|
|
17913
|
+
if (supportedPromptImageMimeType(file.type) || supportedPromptImageFileName(file.name)) {
|
|
17914
|
+
hasImageFiles = true;
|
|
17915
|
+
} else {
|
|
17916
|
+
hasRegularFiles = true;
|
|
17917
|
+
}
|
|
17918
|
+
}
|
|
17919
|
+
return { hasImageFiles, hasRegularFiles };
|
|
17920
|
+
}
|
|
17873
17921
|
function supportedPromptImageMimeType(value) {
|
|
17874
17922
|
return value === "image/png" || value === "image/jpeg" || value === "image/webp";
|
|
17875
17923
|
}
|
|
@@ -18180,7 +18228,8 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18180
18228
|
promptImagesSupported = true,
|
|
18181
18229
|
onPromptImagesUnsupported,
|
|
18182
18230
|
onPasteImages,
|
|
18183
|
-
getReferenceForFile
|
|
18231
|
+
getReferenceForFile,
|
|
18232
|
+
onDropFiles
|
|
18184
18233
|
}, ref) {
|
|
18185
18234
|
"use memo";
|
|
18186
18235
|
const { t } = useTranslation();
|
|
@@ -18199,6 +18248,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18199
18248
|
const onLinkClickRef = useRef9(onLinkClick);
|
|
18200
18249
|
const onPromptImagesUnsupportedRef = useRef9(onPromptImagesUnsupported);
|
|
18201
18250
|
const onPasteImagesRef = useRef9(onPasteImages);
|
|
18251
|
+
const onDropFilesRef = useRef9(onDropFiles);
|
|
18202
18252
|
const promptImagesSupportedRef = useRef9(promptImagesSupported);
|
|
18203
18253
|
const getReferenceForFileRef = useRef9(getReferenceForFile);
|
|
18204
18254
|
const placeholderRef = useRef9(placeholder);
|
|
@@ -18307,6 +18357,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18307
18357
|
onLinkClickRef.current = onLinkClick;
|
|
18308
18358
|
onPromptImagesUnsupportedRef.current = onPromptImagesUnsupported;
|
|
18309
18359
|
onPasteImagesRef.current = onPasteImages;
|
|
18360
|
+
onDropFilesRef.current = onDropFiles;
|
|
18310
18361
|
promptImagesSupportedRef.current = promptImagesSupported;
|
|
18311
18362
|
getReferenceForFileRef.current = getReferenceForFile;
|
|
18312
18363
|
placeholderRef.current = placeholder;
|
|
@@ -18516,10 +18567,11 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18516
18567
|
if (!dataTransfer || disabled) {
|
|
18517
18568
|
return false;
|
|
18518
18569
|
}
|
|
18519
|
-
const
|
|
18520
|
-
|
|
18570
|
+
const systemFileDragInfo = systemFileDragInfoFromDataTransfer(dataTransfer);
|
|
18571
|
+
const canDropRegularSystemFiles = systemFileDragInfo.hasRegularFiles && Boolean(onDropFilesRef.current);
|
|
18572
|
+
if (systemFileDragInfo.hasImageFiles || canDropRegularSystemFiles) {
|
|
18521
18573
|
event.preventDefault();
|
|
18522
|
-
dataTransfer.dropEffect = promptImagesSupportedRef.current ? "copy" : "none";
|
|
18574
|
+
dataTransfer.dropEffect = canDropRegularSystemFiles || systemFileDragInfo.hasImageFiles && promptImagesSupportedRef.current ? "copy" : "none";
|
|
18523
18575
|
return true;
|
|
18524
18576
|
}
|
|
18525
18577
|
if (!hasWorkspaceFileDropData(dataTransfer)) {
|
|
@@ -18541,8 +18593,27 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18541
18593
|
return false;
|
|
18542
18594
|
}
|
|
18543
18595
|
const imageFiles = imageFilesFromDataTransfer(dataTransfer);
|
|
18544
|
-
|
|
18596
|
+
const imageFileSet = new Set(imageFiles);
|
|
18597
|
+
const regularFiles = nonImageFilesFromDataTransfer(
|
|
18598
|
+
dataTransfer
|
|
18599
|
+
).filter((file) => !imageFileSet.has(file));
|
|
18600
|
+
const canHandleRegularFiles = Boolean(onDropFilesRef.current);
|
|
18601
|
+
if (imageFiles.length > 0 || regularFiles.length > 0 && canHandleRegularFiles) {
|
|
18545
18602
|
event.preventDefault();
|
|
18603
|
+
const currentEditor2 = editorRef.current;
|
|
18604
|
+
if (regularFiles.length > 0 && onDropFilesRef.current && currentEditor2 && !currentEditor2.isDestroyed) {
|
|
18605
|
+
const coordinatePosition2 = currentEditor2.view.posAtCoords({
|
|
18606
|
+
left: event.clientX,
|
|
18607
|
+
top: event.clientY
|
|
18608
|
+
})?.pos;
|
|
18609
|
+
const fallbackSelectionPosition2 = currentEditor2.state.selection.from;
|
|
18610
|
+
const insertPosition2 = coordinatePosition2 ?? (Number.isInteger(fallbackSelectionPosition2) ? fallbackSelectionPosition2 : null) ?? currentEditor2.state.doc.content.size;
|
|
18611
|
+
currentEditor2.chain().focus().setTextSelection(insertPosition2).run();
|
|
18612
|
+
onDropFilesRef.current(regularFiles);
|
|
18613
|
+
}
|
|
18614
|
+
if (imageFiles.length === 0) {
|
|
18615
|
+
return true;
|
|
18616
|
+
}
|
|
18546
18617
|
if (!promptImagesSupportedRef.current) {
|
|
18547
18618
|
onPromptImagesUnsupportedRef.current?.();
|
|
18548
18619
|
return true;
|
|
@@ -19910,6 +19981,7 @@ function AgentComposer({
|
|
|
19910
19981
|
onCapabilitySettingsRequest,
|
|
19911
19982
|
onLinkAction,
|
|
19912
19983
|
onRequestWorkspaceReferences = null,
|
|
19984
|
+
resolveDroppedFileReferences = null,
|
|
19913
19985
|
selectProjectDirectory,
|
|
19914
19986
|
onRequestGitBranches = null,
|
|
19915
19987
|
contextMentionProviders = EMPTY_CONTEXT_MENTION_PROVIDERS
|
|
@@ -19923,6 +19995,12 @@ function AgentComposer({
|
|
|
19923
19995
|
const agentActivityRuntime = useOptionalAgentActivityRuntime();
|
|
19924
19996
|
const agentHostApi = useOptionalAgentHostApi();
|
|
19925
19997
|
const getReferenceForFile = agentHostApi?.workspace.getReferenceForFile;
|
|
19998
|
+
const promptFileUploadSupported = Boolean(
|
|
19999
|
+
agentActivityRuntime?.uploadPromptContent && (agentActivityRuntime.promptContentUploadSupport?.file ?? true)
|
|
20000
|
+
);
|
|
20001
|
+
const promptFilesSupported = Boolean(
|
|
20002
|
+
resolveDroppedFileReferences && promptFileUploadSupported
|
|
20003
|
+
);
|
|
19926
20004
|
const [isPaletteOpen, setIsPaletteOpen] = useState11(true);
|
|
19927
20005
|
const [isReviewPickerOpen, setIsReviewPickerOpen] = useState11(false);
|
|
19928
20006
|
const [highlightedIndex, setHighlightedIndex] = useState11(0);
|
|
@@ -20841,7 +20919,7 @@ function AgentComposer({
|
|
|
20841
20919
|
if (remainingSlots === 0) {
|
|
20842
20920
|
return;
|
|
20843
20921
|
}
|
|
20844
|
-
const uploadPromptContent = agentActivityRuntime?.uploadPromptContent;
|
|
20922
|
+
const uploadPromptContent = agentActivityRuntime?.uploadPromptContent && (agentActivityRuntime.promptContentUploadSupport?.image ?? true) ? agentActivityRuntime.uploadPromptContent : void 0;
|
|
20845
20923
|
const nextImages = images.slice(0, remainingSlots).map((image) => ({
|
|
20846
20924
|
id: `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,
|
|
20847
20925
|
name: image.name,
|
|
@@ -20952,7 +21030,7 @@ function AgentComposer({
|
|
|
20952
21030
|
const applyReferencePickResult = useCallback10(
|
|
20953
21031
|
async (result) => {
|
|
20954
21032
|
if (result.files.length > 0) {
|
|
20955
|
-
const uploadPromptContent = agentActivityRuntime?.uploadPromptContent;
|
|
21033
|
+
const uploadPromptContent = promptFileUploadSupported ? agentActivityRuntime?.uploadPromptContent : void 0;
|
|
20956
21034
|
const uploadedFiles = await Promise.all(
|
|
20957
21035
|
result.files.map(async (file) => {
|
|
20958
21036
|
const hostPath = file.hostPath?.trim() ?? "";
|
|
@@ -20996,7 +21074,7 @@ function AgentComposer({
|
|
|
20996
21074
|
editorHandleRef.current?.insertMentionItems(result.mentionItems);
|
|
20997
21075
|
}
|
|
20998
21076
|
},
|
|
20999
|
-
[agentActivityRuntime, workspaceId]
|
|
21077
|
+
[agentActivityRuntime, promptFileUploadSupported, workspaceId]
|
|
21000
21078
|
);
|
|
21001
21079
|
const handleWorkspaceReferencePicker = useCallback10(async () => {
|
|
21002
21080
|
if (!onRequestWorkspaceReferences) {
|
|
@@ -21004,6 +21082,23 @@ function AgentComposer({
|
|
|
21004
21082
|
}
|
|
21005
21083
|
await applyReferencePickResult(await onRequestWorkspaceReferences());
|
|
21006
21084
|
}, [applyReferencePickResult, onRequestWorkspaceReferences]);
|
|
21085
|
+
const applyDroppedFileReferences = useCallback10(
|
|
21086
|
+
async (files) => {
|
|
21087
|
+
if (!promptFilesSupported || !resolveDroppedFileReferences || files.length === 0) {
|
|
21088
|
+
return;
|
|
21089
|
+
}
|
|
21090
|
+
const references = await resolveDroppedFileReferences(files);
|
|
21091
|
+
if (references.length === 0) {
|
|
21092
|
+
return;
|
|
21093
|
+
}
|
|
21094
|
+
await applyReferencePickResult({ files: references, mentionItems: [] });
|
|
21095
|
+
},
|
|
21096
|
+
[
|
|
21097
|
+
applyReferencePickResult,
|
|
21098
|
+
promptFilesSupported,
|
|
21099
|
+
resolveDroppedFileReferences
|
|
21100
|
+
]
|
|
21101
|
+
);
|
|
21007
21102
|
const handleOpenReferencesForEntity = useCallback10(
|
|
21008
21103
|
(entity) => {
|
|
21009
21104
|
clearActiveFileMentionTrigger();
|
|
@@ -21136,21 +21231,41 @@ function AgentComposer({
|
|
|
21136
21231
|
const target = event.target;
|
|
21137
21232
|
return target instanceof Node && dropTarget.contains(target);
|
|
21138
21233
|
};
|
|
21139
|
-
const
|
|
21234
|
+
const systemFileDrag = (event) => {
|
|
21140
21235
|
if (event.defaultPrevented || inputDisabled || !containsEventTarget(event) || hasWorkspaceFileDropData(event.dataTransfer)) {
|
|
21141
|
-
return
|
|
21236
|
+
return null;
|
|
21237
|
+
}
|
|
21238
|
+
const dragInfo = systemFileDragInfoFromDataTransfer(event.dataTransfer);
|
|
21239
|
+
const hasRegularFiles = dragInfo.hasRegularFiles && promptFilesSupported;
|
|
21240
|
+
if (!dragInfo.hasImageFiles && !hasRegularFiles) {
|
|
21241
|
+
return null;
|
|
21142
21242
|
}
|
|
21143
|
-
return
|
|
21243
|
+
return { hasImageFiles: dragInfo.hasImageFiles, hasRegularFiles };
|
|
21244
|
+
};
|
|
21245
|
+
const systemFileDrop = (event) => {
|
|
21246
|
+
if (event.defaultPrevented || inputDisabled || !containsEventTarget(event) || hasWorkspaceFileDropData(event.dataTransfer)) {
|
|
21247
|
+
return null;
|
|
21248
|
+
}
|
|
21249
|
+
const imageFiles = imageFilesFromDataTransfer(event.dataTransfer);
|
|
21250
|
+
const imageFileSet = new Set(imageFiles);
|
|
21251
|
+
const regularFiles = promptFilesSupported ? nonImageFilesFromDataTransfer(event.dataTransfer).filter(
|
|
21252
|
+
(file) => !imageFileSet.has(file)
|
|
21253
|
+
) : [];
|
|
21254
|
+
if (imageFiles.length === 0 && regularFiles.length === 0) {
|
|
21255
|
+
return null;
|
|
21256
|
+
}
|
|
21257
|
+
return { imageFiles, regularFiles };
|
|
21144
21258
|
};
|
|
21145
21259
|
const handleDragOver = (event) => {
|
|
21146
21260
|
if (!isDragEvent(event)) {
|
|
21147
21261
|
return;
|
|
21148
21262
|
}
|
|
21149
|
-
|
|
21263
|
+
const drag = systemFileDrag(event);
|
|
21264
|
+
if (!drag) {
|
|
21150
21265
|
return;
|
|
21151
21266
|
}
|
|
21152
21267
|
event.preventDefault();
|
|
21153
|
-
if (!promptImagesSupported) {
|
|
21268
|
+
if (!drag.hasRegularFiles && drag.hasImageFiles && !promptImagesSupported) {
|
|
21154
21269
|
return;
|
|
21155
21270
|
}
|
|
21156
21271
|
if (event.dataTransfer) {
|
|
@@ -21161,17 +21276,28 @@ function AgentComposer({
|
|
|
21161
21276
|
if (!isDragEvent(event)) {
|
|
21162
21277
|
return;
|
|
21163
21278
|
}
|
|
21164
|
-
|
|
21279
|
+
const drop = systemFileDrop(event);
|
|
21280
|
+
if (!drop) {
|
|
21165
21281
|
return;
|
|
21166
21282
|
}
|
|
21167
21283
|
event.preventDefault();
|
|
21168
21284
|
event.stopPropagation();
|
|
21285
|
+
if (drop.regularFiles.length > 0) {
|
|
21286
|
+
editorHandleRef.current?.focusAtEnd();
|
|
21287
|
+
void applyDroppedFileReferences(drop.regularFiles).then(() => {
|
|
21288
|
+
if (!isDisposed) {
|
|
21289
|
+
scheduleComposerFocus();
|
|
21290
|
+
}
|
|
21291
|
+
});
|
|
21292
|
+
}
|
|
21293
|
+
if (drop.imageFiles.length === 0) {
|
|
21294
|
+
return;
|
|
21295
|
+
}
|
|
21169
21296
|
if (!promptImagesSupported) {
|
|
21170
21297
|
onPromptImagesUnsupported?.();
|
|
21171
21298
|
return;
|
|
21172
21299
|
}
|
|
21173
|
-
|
|
21174
|
-
void readAgentRichTextPromptImages(imageFiles).then((images) => {
|
|
21300
|
+
void readAgentRichTextPromptImages(drop.imageFiles).then((images) => {
|
|
21175
21301
|
if (isDisposed || images.length === 0) {
|
|
21176
21302
|
return;
|
|
21177
21303
|
}
|
|
@@ -21188,8 +21314,10 @@ function AgentComposer({
|
|
|
21188
21314
|
};
|
|
21189
21315
|
}, [
|
|
21190
21316
|
addDraftImages,
|
|
21317
|
+
applyDroppedFileReferences,
|
|
21191
21318
|
inputDisabled,
|
|
21192
21319
|
onPromptImagesUnsupported,
|
|
21320
|
+
promptFilesSupported,
|
|
21193
21321
|
promptImagesSupported,
|
|
21194
21322
|
scheduleComposerFocus
|
|
21195
21323
|
]);
|
|
@@ -21739,7 +21867,8 @@ function AgentComposer({
|
|
|
21739
21867
|
promptImagesSupported,
|
|
21740
21868
|
onPromptImagesUnsupported,
|
|
21741
21869
|
onPasteImages: handlePastedImages,
|
|
21742
|
-
getReferenceForFile
|
|
21870
|
+
getReferenceForFile,
|
|
21871
|
+
onDropFiles: promptFilesSupported ? applyDroppedFileReferences : void 0
|
|
21743
21872
|
}
|
|
21744
21873
|
),
|
|
21745
21874
|
!isHeroLayout ? composerActionButton : null
|
|
@@ -22872,6 +23001,7 @@ function AgentGUINodeView({
|
|
|
22872
23001
|
detailMinWidthPx,
|
|
22873
23002
|
uiLanguage,
|
|
22874
23003
|
onWorkspaceFileReferencesAdded,
|
|
23004
|
+
resolveDroppedFileReferences = null,
|
|
22875
23005
|
onConversationRailWidthChanged,
|
|
22876
23006
|
labels,
|
|
22877
23007
|
workspaceUserProjectI18n,
|
|
@@ -22883,6 +23013,7 @@ function AgentGUINodeView({
|
|
|
22883
23013
|
onRequestGitBranches = null,
|
|
22884
23014
|
contextMentionProviders,
|
|
22885
23015
|
referenceSourceAggregator = null,
|
|
23016
|
+
resolveWorkspaceReferenceEntryIconUrl,
|
|
22886
23017
|
resolveMentionReferenceTarget = null,
|
|
22887
23018
|
resolveWorkspaceReferenceInitialTarget = null,
|
|
22888
23019
|
workspaceAppIcons = EMPTY_WORKSPACE_APP_ICONS3
|
|
@@ -23349,6 +23480,7 @@ function AgentGUINodeView({
|
|
|
23349
23480
|
onCapabilitySettingsRequest,
|
|
23350
23481
|
onAgentProviderLogin,
|
|
23351
23482
|
onRequestWorkspaceReferences: requestWorkspaceReferences,
|
|
23483
|
+
resolveDroppedFileReferences,
|
|
23352
23484
|
selectProjectDirectory,
|
|
23353
23485
|
onRequestGitBranches,
|
|
23354
23486
|
contextMentionProviders,
|
|
@@ -23369,6 +23501,7 @@ function AgentGUINodeView({
|
|
|
23369
23501
|
isNodeSelectable: isWorkspaceReferencePickerNodeSelectable,
|
|
23370
23502
|
fileManagerCopy: workspaceFileManagerCopy ?? void 0,
|
|
23371
23503
|
open: workspaceReferencePickerOpen,
|
|
23504
|
+
resolveEntryIconUrl: resolveWorkspaceReferenceEntryIconUrl,
|
|
23372
23505
|
workspaceId: viewModel.workspaceId,
|
|
23373
23506
|
onClose: closeWorkspaceReferencePicker,
|
|
23374
23507
|
onConfirm: confirmWorkspaceReferencePicker,
|
|
@@ -23466,6 +23599,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
23466
23599
|
onCapabilitySettingsRequest,
|
|
23467
23600
|
onAgentProviderLogin,
|
|
23468
23601
|
onRequestWorkspaceReferences,
|
|
23602
|
+
resolveDroppedFileReferences = null,
|
|
23469
23603
|
selectProjectDirectory,
|
|
23470
23604
|
onRequestGitBranches,
|
|
23471
23605
|
contextMentionProviders,
|
|
@@ -24015,6 +24149,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24015
24149
|
onCapabilitySettingsRequest,
|
|
24016
24150
|
onLinkAction: stableLinkAction,
|
|
24017
24151
|
onRequestWorkspaceReferences: stableRequestWorkspaceReferences,
|
|
24152
|
+
resolveDroppedFileReferences,
|
|
24018
24153
|
selectProjectDirectory: stableSelectProjectDirectory,
|
|
24019
24154
|
onRequestGitBranches: stableRequestGitBranches,
|
|
24020
24155
|
contextMentionProviders
|
|
@@ -24038,6 +24173,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24038
24173
|
onCapabilitySettingsRequest,
|
|
24039
24174
|
contextMentionProviders,
|
|
24040
24175
|
removeQueuedPrompt,
|
|
24176
|
+
resolveDroppedFileReferences,
|
|
24041
24177
|
sendQueuedPromptNext,
|
|
24042
24178
|
showPromptImagesUnsupported,
|
|
24043
24179
|
showStopButton,
|
|
@@ -25079,7 +25215,7 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25079
25215
|
{
|
|
25080
25216
|
type: "button",
|
|
25081
25217
|
"data-testid": "agent-gui-config-env-setup",
|
|
25082
|
-
className: "nodrag -mx-1 flex w-[calc(100%+0.5rem)] items-center gap-2 rounded-[6px] px-2 py-1 text-[13px] text-
|
|
25218
|
+
className: "nodrag -mx-1 flex w-[calc(100%+0.5rem)] items-center gap-2 rounded-[6px] px-2 py-1 text-[13px] text-white transition-colors hover:bg-background-hover hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:text-white/50 [-webkit-app-region:no-drag]",
|
|
25083
25219
|
disabled: previewMode,
|
|
25084
25220
|
onClick: () => onOpenAgentEnvSetup(),
|
|
25085
25221
|
children: [
|
|
@@ -26460,7 +26596,7 @@ function composerOverridesByProviderEqual(left, right) {
|
|
|
26460
26596
|
return true;
|
|
26461
26597
|
}
|
|
26462
26598
|
function areAgentGUINodePropsEqual(previous, next) {
|
|
26463
|
-
return previous.nodeId === next.nodeId && previous.workspaceId === next.workspaceId && previous.currentUserId === next.currentUserId && previous.workspacePath === next.workspacePath && previous.workspaceFileReferenceAdapter === next.workspaceFileReferenceAdapter && previous.selectProjectDirectory === next.selectProjectDirectory && previous.referenceSourceAggregator === next.referenceSourceAggregator && 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.onCapabilitySettingsRequest === next.onCapabilitySettingsRequest && previous.onAgentProviderLogin === next.onAgentProviderLogin && previous.providerTargets === next.providerTargets && 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 && workspaceAgentProbeRenderStateEqualsForProvider(
|
|
26599
|
+
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.onCapabilitySettingsRequest === next.onCapabilitySettingsRequest && previous.onAgentProviderLogin === next.onAgentProviderLogin && previous.providerTargets === next.providerTargets && 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 && workspaceAgentProbeRenderStateEqualsForProvider(
|
|
26464
26600
|
previous.workspaceAgentProbes,
|
|
26465
26601
|
next.workspaceAgentProbes,
|
|
26466
26602
|
previous.state.provider
|
|
@@ -26474,7 +26610,9 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26474
26610
|
workspaceFileReferenceAdapter = null,
|
|
26475
26611
|
onRequestGitBranches = null,
|
|
26476
26612
|
selectProjectDirectory,
|
|
26613
|
+
resolveDroppedFileReferences = null,
|
|
26477
26614
|
referenceSourceAggregator = null,
|
|
26615
|
+
resolveWorkspaceReferenceEntryIconUrl,
|
|
26478
26616
|
resolveMentionReferenceTarget = null,
|
|
26479
26617
|
resolveWorkspaceReferenceInitialTarget = null,
|
|
26480
26618
|
agentSettings,
|
|
@@ -26914,6 +27052,11 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26914
27052
|
id: "bypassPermissions",
|
|
26915
27053
|
label: t("agentHost.agentGui.planModes.allowAll.label"),
|
|
26916
27054
|
description: t("agentHost.agentGui.planModes.allowAll.description")
|
|
27055
|
+
},
|
|
27056
|
+
{
|
|
27057
|
+
id: "auto",
|
|
27058
|
+
label: t("agentHost.agentGui.planModes.auto.label"),
|
|
27059
|
+
description: t("agentHost.agentGui.planModes.auto.description")
|
|
26917
27060
|
}
|
|
26918
27061
|
],
|
|
26919
27062
|
stayInPlan: t("agentHost.agentGui.stayInPlan"),
|
|
@@ -27332,6 +27475,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
27332
27475
|
detailMinWidthPx: AGENT_GUI_DETAIL_MIN_WIDTH_PX,
|
|
27333
27476
|
uiLanguage: locale,
|
|
27334
27477
|
onWorkspaceFileReferencesAdded: onWorkspaceFileReferencesAdded ? handleWorkspaceFileReferencesAdded : void 0,
|
|
27478
|
+
resolveDroppedFileReferences,
|
|
27335
27479
|
onConversationRailWidthChanged: handleConversationRailWidthChanged,
|
|
27336
27480
|
labels,
|
|
27337
27481
|
workspaceUserProjectI18n,
|
|
@@ -27341,6 +27485,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
27341
27485
|
onRequestGitBranches,
|
|
27342
27486
|
selectProjectDirectory,
|
|
27343
27487
|
referenceSourceAggregator,
|
|
27488
|
+
resolveWorkspaceReferenceEntryIconUrl,
|
|
27344
27489
|
resolveMentionReferenceTarget,
|
|
27345
27490
|
resolveWorkspaceReferenceInitialTarget,
|
|
27346
27491
|
workspaceFileReferenceCopy,
|