@mindstudio-ai/remy 0.1.159 → 0.1.160

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.
package/dist/headless.js CHANGED
@@ -5848,6 +5848,7 @@ async function runTurn(params) {
5848
5848
  const contentBlocks = [];
5849
5849
  const thinkingBlockStartTimes = [];
5850
5850
  let thinkingCompleteCount = 0;
5851
+ let textBlockOpen = false;
5851
5852
  const toolInputAccumulators = /* @__PURE__ */ new Map();
5852
5853
  let stopReason = "end_turn";
5853
5854
  let subAgentText = "";
@@ -5958,7 +5959,7 @@ async function runTurn(params) {
5958
5959
  switch (event.type) {
5959
5960
  case "text": {
5960
5961
  const lastBlock = contentBlocks.at(-1);
5961
- if (lastBlock?.type === "text") {
5962
+ if (lastBlock?.type === "text" && textBlockOpen) {
5962
5963
  lastBlock.text += event.text;
5963
5964
  } else {
5964
5965
  contentBlocks.push({
@@ -5967,12 +5968,14 @@ async function runTurn(params) {
5967
5968
  startedAt: event.ts
5968
5969
  });
5969
5970
  }
5971
+ textBlockOpen = true;
5970
5972
  onEvent({ type: "text", text: event.text });
5971
5973
  break;
5972
5974
  }
5973
5975
  case "thinking":
5974
5976
  if (event.text === "") {
5975
5977
  thinkingBlockStartTimes.push(event.ts);
5978
+ textBlockOpen = false;
5976
5979
  }
5977
5980
  onEvent({ type: "thinking", text: event.text });
5978
5981
  break;
package/dist/index.js CHANGED
@@ -6447,6 +6447,7 @@ async function runTurn(params) {
6447
6447
  const contentBlocks = [];
6448
6448
  const thinkingBlockStartTimes = [];
6449
6449
  let thinkingCompleteCount = 0;
6450
+ let textBlockOpen = false;
6450
6451
  const toolInputAccumulators = /* @__PURE__ */ new Map();
6451
6452
  let stopReason = "end_turn";
6452
6453
  let subAgentText = "";
@@ -6557,7 +6558,7 @@ async function runTurn(params) {
6557
6558
  switch (event.type) {
6558
6559
  case "text": {
6559
6560
  const lastBlock = contentBlocks.at(-1);
6560
- if (lastBlock?.type === "text") {
6561
+ if (lastBlock?.type === "text" && textBlockOpen) {
6561
6562
  lastBlock.text += event.text;
6562
6563
  } else {
6563
6564
  contentBlocks.push({
@@ -6566,12 +6567,14 @@ async function runTurn(params) {
6566
6567
  startedAt: event.ts
6567
6568
  });
6568
6569
  }
6570
+ textBlockOpen = true;
6569
6571
  onEvent({ type: "text", text: event.text });
6570
6572
  break;
6571
6573
  }
6572
6574
  case "thinking":
6573
6575
  if (event.text === "") {
6574
6576
  thinkingBlockStartTimes.push(event.ts);
6577
+ textBlockOpen = false;
6575
6578
  }
6576
6579
  onEvent({ type: "thinking", text: event.text });
6577
6580
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/remy",
3
- "version": "0.1.159",
3
+ "version": "0.1.160",
4
4
  "description": "MindStudio coding agent",
5
5
  "repository": {
6
6
  "type": "git",