caruso 0.7.3 → 0.7.4
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 +4 -4
- data/AGENTS.md +1 -1
- data/lib/caruso/fetcher.rb +24 -6
- data/lib/caruso/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f8b934cb6295f95d2246260f6eb77a4b31c999bb35e73a379457fa9c9d27d7d2
|
|
4
|
+
data.tar.gz: 9da817fab3ff58b8a363c631ad945d206f3d4ed3f9fc65efd8f0225b3d731a6b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d135ab13fc7b995cfb1fa029900902d458f1ec84d8eb7d7a1e2a54daeecf757cbfceee0a8491b8e9aeb427e7f18c01800dd227652859ea01f40fd472a55ca67
|
|
7
|
+
data.tar.gz: 94aeb96c6fb123a76d0056785ce12489fc5d4d2d176491e5da2d35c93f3d74e4c2d53509c7932958d687abd22510e95ef30ba3fffe2cfc141389434143166332
|
data/AGENTS.md
CHANGED
|
@@ -185,7 +185,7 @@ Thor-based CLI with nested commands:
|
|
|
185
185
|
- Plugin install format: `plugin@marketplace` or just `plugin` (if only one marketplace configured)
|
|
186
186
|
- Update commands refresh marketplace cache (git pull) before fetching latest plugin files
|
|
187
187
|
- Marketplace add eagerly clones repos unless `CARUSO_TESTING_SKIP_CLONE` env var is set (used in tests)
|
|
188
|
-
- **Marketplace names
|
|
188
|
+
- **Marketplace names for GitHub sources are derived as `owner-repo`** (matching Claude Code behavior). For non-GitHub sources, names come from marketplace.json `name` field (required). No custom names allowed.
|
|
189
189
|
- Errors use descriptive messages with suggestions (e.g., "use 'caruso marketplace add <url>'")
|
|
190
190
|
|
|
191
191
|
### Data Flow Example
|
data/lib/caruso/fetcher.rb
CHANGED
|
@@ -94,6 +94,7 @@ module Caruso
|
|
|
94
94
|
|
|
95
95
|
# Register the marketplace in the registry after name is known.
|
|
96
96
|
# Must be called after extract_marketplace_name or when marketplace_name is set.
|
|
97
|
+
# For GitHub sources, name is derived from URL (owner-repo); for others, from marketplace.json.
|
|
97
98
|
def register_marketplace(name)
|
|
98
99
|
return unless @clone_url # Only register if we cloned something
|
|
99
100
|
|
|
@@ -102,14 +103,18 @@ module Caruso
|
|
|
102
103
|
end
|
|
103
104
|
|
|
104
105
|
def extract_marketplace_name
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
if github_repo?
|
|
107
|
+
extract_github_marketplace_name
|
|
108
|
+
else
|
|
109
|
+
marketplace_data = load_marketplace
|
|
110
|
+
name = marketplace_data["name"]
|
|
107
111
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
unless name
|
|
113
|
+
raise Caruso::Error, "Invalid marketplace: marketplace.json missing required 'name' field"
|
|
114
|
+
end
|
|
111
115
|
|
|
112
|
-
|
|
116
|
+
name
|
|
117
|
+
end
|
|
113
118
|
end
|
|
114
119
|
|
|
115
120
|
private
|
|
@@ -400,5 +405,18 @@ module Caruso
|
|
|
400
405
|
def extract_name_from_url(url)
|
|
401
406
|
url.split("/").last.sub(".git", "")
|
|
402
407
|
end
|
|
408
|
+
|
|
409
|
+
# Derive marketplace name from GitHub URL as owner-repo (matching Claude Code behavior).
|
|
410
|
+
def extract_github_marketplace_name
|
|
411
|
+
uri = @marketplace_uri.sub(/\.git\z/, "")
|
|
412
|
+
|
|
413
|
+
if uri.match?(%r{\Ahttps://github\.com/})
|
|
414
|
+
parts = URI.parse(uri).path.split("/").reject(&:empty?)
|
|
415
|
+
"#{parts[0]}-#{parts[1]}"
|
|
416
|
+
else
|
|
417
|
+
# owner/repo shorthand
|
|
418
|
+
uri.tr("/", "-")
|
|
419
|
+
end
|
|
420
|
+
end
|
|
403
421
|
end
|
|
404
422
|
end
|
data/lib/caruso/version.rb
CHANGED