@tutti-os/agent-gui 0.0.22 → 0.0.24

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 (30) hide show
  1. package/dist/AgentMessageMarkdown-DQL8udfP.d.ts +640 -0
  2. package/dist/agent-conversation/index.d.ts +5 -14
  3. package/dist/agent-conversation/index.js +3 -3
  4. package/dist/agent-message-center/index.d.ts +2 -2
  5. package/dist/agent-message-center/index.js +3 -3
  6. package/dist/{agentConversationVM-BVe64P2E.d.ts → agentConversationVM-BvlmCNOm.d.ts} +3 -2
  7. package/dist/app/renderer/agentactivity.css +21 -28
  8. package/dist/{chunk-64FJGJ3F.js → chunk-4MOHKNXA.js} +3 -3
  9. package/dist/{chunk-KRKC3XXB.js → chunk-7JW4OAKS.js} +94 -14
  10. package/dist/chunk-7JW4OAKS.js.map +1 -0
  11. package/dist/{chunk-6TRWLMRE.js → chunk-BUBD5E4F.js} +125 -44
  12. package/dist/chunk-BUBD5E4F.js.map +1 -0
  13. package/dist/{chunk-222YHU5Z.js → chunk-CCI6EK5W.js} +1 -1
  14. package/dist/chunk-CCI6EK5W.js.map +1 -0
  15. package/dist/{chunk-UUGCUPYW.js → chunk-Q6QE7JNG.js} +15 -14
  16. package/dist/{chunk-UUGCUPYW.js.map → chunk-Q6QE7JNG.js.map} +1 -1
  17. package/dist/context-mention-palette/index.d.ts +1 -3
  18. package/dist/context-mention-palette/index.js +2 -2
  19. package/dist/index.d.ts +29 -418
  20. package/dist/index.js +138 -124
  21. package/dist/index.js.map +1 -1
  22. package/dist/plan-decision-ops.d.ts +2 -2
  23. package/dist/workspace-agent-generated-files.d.ts +1 -1
  24. package/dist/{workspaceAgentActivityListViewModel-BK_J3aNX.d.ts → workspaceAgentActivityListViewModel-jRF8cP37.d.ts} +2 -2
  25. package/package.json +12 -12
  26. package/dist/AgentMessageMarkdown-DeYPURtF.d.ts +0 -7
  27. package/dist/chunk-222YHU5Z.js.map +0 -1
  28. package/dist/chunk-6TRWLMRE.js.map +0 -1
  29. package/dist/chunk-KRKC3XXB.js.map +0 -1
  30. /package/dist/{chunk-64FJGJ3F.js.map → chunk-4MOHKNXA.js.map} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  approvalOptionDisplayLabel,
4
4
  getPromptToolDetails,
5
5
  isPromptRequestIdTitle
