@tutti-os/agent-gui 0.0.98 → 0.0.99

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/agent-gui.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AgentGUI
3
- } from "./chunk-7O4D4KOE.js";
3
+ } from "./chunk-PLCHNOXL.js";
4
4
  import "./chunk-MRRICFWA.js";
5
5
  import "./chunk-QWGJ5TEG.js";
6
6
  import "./chunk-4ROALW3K.js";
@@ -7263,6 +7263,7 @@ function useAgentGUIContinueConversation(input) {
7263
7263
  import {
7264
7264
  useCallback as useCallback10
7265
7265
  } from "react";
7266
+ import { flushSync } from "react-dom";
7266
7267
  function useAgentGUIConversationBatchDeletion(input) {
7267
7268
  const {
7268
7269
  isDeletingProjectConversations,
@@ -7283,7 +7284,6 @@ function useAgentGUIConversationBatchDeletion(input) {
7283
7284
  removeConversations,
7284
7285
  workspaceId,
7285
7286
  setIsDeletingProjectConversations,
7286
- setAgentSessionViewMessagesLoading,
7287
7287
  agentActivityRuntime,
7288
7288
  dataRef,
7289
7289
  agentHostApi
@@ -7312,31 +7312,15 @@ function useAgentGUIConversationBatchDeletion(input) {
7312
7312
  type: "queue/sessionCleaned"
7313
7313
  });
7314
7314
  }
7315
- const nextConversations = conversationsRef.current.filter(
7316
- (conversation) => !targetIds.has(conversation.id)
7317
- );
7318
- const currentActiveId = activeConversationIdRef.current;
7319
- if (currentActiveId && targetIds.has(currentActiveId)) {
7320
- const nextActive = nextConversations[0]?.id ?? null;
7321
- if (nextActive) {
7322
- markSelectedConversationDetailPending(nextActive);
7323
- setIntent({ tag: "active", id: nextActive });
7324
- } else {
7325
- setIsLoadingMessages(false);
7326
- setIntent({ tag: "home" });
7327
- }
7328
- activeConversationIdRef.current = nextActive;
7329
- setActiveConversationId(nextActive);
7330
- persistActiveConversation(nextActive);
7331
- }
7332
7315
  removeConversations([...targetIds]);
7333
7316
  },
7334
7317
  [
7335
- markSelectedConversationDetailPending,
7336
- persistActiveConversation,
7318
+ deleteAgentSessionView,
7319
+ removeConversations,
7337
7320
  sessionEngine,
7338
7321
  sessionViewRef,
7339
- removeConversations
7322
+ setDraftByScopeKey,
7323
+ submittedDraftSnapshotsRef
7340
7324
  ]
7341
7325
  );
7342
7326
  const confirmDeleteProjectConversations = useCallback10(
@@ -7399,11 +7383,23 @@ function useAgentGUIConversationBatchDeletion(input) {
7399
7383
  setListError(null);
7400
7384
  const activeDeletedConversationId = activeConversationIdRef.current;
7401
7385
  if (activeDeletedConversationId && targetIds.has(activeDeletedConversationId)) {
7402
- setIsLoadingMessages(true);
7403
- setAgentSessionViewMessagesLoading(
7404
- sessionViewRef(activeDeletedConversationId),
7405
- true
7406
- );
7386
+ const nextActive = conversationsRef.current.find(
7387
+ (conversation) => !targetIds.has(conversation.id)
7388
+ )?.id ?? null;
7389
+ if (nextActive) {
7390
+ markSelectedConversationDetailPending(nextActive);
7391
+ }
7392
+ activeConversationIdRef.current = nextActive;
7393
+ flushSync(() => {
7394
+ if (nextActive) {
7395
+ setIntent({ tag: "active", id: nextActive });
7396
+ } else {
7397
+ setIsLoadingMessages(false);
7398
+ setIntent({ tag: "home" });
7399
+ }
7400
+ setActiveConversationId(nextActive);
7401
+ });
7402
+ persistActiveConversation(nextActive);
7407
7403
  }
7408
7404
  void deleteSessionsBatch({
7409
7405
  sessionIds: [...targetIds],
@@ -7426,23 +7422,26 @@ function useAgentGUIConversationBatchDeletion(input) {
7426
7422
  });
7427
7423
  setListError(message);
7428
7424
  showAgentGUIControllerErrorToast(agentHostApi.toast, message);
7429
- if (activeDeletedConversationId && activeConversationIdRef.current === activeDeletedConversationId) {
7430
- setIsLoadingMessages(false);
7431
- setAgentSessionViewMessagesLoading(
7432
- sessionViewRef(activeDeletedConversationId),
7433
- false
7434
- );
7435
- }
7436
7425
  }).finally(() => {
7437
7426
  setIsDeletingProjectConversations(false);
7438
7427
  });
7439
7428
  },
