@blade-hq/agent-kit 0.5.31 → 0.5.32

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.
@@ -1280,7 +1280,7 @@ var useChatStore = create3()((set) => ({
1280
1280
  turn_id: turnId,
1281
1281
  loop_id: "root",
1282
1282
  role: "user",
1283
- status: "completed",
1283
+ status: "streaming",
1284
1284
  blocks: [{ type: "text", content }],
1285
1285
  tool_calls: [],
1286
1286
  model: null,
@@ -1295,7 +1295,10 @@ var useChatStore = create3()((set) => ({
1295
1295
  },
1296
1296
  upsertTurn: (sessionId, turn) => {
1297
1297
  set((state) => {
1298
- const existing = [...state.turns[sessionId] ?? []];
1298
+ let existing = [...state.turns[sessionId] ?? []];
1299
+ if (turn.role === "user" && !turn.turn_id.startsWith("local-user-")) {
1300
+ existing = existing.filter((t) => !t.turn_id.startsWith("local-user-"));
1301
+ }
1299
1302
  const index = existing.findIndex((item) => item.turn_id === turn.turn_id);
1300
1303
  if (index >= 0) {
1301
1304
  existing[index] = turn;
@@ -2910,6 +2913,9 @@ var AgentSocket = class {
2910
2913
  }
2911
2914
  send(sessionId, message, mode, askuserAnswer, extras) {
2912
2915
  this._ensureConnected();
2916
+ if (!(askuserAnswer && typeof askuserAnswer.tool_call_id === "string")) {
2917
+ useChatStore.getState().addUserMessage(sessionId, message);
2918
+ }
2913
2919
  useChatStore.getState().setStreaming(sessionId, true);
2914
2920
  if (askuserAnswer && typeof askuserAnswer.tool_call_id === "string") {
2915
2921
  const { tool_call_id, ...rest } = askuserAnswer;
@@ -3248,4 +3254,4 @@ export {
3248
3254
  bootstrapBladeClient,
3249
3255
  getBootstrappedClient
3250
3256
  };
3251
- //# sourceMappingURL=chunk-OPMRX65X.js.map
3257
+ //# sourceMappingURL=chunk-QMOW3TDA.js.map