sisyphi 1.0.11 → 1.0.13

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.
Files changed (33) hide show
  1. package/dist/cli.js +96 -9
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +16 -7
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/templates/agent-plugin/agents/review/compliance.md +48 -0
  6. package/dist/templates/agent-plugin/agents/review/efficiency.md +40 -0
  7. package/dist/templates/agent-plugin/agents/review/quality.md +38 -0
  8. package/dist/templates/agent-plugin/agents/review/reuse.md +38 -0
  9. package/dist/templates/agent-plugin/agents/review/security.md +40 -0
  10. package/dist/templates/agent-plugin/agents/review-plan/code-smells.md +39 -0
  11. package/dist/templates/agent-plugin/agents/review-plan/pattern-consistency.md +39 -0
  12. package/dist/templates/agent-plugin/agents/review-plan/security.md +38 -0
  13. package/dist/templates/agent-plugin/agents/review-plan/spec-coverage.md +44 -0
  14. package/dist/templates/agent-plugin/agents/review-plan.md +10 -64
  15. package/dist/templates/agent-plugin/agents/review.md +21 -18
  16. package/dist/templates/agent-plugin/hooks/review-plan-user-prompt.sh +9 -3
  17. package/dist/templates/agent-plugin/hooks/review-user-prompt.sh +11 -2
  18. package/dist/templates/agent-suffix.md +7 -24
  19. package/package.json +1 -1
  20. package/templates/agent-plugin/agents/review/compliance.md +48 -0
  21. package/templates/agent-plugin/agents/review/efficiency.md +40 -0
  22. package/templates/agent-plugin/agents/review/quality.md +38 -0
  23. package/templates/agent-plugin/agents/review/reuse.md +38 -0
  24. package/templates/agent-plugin/agents/review/security.md +40 -0
  25. package/templates/agent-plugin/agents/review-plan/code-smells.md +39 -0
  26. package/templates/agent-plugin/agents/review-plan/pattern-consistency.md +39 -0
  27. package/templates/agent-plugin/agents/review-plan/security.md +38 -0
  28. package/templates/agent-plugin/agents/review-plan/spec-coverage.md +44 -0
  29. package/templates/agent-plugin/agents/review-plan.md +10 -64
  30. package/templates/agent-plugin/agents/review.md +21 -18
  31. package/templates/agent-plugin/hooks/review-plan-user-prompt.sh +9 -3
  32. package/templates/agent-plugin/hooks/review-user-prompt.sh +11 -2
  33. package/templates/agent-suffix.md +7 -24
package/dist/cli.js CHANGED
@@ -39,10 +39,17 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync, chmodSync, unlinkSy
39
39
  import { homedir } from "os";
40
40
  import { join } from "path";
41
41
  var DEFAULT_KEY = "M-s";
42
+ var DEFAULT_HOME_KEY = "M-S";
42
43
  var SISYPHUS_CONF_MARKER = "# sisyphus-managed \u2014 do not edit";
43
44
  function cycleScriptPath() {
44
45
  return join(globalDir(), "bin", "sisyphus-cycle");
45
46
  }
47
+ function homeScriptPath() {
48
+ return join(globalDir(), "bin", "sisyphus-home");
49
+ }
50
+ function killPaneScriptPath() {
51
+ return join(globalDir(), "bin", "sisyphus-kill-pane");
52
+ }
46
53
  function sisyphusTmuxConfPath() {
47
54
  return join(globalDir(), "tmux.conf");
48
55
  }
