sisyphi 1.0.13 → 1.0.14

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.
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  globalConfigPath,
4
4
  projectConfigPath
5
- } from "./chunk-JXKUI4P6.js";
5
+ } from "./chunk-YGBGKMTF.js";
6
6
 
7
7
  // src/shared/config.ts
8
8
  import { readFileSync } from "fs";
@@ -84,4 +84,4 @@ export {
84
84
  exec,
85
85
  execSafe
86
86
  };
87
- //# sourceMappingURL=chunk-LWWRGQWM.js.map
87
+ //# sourceMappingURL=chunk-MMA43N67.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/shared/config.ts","../src/shared/env.ts","../src/shared/exec.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { globalConfigPath, projectConfigPath } from './paths.js';\n\nexport interface WorktreeConfig {\n copy?: string[];\n clone?: string[];\n symlink?: string[];\n init?: string;\n}\n\nexport type EffortLevel = 'low' | 'medium' | 'high' | 'max';\n\nexport type KeyedWorktreeConfig = Record<string, WorktreeConfig>;\n\nexport interface Config {\n model?: string;\n tmuxSession?: string;\n orchestratorPrompt?: string;\n pollIntervalMs?: number;\n autoUpdate?: boolean;\n orchestratorEffort?: EffortLevel;\n agentEffort?: EffortLevel;\n editor?: string;\n repos?: string[];\n}\n\nconst DEFAULT_CONFIG: Config = {\n pollIntervalMs: 5000,\n orchestratorEffort: 'high',\n agentEffort: 'medium',\n};\n\nfunction readJsonFile(filePath: string): Partial<Config> {\n try {\n const content = readFileSync(filePath, 'utf-8');\n return JSON.parse(content) as Partial<Config>;\n } catch {\n return {};\n }\n}\n\nexport function loadConfig(cwd: string): Config {\n const global = readJsonFile(globalConfigPath());\n const project = readJsonFile(projectConfigPath(cwd));\n return { ...DEFAULT_CONFIG, ...global, ...project };\n}\n","/**\n * Build a PATH string that includes common binary directories\n * across package managers and platforms.\n *\n * Prepends known directories that exist on the system to the current PATH.\n * This ensures tmux commands can find binaries installed by Homebrew,\n * MacPorts, nix, and other package managers.\n */\nexport function augmentedPath(): string {\n const rawPath = process.env['PATH'];\n const basePath = rawPath !== undefined && rawPath.length > 0 ? rawPath : '/usr/bin:/bin';\n\n // Common binary directories across platforms/package managers.\n // Only prepend ones that aren't already in PATH.\n const candidates = [\n '/opt/homebrew/bin', // Homebrew (Apple Silicon macOS)\n '/opt/homebrew/sbin', // Homebrew sbin\n '/usr/local/bin', // Homebrew (Intel macOS), manual installs\n '/usr/local/sbin', // Manual installs\n '/opt/local/bin', // MacPorts\n '/opt/local/sbin', // MacPorts\n '/home/linuxbrew/.linuxbrew/bin', // Linuxbrew\n ];\n\n // Check for nix profile paths\n const nixProfile = process.env['NIX_PROFILES'];\n if (nixProfile) {\n for (const p of nixProfile.split(' ').reverse()) {\n candidates.push(`${p}/bin`);\n }\n }\n\n const existing = new Set(basePath.split(':'));\n const prepend = candidates.filter(dir => !existing.has(dir));\n\n return prepend.length > 0 ? `${prepend.join(':')}:${basePath}` : basePath;\n}\n\n/**\n * Environment variables for child processes that need access to\n * user-installed binaries (tmux, git, claude, etc.).\n */\nexport function execEnv(): Record<string, string | undefined> {\n return {\n ...process.env,\n PATH: augmentedPath(),\n };\n}\n","import { execSync } from 'node:child_process';\nimport { execEnv } from './env.js';\n\nexport const EXEC_ENV = execEnv();\n\nexport function exec(cmd: string, cwd?: string): string {\n return execSync(cmd, { encoding: 'utf-8', env: EXEC_ENV, cwd }).trim();\n}\n\nexport function execSafe(cmd: string, cwd?: string): string | null {\n try {\n return execSync(cmd, { encoding: 'utf-8', env: EXEC_ENV, cwd, stdio: ['pipe', 'pipe', 'pipe'] }).trim();\n } catch { return null; }\n}\n"],"mappings":";;;;;;;AAAA,SAAS,oBAAoB;AA0B7B,IAAM,iBAAyB;AAAA,EAC7B,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,aAAa;AACf;AAEA,SAAS,aAAa,UAAmC;AACvD,MAAI;AACF,UAAM,UA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MAAI;AACF,WAAO,SAAS,KAAK,EAAE,UAAU,SAAS,KAAK,UAAU,KAAK,OAAO,CAAC,QAAQ,QAAQ,MAAM,EAAE,CAAC,EAAE,KAAK;AAAA,EACxG,QAAQ;AAAE,WAAO;AAAA,EAAM;AACzB;","names":[]}
@@ -5,7 +5,7 @@ import {
5
5
  sessionsDir,
6
6
  socketPath,
7
7
  statePath
8
- } from "./chunk-JXKUI4P6.js";
8
+ } from "./chunk-YGBGKMTF.js";
9
9
 
