@parhelia/core 0.1.12663 → 0.1.12694

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.
@@ -9,6 +9,7 @@ import { findComponent, getComponentById } from "../componentTreeHelper";
9
9
  import { getOperationsContext } from "./operations";
10
10
  import { handleErrorResult } from "./helpers";
11
11
  import { executeFieldAction as executeFieldServerAction, connectSocket, getEditHistory, getRunningOperations, reconnectSession, releaseFieldLocks, validateItems, } from "../services/editService";
12
+ import { emitAgentDocumentsChanged } from "../services/agentService";
12
13
  import { useEditorWebSocket } from "./hooks/useEditorWebSocket";
13
14
  import { createEditorSocketDiagnostics, } from "./socketDiagnostics";
14
15
  import { localStorageService } from "../services/localStorageService";
@@ -425,6 +426,7 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
425
426
  const [suggestedEdits, setSuggestedEdits] = useState([]);
426
427
  const [showSuggestedEdits, setShowSuggestedEdits] = useState(false);
427
428
  const [showSuggestedEditsDiff, setShowSuggestedEditsDiff] = useState(false);
429
+ const [showVersionDiffHighlighting, setShowVersionDiffHighlighting] = useState(false);
428
430
  const [availableCommentTags, setAvailableCommentTags] = useState([]);
429
431
  const [showComments, setShowComments] = useState(() => {
430
432
  return localStorageService.getOrSetItem("editor.showComments", true);
@@ -781,6 +783,29 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
781
783
  catch { }
782
784
  };
783
785
  }, [addSocketMessageListener]);
786
+ // Bridge backend agent:documents:changed pushes to the in-process browser event
787
+ // that AgentDocumentList listens to. Single global subscriber so any tool that
788
+ // mutates the agent document store via AgentDocumentRepository refreshes the UI
789
+ // automatically; no per-tool allow-list needed.
790
+ useEffect(() => {
791
+ const removeListener = addSocketMessageListener((message) => {
792
+ if (message.type !== "agent:documents:changed")
793
+ return;
794
+ const agentId = message.payload?.agentId ?? message.payload?.AgentId;
795
+ if (!agentId)
796
+ return;
797
+ emitAgentDocumentsChanged({
798
+ agentId: String(agentId),
799
+ reason: message.payload?.reason ?? message.payload?.Reason,
800
+ });
801
+ });
802
+ return () => {
803
+ try {
804
+ removeListener();
805
+ }
806
+ catch { }
807
+ };
808
+ }, [addSocketMessageListener]);
784
809
  const shouldLoadReviews = openSidebars.includes("reviews") ||
785
810
  workspaceId === "reviews" ||
786
811
  workspaceId === "comments";
@@ -4351,6 +4376,8 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
4351
4376
  setShowSuggestedEdits,
4352
4377
  showSuggestedEditsDiff,
4353
4378
  setShowSuggestedEditsDiff,
4379
+ showVersionDiffHighlighting,
4380
+ setShowVersionDiffHighlighting,
4354
4381
  enableCompletions,
4355
4382
  setEnableCompletions,
4356
4383
  showComponentNavigator,