@tutti-os/agent-gui 0.0.46 → 0.0.47

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.
Files changed (60) hide show
  1. package/dist/{AgentMentionSearchController-D5ks45fN.d.ts → AgentMentionSearchController-CExFPobz.d.ts} +1 -1
  2. package/dist/AgentMessageMarkdown-DeYPURtF.d.ts +7 -0
  3. package/dist/agent-conversation/index.d.ts +4 -3
  4. package/dist/agent-conversation/index.js +8 -8
  5. package/dist/agent-message-center/index.d.ts +1 -1
  6. package/dist/agent-message-center/index.js +9 -9
  7. package/dist/{agentConversationVM-1QgRwvwZ.d.ts → agentConversationVM-BTMtRteS.d.ts} +14 -0
  8. package/dist/{AgentMessageMarkdown-Cts0dAIm.d.ts → agentGuiNodeTypes-B5Y6yDKy.d.ts} +43 -9
  9. package/dist/app/renderer/agentactivity.css +92 -9
  10. package/dist/{chunk-FRG36S6N.js → chunk-2FOBSURO.js} +5 -5
  11. package/dist/chunk-2FOBSURO.js.map +1 -0
  12. package/dist/{chunk-AMNXH4DJ.js → chunk-2RYZ4EBF.js} +2 -2
  13. package/dist/{chunk-EIC7XS3C.js → chunk-5QTC2L52.js} +2 -2
  14. package/dist/{chunk-ZJ7OSY4T.js → chunk-7NCWSH7U.js} +9 -9
  15. package/dist/{chunk-ZJ7OSY4T.js.map → chunk-7NCWSH7U.js.map} +1 -1
  16. package/dist/{chunk-62QOR3TC.js → chunk-HCS3HUUX.js} +5 -5
  17. package/dist/{chunk-OL54R6OL.js → chunk-J3SJZMI5.js} +2 -2
  18. package/dist/{chunk-VFQR7AZI.js → chunk-KACBTC7Y.js} +25 -3
  19. package/dist/chunk-KACBTC7Y.js.map +1 -0
  20. package/dist/{chunk-FJG2EH4V.js → chunk-KUCWRSXU.js} +2 -2
  21. package/dist/{chunk-D6IYEVDT.js → chunk-MCH35MAX.js} +2 -2
  22. package/dist/{chunk-NZ2BGOJU.js → chunk-Q4X6Q4E6.js} +2 -2
  23. package/dist/{chunk-EU7RWKHE.js → chunk-R6GOICRO.js} +5 -5
  24. package/dist/chunk-SD56WDSC.js +359 -0
  25. package/dist/chunk-SD56WDSC.js.map +1 -0
  26. package/dist/{chunk-TXXWUG2J.js → chunk-VE6JY2TH.js} +2 -1
  27. package/dist/{chunk-TXXWUG2J.js.map → chunk-VE6JY2TH.js.map} +1 -1
  28. package/dist/{chunk-QT45WUPQ.js → chunk-XJXSR5XI.js} +244 -21
  29. package/dist/chunk-XJXSR5XI.js.map +1 -0
  30. package/dist/{chunk-BAQTM6VS.js → chunk-ZAF4IVUT.js} +848 -102
  31. package/dist/chunk-ZAF4IVUT.js.map +1 -0
  32. package/dist/context-mention-palette/index.d.ts +3 -3
  33. package/dist/context-mention-palette/index.js +9 -9
  34. package/dist/i18n/index.d.ts +24 -2
  35. package/dist/i18n/index.js +2 -2
  36. package/dist/index.d.ts +22 -6
  37. package/dist/index.js +847 -812
  38. package/dist/index.js.map +1 -1
  39. package/dist/plan-decision-ops.d.ts +1 -1
  40. package/dist/queued-prompt-runtime.d.ts +97 -0
  41. package/dist/queued-prompt-runtime.js +9 -0
  42. package/dist/queued-prompt-runtime.js.map +1 -0
  43. package/dist/workbench/contribution.js +3 -3
  44. package/dist/workbench/index.js +9 -9
  45. package/dist/workbench/launch.js +2 -2
  46. package/dist/workbench/sessionTitle.js +3 -3
  47. package/dist/workspace-agent-generated-files.js +3 -3
  48. package/package.json +21 -14
  49. package/dist/chunk-BAQTM6VS.js.map +0 -1
  50. package/dist/chunk-FRG36S6N.js.map +0 -1
  51. package/dist/chunk-QT45WUPQ.js.map +0 -1
  52. package/dist/chunk-VFQR7AZI.js.map +0 -1
  53. /package/dist/{chunk-AMNXH4DJ.js.map → chunk-2RYZ4EBF.js.map} +0 -0
  54. /package/dist/{chunk-EIC7XS3C.js.map → chunk-5QTC2L52.js.map} +0 -0
  55. /package/dist/{chunk-62QOR3TC.js.map → chunk-HCS3HUUX.js.map} +0 -0
  56. /package/dist/{chunk-OL54R6OL.js.map → chunk-J3SJZMI5.js.map} +0 -0
  57. /package/dist/{chunk-FJG2EH4V.js.map → chunk-KUCWRSXU.js.map} +0 -0
  58. /package/dist/{chunk-D6IYEVDT.js.map → chunk-MCH35MAX.js.map} +0 -0
  59. /package/dist/{chunk-NZ2BGOJU.js.map → chunk-Q4X6Q4E6.js.map} +0 -0
  60. /package/dist/{chunk-EU7RWKHE.js.map → chunk-R6GOICRO.js.map} +0 -0
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  getOptionalAgentHostApi,
3
3
  useOptionalAgentHostApi
