simple-agent-extension 0.2.2 → 0.2.3
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/CHANGELOG.md +6 -0
- data/README.md +14 -2
- data/lib/simple_agent_extension/agents/opencode.rb +16 -0
- data/lib/simple_agent_extension/cli.rb +19 -4
- data/lib/simple_agent_extension/runner.rb +19 -0
- data/lib/simple_agent_extension/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 404e535b96de550ec739358155e62a38ec0d9a07a2ec2f78e7607eb3a98930d7
|
|
4
|
+
data.tar.gz: e17a63f61c78d8b9f30631d52ff212ba890e71ccc0ab17e8a9e1a9b56d919060
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9d622f95994d3f6abcfa23cb3bce94b92316250ad9c3a24ca0b83092be5f05628fa73a10ca5093b60b86cb27753e903566c4a38e248c200518a2d7bb99ef3d7
|
|
7
|
+
data.tar.gz: 963497aacd95ec19efa3157202dc547dacccd2c71567be762d7a8c8ba347efd6a65894c3501b1c0f5ab5794622ba3ff26db682eda2d73fe68cf1c3dbe4f54e63
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -115,9 +115,16 @@ entrypoint frontmatter
|
|
|
115
115
|
< static.agents.<agent>
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
-
####
|
|
118
|
+
#### Supported adaptive fields
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
| Field | Applies to | Value | Meaning |
|
|
121
|
+
|---|---|---|---|
|
|
122
|
+
| `permissions` | agent, skill | map of tool name to `allow`, `ask`, or `deny` | Which tools the extension may use, and how. |
|
|
123
|
+
| `disable-model-invocation` | skill | boolean | `true` keeps the skill out of model auto-selection; `/name` still works. |
|
|
124
|
+
|
|
125
|
+
Each Agent decides how a field appears in its artifact; see the `MetadataTranslator` in `lib/simple_agent_extension/agents/`. A field an Agent has no rule for, listed here or not, passes through unchanged, so it takes effect only on an Agent that recognizes it.
|
|
126
|
+
|
|
127
|
+
The `permissions` fragment above (`read: allow`, `edit: ask`) compiles to:
|
|
121
128
|
|
|
122
129
|
| Agent | Artifact metadata |
|
|
123
130
|
|---|---|
|
|
@@ -127,6 +134,8 @@ One `adaptive` fragment becomes different artifact metadata per Agent. The `perm
|
|
|
127
134
|
|
|
128
135
|
`claude` maps known lowercase tool names such as `read` and `webfetch` to Claude Code's names (`Read`, `WebFetch`) and passes any other name through unchanged. `deny` becomes `disallowedTools` on an agent and `disallowed-tools` on a skill. An agent's `tools` lists both `allow` and `ask` tools, because Claude Code's `tools` limits which tools exist rather than pre-approving them.
|
|
129
136
|
|
|
137
|
+
`disable-model-invocation` is not part of the Agent Skills specification, but Claude Code, Copilot, and OpenCode v2 ( 2.0.23+ ) read it as written. Older OpenCode versions read only their own `metadata` keys, so `opencode` translates the field for them.
|
|
138
|
+
|
|
130
139
|
A skill whose metadata is left unchanged by adaptation and carries no Agent-specific static fragments is written once to the shared skill directory. Otherwise it is written into that Agent's own configuration tree ( written with Ruby ). An agent extension is always Agent-specific. `claude` does not read the shared skill directory, so its skills are always written to `~/.claude/skills`.
|
|
131
140
|
|
|
132
141
|
### Commands
|
|
@@ -137,11 +146,14 @@ snapshot as below:
|
|
|
137
146
|
|
|
138
147
|
```sh
|
|
139
148
|
simple-agent-extension packages
|
|
149
|
+
simple-agent-extension clean
|
|
140
150
|
simple-agent-extension build
|
|
141
151
|
simple-agent-extension deploy
|
|
142
152
|
simple-agent-extension agents
|
|
143
153
|
```
|
|
144
154
|
|
|
155
|
+
`build` (and therefore `deploy`) runs `clean` first, so an artifact whose source package was removed is not deployed again. `clean` removes `<build-root>/<agent>/` for each targeted Agent only. It does not remove anything already deployed.
|
|
156
|
+
|
|
145
157
|
All commands resolve `--source-root` from `./packages` and `--build-root` from `./build` by default. Either root may be outside the repository.
|
|
146
158
|
|
|
147
159
|
```sh
|
|
@@ -10,6 +10,22 @@ module SimpleAgentExtension
|
|
|
10
10
|
{"permission" => permissions}
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
+
# For OpenCode before 2.0.23, which reads only these `metadata` keys.
|
|
14
|
+
# 2.0.23+ reads top-level `disable-model-invocation` itself and ignores
|
|
15
|
+
# `opencode/slash`, so this rule can go once older versions are unsupported.
|
|
16
|
+
define_translation type: :skill, field: "disable-model-invocation" do |disabled|
|
|
17
|
+
if disabled == true
|
|
18
|
+
{
|
|
19
|
+
"metadata" => {
|
|
20
|
+
"opencode/autoinvoke" => "false",
|
|
21
|
+
"opencode/slash" => "true"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else # standard:disable Style/EmptyElse
|
|
25
|
+
nil
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
13
29
|
define_translation type: :agent, field: "name" do |_name|
|
|
14
30
|
nil
|
|
15
31
|
end
|
|
@@ -15,7 +15,8 @@ module SimpleAgentExtension
|
|
|
15
15
|
|
|
16
16
|
COMMANDS = {
|
|
17
17
|
"packages" => "List package names under the source root",
|
|
18
|
-
"
|
|
18
|
+
"clean" => "Remove artifacts from the build root",
|
|
19
|
+
"build" => "Clean, then compile artifacts into the build root",
|
|
19
20
|
"deploy" => "Build artifacts, then deploy them to Agents",
|
|
20
21
|
"agents" => "List Agent names that can be targeted"
|
|
21
22
|
}.freeze
|
|
@@ -42,6 +43,7 @@ module SimpleAgentExtension
|
|
|
42
43
|
parser.parse!(arguments)
|
|
43
44
|
|
|
44
45
|
return display_help(parser) if options[:help]
|
|
46
|
+
return display_version(parser) if options[:version]
|
|
45
47
|
|
|
46
48
|
command = command(arguments)
|
|
47
49
|
validate_options(command, options)
|
|
@@ -86,13 +88,16 @@ module SimpleAgentExtension
|
|
|
86
88
|
agents: [],
|
|
87
89
|
agent_directories: [],
|
|
88
90
|
force: false,
|
|
89
|
-
help: false
|
|
91
|
+
help: false,
|
|
92
|
+
version: false
|
|
90
93
|
}
|
|
91
94
|
end
|
|
92
95
|
|
|
93
96
|
def option_parser(options)
|
|
94
97
|
OptionParser.new do |parser|
|
|
95
98
|
parser.banner = banner
|
|
99
|
+
parser.program_name = "simple-agent-extension"
|
|
100
|
+
parser.version = VERSION
|
|
96
101
|
|
|
97
102
|
parser.on("--source-root DIRECTORY", "Source package root (default: ./packages)") do |directory|
|
|
98
103
|
options[:source_root] = File.expand_path(directory)
|
|
@@ -100,7 +105,7 @@ module SimpleAgentExtension
|
|
|
100
105
|
parser.on("--build-root DIRECTORY", "Build artifact root (default: ./build)") do |directory|
|
|
101
106
|
options[:build_root] = File.expand_path(directory)
|
|
102
107
|
end
|
|
103
|
-
parser.on("--agent NAME", "
|
|
108
|
+
parser.on("--agent NAME", "Clean, build, or deploy only NAME (repeatable)") do |name|
|
|
104
109
|
options[:agents] << name
|
|
105
110
|
end
|
|
106
111
|
parser.on("--agent-dir DIRECTORY", "Load direct *.rb Agent registrations from DIRECTORY") do |directory|
|
|
@@ -112,6 +117,9 @@ module SimpleAgentExtension
|
|
|
112
117
|
parser.on("-h", "--help", "Show this help") do
|
|
113
118
|
options[:help] = true
|
|
114
119
|
end
|
|
120
|
+
parser.on("-V", "--version", "Show version") do
|
|
121
|
+
options[:version] = true
|
|
122
|
+
end
|
|
115
123
|
end
|
|
116
124
|
end
|
|
117
125
|
|
|
@@ -123,7 +131,12 @@ module SimpleAgentExtension
|
|
|
123
131
|
end
|
|
124
132
|
|
|
125
133
|
def display_help(parser)
|
|
126
|
-
@output.puts parser
|
|
134
|
+
@output.puts parser.ver, "", parser
|
|
135
|
+
0
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def display_version(parser)
|
|
139
|
+
@output.puts parser.ver
|
|
127
140
|
0
|
|
128
141
|
end
|
|
129
142
|
|
|
@@ -154,6 +167,8 @@ module SimpleAgentExtension
|
|
|
154
167
|
@output.puts runner.packages
|
|
155
168
|
when "agents"
|
|
156
169
|
@output.puts agent_lines(runner.agents)
|
|
170
|
+
when "clean"
|
|
171
|
+
@output.puts runner.clean(agents: options[:agents])
|
|
157
172
|
when "build"
|
|
158
173
|
@output.puts runner.build(agents: options[:agents])
|
|
159
174
|
when "deploy"
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require "fileutils"
|
|
2
|
+
|
|
1
3
|
module SimpleAgentExtension
|
|
2
4
|
# Coordinates source collection, compilation, and deployment for one
|
|
3
5
|
# source and build roots. Entry points configure these boundaries explicitly.
|
|
@@ -25,12 +27,29 @@ module SimpleAgentExtension
|
|
|
25
27
|
end
|
|
26
28
|
end
|
|
27
29
|
|
|
30
|
+
# Removes each selected Agent's whole artifact subtree, so artifacts whose
|
|
31
|
+
# source package is gone cannot survive into the next deploy. Other
|
|
32
|
+
# Agents' subtrees are left alone.
|
|
33
|
+
#
|
|
34
|
+
# @param [Array<String>] agents target names; all targets when empty
|
|
35
|
+
# @return [Array<String>] Agent directories that existed and were removed
|
|
36
|
+
def clean(agents: [])
|
|
37
|
+
selected_agents(agents)
|
|
38
|
+
.map { |agent| File.join(@build_root, agent.name) }
|
|
39
|
+
.select { |dir| File.exist?(dir) }
|
|
40
|
+
.each { |dir| FileUtils.rm_rf(dir) }
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Cleans the selected Agents first, so the build tree mirrors the current
|
|
44
|
+
# source tree instead of accumulating every artifact ever compiled.
|
|
45
|
+
#
|
|
28
46
|
# @param [Array<String>] agents target names; all targets when empty
|
|
29
47
|
# @return [Array<String>] directories written to the build tree
|
|
30
48
|
def build(agents: [])
|
|
31
49
|
targets = selected_agents(agents)
|
|
32
50
|
extensions = source_extensions
|
|
33
51
|
warn_unknown_deploy_to_names(extensions)
|
|
52
|
+
clean(agents: agents)
|
|
34
53
|
|
|
35
54
|
targets.flat_map { |agent|
|
|
36
55
|
compiler = Compiler.new(agent: agent, build_root: @build_root)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simple-agent-extension
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ''
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: 'Coding Agent Extension Utility with Simple DSL and Rule Translating
|
|
14
14
|
and Deploying '
|