codex-mobile-re 0.1.96 → 0.1.97

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.html CHANGED
@@ -12,7 +12,7 @@
12
12
  <link rel="icon" type="image/png" sizes="192x192" href="/icons/pwa-192x192.png" />
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png" />
14
14
  <title>Codex Web</title>
15
- <script type="module" crossorigin src="/assets/index-BCEfBt5u.js"></script>
15
+ <script type="module" crossorigin src="/assets/index-CNFcjd2m.js"></script>
16
16
  <link rel="stylesheet" crossorigin href="/assets/index-CJxQMdGE.css">
17
17
  </head>
18
18
  <body class="bg-slate-950">
package/dist-cli/index.js CHANGED
@@ -10073,6 +10073,22 @@ function mergeSessionCommandsIntoTurns(turns, sessionLogRaw) {
10073
10073
  const existingItems = Array.isArray(turnRecord.items) ? turnRecord.items : [];
10074
10074
  const agentMessages = existingItems.filter((it) => it.type === "agentMessage");
10075
10075
  const userMessages = existingItems.filter((it) => it.type === "userMessage");
10076
+ const reasoningsByMessageId = /* @__PURE__ */ new Map();
10077
+ let pendingReasonings = [];
10078
+ for (const item of existingItems) {
10079
+ if (item.type === "reasoning") {
10080
+ pendingReasonings.push(item);
10081
+ } else if (item.type === "agentMessage") {
10082
+ if (pendingReasonings.length > 0) {
10083
+ reasoningsByMessageId.set(String(item.id ?? ""), pendingReasonings);
10084
+ }
10085
+ pendingReasonings = [];
10086
+ }
10087
+ }
10088
+ const emitAgentMessage = (msg) => {
10089
+ const leading = reasoningsByMessageId.get(String(msg.id ?? "")) ?? [];
10090
+ interleaved.push(...leading, msg);
10091
+ };
10076
10092
  const agentSlotCount = slots.filter((slot) => slot.type === "agentMessage").length;
10077
10093
  const interleaved = [...userMessages];
10078
10094
  const recoveredIds = /* @__PURE__ */ new Set();
@@ -10086,13 +10102,13 @@ function mergeSessionCommandsIntoTurns(turns, sessionLogRaw) {
10086
10102
  recoveredIds.add(slot.fileChange.id);
10087
10103
  }
10088
10104
  }
10089
- interleaved.push(...agentMessages);
10105
+ for (const msg of agentMessages) emitAgentMessage(msg);
10090
10106
  } else {
10091
10107
  let agentIdx = 0;
10092
10108
  for (const slot of slots) {
10093
10109
  if (slot.type === "agentMessage") {
10094
10110
  if (agentIdx < agentMessages.length) {
10095
- interleaved.push(agentMessages[agentIdx]);
10111
+ emitAgentMessage(agentMessages[agentIdx]);
10096
10112
  agentIdx++;
10097
10113
  }
10098
10114
  } else if (slot.type === "commandExecution" && slot.command) {
@@ -10104,13 +10120,13 @@ function mergeSessionCommandsIntoTurns(turns, sessionLogRaw) {
10104
10120
  }
10105
10121
  }
10106
10122
  while (agentIdx < agentMessages.length) {
10107
- interleaved.push(agentMessages[agentIdx]);
10123
+ emitAgentMessage(agentMessages[agentIdx]);
10108
10124
  agentIdx++;
10109
10125
  }
10110
10126
  }
10111
10127
  const hasRecoveredWorkItems = recoveredIds.size > 0;
10112
10128
  for (const item of existingItems) {
10113
- if (item.type === "userMessage" || item.type === "agentMessage") continue;
10129
+ if (item.type === "userMessage" || item.type === "agentMessage" || item.type === "reasoning") continue;
10114
10130
  if (recoveredIds.has(String(item.id ?? ""))) continue;
10115
10131
  if (hasRecoveredWorkItems && (item.type === "commandExecution" || item.type === "fileChange")) continue;
10116
10132
  interleaved.push(item);