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.
- package/README.md +37 -180
- package/dist/cli.js +8 -7
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +19 -5
- package/dist/daemon.js.map +1 -1
- package/dist/templates/agent-plugin/hooks/hooks.json +15 -0
- package/dist/templates/agent-plugin/hooks/intercept-send-message.sh +62 -0
- package/dist/templates/agent-suffix.md +5 -11
- package/dist/templates/orchestrator-plugin/hooks/hooks.json +0 -10
- package/package.json +1 -1
- package/templates/agent-plugin/hooks/hooks.json +15 -0
- package/templates/agent-plugin/hooks/intercept-send-message.sh +62 -0
- package/templates/agent-suffix.md +5 -11
- package/templates/orchestrator-plugin/hooks/hooks.json +0 -10
- package/dist/templates/orchestrator-plugin/scripts/stop-suggest.sh +0 -12
- package/templates/orchestrator-plugin/scripts/stop-suggest.sh +0 -12
|
@@ -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
|
-
|
|
18
|
-
|
|
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
|
|
23
|
+
When done, submit your final report via `SendMessage` with `type: "message"`. This is terminal — your pane closes after.
|
|
24
24
|
|
|
25
|
-
|
|
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.
|
package/package.json
CHANGED
|
@@ -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
|
-
|
|
18
|
-
|
|
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
|
|
23
|
+
When done, submit your final report via `SendMessage` with `type: "message"`. This is terminal — your pane closes after.
|
|
24
24
|
|
|
25
|
-
|
|
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.
|
|
@@ -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
|