7440
7429
  [
7430
+ activeConversationIdRef,
7441
7431
  agentActivityRuntime,
7432
+ agentHostApi.toast,
7433
+ conversationsRef,
7434
+ dataRef,
7442
7435
  finalizeConversationBatchDeletion,
7443
7436
  isDeletingProjectConversations,
7444
- sessionViewRef,
7445
- agentHostApi.toast,
7437
+ markSelectedConversationDetailPending,
7438
+ persistActiveConversation,
7439
+ setActiveConversationId,
7440
+ setDetailError,
7441
+ setIntent,
7442
+ setIsDeletingProjectConversations,
7443
+ setIsLoadingMessages,
7444
+ setListError,
7446
7445
  workspaceId
7447
7446
  ]
7448
7447
  );
@@ -7456,6 +7455,7 @@ function useAgentGUIConversationBatchDeletion(input) {
7456
7455
  import {
7457
7456
  useCallback as useCallback11
7458
7457
  } from "react";
7458
+ import { flushSync as flushSync2 } from "react-dom";
7459
7459
  function useAgentGUIConversationDeletion(input) {
7460
7460
  const {
7461
7461
  isDeletingConversation,
@@ -7466,7 +7466,6 @@ function useAgentGUIConversationDeletion(input) {
7466
7466
  setIsDeletingConversation,
7467
7467
  activeConversationIdRef,
7468
7468
  setIsLoadingMessages,
7469
- setAgentSessionViewMessagesLoading,
7470
7469
  sessionViewRef,
7471
7470
  activation,
7472
7471
  agentActivityRuntime,
@@ -7481,7 +7480,6 @@ function useAgentGUIConversationDeletion(input) {
7481
7480
  persistActiveConversation,
7482
7481
  removeConversations,
7483
7482
  agentHostApi,
7484
- conversationListQuery,
7485
7483
  workspaceId
7486
7484
  } = input;
7487
7485
  const requestDeleteConversation = useCallback11(
@@ -7515,8 +7513,28 @@ function useAgentGUIConversationDeletion(input) {
7515
7513
  setIsDeletingConversation(true);
7516
7514
  setDetailError(null);
7517
7515
  if (activeConversationIdRef.current === target.id) {
7518
- setIsLoadingMessages(true);
7519
- setAgentSessionViewMessagesLoading(sessionViewRef(target.id), true);
7516
+ const currentConversations = conversationsRef.current;
7517
+ const targetIndex = currentConversations.findIndex(
7518
+ (conversation) => conversation.id === target.id
7519
+ );
7520
+ const nextConversations = currentConversations.filter(
7521
+ (conversation) => conversation.id !== target.id
7522
+ );
7523
+ const nextActive = nextConversations[Math.max(0, targetIndex)]?.id ?? nextConversations[Math.max(0, targetIndex - 1)]?.id ?? null;
7524
+ if (nextActive) {
7525
+ markSelectedConversationDetailPending(nextActive);
7526
+ }
7527
+ activeConversationIdRef.current = nextActive;
7528
+ flushSync2(() => {
7529
+ if (nextActive) {
7530
+ setIntent({ tag: "active", id: nextActive });
7531
+ } else {
7532
+ setIsLoadingMessages(false);
7533
+ setIntent({ tag: "home" });
7534
+ }
7535
+ setActiveConversationId(nextActive);
7536
+ });
7537
+ persistActiveConversation(nextActive);
7520
7538
  }
7521
7539
  void activation.unactivate(target.id).then(
7522
7540
  () => agentActivityRuntime.deleteSession({
@@ -7542,26 +7560,6 @@ function useAgentGUIConversationDeletion(input) {
7542
7560
  type: "queue/sessionCleaned"
7543
7561
  });
7544
7562
  deleteAgentSessionView(sessionViewRef(target.id));
7545
- const currentConversations = conversationsRef.current;
7546
- const targetIndex = currentConversations.findIndex(
7547
- (conversation) => conversation.id === target.id
7548
- );
7549
- const nextConversations = currentConversations.filter(
7550
- (conversation) => conversation.id !== target.id
7551
- );
7552
- if (activeConversationIdRef.current === target.id) {
7553
- const nextActive = nextConversations[Math.max(0, targetIndex)]?.id ?? nextConversations[Math.max(0, targetIndex - 1)]?.id ?? null;
7554
- if (nextActive) {
7555
- markSelectedConversationDetailPending(nextActive);
7556
- setIntent({ tag: "active", id: nextActive });
7557
- } else {
7558
- setIsLoadingMessages(false);
7559
- setIntent({ tag: "home" });
7560
- }
7561
- activeConversationIdRef.current = nextActive;
7562
- setActiveConversationId(nextActive);
7563
- persistActiveConversation(nextActive);
7564
- }
7565
7563
  removeConversations([target.id]);
7566
7564
  setPendingDeleteConversation(null);
7567
7565
  }).catch((error) => {
@@ -7575,26 +7573,32 @@ function useAgentGUIConversationDeletion(input) {
7575
7573
  workspaceId
7576
7574
  });
7577
7575
  showAgentGUIControllerErrorToast(agentHostApi.toast, message);
7578
- if (activeConversationIdRef.current === target.id) {
7579
- setIsLoadingMessages(false);
7580
- setAgentSessionViewMessagesLoading(sessionViewRef(target.id), false);
7581
- }
7582
7576
  }).finally(() => {
7583
7577
  setIsDeletingConversation(false);
7584
7578
  });
7585
7579
  }, [
7586
7580
  activation,
7587
- conversationListQuery,
7581
+ activeConversationIdRef,
7582
+ agentActivityRuntime,
7583
+ agentHostApi.toast,
7584
+ conversationsRef,
7585
+ deleteAgentSessionView,
7588
7586
  isDeletingConversation,
7589
- pendingDeleteConversation,
7590
7587
  markSelectedConversationDetailPending,
7588
+ pendingDeleteConversation,
7591
7589
  persistActiveConversation,
7592
- workspaceId,
7593
- sessionViewRef,
7594
- agentActivityRuntime,
7595
- agentHostApi.toast,
7590
+ removeConversations,
7596
7591
  sessionEngine,
7597
- removeConversations
7592
+ sessionViewRef,
7593
+ setActiveConversationId,
7594
+ setDetailError,
7595
+ setDraftByScopeKey,
7596
+ setIntent,
7597
+ setIsDeletingConversation,
7598
+ setIsLoadingMessages,
7599
+ setPendingDeleteConversation,
7600
+ submittedDraftSnapshotsRef,
7601
+ workspaceId
7598
7602
  ]);
7599
7603
  return {
7600
7604
  requestDeleteConversation,
@@ -14945,7 +14949,7 @@ function AgentSlashStatusPanel({
14945
14949
  }
14946
14950
 
14947
14951
  // agent-gui/agentGuiNode/composer/useComposerDraftAttachments.ts
14948
- import { flushSync } from "react-dom";
14952
+ import { flushSync as flushSync3 } from "react-dom";
14949
14953
  import {
14950
14954
  useCallback as useCallback28,
14951
14955
  useRef as useRef19
@@ -15508,7 +15512,7 @@ ${item.text}` : item.text;
15508
15512
  }
15509
15513
  void onRequestWorkspaceReferences(entity).then((result) => {
15510
15514
  if (result.files.length > 0 || result.mentionItems.length > 0) {
15511
- flushSync(clearActiveFileMentionTrigger);
15515
+ flushSync3(clearActiveFileMentionTrigger);
15512
15516
  }
15513
15517
  return applyReferencePickResult(result);
15514
15518
  });
@@ -33744,4 +33748,4 @@ export {
33744
33748
  resolveAgentGUIAgentTarget,
33745
33749
  AgentGUI
33746
33750
  };
33747
- //# sourceMappingURL=chunk-7O4D4KOE.js.map
33751
+ //# sourceMappingURL=chunk-PLCHNOXL.js.map