@@ -72,12 +79,69 @@ for (( i=0; i<\${#sessions[@]}; i++ )); do
72
79
  done
73
80
  tmux switch-client -t "\${sessions[0]}"
74
81
  `;
82
+ var HOME_SCRIPT = `#!/bin/bash
83
+ # Jump to the home (non-sisyphus) session that has the dashboard window
84
+ cwd=$(tmux show-option -v @sisyphus_cwd 2>/dev/null)
85
+ [ -z "$cwd" ] && exit 0
86
+ while IFS= read -r name; do
87
+ # Skip sisyphus agent/orchestrator sessions
88
+ case "$name" in sisyphus-*) continue ;; esac
89
+ scwd=$(tmux show-option -t "$name" -v @sisyphus_cwd 2>/dev/null)
90
+ if [ "$scwd" = "$cwd" ]; then
91
+ tmux switch-client -t "$name"
92
+ # Focus the dashboard window if it exists
93
+ tmux select-window -t "$name:sisyphus-dashboard" 2>/dev/null
94
+ exit 0
95
+ fi
96
+ done < <(tmux list-sessions -F '#{session_name}')
97
+ `;
98
+ var KILL_PANE_SCRIPT = `#!/bin/bash
99
+ # prefix-x override for sisyphus sessions.
100
+ # If this is the last pane, switch to the home session before killing.
101
+ session=$(tmux display-message -p '#{session_name}')
102
+ pane_count=$(tmux list-panes -t "$session" -F '#{pane_id}' | wc -l | tr -d ' ')
103
+
104
+ if [ "$pane_count" -le 1 ]; then
105
+ # Last pane \u2014 find home session, switch there, then kill sisyphus session
106
+ cwd=$(tmux show-option -t "$session" -v @sisyphus_cwd 2>/dev/null)
107
+ if [ -n "$cwd" ]; then
108
+ while IFS= read -r name; do
109
+ case "$name" in sisyphus-*) continue ;; esac
110
+ scwd=$(tmux show-option -t "$name" -v @sisyphus_cwd 2>/dev/null)
111
+ if [ "$scwd" = "$cwd" ]; then
112
+ tmux switch-client -t "$name"
113
+ tmux select-window -t "$name:sisyphus-dashboard" 2>/dev/null
114
+ tmux kill-session -t "$session"
115
+ exit 0
116
+ fi
117
+ done < <(tmux list-sessions -F '#{session_name}')
118
+ fi
119
+ # No home session found \u2014 just kill the pane
120
+ tmux kill-pane
121
+ else
122
+ # Multiple panes \u2014 kill this one and rebalance
123
+ tmux kill-pane
124
+ tmux select-layout even-horizontal
125
+ fi
126
+ `;
75
127
  function installCycleScript() {
76
- const scriptPath = cycleScriptPath();
77
128
  mkdirSync(join(globalDir(), "bin"), { recursive: true });
129
+ const scriptPath = cycleScriptPath();
78
130
  writeFileSync(scriptPath, CYCLE_SCRIPT, "utf8");
79
131
  chmodSync(scriptPath, 493);
80
132
  }
133
+ function installHomeScript() {
134
+ mkdirSync(join(globalDir(), "bin"), { recursive: true });
135
+ const scriptPath = homeScriptPath();
136
+ writeFileSync(scriptPath, HOME_SCRIPT, "utf8");
137
+ chmodSync(scriptPath, 493);
138
+ }
139
+ function installKillPaneScript() {
140
+ mkdirSync(join(globalDir(), "bin"), { recursive: true });
141
+ const scriptPath = killPaneScriptPath();
142
+ writeFileSync(scriptPath, KILL_PANE_SCRIPT, "utf8");
143
+ chmodSync(scriptPath, 493);
144
+ }
81
145
  function getExistingBinding(key) {
82
146
  try {
83
147
  const output = execSync("tmux list-keys", { stdio: ["pipe", "pipe", "pipe"] }).toString();
@@ -98,8 +162,10 @@ function getExistingBinding(key) {
98
162
  function isSisyphusBinding(binding) {
99
163
  return binding.includes("sisyphus");
100
164
  }
101
- function setupTmuxKeybind(key = DEFAULT_KEY) {
165
+ function setupTmuxKeybind(key = DEFAULT_KEY, homeKey = DEFAULT_HOME_KEY) {
102
166
  installCycleScript();
167
+ installHomeScript();
168
+ installKillPaneScript();
103
169
  const existing = getExistingBinding(key);
104
170
  if (existing !== null && !isSisyphusBinding(existing)) {
105
171
  return {
@@ -108,10 +174,24 @@ function setupTmuxKeybind(key = DEFAULT_KEY) {
108
174
  existingBinding: existing
109
175
  };
110
176
  }
177
+ if (homeKey !== key) {
178
+ const existingHome = getExistingBinding(homeKey);
179
+ if (existingHome !== null && !isSisyphusBinding(existingHome)) {
180
+ return {
181
+ status: "conflict",
182
+ message: `Tmux key ${homeKey} is already bound to something else.`,
183
+ existingBinding: existingHome
184
+ };
185
+ }
186
+ }
111
187
  const confPath = sisyphusTmuxConfPath();
112
- const bindingLine = `bind-key -T root ${key} run-shell ${cycleScriptPath()}`;
188
+ const cycleBinding = `bind-key -T root ${key} run-shell ${cycleScriptPath()}`;
189
+ const homeBinding = `bind-key -T root ${homeKey} run-shell ${homeScriptPath()}`;
190
+ const killPaneOverride = `bind-key -T prefix x if-shell "tmux display-message -p '#{session_name}' | grep -q '^sisyphus-'" "run-shell ${killPaneScriptPath()}" "kill-pane \\; select-layout even-horizontal"`;
113
191
  writeFileSync(confPath, `${SISYPHUS_CONF_MARKER}
114
- ${bindingLine}
192
+ ${cycleBinding}
193
+ ${homeBinding}
194
+ ${killPaneOverride}
115
195
  `, "utf8");
116
196
  const userConf = userTmuxConfPath();
117
197
  const sourceLine = `source-file ${confPath}`;
@@ -128,12 +208,14 @@ ${bindingLine}
128
208
  }
129
209
  try {
130
210
  execSync(`tmux bind-key -T root ${key} run-shell ${cycleScriptPath()}`, { stdio: "pipe" });
211
+ execSync(`tmux bind-key -T root ${homeKey} run-shell ${homeScriptPath()}`, { stdio: "pipe" });
212
+ execSync(`tmux ${killPaneOverride}`, { stdio: "pipe" });
131
213
  } catch {
132
214
  }
133
215
  if (existing !== null && isSisyphusBinding(existing)) {
134
216
  return {
135
217
  status: "already-installed",
136
- message: `Tmux keybinding ${key} already configured for sisyphus.`
218
+ message: `Tmux keybindings ${key} (cycle) and ${homeKey} (dashboard) already configured for sisyphus.`
137
219
  };
138
220
  }
139
221
  const persistNote = persistedToConf ? "" : `
@@ -141,7 +223,7 @@ Note: No tmux.conf found. Add this to your tmux config for persistence:
141
223
  source-file ${confPath}`;
142
224
  return {
143
225
  status: "installed",
144
- message: `Tmux keybinding set: ${key} cycles sisyphus sessions${persistNote}`
226
+ message: `Tmux keybindings set: ${key} cycles sessions, ${homeKey} jumps to dashboard${persistNote}`
145
227
  };
146
228
  }
147
229
  function removeTmuxKeybind() {
@@ -158,9 +240,14 @@ function removeTmuxKeybind() {
158
240
  if (existsSync(confPath)) {
159
241
  unlinkSync(confPath);
160
242
  }
161
- const scriptPath = cycleScriptPath();
162
- if (existsSync(scriptPath)) {
163
- unlinkSync(scriptPath);
243
+ try {
244
+ execSync("tmux bind-key -T prefix x kill-pane \\; select-layout even-horizontal", { stdio: "pipe" });
245
+ } catch {
246
+ }
247
+ for (const scriptPath of [cycleScriptPath(), homeScriptPath(), killPaneScriptPath()]) {
248
+ if (existsSync(scriptPath)) {
249
+ unlinkSync(scriptPath);
250
+ }
164
251
  }
165
252
  }
166
253