sisyphi 1.0.10 → 1.0.12

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/daemon.js +40 -5
  2. package/dist/daemon.js.map +1 -1
  3. package/dist/templates/agent-plugin/agents/review/compliance.md +48 -0
  4. package/dist/templates/agent-plugin/agents/review/efficiency.md +40 -0
  5. package/dist/templates/agent-plugin/agents/review/quality.md +38 -0
  6. package/dist/templates/agent-plugin/agents/review/reuse.md +38 -0
  7. package/dist/templates/agent-plugin/agents/review/security.md +40 -0
  8. package/dist/templates/agent-plugin/agents/review-plan/code-smells.md +39 -0
  9. package/dist/templates/agent-plugin/agents/review-plan/pattern-consistency.md +39 -0
  10. package/dist/templates/agent-plugin/agents/review-plan/security.md +38 -0
  11. package/dist/templates/agent-plugin/agents/review-plan/spec-coverage.md +44 -0
  12. package/dist/templates/agent-plugin/agents/review-plan.md +10 -64
  13. package/dist/templates/agent-plugin/agents/review.md +21 -18
  14. package/dist/templates/agent-plugin/hooks/review-plan-user-prompt.sh +9 -3
  15. package/dist/templates/agent-plugin/hooks/review-user-prompt.sh +11 -2
  16. package/dist/templates/agent-suffix.md +7 -24
  17. package/dist/tui.js +333 -359
  18. package/dist/tui.js.map +1 -1
  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/daemon.js CHANGED
@@ -42,7 +42,7 @@ import { setTimeout as sleep } from "timers/promises";
42
42
  // src/daemon/server.ts
43
43
  import { createServer } from "net";
44
44
  import { unlinkSync, existsSync as existsSync8, writeFileSync as writeFileSync5, readFileSync as readFileSync6, mkdirSync as mkdirSync4, rmSync as rmSync4 } from "fs";
45
- import { join as join5 } from "path";
45
+ import { join as join6 } from "path";
46
46
 
47
47
  // src/daemon/session-manager.ts
48
48
  import { v4 as uuidv4 } from "uuid";
@@ -524,6 +524,25 @@ function killSession(sessionName) {
524
524
  function setSessionOption(sessionName, option, value) {
525
525
  execSafe(`tmux set-option -t "${sessionName}" ${option} ${shellQuote(value)}`);
526
526
  }
527
+ function findHomeSession(cwd) {
528
+ const output = execSafe('tmux list-sessions -F "#{session_name}"');
529
+ if (!output) return null;
530
+ const normalizedCwd = cwd.replace(/\/+$/, "");
531
+ for (const name of output.split("\n").filter(Boolean)) {
532
+ if (name.startsWith("sisyphus-")) continue;
533
+ const val = execSafe(`tmux show-options -t "${name}" -v @sisyphus_cwd`);
534
+ if (val?.trim() === normalizedCwd) return name;
535
+ }
536
+ return null;
537
+ }
538
+ function switchAttachedClients(sessionName, targetSession) {
539
+ if (!sessionExists(targetSession)) return;
540
+ const output = execSafe(`tmux list-clients -t "${sessionName}" -F "#{client_tty}"`);
541
+ if (!output) return;
542
+ for (const tty of output.split("\n").filter(Boolean)) {
543
+ execSafe(`tmux switch-client -c "${tty}" -t "${targetSession}"`);
544
+ }
545
+ }
527
546
  function listPanes(windowTarget) {
528
547
  const output = execSafe(`tmux list-panes -t "${windowTarget}" -F "#{pane_id} #{pane_pid}"`);
529
548
  if (!output) return [];
@@ -836,9 +855,9 @@ function cleanupSessionMaps(sessionId) {
836
855
  }
837
856
 
838
857
  // src/daemon/agent.ts
839
- import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, copyFileSync as copyFileSync2, mkdirSync as mkdirSync3, readdirSync as readdirSync5 } from "fs";
858
+ import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, copyFileSync as copyFileSync2, mkdirSync as mkdirSync3, readdirSync as readdirSync5, existsSync as existsSync6 } from "fs";
840
859
  import { execSync as execSync2 } from "child_process";
