@tutti-os/agent-gui 0.0.6 → 0.0.8

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-3D3TO2MH.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,
@@ -25461,6 +25542,7 @@ function AgentProjectDropdown({
25461
25542
  }
25462
25543
  ),
25463
25544
  selectedProjectPath: composerSettings.selectedProjectPath,
25545
+ service: agentHostApi.userProjects?.service ?? null,
25464
25546
  showCreateProjectAction: true,
25465
25547
  onProjectMissingChange,
25466
25548
  onProjectPathChange
@@ -30313,6 +30395,7 @@ function AgentComposer({
30313
30395
  ref: inputShellRef,
30314
30396
  className: cn(inputShellClassName, "relative"),
30315
30397
  "data-input-disabled": inputDisabled ? "true" : void 0,
30398
+ title: inputDisabled && disabledReasonText ? disabledReasonText : void 0,
30316
30399
  style: inputShellStyle,
30317
30400
  children: [
30318
30401
  /* @__PURE__ */ jsxs54(
@@ -31058,6 +31141,14 @@ function agentGuiPerfNowMs() {
31058
31141
  function roundAgentGuiPerfMs(value) {
31059
31142
  return Math.round(value * 100) / 100;
31060
31143
  }
31144
+ function isDifferentKnownConversationOwner(input) {
31145
+ const conversationUserId = input.conversationUserId?.trim() ?? "";
31146
+ const currentUserId = input.currentUserId?.trim() ?? "";
31147
+ if (!conversationUserId || !currentUserId || conversationUserId === "local" || currentUserId === "local") {
31148
+ return false;
31149
+ }
31150
+ return conversationUserId !== currentUserId;
31151
+ }
31061
31152
  function isContextCanceledMessage(message) {
31062
31153
  const normalized = message?.trim().toLowerCase() ?? "";
31063
31154
  return normalized === "context canceled";
@@ -31218,6 +31309,9 @@ function conversationHasActiveWork2(conversation) {
31218
31309
  return false;
31219
31310
  }) ?? false;
31220
31311
  }
31312
+ function isSettledConversationStatus2(status) {
31313
+ return status === "completed" || status === "failed" || status === "canceled";
31314
+ }
31221
31315
  function resolveActiveConversationBusyStatus(input) {
31222
31316
  if (input.conversationStatus === "waiting" || input.detailStatus === "waiting") {
31223
31317
  return "waiting";
@@ -31225,6 +31319,9 @@ function resolveActiveConversationBusyStatus(input) {
31225
31319
  if (input.conversationStatus === "working" || input.detailStatus === "working") {
31226
31320
  return "working";
31227
31321
  }
31322
+ if (isSettledConversationStatus2(input.conversationStatus) || isSettledConversationStatus2(input.detailStatus)) {
31323
+ return null;
31324
+ }
31228
31325
  if (conversationHasActiveWork2(input.conversation)) {
31229
31326
  return "working";
31230
31327
  }
@@ -31252,6 +31349,7 @@ function AgentGUINodeView({
31252
31349
  isAgentProviderReady,
31253
31350
  slashStatusLimits = [],
31254
31351
  slashStatusLimitsLoading = false,
31352
+ previewMode = false,
31255
31353
  showProjectSelector = true,
31256
31354
  onAgentProviderLogin,
31257
31355
  actions,
@@ -31280,6 +31378,9 @@ function AgentGUINodeView({
31280
31378
  ] = useState26(0);
31281
31379
  const workspaceReferencePickerResolverRef = useRef20(null);
31282
31380
  const requestWorkspaceReferences = useCallback18(async () => {
31381
+ if (previewMode) {
31382
+ return [];
31383
+ }
31283
31384
  if (!workspaceFileReferenceAdapter || !workspaceFileReferenceCopy) {
31284
31385
  return [];
31285
31386
  }
@@ -31287,7 +31388,7 @@ function AgentGUINodeView({
31287
31388
  return await new Promise((resolve) => {
31288
31389
  workspaceReferencePickerResolverRef.current = resolve;
31289
31390
  });
31290
- }, [workspaceFileReferenceAdapter, workspaceFileReferenceCopy]);
31391
+ }, [previewMode, workspaceFileReferenceAdapter, workspaceFileReferenceCopy]);
31291
31392
  const closeWorkspaceReferencePicker = useCallback18(() => {
31292
31393
  workspaceReferencePickerResolverRef.current?.([]);
31293
31394
  workspaceReferencePickerResolverRef.current = null;
@@ -31310,6 +31411,9 @@ function AgentGUINodeView({
31310
31411
  const detailComposerFocusRequestSequence = localComposerFocusRequestSequence === 0 ? composerFocusRequestSequence : (composerFocusRequestSequence ?? 0) + localComposerFocusRequestSequence;
31311
31412
  const requestCreateConversation = useCallback18(
31312
31413
  (options) => {
31414
+ if (previewMode) {
31415
+ return;
31416
+ }
31313
31417
  if (options) {
31314
31418
  actions.createConversation(options);
31315
31419
  } else {
@@ -31317,7 +31421,7 @@ function AgentGUINodeView({
31317
31421
  }
31318
31422
  setLocalComposerFocusRequestSequence((current) => current + 1);
31319
31423
  },
31320
- [actions]
31424
+ [actions, previewMode]
31321
31425
  );
31322
31426
  const effectiveWorkspaceAppIcons = useMemo15(
31323
31427
  () => mergeWorkspaceAppIconsFromCommands({
@@ -31336,6 +31440,9 @@ function AgentGUINodeView({
31336
31440
  );
31337
31441
  const handleConversationRailResizePointerDown = useCallback18(
31338
31442
  (event) => {
31443
+ if (previewMode) {
31444
+ return;
31445
+ }
31339
31446
  if (conversationRailCollapsed || event.button !== 0) {
31340
31447
  return;
31341
31448
  }
@@ -31348,10 +31455,13 @@ function AgentGUINodeView({
31348
31455
  };
31349
31456
  setIsRailResizing(true);
31350
31457
  },
31351
- [conversationRailCollapsed, conversationRailWidthPx]
31458
+ [conversationRailCollapsed, conversationRailWidthPx, previewMode]
31352
31459
  );
31353
31460
  const handleConversationRailResizePointerMove = useCallback18(
31354
31461
  (event) => {
31462
+ if (previewMode) {
31463
+ return;
31464
+ }
31355
31465
  const resizeState = railResizeInteractionRef.current;
31356
31466
  if (!resizeState || resizeState.pointerId !== event.pointerId) {
31357
31467
  return;
@@ -31361,7 +31471,7 @@ function AgentGUINodeView({
31361
31471
  );
31362
31472
  onConversationRailWidthChanged(nextWidthPx);
31363
31473
  },
31364
- [clampConversationRailWidth, onConversationRailWidthChanged]
31474
+ [clampConversationRailWidth, onConversationRailWidthChanged, previewMode]
31365
31475
  );
31366
31476
  const endConversationRailResize = useCallback18(
31367
31477
  (event) => {
@@ -31375,6 +31485,9 @@ function AgentGUINodeView({
31375
31485
  );
31376
31486
  const handleConversationRailResizeKeyDown = useCallback18(
31377
31487
  (event) => {
31488
+ if (previewMode) {
31489
+ return;
31490
+ }
31378
31491
  if (conversationRailCollapsed) {
31379
31492
  return;
31380
31493
  }
@@ -31392,7 +31505,8 @@ function AgentGUINodeView({
31392
31505
  clampConversationRailWidth,
31393
31506
  conversationRailCollapsed,
31394
31507
  conversationRailWidthPx,
31395
- onConversationRailWidthChanged
31508
+ onConversationRailWidthChanged,
31509
+ previewMode
31396
31510
  ]
31397
31511
  );
31398
31512
  const layoutStyle = {
@@ -31401,90 +31515,99 @@ function AgentGUINodeView({
31401
31515
  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
31516
  };
31403
31517
  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,
31518
+ /* @__PURE__ */ jsxs56(
31519
+ "div",
31520
+ {
31521
+ className: AgentGUINode_styles_default.layout,
31522
+ "data-agent-gui-preview": previewMode ? "true" : void 0,
31523
+ inert: previewMode ? true : void 0,
31524
+ style: layoutStyle,
31525
+ children: [
31526
+ /* @__PURE__ */ jsx86(
31527
+ "aside",
31528
+ {
31529
+ id: "agent-gui-conversation-rail",
31530
+ className: `${AgentGUINode_styles_default.railPanel}${conversationRailCollapsed ? ` ${AgentGUINode_styles_default.railPanelCollapsed}` : ""}`,
31531
+ "aria-hidden": conversationRailCollapsed ? "true" : void 0,
31532
+ inert: conversationRailCollapsed ? true : void 0,
31533
+ children: /* @__PURE__ */ jsx86(
31534
+ AgentGUIConversationRailPane,
31535
+ {
31536
+ conversations: viewModel.conversations,
31537
+ userProjects: viewModel.userProjects,
31538
+ activeConversationId: viewModel.activeConversationId,
31539
+ pendingDeleteConversationId: viewModel.pendingDeleteConversation?.id ?? null,
31540
+ isLoadingConversations: viewModel.isLoadingConversations,
31541
+ isDeletingConversation: viewModel.isDeletingConversation,
31542
+ isDeletingProjectConversations: viewModel.isDeletingProjectConversations,
31543
+ labels,
31544
+ workspaceUserProjectI18n,
31545
+ uiLanguage,
31546
+ showProjectSelector,
31547
+ createConversationDisabled,
31548
+ openclawGateway,
31549
+ isCollapsed: conversationRailCollapsed,
31550
+ onCreateConversation: requestCreateConversation,
31551
+ onRetryOpenclawGateway: actions.retryOpenclawGateway,
31552
+ onSelectConversation: actions.selectConversation,
31553
+ onToggleConversationPinned: actions.toggleConversationPinned,
31554
+ onRemoveProject: actions.removeProject,
31555
+ onConfirmDeleteProjectConversations: actions.confirmDeleteProjectConversations,
31556
+ onRequestDeleteConversation: actions.requestDeleteConversation,
31557
+ onCancelDeleteConversation: actions.cancelDeleteConversation,
31558
+ onConfirmDeleteConversation: actions.confirmDeleteConversation
31559
+ }
31560
+ )
31561
+ }
31562
+ ),
31563
+ /* @__PURE__ */ jsx86(
31564
+ "div",
31414
31565
  {
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,
31566
+ id: "agent-gui-conversation-rail-resize",
31567
+ className: conversationRailCollapsed ? `${AgentGUINode_styles_default.railResizeHandle} ${AgentGUINode_styles_default.railResizeHandleCollapsed} nodrag pointer-events-none opacity-0` : `${AgentGUINode_styles_default.railResizeHandle} nodrag`,
31568
+ role: "separator",
31569
+ "aria-label": labels.conversationRailResizeAria,
31570
+ "aria-hidden": conversationRailCollapsed ? "true" : void 0,
31571
+ "aria-orientation": "vertical",
31572
+ "aria-valuemin": conversationRailMinWidthPx,
31573
+ "aria-valuemax": conversationRailMaxWidthPx,
31574
+ "aria-valuenow": conversationRailCollapsed ? void 0 : conversationRailWidthPx,
31575
+ "data-resizing": isRailResizing ? "true" : void 0,
31576
+ "data-testid": "agent-gui-conversation-rail-resize-handle",
31577
+ tabIndex: conversationRailCollapsed ? -1 : 0,
31578
+ onBlur: () => endConversationRailResize(),
31579
+ onKeyDown: handleConversationRailResizeKeyDown,
31580
+ onPointerCancel: endConversationRailResize,
31581
+ onPointerDown: handleConversationRailResizePointerDown,
31582
+ onLostPointerCapture: endConversationRailResize,
31583
+ onPointerMove: handleConversationRailResizePointerMove,
31584
+ onPointerUp: endConversationRailResize
31585
+ }
31586
+ ),
31587
+ /* @__PURE__ */ jsx86("section", { id: "agent-gui-detail", className: AgentGUINode_styles_default.detailPanel, children: /* @__PURE__ */ jsx86(
31588
+ AgentGUIDetailPane,
31589
+ {
31590
+ viewModel,
31591
+ actions,
31422
31592
  labels,
31423
- workspaceUserProjectI18n,
31424
31593
  uiLanguage,
31594
+ isActive,
31595
+ composerFocusRequestSequence: detailComposerFocusRequestSequence,
31596
+ isAgentProviderReady,
31597
+ slashStatusLimits,
31598
+ slashStatusLimitsLoading,
31425
31599
  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
31600
+ onLinkAction,
31601
+ onAgentProviderLogin,
31602
+ onRequestWorkspaceReferences: requestWorkspaceReferences,
31603
+ richTextAtProviders,
31604
+ workspaceAppIcons: effectiveWorkspaceAppIcons,
31605
+ workspaceUserProjectI18n
31438
31606
  }
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
- ] }),
31607
+ ) })
31608
+ ]
31609
+ }
31610
+ ),
31488
31611
  /* @__PURE__ */ jsx86(
31489
31612
  WorkspaceFileReferencePicker,
31490
31613
  {
@@ -31661,11 +31784,15 @@ var AgentGUIDetailPane = memo5(function AgentGUIDetailPane2({
31661
31784
  const displayConversationStatus = viewModel.isSubmitting ? "working" : derivedBusyStatus ?? viewModel.activeConversation?.status;
31662
31785
  const activeConversationTurnBusy = viewModel.isSubmitting || derivedBusyStatus !== null;
31663
31786
  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() === "";
31787
+ const isCollaboratorConversation = isDifferentKnownConversationOwner({
31788
+ conversationUserId: viewModel.activeConversation?.userId,
31789
+ currentUserId: viewModel.currentUserId
31790
+ });
31791
+ const canQueueWhileBusy = viewModel.canQueueWhileBusy && isAgentProviderReady && !isCollaboratorConversation;
31792
+ const composerDisabledReason = isCollaboratorConversation ? labels.collaboratorSessionReadOnlyPlaceholder : isAgentProviderReady ? null : labels.installRequiredPlaceholder;
31793
+ const submitDisabled = isCollaboratorConversation || !isAgentProviderReady || !viewModel.canSubmit && !canQueueWhileBusy || viewModel.draftPrompt.trim() === "";
31667
31794
  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);
31795
+ const composerDisabled = hasNonRetryableRecoveryFailure || isCollaboratorConversation || !isAgentProviderReady || !canQueueWhileBusy && (viewModel.pendingApproval !== null || viewModel.pendingInteractivePrompt !== null || viewModel.isSubmitting || viewModel.isInterrupting || viewModel.isCreatingConversation);
31669
31796
  const showStopButton = !viewModel.isSubmitting && viewModel.activeLiveState !== "failed" && sessionChrome.auth === null && (activeConversationTurnBusy || viewModel.pendingApproval !== null || viewModel.pendingInteractivePrompt !== null || viewModel.isInterrupting) && !(canQueueWhileBusy && viewModel.draftPrompt.trim() !== "");
31670
31797
  const syncStatus = resolveSyncIndicatorStatus(
31671
31798
  viewModel.activeConversation?.syncState?.status
@@ -33012,6 +33139,7 @@ function AgentGUIProjectRailHeader({
33012
33139
  }
33013
33140
  ),
33014
33141
  selectedProjectPath: null,
33142
+ service: agentHostApi.userProjects?.service ?? null,
33015
33143
  shouldApplyPreparedSelection: false,
33016
33144
  showCreateProjectAction: true,
33017
33145
  showKnownProjectOptions: false,
@@ -33734,7 +33862,7 @@ function areAgentGUINodePropsEqual(previous, next) {
33734
33862
  previous.workspaceAgentProbes,
33735
33863
  next.workspaceAgentProbes,
33736
33864
  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;
33865
+ ) && 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
33866
  }
33739
33867
  var AgentGUINode = memo6(function AgentGUINode2({
33740
33868
  nodeId,
@@ -33768,7 +33896,8 @@ var AgentGUINode = memo6(function AgentGUINode2({
33768
33896
  managedAgentsState,
33769
33897
  richTextAtProviders,
33770
33898
  workspaceAppIcons,
33771
- embedded = false
33899
+ embedded = false,
33900
+ previewMode = false
33772
33901
  }) {
33773
33902
  "use memo";
33774
33903
  const { i18n, locale, t } = useTranslation();
@@ -33804,12 +33933,18 @@ var AgentGUINode = memo6(function AgentGUINode2({
33804
33933
  );
33805
33934
  const handleDataChange = useCallback20(
33806
33935
  (updater) => {
33936
+ if (previewMode) {
33937
+ return;
33938
+ }
33807
33939
  onUpdateNode(updater);
33808
33940
  },
33809
- [onUpdateNode]
33941
+ [onUpdateNode, previewMode]
33810
33942
  );
33811
33943
  const handleConversationRailWidthChanged = useCallback20(
33812
33944
  (widthPx) => {
33945
+ if (previewMode) {
33946
+ return;
33947
+ }
33813
33948
  onUpdateNode((current) => {
33814
33949
  const nextWidthPx = resolveNextAgentGUIConversationRailWidthPx({
33815
33950
  currentWidthPx: current.conversationRailWidthPx,
@@ -33825,7 +33960,7 @@ var AgentGUINode = memo6(function AgentGUINode2({
33825
33960
  };
33826
33961
  });
33827
33962
  },
33828
- [onUpdateNode, width]
33963
+ [onUpdateNode, previewMode, width]
33829
33964
  );
33830
33965
  const isConversationRailManuallyCollapsed = state.conversationRailCollapsed === true;
33831
33966
  const isConversationRailAutoCollapsed = shouldAutoCollapseAgentGUIConversationRail(width);
@@ -33838,12 +33973,18 @@ var AgentGUINode = memo6(function AgentGUINode2({
33838
33973
  []
33839
33974
  );
33840
33975
  const toggleConversationRailCollapsed = useCallback20(() => {
33976
+ if (previewMode) {
33977
+ return;
33978
+ }
33841
33979
  onUpdateNode((current) => ({
33842
33980
  ...current,
33843
33981
  conversationRailCollapsed: current.conversationRailCollapsed !== true
33844
33982
  }));
33845
- }, [onUpdateNode]);
33983
+ }, [onUpdateNode, previewMode]);
33846
33984
  const handleConversationRailToggle = useCallback20(() => {
33985
+ if (previewMode) {
33986
+ return;
33987
+ }
33847
33988
  if (!isConversationRailAutoCollapsed) {
33848
33989
  toggleConversationRailCollapsed();
33849
33990
  return;
@@ -33873,6 +34014,7 @@ var AgentGUINode = memo6(function AgentGUINode2({
33873
34014
  onResize,
33874
34015
  onUpdateNode,
33875
34016
  position,
34017
+ previewMode,
33876
34018
  state.conversationRailWidthPx,
33877
34019
  toggleConversationRailCollapsed,
33878
34020
  width
@@ -33884,6 +34026,7 @@ var AgentGUINode = memo6(function AgentGUINode2({
33884
34026
  workspacePath,
33885
34027
  avoidGroupingEdits: agentSettings.avoidGroupingEdits,
33886
34028
  data: state,
34029
+ previewMode,
33887
34030
  onDataChange: handleDataChange,
33888
34031
  onShowMessage
33889
34032
  });
@@ -33909,6 +34052,9 @@ var AgentGUINode = memo6(function AgentGUINode2({
33909
34052
  provider: displayProviderLabel
33910
34053
  }
33911
34054
  ),
34055
+ collaboratorSessionReadOnlyPlaceholder: t(
34056
+ "agentHost.agentGui.collaboratorSessionReadOnlyPlaceholder"
34057
+ ),
33912
34058
  send: t("agentHost.agentGui.send"),
33913
34059
  modelLabel: t("agentHost.agentGui.modelLabel"),
33914
34060
  modelSelectionLabel: t("agentHost.agentGui.modelSelectionLabel"),
@@ -34232,7 +34378,7 @@ var AgentGUINode = memo6(function AgentGUINode2({
34232
34378
  t
34233
34379
  ]);
34234
34380
  useEffect23(() => {
34235
- if (!onAgentProbeDemandChange) {
34381
+ if (previewMode || !onAgentProbeDemandChange) {
34236
34382
  return;
34237
34383
  }
34238
34384
  const probeSourceId = `agent-gui:${nodeId}`;
@@ -34240,7 +34386,7 @@ var AgentGUINode = memo6(function AgentGUINode2({
34240
34386
  return () => {
34241
34387
  onAgentProbeDemandChange(null, probeSourceId);
34242
34388
  };
34243
- }, [activeProbeProvider, nodeId, onAgentProbeDemandChange]);
34389
+ }, [activeProbeProvider, nodeId, onAgentProbeDemandChange, previewMode]);
34244
34390
  return /* @__PURE__ */ jsx88(
34245
34391
  WorkspaceNodeWindow,
34246
34392
  {
@@ -34308,6 +34454,7 @@ var AgentGUINode = memo6(function AgentGUINode2({
34308
34454
  isAgentProviderReady: isActiveAgentProviderReady,
34309
34455
  slashStatusLimits,
34310
34456
  slashStatusLimitsLoading: workspaceAgentProbes?.isLoadingUsage ?? false,
34457
+ previewMode,
34311
34458
  showProjectSelector,
34312
34459
  onLinkAction: handleLinkAction,
34313
34460
  onAgentProviderLogin: onAgentProviderLogin ? handleAgentProviderLogin : void 0,