@blade-hq/agent-kit 0.5.23 → 0.5.24

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.
@@ -1543,6 +1543,7 @@ var useSessionStore = create5()((set, get) => ({
1543
1543
  loading: false,
1544
1544
  modes: {},
1545
1545
  rewindDrafts: {},
1546
+ errorMessages: {},
1546
1547
  _freshSessions: /* @__PURE__ */ new Set(),
1547
1548
  fetchSessions: async () => {
1548
1549
  set({ loading: true });
@@ -1727,6 +1728,17 @@ var useSessionStore = create5()((set, get) => ({
1727
1728
  }));
1728
1729
  invalidateHomeSidebarSessions();
1729
1730
  },
1731
+ setErrorMessage: (sessionId, message) => {
1732
+ set((state) => ({
1733
+ errorMessages: { ...state.errorMessages, [sessionId]: message }
1734
+ }));
1735
+ },
1736
+ clearErrorMessage: (sessionId) => {
1737
+ set((state) => {
1738
+ const { [sessionId]: _, ...rest } = state.errorMessages;
1739
+ return { errorMessages: rest };
1740
+ });
1741
+ },
1730
1742
  setRewindDraft: (sessionId, text) => {
1731
1743
  set((state) => {
1732
1744
  if (text == null) {
@@ -1767,6 +1779,7 @@ var useSessionStore = create5()((set, get) => ({
1767
1779
  loading: false,
1768
1780
  modes: {},
1769
1781
  rewindDrafts: {},
1782
+ errorMessages: {},
1770
1783
  _freshSessions: /* @__PURE__ */ new Set()
1771
1784
  });
1772
1785
  invalidateHomeSidebarSessions();
@@ -2406,6 +2419,7 @@ var AgentSocket = class {
2406
2419
  const sessionId = this._resolveSessionId(data);
2407
2420
  if (!sessionId) return;
2408
2421
  useSessionStore.getState().updateSessionStatus(sessionId, "running");
2422
+ useSessionStore.getState().clearErrorMessage(sessionId);
2409
2423
  useChatStore.getState().setStreaming(sessionId, true);
2410
2424
  });
2411
2425
  s.on("chat:end", (data) => {
@@ -2445,8 +2459,8 @@ var AgentSocket = class {
2445
2459
  this._flushPendingTurnPatches(sessionId);
2446
2460
  const message = isOomText(data.message) ? OOM_MESSAGE : data.message;
2447
2461
  useSessionStore.getState().updateSessionStatus(sessionId, "failed");
2462
+ useSessionStore.getState().setErrorMessage(sessionId, message);
2448
2463
  useChatStore.getState().markFailed(sessionId);
2449
- useChatStore.getState().addErrorMessage(sessionId, message);
2450
2464
  useChatStore.getState().setStreaming(sessionId, false);
2451
2465
  useRuntimeStore.getState().addEvent(sessionId, {
2452
2466
  type: "system:error",
@@ -2519,6 +2533,7 @@ var AgentSocket = class {
2519
2533
  const { modes, ...rest } = useSessionStore.getState();
2520
2534
  const { [sessionId]: _, ...restModes } = modes;
2521
2535
  useSessionStore.setState({ ...rest, modes: restModes });
2536
+ useSessionStore.getState().clearErrorMessage(sessionId);
2522
2537
  useSessionStore.getState().setActiveSession(sessionId);
2523
2538
  useRuntimeStore.getState().addEvent(sessionId, {
2524
2539
  type: "session:rewind",
@@ -3188,4 +3203,4 @@ export {
3188
3203
  bootstrapBladeClient,
3189
3204
  getBootstrappedClient
3190
3205
  };
3191
- //# sourceMappingURL=chunk-B4RZNR3L.js.map
3206
+ //# sourceMappingURL=chunk-DTDZFQRY.js.map