@blade-hq/agent-kit 0.5.30 → 0.5.31

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useSessionStore
3
- } from "./chunk-JWHBUVSM.js";
3
+ } from "./chunk-OPMRX65X.js";
4
4
 
5
5
  // src/react/hooks/use-session.ts
6
6
  function useSession() {
@@ -27,4 +27,4 @@ function useSession() {
27
27
  export {
28
28
  useSession
29
29
  };
30
- //# sourceMappingURL=chunk-EP5LVNO3.js.map
30
+ //# sourceMappingURL=chunk-4XBNTPVS.js.map
@@ -5,12 +5,12 @@ import {
5
5
  import {
6
6
  getSessionFilePath,
7
7
  resolveSessionFilePreviewTarget
8
- } from "./chunk-XTEHNSFN.js";
8
+ } from "./chunk-KMQQDKGU.js";
9
9
  import {
10
10
  formatToolName,
11
11
  getAuthedUrl,
12
12
  useUiStore
13
- } from "./chunk-JWHBUVSM.js";
13
+ } from "./chunk-OPMRX65X.js";
14
14
  import {
15
15
  cn,
16
16
  copyToClipboard
@@ -1933,4 +1933,4 @@ export {
1933
1933
  PlanSummaryCard,
1934
1934
  extractLatestPlanMessages
1935
1935
  };
1936
- //# sourceMappingURL=chunk-S66X23O7.js.map
1936
+ //# sourceMappingURL=chunk-BUQRNLEE.js.map
@@ -8,7 +8,7 @@ import {
8
8
  getCodeLanguageFromFilename,
9
9
  parseAskUserQuestion,
10
10
  useHighlightedCodeHtml
11
- } from "./chunk-S66X23O7.js";
11
+ } from "./chunk-BUQRNLEE.js";
12
12
  import {
13
13
  Collapsible,
14
14
  CollapsibleContent,
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-H62LH2AG.js";
17
17
  import {
18
18
  resolveSessionFilePreviewTarget
19
- } from "./chunk-XTEHNSFN.js";
19
+ } from "./chunk-KMQQDKGU.js";
20
20
  import {
21
21
  apiFetchResponse,
22
22
  buildMessageContent,
@@ -60,7 +60,7 @@ import {
60
60
  useUiBridgeStore,
61
61
  useUiStore,
62
62
  writeFile
63
- } from "./chunk-JWHBUVSM.js";
63
+ } from "./chunk-OPMRX65X.js";
64
64
  import {
65
65
  registerBridgeIframe,
66
66
  tapBridgeEvent
@@ -8534,4 +8534,4 @@ use-stick-to-bottom/dist/StickToBottom.js:
8534
8534
  * Licensed under the MIT License. See License.txt in the project root for license information.
8535
8535
  *--------------------------------------------------------------------------------------------*)
8536
8536
  */
8537
- //# sourceMappingURL=chunk-UW55FYRL.js.map
8537
+ //# sourceMappingURL=chunk-HFVB57MR.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  apiFetchResponse,
3
3
  getAuthedUrl
4
- } from "./chunk-JWHBUVSM.js";
4
+ } from "./chunk-OPMRX65X.js";
5
5
 
6
6
  // src/react/lib/session-file-preview.ts
7
7
  var IMAGE_EXTS = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "svg", "webp", "ico", "bmp"]);
@@ -101,4 +101,4 @@ export {
101
101
  resolveTextPreviewType,
102
102
  resolveSessionFilePreviewTarget
103
103
  };
