sisyphi 1.1.15 → 1.1.17

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/cli.js CHANGED
@@ -2875,6 +2875,67 @@ function registerSetup(program2) {
2875
2875
  });
2876
2876
  }
2877
2877
 
2878
+ // src/cli/commands/tmux-status.ts
2879
+ import { execSync as execSync12 } from "child_process";
2880
+ function registerTmuxStatus(program2) {
2881
+ program2.command("tmux-status").description("Output session status dots for tmux status bar").action(() => {
2882
+ try {
2883
+ const dots = execSync12(
2884
+ "tmux show-option -w -v @sisyphus_dots",
2885
+ { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
2886
+ ).trim();
2887
+ if (dots) process.stdout.write(dots);
2888
+ } catch {
2889
+ }
2890
+ });
2891
+ }
2892
+
2893
+ // src/cli/commands/tmux-sessions.ts
2894
+ import { execSync as execSync13 } from "child_process";
2895
+ var DOT_MAP = {
2896
+ "orchestrator:processing": { icon: "\u25CF", color: "#d4ad6a" },
2897
+ "orchestrator:idle": { icon: "\u25CF", color: "#d47766" },
2898
+ "agents:running": { icon: "\u25C6", color: "#d4ad6a" },
2899
+ "between-cycles": { icon: "\u25C6", color: "#5e584e" },
2900
+ "paused": { icon: "\u25CB", color: "#d47766" },
2901
+ "completed": { icon: "\u25CF", color: "#a9b16e" }
2902
+ };
2903
+ function tmuxExec(cmd) {
2904
+ try {
2905
+ return execSync13(cmd, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim();
2906
+ } catch {
2907
+ return null;
2908
+ }
2909
+ }
2910
+ function registerTmuxSessions(program2) {
2911
+ program2.command("tmux-sessions").description("Output sisyphus session list for tmux status bar").action(() => {
2912
+ const cwd = tmuxExec("tmux show-option -v @sisyphus_cwd");
2913
+ if (!cwd) return;
2914
+ const currentSession = tmuxExec("tmux display-message -p '#{session_name}'");
2915
+ const sessionList = tmuxExec('tmux list-sessions -F "#{session_name}"');
2916
+ if (!sessionList) return;
2917
+ const entries = [];
2918
+ for (const name of sessionList.split("\n").filter(Boolean)) {
2919
+ const scwd = tmuxExec(`tmux show-option -t "${name}" -v @sisyphus_cwd`);
2920
+ if (scwd !== cwd) continue;
2921
+ const phase = tmuxExec(`tmux show-option -t "${name}" -v @sisyphus_phase`);
2922
+ const displayName = name.replace(/^sisyphus-/, "");
2923
+ entries.push({ name, displayName, phase });
2924
+ }
2925
+ if (entries.length <= 1) return;
2926
+ const parts = entries.map((e) => {
2927
+ const dot = e.phase ? DOT_MAP[e.phase] : null;
2928
+ const dotStr = dot ? ` #[fg=${dot.color}]${dot.icon}` : "";
2929
+ const isCurrent = e.name === currentSession;
2930
+ if (isCurrent) {
2931
+ return `#[fg=#e2d9c6,bold]${e.displayName}${dotStr}#[default]`;
2932
+ }
2933
+ return `#[fg=#5e584e]${e.displayName}${dotStr}#[default]`;
2934
+ });
2935
+ process.stdout.write(parts.join("#[fg=#3a3d42] \u2502 "));
2936
+ });
2937
+ }
2938
+
2878
2939
  // src/cli/index.ts
2879
2940
  var nodeVersion = parseInt(process.versions.node.split(".")[0], 10);
2880
2941
  if (nodeVersion < 22) {
@@ -2914,6 +2975,8 @@ registerCompanionContext(program);
2914
2975
  registerGettingStarted(program);
2915
2976
  registerInit(program);
2916
2977
  registerSetup(program);
2978
+ registerTmuxStatus(program);
2979
+ registerTmuxSessions(program);
2917
2980
  program.addHelpText("after", `
2918
2981
  Examples:
2919
2982
  $ sisyphus start "Implement auth system" Start a new session