@tutti-os/agent-gui 0.0.46 → 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/{AgentMentionSearchController-D5ks45fN.d.ts → AgentMentionSearchController-CExFPobz.d.ts} +1 -1
- package/dist/AgentMessageMarkdown-DeYPURtF.d.ts +7 -0
- package/dist/agent-conversation/index.d.ts +5 -4
- package/dist/agent-conversation/index.js +8 -8
- package/dist/agent-message-center/index.d.ts +2 -2
- package/dist/agent-message-center/index.js +36 -14
- package/dist/agent-message-center/index.js.map +1 -1
- package/dist/{agentConversationVM-1QgRwvwZ.d.ts → agentConversationVM-DSXrFL9v.d.ts} +19 -1
- package/dist/{AgentMessageMarkdown-Cts0dAIm.d.ts → agentGuiNodeTypes-Bp1G8pOj.d.ts} +45 -11
- package/dist/app/renderer/agentactivity.css +145 -12
- package/dist/{chunk-AMNXH4DJ.js → chunk-2RYZ4EBF.js} +2 -2
- package/dist/{chunk-QT45WUPQ.js → chunk-6YN7HQL5.js} +366 -52
- package/dist/chunk-6YN7HQL5.js.map +1 -0
- package/dist/{chunk-D6IYEVDT.js → chunk-7W3VWU5R.js} +10 -6
- package/dist/chunk-7W3VWU5R.js.map +1 -0
- package/dist/{chunk-NZ2BGOJU.js → chunk-EUOGIKT7.js} +2 -2
- package/dist/{chunk-BAQTM6VS.js → chunk-LWMC2YA3.js} +1260 -442
- package/dist/chunk-LWMC2YA3.js.map +1 -0
- package/dist/{chunk-EIC7XS3C.js → chunk-N6HRVMIS.js} +2 -2
- package/dist/{chunk-VFQR7AZI.js → chunk-NETHPCSA.js} +35 -5
- package/dist/chunk-NETHPCSA.js.map +1 -0
- package/dist/{chunk-OL54R6OL.js → chunk-OB43QOMC.js} +2 -2
- package/dist/{chunk-FRG36S6N.js → chunk-OYQZRLJQ.js} +5 -5
- package/dist/chunk-OYQZRLJQ.js.map +1 -0
- package/dist/{chunk-EU7RWKHE.js → chunk-R6GOICRO.js} +5 -5
- package/dist/{chunk-ZJ7OSY4T.js → chunk-RNIY43TA.js} +9 -9
- package/dist/{chunk-ZJ7OSY4T.js.map → chunk-RNIY43TA.js.map} +1 -1
- package/dist/chunk-SD56WDSC.js +359 -0
- package/dist/chunk-SD56WDSC.js.map +1 -0
- package/dist/{chunk-TXXWUG2J.js → chunk-U6JWW45G.js} +2 -1
- package/dist/chunk-U6JWW45G.js.map +1 -0
- package/dist/{chunk-62QOR3TC.js → chunk-VGDPBC6W.js} +37 -7
- package/dist/chunk-VGDPBC6W.js.map +1 -0
- package/dist/{chunk-FJG2EH4V.js → chunk-ZVKRNEOF.js} +2 -2
- package/dist/context-mention-palette/index.d.ts +3 -3
- package/dist/context-mention-palette/index.js +9 -9
- package/dist/i18n/index.d.ts +34 -4
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +308 -10
- package/dist/index.js +1023 -843
- package/dist/index.js.map +1 -1
- package/dist/plan-decision-ops.d.ts +2 -2
- package/dist/queued-prompt-runtime.d.ts +97 -0
- package/dist/queued-prompt-runtime.js +9 -0
- package/dist/queued-prompt-runtime.js.map +1 -0
- package/dist/workbench/contribution.js +3 -3
- package/dist/workbench/index.js +9 -9
- package/dist/workbench/launch.js +2 -2
- 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 +21 -14
- package/dist/chunk-62QOR3TC.js.map +0 -1
- package/dist/chunk-BAQTM6VS.js.map +0 -1
- package/dist/chunk-D6IYEVDT.js.map +0 -1
- package/dist/chunk-FRG36S6N.js.map +0 -1
- package/dist/chunk-QT45WUPQ.js.map +0 -1
- package/dist/chunk-TXXWUG2J.js.map +0 -1
- package/dist/chunk-VFQR7AZI.js.map +0 -1
- /package/dist/{chunk-AMNXH4DJ.js.map → chunk-2RYZ4EBF.js.map} +0 -0
- /package/dist/{chunk-NZ2BGOJU.js.map → chunk-EUOGIKT7.js.map} +0 -0
- /package/dist/{chunk-EIC7XS3C.js.map → chunk-N6HRVMIS.js.map} +0 -0
- /package/dist/{chunk-OL54R6OL.js.map → chunk-OB43QOMC.js.map} +0 -0
- /package/dist/{chunk-EU7RWKHE.js.map → chunk-R6GOICRO.js.map} +0 -0
- /package/dist/{chunk-FJG2EH4V.js.map → chunk-ZVKRNEOF.js.map} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getOptionalAgentHostApi,
|
|
3
3
|
useOptionalAgentHostApi
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
translate,
|
|
7
|
-
useTranslation
|
|
8
|
-
} from "./chunk-EIC7XS3C.js";
|
|
4
|
+
} from "./chunk-U6JWW45G.js";
|
|
9
5
|
import {
|
|
10
6
|
resolveAgentWorkspaceFileVisualKind
|
|
11
7
|
} from "./chunk-PJP5BUU6.js";
|
|
8
|
+
import {
|
|
9
|
+
translate,
|
|
10
|
+
useTranslation
|
|
11
|
+
} from "./chunk-N6HRVMIS.js";
|
|
12
12
|
|
|
13
13
|
// shared/agentMcpToolTarget.ts
|
|
14
14
|
function extractAgentMcpToolTarget({
|
|
@@ -144,28 +144,86 @@ function objectValue(value) {
|
|
|
144
144
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
// shared/agentConversation/exitPlanOptions.ts
|
|
148
|
+
var EXIT_PLAN_KEEP_PLANNING_OPTION_ID = "plan";
|
|
149
|
+
function isExitPlanSwitchModeInput(input) {
|
|
150
|
+
const record = recordValue(input);
|
|
151
|
+
const toolCall = recordValue(record.toolCall);
|
|
152
|
+
if (normalizeToken(stringValue2(toolCall.kind)) !== "switchmode") {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
return collectRawOptions(record).some(
|
|
156
|
+
(option) => normalizeToken(rawOptionId(option)) === EXIT_PLAN_KEEP_PLANNING_OPTION_ID
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
function extractExitPlanModeOptions(input, payload) {
|
|
160
|
+
const sources = payload === void 0 ? [recordValue(input)] : [recordValue(input), recordValue(payload)];
|
|
161
|
+
return sources.flatMap(collectRawOptions).flatMap((option) => {
|
|
162
|
+
const id = rawOptionId(option);
|
|
163
|
+
if (!id || normalizeToken(id) === EXIT_PLAN_KEEP_PLANNING_OPTION_ID) {
|
|
164
|
+
return [];
|
|
165
|
+
}
|
|
166
|
+
return [
|
|
167
|
+
{
|
|
168
|
+
id,
|
|
169
|
+
label: stringValue2(option.name) ?? stringValue2(option.label) ?? stringValue2(option.title) ?? stringValue2(option.kind) ?? id,
|
|
170
|
+
kind: stringValue2(option.kind) ?? id,
|
|
171
|
+
...stringValue2(option.description) ? { description: stringValue2(option.description) } : {}
|
|
172
|
+
}
|
|
173
|
+
];
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
function extractExitPlanKeepPlanningOptionId(input, payload) {
|
|
177
|
+
const sources = payload === void 0 ? [recordValue(input)] : [recordValue(input), recordValue(payload)];
|
|
178
|
+
for (const option of sources.flatMap(collectRawOptions)) {
|
|
179
|
+
const id = rawOptionId(option);
|
|
180
|
+
if (id && normalizeToken(id) === EXIT_PLAN_KEEP_PLANNING_OPTION_ID) {
|
|
181
|
+
return id;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
function collectRawOptions(record) {
|
|
187
|
+
return arrayValue(record.options).map(recordValue);
|
|
188
|
+
}
|
|
189
|
+
function rawOptionId(option) {
|
|
190
|
+
return stringValue2(option.optionId) ?? stringValue2(option.id) ?? stringValue2(option.kind) ?? "";
|
|
191
|
+
}
|
|
192
|
+
function normalizeToken(value) {
|
|
193
|
+
return (value ?? "").replace(/[_\s-]+/g, "").trim().toLowerCase();
|
|
194
|
+
}
|
|
195
|
+
function stringValue2(value) {
|
|
196
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
197
|
+
}
|
|
198
|
+
function recordValue(value) {
|
|
199
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
200
|
+
}
|
|
201
|
+
function arrayValue(value) {
|
|
202
|
+
return Array.isArray(value) ? value : [];
|
|
203
|
+
}
|
|
204
|
+
|
|
147
205
|
// shared/agentConversation/askUserQuestions.ts
|
|
148
206
|
function normalizeAskUserQuestions(rawQuestions) {
|
|
149
|
-
return
|
|
207
|
+
return arrayValue2(rawQuestions).flatMap((value, index) => {
|
|
150
208
|
const question = objectValue2(value);
|
|
151
209
|
if (!question) {
|
|
152
210
|
return [];
|
|
153
211
|
}
|
|
154
212
|
return [
|
|
155
213
|
{
|
|
156
|
-
id:
|
|
157
|
-
header:
|
|
158
|
-
question:
|
|
159
|
-
options:
|
|
214
|
+
id: stringValue3(question.id) ?? `question-${index + 1}`,
|
|
215
|
+
header: stringValue3(question.header) ?? `Question ${index + 1}`,
|
|
216
|
+
question: stringValue3(question.question) ?? stringValue3(question.header) ?? `Question ${index + 1}`,
|
|
217
|
+
options: arrayValue2(question.options).flatMap((optionValue) => {
|
|
160
218
|
const option = objectValue2(optionValue);
|
|
161
|
-
const label =
|
|
219
|
+
const label = stringValue3(option?.label);
|
|
162
220
|
if (!label) {
|
|
163
221
|
return [];
|
|
164
222
|
}
|
|
165
223
|
return [
|
|
166
224
|
{
|
|
167
225
|
label,
|
|
168
|
-
description:
|
|
226
|
+
description: stringValue3(option?.description) ?? ""
|
|
169
227
|
}
|
|
170
228
|
];
|
|
171
229
|
}),
|
|
@@ -174,13 +232,13 @@ function normalizeAskUserQuestions(rawQuestions) {
|
|
|
174
232
|
];
|
|
175
233
|
});
|
|
176
234
|
}
|
|
177
|
-
function
|
|
235
|
+
function stringValue3(value) {
|
|
178
236
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
179
237
|
}
|
|
180
238
|
function objectValue2(value) {
|
|
181
239
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
182
240
|
}
|
|
183
|
-
function
|
|
241
|
+
function arrayValue2(value) {
|
|
184
242
|
return Array.isArray(value) ? value : [];
|
|
185
243
|
}
|
|
186
244
|
|
|
@@ -215,6 +273,7 @@ import {
|
|
|
215
273
|
DownloadIcon,
|
|
216
274
|
RestoreIcon
|
|
217
275
|
} from "@tutti-os/ui-system";
|
|
276
|
+
import { RotateCcwIcon, ZoomInIcon, ZoomOutIcon } from "lucide-react";
|
|
218
277
|
import Zoom from "react-medium-image-zoom";
|
|
219
278
|
|
|
220
279
|
// app/renderer/lib/utils.ts
|
|
@@ -354,6 +413,9 @@ function ConversationImageContextMenu({
|
|
|
354
413
|
|
|
355
414
|
// app/renderer/components/ZoomableImage.tsx
|
|
356
415
|
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
416
|
+
var IMAGE_PREVIEW_ZOOM_MIN = 0.5;
|
|
417
|
+
var IMAGE_PREVIEW_ZOOM_MAX = 3;
|
|
418
|
+
var IMAGE_PREVIEW_ZOOM_STEP = 0.25;
|
|
357
419
|
function ZoomableImage({
|
|
358
420
|
alt,
|
|
359
421
|
className,
|
|
@@ -369,6 +431,12 @@ function ZoomableImage({
|
|
|
369
431
|
const hasImageActions = Boolean(actionSource && downloadName !== void 0);
|
|
370
432
|
const [contextMenuPosition, setContextMenuPosition] = useState2(null);
|
|
371
433
|
const [copyStatus, setCopyStatus] = useState2(null);
|
|
434
|
+
const [imagePreviewZoom, setImagePreviewZoom] = useState2(1);
|
|
435
|
+
const [isWheelZooming, setIsWheelZooming] = useState2(false);
|
|
436
|
+
const [isImagePreviewOpen, setIsImagePreviewOpen] = useState2(false);
|
|
437
|
+
const imagePreviewZoomPercent = Math.round(imagePreviewZoom * 100);
|
|
438
|
+
const canZoomOut = imagePreviewZoom > IMAGE_PREVIEW_ZOOM_MIN;
|
|
439
|
+
const canZoomIn = imagePreviewZoom < IMAGE_PREVIEW_ZOOM_MAX;
|
|
372
440
|
const closeContextMenu = useCallback2(() => {
|
|
373
441
|
setContextMenuPosition(null);
|
|
374
442
|
}, []);
|
|
@@ -445,6 +513,36 @@ function ZoomableImage({
|
|
|
445
513
|
resolveImageDownloadName(downloadName, actionSource, alt)
|
|
446
514
|
);
|
|
447
515
|
}, [actionSource, alt, closeContextMenu, downloadName]);
|
|
516
|
+
const zoomOutPreviewImage = useCallback2(() => {
|
|
517
|
+
setIsWheelZooming(false);
|
|
518
|
+
setImagePreviewZoom(
|
|
519
|
+
(value) => clampSteppedImagePreviewZoom(value - IMAGE_PREVIEW_ZOOM_STEP)
|
|
520
|
+
);
|
|
521
|
+
}, []);
|
|
522
|
+
const zoomInPreviewImage = useCallback2(() => {
|
|
523
|
+
setIsWheelZooming(false);
|
|
524
|
+
setImagePreviewZoom(
|
|
525
|
+
(value) => clampSteppedImagePreviewZoom(value + IMAGE_PREVIEW_ZOOM_STEP)
|
|
526
|
+
);
|
|
527
|
+
}, []);
|
|
528
|
+
const resetPreviewImageZoom = useCallback2(() => {
|
|
529
|
+
setIsWheelZooming(false);
|
|
530
|
+
setImagePreviewZoom(1);
|
|
531
|
+
}, []);
|
|
532
|
+
const handlePreviewImageWheel = useCallback2(
|
|
533
|
+
(event) => {
|
|
534
|
+
event.preventDefault();
|
|
535
|
+
event.stopPropagation();
|
|
536
|
+
if (event.deltaY === 0) {
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
setIsWheelZooming(true);
|
|
540
|
+
setImagePreviewZoom(
|
|
541
|
+
(value) => clampImagePreviewZoom(value * Math.pow(2, resolveWheelZoomDelta(event)))
|
|
542
|
+
);
|
|
543
|
+
},
|
|
544
|
+
[]
|
|
545
|
+
);
|
|
448
546
|
const actionButtons = hasImageActions ? /* @__PURE__ */ jsx2(
|
|
449
547
|
ImageActionButtons,
|
|
450
548
|
{
|
|
@@ -456,30 +554,55 @@ function ZoomableImage({
|
|
|
456
554
|
) : null;
|
|
457
555
|
const renderZoomContent = ({
|
|
458
556
|
buttonUnzoom,
|
|
459
|
-
img
|
|
557
|
+
img,
|
|
558
|
+
modalState
|
|
460
559
|
}) => {
|
|
560
|
+
const typedButtonUnzoom = buttonUnzoom;
|
|
561
|
+
const buttonUnzoomProps = typedButtonUnzoom.props;
|
|
461
562
|
const zoomSrc = isValidElement(img) && typeof img.props.src === "string" ? img.props.src : null;
|
|
563
|
+
const isUnzooming = modalState === "UNLOADING";
|
|
564
|
+
const effectiveImagePreviewZoom = isUnzooming ? 1 : imagePreviewZoom;
|
|
565
|
+
const renderedImage = img ? cloneImageWithPreviewZoom(
|
|
566
|
+
img,
|
|
567
|
+
effectiveImagePreviewZoom,
|
|
568
|
+
isUnzooming ? false : isWheelZooming,
|
|
569
|
+
handlePreviewImageWheel
|
|
570
|
+
) : null;
|
|
462
571
|
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
463
|
-
actionButtons &&
|
|
464
|
-
|
|
465
|
-
|
|
572
|
+
actionButtons && renderedImage && zoomSrc ? cloneElement(
|
|
573
|
+
renderedImage,
|
|
574
|
+
{
|
|
575
|
+
onContextMenu: handleContextMenu
|
|
576
|
+
}
|
|
577
|
+
) : !actionButtons && renderedImage && zoomSrc ? /* @__PURE__ */ jsx2(
|
|
466
578
|
ConversationImageContextMenu,
|
|
467
579
|
{
|
|
468
580
|
src: zoomSrc,
|
|
469
581
|
asChild: true,
|
|
470
582
|
contentStyle: { zIndex: "var(--z-dialog-popover)" },
|
|
471
|
-
children:
|
|
583
|
+
children: renderedImage
|
|
472
584
|
}
|
|
473
|
-
) :
|
|
474
|
-
|
|
475
|
-
|
|
585
|
+
) : renderedImage,
|
|
586
|
+
/* @__PURE__ */ jsx2(
|
|
587
|
+
ImagePreviewZoomControls,
|
|
476
588
|
{
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
589
|
+
canZoomIn,
|
|
590
|
+
canZoomOut,
|
|
591
|
+
percent: imagePreviewZoomPercent,
|
|
592
|
+
percentLabel: t("common.imageZoomPercent", {
|
|
593
|
+
percent: imagePreviewZoomPercent
|
|
594
|
+
}),
|
|
595
|
+
reportPercentStatus: !copyStatus,
|
|
596
|
+
resetLabel: t("common.resetImageZoom"),
|
|
597
|
+
zoomInLabel: t("common.zoomInImage"),
|
|
598
|
+
zoomOutLabel: t("common.zoomOutImage"),
|
|
599
|
+
onReset: resetPreviewImageZoom,
|
|
600
|
+
onZoomIn: zoomInPreviewImage,
|
|
601
|
+
onZoomOut: zoomOutPreviewImage,
|
|
602
|
+
onWheel: handlePreviewImageWheel
|
|
481
603
|
}
|
|
482
|
-
)
|
|
604
|
+
),
|
|
605
|
+
actionButtons ? /* @__PURE__ */ jsx2("div", { className: "tsh-zoom-dialog__image-actions nodrag tsh-desktop-no-drag", children: actionButtons }) : null,
|
|
483
606
|
contextMenuPosition?.inZoomDialog && actionButtons ? /* @__PURE__ */ jsx2(
|
|
484
607
|
"div",
|
|
485
608
|
{
|
|
@@ -502,6 +625,19 @@ function ZoomableImage({
|
|
|
502
625
|
)
|
|
503
626
|
}
|
|
504
627
|
) : null,
|
|
628
|
+
copyStatus ? /* @__PURE__ */ jsx2(
|
|
629
|
+
ImageCopyStatusToast,
|
|
630
|
+
{
|
|
631
|
+
busy: copyStatus.busy,
|
|
632
|
+
message: copyStatus.message,
|
|
633
|
+
variant: copyStatus.variant,
|
|
634
|
+
onOpenChange: (open) => {
|
|
635
|
+
if (!open) {
|
|
636
|
+
setCopyStatus(null);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
) : null,
|
|
505
641
|
/* @__PURE__ */ jsx2(
|
|
506
642
|
Button,
|
|
507
643
|
{
|
|
@@ -510,8 +646,14 @@ function ZoomableImage({
|
|
|
510
646
|
size: "icon",
|
|
511
647
|
variant: "chrome",
|
|
512
648
|
children: cloneElement(
|
|
513
|
-
|
|
514
|
-
|
|
649
|
+
typedButtonUnzoom,
|
|
650
|
+
{
|
|
651
|
+
onClick: (event) => {
|
|
652
|
+
setIsWheelZooming(false);
|
|
653
|
+
setImagePreviewZoom(1);
|
|
654
|
+
buttonUnzoomProps.onClick?.(event);
|
|
655
|
+
}
|
|
656
|
+
},
|
|
515
657
|
/* @__PURE__ */ jsx2(RestoreIcon, { "aria-hidden": "true", className: "size-4" })
|
|
516
658
|
)
|
|
517
659
|
}
|
|
@@ -528,6 +670,13 @@ function ZoomableImage({
|
|
|
528
670
|
wrapElement,
|
|
529
671
|
zoomMargin: 24,
|
|
530
672
|
ZoomContent: renderZoomContent,
|
|
673
|
+
onZoomChange: (zoomed) => {
|
|
674
|
+
setIsImagePreviewOpen(zoomed);
|
|
675
|
+
if (!zoomed) {
|
|
676
|
+
setIsWheelZooming(false);
|
|
677
|
+
setImagePreviewZoom(1);
|
|
678
|
+
}
|
|
679
|
+
},
|
|
531
680
|
children: /* @__PURE__ */ jsx2(
|
|
532
681
|
"img",
|
|
533
682
|
{
|
|
@@ -540,29 +689,32 @@ function ZoomableImage({
|
|
|
540
689
|
)
|
|
541
690
|
}
|
|
542
691
|
),
|
|
543
|
-
contextMenuPosition && !contextMenuPosition.inZoomDialog && actionButtons ?
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
692
|
+
contextMenuPosition && !contextMenuPosition.inZoomDialog && actionButtons ? createPortal(
|
|
693
|
+
/* @__PURE__ */ jsx2(
|
|
694
|
+
"div",
|
|
695
|
+
{
|
|
696
|
+
className: "tsh-image-context-menu nodrag tsh-desktop-no-drag",
|
|
697
|
+
style: {
|
|
698
|
+
left: contextMenuPosition.x,
|
|
699
|
+
top: contextMenuPosition.y
|
|
700
|
+
},
|
|
701
|
+
role: "menu",
|
|
702
|
+
onClick: (event) => event.stopPropagation(),
|
|
703
|
+
children: /* @__PURE__ */ jsx2(
|
|
704
|
+
ImageActionButtons,
|
|
705
|
+
{
|
|
706
|
+
copyLabel: t("common.copyImage"),
|
|
707
|
+
downloadLabel: t("common.downloadImage"),
|
|
708
|
+
itemRole: "menuitem",
|
|
709
|
+
onCopy: handleCopyImageAction,
|
|
710
|
+
onDownload: handleDownloadImage
|
|
711
|
+
}
|
|
712
|
+
)
|
|
713
|
+
}
|
|
714
|
+
),
|
|
715
|
+
document.body
|
|
564
716
|
) : null,
|
|
565
|
-
copyStatus ? createPortal(
|
|
717
|
+
copyStatus && !isImagePreviewOpen ? createPortal(
|
|
566
718
|
/* @__PURE__ */ jsx2(
|
|
567
719
|
ImageCopyStatusToast,
|
|
568
720
|
{
|
|
@@ -594,6 +746,8 @@ function ImageCopyStatusToast({
|
|
|
594
746
|
anchor: "viewport",
|
|
595
747
|
busy,
|
|
596
748
|
variant,
|
|
749
|
+
"data-tsh-image-copy-status": "true",
|
|
750
|
+
style: { zIndex: 100303 },
|
|
597
751
|
onOpenChange,
|
|
598
752
|
children: /* @__PURE__ */ jsx2(ToastTitle, { children: message })
|
|
599
753
|
}
|
|
@@ -610,6 +764,73 @@ function ImageCopyStatusToast({
|
|
|
610
764
|
)
|
|
611
765
|
] });
|
|
612
766
|
}
|
|
767
|
+
function ImagePreviewZoomControls({
|
|
768
|
+
canZoomIn,
|
|
769
|
+
canZoomOut,
|
|
770
|
+
percent,
|
|
771
|
+
percentLabel,
|
|
772
|
+
reportPercentStatus,
|
|
773
|
+
resetLabel,
|
|
774
|
+
zoomInLabel,
|
|
775
|
+
zoomOutLabel,
|
|
776
|
+
onReset,
|
|
777
|
+
onZoomIn,
|
|
778
|
+
onZoomOut,
|
|
779
|
+
onWheel
|
|
780
|
+
}) {
|
|
781
|
+
return /* @__PURE__ */ jsxs2(
|
|
782
|
+
"div",
|
|
783
|
+
{
|
|
784
|
+
className: "tsh-zoom-dialog__zoom-controls nodrag tsh-desktop-no-drag",
|
|
785
|
+
onWheel,
|
|
786
|
+
children: [
|
|
787
|
+
/* @__PURE__ */ jsx2(
|
|
788
|
+
"button",
|
|
789
|
+
{
|
|
790
|
+
type: "button",
|
|
791
|
+
title: zoomOutLabel,
|
|
792
|
+
"aria-label": zoomOutLabel,
|
|
793
|
+
disabled: !canZoomOut,
|
|
794
|
+
onClick: onZoomOut,
|
|
795
|
+
children: /* @__PURE__ */ jsx2(ZoomOutIcon, { "aria-hidden": "true", className: "size-4" })
|
|
796
|
+
}
|
|
797
|
+
),
|
|
798
|
+
/* @__PURE__ */ jsxs2(
|
|
799
|
+
"span",
|
|
800
|
+
{
|
|
801
|
+
"aria-label": percentLabel,
|
|
802
|
+
role: reportPercentStatus ? "status" : void 0,
|
|
803
|
+
children: [
|
|
804
|
+
percent,
|
|
805
|
+
"%"
|
|
806
|
+
]
|
|
807
|
+
}
|
|
808
|
+
),
|
|
809
|
+
/* @__PURE__ */ jsx2(
|
|
810
|
+
"button",
|
|
811
|
+
{
|
|
812
|
+
type: "button",
|
|
813
|
+
title: resetLabel,
|
|
814
|
+
"aria-label": resetLabel,
|
|
815
|
+
onClick: onReset,
|
|
816
|
+
children: /* @__PURE__ */ jsx2(RotateCcwIcon, { "aria-hidden": "true", className: "size-4" })
|
|
817
|
+
}
|
|
818
|
+
),
|
|
819
|
+
/* @__PURE__ */ jsx2(
|
|
820
|
+
"button",
|
|
821
|
+
{
|
|
822
|
+
type: "button",
|
|
823
|
+
title: zoomInLabel,
|
|
824
|
+
"aria-label": zoomInLabel,
|
|
825
|
+
disabled: !canZoomIn,
|
|
826
|
+
onClick: onZoomIn,
|
|
827
|
+
children: /* @__PURE__ */ jsx2(ZoomInIcon, { "aria-hidden": "true", className: "size-4" })
|
|
828
|
+
}
|
|
829
|
+
)
|
|
830
|
+
]
|
|
831
|
+
}
|
|
832
|
+
);
|
|
833
|
+
}
|
|
613
834
|
function ImageActionButtons({
|
|
614
835
|
copyLabel,
|
|
615
836
|
downloadLabel,
|
|
@@ -626,6 +847,7 @@ function ImageActionButtons({
|
|
|
626
847
|
className: "tsh-zoom-dialog__icon-button",
|
|
627
848
|
size: "icon",
|
|
628
849
|
title: copyLabel,
|
|
850
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
629
851
|
variant: "chrome",
|
|
630
852
|
onClick: (event) => {
|
|
631
853
|
event.preventDefault();
|
|
@@ -642,6 +864,7 @@ function ImageActionButtons({
|
|
|
642
864
|
className: "tsh-zoom-dialog__icon-button",
|
|
643
865
|
size: "icon",
|
|
644
866
|
title: downloadLabel,
|
|
867
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
645
868
|
variant: "chrome",
|
|
646
869
|
onClick: (event) => {
|
|
647
870
|
event.preventDefault();
|
|
@@ -660,6 +883,7 @@ function ImageActionButtons({
|
|
|
660
883
|
type: "button",
|
|
661
884
|
role: itemRole,
|
|
662
885
|
title: copyLabel,
|
|
886
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
663
887
|
onClick: (event) => {
|
|
664
888
|
event.preventDefault();
|
|
665
889
|
event.stopPropagation();
|
|
@@ -677,6 +901,7 @@ function ImageActionButtons({
|
|
|
677
901
|
type: "button",
|
|
678
902
|
role: itemRole,
|
|
679
903
|
title: downloadLabel,
|
|
904
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
680
905
|
onClick: (event) => {
|
|
681
906
|
event.preventDefault();
|
|
682
907
|
event.stopPropagation();
|
|
@@ -690,6 +915,90 @@ function ImageActionButtons({
|
|
|
690
915
|
)
|
|
691
916
|
] });
|
|
692
917
|
}
|
|
918
|
+
function cloneImageWithPreviewZoom(img, zoom, isWheelZooming, onWheel) {
|
|
919
|
+
const props = img.props;
|
|
920
|
+
const style = props.style;
|
|
921
|
+
const mergedStyle = {
|
|
922
|
+
...style,
|
|
923
|
+
transform: resolveZoomedImageTransform(
|
|
924
|
+
style?.transform,
|
|
925
|
+
zoom,
|
|
926
|
+
resolveImagePreviewDimension(style?.width ?? props.width),
|
|
927
|
+
resolveImagePreviewDimension(style?.height ?? props.height)
|
|
928
|
+
),
|
|
929
|
+
transition: isWheelZooming ? "none" : mergeImagePreviewTransition(style?.transition)
|
|
930
|
+
};
|
|
931
|
+
if (style?.transformOrigin !== void 0) {
|
|
932
|
+
mergedStyle.transformOrigin = style.transformOrigin;
|
|
933
|
+
}
|
|
934
|
+
return cloneElement(img, {
|
|
935
|
+
"data-tsh-image-zoom": formatImagePreviewZoom(zoom),
|
|
936
|
+
onWheel: (event) => {
|
|
937
|
+
props.onWheel?.(event);
|
|
938
|
+
onWheel(event);
|
|
939
|
+
},
|
|
940
|
+
style: mergedStyle
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
function resolveWheelZoomDelta(event) {
|
|
944
|
+
return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 2e-3) * (event.ctrlKey ? 10 : 1);
|
|
945
|
+
}
|
|
946
|
+
function resolveZoomedImageTransform(transform, zoom, width, height) {
|
|
947
|
+
const baseTransform = typeof transform === "string" ? transform.trim() : "";
|
|
948
|
+
const zoomTransform = resolveImagePreviewZoomTransform(zoom, width, height);
|
|
949
|
+
if (!baseTransform) {
|
|
950
|
+
return zoomTransform || void 0;
|
|
951
|
+
}
|
|
952
|
+
if (!zoomTransform) {
|
|
953
|
+
return baseTransform;
|
|
954
|
+
}
|
|
955
|
+
return `${baseTransform} ${zoomTransform}`;
|
|
956
|
+
}
|
|
957
|
+
function resolveImagePreviewZoomTransform(zoom, width, height) {
|
|
958
|
+
if (zoom === 1) {
|
|
959
|
+
return "";
|
|
960
|
+
}
|
|
961
|
+
const scale = `scale(${formatImagePreviewZoom(zoom)})`;
|
|
962
|
+
if (width === null || height === null) {
|
|
963
|
+
return scale;
|
|
964
|
+
}
|
|
965
|
+
const halfWidth = formatCssNumber(width / 2);
|
|
966
|
+
const halfHeight = formatCssNumber(height / 2);
|
|
967
|
+
return `translate(${halfWidth}px,${halfHeight}px) ${scale} translate(-${halfWidth}px,-${halfHeight}px)`;
|
|
968
|
+
}
|
|
969
|
+
function resolveImagePreviewDimension(value) {
|
|
970
|
+
if (typeof value === "number") {
|
|
971
|
+
return Number.isFinite(value) && value > 0 ? value : null;
|
|
972
|
+
}
|
|
973
|
+
if (typeof value !== "string") {
|
|
974
|
+
return null;
|
|
975
|
+
}
|
|
976
|
+
const dimension = Number.parseFloat(value);
|
|
977
|
+
return Number.isFinite(dimension) && dimension > 0 ? dimension : null;
|
|
978
|
+
}
|
|
979
|
+
function formatCssNumber(value) {
|
|
980
|
+
return Number(value.toFixed(3)).toString();
|
|
981
|
+
}
|
|
982
|
+
function mergeImagePreviewTransition(transition) {
|
|
983
|
+
const zoomTransition = "transform 120ms ease-out";
|
|
984
|
+
if (typeof transition !== "string" || !transition.trim()) {
|
|
985
|
+
return zoomTransition;
|
|
986
|
+
}
|
|
987
|
+
return transition.includes("transform") ? transition : `${transition}, ${zoomTransition}`;
|
|
988
|
+
}
|
|
989
|
+
function clampSteppedImagePreviewZoom(value) {
|
|
990
|
+
const stepped = Math.round(value / IMAGE_PREVIEW_ZOOM_STEP) * IMAGE_PREVIEW_ZOOM_STEP;
|
|
991
|
+
return clampImagePreviewZoom(stepped);
|
|
992
|
+
}
|
|
993
|
+
function clampImagePreviewZoom(value) {
|
|
994
|
+
return Math.min(
|
|
995
|
+
IMAGE_PREVIEW_ZOOM_MAX,
|
|
996
|
+
Math.max(IMAGE_PREVIEW_ZOOM_MIN, value)
|
|
997
|
+
);
|
|
998
|
+
}
|
|
999
|
+
function formatImagePreviewZoom(value) {
|
|
1000
|
+
return Number(value.toFixed(2)).toString();
|
|
1001
|
+
}
|
|
693
1002
|
function downloadImage(src, name) {
|
|
694
1003
|
const link = document.createElement("a");
|
|
695
1004
|
link.href = src;
|
|
@@ -2826,6 +3135,8 @@ var styles = {
|
|
|
2826
3135
|
userMessageFlow: "agent-gui-conversation__user-message-flow",
|
|
2827
3136
|
assistantMessageFlow: "agent-gui-conversation__assistant-message-flow",
|
|
2828
3137
|
messageGroup: "agent-gui-conversation__message-group",
|
|
3138
|
+
messageFooter: "agent-gui-conversation__message-footer",
|
|
3139
|
+
messageTimestamp: "agent-gui-conversation__message-timestamp",
|
|
2829
3140
|
messageCopyButton: "agent-gui-conversation__message-copy-button",
|
|
2830
3141
|
userMessageBubble: "agent-gui-conversation__user-message-bubble",
|
|
2831
3142
|
assistantMarkdown: "agent-gui-conversation__assistant-markdown"
|
|
@@ -3251,6 +3562,9 @@ function clamp(value, min, max) {
|
|
|
3251
3562
|
export {
|
|
3252
3563
|
cn,
|
|
3253
3564
|
extractAgentMcpToolTarget,
|
|
3565
|
+
isExitPlanSwitchModeInput,
|
|
3566
|
+
extractExitPlanModeOptions,
|
|
3567
|
+
extractExitPlanKeepPlanningOptionId,
|
|
3254
3568
|
normalizeAskUserQuestions,
|
|
3255
3569
|
resolveWorkspaceFilePathCandidate,
|
|
3256
3570
|
resolveWorkspaceFileLinkAction,
|
|
@@ -3261,4 +3575,4 @@ export {
|
|
|
3261
3575
|
CustomScrollArea,
|
|
3262
3576
|
MessageSquareMoreIcon
|
|
3263
3577
|
};
|
|
3264
|
-
//# sourceMappingURL=chunk-
|
|
3578
|
+
//# sourceMappingURL=chunk-6YN7HQL5.js.map
|