@tutti-os/agent-gui 0.0.6 → 0.0.7

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/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  mergeWorkspaceAgentActivityDurableAndOverlayMessages,
8
8
  normalizeOptionalWorkspaceAgentStatus,
9
9
  selectWorkspaceAgentActivityOverlayMessages
10
- } from "./chunk-KGFWU4FL.js";
10
+ } from "./chunk-DHOAJJ3K.js";
11
11
  import {
12
12
  AgentActivityHostProvider,
13
13
  AgentActivityRuntimeProvider,
@@ -38,7 +38,7 @@ import {
38
38
  useOptionalAgentHostApi,
39
39
  user_avatar_placeholder_default,
40
40
  workspaceAgentActivityStatusLabel
41
- } from "./chunk-FKCXHCPO.js";
41
+ } from "./chunk-VBNWIBNV.js";
42
42
  import {
43
43
  resolveWorkspaceAgentSessionSortTimeUnixMs,
44
44
  workspaceAgentProviderLabel
@@ -56,7 +56,7 @@ import {
56
56
  getActiveUiLanguage,
57
57
  translate,
58
58
  useTranslation
59
- } from "./chunk-JWVLIF5R.js";
59
+ } from "./chunk-ZAVQMGAX.js";
60
60
  import {
61
61
  resolveAgentMentionFileThumbnailUrl,
62
62
  resolveAgentMentionFileVisualKind
@@ -12398,6 +12398,7 @@ function useAgentGUINodeController({
12398
12398
  workspacePath,
12399
12399
  avoidGroupingEdits,
12400
12400
  data,
12401
+ previewMode = false,
12401
12402
  onDataChange,
12402
12403
  onShowMessage
12403
12404
  }) {
@@ -12607,6 +12608,9 @@ function useAgentGUINodeController({
12607
12608
  setRetainedBackgroundConversationIds
12608
12609
  ] = useState5([]);
12609
12610
  useEffect5(() => {
12611
+ if (previewMode) {
12612
+ return;
12613
+ }
12610
12614
  setRetainedBackgroundConversationIds((current) => {
12611
12615
  const next = new Set(current);
12612
12616
  for (const conversationId of backgroundBusyConversationIds) {
@@ -12622,15 +12626,24 @@ function useAgentGUINodeController({
12622
12626
  (conversationId, index) => conversationId === current[index]
12623
12627
  ) ? current : nextIds;
12624
12628
  });
12625
- }, [activeConversationId, backgroundBusyConversationIds, conversations]);
12629
+ }, [
12630
+ activeConversationId,
12631
+ backgroundBusyConversationIds,
12632
+ conversations,
12633
+ previewMode
12634
+ ]);
12626
12635
  const backgroundWatchedConversationIds = useMemo4(
12627
- () => [
12636
+ () => previewMode ? [] : [
12628
12637
  .../* @__PURE__ */ new Set([
12629
12638
  ...backgroundBusyConversationIds,
12630
12639
  ...retainedBackgroundConversationIds
12631
12640
  ])
12632
12641
  ].sort(),
12633
- [backgroundBusyConversationIds, retainedBackgroundConversationIds]
12642
+ [
12643
+ backgroundBusyConversationIds,
12644
+ previewMode,
12645
+ retainedBackgroundConversationIds
12646
+ ]
12634
12647
  );
12635
12648
  const accountProfilesByUserId = useAccountStore(
12636
12649
  (state) => state.profilesByUserId
@@ -12724,6 +12737,9 @@ function useAgentGUINodeController({
12724
12737
  []
12725
12738
  );
12726
12739
  useEffect5(() => {
12740
+ if (previewMode) {
12741
+ return void 0;
12742
+ }
12727
12743
  const api = agentHostApi.userProjects;
12728
12744
  let disposed = false;
12729
12745
  const loadUserProjects = async () => {
@@ -12753,8 +12769,11 @@ function useAgentGUINodeController({
12753
12769
  disposed = true;
12754
12770
  unsubscribe?.();
12755
12771
  };
12756
- }, [agentHostApi.userProjects, setUserProjectsSnapshot]);
12772
+ }, [agentHostApi.userProjects, previewMode, setUserProjectsSnapshot]);
12757
12773
  useEffect5(() => {
12774
+ if (previewMode) {
12775
+ return;
12776
+ }
12758
12777
  if (!conversationListQuery || agentActivitySnapshot.sessions.length === 0) {
12759
12778
  return;
12760
12779
  }
@@ -12820,6 +12839,7 @@ function useAgentGUINodeController({
12820
12839
  agentActivitySnapshot,
12821
12840
  conversationListQuery,
12822
12841
  data.provider,
12842
+ previewMode,
12823
12843
  updateConversationList,
12824
12844
  userProjects
12825
12845
  ]);
@@ -12835,6 +12855,9 @@ function useAgentGUINodeController({
12835
12855
  []
12836
12856
  );
12837
12857
  useEffect5(() => {
12858
+ if (previewMode) {
12859
+ return;
12860
+ }
12838
12861
  updateConversationList(
12839
12862
  (current) => applyAgentGUIConversationProjects(current, userProjects)
12840
12863
  );
@@ -12843,6 +12866,7 @@ function useAgentGUINodeController({
12843
12866
  );
12844
12867
  }, [
12845
12868
  conversations,
12869
+ previewMode,
12846
12870
  setTransientConversation,
12847
12871
  updateConversationList,
12848
12872
  userProjects
@@ -12901,6 +12925,9 @@ function useAgentGUINodeController({
12901
12925
  isCreatingConversationRef.current = isCreatingConversation;
12902
12926
  }, [isCreatingConversation]);
12903
12927
  useEffect5(() => {
12928
+ if (previewMode) {
12929
+ return;
12930
+ }
12904
12931
  setPendingCreateConversationId(resolvePendingCreateConversationId());
12905
12932
  if (!conversationListQuery || !pendingCreateOwnerKey) {
12906
12933
  return;
@@ -12911,9 +12938,13 @@ function useAgentGUINodeController({
12911
12938
  }, [
12912
12939
  conversationListQuery,
12913
12940
  pendingCreateOwnerKey,
12941
+ previewMode,
12914
12942
  resolvePendingCreateConversationId
12915
12943
  ]);
12916
12944
  useEffect5(() => {
12945
+ if (previewMode) {
12946
+ return;
12947
+ }
12917
12948
  setIsPendingSubmit(resolvePendingSubmit());
12918
12949
  if (!conversationListQuery || activeConversationId === null) {
12919
12950
  return;
@@ -12921,10 +12952,18 @@ function useAgentGUINodeController({
12921
12952
  return subscribeAgentGUIConversationListStore(() => {
12922
12953
  setIsPendingSubmit(resolvePendingSubmit());
12923
12954
  });
12924
- }, [activeConversationId, conversationListQuery, resolvePendingSubmit]);
12955
+ }, [
12956
+ activeConversationId,
12957
+ conversationListQuery,
12958
+ previewMode,
12959
+ resolvePendingSubmit
12960
+ ]);
12925
12961
  useEffect5(() => {
12962
+ if (previewMode) {
12963
+ return;
12964
+ }
12926
12965
  ensureOpenclawGateway();
12927
- }, [data.provider, ensureOpenclawGateway]);
12966
+ }, [data.provider, ensureOpenclawGateway, previewMode]);
12928
12967
  useEffect5(() => {
12929
12968
  onDataChangeRef.current = onDataChange;
12930
12969
  }, [onDataChange]);
@@ -12955,6 +12994,9 @@ function useAgentGUINodeController({
12955
12994
  );
12956
12995
  }, [conversations]);
12957
12996
  useEffect5(() => {
12997
+ if (previewMode) {
12998
+ return;
12999
+ }
12958
13000
  const previousSnapshot = previousConversationListSnapshotRef.current;
12959
13001
  const previousQuery = previousSnapshot.query;
12960
13002
  const previousQueryKey = previousQuery ? createAgentGUIConversationListQueryKey(previousQuery) : null;
@@ -12970,7 +13012,7 @@ function useAgentGUINodeController({
12970
13012
  query: conversationListQuery,
12971
13013
  conversations
12972
13014
  };
12973
- }, [conversationListQuery, conversations]);
13015
+ }, [conversationListQuery, conversations, previewMode]);
12974
13016
  const persistActiveConversation = useCallback4(
12975
13017
  (agentSessionId) => {
12976
13018
  if (persistedActiveConversationIdRef.current === agentSessionId) {
@@ -13005,6 +13047,9 @@ function useAgentGUINodeController({
13005
13047
  [agentActivityRuntime, workspaceId]
13006
13048
  );
13007
13049
  useEffect5(() => {
13050
+ if (previewMode) {
13051
+ return;
13052
+ }
13008
13053
  if (!hasLoadedConversations) {
13009
13054
  return;
13010
13055
  }
@@ -13015,7 +13060,12 @@ function useAgentGUINodeController({
13015
13060
  onDataChangeRef.current(
13016
13061
  (current) => current.conversationCount === nextConversationCount ? current : { ...current, conversationCount: nextConversationCount }
13017
13062
  );
13018
- }, [conversations.length, hasLoadedConversations, transientConversation]);
13063
+ }, [
13064
+ conversations.length,
13065
+ hasLoadedConversations,
13066
+ previewMode,
13067
+ transientConversation
13068
+ ]);
13019
13069
  const isCurrentConversation = useCallback4((agentSessionId) => {
13020
13070
  return isMountedRef.current && activeConversationIdRef.current === agentSessionId.trim();
13021
13071
  }, []);
@@ -13535,6 +13585,9 @@ function useAgentGUINodeController({
13535
13585
  ]
13536
13586
  );
13537
13587
  useEffect5(() => {
13588
+ if (previewMode) {
13589
+ return;
13590
+ }
13538
13591
  if (!supports.model && !supports.reasoning && !supports.permission) {
13539
13592
  return;
13540
13593
  }
@@ -13548,12 +13601,16 @@ function useAgentGUINodeController({
13548
13601
  }, [
13549
13602
  data.provider,
13550
13603
  loadDraftComposerOptions,
13604
+ previewMode,
13551
13605
  selectedProjectPath,
13552
13606
  supports.model,
13553
13607
  supports.permission,
13554
13608
  supports.reasoning
13555
13609
  ]);
13556
13610
  useEffect5(() => {
13611
+ if (previewMode) {
13612
+ return void 0;
13613
+ }
13557
13614
  if (!supports.model && !supports.reasoning && !supports.permission) {
13558
13615
  return void 0;
13559
13616
  }
@@ -13586,18 +13643,23 @@ function useAgentGUINodeController({
13586
13643
  }, [
13587
13644
  loadDraftComposerOptions,
13588
13645
  loadSessionState,
13646
+ previewMode,
13589
13647
  workspaceId,
13590
13648
  supports.model,
13591
13649
  supports.permission,
13592
13650
  supports.reasoning
13593
13651
  ]);
13594
13652
  useEffect5(() => {
13653
+ if (previewMode) {
13654
+ return;
13655
+ }
13595
13656
  loadDraftComposerOptions();
13596
13657
  }, [
13597
13658
  activeConversationId,
13598
13659
  data.provider,
13599
13660
  isComposerHome,
13600
- loadDraftComposerOptions
13661
+ loadDraftComposerOptions,
13662
+ previewMode
13601
13663
  ]);
13602
13664
  const clearPendingSessionStateReload = useCallback4(() => {
13603
13665
  if (stateReloadTimerRef.current !== null) {
@@ -13935,11 +13997,22 @@ function useAgentGUINodeController({
13935
13997
  [applyStatePatch, handleActivityStreamEvent]
13936
13998
  );
13937
13999
  useEffect5(() => {
14000
+ if (previewMode) {
14001
+ return;
14002
+ }
13938
14003
  void syncConversationListProjection(
13939
14004
  dataRef.current.lastActiveAgentSessionId
13940
14005
  );
13941
- }, [currentUserId, data.provider, syncConversationListProjection]);
14006
+ }, [
14007
+ currentUserId,
14008
+ data.provider,
14009
+ previewMode,
14010
+ syncConversationListProjection
14011
+ ]);
13942
14012
  useEffect5(() => {
14013
+ if (previewMode) {
14014
+ return;
14015
+ }
13943
14016
  if (!activeConversationId) {
13944
14017
  setDetailError(null);
13945
14018
  return;
@@ -13954,11 +14027,11 @@ function useAgentGUINodeController({
13954
14027
  reloadConversations: false,
13955
14028
  reloadDetail: true
13956
14029
  });
13957
- }, [activeConversationId, reloadSelectedConversation]);
14030
+ }, [activeConversationId, previewMode, reloadSelectedConversation]);
13958
14031
  useAgentSessionDurableRefresh({
13959
14032
  agentSessionId: activeConversationId,
13960
14033
  sessionView: activeSessionView,
13961
- blockControlStateRefresh: activeConversationId === null || blockedActivityStreamStateReloadSessionIdsRef.current.has(
14034
+ blockControlStateRefresh: previewMode || activeConversationId === null || blockedActivityStreamStateReloadSessionIdsRef.current.has(
13962
14035
  activeConversationId
13963
14036
  ),
13964
14037
  onControlStateRefresh: () => {
@@ -13976,7 +14049,7 @@ function useAgentGUINodeController({
13976
14049
  useWatchAgentSession({
13977
14050
  workspaceId,
13978
14051
  agentSessionId: activeConversationId,
13979
- enabled: activeConversationId !== null,
14052
+ enabled: !previewMode && activeConversationId !== null,
13980
14053
  onSubscribe: () => {
13981
14054
  if (!activeConversationId) {
13982
14055
  return;
@@ -15190,6 +15263,9 @@ function useAgentGUINodeController({
15190
15263
  ]
15191
15264
  );
15192
15265
  useEffect5(() => {
15266
+ if (previewMode) {
15267
+ return;
15268
+ }
15193
15269
  if (!activeConversationId) {
15194
15270
  return;
15195
15271
  }
@@ -15221,10 +15297,14 @@ function useAgentGUINodeController({
15221
15297
  isRespondingApproval,
15222
15298
  isSubmitting,
15223
15299
  failedQueuedPromptIdBySessionId,
15300
+ previewMode,
15224
15301
  queuedPromptRetryBlockBySessionId,
15225
15302
  queuedPromptsBySessionId
15226
15303
  ]);
15227
15304
  useEffect5(() => {
15305
+ if (previewMode) {
15306
+ return;
15307
+ }
15228
15308
  if (!activeConversationId) {
15229
15309
  return;
15230
15310
  }
@@ -15313,6 +15393,7 @@ function useAgentGUINodeController({
15313
15393
  syncConversationListProjection,
15314
15394
  loadSessionState,
15315
15395
  refreshMessagesFromSnapshot,
15396
+ previewMode,
15316
15397
  queuedPromptsBySessionId,
15317
15398
  runtimeSessionsBySessionId,
15318
15399
  workspaceId,
@@ -30313,6 +30394,7 @@ function AgentComposer({
30313
30394
  ref: inputShellRef,
30314
30395
  className: cn(inputShellClassName, "relative"),
30315
30396
  "data-input-disabled": inputDisabled ? "true" : void 0,
30397
+ title: inputDisabled && disabledReasonText ? disabledReasonText : void 0,
30316
30398
  style: inputShellStyle,
30317
30399
  children: [
30318
30400
  /* @__PURE__ */ jsxs54(
@@ -31058,6 +31140,14 @@ function agentGuiPerfNowMs() {
31058
31140
  function roundAgentGuiPerfMs(value) {
31059
31141
  return Math.round(value * 100) / 100;
31060
31142
  }
31143
+ function isDifferentKnownConversationOwner(input) {
31144
+ const conversationUserId = input.conversationUserId?.trim() ?? "";
31145
+ const currentUserId = input.currentUserId?.trim() ?? "";
31146
+ if (!conversationUserId || !currentUserId || conversationUserId === "local" || currentUserId === "local") {
31147
+ return false;
31148
+ }
31149
+ return conversationUserId !== currentUserId;
31150
+ }
31061
31151
  function isContextCanceledMessage(message) {
31062
31152
  const normalized = message?.trim().toLowerCase() ?? "";
31063
31153
  return normalized === "context canceled";
@@ -31252,6 +31342,7 @@ function AgentGUINodeView({
31252
31342
  isAgentProviderReady,
31253
31343
  slashStatusLimits = [],
31254
31344
  slashStatusLimitsLoading = false,
31345
+ previewMode = false,
31255
31346
  showProjectSelector = true,
31256
31347
  onAgentProviderLogin,
31257
31348
  actions,
@@ -31280,6 +31371,9 @@ function AgentGUINodeView({
31280
31371
  ] = useState26(0);
31281
31372
  const workspaceReferencePickerResolverRef = useRef20(null);
31282
31373
  const requestWorkspaceReferences = useCallback18(async () => {
31374
+ if (previewMode) {
31375
+ return [];
31376
+ }
31283
31377
  if (!workspaceFileReferenceAdapter || !workspaceFileReferenceCopy) {
31284
31378
  return [];
31285
31379
  }
@@ -31287,7 +31381,7 @@ function AgentGUINodeView({
31287
31381
  return await new Promise((resolve) => {
31288
31382
  workspaceReferencePickerResolverRef.current = resolve;
31289
31383
  });
31290
- }, [workspaceFileReferenceAdapter, workspaceFileReferenceCopy]);
31384
+ }, [previewMode, workspaceFileReferenceAdapter, workspaceFileReferenceCopy]);
31291
31385
  const closeWorkspaceReferencePicker = useCallback18(() => {
31292
31386
  workspaceReferencePickerResolverRef.current?.([]);
31293
31387
  workspaceReferencePickerResolverRef.current = null;
@@ -31310,6 +31404,9 @@ function AgentGUINodeView({
31310
31404
  const detailComposerFocusRequestSequence = localComposerFocusRequestSequence === 0 ? composerFocusRequestSequence : (composerFocusRequestSequence ?? 0) + localComposerFocusRequestSequence;
31311
31405
  const requestCreateConversation = useCallback18(
31312
31406
  (options) => {
31407
+ if (previewMode) {
31408
+ return;
31409
+ }
31313
31410
  if (options) {
31314
31411
  actions.createConversation(options);
31315
31412
  } else {
@@ -31317,7 +31414,7 @@ function AgentGUINodeView({
31317
31414
  }
31318
31415
  setLocalComposerFocusRequestSequence((current) => current + 1);
31319
31416
  },
31320
- [actions]
31417
+ [actions, previewMode]
31321
31418
  );
31322
31419
  const effectiveWorkspaceAppIcons = useMemo15(
31323
31420
  () => mergeWorkspaceAppIconsFromCommands({
@@ -31336,6 +31433,9 @@ function AgentGUINodeView({
31336
31433
  );
31337
31434
  const handleConversationRailResizePointerDown = useCallback18(
31338
31435
  (event) => {
31436
+ if (previewMode) {
31437
+ return;
31438
+ }
31339
31439
  if (conversationRailCollapsed || event.button !== 0) {
31340
31440
  return;
31341
31441
  }
@@ -31348,10 +31448,13 @@ function AgentGUINodeView({
31348
31448
  };
31349
31449
  setIsRailResizing(true);
31350
31450
  },
31351
- [conversationRailCollapsed, conversationRailWidthPx]
31451
+ [conversationRailCollapsed, conversationRailWidthPx, previewMode]
31352
31452
  );
31353
31453
  const handleConversationRailResizePointerMove = useCallback18(
31354
31454
  (event) => {
31455
+ if (previewMode) {
31456
+ return;
31457
+ }
31355
31458
  const resizeState = railResizeInteractionRef.current;
31356
31459
  if (!resizeState || resizeState.pointerId !== event.pointerId) {
31357
31460
  return;
@@ -31361,7 +31464,7 @@ function AgentGUINodeView({
31361
31464
  );
31362
31465
  onConversationRailWidthChanged(nextWidthPx);
31363
31466
  },
31364
- [clampConversationRailWidth, onConversationRailWidthChanged]
31467
+ [clampConversationRailWidth, onConversationRailWidthChanged, previewMode]
31365
31468
  );
31366
31469
  const endConversationRailResize = useCallback18(
31367
31470
  (event) => {
@@ -31375,6 +31478,9 @@ function AgentGUINodeView({
31375
31478
  );
31376
31479
  const handleConversationRailResizeKeyDown = useCallback18(
31377
31480
  (event) => {
31481
+ if (previewMode) {
31482
+ return;
31483
+ }
31378
31484
  if (conversationRailCollapsed) {
31379
31485
  return;
31380
31486
  }
@@ -31392,7 +31498,8 @@ function AgentGUINodeView({
31392
31498
  clampConversationRailWidth,
31393
31499
  conversationRailCollapsed,
31394
31500
  conversationRailWidthPx,
31395
- onConversationRailWidthChanged
31501
+ onConversationRailWidthChanged,
31502
+ previewMode
31396
31503
  ]
31397
31504
  );
31398
31505
  const layoutStyle = {
@@ -31401,90 +31508,99 @@ function AgentGUINodeView({
31401
31508
  gridTemplateColumns: conversationRailCollapsed ? "0 minmax(var(--agent-gui-detail-min-width), 1fr)" : "var(--agent-gui-conversation-rail-width) minmax(var(--agent-gui-detail-min-width), 1fr)"
31402
31509
  };
31403
31510
  return /* @__PURE__ */ jsxs56(TooltipProvider2, { children: [
31404
- /* @__PURE__ */ jsxs56("div", { className: AgentGUINode_styles_default.layout, style: layoutStyle, children: [
31405
- /* @__PURE__ */ jsx86(
31406
- "aside",
31407
- {
31408
- id: "agent-gui-conversation-rail",
31409
- className: `${AgentGUINode_styles_default.railPanel}${conversationRailCollapsed ? ` ${AgentGUINode_styles_default.railPanelCollapsed}` : ""}`,
31410
- "aria-hidden": conversationRailCollapsed ? "true" : void 0,
31411
- inert: conversationRailCollapsed ? true : void 0,
31412
- children: /* @__PURE__ */ jsx86(
31413
- AgentGUIConversationRailPane,
31511
+ /* @__PURE__ */ jsxs56(
31512
+ "div",
31513
+ {
31514
+ className: AgentGUINode_styles_default.layout,
31515
+ "data-agent-gui-preview": previewMode ? "true" : void 0,
31516
+ inert: previewMode ? true : void 0,
31517
+ style: layoutStyle,
31518
+ children: [
31519
+ /* @__PURE__ */ jsx86(
31520
+ "aside",
31414
31521
  {
31415
- conversations: viewModel.conversations,
31416
- userProjects: viewModel.userProjects,
31417
- activeConversationId: viewModel.activeConversationId,
31418
- pendingDeleteConversationId: viewModel.pendingDeleteConversation?.id ?? null,
31419
- isLoadingConversations: viewModel.isLoadingConversations,
31420
- isDeletingConversation: viewModel.isDeletingConversation,
31421
- isDeletingProjectConversations: viewModel.isDeletingProjectConversations,
31522
+ id: "agent-gui-conversation-rail",
31523
+ className: `${AgentGUINode_styles_default.railPanel}${conversationRailCollapsed ? ` ${AgentGUINode_styles_default.railPanelCollapsed}` : ""}`,
31524
+ "aria-hidden": conversationRailCollapsed ? "true" : void 0,
31525
+ inert: conversationRailCollapsed ? true : void 0,
31526
+ children: /* @__PURE__ */ jsx86(
31527
+ AgentGUIConversationRailPane,
31528
+ {
31529
+ conversations: viewModel.conversations,
31530
+ userProjects: viewModel.userProjects,
31531
+ activeConversationId: viewModel.activeConversationId,
31532
+ pendingDeleteConversationId: viewModel.pendingDeleteConversation?.id ?? null,
31533
+ isLoadingConversations: viewModel.isLoadingConversations,
31534
+ isDeletingConversation: viewModel.isDeletingConversation,
31535
+ isDeletingProjectConversations: viewModel.isDeletingProjectConversations,
31536
+ labels,
31537
+ workspaceUserProjectI18n,
31538
+ uiLanguage,
31539
+ showProjectSelector,
31540
+ createConversationDisabled,
31541
+ openclawGateway,
31542
+ isCollapsed: conversationRailCollapsed,
31543
+ onCreateConversation: requestCreateConversation,
31544
+ onRetryOpenclawGateway: actions.retryOpenclawGateway,
31545
+ onSelectConversation: actions.selectConversation,
31546
+ onToggleConversationPinned: actions.toggleConversationPinned,
31547
+ onRemoveProject: actions.removeProject,
31548
+ onConfirmDeleteProjectConversations: actions.confirmDeleteProjectConversations,
31549
+ onRequestDeleteConversation: actions.requestDeleteConversation,
31550
+ onCancelDeleteConversation: actions.cancelDeleteConversation,
31551
+ onConfirmDeleteConversation: actions.confirmDeleteConversation
31552
+ }
31553
+ )
31554
+ }
31555
+ ),
31556
+ /* @__PURE__ */ jsx86(
31557
+ "div",
31558
+ {
31559
+ id: "agent-gui-conversation-rail-resize",
31560
+ className: conversationRailCollapsed ? `${AgentGUINode_styles_default.railResizeHandle} ${AgentGUINode_styles_default.railResizeHandleCollapsed} nodrag pointer-events-none opacity-0` : `${AgentGUINode_styles_default.railResizeHandle} nodrag`,
31561
+ role: "separator",
31562
+ "aria-label": labels.conversationRailResizeAria,
31563
+ "aria-hidden": conversationRailCollapsed ? "true" : void 0,
31564
+ "aria-orientation": "vertical",
31565
+ "aria-valuemin": conversationRailMinWidthPx,
31566
+ "aria-valuemax": conversationRailMaxWidthPx,
31567
+ "aria-valuenow": conversationRailCollapsed ? void 0 : conversationRailWidthPx,
31568
+ "data-resizing": isRailResizing ? "true" : void 0,
31569
+ "data-testid": "agent-gui-conversation-rail-resize-handle",
31570
+ tabIndex: conversationRailCollapsed ? -1 : 0,
31571
+ onBlur: () => endConversationRailResize(),
31572
+ onKeyDown: handleConversationRailResizeKeyDown,
31573
+ onPointerCancel: endConversationRailResize,
31574
+ onPointerDown: handleConversationRailResizePointerDown,
31575
+ onLostPointerCapture: endConversationRailResize,
31576
+ onPointerMove: handleConversationRailResizePointerMove,
31577
+ onPointerUp: endConversationRailResize
31578
+ }
31579
+ ),
31580
+ /* @__PURE__ */ jsx86("section", { id: "agent-gui-detail", className: AgentGUINode_styles_default.detailPanel, children: /* @__PURE__ */ jsx86(
31581
+ AgentGUIDetailPane,
31582
+ {
31583
+ viewModel,
31584
+ actions,
31422
31585
  labels,
31423
- workspaceUserProjectI18n,
31424
31586
  uiLanguage,
31587
+ isActive,
31588
+ composerFocusRequestSequence: detailComposerFocusRequestSequence,
31589
+ isAgentProviderReady,
31590
+ slashStatusLimits,
31591
+ slashStatusLimitsLoading,
31425
31592
  showProjectSelector,
31426
- createConversationDisabled,
31427
- openclawGateway,
31428
- isCollapsed: conversationRailCollapsed,
31429
- onCreateConversation: requestCreateConversation,
31430
- onRetryOpenclawGateway: actions.retryOpenclawGateway,
31431
- onSelectConversation: actions.selectConversation,
31432
- onToggleConversationPinned: actions.toggleConversationPinned,
31433
- onRemoveProject: actions.removeProject,
31434
- onConfirmDeleteProjectConversations: actions.confirmDeleteProjectConversations,
31435
- onRequestDeleteConversation: actions.requestDeleteConversation,
31436
- onCancelDeleteConversation: actions.cancelDeleteConversation,
31437
- onConfirmDeleteConversation: actions.confirmDeleteConversation
31593
+ onLinkAction,
31594
+ onAgentProviderLogin,
31595
+ onRequestWorkspaceReferences: requestWorkspaceReferences,
31596
+ richTextAtProviders,
31597
+ workspaceAppIcons: effectiveWorkspaceAppIcons,
31598
+ workspaceUserProjectI18n
31438
31599
  }
31439
- )
31440
- }
31441
- ),
31442
- /* @__PURE__ */ jsx86(
31443
- "div",
31444
- {
31445
- id: "agent-gui-conversation-rail-resize",
31446
- className: conversationRailCollapsed ? `${AgentGUINode_styles_default.railResizeHandle} ${AgentGUINode_styles_default.railResizeHandleCollapsed} nodrag pointer-events-none opacity-0` : `${AgentGUINode_styles_default.railResizeHandle} nodrag`,
31447
- role: "separator",
31448
- "aria-label": labels.conversationRailResizeAria,
31449
- "aria-hidden": conversationRailCollapsed ? "true" : void 0,
31450
- "aria-orientation": "vertical",
31451
- "aria-valuemin": conversationRailMinWidthPx,
31452
- "aria-valuemax": conversationRailMaxWidthPx,
31453
- "aria-valuenow": conversationRailCollapsed ? void 0 : conversationRailWidthPx,
31454
- "data-resizing": isRailResizing ? "true" : void 0,
31455
- "data-testid": "agent-gui-conversation-rail-resize-handle",
31456
- tabIndex: conversationRailCollapsed ? -1 : 0,
31457
- onBlur: () => endConversationRailResize(),
31458
- onKeyDown: handleConversationRailResizeKeyDown,
31459
- onPointerCancel: endConversationRailResize,
31460
- onPointerDown: handleConversationRailResizePointerDown,
31461
- onLostPointerCapture: endConversationRailResize,
31462
- onPointerMove: handleConversationRailResizePointerMove,
31463
- onPointerUp: endConversationRailResize
31464
- }
31465
- ),
31466
- /* @__PURE__ */ jsx86("section", { id: "agent-gui-detail", className: AgentGUINode_styles_default.detailPanel, children: /* @__PURE__ */ jsx86(
31467
- AgentGUIDetailPane,
31468
- {
31469
- viewModel,
31470
- actions,
31471
- labels,
31472
- uiLanguage,
31473
- isActive,
31474
- composerFocusRequestSequence: detailComposerFocusRequestSequence,
31475
- isAgentProviderReady,
31476
- slashStatusLimits,
31477
- slashStatusLimitsLoading,
31478
- showProjectSelector,
31479
- onLinkAction,
31480
- onAgentProviderLogin,
31481
- onRequestWorkspaceReferences: requestWorkspaceReferences,
31482
- richTextAtProviders,
31483
- workspaceAppIcons: effectiveWorkspaceAppIcons,
31484
- workspaceUserProjectI18n
31485
- }
31486
- ) })
31487
- ] }),
31600
+ ) })
31601
+ ]
31602
+ }
31603
+ ),
31488
31604
  /* @__PURE__ */ jsx86(
31489
31605
  WorkspaceFileReferencePicker,
31490
31606
  {
@@ -31661,11 +31777,15 @@ var AgentGUIDetailPane = memo5(function AgentGUIDetailPane2({
31661
31777
  const displayConversationStatus = viewModel.isSubmitting ? "working" : derivedBusyStatus ?? viewModel.activeConversation?.status;
31662
31778
  const activeConversationTurnBusy = viewModel.isSubmitting || derivedBusyStatus !== null;
31663
31779
  const isComposerSending = viewModel.isSubmitting || activeConversationTurnBusy || !hasActiveConversation && viewModel.isCreatingConversation;
31664
- const canQueueWhileBusy = viewModel.canQueueWhileBusy && isAgentProviderReady;
31665
- const composerDisabledReason = isAgentProviderReady ? null : labels.installRequiredPlaceholder;
31666
- const submitDisabled = !isAgentProviderReady || !viewModel.canSubmit && !canQueueWhileBusy || viewModel.draftPrompt.trim() === "";
31780
+ const isCollaboratorConversation = isDifferentKnownConversationOwner({
31781
+ conversationUserId: viewModel.activeConversation?.userId,
31782
+ currentUserId: viewModel.currentUserId
31783
+ });
31784
+ const canQueueWhileBusy = viewModel.canQueueWhileBusy && isAgentProviderReady && !isCollaboratorConversation;
31785
+ const composerDisabledReason = isCollaboratorConversation ? labels.collaboratorSessionReadOnlyPlaceholder : isAgentProviderReady ? null : labels.installRequiredPlaceholder;
31786
+ const submitDisabled = isCollaboratorConversation || !isAgentProviderReady || !viewModel.canSubmit && !canQueueWhileBusy || viewModel.draftPrompt.trim() === "";
31667
31787
  const hasNonRetryableRecoveryFailure = sessionChrome.recovery?.kind === "failed" && sessionChrome.recovery.canRetry === false;
31668
- const composerDisabled = hasNonRetryableRecoveryFailure || !isAgentProviderReady || !canQueueWhileBusy && (viewModel.pendingApproval !== null || viewModel.pendingInteractivePrompt !== null || viewModel.isSubmitting || viewModel.isInterrupting || viewModel.isCreatingConversation);
31788
+ const composerDisabled = hasNonRetryableRecoveryFailure || isCollaboratorConversation || !isAgentProviderReady || !canQueueWhileBusy && (viewModel.pendingApproval !== null || viewModel.pendingInteractivePrompt !== null || viewModel.isSubmitting || viewModel.isInterrupting || viewModel.isCreatingConversation);
31669
31789
  const showStopButton = !viewModel.isSubmitting && viewModel.activeLiveState !== "failed" && sessionChrome.auth === null && (activeConversationTurnBusy || viewModel.pendingApproval !== null || viewModel.pendingInteractivePrompt !== null || viewModel.isInterrupting) && !(canQueueWhileBusy && viewModel.draftPrompt.trim() !== "");
31670
31790
  const syncStatus = resolveSyncIndicatorStatus(
31671
31791
  viewModel.activeConversation?.syncState?.status
@@ -33734,7 +33854,7 @@ function areAgentGUINodePropsEqual(previous, next) {
33734
33854
  previous.workspaceAgentProbes,
33735
33855
  next.workspaceAgentProbes,
33736
33856
  previous.state.provider
33737
- ) && previous.onAgentProbeDemandChange === next.onAgentProbeDemandChange && previous.managedAgentsState === next.managedAgentsState && previous.richTextAtProviders === next.richTextAtProviders && previous.workspaceAppIcons === next.workspaceAppIcons && previous.embedded === next.embedded && previous.isActive === next.isActive && previous.showProjectSelector === next.showProjectSelector && previous.composerFocusRequestSequence === next.composerFocusRequestSequence;
33857
+ ) && previous.onAgentProbeDemandChange === next.onAgentProbeDemandChange && previous.managedAgentsState === next.managedAgentsState && previous.richTextAtProviders === next.richTextAtProviders && previous.workspaceAppIcons === next.workspaceAppIcons && previous.embedded === next.embedded && previous.previewMode === next.previewMode && previous.isActive === next.isActive && previous.showProjectSelector === next.showProjectSelector && previous.composerFocusRequestSequence === next.composerFocusRequestSequence;
33738
33858
  }
33739
33859
  var AgentGUINode = memo6(function AgentGUINode2({
33740
33860
  nodeId,
@@ -33768,7 +33888,8 @@ var AgentGUINode = memo6(function AgentGUINode2({
33768
33888
  managedAgentsState,
33769
33889
  richTextAtProviders,
33770
33890
  workspaceAppIcons,
33771
- embedded = false
33891
+ embedded = false,
33892
+ previewMode = false
33772
33893
  }) {
33773
33894
  "use memo";
33774
33895
  const { i18n, locale, t } = useTranslation();
@@ -33804,12 +33925,18 @@ var AgentGUINode = memo6(function AgentGUINode2({
33804
33925
  );
33805
33926
  const handleDataChange = useCallback20(
33806
33927
  (updater) => {
33928
+ if (previewMode) {
33929
+ return;
33930
+ }
33807
33931
  onUpdateNode(updater);
33808
33932
  },
33809
- [onUpdateNode]
33933
+ [onUpdateNode, previewMode]
33810
33934
  );
33811
33935
  const handleConversationRailWidthChanged = useCallback20(
33812
33936
  (widthPx) => {
33937
+ if (previewMode) {
33938
+ return;
33939
+ }
33813
33940
  onUpdateNode((current) => {
33814
33941
  const nextWidthPx = resolveNextAgentGUIConversationRailWidthPx({
33815
33942
  currentWidthPx: current.conversationRailWidthPx,
@@ -33825,7 +33952,7 @@ var AgentGUINode = memo6(function AgentGUINode2({
33825
33952
  };
33826
33953
  });
33827
33954
  },
33828
- [onUpdateNode, width]
33955
+ [onUpdateNode, previewMode, width]
33829
33956
  );
33830
33957
  const isConversationRailManuallyCollapsed = state.conversationRailCollapsed === true;
33831
33958
  const isConversationRailAutoCollapsed = shouldAutoCollapseAgentGUIConversationRail(width);
@@ -33838,12 +33965,18 @@ var AgentGUINode = memo6(function AgentGUINode2({
33838
33965
  []
33839
33966
  );
33840
33967
  const toggleConversationRailCollapsed = useCallback20(() => {
33968
+ if (previewMode) {
33969
+ return;
33970
+ }
33841
33971
  onUpdateNode((current) => ({
33842
33972
  ...current,
33843
33973
  conversationRailCollapsed: current.conversationRailCollapsed !== true
33844
33974
  }));
33845
- }, [onUpdateNode]);
33975
+ }, [onUpdateNode, previewMode]);
33846
33976
  const handleConversationRailToggle = useCallback20(() => {
33977
+ if (previewMode) {
33978
+ return;
33979
+ }
33847
33980
  if (!isConversationRailAutoCollapsed) {
33848
33981
  toggleConversationRailCollapsed();
33849
33982
  return;
@@ -33873,6 +34006,7 @@ var AgentGUINode = memo6(function AgentGUINode2({
33873
34006
  onResize,
33874
34007
  onUpdateNode,
33875
34008
  position,
34009
+ previewMode,
33876
34010
  state.conversationRailWidthPx,
33877
34011
  toggleConversationRailCollapsed,
33878
34012
  width
@@ -33884,6 +34018,7 @@ var AgentGUINode = memo6(function AgentGUINode2({
33884
34018
  workspacePath,
33885
34019
  avoidGroupingEdits: agentSettings.avoidGroupingEdits,
33886
34020
  data: state,
34021
+ previewMode,
33887
34022
  onDataChange: handleDataChange,
33888
34023
  onShowMessage
33889
34024
  });
@@ -33909,6 +34044,9 @@ var AgentGUINode = memo6(function AgentGUINode2({
33909
34044
  provider: displayProviderLabel
33910
34045
  }
33911
34046
  ),
34047
+ collaboratorSessionReadOnlyPlaceholder: t(
34048
+ "agentHost.agentGui.collaboratorSessionReadOnlyPlaceholder"
34049
+ ),
33912
34050
  send: t("agentHost.agentGui.send"),
33913
34051
  modelLabel: t("agentHost.agentGui.modelLabel"),
33914
34052
  modelSelectionLabel: t("agentHost.agentGui.modelSelectionLabel"),
@@ -34232,7 +34370,7 @@ var AgentGUINode = memo6(function AgentGUINode2({
34232
34370
  t
34233
34371
  ]);
34234
34372
  useEffect23(() => {
34235
- if (!onAgentProbeDemandChange) {
34373
+ if (previewMode || !onAgentProbeDemandChange) {
34236
34374
  return;
34237
34375
  }
34238
34376
  const probeSourceId = `agent-gui:${nodeId}`;
@@ -34240,7 +34378,7 @@ var AgentGUINode = memo6(function AgentGUINode2({
34240
34378
  return () => {
34241
34379
  onAgentProbeDemandChange(null, probeSourceId);
34242
34380
  };
34243
- }, [activeProbeProvider, nodeId, onAgentProbeDemandChange]);
34381
+ }, [activeProbeProvider, nodeId, onAgentProbeDemandChange, previewMode]);
34244
34382
  return /* @__PURE__ */ jsx88(
34245
34383
  WorkspaceNodeWindow,
34246
34384
  {
@@ -34308,6 +34446,7 @@ var AgentGUINode = memo6(function AgentGUINode2({
34308
34446
  isAgentProviderReady: isActiveAgentProviderReady,
34309
34447
  slashStatusLimits,
34310
34448
  slashStatusLimitsLoading: workspaceAgentProbes?.isLoadingUsage ?? false,
34449
+ previewMode,
34311
34450
  showProjectSelector,
34312
34451
  onLinkAction: handleLinkAction,
34313
34452
  onAgentProviderLogin: onAgentProviderLogin ? handleAgentProviderLogin : void 0,