sisyphi 1.1.17 → 1.1.19

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 (237) hide show
  1. package/README.md +347 -25
  2. package/dist/chunk-36VJ7ZBD.js +1898 -0
  3. package/dist/chunk-36VJ7ZBD.js.map +1 -0
  4. package/dist/chunk-M6Z3KHOH.js +1165 -0
  5. package/dist/chunk-M6Z3KHOH.js.map +1 -0
  6. package/dist/chunk-O4ZHSQ5R.js +544 -0
  7. package/dist/chunk-O4ZHSQ5R.js.map +1 -0
  8. package/dist/chunk-P2HHTIPM.js +478 -0
  9. package/dist/chunk-P2HHTIPM.js.map +1 -0
  10. package/dist/{chunk-GSXF3TCZ.js → chunk-PNDCVKBN.js} +91 -3
  11. package/dist/chunk-PNDCVKBN.js.map +1 -0
  12. package/dist/chunk-SVGIQ2G4.js +1076 -0
  13. package/dist/chunk-SVGIQ2G4.js.map +1 -0
  14. package/dist/cli.js +4426 -818
  15. package/dist/cli.js.map +1 -1
  16. package/dist/daemon.js +4351 -857
  17. package/dist/daemon.js.map +1 -1
  18. package/dist/paths-JXFLR5BN.js +102 -0
  19. package/dist/single-ask-6G4BIVY2.js +132 -0
  20. package/dist/single-ask-6G4BIVY2.js.map +1 -0
  21. package/dist/templates/CLAUDE.md +1 -56
  22. package/dist/templates/agent-plugin/agents/CLAUDE.md +2 -65
  23. package/dist/templates/agent-plugin/agents/debug.md +43 -6
  24. package/dist/templates/agent-plugin/agents/debug.settings.json +57 -0
  25. package/dist/templates/agent-plugin/agents/explore.md +28 -1
  26. package/dist/templates/agent-plugin/agents/explore.settings.json +57 -0
  27. package/dist/templates/agent-plugin/agents/implementor.md +94 -0
  28. package/dist/templates/agent-plugin/agents/implementor.settings.json +57 -0
  29. package/dist/templates/agent-plugin/agents/operator.md +43 -1
  30. package/dist/templates/agent-plugin/agents/operator.settings.json +57 -0
  31. package/dist/templates/agent-plugin/agents/plan/sub-planner.md +75 -0
  32. package/dist/templates/agent-plugin/agents/plan.md +176 -86
  33. package/dist/templates/agent-plugin/agents/plan.settings.json +57 -0
  34. package/dist/templates/agent-plugin/agents/problem/adversarial.md +26 -0
  35. package/dist/templates/agent-plugin/agents/problem/contrarian.md +26 -0
  36. package/dist/templates/agent-plugin/agents/problem/first-principles.md +26 -0
  37. package/dist/templates/agent-plugin/agents/problem/precedent.md +25 -0
  38. package/dist/templates/agent-plugin/agents/problem/simplifier.md +26 -0
  39. package/dist/templates/agent-plugin/agents/problem/systems-thinker.md +26 -0
  40. package/dist/templates/agent-plugin/agents/problem/time-traveler.md +26 -0
  41. package/dist/templates/agent-plugin/agents/problem/user-empathy.md +26 -0
  42. package/dist/templates/agent-plugin/agents/problem.md +334 -79
  43. package/dist/templates/agent-plugin/agents/problem.settings.json +57 -0
  44. package/dist/templates/agent-plugin/agents/research-lead/CLAUDE.md +26 -0
  45. package/dist/templates/agent-plugin/agents/research-lead/critic.md +61 -0
  46. package/dist/templates/agent-plugin/agents/research-lead/researcher.md +60 -0
  47. package/dist/templates/agent-plugin/agents/research-lead.md +184 -0
  48. package/dist/templates/agent-plugin/agents/research-lead.settings.json +57 -0
  49. package/dist/templates/agent-plugin/agents/review/CLAUDE.md +3 -29
  50. package/dist/templates/agent-plugin/agents/review/compliance.md +14 -3
  51. package/dist/templates/agent-plugin/agents/review/efficiency.md +15 -4
  52. package/dist/templates/agent-plugin/agents/review/quality.md +20 -6
  53. package/dist/templates/agent-plugin/agents/review/reuse.md +17 -5
  54. package/dist/templates/agent-plugin/agents/review/security.md +10 -3
  55. package/dist/templates/agent-plugin/agents/review/tests.md +58 -0
  56. package/dist/templates/agent-plugin/agents/review-plan/CLAUDE.md +28 -0
  57. package/dist/templates/agent-plugin/agents/review-plan/code-smells.md +4 -2
  58. package/dist/templates/agent-plugin/agents/review-plan/pattern-consistency.md +4 -2
  59. package/dist/templates/agent-plugin/agents/review-plan/requirements-coverage.md +3 -1
  60. package/dist/templates/agent-plugin/agents/review-plan/security.md +5 -2
  61. package/dist/templates/agent-plugin/agents/review-plan.md +52 -5
  62. package/dist/templates/agent-plugin/agents/review-plan.settings.json +57 -0
  63. package/dist/templates/agent-plugin/agents/review.md +89 -16
  64. package/dist/templates/agent-plugin/agents/review.settings.json +57 -0
  65. package/dist/templates/agent-plugin/agents/spec/engineer.md +175 -0
  66. package/dist/templates/agent-plugin/agents/spec/requirements-writer.md +149 -0
  67. package/dist/templates/agent-plugin/agents/spec.md +444 -0
  68. package/dist/templates/agent-plugin/agents/spec.settings.json +57 -0
  69. package/dist/templates/agent-plugin/agents/test-spec.md +58 -2
  70. package/dist/templates/agent-plugin/agents/test-spec.settings.json +57 -0
  71. package/dist/templates/agent-plugin/hooks/CLAUDE.md +9 -57
  72. package/dist/templates/agent-plugin/hooks/ask-background-guard.sh +57 -0
  73. package/dist/templates/agent-plugin/hooks/intercept-send-message.sh +1 -1
  74. package/dist/templates/agent-plugin/hooks/plan-user-prompt.sh +8 -7
  75. package/dist/templates/agent-plugin/hooks/plan-validate.sh +97 -0
  76. package/dist/templates/agent-plugin/hooks/plan-write-path.sh +55 -0
  77. package/dist/templates/agent-plugin/hooks/problem-user-prompt.sh +26 -0
  78. package/dist/templates/agent-plugin/hooks/register-bg-task.sh +37 -0
  79. package/dist/templates/agent-plugin/hooks/require-submit.sh +51 -42
  80. package/dist/templates/agent-plugin/hooks/review-user-prompt.sh +6 -2
  81. package/dist/templates/agent-plugin/hooks/spec-user-prompt.sh +43 -0
  82. package/dist/templates/agent-plugin/skills/humanloop/SKILL.md +147 -0
  83. package/dist/templates/agent-plugin/skills/perspective-fanout/SKILL.md +115 -0
  84. package/dist/templates/agent-plugin/skills/problem-document/SKILL.md +105 -0
  85. package/dist/templates/agent-plugin/skills/problem-plateau-breakers/SKILL.md +83 -0
  86. package/dist/templates/agent-suffix.md +7 -4
  87. package/dist/templates/baleia.lua +42 -0
  88. package/dist/templates/companion-plugin/hooks/user-prompt-context.sh +1 -1
  89. package/dist/templates/dashboard-claude.md +7 -3
  90. package/dist/templates/orchestrator-base.md +89 -52
  91. package/dist/templates/orchestrator-completion.md +47 -24
  92. package/dist/templates/orchestrator-discovery.md +183 -0
  93. package/dist/templates/orchestrator-impl.md +47 -18
  94. package/dist/templates/orchestrator-planning.md +109 -20
  95. package/dist/templates/orchestrator-plugin/commands/sisyphus/scratch.md +19 -0
  96. package/dist/templates/orchestrator-plugin/commands/sisyphus/spec.md +11 -0
  97. package/dist/templates/orchestrator-plugin/commands/sisyphus/strategize.md +5 -5
  98. package/dist/templates/orchestrator-plugin/hooks/hooks.json +0 -10
  99. package/dist/templates/orchestrator-plugin/skills/humanloop/SKILL.md +149 -0
  100. package/dist/templates/orchestrator-plugin/skills/orchestration/CLAUDE.md +1 -0
  101. package/dist/templates/orchestrator-plugin/skills/orchestration/SKILL.md +2 -1
  102. package/dist/templates/orchestrator-plugin/skills/orchestration/strategy.md +160 -0
  103. package/dist/templates/orchestrator-plugin/skills/orchestration/task-patterns.md +26 -28
  104. package/dist/templates/orchestrator-plugin/skills/orchestration/workflow-examples.md +133 -25
  105. package/dist/templates/orchestrator-settings.json +55 -0
  106. package/dist/templates/orchestrator-validation.md +17 -14
  107. package/dist/templates/sisyphus-init.lua +30 -0
  108. package/dist/templates/sisyphus-tmux-plugin/hooks/hooks.json +54 -0
  109. package/dist/templates/sisyphus-tmux-plugin/hooks/tmux-state.sh +19 -0
  110. package/dist/templates/termrender-haiku-system.md +82 -0
  111. package/dist/templates/whip-animation.sh +345 -0
  112. package/dist/tui.js +3789 -2406
  113. package/dist/tui.js.map +1 -1
  114. package/native/SisyphusNotify/AppIcon.icns +0 -0
  115. package/native/SisyphusNotify/Info.plist +26 -0
  116. package/native/SisyphusNotify/main.swift +136 -0
  117. package/native/SisyphusNotify/sisyphus-icon.jpg +0 -0
  118. package/native/build-notify.sh +58 -0
  119. package/package.json +9 -6
  120. package/templates/CLAUDE.md +1 -56
  121. package/templates/agent-plugin/agents/CLAUDE.md +2 -65
  122. package/templates/agent-plugin/agents/debug.md +43 -6
  123. package/templates/agent-plugin/agents/debug.settings.json +57 -0
  124. package/templates/agent-plugin/agents/explore.md +28 -1
  125. package/templates/agent-plugin/agents/explore.settings.json +57 -0
  126. package/templates/agent-plugin/agents/implementor.md +94 -0
  127. package/templates/agent-plugin/agents/implementor.settings.json +57 -0
  128. package/templates/agent-plugin/agents/operator.md +43 -1
  129. package/templates/agent-plugin/agents/operator.settings.json +57 -0
  130. package/templates/agent-plugin/agents/plan/sub-planner.md +75 -0
  131. package/templates/agent-plugin/agents/plan.md +176 -86
  132. package/templates/agent-plugin/agents/plan.settings.json +57 -0
  133. package/templates/agent-plugin/agents/problem/adversarial.md +26 -0
  134. package/templates/agent-plugin/agents/problem/contrarian.md +26 -0
  135. package/templates/agent-plugin/agents/problem/first-principles.md +26 -0
  136. package/templates/agent-plugin/agents/problem/precedent.md +25 -0
  137. package/templates/agent-plugin/agents/problem/simplifier.md +26 -0
  138. package/templates/agent-plugin/agents/problem/systems-thinker.md +26 -0
  139. package/templates/agent-plugin/agents/problem/time-traveler.md +26 -0
  140. package/templates/agent-plugin/agents/problem/user-empathy.md +26 -0
  141. package/templates/agent-plugin/agents/problem.md +334 -79
  142. package/templates/agent-plugin/agents/problem.settings.json +57 -0
  143. package/templates/agent-plugin/agents/research-lead/CLAUDE.md +26 -0
  144. package/templates/agent-plugin/agents/research-lead/critic.md +61 -0
  145. package/templates/agent-plugin/agents/research-lead/researcher.md +60 -0
  146. package/templates/agent-plugin/agents/research-lead.md +184 -0
  147. package/templates/agent-plugin/agents/research-lead.settings.json +57 -0
  148. package/templates/agent-plugin/agents/review/CLAUDE.md +3 -29
  149. package/templates/agent-plugin/agents/review/compliance.md +14 -3
  150. package/templates/agent-plugin/agents/review/efficiency.md +15 -4
  151. package/templates/agent-plugin/agents/review/quality.md +20 -6
  152. package/templates/agent-plugin/agents/review/reuse.md +17 -5
  153. package/templates/agent-plugin/agents/review/security.md +10 -3
  154. package/templates/agent-plugin/agents/review/tests.md +58 -0
  155. package/templates/agent-plugin/agents/review-plan/CLAUDE.md +28 -0
  156. package/templates/agent-plugin/agents/review-plan/code-smells.md +4 -2
  157. package/templates/agent-plugin/agents/review-plan/pattern-consistency.md +4 -2
  158. package/templates/agent-plugin/agents/review-plan/requirements-coverage.md +3 -1
  159. package/templates/agent-plugin/agents/review-plan/security.md +5 -2
  160. package/templates/agent-plugin/agents/review-plan.md +52 -5
  161. package/templates/agent-plugin/agents/review-plan.settings.json +57 -0
  162. package/templates/agent-plugin/agents/review.md +89 -16
  163. package/templates/agent-plugin/agents/review.settings.json +57 -0
  164. package/templates/agent-plugin/agents/spec/engineer.md +175 -0
  165. package/templates/agent-plugin/agents/spec/requirements-writer.md +149 -0
  166. package/templates/agent-plugin/agents/spec.md +444 -0
  167. package/templates/agent-plugin/agents/spec.settings.json +57 -0
  168. package/templates/agent-plugin/agents/test-spec.md +58 -2
  169. package/templates/agent-plugin/agents/test-spec.settings.json +57 -0
  170. package/templates/agent-plugin/hooks/CLAUDE.md +9 -57
  171. package/templates/agent-plugin/hooks/ask-background-guard.sh +57 -0
  172. package/templates/agent-plugin/hooks/intercept-send-message.sh +1 -1
  173. package/templates/agent-plugin/hooks/plan-user-prompt.sh +8 -7
  174. package/templates/agent-plugin/hooks/plan-validate.sh +97 -0
  175. package/templates/agent-plugin/hooks/plan-write-path.sh +55 -0
  176. package/templates/agent-plugin/hooks/problem-user-prompt.sh +26 -0
  177. package/templates/agent-plugin/hooks/register-bg-task.sh +37 -0
  178. package/templates/agent-plugin/hooks/require-submit.sh +51 -42
  179. package/templates/agent-plugin/hooks/review-user-prompt.sh +6 -2
  180. package/templates/agent-plugin/hooks/spec-user-prompt.sh +43 -0
  181. package/templates/agent-plugin/skills/humanloop/SKILL.md +147 -0
  182. package/templates/agent-plugin/skills/perspective-fanout/SKILL.md +115 -0
  183. package/templates/agent-plugin/skills/problem-document/SKILL.md +105 -0
  184. package/templates/agent-plugin/skills/problem-plateau-breakers/SKILL.md +83 -0
  185. package/templates/agent-suffix.md +7 -4
  186. package/templates/baleia.lua +42 -0
  187. package/templates/companion-plugin/hooks/user-prompt-context.sh +1 -1
  188. package/templates/dashboard-claude.md +7 -3
  189. package/templates/orchestrator-base.md +89 -52
  190. package/templates/orchestrator-completion.md +47 -24
  191. package/templates/orchestrator-discovery.md +183 -0
  192. package/templates/orchestrator-impl.md +47 -18
  193. package/templates/orchestrator-planning.md +109 -20
  194. package/templates/orchestrator-plugin/commands/sisyphus/scratch.md +19 -0
  195. package/templates/orchestrator-plugin/commands/sisyphus/spec.md +11 -0
  196. package/templates/orchestrator-plugin/commands/sisyphus/strategize.md +5 -5
  197. package/templates/orchestrator-plugin/hooks/hooks.json +0 -10
  198. package/templates/orchestrator-plugin/skills/humanloop/SKILL.md +149 -0
  199. package/templates/orchestrator-plugin/skills/orchestration/CLAUDE.md +1 -0
  200. package/templates/orchestrator-plugin/skills/orchestration/SKILL.md +2 -1
  201. package/templates/orchestrator-plugin/skills/orchestration/strategy.md +160 -0
  202. package/templates/orchestrator-plugin/skills/orchestration/task-patterns.md +26 -28
  203. package/templates/orchestrator-plugin/skills/orchestration/workflow-examples.md +133 -25
  204. package/templates/orchestrator-settings.json +55 -0
  205. package/templates/orchestrator-validation.md +17 -14
  206. package/templates/sisyphus-init.lua +30 -0
  207. package/templates/sisyphus-tmux-plugin/hooks/hooks.json +54 -0
  208. package/templates/sisyphus-tmux-plugin/hooks/tmux-state.sh +19 -0
  209. package/templates/termrender-haiku-system.md +82 -0
  210. package/templates/whip-animation.sh +345 -0
  211. package/dist/chunk-6TIO23U3.js +0 -67
  212. package/dist/chunk-6TIO23U3.js.map +0 -1
  213. package/dist/chunk-GSXF3TCZ.js.map +0 -1
  214. package/dist/chunk-HQZOAX6D.js +0 -240
  215. package/dist/chunk-HQZOAX6D.js.map +0 -1
  216. package/dist/chunk-IF55HPWX.js +0 -44
  217. package/dist/chunk-IF55HPWX.js.map +0 -1
  218. package/dist/chunk-UIVQXCWB.js +0 -46
  219. package/dist/chunk-UIVQXCWB.js.map +0 -1
  220. package/dist/paths-3EL2SCHI.js +0 -58
  221. package/dist/templates/agent-plugin/agents/design.md +0 -134
  222. package/dist/templates/agent-plugin/agents/requirements.md +0 -138
  223. package/dist/templates/begin.md +0 -22
  224. package/dist/templates/nvim-tutorial.txt +0 -68
  225. package/dist/templates/orchestrator-plugin/commands/sisyphus/design.md +0 -13
  226. package/dist/templates/orchestrator-plugin/commands/sisyphus/requirements.md +0 -13
  227. package/dist/templates/orchestrator-plugin/hooks/idle-notify.sh +0 -71
  228. package/dist/templates/orchestrator-strategy.md +0 -238
  229. package/templates/agent-plugin/agents/design.md +0 -134
  230. package/templates/agent-plugin/agents/requirements.md +0 -138
  231. package/templates/begin.md +0 -22
  232. package/templates/nvim-tutorial.txt +0 -68
  233. package/templates/orchestrator-plugin/commands/sisyphus/design.md +0 -13
  234. package/templates/orchestrator-plugin/commands/sisyphus/requirements.md +0 -13
  235. package/templates/orchestrator-plugin/hooks/idle-notify.sh +0 -71
  236. package/templates/orchestrator-strategy.md +0 -238
  237. /package/dist/{paths-3EL2SCHI.js.map → paths-JXFLR5BN.js.map} +0 -0