4
- } from "./chunk-TXXWUG2J.js";
5
- import {
6
- translate,
7
- useTranslation
8
- } from "./chunk-EIC7XS3C.js";
4
+ } from "./chunk-VE6JY2TH.js";
9
5
  import {
10
6
  resolveAgentWorkspaceFileVisualKind
11
7
  } from "./chunk-PJP5BUU6.js";
8
+ import {
9
+ translate,
10
+ useTranslation
11
+ } from "./chunk-5QTC2L52.js";
12
12
 
13
13
  // shared/agentMcpToolTarget.ts
14
14
  function extractAgentMcpToolTarget({
@@ -215,6 +215,7 @@ import {
215
215
  DownloadIcon,
216
216
  RestoreIcon
217
217
  } from "@tutti-os/ui-system";
218
+ import { RotateCcwIcon, ZoomInIcon, ZoomOutIcon } from "lucide-react";
218
219
  import Zoom from "react-medium-image-zoom";
219
220
 
220
221
  // app/renderer/lib/utils.ts
@@ -354,6 +355,9 @@ function ConversationImageContextMenu({
354
355
 
355
356
  // app/renderer/components/ZoomableImage.tsx
356
357
  import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
358
+ var IMAGE_PREVIEW_ZOOM_MIN = 0.5;
359
+ var IMAGE_PREVIEW_ZOOM_MAX = 3;
360
+ var IMAGE_PREVIEW_ZOOM_STEP = 0.25;
357
361
  function ZoomableImage({
358
362
  alt,
359
363
  className,
@@ -369,6 +373,11 @@ function ZoomableImage({
369
373
  const hasImageActions = Boolean(actionSource && downloadName !== void 0);
370
374
  const [contextMenuPosition, setContextMenuPosition] = useState2(null);
371
375
  const [copyStatus, setCopyStatus] = useState2(null);
376
+ const [imagePreviewZoom, setImagePreviewZoom] = useState2(1);
377
+ const [isWheelZooming, setIsWheelZooming] = useState2(false);
378
+ const imagePreviewZoomPercent = Math.round(imagePreviewZoom * 100);
379
+ const canZoomOut = imagePreviewZoom > IMAGE_PREVIEW_ZOOM_MIN;
380
+ const canZoomIn = imagePreviewZoom < IMAGE_PREVIEW_ZOOM_MAX;
372
381
  const closeContextMenu = useCallback2(() => {
373
382
  setContextMenuPosition(null);
374
383
  }, []);
@@ -445,6 +454,36 @@ function ZoomableImage({
445
454
  resolveImageDownloadName(downloadName, actionSource, alt)
446
455
  );
447
456
  }, [actionSource, alt, closeContextMenu, downloadName]);
457
+ const zoomOutPreviewImage = useCallback2(() => {
458
+ setIsWheelZooming(false);
459
+ setImagePreviewZoom(
460
+ (value) => clampSteppedImagePreviewZoom(value - IMAGE_PREVIEW_ZOOM_STEP)
461
+ );
462
+ }, []);
463
+ const zoomInPreviewImage = useCallback2(() => {
464
+ setIsWheelZooming(false);
465
+ setImagePreviewZoom(
466
+ (value) => clampSteppedImagePreviewZoom(value + IMAGE_PREVIEW_ZOOM_STEP)
467
+ );
468
+ }, []);
469
+ const resetPreviewImageZoom = useCallback2(() => {
470
+ setIsWheelZooming(false);
471
+ setImagePreviewZoom(1);
472
+ }, []);
473
+ const handlePreviewImageWheel = useCallback2(
474
+ (event) => {
475
+ event.preventDefault();
476
+ event.stopPropagation();
477
+ if (event.deltaY === 0) {
478
+ return;
479
+ }
480
+ setIsWheelZooming(true);
481
+ setImagePreviewZoom(
482
+ (value) => clampImagePreviewZoom(value * Math.pow(2, resolveWheelZoomDelta(event)))
483
+ );
484
+ },
485
+ []
486
+ );
448
487
  const actionButtons = hasImageActions ? /* @__PURE__ */ jsx2(
449
488
  ImageActionButtons,
450
489
  {
@@ -456,30 +495,55 @@ function ZoomableImage({
456
495
  ) : null;
457
496
  const renderZoomContent = ({
458
497
  buttonUnzoom,
459
- img
498
+ img,
499
+ modalState
460
500
  }) => {
501
+ const typedButtonUnzoom = buttonUnzoom;
502
+ const buttonUnzoomProps = typedButtonUnzoom.props;
461
503
  const zoomSrc = isValidElement(img) && typeof img.props.src === "string" ? img.props.src : null;
504
+ const isUnzooming = modalState === "UNLOADING";
505
+ const effectiveImagePreviewZoom = isUnzooming ? 1 : imagePreviewZoom;
506
+ const renderedImage = img ? cloneImageWithPreviewZoom(
507
+ img,
508
+ effectiveImagePreviewZoom,
509
+ isUnzooming ? false : isWheelZooming,
510
+ handlePreviewImageWheel
511
+ ) : null;
462
512
  return /* @__PURE__ */ jsxs2(Fragment, { children: [
463
- actionButtons && img && zoomSrc ? cloneElement(img, {
464
- onContextMenu: handleContextMenu
465
- }) : !actionButtons && img && zoomSrc ? /* @__PURE__ */ jsx2(
513
+ actionButtons && renderedImage && zoomSrc ? cloneElement(
514
+ renderedImage,
515
+ {
516
+ onContextMenu: handleContextMenu
517
+ }
518
+ ) : !actionButtons && renderedImage && zoomSrc ? /* @__PURE__ */ jsx2(
466
519
  ConversationImageContextMenu,
467
520
  {
468
521
  src: zoomSrc,
469
522
  asChild: true,
470
523
  contentStyle: { zIndex: "var(--z-dialog-popover)" },
471
- children: img
524
+ children: renderedImage
472
525
  }
473
- ) : img,
474
- actionButtons ? /* @__PURE__ */ jsx2("div", { className: "tsh-zoom-dialog__image-actions nodrag tsh-desktop-no-drag", children: /* @__PURE__ */ jsx2(
475
- ImageActionButtons,
526
+ ) : renderedImage,
527
+ /* @__PURE__ */ jsx2(
528
+ ImagePreviewZoomControls,
476
529
  {
477
- copyLabel: t("common.copyImage"),
478
- downloadLabel: t("common.downloadImage"),
479
- onCopy: handleCopyImageAction,
480
- onDownload: handleDownloadImage
530
+ canZoomIn,
531
+ canZoomOut,
532
+ percent: imagePreviewZoomPercent,
533
+ percentLabel: t("common.imageZoomPercent", {
534
+ percent: imagePreviewZoomPercent
535
+ }),
536
+ reportPercentStatus: !copyStatus,
537
+ resetLabel: t("common.resetImageZoom"),
538
+ zoomInLabel: t("common.zoomInImage"),
539
+ zoomOutLabel: t("common.zoomOutImage"),
540
+ onReset: resetPreviewImageZoom,
541
+ onZoomIn: zoomInPreviewImage,
542
+ onZoomOut: zoomOutPreviewImage,
543
+ onWheel: handlePreviewImageWheel
481
544
  }
482
- ) }) : null,
545
+ ),
546
+ actionButtons ? /* @__PURE__ */ jsx2("div", { className: "tsh-zoom-dialog__image-actions nodrag tsh-desktop-no-drag", children: actionButtons }) : null,
483
547
  contextMenuPosition?.inZoomDialog && actionButtons ? /* @__PURE__ */ jsx2(
484
548
  "div",
485
549
  {
@@ -510,8 +574,14 @@ function ZoomableImage({
510
574
  size: "icon",
511
575
  variant: "chrome",
512
576
  children: cloneElement(
513
- buttonUnzoom,
514
- void 0,
577
+ typedButtonUnzoom,
578
+ {
579
+ onClick: (event) => {
580
+ setIsWheelZooming(false);
581
+ setImagePreviewZoom(1);
582
+ buttonUnzoomProps.onClick?.(event);
583
+ }
584
+ },
515
585
  /* @__PURE__ */ jsx2(RestoreIcon, { "aria-hidden": "true", className: "size-4" })
516
586
  )
517
587
  }
@@ -610,6 +680,73 @@ function ImageCopyStatusToast({
610
680
  )
611
681
  ] });
612
682
  }
683
+ function ImagePreviewZoomControls({
684
+ canZoomIn,
685
+ canZoomOut,
686
+ percent,
687
+ percentLabel,
688
+ reportPercentStatus,
689
+ resetLabel,
690
+ zoomInLabel,
691
+ zoomOutLabel,
692
+ onReset,
693
+ onZoomIn,
694
+ onZoomOut,
695
+ onWheel
696
+ }) {
697
+ return /* @__PURE__ */ jsxs2(
698
+ "div",
699
+ {
700
+ className: "tsh-zoom-dialog__zoom-controls nodrag tsh-desktop-no-drag",
701
+ onWheel,
702
+ children: [
703
+ /* @__PURE__ */ jsx2(
704
+ "button",
705
+ {
706
+ type: "button",
707
+ title: zoomOutLabel,
708
+ "aria-label": zoomOutLabel,
709
+ disabled: !canZoomOut,
710
+ onClick: onZoomOut,
711
+ children: /* @__PURE__ */ jsx2(ZoomOutIcon, { "aria-hidden": "true", className: "size-4" })
712
+ }
713
+ ),
714
+ /* @__PURE__ */ jsxs2(
715
+ "span",
716
+ {
717
+ "aria-label": percentLabel,
718
+ role: reportPercentStatus ? "status" : void 0,
719
+ children: [
720
+ percent,
721
+ "%"
722
+ ]
723
+ }
724
+ ),
725
+ /* @__PURE__ */ jsx2(
726
+ "button",
727
+ {
728
+ type: "button",
729
+ title: resetLabel,
730
+ "aria-label": resetLabel,
731
+ onClick: onReset,
732
+ children: /* @__PURE__ */ jsx2(RotateCcwIcon, { "aria-hidden": "true", className: "size-4" })
733
+ }
734
+ ),
735
+ /* @__PURE__ */ jsx2(
736
+ "button",
737
+ {
738
+ type: "button",
739
+ title: zoomInLabel,
740
+ "aria-label": zoomInLabel,
741
+ disabled: !canZoomIn,
742
+ onClick: onZoomIn,
743
+ children: /* @__PURE__ */ jsx2(ZoomInIcon, { "aria-hidden": "true", className: "size-4" })
744
+ }
745
+ )
746
+ ]
747
+ }
748
+ );
749
+ }
613
750
  function ImageActionButtons({
614
751
  copyLabel,
615
752
  downloadLabel,
@@ -690,6 +827,90 @@ function ImageActionButtons({
690
827
  )
691
828
  ] });
692
829
  }
830
+ function cloneImageWithPreviewZoom(img, zoom, isWheelZooming, onWheel) {
831
+ const props = img.props;
832
+ const style = props.style;
833
+ const mergedStyle = {
834
+ ...style,
835
+ transform: resolveZoomedImageTransform(
836
+ style?.transform,
837
+ zoom,
838
+ resolveImagePreviewDimension(style?.width ?? props.width),
839
+ resolveImagePreviewDimension(style?.height ?? props.height)
840
+ ),
841
+ transition: isWheelZooming ? "none" : mergeImagePreviewTransition(style?.transition)
842
+ };
843
+ if (style?.transformOrigin !== void 0) {
844
+ mergedStyle.transformOrigin = style.transformOrigin;
845
+ }
846
+ return cloneElement(img, {
847
+ "data-tsh-image-zoom": formatImagePreviewZoom(zoom),
848
+ onWheel: (event) => {
849
+ props.onWheel?.(event);
850
+ onWheel(event);
851
+ },
852
+ style: mergedStyle
853
+ });
854
+ }
855
+ function resolveWheelZoomDelta(event) {
856
+ return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 2e-3) * (event.ctrlKey ? 10 : 1);
857
+ }
858
+ function resolveZoomedImageTransform(transform, zoom, width, height) {
859
+ const baseTransform = typeof transform === "string" ? transform.trim() : "";
860
+ const zoomTransform = resolveImagePreviewZoomTransform(zoom, width, height);
861
+ if (!baseTransform) {
862
+ return zoomTransform || void 0;
863
+ }
864
+ if (!zoomTransform) {
865
+ return baseTransform;
866
+ }
867
+ return `${baseTransform} ${zoomTransform}`;
868
+ }
869
+ function resolveImagePreviewZoomTransform(zoom, width, height) {
870
+ if (zoom === 1) {
871
+ return "";
872
+ }
873
+ const scale = `scale(${formatImagePreviewZoom(zoom)})`;
874
+ if (width === null || height === null) {
875
+ return scale;
876
+ }
877
+ const halfWidth = formatCssNumber(width / 2);
878
+ const halfHeight = formatCssNumber(height / 2);
879
+ return `translate(${halfWidth}px,${halfHeight}px) ${scale} translate(-${halfWidth}px,-${halfHeight}px)`;
880
+ }
881
+ function resolveImagePreviewDimension(value) {
882
+ if (typeof value === "number") {
883
+ return Number.isFinite(value) && value > 0 ? value : null;
884
+ }
885
+ if (typeof value !== "string") {
886
+ return null;
887
+ }
888
+ const dimension = Number.parseFloat(value);
889
+ return Number.isFinite(dimension) && dimension > 0 ? dimension : null;
890
+ }
891
+ function formatCssNumber(value) {
892
+ return Number(value.toFixed(3)).toString();
893
+ }
894
+ function mergeImagePreviewTransition(transition) {
895
+ const zoomTransition = "transform 120ms ease-out";
896
+ if (typeof transition !== "string" || !transition.trim()) {
897
+ return zoomTransition;
898
+ }
899
+ return transition.includes("transform") ? transition : `${transition}, ${zoomTransition}`;
900
+ }
901
+ function clampSteppedImagePreviewZoom(value) {
902
+ const stepped = Math.round(value / IMAGE_PREVIEW_ZOOM_STEP) * IMAGE_PREVIEW_ZOOM_STEP;
903
+ return clampImagePreviewZoom(stepped);
904
+ }
905
+ function clampImagePreviewZoom(value) {
906
+ return Math.min(
907
+ IMAGE_PREVIEW_ZOOM_MAX,
908
+ Math.max(IMAGE_PREVIEW_ZOOM_MIN, value)
909
+ );
910
+ }
911
+ function formatImagePreviewZoom(value) {
912
+ return Number(value.toFixed(2)).toString();
913
+ }
693
914
  function downloadImage(src, name) {
694
915
  const link = document.createElement("a");
695
916
  link.href = src;
@@ -2826,6 +3047,8 @@ var styles = {
2826
3047
  userMessageFlow: "agent-gui-conversation__user-message-flow",
2827
3048
  assistantMessageFlow: "agent-gui-conversation__assistant-message-flow",
2828
3049
  messageGroup: "agent-gui-conversation__message-group",
3050
+ messageFooter: "agent-gui-conversation__message-footer",
3051
+ messageTimestamp: "agent-gui-conversation__message-timestamp",
2829
3052
  messageCopyButton: "agent-gui-conversation__message-copy-button",
2830
3053
  userMessageBubble: "agent-gui-conversation__user-message-bubble",
2831
3054
  assistantMarkdown: "agent-gui-conversation__assistant-markdown"
@@ -3261,4 +3484,4 @@ export {
3261
3484
  CustomScrollArea,
3262
3485
  MessageSquareMoreIcon
3263
3486
  };
3264
- //# sourceMappingURL=chunk-QT45WUPQ.js.map
3487
+ //# sourceMappingURL=chunk-XJXSR5XI.js.map