@phren/cli 0.3.7 → 0.3.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.
@@ -73,10 +73,12 @@ export declare function tmuxKey(key: string): string | undefined;
73
73
  export declare function sendKeysCalls(pane: string, keys: string[]): string[][];
74
74
  export declare const tmuxTerminal: TerminalProvider;
75
75
  /** The tmux servers the Hook drives, as `/v1/muxes` lists servers: the owner's
76
- * servers that answer, and the hidden server whenever tmux is installed (a
77
- * launch starts it). `kind` stays "herdr", the phone's name for the Hook's
76
+ * servers that answer, and (unless `hidden: false`) the hidden server whenever
77
+ * tmux is installed (a launch starts it). `kind` stays "herdr", the phone's name for the Hook's
78
78
  * session protocol; `terminal` names the multiplexer. */
79
- export declare function tmuxServers(): Promise<Json[]>;
79
+ export declare function tmuxServers(options?: {
80
+ hidden?: boolean;
81
+ }): Promise<Json[]>;
80
82
  /** What `phren bridge doctor` and the health details say about tmux. */
81
83
  export interface TmuxHealth {
82
84
  /** "off" when PHREN_TMUX=off, "missing" without a tmux executable. */
@@ -494,13 +494,14 @@ async function ownerServers() {
494
494
  return names.filter((_, index) => running[index]);
495
495
  }
496
496
  /** The tmux servers the Hook drives, as `/v1/muxes` lists servers: the owner's
497
- * servers that answer, and the hidden server whenever tmux is installed (a
498
- * launch starts it). `kind` stays "herdr", the phone's name for the Hook's
497
+ * servers that answer, and (unless `hidden: false`) the hidden server whenever
498
+ * tmux is installed (a launch starts it). `kind` stays "herdr", the phone's name for the Hook's
499
499
  * session protocol; `terminal` names the multiplexer. */
500
- export async function tmuxServers() {
500
+ export async function tmuxServers(options = {}) {
501
501
  if (!deps.binary())
502
502
  return [];
503
- return [...await ownerServers(), TMUX_HIDDEN].map(name => ({ id: `tmux:${name}`, kind: "herdr", terminal: "tmux", session: name, running: true }));
503
+ return [...await ownerServers(), ...(options.hidden ?? true ? [TMUX_HIDDEN] : [])]
504
+ .map(name => ({ id: `tmux:${name}`, kind: "herdr", terminal: "tmux", session: name, running: true }));
504
505
  }
505
506
  export async function tmuxHealth() {
506
507
  if (process.env.PHREN_TMUX === "off")
@@ -8,6 +8,7 @@ import { promisify } from "node:util";
8
8
  import { fanoutRoot } from "./fanouts.js";
9
9
  import { atomicInPrivateDir, bridgeRoot, object } from "./protocol.js";
10
10
  import { stripTerminal } from "../terminal-text.js";
11
+ import { codexExecutable } from "./codex-binary.js";
11
12
  const exec = promisify(execFile);
12
13
  const claudeFile = () => path.join(bridgeRoot(), "usage", "claude.json");
13
14
  const safeText = (v) => typeof v === "string" ? v.replace(/[\x00-\x1f\x7f]/g, "").slice(0, 100) : undefined;
@@ -648,7 +649,7 @@ async function liveClaudeUsage(now) {
648
649
  }
649
650
  }
650
651
  /** Only initialize and read limits. Never create a thread, prompt, or login. */
651
- export function readCodexLimits(executable = "codex") {
652
+ export function readCodexLimits(executable = codexExecutable()) {
652
653
  return new Promise(resolve => {
653
654
  const child = spawn(executable, ["app-server"], { cwd: homedir(), stdio: ["pipe", "pipe", "ignore"] });
654
655
  let pending = "", bytes = 0, initialized = false, done = false;