841
- import { resolve as resolve3 } from "path";
860
+ import { resolve as resolve3, dirname as dirname3, join as join5 } from "path";
842
861
 
843
862
  // src/daemon/worktree.ts
844
863
  import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync4, readdirSync as readdirSync4, rmSync as rmSync2 } from "fs";
@@ -1051,6 +1070,14 @@ function createAgentPlugin(cwd, sessionId, agentId, agentType, agentConfig) {
1051
1070
  if (agentConfig?.filePath && agentType && agentType !== "worker") {
1052
1071
  const shortName = agentType.replace(/^sisyphus:/, "");
1053
1072
  copyFileSync2(agentConfig.filePath, `${base}/agents/${shortName}.md`);
1073
+ const subAgentDir = join5(dirname3(agentConfig.filePath), shortName);
1074
+ if (existsSync6(subAgentDir)) {
1075
+ for (const f of readdirSync5(subAgentDir)) {
1076
+ if (f.endsWith(".md") && f !== "CLAUDE.md") {
1077
+ copyFileSync2(join5(subAgentDir, f), `${base}/agents/${f}`);
1078
+ }
1079
+ }
1080
+ }
1054
1081
  }
1055
1082
  const srcHooks = resolve3(import.meta.dirname, "../templates/agent-plugin/hooks");
1056
1083
  for (const f of ["require-submit.sh", "intercept-send-message.sh"]) {
@@ -1470,6 +1497,11 @@ function sendTerminalNotification(title, message) {
1470
1497
 
1471
1498
  // src/daemon/session-manager.ts
1472
1499
  var NAME_PATTERN = /^[a-zA-Z0-9_-]+$/;
1500
+ function switchToHomeSession(session) {
1501
+ if (!session.tmuxSessionName) return;
1502
+ const home = findHomeSession(session.cwd);
1503
+ if (home) switchAttachedClients(session.tmuxSessionName, home);
1504
+ }
1473
1505
  async function startSession(task, cwd, context, name) {
1474
1506
  const sessionId = uuidv4();
1475
1507
  if (name && !NAME_PATTERN.test(name)) {
@@ -1724,7 +1756,9 @@ async function handleYield(sessionId, cwd, nextPrompt, mode) {
1724
1756
  }
1725
1757
  }
1726
1758
  async function handleComplete(sessionId, cwd, report) {
1759
+ const session = getSession(cwd, sessionId);
1727
1760
  await handleOrchestratorComplete(sessionId, cwd, report);
1761
+ switchToHomeSession(session);
1728
1762
  }
1729
1763
  async function handleContinue(sessionId, cwd) {
1730
1764
  await continueSession(cwd, sessionId);
@@ -1758,6 +1792,7 @@ async function handleKill(sessionId, cwd) {
1758
1792
  await updateSessionStatus(cwd, sessionId, "completed");
1759
1793
  untrackSession(sessionId);
1760
1794
  unregisterSessionPanes(sessionId);
1795
+ switchToHomeSession(session);
1761
1796
  if (session.tmuxSessionName) {
1762
1797
  killSession(session.tmuxSessionName);
1763
1798
  } else if (windowId) {
@@ -1870,7 +1905,7 @@ async function handlePaneExited(paneId, cwd, sessionId, role, agentId) {
1870
1905
  var server = null;
1871
1906
  var sessionTrackingMap = /* @__PURE__ */ new Map();
1872
1907
  function registryPath() {
1873
- return join5(globalDir(), "session-registry.json");
1908
+ return join6(globalDir(), "session-registry.json");
1874
1909
  }
1875
1910
  function persistSessionRegistry() {
1876
1911
  const dir = globalDir();
@@ -2114,7 +2149,7 @@ async function handleRequest(req) {
2114
2149
  if (req.content.length > 200) {
2115
2150
  const dir = messagesDir(tracking.cwd, req.sessionId);
2116
2151
  mkdirSync4(dir, { recursive: true });
2117
- filePath = join5(dir, `${id}.md`);
2152
+ filePath = join6(dir, `${id}.md`);
2118
2153
  writeFileSync5(filePath, req.content, "utf-8");
2119
2154
  }
2120
2155
  await appendMessage(tracking.cwd, req.sessionId, {