sisyphi 0.1.16 → 0.1.18

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.
@@ -0,0 +1,15 @@
1
+ {
2
+ "hooks": {
3
+ "PreToolUse": [
4
+ {
5
+ "matcher": "SendMessage",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/intercept-send-message.sh\""
10
+ }
11
+ ]
12
+ }
13
+ ]
14
+ }
15
+ }
@@ -0,0 +1,62 @@
1
+ #!/bin/bash
2
+ # Intercept SendMessage and route through sisyphus report/submit infrastructure.
3
+ # Passthrough (exit 0) if not in a sisyphus session or if jq is missing.
4
+
5
+ # Passthrough if not in a sisyphus session
6
+ if [ -z "$SISYPHUS_SESSION_ID" ]; then
7
+ exit 0
8
+ fi
9
+
10
+ # Passthrough if jq not available
11
+ if ! command -v jq &>/dev/null; then
12
+ exit 0
13
+ fi
14
+
15
+ # Read hook input from stdin
16
+ input=$(cat)
17
+
18
+ # Extract type and content from tool_input
19
+ msg_type=$(echo "$input" | jq -r '.tool_input.type // empty')
20
+ content=$(echo "$input" | jq -r '.tool_input.content // empty')
21
+
22
+ if [ -z "$content" ]; then
23
+ cat <<'EOF'
24
+ {"decision":"block","reason":"SendMessage content is empty. Provide a message to send."}
25
+ EOF
26
+ exit 0
27
+ fi
28
+
29
+ case "$msg_type" in
30
+ message)
31
+ # Final submission — pipe content to sisyphus submit
32
+ error=$(echo "$content" | sisyphus submit 2>&1)
33
+ rc=$?
34
+ if [ $rc -ne 0 ]; then
35
+ # Relay error (likely worktree uncommitted changes check)
36
+ reason=$(echo "$error" | tr '\n' ' ' | sed 's/"/\\"/g')
37
+ echo "{\"decision\":\"block\",\"reason\":\"Submit failed: ${reason}\"}"
38
+ exit 0
39
+ fi
40
+ cat <<'EOF'
41
+ {"decision":"block","reason":"Report submitted to orchestrator."}
42
+ EOF
43
+ ;;
44
+ broadcast)
45
+ # Progress report — pipe content to sisyphus report
46
+ error=$(echo "$content" | sisyphus report 2>&1)
47
+ rc=$?
48
+ if [ $rc -ne 0 ]; then
49
+ reason=$(echo "$error" | tr '\n' ' ' | sed 's/"/\\"/g')
50
+ echo "{\"decision\":\"block\",\"reason\":\"Report failed: ${reason}\"}"
51
+ exit 0
52
+ fi
53
+ cat <<'EOF'
54
+ {"decision":"block","reason":"Progress report recorded. Continue working."}
55
+ EOF
56
+ ;;
57
+ *)
58
+ cat <<EOF
59
+ {"decision":"block","reason":"Unknown message type '${msg_type}'. Use type 'message' for final submission or 'broadcast' for progress reports."}
60
+ EOF
61
+ ;;
62
+ esac
@@ -14,24 +14,18 @@ Reports are non-terminal — you keep working after sending them. Use them for:
14
14
  - **Partial answers** you've already found — don't hold everything for the final report
15
15
  - **Out-of-scope issues** you notice (failing tests, code smells, missing handling) — report them, don't fix them
16
16
 
17
- ```bash
18
- sisyphus report --message <concise message with file paths and line numbers>
19
- ```
17
+ Send a progress report via `SendMessage` with `type: "broadcast"`:
18
+
19
+ > SendMessage(type: "broadcast", content: "Found the auth bug in src/auth.ts:45 — session token not refreshed on redirect", summary: "progress update")
20
20
 
21
21
  ## Finishing
22
22
 
23
- When done, submit your final report. This is terminal — your pane closes after.
23
+ When done, submit your final report via `SendMessage` with `type: "message"`. This is terminal — your pane closes after.
24
24
 
25
- ```bash
26
- echo "report..." | sisyphus submit
27
- ```
25
+ > SendMessage(type: "message", recipient: "orchestrator", content: "your full report here", summary: "final report")
28
26
 
29
27
  If you're blocked by ambiguity, contradictions, or unclear requirements — **don't guess**. Submit what you found instead. A clear report is more valuable than a wrong implementation.
30
28
 
31
- ```bash
32
- sisyphus submit --report "Could not complete: auth middleware uses a different session pattern than expected (src/middleware/session.ts:23). Needs your decision on which pattern to follow."
33
- ```
34
-
35
29
  ## The User
36
30
 
37
31
  A human may interact with you directly in your pane — if they do, prioritize their input over your original instruction. Otherwise, communicate through the orchestrator via reports.
@@ -10,16 +10,6 @@
10
10
  }
11
11
  ]
12
12
  }
13
- ],
14
- "Stop": [
15
- {
16
- "hooks": [
17
- {
18
- "type": "command",
19
- "command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/stop-suggest.sh\""
20
- }
21
- ]
22
- }
23
13
  ]
24
14
  }
