Commit 364beb1
Changed files (5)
lib
elelem
lib/elelem/skills/catalog.rb
@@ -6,15 +6,6 @@ module Elelem
GEM_SKILLS = File.expand_path("builtin", __dir__).freeze
REMOTE_SKILLS = File.expand_path("~/.agents/remote-skills").freeze
- # Order matters: later entries shadow earlier ones by skill name.
- # remote_skills (see #initialize) is scanned immediately after
- # GEM_SKILLS is scanned (see #discover), so the precedence is:
- # bundled < remote-fetched < user-level < project-level. A skill
- # fetched via `/skills fetch` never overrides one the user placed
- # directly in ~/.agents/skills or .agents/skills. Note the remote
- # scan is keyed on GEM_SKILLS being present in load_paths -- passing
- # a load_paths without it (as tests do, to stay fixture-isolated)
- # skips the remote scan too.
LOAD_PATHS = [
GEM_SKILLS,
"~/.agents/skills",
@@ -53,7 +44,6 @@ module Elelem
seen.values
end
- # Bundled and local skills: <root>/<skill>/SKILL.md
def scan_one_level(path, seen)
dir = File.expand_path(path)
return unless File.directory?(dir)
@@ -61,11 +51,6 @@ module Elelem
Dir["#{dir}/*/SKILL.md"].sort.each { |skill_md| load_into(skill_md, seen) }
end
- # Fetched skills, partitioned by index host: <root>/<host>/<skill>/SKILL.md.
- # Deliberately not Dir["**/SKILL.md"] -- an unbounded recursive glob
- # would also pick up any SKILL.md nested arbitrarily deep inside a
- # fetched skill's own resources (or a stray file entirely unrelated
- # to this gem living under the same tree).
def scan_remote(seen)
dir = File.expand_path(@remote_skills)
return unless File.directory?(dir)
lib/elelem/skills/fetcher.rb
@@ -18,19 +18,7 @@ module Elelem
@http = http
end
- # Fetches https://<origin>/.well-known/agent-skills/index.json, verifies
- # it, and installs every type: "skill-md" entry into
- # install_dir/<index host>/<skill name>/SKILL.md. Partitioning by the
- # index's own host (not the artifact URL's host, which the spec allows
- # to point elsewhere, e.g. a CDN) keeps two publishers who happen to
- # both name a skill "wrangler" from clobbering each other on disk --
- # Catalog still resolves by frontmatter name across all of them, so a
- # same-named skill from two hosts is still ambiguous at that level;
- # this only fixes the fetch-time file collision, not that ambiguity.
- # Entries with an unsupported type (currently anything but "skill-md")
- # are skipped with a warning, per the spec's guidance.
- #
- # Returns the list of skill names installed.
+ # Fetches https://<origin>/.well-known/agent-skills/index.json
def fetch(origin)
base = normalize(origin)
index_url = URI.join(base, "/.well-known/agent-skills/index.json")
lib/elelem/skills/setup.rb
@@ -69,7 +69,3 @@ module Elelem
end
end
end
-
-Elelem.configure do |config|
- config.setup(:skills) { |agent| Elelem::Skills::Setup.call(agent) }
-end
lib/elelem/skills/version.rb
@@ -2,6 +2,6 @@
module Elelem
module Skills
- VERSION = "0.10.0"
+ VERSION = "0.3.0"
end
end
lib/elelem/skills.rb
@@ -9,3 +9,9 @@ require_relative "skills/skill_file"
require_relative "skills/catalog"
require_relative "skills/fetcher"
require_relative "skills/setup"
+
+Elelem.configure do |config|
+ config.setup(:skills) do |agent|
+ Elelem::Skills::Setup.call(agent)
+ end
+end