@moxt-ai/mobius 0.0.115 → 0.0.116

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/index.js CHANGED
@@ -27695,6 +27695,18 @@ var CODEX_META_KEY = "codex";
27695
27695
  function truncate4(value, limit) {
27696
27696
  return value.length <= limit ? value : value.slice(0, limit);
27697
27697
  }
27698
+ function boundedParagraphs(values, limit) {
27699
+ let text = "";
27700
+ for (const value of values) {
27701
+ const separator = text.length === 0 ? "" : "\n\n";
27702
+ const remaining = limit - text.length;
27703
+ if (remaining <= separator.length) {
27704
+ break;
27705
+ }
27706
+ text += `${separator}${value.slice(0, remaining - separator.length)}`;
27707
+ }
27708
+ return text;
27709
+ }
27698
27710
  function textContent(text) {
27699
27711
  const block = { text: truncate4(text, TOOL_OUTPUT_CHARACTER_LIMIT), type: "text" };
27700
27712
  return { content: block, type: "content" };
@@ -27812,6 +27824,12 @@ function decodeThreadItem(value) {
27812
27824
  const decoded = threadItemSchema.safeParse(value);
27813
27825
  return decoded.success ? decoded.data : null;
27814
27826
  }
27827
+ function reasoningText(item) {
27828
+ if (item.type !== "reasoning") {
27829
+ return null;
27830
+ }
27831
+ return boundedParagraphs(item.summary.length > 0 ? item.summary : item.content, TOOL_OUTPUT_CHARACTER_LIMIT);
27832
+ }
27815
27833
  function agentMessageMeta(phase) {
27816
27834
  if (phase == null) {
27817
27835
  return null;
@@ -28580,6 +28598,19 @@ var CodexAcpAgent = class {
28580
28598
  });
28581
28599
  return;
28582
28600
  }
28601
+ const reasoning = reasoningText(item);
28602
+ if (reasoning !== null) {
28603
+ if (method === "item/completed" && reasoning.length > 0) {
28604
+ await this.#enqueue(async () => {
28605
+ await this.#emit({
28606
+ content: { text: reasoning, type: "text" },
28607
+ messageId: item.id,
28608
+ sessionUpdate: "agent_thought_chunk"
28609
+ });
28610
+ });
28611
+ }
28612
+ return;
28613
+ }
28583
28614
  const update = toolCallUpdate(item, method === "item/completed" ? "completed" : "started");
28584
28615
  if (update !== null) {
28585
28616
  await this.#enqueue(async () => {