codex-to-im 1.0.30 → 1.0.31
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/daemon.mjs +24 -1
- package/package.json +1 -1
package/dist/daemon.mjs
CHANGED
|
@@ -18175,6 +18175,29 @@ function buildMirrorTitle(threadTitle, markdown = false) {
|
|
|
18175
18175
|
function buildMirrorSpeakerLabel(label, markdown = false) {
|
|
18176
18176
|
return markdown ? `**${label}:**` : `${label}:`;
|
|
18177
18177
|
}
|
|
18178
|
+
var MIRROR_USER_WRAPPER_LABELS = /* @__PURE__ */ new Map([
|
|
18179
|
+
["# Review findings:", "Review findings"],
|
|
18180
|
+
["# Context from my IDE setup:", "IDE setup"],
|
|
18181
|
+
["# Files mentioned by the user:", "Files"]
|
|
18182
|
+
]);
|
|
18183
|
+
var MIRROR_USER_REQUEST_MARKER = "## My request for Codex:";
|
|
18184
|
+
function formatMirrorUserText(text2) {
|
|
18185
|
+
const normalized = (text2 || "").replace(/\r\n?/g, "\n").trim();
|
|
18186
|
+
if (!normalized) return null;
|
|
18187
|
+
const lines = normalized.split("\n");
|
|
18188
|
+
const firstNonEmptyIndex = lines.findIndex((line) => line.trim().length > 0);
|
|
18189
|
+
if (firstNonEmptyIndex < 0) return null;
|
|
18190
|
+
const wrapperLabel = MIRROR_USER_WRAPPER_LABELS.get(lines[firstNonEmptyIndex].trim());
|
|
18191
|
+
if (!wrapperLabel) return normalized;
|
|
18192
|
+
const requestMarkerIndex = lines.findIndex(
|
|
18193
|
+
(line, index) => index > firstNonEmptyIndex && line.trim() === MIRROR_USER_REQUEST_MARKER
|
|
18194
|
+
);
|
|
18195
|
+
if (requestMarkerIndex < 0) return normalized;
|
|
18196
|
+
const requestBody = lines.slice(requestMarkerIndex + 1).join("\n").trim();
|
|
18197
|
+
if (!requestBody) return normalized;
|
|
18198
|
+
return `\uFF08\u57FA\u4E8E ${wrapperLabel}\uFF09
|
|
18199
|
+
${requestBody}`;
|
|
18200
|
+
}
|
|
18178
18201
|
function formatMirrorSpeakerBlock(label, text2, markdown = false, forceLabel = false) {
|
|
18179
18202
|
const normalized = (text2 || "").trim();
|
|
18180
18203
|
if (!normalized) {
|
|
@@ -18353,7 +18376,7 @@ function createMirrorTurnState(sessionId, timestamp, turnId) {
|
|
|
18353
18376
|
};
|
|
18354
18377
|
}
|
|
18355
18378
|
function appendMirrorUserText(turnState, chunk) {
|
|
18356
|
-
const normalized = chunk
|
|
18379
|
+
const normalized = formatMirrorUserText(chunk);
|
|
18357
18380
|
if (!normalized) return;
|
|
18358
18381
|
if (!turnState.userText) {
|
|
18359
18382
|
turnState.userText = normalized;
|
package/package.json
CHANGED