6
- } from "../chunk-64FJGJ3F.js";
6
+ } from "../chunk-4MOHKNXA.js";
7
7
  import {
8
8
  PLAN_IMPLEMENTATION_ACTION_IMPLEMENT,
9
9
  PLAN_IMPLEMENTATION_PROMPT,
@@ -16,7 +16,7 @@ import {
16
16
  cn,
17
17
  extractAgentMcpToolTarget,
18
18
  normalizeAskUserQuestions
19
- } from "../chunk-6TRWLMRE.js";
19
+ } from "../chunk-BUBD5E4F.js";
20
20
  import {
21
21
  managedAgentRoundedIconUrl,
22
22
  userAvatarPlaceholderUrl,
@@ -26,7 +26,7 @@ import "../chunk-MTFSQWZ6.js";
26
26
  import {
27
27
  resolveWorkspaceAgentSessionSortTimeUnixMs
28
28
  } from "../chunk-IBIMGLCD.js";
29
- import "../chunk-222YHU5Z.js";
29
+ import "../chunk-CCI6EK5W.js";
30
30
  import {
31
31
  workspaceAgentProviderLabel
32
32
  } from "../chunk-TYGL25EL.js";
@@ -1,4 +1,4 @@
1
- import { W as WorkspaceAgentActivityCard, n as WorkspaceAgentActivitySession, T as ToolCallStatusKind, p as WorkspaceAgentActivityTimelineItem } from './workspaceAgentActivityListViewModel-BK_J3aNX.js';
1
+ import { W as WorkspaceAgentActivityCard, n as WorkspaceAgentActivitySession, T as ToolCallStatusKind, q as WorkspaceAgentActivityTimelineItem } from './workspaceAgentActivityListViewModel-jRF8cP37.js';
2
2
 
3
3
  interface WorkspaceAgentSessionDetailMessage {
4
4
  id: string;
@@ -172,6 +172,7 @@ interface AgentMessageImageVM {
172
172
  mimeType: string;
173
173
  name?: string | null;
174
174
  data?: string | null;
175
+ path?: string | null;
175
176
  }
176
177
  interface AgentThinkingContentVM {
177
178
  kind: "thinking-content";
@@ -339,4 +340,4 @@ interface AgentConversationVM {
339
340
  pendingInteractivePrompt: AgentConversationPendingInteractivePromptVM | null;
340
341
  }
341
342
 
342
- export { type AgentConversationPromptVM as A, type BuildWorkspaceAgentSessionDetailInput as B, type WorkspaceAgentSessionDetailViewModel as W, type AgentConversationVM as a, buildWorkspaceAgentSessionDetailViewModel as b };
343
+ export { type AgentApprovalItemVM as A, type BuildWorkspaceAgentSessionDetailInput as B, type WorkspaceAgentSessionDetailViewModel as W, type AgentAskUserQuestionVM as a, type AgentConversationPromptVM as b, type AgentConversationVM as c, buildWorkspaceAgentSessionDetailViewModel as d };
@@ -623,7 +623,7 @@ aside.workspace-agents-status-panel
623
623
 
624
624
  .workspace-agents-status-panel__content--detail {
625
625
  gap: 0;
626
- padding-inline: 24px;
626
+ padding-inline: 28px;
627
627
  }
628
628
 
629
629
  .workspace-agents-status-panel__content--detail-overlay {
@@ -2292,7 +2292,7 @@ aside.workspace-agents-status-panel
2292
2292
  justify-self: stretch;
2293
2293
  width: auto;
2294
2294
  gap: 0;
2295
- margin: 0 24px;
2295
+ margin: 0 8px;
2296
2296
  padding: 0;
2297
2297
  background: transparent;
2298
2298
  }
@@ -2317,11 +2317,16 @@ aside.workspace-agents-status-panel
2317
2317
  }
2318
2318
 
2319
2319
  .agent-gui-chrome__session-chrome:has(+ .agent-gui-chrome__session-chrome) {
2320
- margin-right: 36px;
2321
- margin-left: 36px;
2320
+ margin-right: 16px;
2321
+ margin-left: 16px;
2322
2322
  }
2323
2323
 
2324
2324
  .agent-gui-node__composer-input-group > .agent-gui-chrome__session-chrome {
2325
+ margin-right: 8px;
2326
+ margin-left: 8px;
2327
+ }
2328
+
2329
+ .agent-gui-node__composer-input-group-hero > .agent-gui-chrome__session-chrome {
2325
2330
  margin-right: 24px;
2326
2331
  margin-left: 24px;
2327
2332
  }
@@ -2332,8 +2337,8 @@ aside.workspace-agents-status-panel
2332
2337
  .agent-gui-node__composer-input-group
2333
2338
  > .agent-gui-chrome__session-chrome
2334
2339
  ) {
2335
- margin-right: 36px;
2336
- margin-left: 36px;
2340
+ margin-right: 16px;
2341
+ margin-left: 16px;
2337
2342
  }
2338
2343
 
2339
2344
  .agent-gui-node__bottom-dock
@@ -2345,8 +2350,8 @@ aside.workspace-agents-status-panel
2345
2350
  + .agent-gui-node__composer
2346
2351
  .agent-gui-node__composer-input-group
2347
2352
  > .agent-gui-chrome__session-chrome {
2348
- margin-right: 24px;
2349
- margin-left: 24px;
2353
+ margin-right: 8px;
2354
+ margin-left: 8px;
2350
2355
  }
2351
2356
 
2352
2357
  .agent-gui-chrome__card {
@@ -2520,23 +2525,6 @@ aside.workspace-agents-status-panel
2520
2525
  cursor: pointer;
2521
2526
  }
2522
2527
 
2523
- .agent-gui-node__empty-hero-body
2524
- > .agent-gui-chrome__session-chrome
2525
- > .agent-gui-chrome__card--danger,
2526
- .agent-gui-node__composer-input-group
2527
- > .agent-gui-chrome__session-chrome
2528
- > .agent-gui-chrome__card--danger,
2529
- .agent-gui-node__bottom-dock
2530
- > .agent-gui-chrome__session-chrome:has(+ .agent-gui-node__composer)
2531
- > .agent-gui-chrome__card--danger {
2532
- border-bottom: 1px solid
2533
- color-mix(
2534
- in srgb,
2535
- var(--status-danger, var(--state-danger)) 16%,
2536
- transparent
2537
- );
2538
- }
2539
-
2540
2528
  .agent-gui-chrome__card[data-has-inline-actions="true"] {
2541
2529
  padding-right: 4px;
2542
2530
  }
@@ -3818,7 +3806,7 @@ aside.workspace-agents-status-panel
3818
3806
  --agent-conversation-text: var(--text-primary);
3819
3807
  --agent-conversation-user-text: var(--text-primary);
3820
3808
  --agent-conversation-user-bg: var(--agent-gui-surface-muted);
3821
- --agent-gui-detail-padding-x: 24px;
3809
+ --agent-gui-detail-padding-x: 28px;
3822
3810
  --agent-gui-detail-flow-max-width: 1280px;
3823
3811
  width: 100%;
3824
3812
  height: 100%;
@@ -4427,6 +4415,11 @@ button.agent-gui-node__conversation-section-toggle:hover
4427
4415
  pointer-events: auto;
4428
4416
  }
