agent-blocked 0.1.7 → 0.1.9

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/README.md CHANGED
@@ -43,6 +43,18 @@ node .agent-blocked/report.mjs --event=needs_credentials --severity=critical --r
43
43
 
44
44
  Codex hook reporting is installed by `npx agent-blocked@latest install --tool=codex`. Restart Codex or start a new Codex session after installation so the hook config is loaded.
45
45
 
46
+ If you already had a Codex session open in that repo, exit the old session and choose the session to resume with:
47
+
48
+ ```bash
49
+ npx agent-blocked@latest restart --tool=codex
50
+ ```
51
+
52
+ To skip the picker and resume the most recent session:
53
+
54
+ ```bash
55
+ npx agent-blocked@latest restart --tool=codex --last
56
+ ```
57
+
46
58
  Codex can also be run through the wrapper when you want hard process exits reported:
47
59
 
48
60
  ```bash
@@ -502,6 +502,7 @@ function install() {
502
502
  console.log("\nNext: set AGENT_BLOCKED_AGENT_TOKEN in the shell or secret store where your agent runs.");
503
503
  if (selected.includes("codex")) {
504
504
  console.log("Codex hook reporting is installed. Restart Codex or start a new Codex session if it was already running.");
505
+ console.log("To choose an existing Codex session with hooks loaded, run: npx agent-blocked@latest restart --tool=codex");
505
506
  }
506
507
  console.log("Manual report command: node .agent-blocked/report.mjs --event=needs_direction --severity=medium --reason=\"Need human direction\"");
507
508
  }
@@ -572,6 +573,30 @@ async function codex() {
572
573
  process.exit(code || 0);
573
574
  }
574
575
 
576
+ async function restart() {
577
+ const tool = arg("tool", "codex").toLowerCase();
578
+ if (tool !== "codex") {
579
+ console.error("Restart helper currently supports --tool=codex.");
580
+ process.exit(1);
581
+ }
582
+
583
+ const resumeArgs = hasFlag("last") ? ["resume", "--last"] : ["resume"];
584
+ console.log(
585
+ hasFlag("last")
586
+ ? "Starting a fresh Codex process with the most recent session. Exit the old Codex session first if it is still open."
587
+ : "Starting a fresh Codex process with the session picker. Exit the old Codex session first if it is still open."
588
+ );
589
+ process.argv = [
590
+ process.argv[0],
591
+ process.argv[1],
592
+ "codex",
593
+ "--",
594
+ "codex",
595
+ ...resumeArgs
596
+ ];
597
+ await codex();
598
+ }
599
+
575
600
  function help() {
576
601
  console.log(`Agent Blocked CLI
577
602
 
@@ -579,9 +604,12 @@ Usage:
579
604
  agent-blocked install --tool=claude|codex|gemini|aider|all
580
605
  agent-blocked report --event=needs_direction --severity=medium --reason="Need human help"
581
606
  agent-blocked codex -- codex "your task"
607
+ agent-blocked restart --tool=codex [--last]
582
608
 
583
609
  Examples:
584
610
  npx agent-blocked@latest install --tool=all
611
+ npx agent-blocked@latest restart --tool=codex
612
+ npx agent-blocked@latest restart --tool=codex --last
585
613
  npx agent-blocked@latest report --event=needs_credentials --severity=critical --reason="Missing AWS credentials"
586
614
  `);
587
615
  }
@@ -596,6 +624,9 @@ switch (commandName()) {
596
624
  case "codex":
597
625
  await codex();
598
626
  break;
627
+ case "restart":
628
+ await restart();
629
+ break;
599
630
  default:
600
631
  help();
601
632
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-blocked",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "CLI installer and reporter for Agent Blocked AI agent escalation alerts.",
5
5
  "type": "module",
6
6
  "bin": {