codex-blocker 0.1.0 → 0.1.1
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/bin.js
CHANGED
|
@@ -209,6 +209,15 @@ function parseCodexLine(line, sessionId) {
|
|
|
209
209
|
if (entryType === "event_msg" && innerTypeString === "agent_message") {
|
|
210
210
|
markIdle = true;
|
|
211
211
|
}
|
|
212
|
+
if (entryType === "response_item" && innerTypeString === "message") {
|
|
213
|
+
const role = innerPayload && typeof innerPayload === "object" ? innerPayload.role : void 0;
|
|
214
|
+
if (role === "user") {
|
|
215
|
+
const messageText = extractMessageText(innerPayload);
|
|
216
|
+
if (!messageText || !messageText.trim().startsWith("<environment_context>")) {
|
|
217
|
+
markWorking = true;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
212
221
|
} catch {
|
|
213
222
|
}
|
|
214
223
|
return {
|
|
@@ -219,6 +228,20 @@ function parseCodexLine(line, sessionId) {
|
|
|
219
228
|
markIdle
|
|
220
229
|
};
|
|
221
230
|
}
|
|
231
|
+
function extractMessageText(payload) {
|
|
232
|
+
if (!payload || typeof payload !== "object") return void 0;
|
|
233
|
+
const record = payload;
|
|
234
|
+
const content = record.content;
|
|
235
|
+
if (typeof content === "string") return content;
|
|
236
|
+
if (!Array.isArray(content)) return void 0;
|
|
237
|
+
const parts = [];
|
|
238
|
+
for (const item of content) {
|
|
239
|
+
if (!item || typeof item !== "object") continue;
|
|
240
|
+
const text = item.text;
|
|
241
|
+
if (typeof text === "string") parts.push(text);
|
|
242
|
+
}
|
|
243
|
+
return parts.length > 0 ? parts.join("\n") : void 0;
|
|
244
|
+
}
|
|
222
245
|
|
|
223
246
|
// src/codex.ts
|
|
224
247
|
var DEFAULT_CODEX_HOME = join(homedir(), ".codex");
|
package/dist/server.js
CHANGED
package/package.json
CHANGED