4429
4417
 
4418
+ .agent-gui-node__conversation-section[data-kind="conversations"]
4419
+ .agent-gui-node__conversation-section-actions {
4420
+ min-width: 0;
4421
+ }
4422
+
4430
4423
  .agent-gui-node__conversation-section-action-tooltip-wrap {
4431
4424
  position: relative;
4432
4425
  display: inline-flex;
@@ -5153,8 +5146,8 @@ button.agent-gui-node__conversation-section-toggle:hover
5153
5146
  }
5154
5147
 
5155
5148
  .workspace-agents-status-panel__conversation-timeline.agent-gui-node__timeline {
5156
- padding-right: 24px;
5157
- padding-left: 24px;
5149
+ padding-right: 28px;
5150
+ padding-left: 28px;
5158
5151
  }
5159
5152
 
5160
5153
  .agent-gui-node__timeline-with-composer {
@@ -7,14 +7,14 @@ import {
7
7
  AgentGUIConversation_styles_default,
8
8
  MessageSquareMoreIcon,
9
9
  extractAgentMcpToolTarget
10
- } from "./chunk-6TRWLMRE.js";
10
+ } from "./chunk-BUBD5E4F.js";
11
11
  import {
12
12
  Spinner
13
13
  } from "./chunk-F7XLV7M3.js";
14
14
  import {
15
15
  getOptionalAgentHostApi,
16
16
  useOptionalAgentHostApi
17
- } from "./chunk-222YHU5Z.js";
17
+ } from "./chunk-CCI6EK5W.js";
18
18
  import {
19
19
  translate
20
20
  } from "./chunk-GLDKFIWM.js";
@@ -1120,4 +1120,4 @@ export {
1120
1120
  isPromptRequestIdTitle,
1121
1121
  AgentInteractivePromptSurface
1122
1122
  };
