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
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  DEFAULT_PORT,
4
4
  startServer
5
- } from "./chunk-APDAIY47.js";
5
+ } from "./chunk-SOAB3RMQ.js";
6
6
 
7
7
  // src/bin.ts
8
8
  import { createRequire } from "module";
@@ -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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  startServer
3
- } from "./chunk-APDAIY47.js";
3
+ } from "./chunk-SOAB3RMQ.js";
4
4
  export {
5
5
  startServer
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-blocker",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Automatically blocks distracting websites unless Codex is actively running. Forked from Theo Browne's (T3) Claude Blocker",
5
5
  "author": "Adam Blumoff ",
6
6
  "repository": {