tinker-agent 1.0.21 → 1.0.23
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.
- package/package.json +1 -1
- package/run-tinker-agent.rb +1 -3
- package/setup-agent.rb +49 -0
package/package.json
CHANGED
package/run-tinker-agent.rb
CHANGED
|
@@ -100,11 +100,9 @@ def run_agent(agent_type, config)
|
|
|
100
100
|
# Mount Claude config
|
|
101
101
|
"-v", "#{ENV['HOME']}/.claude.json:/tmp/cfg/claude.json:ro",
|
|
102
102
|
"-v", "#{ENV['HOME']}/.claude:/tmp/cfg/claude_dir:ro",
|
|
103
|
-
# Mount agent banner for CLAUDE.md
|
|
104
103
|
"-v", "#{banner_path}:/tmp/agent-banner.txt:ro",
|
|
105
|
-
# Skills are downloaded inside container (see entrypoint)
|
|
106
104
|
"-e", "TINKER_VERSION=main",
|
|
107
|
-
|
|
105
|
+
"-e", "SKILLS=#{agent_def[:skills]&.join(',')}",
|
|
108
106
|
"-e", "AGENT_TYPE=#{agent_type}",
|
|
109
107
|
"-e", "PROJECT_ID=#{config['project_id']}",
|
|
110
108
|
"-e", "RAILS_WS_URL=#{config['rails_ws_url']}",
|
package/setup-agent.rb
CHANGED
|
@@ -162,6 +162,54 @@ def setup_claude_md!
|
|
|
162
162
|
end
|
|
163
163
|
end
|
|
164
164
|
|
|
165
|
+
def setup_skills!
|
|
166
|
+
skills = ENV["SKILLS"].to_s.split(",")
|
|
167
|
+
return if skills.empty?
|
|
168
|
+
|
|
169
|
+
skills_dir = ".claude/skills"
|
|
170
|
+
puts "🧠 Installing #{skills.size} skills to #{skills_dir}..."
|
|
171
|
+
FileUtils.mkdir_p(skills_dir)
|
|
172
|
+
|
|
173
|
+
skills.each do |skill|
|
|
174
|
+
puts " - #{skill}"
|
|
175
|
+
|
|
176
|
+
# Try local copy first (dev mode, or if copied into image)
|
|
177
|
+
# Check both PWD/tinker-public/skills or PWD/skills (depending on how image was built)
|
|
178
|
+
local_paths = [
|
|
179
|
+
File.join(Dir.pwd, "tinker-public", "skills", skill, "SKILL.md"),
|
|
180
|
+
File.join(Dir.pwd, "skills", skill, "SKILL.md"),
|
|
181
|
+
"/tmp/skills/#{skill}/SKILL.md" # For legacy mounts
|
|
182
|
+
]
|
|
183
|
+
|
|
184
|
+
skill_content = nil
|
|
185
|
+
|
|
186
|
+
local_paths.each do |path|
|
|
187
|
+
if File.exist?(path)
|
|
188
|
+
skill_content = File.read(path)
|
|
189
|
+
puts " (from local: #{path})"
|
|
190
|
+
break
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
url = "#{TINKER_RAW_URL}/skills/#{skill}/SKILL.md"
|
|
195
|
+
|
|
196
|
+
begin
|
|
197
|
+
unless skill_content
|
|
198
|
+
skill_content = URI.open(url).read
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Write to .claude/skills/[skill]/SKILL.md with proper structure
|
|
202
|
+
skill_dir = File.join(skills_dir, skill)
|
|
203
|
+
FileUtils.mkdir_p(skill_dir)
|
|
204
|
+
File.write(File.join(skill_dir, "SKILL.md"), skill_content)
|
|
205
|
+
rescue OpenURI::HTTPError, Errno::ENOENT => e
|
|
206
|
+
puts "⚠️ Failed to download skill #{skill}: #{e.message}"
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
puts "✅ Skills installed"
|
|
211
|
+
end
|
|
212
|
+
|
|
165
213
|
def setup_github_auth!
|
|
166
214
|
app_id = ENV["GITHUB_APP_ID"] || ENV["GITHUB_APP_CLIENT_ID"]
|
|
167
215
|
|
|
@@ -373,6 +421,7 @@ check_env!
|
|
|
373
421
|
setup_mcp_config!
|
|
374
422
|
setup_claude_config!
|
|
375
423
|
setup_claude_md!
|
|
424
|
+
setup_skills!
|
|
376
425
|
setup_github_auth!
|
|
377
426
|
setup_git_config!
|
|
378
427
|
bin_dir = download_agent_bridge!
|