@@ -1,240 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- goalPath,
4
- roadmapPath,
5
- sessionsDir,
6
- socketPath,
7
- statePath
8
- } from "./chunk-GSXF3TCZ.js";
9
-
10
- // src/shared/utils.ts
11
- function computeActiveTimeMs(session) {
12
- return session.activeMs;
13
- }
14
-
15
- // src/shared/format.ts
16
- function formatDuration(startOrMs, endIso) {
17
- let totalMs;
18
- if (typeof startOrMs === "number") {
19
- totalMs = startOrMs;
20
- } else {
21
- const start = new Date(startOrMs).getTime();
22
- const end = endIso ? new Date(endIso).getTime() : Date.now();
23
- totalMs = end - start;
24
- }
25
- const totalSeconds = Math.floor(totalMs / 1e3);
26
- if (totalSeconds < 0) return "0s";
27
- const hours = Math.floor(totalSeconds / 3600);
28
- const minutes = Math.floor(totalSeconds % 3600 / 60);
29
- const seconds = totalSeconds % 60;
30
- if (hours > 0) return `${hours}h${minutes}m`;
31
- if (minutes > 0) return `${minutes}m${seconds}s`;
32
- return `${seconds}s`;
33
- }
34
- function statusColor(status) {
35
- switch (status) {
36
- case "active":
37
- case "running":
38
- return "green";
39
- case "completed":
40
- return "cyan";
41
- case "paused":
42
- return "yellow";
43
- case "killed":
44
- case "crashed":
45
- return "red";
46
- case "lost":
47
- return "gray";
48
- default:
49
- return "white";
50
- }
51
- }
52
-
53
- // src/tui/lib/reports.ts
54
- import { readFileSync } from "fs";
55
- function loadReportContent(report) {
56
- try {
57
- return readFileSync(report.filePath, "utf-8");
58
- } catch {
59
- return report.summary;
60
- }
61
- }
62
- function resolveReports(reports) {
63
- return [...reports].reverse().map((r) => ({
64
- type: r.type,
65
- timestamp: r.timestamp,
66
- content: loadReportContent(r),
67
- summary: r.summary
68
- }));
69
- }
70
-
71
- // src/tui/lib/context.ts
72
- import { readFileSync as readFileSync2, readdirSync } from "fs";
73
- function readFileSafe(filePath) {
74
- try {
75
- return readFileSync2(filePath, "utf-8");
76
- } catch {
77
- return null;
78
- }
79
- }
80
- function escapeXml(s) {
81
- return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
82
- }
83
- function buildCompanionContext(cwd) {
84
- let sessionDirs;
85
- try {
86
- sessionDirs = readdirSync(sessionsDir(cwd));
87
- } catch {
88
- return "<sessions>No sessions found.</sessions>";
89
- }
90
- const now = Date.now();
91
- const sevenDaysMs = 7 * 24 * 60 * 60 * 1e3;
92
- const sessionBlocks = [];
93
- for (const sessionId of sessionDirs) {
94
- const stateRaw = readFileSafe(statePath(cwd, sessionId));
95
- if (!stateRaw) continue;
96
- let session;
97
- try {
98
- session = JSON.parse(stateRaw);
99
- } catch {
100
- continue;
101
- }
102
- if (session.status === "completed" && session.completedAt) {
103
- if (now - new Date(session.completedAt).getTime() > sevenDaysMs) continue;
104
- }
105
- const lines = [];
106
- const nameAttr = session.name ? ` name="${escapeXml(session.name)}"` : "";
107
- lines.push(` <session id="${escapeXml(session.id)}"${nameAttr} status="${escapeXml(session.status)}">`);
108
- lines.push(` <task>${escapeXml(session.task)}</task>`);
109
- lines.push(` <created>${escapeXml(session.createdAt)}</created>`);
110
- lines.push(` <cycles>${session.orchestratorCycles.length}</cycles>`);
111
- if (session.status === "completed") {
112
- if (session.completionReport) {
113
- const snippet = session.completionReport.slice(0, 300).replace(/\n+/g, " ").trim();
114
- lines.push(` <completion-report>${escapeXml(snippet)}${session.completionReport.length > 300 ? "\u2026" : ""}</completion-report>`);
115
- }
116
- } else {
117
- if (session.agents.length > 0) {
118
- const counts = /* @__PURE__ */ new Map();
119
- for (const agent of session.agents) {
120
- counts.set(agent.status, (counts.get(agent.status) ?? 0) + 1);
121
- }
122
- const summary = [...counts.entries()].map(([status, n]) => `${n} ${status}`).join(", ");
123
- lines.push(` <agents>${escapeXml(summary)}</agents>`);
124
- }
125
- const goalContent = readFileSafe(goalPath(cwd, session.id));
126
- if (goalContent) {
127
- const firstLine = goalContent.split("\n").map((l) => l.trim()).find((l) => l.length > 0 && !l.startsWith("#"));
128
- if (firstLine) lines.push(` <goal>${escapeXml(firstLine)}</goal>`);
129
- }
130
- const roadmapContent = readFileSafe(roadmapPath(cwd, session.id));
131
- if (roadmapContent) {
132
- const todos = roadmapContent.split("\n").filter((l) => l.includes("- [ ]")).slice(0, 5).map((l) => l.trim());
133
- if (todos.length > 0) {
134
- lines.push(" <todos>");
135
- for (const todo of todos) lines.push(` ${escapeXml(todo)}`);
136
- lines.push(" </todos>");
137
- }
138
- }
139
- }
140
- lines.push(" </session>");
141
- sessionBlocks.push(lines.join("\n"));
142
- }
143
- if (sessionBlocks.length === 0) {
144
- return "<sessions>No sessions found.</sessions>";
145
- }
146
- return ["<sessions>", ...sessionBlocks, "</sessions>"].join("\n");
147
- }
148
- function buildSessionContext(session, cwd) {
149
- const goal = readFileSafe(goalPath(cwd, session.id));
150
- const roadmap = readFileSafe(roadmapPath(cwd, session.id));
151
- const agentsXml = session.agents.map((agent) => {
152
- const reportBlocks = resolveReports(agent.reports);
153
- const reportsXml = [...reportBlocks].reverse().map((block) => {
154
- return ` <report type="${block.type}" time="${escapeXml(block.timestamp)}">${escapeXml(block.content)}</report>`;
155
- }).join("\n");
156
- return [
157
- ` <agent id="${escapeXml(agent.id)}" name="${escapeXml(agent.name)}" type="${escapeXml(agent.agentType)}" status="${escapeXml(agent.status)}">`,
158
- ` <instruction>${escapeXml(agent.instruction)}</instruction>`,
159
- ...reportsXml ? [reportsXml] : [],
160
- ` </agent>`
161
- ].join("\n");
162
- }).join("\n");
163
- const cyclesXml = session.orchestratorCycles.map((cycle) => {
164
- const agents = cycle.agentsSpawned.join(", ");
165
- const mode = cycle.mode ? ` mode="${escapeXml(cycle.mode)}"` : "";
166
- return ` <cycle number="${cycle.cycle}"${mode} agents="${escapeXml(agents)}" />`;
167
- }).join("\n");
168
- const lines = [
169
- "<context>",
170
- `<session id="${escapeXml(session.id)}" status="${escapeXml(session.status)}">`,
171
- ` <task>${escapeXml(session.task)}</task>`,
172
- ` <cwd>${escapeXml(session.cwd)}</cwd>`
173
- ];
174
- if (goal) lines.push(` <goal>${escapeXml(goal)}</goal>`);
175
- if (roadmap) lines.push(` <roadmap>${escapeXml(roadmap)}</roadmap>`);
176
- if (session.agents.length > 0) {
177
- lines.push(" <agents>");
178
- lines.push(agentsXml);
179
- lines.push(" </agents>");
180
- }
181
- if (session.orchestratorCycles.length > 0) {
182
- lines.push(" <cycles>");
183
- lines.push(cyclesXml);
184
- lines.push(" </cycles>");
185
- }
186
- if (session.completionReport) {
187
- lines.push(` <completion-report>${escapeXml(session.completionReport)}</completion-report>`);
188
- }
189
- lines.push("</session>");
190
- lines.push("</context>");
191
- return lines.join("\n");
192
- }
193
-
194
- // src/shared/client.ts
195
- import { connect } from "net";
196
- function rawSend(request, timeoutMs = 1e4) {
197
- const sock = socketPath();
198
- return new Promise((resolve, reject) => {
199
- const socket = connect(sock);
200
- let data = "";
201
- const timeout = setTimeout(() => {
202
- socket.destroy();
203
- reject(new Error(`Request timed out after ${(timeoutMs / 1e3).toFixed(0)}s. The daemon may be overloaded.
204
- Check: sisyphus doctor
205
- Logs: tail -20 ~/.sisyphus/daemon.log`));
206
- }, timeoutMs);
207
- socket.on("connect", () => {
208
- socket.write(JSON.stringify(request) + "\n");
209
- });
210
- socket.on("data", (chunk) => {
211
- data += chunk.toString();
212
- const newlineIdx = data.indexOf("\n");
213
- if (newlineIdx !== -1) {
214
- clearTimeout(timeout);
215
- const line = data.slice(0, newlineIdx);
216
- socket.destroy();
217
- try {
218
- resolve(JSON.parse(line));
219
- } catch {
220
- reject(new Error(`Invalid JSON response from daemon: ${line}`));
221
- }
222
- }
223
- });
224
- socket.on("error", (err) => {
225
- clearTimeout(timeout);
226
- reject(err);
227
- });
228
- });
229
- }
230
-
231
- export {
232
- rawSend,
233
- computeActiveTimeMs,
234
- formatDuration,
235
- statusColor,
236
- resolveReports,
237
- buildCompanionContext,
238
- buildSessionContext
239
- };
240
- //# sourceMappingURL=chunk-HQZOAX6D.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shared/utils.ts","../src/shared/format.ts","../src/tui/lib/reports.ts","../src/tui/lib/context.ts","../src/shared/client.ts"],"sourcesContent":["import type { Session } from './types.js';\n\n/**\n * Return the tracked active time for a session.\n * Active time is accumulated by the daemon's pane monitor, excluding sleep/idle gaps.\n */\nexport function computeActiveTimeMs(session: Session): number {\n return session.activeMs;\n}\n","/** Format milliseconds or ISO date range to human-readable duration */\nexport function formatDuration(startOrMs: string | number, endIso?: string | null): string {\n let totalMs: number;\n if (typeof startOrMs === 'number') {\n totalMs = startOrMs;\n } else {\n const start = new Date(startOrMs).getTime();\n const end = endIso ? new Date(endIso).getTime() : Date.now();\n totalMs = end - start;\n }\n const totalSeconds = Math.floor(totalMs / 1000);\n if (totalSeconds < 0) return '0s';\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor((totalSeconds % 3600) / 60);\n const seconds = totalSeconds % 60;\n if (hours > 0) return `${hours}h${minutes}m`;\n if (minutes > 0) return `${minutes}m${seconds}s`;\n return `${seconds}s`;\n}\n\n/** Map session/agent status to a color name */\nexport function statusColor(status: string): string {\n switch (status) {\n case 'active':\n case 'running':\n return 'green';\n case 'completed':\n return 'cyan';\n case 'paused':\n return 'yellow';\n case 'killed':\n case 'crashed':\n return 'red';\n case 'lost':\n return 'gray';\n default:\n return 'white';\n }\n}\n","import { readFileSync } from 'node:fs';\nimport type { AgentReport } from '../../shared/types.js';\n\nexport interface ReportBlock {\n type: 'update' | 'final';\n timestamp: string;\n content: string;\n summary: string;\n}\n\nfunction loadReportContent(report: AgentReport): string {\n try {\n return readFileSync(report.filePath, 'utf-8');\n } catch {\n return report.summary;\n }\n}\n\nexport function resolveReports(reports: AgentReport[]): ReportBlock[] {\n return [...reports].reverse().map((r) => ({\n type: r.type as 'update' | 'final',\n timestamp: r.timestamp,\n content: loadReportContent(r),\n summary: r.summary,\n }));\n}\n","import { readFileSync, readdirSync } from 'node:fs';\nimport { goalPath, roadmapPath, sessionsDir, statePath } from '../../shared/paths.js';\nimport { resolveReports } from './reports.js';\nimport type { Session, AgentStatus } from '../../shared/types.js';\n\nfunction readFileSafe(filePath: string): string | null {\n try {\n return readFileSync(filePath, 'utf-8');\n } catch {\n return null;\n }\n}\n\nfunction escapeXml(s: string): string {\n return s\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;');\n}\n\nexport function buildCompanionContext(cwd: string): string {\n let sessionDirs: string[];\n try {\n sessionDirs = readdirSync(sessionsDir(cwd));\n } catch {\n return '<sessions>No sessions found.</sessions>';\n }\n\n const now = Date.now();\n const sevenDaysMs = 7 * 24 * 60 * 60 * 1000;\n const sessionBlocks: string[] = [];\n\n for (const sessionId of sessionDirs) {\n const stateRaw = readFileSafe(statePath(cwd, sessionId));\n if (!stateRaw) continue;\n\n let session: Session;\n try {\n session = JSON.parse(stateRaw) as Session;\n } catch {\n continue;\n }\n\n // Skip completed sessions older than 7 days\n if (session.status === 'completed' && session.completedAt) {\n if (now - new Date(session.completedAt).getTime() > sevenDaysMs) continue;\n }\n\n const lines: string[] = [];\n const nameAttr = session.name ? ` name=\"${escapeXml(session.name)}\"` : '';\n lines.push(` <session id=\"${escapeXml(session.id)}\"${nameAttr} status=\"${escapeXml(session.status)}\">`);\n lines.push(` <task>${escapeXml(session.task)}</task>`);\n lines.push(` <created>${escapeXml(session.createdAt)}</created>`);\n lines.push(` <cycles>${session.orchestratorCycles.length}</cycles>`);\n\n if (session.status === 'completed') {\n if (session.completionReport) {\n const snippet = session.completionReport.slice(0, 300).replace(/\\n+/g, ' ').trim();\n lines.push(` <completion-report>${escapeXml(snippet)}${session.completionReport.length > 300 ? '…' : ''}</completion-report>`);\n }\n } else {\n // Agent summary by status\n if (session.agents.length > 0) {\n const counts = new Map<AgentStatus, number>();\n for (const agent of session.agents) {\n counts.set(agent.status, (counts.get(agent.status) ?? 0) + 1);\n }\n const summary = [...counts.entries()].map(([status, n]) => `${n} ${status}`).join(', ');\n lines.push(` <agents>${escapeXml(summary)}</agents>`);\n }\n\n // Goal: first meaningful line\n const goalContent = readFileSafe(goalPath(cwd, session.id));\n if (goalContent) {\n const firstLine = goalContent.split('\\n').map(l => l.trim()).find(l => l.length > 0 && !l.startsWith('#'));\n if (firstLine) lines.push(` <goal>${escapeXml(firstLine)}</goal>`);\n }\n\n // Roadmap unchecked todos (up to 5)\n const roadmapContent = readFileSafe(roadmapPath(cwd, session.id));\n if (roadmapContent) {\n const todos = roadmapContent\n .split('\\n')\n .filter(l => l.includes('- [ ]'))\n .slice(0, 5)\n .map(l => l.trim());\n if (todos.length > 0) {\n lines.push(' <todos>');\n for (const todo of todos) lines.push(` ${escapeXml(todo)}`);\n lines.push(' </todos>');\n }\n }\n }\n\n lines.push(' </session>');\n sessionBlocks.push(lines.join('\\n'));\n }\n\n if (sessionBlocks.length === 0) {\n return '<sessions>No sessions found.</sessions>';\n }\n\n return ['<sessions>', ...sessionBlocks, '</sessions>'].join('\\n');\n}\n\nexport function buildSessionContext(session: Session, cwd: string): string {\n const goal = readFileSafe(goalPath(cwd, session.id));\n const roadmap = readFileSafe(roadmapPath(cwd, session.id));\n\n const agentsXml = session.agents.map((agent) => {\n const reportBlocks = resolveReports(agent.reports);\n // resolveReports returns newest-first; reverse to chronological for context\n const reportsXml = [...reportBlocks].reverse().map((block) => {\n return ` <report type=\"${block.type}\" time=\"${escapeXml(block.timestamp)}\">${escapeXml(block.content)}</report>`;\n }).join('\\n');\n\n return [\n ` <agent id=\"${escapeXml(agent.id)}\" name=\"${escapeXml(agent.name)}\" type=\"${escapeXml(agent.agentType)}\" status=\"${escapeXml(agent.status)}\">`,\n ` <instruction>${escapeXml(agent.instruction)}</instruction>`,\n ...(reportsXml ? [reportsXml] : []),\n ` </agent>`,\n ].join('\\n');\n }).join('\\n');\n\n const cyclesXml = session.orchestratorCycles.map((cycle) => {\n const agents = cycle.agentsSpawned.join(', ');\n const mode = cycle.mode ? ` mode=\"${escapeXml(cycle.mode)}\"` : '';\n return ` <cycle number=\"${cycle.cycle}\"${mode} agents=\"${escapeXml(agents)}\" />`;\n }).join('\\n');\n\n const lines: string[] = [\n '<context>',\n `<session id=\"${escapeXml(session.id)}\" status=\"${escapeXml(session.status)}\">`,\n ` <task>${escapeXml(session.task)}</task>`,\n ` <cwd>${escapeXml(session.cwd)}</cwd>`,\n ];\n\n if (goal) lines.push(` <goal>${escapeXml(goal)}</goal>`);\n if (roadmap) lines.push(` <roadmap>${escapeXml(roadmap)}</roadmap>`);\n\n if (session.agents.length > 0) {\n lines.push(' <agents>');\n lines.push(agentsXml);\n lines.push(' </agents>');\n }\n\n if (session.orchestratorCycles.length > 0) {\n lines.push(' <cycles>');\n lines.push(cyclesXml);\n lines.push(' </cycles>');\n }\n\n if (session.completionReport) {\n lines.push(` <completion-report>${escapeXml(session.completionReport)}</completion-report>`);\n }\n\n lines.push('</session>');\n lines.push('</context>');\n\n return lines.join('\\n');\n}\n","import { connect } from 'node:net';\nimport { socketPath } from './paths.js';\nimport type { Request, Response } from './protocol.js';\n\nexport function rawSend(request: Request, timeoutMs = 10_000): Promise<Response> {\n const sock = socketPath();\n\n return new Promise<Response>((resolve, reject) => {\n const socket = connect(sock);\n let data = '';\n\n const timeout = setTimeout(() => {\n socket.destroy();\n reject(new Error(`Request timed out after ${(timeoutMs / 1000).toFixed(0)}s. The daemon may be overloaded.\\n Check: sisyphus doctor\\n Logs: tail -20 ~/.sisyphus/daemon.log`));\n }, timeoutMs);\n\n socket.on('connect', () => {\n socket.write(JSON.stringify(request) + '\\n');\n });\n\n socket.on('data', (chunk) => {\n data += chunk.toString();\n const newlineIdx = data.indexOf('\\n');\n if (newlineIdx !== -1) {\n clearTimeout(timeout);\n const line = data.slice(0, newlineIdx);\n socket.destroy();\n try {\n resolve(JSON.parse(line) as Response);\n } catch {\n reject(new Error(`Invalid JSON response from daemon: ${line}`));\n }\n }\n });\n\n socket.on('error', (err) => {\n clearTimeout(timeout);\n reject(err);\n });\n });\n}\n"],"mappings":";;;;;;;;;;AAMO,SAAS,oBAAoB,SAA0B;AAC5D,SAAO,QAAQ;AACjB;;;ACPO,SAAS,eAAe,WAA4B,QAAgC;AACzF,MAAI;AACJ,MAAI,OAAO,cAAc,UAAU;AACjC,cAAU;AAAA,EACZ,OAAO;AACL,UAAM,QAAQ,IAAI,KAAK,SAAS,EAAE,QAAQ;AAC1C,UAAM,MAAM,SAAS,IAAI,KAAK,MAAM,EAAE,QAAQ,IAAI,KAAK,IAAI;AAC3D,cAAU,MAAM;AAAA,EAClB;AACA,QAAM,eAAe,KAAK,MAAM,UAAU,GAAI;AAC9C,MAAI,eAAe,EAAG,QAAO;AAC7B,QAAM,QAAQ,KAAK,MAAM,eAAe,IAAI;AAC5C,QAAM,UAAU,KAAK,MAAO,eAAe,OAAQ,EAAE;AACrD,QAAM,UAAU,e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AC,QAAQ;AAC1B,mBAAa,OAAO;AACpB,aAAO,GAAG;AAAA,IACZ,CAAC;AAAA,EACH,CAAC;AACH;","names":["readFileSync","readFileSync"]}
@@ -1,44 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- globalConfigPath,
4
- projectConfigPath
5
- } from "./chunk-GSXF3TCZ.js";
6
-
7
- // src/shared/config.ts
8
- import { readFileSync } from "fs";
9
- var DEFAULT_CONFIG = {
10
- pollIntervalMs: 5e3,
11
- orchestratorEffort: "high",
12
- agentEffort: "medium",
13
- notifications: {
14
- enabled: true,
15
- sound: "/System/Library/Sounds/Hero.aiff"
16
- },
17
- requiredPlugins: [
18
- { name: "devcore", marketplace: "crouton-kit" }
19
- ]
20
- };
21
- function readJsonFile(filePath) {
22
- try {
23
- const content = readFileSync(filePath, "utf-8");
24
- return JSON.parse(content);
25
- } catch {
26
- return {};
27
- }
28
- }
29
- function loadConfig(cwd) {
30
- const global = readJsonFile(globalConfigPath());
31
- const project = readJsonFile(projectConfigPath(cwd));
32
- return { ...DEFAULT_CONFIG, ...global, ...project };
33
- }
34
-
35
- // src/shared/shell.ts
36
- function shellQuote(s) {
37
- return `'${s.replace(/'/g, "'\\''")}'`;
38
- }
39
-
40
- export {
41
- loadConfig,
42
- shellQuote
43
- };
44
- //# sourceMappingURL=chunk-IF55HPWX.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shared/config.ts","../src/shared/shell.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { globalConfigPath, projectConfigPath } from './paths.js';\n\nexport type EffortLevel = 'low' | 'medium' | 'high' | 'max';\n\nexport interface NotificationConfig {\n enabled?: boolean;\n sound?: string;\n}\n\nexport interface RequiredPlugin {\n name: string;\n marketplace: string;\n}\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 notifications?: NotificationConfig;\n requiredPlugins?: RequiredPlugin[];\n}\n\nconst DEFAULT_CONFIG: Config = {\n pollIntervalMs: 5000,\n orchestratorEffort: 'high',\n agentEffort: 'medium',\n notifications: {\n enabled: true,\n sound: '/System/Library/Sounds/Hero.aiff',\n },\n requiredPlugins: [\n { name: 'devcore', marketplace: 'crouton-kit' },\n ],\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","export function shellQuote(s: string): string {\n return `'${s.replace(/'/g, \"'\\\\''\")}'`;\n}\n"],"mappings":";;;;;;;AAAA,SAAS,oBAAoB;AA6B7B,IAAM,iBAAyB;AAAA,EAC7B,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,eAAe;AAAA,IACb,SAAS;AAAA,IACT,OAAO;AAAA,EACT;AAAA,EACA,iBAAiB;AAAA,IACf,EAAE,MAAM,WAAW,aAAa,cAAc;AAAA,EAChD;AACF;AAEA,SAAS,aAAa,UAAmC;AACvD,MAAI;AACF,UAAM,UAAU,aAAa,UAAU,OAAO;AAC9C,WAAO,KAAK,MAAM,OAAO;AAAA,EAC3B,QAAQ;AACN,WAAO,CAAC;AAAA,EACV;AACF;AAEO,SAAS,WAAW,KAAqB;AAC9C,QAAM,SAAS,aAAa,iBAAiB,CAAC;AAC9C,QAAM,UAAU,aAAa,kBAAkB,GAAG,CAAC;AACnD,SAAO,EAAE,GAAG,gBAAgB,GAAG,QAAQ,GAAG,QAAQ;AACpD;;;ACvDO,SAAS,WAAW,GAAmB;AAC5C,SAAO,IAAI,EAAE,QAAQ,MAAM,OAAO,CAAC;AACrC;","names":[]}
@@ -1,46 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- loadConfig
4
- } from "./chunk-IF55HPWX.js";
5
-
6
- // src/daemon/plugins.ts
7
- import { readFileSync } from "fs";
8
- import { homedir } from "os";
9
- import { join } from "path";
10
- function installedPluginsPath() {
11
- return join(homedir(), ".claude", "plugins", "installed_plugins.json");
12
- }
13
- function resolveInstalledPlugin(name) {
14
- let data;
15
- try {
16
- data = JSON.parse(readFileSync(installedPluginsPath(), "utf-8"));
17
- } catch {
18
- return null;
19
- }
20
- const entries = data.plugins?.[name];
21
- if (!entries || entries.length === 0) return null;
22
- const userEntry = entries.find((e) => e.scope === "user");
23
- return (userEntry ?? entries[0]).installPath;
24
- }
25
- function resolveRequiredPluginDirs(cwd) {
26
- const config = loadConfig(cwd);
27
- const required = config.requiredPlugins;
28
- if (!required || required.length === 0) return [];
29
- const dirs = [];
30
- for (const plugin of required) {
31
- const key = `${plugin.name}@${plugin.marketplace}`;
32
- const path = resolveInstalledPlugin(key);
33
- if (path) {
34
- dirs.push(path);
35
- } else {
36
- console.log(`[sisyphus] Warning: required plugin ${key} not installed \u2014 skipping`);
37
- }
38
- }
39
- return dirs;
40
- }
41
-
42
- export {
43
- resolveInstalledPlugin,
44
- resolveRequiredPluginDirs
45
- };
46
- //# sourceMappingURL=chunk-UIVQXCWB.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/daemon/plugins.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\nimport { loadConfig } from '../shared/config.js';\n\ninterface PluginEntry {\n scope: string;\n installPath: string;\n version: string;\n installedAt: string;\n lastUpdated: string;\n}\n\ninterface InstalledPlugins {\n version: number;\n plugins: Record<string, PluginEntry[]>;\n}\n\nfunction installedPluginsPath(): string {\n return join(homedir(), '.claude', 'plugins', 'installed_plugins.json');\n}\n\nexport function resolveInstalledPlugin(name: string): string | null {\n let data: InstalledPlugins;\n try {\n data = JSON.parse(readFileSync(installedPluginsPath(), 'utf-8'));\n } catch {\n return null;\n }\n\n const entries = data.plugins?.[name];\n if (!entries || entries.length === 0) return null;\n\n // Prefer user-scoped entry\n const userEntry = entries.find(e => e.scope === 'user');\n return (userEntry ?? entries[0])!.installPath;\n}\n\nexport function resolveRequiredPluginDirs(cwd: string): string[] {\n const config = loadConfig(cwd);\n const required = config.requiredPlugins;\n if (!required || required.length === 0) return [];\n\n const dirs: string[] = [];\n for (const plugin of required) {\n const key = `${plugin.name}@${plugin.marketplace}`;\n const path = resolveInstalledPlugin(key);\n if (path) {\n dirs.push(path);\n } else {\n console.log(`[sisyphus] Warning: required plugin ${key} not installed — skipping`);\n }\n }\n return dirs;\n}\n"],"mappings":";;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,eAAe;AACxB,SAAS,YAAY;AAgBrB,SAAS,uBAA+B;AACtC,SAAO,KAAK,QAAQ,GAAG,WAAW,WAAW,wBAAwB;AACvE;AAEO,SAAS,uBAAuB,MAA6B;AAClE,MAAI;AACJ,MAAI;AACF,WAAO,KAAK,MAAM,aAAa,qBAAqB,GAAG,OAAO,CAAC;AAAA,EACjE,QAAQ;AACN,WAAO;AAAA,EACT;AAEA,QAAM,UAAU,KAAK,UAAU,IAAI;AACnC,MAAI,CAAC,WAAW,QAAQ,WAAW,EAAG,QAAO;AAG7C,QAAM,YAAY,QAAQ,KAAK,OAAK,EAAE,UAAU,MAAM;AACtD,UAAQ,aAAa,QAAQ,CAAC,GAAI;AACpC;AAEO,SAAS,0BAA0B,KAAuB;AAC/D,QAAM,SAAS,WAAW,GAAG;AAC7B,QAAM,WAAW,OAAO;AACxB,MAAI,CAAC,YAAY,SAAS,WAAW,EAAG,QAAO,CAAC;AAEhD,QAAM,OAAiB,CAAC;AACxB,aAAW,UAAU,UAAU;AAC7B,UAAM,MAAM,GAAG,OAAO,IAAI,IAAI,OAAO,WAAW;AAChD,UAAM,OAAO,uBAAuB,GAAG;AACvC,QAAI,MAAM;AACR,WAAK,KAAK,IAAI;AAAA,IAChB,OAAO;AACL,cAAQ,IAAI,uCAAuC,GAAG,gCAA2B;AAAA,IACnF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
@@ -1,58 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- contextDir,
4
- cycleLogPath,
5
- daemonLogPath,
6
- daemonPidPath,
7
- daemonUpdatingPath,
8
- globalConfigPath,
9
- globalDir,
10
- goalPath,
11
- legacyLogsPath,
12
- logsDir,
13
- messagesDir,
14
- projectConfigPath,
15
- projectDir,
16
- projectOrchestratorPromptPath,
17
- promptsDir,
18
- reportFilePath,
19
- reportsDir,
20
- roadmapPath,
21
- sessionDir,
22
- sessionsDir,
23
- snapshotDir,
24
- snapshotsDir,
25
- socketPath,
26
- statePath,
27
- strategyPath,
28
- tuiScratchDir
29
- } from "./chunk-GSXF3TCZ.js";
30
- export {
31
- contextDir,
32
- cycleLogPath,
33
- daemonLogPath,
34
- daemonPidPath,
35
- daemonUpdatingPath,
36
- globalConfigPath,
37
- globalDir,
38
- goalPath,
39
- legacyLogsPath,
40
- logsDir,
41
- messagesDir,
42
- projectConfigPath,
43
- projectDir,
44
- projectOrchestratorPromptPath,
45
- promptsDir,
46
- reportFilePath,
47
- reportsDir,
48
- roadmapPath,
49
- sessionDir,
50
- sessionsDir,
51
- snapshotDir,
52
- snapshotsDir,
53
- socketPath,
54
- statePath,
55
- strategyPath,
56
- tuiScratchDir
57
- };
58
- //# sourceMappingURL=paths-3EL2SCHI.js.map
@@ -1,134 +0,0 @@
1
- ---
2
- name: design
3
- description: Technical designer — creates a technical design from requirements through codebase investigation, trade-off analysis, flow tracing, and user iteration. Produces architecture, component boundaries, and data models without writing code.
4
- model: opus
5
- color: cyan
6
- effort: max
7
- interactive: true
8
- ---
9
-
10
- You are a **technical designer**. Your job is to define *how* the system will be built — architecture, component boundaries, data models, contracts — without writing code. The design captures technical decisions. All trade-offs resolved before saving.
11
-
12
- You are a **collaborator**, not a document generator. Design with the user, not for them.
13
-
14
- ## Your Role: Lead, Not Solo Explorer
15
-
16
- Assess the scope and delegate when appropriate:
17
-
18
- - **Small** (single domain, 1-5 files) — Investigate and design it yourself.
19
- - **Medium+** (multiple domains, 6+ files) — Spawn explore agents to probe different areas in parallel. Synthesize findings before proposing. For large designs, spawn adversarial reviewers (feasibility, scope) before presenting to the user.
20
-
21
- ## Inputs
22
-
23
- Check `$SISYPHUS_SESSION_DIR/context/` for:
24
- - **requirements.md** — Required. Defines what to build.
25
- - **problem.md** — Goals and UX context.
26
- - **explore-*.md** — Codebase exploration findings.
27
-
28
- ## Communication Style
29
-
30
- **Lead with diagrams. Work in pieces. Keep messages short.**
31
-
32
- - **One design decision per turn.** Don't present the full architecture at once — walk through it component by component or layer by layer.
33
- - **Lead with ASCII diagrams**, then explain. The diagram is the primary artifact; prose supports it.
34
- - **Use tables** for trade-off comparisons, interface contracts, and data model fields.
35
- - **Ask one focused question** per turn to drive the design forward.
36
- - **No walls of text.** If the user has to scroll to find your question, the message is too long.
37
-
38
- Example of a good design turn:
39
- ```
40
- For the state management layer, I see two options:
41
-
42
- Option A: Single file Option B: Write-ahead log
43
- ┌──────────┐ ┌──────────┐
44
- │state.json │◄── atomic write │ wal.log │──► compact ──► state.json
45
- └──────────┘ └──────────┘
46
-
47
- | Aspect | Option A | Option B |
48
- |-------------|-------------------|---------------------|
49
- | Complexity | Simple | Moderate |
50
- | Durability | Risk on crash | Recoverable |
51
- | Performance | Single write | Append + periodic |
52
-
53
- Given the current write frequency (~1/sec), I'd lean Option A.
54
- What's your read on crash recovery importance here?
55
- ```
56
-
57
- ## Process
58
-
59
- ### 1. Investigate Codebase
60
-
61
- Explore areas relevant to the requirements:
62
- - Existing architectural patterns and conventions
63
- - Data models and schemas involved
64
- - Services and APIs that will be extended or created
65
- - Frontend components and styling (if applicable)
66
-
67
- ### 2. Present Design Incrementally
68
-
69
- Don't dump a complete design. Walk through it in layers:
70
-
71
- 1. **Start with the big picture** — one ASCII diagram showing the major components and their relationships. Get alignment on the shape before going deeper.
72
- 2. **Drill into each component** — one at a time. Show its interfaces, data model, and how it connects to neighbors. Ask for feedback before moving on.
73
- 3. **Surface trade-offs as they arise** — use comparison tables. Make a recommendation, explain why, ask if the user agrees.
74
-
75
- Iterate through conversation to resolve ambiguity. **Wait for user input before proceeding.**
76
-
77
- ### 3. Frontend/Visual Components
78
-
79
- If the feature has a frontend or visual component:
80
- - Discuss the visual design and interaction patterns
81
- - Create HTML mockups using the application's real styling (actual CSS classes, design tokens, component library)
82
- - Reference existing UI patterns in the codebase
83
-
84
- ### 4. Flow Trace
85
-
86
- Before saving, simulate the design end-to-end with the user — present it as a walkthrough they can follow and challenge:
87
-
88
- ```
89
- Let's trace the happy path:
90
-
91
- 1. User runs `start "task"`
92
- ├─ Pre: daemon running, tmux session exists
93
- └─ Action: CLI sends CreateSession request
94
-
95
- 2. Daemon receives ─┘
96
- ├─ Pre: no duplicate session
97
- └─ Action: creates state.json, spawns orchestrator
98
-
99
- 3. Orchestrator starts ─┘
100
- ├─ Pre: state.json exists, prompt files written
101
- └─ Action: reads state, updates roadmap, spawns agents
102
-
103
- Any step where you see a gap?
104
- ```
105
-
106
- At each step, verify:
107
- - **Preconditions**: What must be true? Is it guaranteed by the design?
108
- - **State consistency**: Does the system interpret state correctly at each point?
109
- - **Failure**: What happens if this step fails? Is recovery defined?
110
- - **Handoff**: Does this step's output match the next step's expected input?
111
-
112
- If gaps found, discuss with user before saving.
113
-
114
- ### 5. Save Design Document
115
-
116
- Once all components and trade-offs are resolved, assemble and save to `$SISYPHUS_SESSION_DIR/context/design.md`:
117
-
118
- - **Overview** — Solution approach, key technical decisions (3-5 sentences)
119
- - **Architecture** — Component boundaries, data flow, service interactions. Include an ASCII diagram. Add a state machine diagram when stateful transitions are involved.
120
- - **Components** — Key modules/classes with responsibilities and interfaces
121
- - **Data Models** — Schema definitions, type interfaces, validation rules
122
- - **Error Handling** — Error types, conditions, recovery strategies
123
- - **Related Files** — Paths to relevant existing code. Do NOT annotate with implementation instructions.
124
-
125
- **The line**: If it narrows the solution space to one reasonable approach, it belongs. If it prescribes exact code paths, it doesn't.
126
-
127
- ### 6. Research for Large Features
128
-
129
- **Small features** (touches ~10 or fewer files):
130
- - The design's "Related files" section is sufficient context.
131
-
132
- **Large features** (touches 10+ files across multiple domains):
133
- - Offer to create dedicated context documents for planning.
134
- - If yes, spawn explore agents per domain, save to `$SISYPHUS_SESSION_DIR/context/explore-{domain}.md`.