10
10
  // src/shared/utils.ts
11
11
  function computeActiveTimeMs(session) {
@@ -261,4 +261,4 @@ export {
261
261
  buildCompanionContext,
262
262
  buildSessionContext
263
263
  };
264
- //# sourceMappingURL=chunk-T7ETTIQK.js.map
264
+ //# sourceMappingURL=chunk-Q6VQOUN3.js.map
@@ -1,29 +1,4 @@
1
1
  #!/usr/bin/env node
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
2
 
28
3
  // src/shared/paths.ts
29
4
  import { homedir } from "os";
@@ -108,8 +83,6 @@ function worktreeBaseDir(cwd) {
108
83
  }
109
84
 
110
85
  export {
111
- __commonJS,
112
- __toESM,
113
86
  globalDir,
114
87
  socketPath,
115
88
  globalConfigPath,
@@ -137,4 +110,4 @@ export {
137
110
  worktreeConfigPath,
138
111
  worktreeBaseDir
139
112
  };
140
- //# sourceMappingURL=chunk-JXKUI4P6.js.map
113
+ //# sourceMappingURL=chunk-YGBGKMTF.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/shared/paths.ts"],"sourcesContent":["import { homedir } from 'node:os';\nimport { basename, join } from 'node:path';\n\nexport function globalDir(): string {\n return join(homedir(), '.sisyphus');\n}\n\nexport function socketPath(): string {\n return join(globalDir(), 'daemon.sock');\n}\n\nexport function globalConfigPath(): string {\n return join(globalDir(), 'config.json');\n}\n\nexport function daemonLogPath(): string {\n return join(globalDir(), 'daemon.log');\n}\n\nexport function daemonPidPath(): string {\n return join(globalDir(), 'daemon.pid');\n}\n\nexport function daemonUpdatingPath(): string {\n return join(globalDir(), 'updating');\n}\n\nexport function projectDir(cwd: string): string {\n return join(cwd, '.sisyphus');\n}\n\nexport function projectConfigPath(cwd: string): string {\n return join(projectDir(cwd), 'config.json');\n}\n\nexport function projectOrchestratorPromptPath(cwd: string): string {\n return join(projectDir(cwd), 'orchestrator.md');\n}\n\nexport function sessionsDir(cwd: string): string {\n return join(projectDir(cwd), 'sessions');\n}\n\nexport function sessionDir(cwd: string, sessionId: string): string {\n return join(sessionsDir(cwd), sessionId);\n}\n\nexport function statePath(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'state.json');\n}\n\nexport function reportsDir(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'reports');\n}\n\nexport function reportFilePath(cwd: string, sessionId: string, agentId: string, suffix: string): string {\n return join(reportsDir(cwd, sessionId), `${agentId}-${suffix}.md`);\n}\n\nexport function messagesDir(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'messages');\n}\n\nexport function promptsDir(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'prompts');\n}\n\nexport function contextDir(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'context');\n}\n\nexport function roadmapPath(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'roadmap.md');\n}\n\nexport function goalPath(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'goal.md');\n}\n\nexport function logsDir(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'logs');\n}\n\nexport function cycleLogPath(cwd: string, sessionId: string, cycle: number): string {\n return join(logsDir(cwd, sessionId), `cycle-${String(cycle).padStart(3, '0')}.md`);\n}\n\n// Backwards compat for old sessions\nexport function legacyLogsPath(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'logs.md');\n}\n\nexport function snapshotsDir(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'snapshots');\n}\n\nexport function snapshotDir(cwd: string, sessionId: string, cycle: number): string {\n return join(snapshotsDir(cwd, sessionId), `cycle-${cycle}`);\n}\n\nexport function worktreeConfigPath(cwd: string): string {\n return join(projectDir(cwd), 'worktree.json');\n}\n\nexport function worktreeBaseDir(cwd: string): string {\n return join(cwd, '..', `${basename(cwd)}-sisyphus-wt`);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,UAAU,YAAY;AAExB,SAAS,YAAoB;AAClC,SAAO,KAAK,QAAQ,GAAG,WAAW;AACpC;AAEO,SAAS,aAAqB;AACnC,SAAO,KAAK,UAAU,GAAG,aAAa;AACxC;AAEO,SAAS,mBAA2B;AACzC,SAAO,KAAK,UAAU,GAAG,aAAa;AACxC;AAEO,SAAS,gBAAwB;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W,KAAK,SAAS,GAAG,SAAS;AACnD;AAEO,SAAS,QAAQ,KAAa,WAA2B;AAC9D,SAAO,KAAK,WAAW,KAAK,SAAS,GAAG,MAAM;AAChD;AAEO,SAAS,aAAa,KAAa,WAAmB,OAAuB;AAClF,SAAO,KAAK,QAAQ,KAAK,SAAS,GAAG,SAAS,OAAO,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,KAAK;AACnF;AAGO,SAAS,eAAe,KAAa,WAA2B;AACrE,SAAO,KAAK,WAAW,KAAK,SAAS,GAAG,SAAS;AACnD;AAEO,SAAS,aAAa,KAAa,WAA2B;AACnE,SAAO,KAAK,WAAW,KAAK,SAAS,GAAG,WAAW;AACrD;AAEO,SAAS,YAAY,KAAa,WAAmB,OAAuB;AACjF,SAAO,KAAK,aAAa,KAAK,SAAS,GAAG,SAAS,KAAK,EAAE;AAC5D;AAEO,SAAS,mBAAmB,KAAqB;AACtD,SAAO,KAAK,WAAW,GAAG,GAAG,eAAe;AAC9C;AAEO,SAAS,gBAAgB,KAAqB;AACnD,SAAO,KAAK,KAAK,MAAM,GAAG,SAAS,GAAG,CAAC,cAAc;AACvD;","names":[]}
1
+ {"version":3,"sources":["../src/shared/paths.ts"],"sourcesContent":["import { homedir } from 'node:os';\nimport { basename, join } from 'node:path';\n\nexport function globalDir(): string {\n return join(homedir(), '.sisyphus');\n}\n\nexport function socketPath(): string {\n return join(globalDir(), 'daemon.sock');\n}\n\nexport function globalConfigPath(): string {\n return join(globalDir(), 'config.json');\n}\n\nexport function daemonLogPath(): string {\n return join(globalDir(), 'daemon.log');\n}\n\nexport function daemonPidPath(): string {\n return join(globalDir(), 'daemon.pid');\n}\n\nexport function daemonUpdatingPath(): string {\n return join(globalDir(), 'updating');\n}\n\nexport function projectDir(cwd: string): string {\n return join(cwd, '.sisyphus');\n}\n\nexport function projectConfigPath(cwd: string): string {\n return join(projectDir(cwd), 'config.json');\n}\n\nexport function projectOrchestratorPromptPath(cwd: string): string {\n return join(projectDir(cwd), 'orchestrator.md');\n}\n\nexport function sessionsDir(cwd: string): string {\n return join(projectDir(cwd), 'sessions');\n}\n\nexport function sessionDir(cwd: string, sessionId: string): string {\n return join(sessionsDir(cwd), sessionId);\n}\n\nexport function statePath(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'state.json');\n}\n\nexport function reportsDir(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'reports');\n}\n\nexport function reportFilePath(cwd: string, sessionId: string, agentId: string, suffix: string): string {\n return join(reportsDir(cwd, sessionId), `${agentId}-${suffix}.md`);\n}\n\nexport function messagesDir(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'messages');\n}\n\nexport function promptsDir(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'prompts');\n}\n\nexport function contextDir(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'context');\n}\n\nexport function roadmapPath(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'roadmap.md');\n}\n\nexport function goalPath(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'goal.md');\n}\n\nexport function logsDir(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'logs');\n}\n\nexport function cycleLogPath(cwd: string, sessionId: string, cycle: number): string {\n return join(logsDir(cwd, sessionId), `cycle-${String(cycle).padStart(3, '0')}.md`);\n}\n\n// Backwards compat for old sessions\nexport function legacyLogsPath(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'logs.md');\n}\n\nexport function snapshotsDir(cwd: string, sessionId: string): string {\n return join(sessionDir(cwd, sessionId), 'snapshots');\n}\n\nexport function snapshotDir(cwd: string, sessionId: string, cycle: number): string {\n return join(snapshotsDir(cwd, sessionId), `cycle-${cycle}`);\n}\n\nexport function worktreeConfigPath(cwd: string): string {\n return join(projectDir(cwd), 'worktree.json');\n}\n\nexport function worktreeBaseDir(cwd: string): string {\n return join(cwd, '..', `${bas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a,WAA2B;AACjE,SAAO,KAAK,WAAW,KAAK,SAAS,GAAG,SAAS;AACnD;AAEO,SAAS,WAAW,KAAa,WAA2B;AACjE,SAAO,KAAK,WAAW,KAAK,SAAS,GAAG,SAAS;AACnD;AAEO,SAAS,YAAY,KAAa,WAA2B;AAClE,SAAO,KAAK,WAAW,KAAK,SAAS,GAAG,YAAY;AACtD;AAEO,SAAS,SAAS,KAAa,WAA2B;AAC/D,SAAO,KAAK,WAAW,KAAK,SAAS,GAAG,SAAS;AACnD;AAEO,SAAS,QAAQ,KAAa,WAA2B;AAC9D,SAAO,KAAK,WAAW,KAAK,SAAS,GAAG,MAAM;AAChD;AAEO,SAAS,aAAa,KAAa,WAAmB,OAAuB;AAClF,SAAO,KAAK,QAAQ,KAAK,SAAS,GAAG,SAAS,OAAO,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,KAAK;AACnF;AAGO,SAAS,eAAe,KAAa,WAA2B;AACrE,SAAO,KAAK,WAAW,KAAK,SAAS,GAAG,SAAS;AACnD;AAEO,SAAS,aAAa,KAAa,WAA2B;AACnE,SAAO,KAAK,WAAW,KAAK,SAAS,GAAG,WAAW;AACrD;AAEO,SAAS,YAAY,KAAa,WAAmB,OAAuB;AACjF,SAAO,KAAK,aAAa,KAAK,SAAS,GAAG,SAAS,KAAK,EAAE;AAC5D;AAEO,SAAS,mBAAmB,KAAqB;AACtD,SAAO,KAAK,WAAW,GAAG,GAAG,eAAe;AAC9C;AAEO,SAAS,gBAAgB,KAAqB;AACnD,SAAO,KAAK,KAAK,MAAM,GAAG,SAAS,GAAG,CAAC,cAAc;AACvD;","names":[]}
package/dist/cli.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  formatDuration,
6
6
  rawSend,
7
7
  statusColor
8
- } from "./chunk-T7ETTIQK.js";
8
+ } from "./chunk-Q6VQOUN3.js";
9
9
  import {
10
10
  shellQuote
11
11
  } from "./chunk-6G226ZK7.js";
@@ -16,11 +16,11 @@ import {
16
16
  globalDir,
17
17
  roadmapPath,
18
18
  socketPath
19
- } from "./chunk-JXKUI4P6.js";
19
+ } from "./chunk-YGBGKMTF.js";
20
20
 