1123
- //# sourceMappingURL=chunk-64FJGJ3F.js.map
1123
+ //# sourceMappingURL=chunk-4MOHKNXA.js.map
@@ -10,7 +10,7 @@ import {
10
10
  resolveWorkspaceFileLinkAction,
11
11
  resolveWorkspaceFilePathCandidate,
12
12
  resolveWorkspaceLinkAction
13
- } from "./chunk-6TRWLMRE.js";
13
+ } from "./chunk-BUBD5E4F.js";
14
14
  import {
15
15
  attrsToMentionItem,
16
16
  createAgentFileMentionExtension,
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  getOptionalAgentActivityRuntime,
26
26
  useOptionalAgentHostApi
27
- } from "./chunk-222YHU5Z.js";
27
+ } from "./chunk-CCI6EK5W.js";
28
28
  import {
29
29
  workspaceAgentProviderLabel
30
30
  } from "./chunk-TYGL25EL.js";
@@ -4368,13 +4368,14 @@ function projectUserMessageContentParts(message, turnId, workspaceId) {
4368
4368
  body: "",
4369
4369
  contentKind: "image-grid",
4370
4370
  images: imageBlocks.map((image, index) => ({
4371
- id: image.attachmentId || `${message.id}:image:0:${index}`,
4371
+ id: image.path || image.attachmentId || `${message.id}:image:0:${index}`,
4372
4372
  workspaceId: image.workspaceId,
4373
4373
  agentSessionId: image.agentSessionId,
4374
4374
  attachmentId: image.attachmentId,
4375
4375
  mimeType: image.mimeType,
4376
4376
  name: image.name,
4377
- data: image.data
4377
+ data: image.data,
4378
+ path: image.path
4378
4379
  })),
4379
4380
  occurredAtUnixMs: message.occurredAtUnixMs ?? null,
4380
4381
  sourceTimelineItems: message.sourceTimelineItems
@@ -4448,7 +4449,8 @@ function userPromptContentBlocks(message, fallbackWorkspaceId) {
4448
4449
  attachmentId: typeof block.attachmentId === "string" && block.attachmentId.trim() ? block.attachmentId.trim() : null,
4449
4450
  mimeType,
4450
4451
  name: typeof block.name === "string" && block.name.trim() ? block.name.trim() : null,
4451
- data: typeof block.data === "string" && block.data.trim() ? block.data.trim() : null
4452
+ data: typeof block.data === "string" && block.data.trim() ? block.data.trim() : null,
4453
+ path: typeof block.path === "string" && block.path.trim() ? block.path.trim() : null
4452
4454
  }
4453
4455
  ];
4454
4456
  });
@@ -4661,7 +4663,7 @@ import {
4661
4663
  useMemo,
4662
4664
  useState as useState5
4663
4665
  } from "react";
4664
- import { ChevronRight as ChevronRight3 } from "lucide-react";
4666
+ import { ChevronRight as ChevronRight3, LoaderCircle } from "lucide-react";
4665
4667
  import { CheckIcon, CopyIcon } from "@tutti-os/ui-system/icons";
4666
4668
 
4667
4669
  // app/renderer/components/ui/button.tsx
