oh-my-claude-sisyphus 2.0.3 → 2.0.5

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.
@@ -231,7 +231,7 @@ describe('Installer Constants', () => {
231
231
  });
232
232
  it('should match package.json version', () => {
233
233
  // This is a runtime check - VERSION should match the package.json
234
- expect(VERSION).toBe('2.0.3');
234
+ expect(VERSION).toBe('2.0.5');
235
235
  });
236
236
  });
237
237
  describe('File Paths', () => {
@@ -24,7 +24,7 @@ export declare const HOOKS_DIR: string;
24
24
  export declare const SETTINGS_FILE: string;
25
25
  export declare const VERSION_FILE: string;
26
26
  /** Current version */
27
- export declare const VERSION = "2.0.3";
27
+ export declare const VERSION = "2.0.5";
28
28
  /** Installation result */
29
29
  export interface InstallResult {
30
30
  success: boolean;
@@ -29,7 +29,7 @@ export const HOOKS_DIR = join(CLAUDE_CONFIG_DIR, 'hooks');
29
29
  export const SETTINGS_FILE = join(CLAUDE_CONFIG_DIR, 'settings.json');
30
30
  export const VERSION_FILE = join(CLAUDE_CONFIG_DIR, '.sisyphus-version.json');
31
31
  /** Current version */
32
- export const VERSION = '2.0.3';
32
+ export const VERSION = '2.0.5';
33
33
  /**
34
34
  * Check if the current Node.js version meets the minimum requirement
35
35
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-claude-sisyphus",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "Multi-agent orchestration system for Claude Code - Inspired by oh-my-opencode",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1706,7 +1706,7 @@ else
1706
1706
  fi
1707
1707
 
1708
1708
  # Save version metadata for auto-update system
1709
- VERSION="2.0.3"
1709
+ VERSION="2.0.5"
1710
1710
  VERSION_FILE="$CLAUDE_CONFIG_DIR/.sisyphus-version.json"
1711
1711
 
1712
1712
  cat > "$VERSION_FILE" << VERSION_EOF
@@ -0,0 +1,126 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Sisyphus Session Start Hook (Node.js)
5
+ * Restores persistent mode states when session starts
6
+ * Cross-platform: Windows, macOS, Linux
7
+ */
8
+
9
+ import { existsSync, readFileSync, readdirSync } from 'fs';
10
+ import { join } from 'path';
11
+ import { homedir } from 'os';
12
+
13
+ // Read all stdin
14
+ async function readStdin() {
15
+ const chunks = [];
16
+ for await (const chunk of process.stdin) {
17
+ chunks.push(chunk);
18
+ }
19
+ return Buffer.concat(chunks).toString('utf-8');
20
+ }
21
+
22
+ // Read JSON file safely
23
+ function readJsonFile(path) {
24
+ try {
25
+ if (!existsSync(path)) return null;
26
+ return JSON.parse(readFileSync(path, 'utf-8'));
27
+ } catch {
28
+ return null;
29
+ }
30
+ }
31
+
32
+ // Count incomplete todos
33
+ function countIncompleteTodos(todosDir) {
34
+ let count = 0;
35
+ if (existsSync(todosDir)) {
36
+ try {
37
+ const files = readdirSync(todosDir).filter(f => f.endsWith('.json'));
38
+ for (const file of files) {
39
+ const todos = readJsonFile(join(todosDir, file));
40
+ if (Array.isArray(todos)) {
41
+ count += todos.filter(t => t.status !== 'completed' && t.status !== 'cancelled').length;
42
+ }
43
+ }
44
+ } catch {}
45
+ }
46
+ return count;
47
+ }
48
+
49
+ // Main
50
+ async function main() {
51
+ try {
52
+ const input = await readStdin();
53
+ let data = {};
54
+ try { data = JSON.parse(input); } catch {}
55
+
56
+ const directory = data.directory || process.cwd();
57
+ const messages = [];
58
+
59
+ // Check for ultrawork state
60
+ const ultraworkState = readJsonFile(join(directory, '.sisyphus', 'ultrawork-state.json'))
61
+ || readJsonFile(join(homedir(), '.claude', 'ultrawork-state.json'));
62
+
63
+ if (ultraworkState?.active) {
64
+ messages.push(`<session-restore>
65
+
66
+ [ULTRAWORK MODE RESTORED]
67
+
68
+ You have an active ultrawork session from ${ultraworkState.started_at}.
69
+ Original task: ${ultraworkState.original_prompt}
70
+
71
+ Continue working in ultrawork mode until all tasks are complete.
72
+
73
+ </session-restore>
74
+
75
+ ---
76
+ `);
77
+ }
78
+
79
+ // Check for ralph loop state
80
+ const ralphState = readJsonFile(join(directory, '.sisyphus', 'ralph-state.json'));
81
+ if (ralphState?.active) {
82
+ messages.push(`<session-restore>
83
+
84
+ [RALPH LOOP RESTORED]
85
+
86
+ You have an active ralph-loop session.
87
+ Original task: ${ralphState.prompt || 'Task in progress'}
88
+ Iteration: ${ralphState.iteration || 1}/${ralphState.max_iterations || 10}
89
+
90
+ Continue working until the task is verified complete.
91
+
92
+ </session-restore>
93
+
94
+ ---
95
+ `);
96
+ }
97
+
98
+ // Check for incomplete todos
99
+ const todosDir = join(homedir(), '.claude', 'todos');
100
+ const incompleteCount = countIncompleteTodos(todosDir);
101
+
102
+ if (incompleteCount > 0) {
103
+ messages.push(`<session-restore>
104
+
105
+ [PENDING TASKS DETECTED]
106
+
107
+ You have ${incompleteCount} incomplete tasks from a previous session.
108
+ Please continue working on these tasks.
109
+
110
+ </session-restore>
111
+
112
+ ---
113
+ `);
114
+ }
115
+
116
+ if (messages.length > 0) {
117
+ console.log(JSON.stringify({ continue: true, message: messages.join('\n') }));
118
+ } else {
119
+ console.log(JSON.stringify({ continue: true }));
120
+ }
121
+ } catch (error) {
122
+ console.log(JSON.stringify({ continue: true }));
123
+ }
124
+ }
125
+
126
+ main();