tinker-agent 1.0.6 → 1.0.8
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/setup-agent.rb +36 -3
package/package.json
CHANGED
package/setup-agent.rb
CHANGED
|
@@ -191,10 +191,21 @@ def setup_mcp_config!
|
|
|
191
191
|
existing_config["mcpServers"] ||= {}
|
|
192
192
|
|
|
193
193
|
if rails_api_url && !rails_api_url.empty? && rails_api_key && !rails_api_key.empty?
|
|
194
|
-
#
|
|
194
|
+
# Install tinker-mcp locally to ensure we can run it with node (bypassing shebang issues)
|
|
195
|
+
tools_dir = File.expand_path("~/tinker-tools")
|
|
196
|
+
FileUtils.mkdir_p(tools_dir)
|
|
197
|
+
|
|
198
|
+
puts "📦 Installing tinker-mcp..."
|
|
199
|
+
# Redirect output to avoid cluttering logs, unless it fails
|
|
200
|
+
unless system("npm install --prefix #{tools_dir} tinker-mcp > /dev/null 2>&1")
|
|
201
|
+
puts "❌ Failed to install tinker-mcp"
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
script_path = "#{tools_dir}/node_modules/tinker-mcp/dist/index.js"
|
|
205
|
+
|
|
195
206
|
tinker_server_config = {
|
|
196
|
-
"command" => "
|
|
197
|
-
"args" => [
|
|
207
|
+
"command" => "node",
|
|
208
|
+
"args" => [script_path],
|
|
198
209
|
"env" => {
|
|
199
210
|
"RAILS_API_URL" => rails_api_url,
|
|
200
211
|
"RAILS_API_KEY" => rails_api_key
|
|
@@ -217,6 +228,27 @@ def setup_mcp_config!
|
|
|
217
228
|
end
|
|
218
229
|
end
|
|
219
230
|
|
|
231
|
+
def setup_claude_config!
|
|
232
|
+
home_claude_json = File.expand_path("~/.claude.json")
|
|
233
|
+
|
|
234
|
+
if File.exist?(home_claude_json)
|
|
235
|
+
puts "🔧 Configuring claude.json..."
|
|
236
|
+
begin
|
|
237
|
+
claude_config = JSON.parse(File.read(home_claude_json))
|
|
238
|
+
|
|
239
|
+
# Add bypass permission at top level
|
|
240
|
+
claude_config["bypassPermissionsModeAccepted"] = true
|
|
241
|
+
|
|
242
|
+
File.write(home_claude_json, JSON.pretty_generate(claude_config))
|
|
243
|
+
puts "✅ claude.json configured with bypass permissions"
|
|
244
|
+
rescue JSON::ParserError
|
|
245
|
+
puts "⚠️ claude.json is invalid, skipping configuration"
|
|
246
|
+
end
|
|
247
|
+
else
|
|
248
|
+
puts "⚠️ claude.json not found at #{home_claude_json}"
|
|
249
|
+
end
|
|
250
|
+
end
|
|
251
|
+
|
|
220
252
|
def setup_claude_md!
|
|
221
253
|
agent_type = ENV["AGENT_TYPE"]
|
|
222
254
|
banner = AGENT_BANNERS[agent_type]
|
|
@@ -408,6 +440,7 @@ puts ""
|
|
|
408
440
|
check_requirements!
|
|
409
441
|
check_env!
|
|
410
442
|
setup_mcp_config!
|
|
443
|
+
setup_claude_config!
|
|
411
444
|
setup_claude_md!
|
|
412
445
|
setup_github_auth!
|
|
413
446
|
bin_dir = download_agent_bridge!
|