@parhelia/core 0.1.12663 → 0.1.12676

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";
@@ -781,6 +782,29 @@ export function EditorShell({ configuration, className, item: loadItemDescriptor
781
782
  catch { }
782
783
  };
783
784
  }, [addSocketMessageListener]);
785
+ // Bridge backend agent:documents:changed pushes to the in-process browser event
786
+ // that AgentDocumentList listens to. Single global subscriber so any tool that
787
+ // mutates the agent document store via AgentDocumentRepository refreshes the UI
788
+ // automatically; no per-tool allow-list needed.
789
+ useEffect(() => {
790
+ const removeListener = addSocketMessageListener((message) => {
791
+ if (message.type !== "agent:documents:changed")
792
+ return;
793
+ const agentId = message.payload?.agentId ?? message.payload?.AgentId;
794
+ if (!agentId)
795
+ return;
796
+ emitAgentDocumentsChanged({
797
+ agentId: String(agentId),
798
+ reason: message.payload?.reason ?? message.payload?.Reason,
799
+ });
800
+ });
801
+ return () => {
802
+ try {
803
+ removeListener();
804
+ }
805
+ catch { }
806
+ };
807
+ }, [addSocketMessageListener]);
784
808
  const shouldLoadReviews = openSidebars.includes("reviews") ||
785
809
  workspaceId === "reviews" ||
786
810
  workspaceId === "comments";