21
21
  // src/cli/index.ts
22
22
  import { Command } from "commander";
23
- import { existsSync as existsSync5, mkdirSync as mkdirSync4 } from "fs";
23
+ import { existsSync as existsSync6, mkdirSync as mkdirSync4 } from "fs";
24
24
 
25
25
  // src/cli/commands/start.ts
26
26
  import { execSync as execSync5 } from "child_process";
@@ -576,6 +576,10 @@ Control:`);
576
576
  });
577
577
  }
578
578
 
579
+ // src/cli/commands/spawn.ts
580
+ import { existsSync as existsSync3 } from "fs";
581
+ import { join as join4 } from "path";
582
+
579
583
  // src/cli/stdin.ts
580
584
  function readStdin() {
581
585
  if (process.stdin.isTTY) return Promise.resolve(null);
@@ -592,7 +596,7 @@ function readStdin() {
592
596
 
593
597
  // src/cli/commands/spawn.ts
594
598
  function registerSpawn(program2) {
595
- program2.command("spawn").description("Spawn a new agent (orchestrator only)").argument("[instruction]", "Task instruction for the agent").option("--agent-type <type>", "Agent role label (default: worker)", "worker").requiredOption("--name <name>", "Agent name").option("--instruction <instruction>", "Task instruction for the agent (or pipe via stdin)").option("--worktree", "Spawn agent in an isolated git worktree").action(async (positionalInstruction, opts) => {
599
+ program2.command("spawn").description("Spawn a new agent (orchestrator only)").argument("[instruction]", "Task instruction for the agent").option("--agent-type <type>", "Agent role label (default: worker)", "worker").requiredOption("--name <name>", "Agent name").option("--instruction <instruction>", "Task instruction for the agent (or pipe via stdin)").option("--worktree", "Spawn agent in an isolated git worktree").option("--repo <name>", "Repo subdirectory to use for this agent").action(async (positionalInstruction, opts) => {
596
600
  assertTmux();
597
601
  const sessionId = process.env.SISYPHUS_SESSION_ID;
598
602
  if (!sessionId) {
@@ -604,13 +608,35 @@ function registerSpawn(program2) {
604
608
  console.error("Error: --instruction is required (or pipe via stdin)");
605
609
  process.exit(1);
606
610
  }
611
+ const sisyphusCwd = process.env["SISYPHUS_CWD"] ?? process.cwd();
612
+ if (opts.repo && (opts.repo.includes("/") || opts.repo.includes("..") || opts.repo.includes("\\"))) {
613
+ console.error("Error: --repo must be a directory name, not a path");
614
+ process.exit(1);
615
+ }
616
+ if (opts.repo && opts.repo !== ".") {
617
+ const repoPath = join4(sisyphusCwd, opts.repo);
618
+ if (!existsSync3(repoPath)) {
619
+ console.error(`Error: repo directory does not exist: ${repoPath}`);
620
+ process.exit(1);
621
+ }
622
+ if (opts.worktree && !existsSync3(join4(repoPath, ".git"))) {
623
+ console.error(`Error: --worktree requires a git repo; no .git found at ${repoPath}`);
624
+ process.exit(1);
625
+ }
626
+ } else if (!opts.repo) {
627
+ if (!existsSync3(join4(sisyphusCwd, ".git"))) {
628
+ console.error("Error: --repo is required when session root is not a git repo.");
629
+ process.exit(1);
630
+ }
631
+ }
607
632
  const request = {
608
633
  type: "spawn",
609
634
  sessionId,
610
635
  agentType: opts.agentType,
611
636
  name: opts.name,
612
637
  instruction,
613
- ...opts.worktree ? { worktree: true } : {}
638
+ ...opts.worktree ? { worktree: true } : {},
639
+ ...opts.repo ? { repo: opts.repo } : {}
614
640
  };
615
641
  const response = await sendRequest(request);
616
642
  if (response.ok) {
@@ -930,7 +956,7 @@ function truncateTask(task, max) {
930
956
  }
931
957
  function registerList(program2) {
932
958
  program2.command("list").description("List sessions (defaults to current project)").option("-a, --all", "Show sessions from all projects").action(async (opts) => {
933
- const cwd = process.cwd();
959
+ const cwd = process.env["SISYPHUS_CWD"] ?? process.cwd();
934
960
  const request = { type: "list", cwd, all: opts.all };
935
961
  const response = await sendRequest(request);
936
962
  if (response.ok) {
@@ -951,8 +977,9 @@ function registerList(program2) {
951
977
  const status = `${color}${s.status}${RESET2}`;
952
978
  const agents = `${DIM2}${s.agentCount} agent(s)${RESET2}`;
953
979
  const task = truncateTask(s.task, 60);
980
+ const label = s.name ? `${s.name} ${DIM2}(${s.id.slice(0, 8)})${RESET2}` : s.id;
954
981
  const cwdLabel = opts.all && s.cwd ? ` ${DIM2}${basename(s.cwd)}${RESET2}` : "";
955
- console.log(` ${BOLD2}${s.id}${RESET2} ${status} ${agents} ${task}${cwdLabel}`);
982
+ console.log(` ${BOLD2}${label}${RESET2} ${status} ${agents} ${task}${cwdLabel}`);
956
983
  }
957
984
  if (filtered && totalCount && totalCount > sessions.length) {
958
985
  const otherCount = totalCount - sessions.length;
@@ -995,7 +1022,7 @@ function registerReport(program2) {
995
1022
  // src/cli/commands/resume.ts
996
1023
  function registerResume(program2) {
997
1024
  program2.command("resume").description("Respawn orchestrator with new instructions (for paused/completed sessions)").addHelpText("after", "\n Use `resume` to restart a paused or completed session with new instructions.\n Use `continue` to keep working on a completed session without new instructions.\n").argument("<session-id>", "Session ID to resume").argument("[message]", "Additional instructions for the orchestrator").action(async (sessionId, message) => {
998
- const cwd = process.cwd();
1025
+ const cwd = process.env["SISYPHUS_CWD"] ?? process.cwd();
999
1026
  const request = { type: "resume", sessionId, cwd, message };
1000
1027
  const response = await sendRequest(request);
1001
1028
  if (response.ok) {
@@ -1114,7 +1141,8 @@ function registerRollback(program2) {
1114
1141
  console.error("Error: cycle must be a positive integer");
1115
1142
  process.exit(1);
1116
1143
  }
1117
- const request = { type: "rollback", sessionId, cwd: process.cwd(), toCycle };
1144
+ const cwd = process.env["SISYPHUS_CWD"] ?? process.cwd();
1145
+ const request = { type: "rollback", sessionId, cwd, toCycle };
1118
1146
  const response = await sendRequest(request);
1119
1147
  if (response.ok) {
1120
1148
  const data = response.data;
@@ -1173,7 +1201,7 @@ function registerSetupKeybind(program2) {
1173
1201
 
1174
1202
  // src/cli/commands/doctor.ts
1175
1203
  import { execSync as execSync7 } from "child_process";
1176
- import { existsSync as existsSync3, statSync } from "fs";
1204
+ import { existsSync as existsSync4, statSync } from "fs";
1177
1205
  function checkNodeVersion() {
1178
1206
  const major = parseInt(process.versions.node.split(".")[0], 10);
1179
1207
  if (major < 22) {
@@ -1230,7 +1258,7 @@ function checkDaemonInstalled() {
1230
1258
  };
1231
1259
  }
1232
1260
  const pid = daemonPidPath();
1233
- if (existsSync3(pid)) {
1261
+ if (existsSync4(pid)) {
1234
1262
  return { name: "Daemon setup", status: "ok", detail: `PID file found at ${pid}` };
1235
1263
  }
1236
1264
  return {
@@ -1242,7 +1270,7 @@ function checkDaemonInstalled() {
1242
1270
  }
1243
1271
  function checkDaemonRunning() {
1244
1272
  const pid = daemonPidPath();
1245
- if (!existsSync3(pid)) {
1273
+ if (!existsSync4(pid)) {
1246
1274
  const fix = process.platform === "darwin" ? "launchctl load -w ~/Library/LaunchAgents/com.sisyphus.daemon.plist" : "sisyphusd & \u2014 or check if the process is running";
1247
1275
  return {
1248
1276
  name: "Daemon process",
@@ -1280,7 +1308,7 @@ function checkTmux() {
1280
1308
  }
1281
1309
  function checkCycleScript() {
1282
1310
  const path = cycleScriptPath();
1283
- if (!existsSync3(path)) {
1311
+ if (!existsSync4(path)) {
1284
1312
  return {
1285
1313
  name: "Cycle script",
1286
1314
  status: "fail",
@@ -1305,7 +1333,7 @@ function checkCycleScript() {
1305
1333
  function checkTmuxKeybind() {
1306
1334
  const existing = getExistingBinding(DEFAULT_KEY);
1307
1335
  if (existing === null) {
1308
- if (existsSync3(sisyphusTmuxConfPath())) {
1336
+ if (existsSync4(sisyphusTmuxConfPath())) {
1309
1337
  return {
1310
1338
  name: `Tmux keybind (${DEFAULT_KEY})`,
1311
1339
  status: "warn",
@@ -1331,7 +1359,7 @@ function checkTmuxKeybind() {
1331
1359
  }
1332
1360
  function checkGlobalDir() {
1333
1361
  const dir = globalDir();
1334
- if (existsSync3(dir)) {
1362
+ if (existsSync4(dir)) {
1335
1363
  return { name: "Data directory", status: "ok", detail: dir };
1336
1364
  }
1337
1365
  return { name: "Data directory", status: "warn", detail: `${dir} does not exist (created on first use)` };
@@ -1506,8 +1534,8 @@ function registerGettingStarted(program2) {
1506
1534
  }
1507
1535
 
1508
1536
  // src/cli/commands/init.ts
1509
- import { existsSync as existsSync4, mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "fs";
1510
- import { join as join4 } from "path";
1537
+ import { existsSync as existsSync5, mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "fs";
1538
+ import { join as join5 } from "path";
1511
1539
  var DEFAULT_CONFIG = {};
1512
1540
  var ORCHESTRATOR_TEMPLATE = `# Custom Orchestrator Prompt