25
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sisyphi",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "tmux-integrated orchestration daemon for Claude Code multi-agent workflows",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -0,0 +1,15 @@
1
+ {
2
+ "hooks": {
3
+ "PreToolUse": [
4
+ {
5
+ "matcher": "SendMessage",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/intercept-send-message.sh\""
10
+ }
11
+ ]
12
+ }
13
+ ]
14
+ }
15
+ }
@@ -0,0 +1,62 @@
1
+ #!/bin/bash
2
+ # Intercept SendMessage and route through sisyphus report/submit infrastructure.
3
+ # Passthrough (exit 0) if not in a sisyphus session or if jq is missing.
4
+
5
+ # Passthrough if not in a sisyphus session
6
+ if [ -z "$SISYPHUS_SESSION_ID" ]; then
7
+ exit 0
8
+ fi
9
+
10
+ # Passthrough if jq not available
11
+ if ! command -v jq &>/dev/null; then
12
+ exit 0
13
+ fi
14
+
15
+ # Read hook input from stdin
16
+ input=$(cat)
17
+
18
+ # Extract type and content from tool_input
19
+ msg_type=$(echo "$input" | jq -r '.tool_input.type // empty')
20
+ content=$(echo "$input" | jq -r '.tool_input.content // empty')
21
+
22
+ if [ -z "$content" ]; then
23
+ cat <<'EOF'
24
+ {"decision":"block","reason":"SendMessage content is empty. Provide a message to send."}
25
+ EOF
26
+ exit 0
27
+ fi
28
+
29
+ case "$msg_type" in
30
+ message)
31
+ # Final submission — pipe content to sisyphus submit
32
+ error=$(echo "$content" | sisyphus submit 2>&1)
33
+ rc=$?
34
+ if [ $rc -ne 0 ]; then
35
+ # Relay error (likely worktree uncommitted changes check)
36
+ reason=$(echo "$error" | tr '\n' ' ' | sed 's/"/\\"/g')
37
+ echo "{\"decision\":\"block\",\"reason\":\"Submit failed: ${reason}\"}"
38
+ exit 0
39
+ fi
40
+ cat <<'EOF'
41
+ {"decision":"block","reason":"Report submitted to orchestrator."}
42
+ EOF
43
+ ;;
44
+ broadcast)
45
+ # Progress report — pipe content to sisyphus report
46
+ error=$(echo "$content" | sisyphus report 2>&1)
47
+ rc=$?
48
+ if [ $rc -ne 0 ]; then
49
+ reason=$(echo "$error" | tr '\n' ' ' | sed 's/"/\\"/g')
50
+ echo "{\"decision\":\"block\",\"reason\":\"Report failed: ${reason}\"}"
51
+ exit 0
52
+ fi
53
+ cat <<'EOF'
54
+ {"decision":"block","reason":"Progress report recorded. Continue working."}
55
+ EOF
56
+ ;;
57
+ *)
58
+ cat <<EOF
59
+ {"decision":"block","reason":"Unknown message type '${msg_type}'. Use type 'message' for final submission or 'broadcast' for progress reports."}
60
+ EOF
61
+ ;;
62
+ esac
@@ -14,24 +14,18 @@ Reports are non-terminal — you keep working after sending them. Use them for:
14
14
  - **Partial answers** you've already found — don't hold everything for the final report
15
15
  - **Out-of-scope issues** you notice (failing tests, code smells, missing handling) — report them, don't fix them
16
16
 
17
- ```bash
18
- sisyphus report --message <concise message with file paths and line numbers>
19
- ```
17
+ Send a progress report via `SendMessage` with `type: "broadcast"`:
18
+
19
+ > SendMessage(type: "broadcast", content: "Found the auth bug in src/auth.ts:45 — session token not refreshed on redirect", summary: "progress update")
20
20
 
21
21
  ## Finishing
22
22
 
23
- When done, submit your final report. This is terminal — your pane closes after.
23
+ When done, submit your final report via `SendMessage` with `type: "message"`. This is terminal — your pane closes after.
24
24
 
25
- ```bash
26
- echo "report..." | sisyphus submit
27
- ```
25
+ > SendMessage(type: "message", recipient: "orchestrator", content: "your full report here", summary: "final report")
28
26
 
29
27
  If you're blocked by ambiguity, contradictions, or unclear requirements — **don't guess**. Submit what you found instead. A clear report is more valuable than a wrong implementation.
30
28
 
31
- ```bash
32
- sisyphus submit --report "Could not complete: auth middleware uses a different session pattern than expected (src/middleware/session.ts:23). Needs your decision on which pattern to follow."
33
- ```
34
-
35
29
  ## The User
36
30
 
37
31
  A human may interact with you directly in your pane — if they do, prioritize their input over your original instruction. Otherwise, communicate through the orchestrator via reports.
@@ -10,16 +10,6 @@
10
10
  }
11
11
  ]
12
12
  }
13
- ],
14
- "Stop": [
15
- {
16
- "hooks": [
17
- {
18
- "type": "command",
19
- "command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/stop-suggest.sh\""
20
- }
21
- ]
22
- }
23
13
  ]
24
14
  }
25
15
  }
@@ -1,12 +0,0 @@
1
- #!/bin/bash
2
- MARKER="/tmp/sisyphus-exit-${SISYPHUS_SESSION_ID}"
3
- if [ -f "$MARKER" ]; then
4
- rm -f "$MARKER"
5
- cat <<'EOF'
6
- {"decision":"approve"}
7
- EOF
8
- else
9
- cat <<'EOF'
10
- {"decision":"block","reason":"Before stopping, consider: use `sisyphus yield` to end this cycle and let the daemon respawn you with updated state, or use AskUserQuestion if you need clarification from the user."}
11
- EOF
12
- fi
@@ -1,12 +0,0 @@
1
- #!/bin/bash
2
- MARKER="/tmp/sisyphus-exit-${SISYPHUS_SESSION_ID}"
3
- if [ -f "$MARKER" ]; then
4
- rm -f "$MARKER"
5
- cat <<'EOF'
6
- {"decision":"approve"}
7
- EOF
8
- else
9
- cat <<'EOF'
10
- {"decision":"block","reason":"Before stopping, consider: use `sisyphus yield` to end this cycle and let the daemon respawn you with updated state, or use AskUserQuestion if you need clarification from the user."}
11
- EOF
12
- fi