caruso 0.7.6 → 0.7.7

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: c881250221622ad116a1da441ca090a80fa1830f3d51b675b4a0919853d82287
4
- data.tar.gz: 4276216066d112d8bed3e99c5d2928bd6d28ba1b44c4d2847f95f0f9447b803f
3
+ metadata.gz: af75d0db21770fa0559c36964cbca4cd51e80f8c96eb8097a1d41f0281ce70e3
4
+ data.tar.gz: 12bff57c9d9891b5abc54d2d2dd4a854ceb34faf8e3c5ad026ac3c51a0705944
5
5
  SHA512:
6
- metadata.gz: ebf987777a3b98062f132330f17ba646840085cd63a123c04d944997002c42c1049cb325f0eb66dfee4ecb0dfb4127b279a96e6a298aa73b1bb61f56ce7caba5
7
- data.tar.gz: fe109bde2907c60ef0c15f3eaa4e4ea7fc1a4f98d2f0c05f7ceaad78b7e2ab0ea7c632fa7851497df8630aeff7adb145f7bab093059af136519cfdb80ad62e5d
6
+ metadata.gz: cadbe6b5022e9ae58c79d8cf3fdc9750e71f10f3d6c90f920fbb3e2be18da127977e14d725a4b36ec629cfc69008cd4c8a58203492f6748185557bf0f3567fe3
7
+ data.tar.gz: 616a955c75e3c1e4aff04a18f282248dbf677d01ce85be4f224db2e6b08418e59fcd4b1ba9db0dda8f485e8f9684b127153f0df44c917571683c782cb45f697b
data/AGENTS.md CHANGED
@@ -6,21 +6,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
6
6
 
7
7
  Caruso is a Ruby gem CLI that bridges the gap between AI coding assistants. It fetches "steering documentation" (commands, agents, skills) from Claude Code Marketplaces and converts them to formats compatible with other IDEs, currently Cursor.
8
8
 
9
- ## Source of Truth: Claude Code Documentation
9
+ ## Source of Truth: Official Documentation
10
10
 
11
- **IMPORTANT:** The official Claude Code marketplace and plugin specifications are located in `/Users/philipp/code/caruso/reference/`:
11
+ **IMPORTANT:** The authoritative sources for Claude Code and Cursor specifications are the official docs. Reference links are in `/Users/philipp/code/caruso/reference/`:
12
12
 
13
- - `marketplace.md` - Marketplace structure and specification
14
- - `plugins.md` - Plugin format and configuration
15
- - `plugins_reference.md` - Component configuration fields and metadata
13
+ - `claude_code.md` - Links to official Claude Code docs (hooks, plugins, marketplaces, skills)
14
+ - `cursor.md` - Links to official Cursor docs (hooks, modes, rules, commands)
16
15
 
17
- **These reference documents are the authoritative source for:**
18
- - Marketplace.json schema and plugin metadata format
19
- - Component configuration fields (`commands`, `agents`, `skills`, `hooks`, `mcpServers`)
20
- - Expected directory structures and file patterns
21
- - Metadata requirements and validation rules
22
-
23
- When implementing features or fixing bugs related to marketplace compatibility, **always consult these reference files first**. If the implementation conflicts with the reference docs, the reference docs are correct and the code should be updated to match.
16
+ When implementing features or fixing bugs, **always fetch the latest docs from these official URLs**. If the implementation conflicts with the official docs, the docs are correct and the code should be updated to match.
24
17
 
25
18
  ## Development Commands
26
19
 
@@ -271,6 +264,9 @@ Results are deduplicated with `.uniq`.
271
264
 
272
265
  Version is managed in `lib/caruso/version.rb`.
273
266
 
267
+ # Rules
268
+ - **NEVER force-push.** No `git push --force`, `git push --force-with-lease`, or `git push origin <tag> --force`. If a tag or commit was pushed wrong, fix forward with a new version.
269
+
274
270
  # Memory
275
271
  - The goal is a clean, correct, consistent implementation. Never implement fallbacks that hide errors or engage in defensive programming.
276
272
  - **Idempotency**: Removal commands (`marketplace remove`, `plugin uninstall`) are designed to be idempotent. They exit successfully (0) if the target does not exist. This is intentional for automation friendliness and is NOT considered "hiding errors".
@@ -40,9 +40,9 @@ module Caruso
40
40
  # We don't need globs or alwaysApply (those are for rules)
41
41
  # Just return content as-is, Claude Code commands are already compatible
42
42
 
43
- # Add note about bash execution if it contains ! prefix
43
+ # Convert ```! auto-execute blocks to ```bash with run instruction
44
44
  if content.include?("`!")
45
- add_bash_execution_note(content)
45
+ convert_auto_execute_blocks(content)
46
46
  else
47
47
  content
48
48
  end
@@ -57,14 +57,9 @@ module Caruso
57
57
  YAML
58
58
  end
59
59
 
60
- def add_bash_execution_note(content)
61
- match = content.match(/\A---\s*\n(.*?)\n---\s*\n/m)
62
- return content unless match
63
-
64
- note = "\n**Note:** This command originally used Claude Code's `!` prefix for bash execution. " \
65
- "Cursor does not support this feature. The bash commands are documented below for reference.\n"
66
-
67
- "---\n#{match[1]}\n---\n#{note}#{match.post_match}"
60
+ def convert_auto_execute_blocks(content)
61
+ # Replace ```! with ```bash and add instruction to run
62
+ content.gsub("```!\n", "```bash\n")
68
63
  end
69
64
 
70
65
  def save_command_file(relative_path, content)
@@ -1,14 +1,17 @@
1
1
  #!/bin/bash
2
- # Translates Claude Code stop hook output to Cursor format.
2
+ # Translates Claude Code stop hook I/O to Cursor format.
3
3
  #
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
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).
8
9
  #
9
- # Cursor stop hooks expect:
10
- # Exit 0 + {"followup_message":"..."} -> continue with message
11
- # Exit 0 + no output -> allow stop
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
12
15
  #
13
16
  # Usage: cc_stop_wrapper.sh <original-script> [args...]
14
17
 
@@ -18,9 +21,21 @@ SCRIPT="$1"
18
21
  shift
19
22
 
20
23
  STDERR_TMP=$(mktemp) || exit 1
21
- trap 'rm -f "$STDERR_TMP"' EXIT
24
+ FAKE_TRANSCRIPT=""
25
+ trap 'rm -f "$STDERR_TMP" "$FAKE_TRANSCRIPT"' EXIT
22
26
 
23
- OUTPUT=$("$SCRIPT" "$@" 2>"$STDERR_TMP")
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":""}]}}' > "$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")
24
39
  EXIT_CODE=$?
25
40
 
26
41
  # 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.6"
4
+ VERSION = "0.7.7"
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.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philipp Comans