@@ -6308,6 +6310,7 @@ var CanvasNodeGhostIconButton = forwardRef3(function CanvasNodeGhostIconButton2(
6308
6310
  // shared/agentConversation/components/AgentMessageBlock.tsx
6309
6311
  import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
6310
6312
  var MESSAGE_COPY_FEEDBACK_MS = 1400;
6313
+ var CONTEXT_COMPACTION_NOTICE_TITLE = "Context compacted.";
6311
6314
  function AgentMessageBlock({
6312
6315
  workspaceRoot,
6313
6316
  basePath,
@@ -6519,7 +6522,7 @@ function AgentUserImageGrid({
6519
6522
  }) {
6520
6523
  "use memo";
6521
6524
  const images = message.images ?? [];
6522
- const loadedImages = useAgentMessageImageSources(images);
6525
+ const { loadingIds, sources: loadedImages } = useAgentMessageImageSources(images);
6523
6526
  const columnCount = Math.min(Math.max(images.length, 1), 4);
6524
6527
  return /* @__PURE__ */ jsx12(
6525
6528
  "div",
@@ -6528,6 +6531,7 @@ function AgentUserImageGrid({
6528
6531
  style: { gridTemplateColumns: `repeat(${columnCount}, 80px)` },
6529
6532
  children: images.map((image) => {
6530
6533
  const src = loadedImages.get(image.id) ?? imageDataUrl(image);
6534
+ const loading = !src && loadingIds.has(image.id);
6531
6535
  return /* @__PURE__ */ jsx12(
6532
6536
  "div",
6533
6537
  {
@@ -6540,6 +6544,20 @@ function AgentUserImageGrid({
6540
6544
  className: "size-full object-cover",
6541
6545
  draggable: false
6542
6546
  }
6547
+ ) : loading ? /* @__PURE__ */ jsx12(
6548
+ "div",
6549
+ {
6550
+ className: "flex size-full items-center justify-center bg-[color-mix(in_srgb,var(--text-primary)_6%,transparent)]",
6551
+ "data-testid": "agent-gui-message-image-loading",
6552
+ children: /* @__PURE__ */ jsx12(
6553
+ LoaderCircle,
6554
+ {
6555
+ "aria-hidden": "true",
6556
+ className: "size-5 animate-spin text-[color-mix(in_srgb,var(--text-primary)_45%,transparent)]",
6557
+ strokeWidth: 2
6558
+ }
6559
+ )
6560
+ }
6543
6561
  ) : /* @__PURE__ */ jsx12("div", { className: "size-full animate-pulse bg-[color-mix(in_srgb,var(--text-primary)_8%,transparent)]" })
6544
6562
  },
6545
6563
  image.id
@@ -6551,23 +6569,42 @@ function AgentUserImageGrid({
6551
6569
  function useAgentMessageImageSources(images) {
6552
6570
  const runtime = getOptionalAgentActivityRuntime();
6553
6571
  const [sources, setSources] = useState5(() => /* @__PURE__ */ new Map());
6572
+ const [loadingIds, setLoadingIds] = useState5(() => /* @__PURE__ */ new Set());
6554
6573
  const missingImages = useMemo(
6555
6574
  () => images.filter(
6556
- (image) => !imageDataUrl(image) && !sources.has(image.id) && image.workspaceId && image.agentSessionId && image.attachmentId
6575
+ (image) => !imageDataUrl(image) && !sources.has(image.id) && image.workspaceId && image.agentSessionId && (image.attachmentId || image.path)
6557
6576
  ),
6558
6577
  [images, sources]
6559
6578
  );
6560
6579
  useEffect4(() => {
6561
- if (!runtime?.readSessionAttachment || missingImages.length === 0) {
6580
+ if (!runtime?.readSessionAttachment && !runtime?.readPromptAsset || missingImages.length === 0) {
6562
6581
  return;
6563
6582
  }
6564
6583
  let canceled = false;
6565
6584
  for (const image of missingImages) {
6566
- void runtime.readSessionAttachment({
6585
+ const readImage = image.attachmentId ? runtime.readSessionAttachment?.({
6567
6586
  workspaceId: image.workspaceId ?? "",
6568
6587
  agentSessionId: image.agentSessionId,
6569
6588
  attachmentId: image.attachmentId ?? ""
6570
- }).then((attachment) => {
6589
+ }) : runtime.readPromptAsset?.({
6590
+ workspaceId: image.workspaceId ?? "",
6591
+ agentSessionId: image.agentSessionId,
6592
+ mimeType: image.mimeType,
6593
+ name: image.name,
6594
+ path: image.path
6595
+ });
6596
+ if (!readImage) {
6597
+ continue;
6598
+ }
6599
+ setLoadingIds((current) => {
6600
+ if (current.has(image.id)) {
6601
+ return current;
6602
+ }
6603
+ const next = new Set(current);
6604
+ next.add(image.id);
6605
+ return next;
6606
+ });
6607
+ void readImage.then((attachment) => {
6571
6608
  if (canceled) {
6572
6609
  return;
6573
6610
  }
@@ -6583,13 +6620,25 @@ function useAgentMessageImageSources(images) {
6583
6620
  return next;
6584
6621
  });
6585
6622
  }).catch(() => {
6623
+ }).finally(() => {
6624
+ if (canceled) {
6625
+ return;
6626
+ }
6627
+ setLoadingIds((current) => {
6628
+ if (!current.has(image.id)) {
6629
+ return current;
6630
+ }
6631
+ const next = new Set(current);
6632
+ next.delete(image.id);
6633
+ return next;
6634
+ });
6586
6635
  });
6587
6636
  }
6588
6637
  return () => {
6589
6638
  canceled = true;
6590
6639
  };
6591
6640
  }, [missingImages, runtime]);
6592
- return sources;
6641
+ return { loadingIds, sources };
6593
6642
  }
6594
6643
  function imageDataUrl(image) {
6595
6644
  const data = image.data?.trim() ?? "";
@@ -6605,6 +6654,33 @@ function AgentSystemNoticeMessage({
6605
6654
  "use memo";
6606
6655
  const notice = message.systemNotice;
6607
6656
  const detail = notice?.detail?.trim() ?? "";
6657
+ const title = systemNoticeTitle(message);
6658
+ if (isContextCompactionNotice(message, title)) {
6659
+ return /* @__PURE__ */ jsxs7(
6660
+ "div",
6661
+ {
6662
+ role: "status",
6663
+ className: "box-border flex w-full min-w-0 items-center gap-3 py-2 text-[12px] leading-4 text-[var(--text-secondary)]",
6664
+ children: [
6665
+ /* @__PURE__ */ jsx12(
6666
+ "span",
6667
+ {
6668
+ "aria-hidden": "true",
6669
+ className: "h-px min-w-4 flex-1 bg-[var(--line-1)]"
6670
+ }
6671
+ ),
6672
+ /* @__PURE__ */ jsx12("span", { className: "shrink-0 whitespace-nowrap", children: title }),
6673
+ /* @__PURE__ */ jsx12(
6674
+ "span",
6675
+ {
6676
+ "aria-hidden": "true",
6677
+ className: "h-px min-w-4 flex-1 bg-[var(--line-1)]"
6678
+ }
6679
+ )
6680
+ ]
6681
+ }
6682
+ );
6683
+ }
6608
6684
  const isWarning = notice?.severity === "warning" || notice?.severity === "error";
6609
6685
  return /* @__PURE__ */ jsx12(
6610
6686
  "section",
@@ -6612,12 +6688,16 @@ function AgentSystemNoticeMessage({
6612
6688
  role: isWarning ? "status" : void 0,
6613
6689
  className: "box-border w-full min-w-0 rounded-[8px] border border-[color-mix(in_srgb,var(--state-warning)_14%,transparent)] bg-[color-mix(in_srgb,var(--background-fronted)_100%,var(--state-warning)_6%)] p-3 text-[13px] leading-5 text-[var(--text-primary)]",
6614
6690
  children: /* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
6615
- /* @__PURE__ */ jsx12("div", { className: "font-medium text-[var(--text-primary)]", children: systemNoticeTitle(message) }),
6691
+ /* @__PURE__ */ jsx12("div", { className: "font-medium text-[var(--text-primary)]", children: title }),
6616
6692
  detail ? /* @__PURE__ */ jsx12(AgentMessageDetailsDisclosure, { detail, className: "mt-1" }) : null
6617
6693
  ] })
6618
6694
  }
6619
6695
  );
6620
6696
  }
6697
+ function isContextCompactionNotice(message, title) {
6698
+ const notice = message.systemNotice;
6699
+ return notice?.noticeKind === "system_notice" && (notice.detail?.trim() ?? "") === "" && title.trim() === CONTEXT_COMPACTION_NOTICE_TITLE;
6700
+ }
6621
6701
  function AgentPlanCardMessage({
6622
6702
  message,
6623
6703
  workspaceRoot,
@@ -12234,4 +12314,4 @@ export {
12234
12314
  AgentConversationFlow,
12235
12315
  useProjectedAgentConversation
12236
12316
  };
12237
- //# sourceMappingURL=chunk-KRKC3XXB.js.map
12317
+ //# sourceMappingURL=chunk-7JW4OAKS.js.map