caruso 0.7.8 → 0.7.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0c377bf1e2ba7a8ec294751d5de30907917d3cfac7d6a562950132c68465805
4
- data.tar.gz: 2e7d6f2257a1360c33538303412e548bfe3e5baef7496b4f9180421ba8334a47
3
+ metadata.gz: 7af24e8f96d3fd427fe9bf41990633050002b299bae09b94b7a304295870c099
4
+ data.tar.gz: 62a47c1dde9ebbf7e45b0457b6a772d33a82bb605cee4983e5d0e2bf11544b81
5
5
  SHA512:
6
- metadata.gz: 968ece230a0315a83940728d4cbd6c4a55cc289c742bf63ad89f69c1cb9d2b3e42fe117d9c432d81f755a9b30e602f9fadc309c5ea4ef4f25728b0e85e5929a7
7
- data.tar.gz: e5542d1c914eae991b327839649496d346b9337b566d8b18b65402a7f0602fec50e08b16d387875e4820d547a2c269ff362ba67ff2a4d7ab7f41190aa76ea603
6
+ metadata.gz: 006aa6e88a47b2040bbec4bb11708b739b1197c1783e25715e2967960ad4afebb6c0a129b3edea3f77f6c847e5295bacc20d8bccde4972801a30ec60ef9e3fee
7
+ data.tar.gz: 726519d8cd3df85deebe7cc061f5f0f6a32a960f8aca821f81567f68ddd290c4c24017cf3d7e4f51999f464443fbc96e807952aafc3badf18b60b142ec05d319
@@ -1,17 +1,14 @@
1
1
  #!/bin/bash
2
- # Translates Claude Code stop hook I/O to Cursor format.
2
+ # Translates Claude Code stop hook output to Cursor format.
3
3
  #
4
- # INPUT translation (stdin):
5
- # Cursor may pass transcript_path: null. CC hooks that read the transcript
6
- # would bail out. We provide a minimal dummy transcript so the hook can
7
- # proceed past transcript gates (completion promise won't match, but the
8
- # core loop/block logic still works).
4
+ # CC stop hooks communicate via:
5
+ # Exit 2 + stderr reason -> block (continue conversation)
6
+ # Exit 0 + {"decision":"block","reason":"..."} -> block
7
+ # Exit 0 + anything else -> allow stop
9
8
  #
10
- # OUTPUT translation (stdout):
11
- # CC: exit 2 + stderr reason -> block
12
- # CC: exit 0 + {"decision":"block","reason":"..."} -> block
13
- # Cursor: exit 0 + {"followup_message":"..."} -> continue with message
14
- # Cursor: exit 0 + no output -> allow stop
9
+ # Cursor stop hooks expect:
10
+ # Exit 0 + {"followup_message":"..."} -> continue with message
11
+ # Exit 0 + no output -> allow stop
15
12
  #
16
13
  # Usage: cc_stop_wrapper.sh <original-script> [args...]
17
14
 
@@ -21,21 +18,9 @@ SCRIPT="$1"
21
18
  shift
22
19
 
23
20
  STDERR_TMP=$(mktemp) || exit 1
24
- FAKE_TRANSCRIPT=""
25
- trap 'rm -f "$STDERR_TMP" "$FAKE_TRANSCRIPT"' EXIT
21
+ trap 'rm -f "$STDERR_TMP"' EXIT
26
22
 
27
- # Read and patch stdin: ensure transcript_path points to a readable file
28
- INPUT=$(cat)
29
- if [ -n "$INPUT" ] && command -v jq >/dev/null 2>&1; then
30
- TP=$(echo "$INPUT" | jq -r '.transcript_path // empty' 2>/dev/null)
31
- if [ -z "$TP" ] || [ "$TP" = "null" ] || [ ! -f "$TP" ]; then
32
- FAKE_TRANSCRIPT=$(mktemp) || exit 1
33
- echo '{"role":"assistant","message":{"content":[{"type":"text","text":"(transcript not available)"}]}}' > "$FAKE_TRANSCRIPT"
34
- INPUT=$(echo "$INPUT" | jq --arg tp "$FAKE_TRANSCRIPT" '.transcript_path = $tp')
35
- fi
36
- fi
37
-
38
- OUTPUT=$(echo "$INPUT" | "$SCRIPT" "$@" 2>"$STDERR_TMP")
23
+ OUTPUT=$("$SCRIPT" "$@" 2>"$STDERR_TMP")
39
24
  EXIT_CODE=$?
40
25
 
41
26
  # CC exit 2 = block with stderr reason
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Caruso
4
- VERSION = "0.7.8"
4
+ VERSION = "0.7.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caruso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.8
4
+ version: 0.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philipp Comans