1513
1541
 
@@ -1518,9 +1546,9 @@ var ORCHESTRATOR_TEMPLATE = `# Custom Orchestrator Prompt
1518
1546
  function registerInit(program2) {
1519
1547
  program2.command("init").description("Initialize sisyphus configuration for this project").option("--orchestrator", "Also create a custom orchestrator prompt template").action((opts) => {
1520
1548
  const cwd = process.cwd();
1521
- const sisDir = join4(cwd, ".sisyphus");
1522
- const configPath = join4(sisDir, "config.json");
1523
- if (existsSync4(configPath)) {
1549
+ const sisDir = join5(cwd, ".sisyphus");
1550
+ const configPath = join5(sisDir, "config.json");
1551
+ if (existsSync5(configPath)) {
1524
1552
  console.log(`Already initialized: ${configPath}`);
1525
1553
  return;
1526
1554
  }
@@ -1528,8 +1556,8 @@ function registerInit(program2) {
1528
1556
  writeFileSync3(configPath, JSON.stringify(DEFAULT_CONFIG, null, 2) + "\n", "utf-8");
1529
1557
  console.log(`Created ${configPath}`);
1530
1558
  if (opts.orchestrator) {
1531
- const orchPath = join4(sisDir, "orchestrator.md");
1532
- if (!existsSync4(orchPath)) {
1559
+ const orchPath = join5(sisDir, "orchestrator.md");
1560
+ if (!existsSync5(orchPath)) {
1533
1561
  writeFileSync3(orchPath, ORCHESTRATOR_TEMPLATE, "utf-8");
1534
1562
  console.log(`Created ${orchPath}`);
1535
1563
  }
@@ -1590,7 +1618,7 @@ Run 'sisyphus getting-started' for a complete usage guide.
1590
1618
  var args = process.argv.slice(2);
1591
1619
  var firstArg = args[0];
1592
1620
  var skipWelcome = ["doctor", "getting-started", "help", "--help", "-h", "init", "uninstall", "--version", "-V"];
1593
- if (!existsSync5(globalDir()) && firstArg && !skipWelcome.includes(firstArg)) {
1621
+ if (!existsSync6(globalDir()) && firstArg && !skipWelcome.includes(firstArg)) {
1594
1622
  mkdirSync4(globalDir(), { recursive: true });
1595
1623
  console.log("");
1596
1624
  console.log(" Welcome to Sisyphus \u2014 multi-agent orchestration for Claude Code.");