104
- //# sourceMappingURL=chunk-XTEHNSFN.js.map
104
+ //# sourceMappingURL=chunk-KMQQDKGU.js.map
@@ -905,7 +905,11 @@ function upsertArtifactState(state, target, options) {
905
905
  const targetKey = target.key ?? target.title;
906
906
  const applyUiState = (partial) => ({
907
907
  ...partial,
908
- ...reveal ? { rightPanelCollapsed: false, activeRightTab: "preview" } : {}
908
+ ...reveal ? {
909
+ rightPanelCollapsed: false,
910
+ activeRightTab: "preview",
911
+ rightTabActivationId: state.rightTabActivationId + 1
912
+ } : {}
909
913
  });
910
914
  const existing = state.artifacts.findIndex((artifact) => targetKey && (artifact.key ?? artifact.title) === targetKey);
911
915
  if (existing >= 0) {
@@ -929,6 +933,7 @@ var useUiStore = create2()((set) => ({
929
933
  leftPanelCollapsed: false,
930
934
  rightPanelCollapsed: false,
931
935
  activeRightTab: "situation",
936
+ rightTabActivationId: 0,
932
937
  artifacts: [],
933
938
  activeArtifactIndex: -1,
934
939
  theme: storedTheme,
@@ -938,7 +943,10 @@ var useUiStore = create2()((set) => ({
938
943
  setRightPanelCollapsed: (collapsed) => set({ rightPanelCollapsed: collapsed }),
939
944
  toggleLeftPanel: () => set((s) => ({ leftPanelCollapsed: !s.leftPanelCollapsed })),
940
945
  toggleRightPanel: () => set((s) => ({ rightPanelCollapsed: !s.rightPanelCollapsed })),
941
- setActiveRightTab: (tab) => set({ activeRightTab: tab }),
946
+ setActiveRightTab: (tab) => set((state) => ({
947
+ activeRightTab: tab,
948
+ rightTabActivationId: state.rightTabActivationId + 1
949
+ })),
942
950
  pushArtifact: (target) => set((state) => upsertArtifactState(state, target)),
943
951
  upsertArtifact: (target, options) => set((state) => upsertArtifactState(state, target, options)),
944
952
  setActiveArtifact: (index) => set({ activeArtifactIndex: index }),
@@ -949,7 +957,7 @@ var useUiStore = create2()((set) => ({
949
957
  return removeArtifactAtIndex(state, index);
950
958
  }),
951
959
  clearArtifacts: () => set({ artifacts: [], activeArtifactIndex: -1 }),
952
- setPreviewTarget: (target) => set(() => {
960
+ setPreviewTarget: (target) => set((state) => {
953
961
  if (target === null) {
954
962
  return { artifacts: [], activeArtifactIndex: -1 };
955
963
  }
@@ -957,7 +965,8 @@ var useUiStore = create2()((set) => ({
957
965
  artifacts: [target],
958
966
  activeArtifactIndex: 0,
959
967
  rightPanelCollapsed: false,
960
- activeRightTab: "preview"
968
+ activeRightTab: "preview",
969
+ rightTabActivationId: state.rightTabActivationId + 1
961
970
  };
962
971
  }),
963
972
  setTheme: (theme) => {
@@ -2105,19 +2114,6 @@ function invalidateFileTree(sessionId) {
2105
2114
  if (!queryClient) return;
2106
2115
  void queryClient.invalidateQueries({ queryKey: ["file-tree", sessionId] });
2107
2116
  }
2108
- function shouldSuppressOptimisticUserMessage(sessionId, askuserAnswer) {
2109
- if (askuserAnswer && typeof askuserAnswer.tool_call_id === "string") {
2110
- return true;
2111
- }
2112
- const session = useSessionStore.getState().sessions.find((item) => item.id === sessionId);
2113
- if (session?.status !== "waiting_for_input") {
2114
- return false;
2115
- }
2116
- const messages = useChatStore.getState().messages[sessionId] ?? [];
2117
- return messages.some(
2118
- (message) => (message.tool_calls ?? []).some((toolCall) => toolCall.status === "awaiting_answer")
2119
- );
2120
- }
2121
2117
  function invalidateSkillStats2(sessionId) {
2122
2118
  const queryClient = globalThis.__agentQueryClient;
2123
2119
  if (!queryClient) return;
@@ -2914,13 +2910,6 @@ var AgentSocket = class {
2914
2910
  }
2915
2911
  send(sessionId, message, mode, askuserAnswer, extras) {
2916
2912
  this._ensureConnected();
2917
- const suppressOptimisticUserMessage = shouldSuppressOptimisticUserMessage(
2918
- sessionId,
2919
- askuserAnswer
2920
- );
2921
- if (!suppressOptimisticUserMessage) {
2922
- useChatStore.getState().addUserMessage(sessionId, message);
2923
- }
2924
2913
  useChatStore.getState().setStreaming(sessionId, true);
2925
2914
  if (askuserAnswer && typeof askuserAnswer.tool_call_id === "string") {
2926
2915
  const { tool_call_id, ...rest } = askuserAnswer;
@@ -2930,14 +2919,12 @@ var AgentSocket = class {
2930
2919
  [tool_call_id]: rest
2931
2920
  });
2932
2921
  }
2933
- if (!suppressOptimisticUserMessage) {
2934
- useRuntimeStore.getState().addEvent(sessionId, {
2935
- type: "chat:start",
2936
- title: "User prompt sent",
2937
- status: "running",
2938
- detail: contentPreview(message)
2939
- });
2940
- }
2922
+ useRuntimeStore.getState().addEvent(sessionId, {
2923
+ type: "chat:start",
2924
+ title: "User prompt sent",
2925
+ status: "running",
2926
+ detail: contentPreview(message)
2927
+ });
2941
2928
  if (!extras?.replay_decision) {
2942
2929
  this.pendingReplayMessages.set(sessionId, message);
2943
2930
  this.pendingReplayModes.set(sessionId, mode);
@@ -3261,4 +3248,4 @@ export {
3261
3248
  bootstrapBladeClient,
3262
3249
  getBootstrappedClient
3263
3250
  };
3264
- //# sourceMappingURL=chunk-JWHBUVSM.js.map
3251
+ //# sourceMappingURL=chunk-OPMRX65X.js.map