@blade-hq/agent-kit 0.5.3 → 0.5.4

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,7 +1,7 @@
1
1
  import {
2
2
  apiFetchResponse,
3
3
  getAuthedUrl
4
- } from "./chunk-UQEXX57F.js";
4
+ } from "./chunk-HWOVPFWG.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"]);
@@ -124,4 +124,4 @@ export {
124
124
  CollapsibleTrigger,
125
125
  CollapsibleContent
126
126
  };
127
- //# sourceMappingURL=chunk-IRCXJHXT.js.map
127
+ //# sourceMappingURL=chunk-3ZEWA2YM.js.map
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  getAuthedUrl,
7
7
  useUiStore
8
- } from "./chunk-UQEXX57F.js";
8
+ } from "./chunk-HWOVPFWG.js";
9
9
  import {
10
10
  cn,
11
11
  copyToClipboard
@@ -1576,4 +1576,4 @@ export {
1576
1576
  PlanSummaryCard,
1577
1577
  extractLatestPlanMessages
1578
1578
  };
1579
- //# sourceMappingURL=chunk-ZQQNSKQS.js.map
1579
+ //# sourceMappingURL=chunk-557R7QZV.js.map
@@ -1124,17 +1124,17 @@ function buildMessageContent2(turn) {
1124
1124
  return JSON.stringify(block.content);
1125
1125
  }).join("");
1126
1126
  }
1127
- function buildReasoning(turn) {
1128
- const thinking = turn.blocks.filter((block) => block.type === "thinking").map((block) => typeof block.content === "string" ? block.content : JSON.stringify(block.content)).filter(Boolean);
1129
- if (thinking.length === 0) return void 0;
1130
- return thinking.join("\n\n");
1131
- }
1132
- function buildAskUserAnswerContent(turn) {
1127
+ function askUserAnswerContent(turn) {
1133
1128
  const answerBlock = turn.blocks.find((block) => block.type === "ask_user_answer");
1134
1129
  if (!answerBlock || !isRecord3(answerBlock.content)) return null;
1135
1130
  const answer = answerBlock.content.answer;
1136
1131
  return typeof answer === "string" && answer.trim().length > 0 ? answer : null;
1137
1132
  }
1133
+ function buildReasoning(turn) {
1134
+ const thinking = turn.blocks.filter((block) => block.type === "thinking").map((block) => typeof block.content === "string" ? block.content : JSON.stringify(block.content)).filter(Boolean);
1135
+ if (thinking.length === 0) return void 0;
1136
+ return thinking.join("\n\n");
1137
+ }
1138
1138
  function isModeChangeContent(value) {
1139
1139
  return typeof value === "object" && value !== null && typeof value.from === "string" && typeof value.to === "string";
1140
1140
  }
@@ -1193,14 +1193,12 @@ function projectionToMessage(turn) {
1193
1193
  status: turn.status
1194
1194
  };
1195
1195
  }
1196
- if (turn.blocks.some((block) => block.type === "ask_user_answer")) {
1197
- const answerContent = buildAskUserAnswerContent(turn);
1198
- if (answerContent === null) return null;
1196
+ const askAnswer = askUserAnswerContent(turn);
1197
+ if (askAnswer !== null) {
1199
1198
  return {
1200
1199
  role: "user",
1201
- content: answerContent,
1200
+ content: askAnswer,
1202
1201
  blocks: turn.blocks,
1203
- kind: "ask_user_answer",
1204
1202
  loop_name: turn.loop_id,
1205
1203
  entry_id: turn.turn_id,
1206
1204
  status: turn.status,
@@ -1278,7 +1276,11 @@ function applyPlanningSideEffects(sessionId, turns) {
1278
1276
  }
1279
1277
  }
1280
1278
  function materialize(turns) {
1281
- const messages = turns.map(projectionToMessage).filter((message) => message !== null);
1279
+ const messages = turns.map(projectionToMessage).filter((message) => message !== null).filter((message, index, allMessages) => {
1280
+ if (!message.blocks?.some((block) => block.type === "ask_user_answer")) return true;
1281
+ const next = allMessages[index + 1];
1282
+ return !(next?.role === "user" && next.content === message.content);
1283
+ });
1282
1284
  const activeCompaction = [...turns].reverse().find(
1283
1285
  (turn) => turn.kind === "compaction" && turn.status === "streaming" && typeof turn.compaction_id === "string"
1284
1286
  );
@@ -3091,4 +3093,4 @@ export {
3091
3093
  bootstrapBladeClient,
3092
3094
  getBootstrappedClient
3093
3095
  };
3094
- //# sourceMappingURL=chunk-UQEXX57F.js.map
3096
+ //# sourceMappingURL=chunk-HWOVPFWG.js.map