tinker-agent 1.0.7 → 1.0.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinker-agent",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Tinker Agent Runner",
5
5
  "bin": {
6
6
  "tinker-agent": "./run-tinker-agent.rb"
@@ -112,12 +112,6 @@ def run_agent(agent_type, config)
112
112
  "-e", "RAILS_API_KEY=#{agent_config['mcp_api_key']}"
113
113
  ]
114
114
 
115
- # Add Anthropic config
116
- if (anthropic = config["anthropic"])
117
- docker_cmd += ["-e", "ANTHROPIC_BASE_URL=#{anthropic['base_url']}"] if anthropic["base_url"]
118
- docker_cmd += ["-e", "ANTHROPIC_MODEL=#{anthropic['model']}"] if anthropic["model"]
119
- end
120
-
121
115
  # Add GitHub auth
122
116
  github = config["github"] || {}
123
117
  if github["method"] == "app"
package/setup-agent.rb CHANGED
@@ -123,24 +123,6 @@ AGENT_BANNERS = {
123
123
  BANNER
124
124
  }
125
125
 
126
- def check_requirements!
127
- missing = []
128
- missing << "ruby" unless system("which ruby > /dev/null 2>&1")
129
- missing << "node" unless system("which node > /dev/null 2>&1")
130
- missing << "tmux" unless system("which tmux > /dev/null 2>&1")
131
- missing << "git" unless system("which git > /dev/null 2>&1")
132
- missing << "claude" unless system("which claude > /dev/null 2>&1")
133
-
134
- unless missing.empty?
135
- puts "❌ Missing requirements: #{missing.join(', ')}"
136
- puts ""
137
- puts "Install with:"
138
- puts " apt-get install -y tmux git curl"
139
- puts " npm install -g @anthropic-ai/claude-code"
140
- exit 1
141
- end
142
- end
143
-
144
126
  def check_env!
145
127
  required = %w[AGENT_TYPE PROJECT_ID RAILS_WS_URL]
146
128
  missing = required.select { |var| ENV[var].to_s.empty? }
@@ -191,10 +173,21 @@ def setup_mcp_config!
191
173
  existing_config["mcpServers"] ||= {}
192
174
 
193
175
  if rails_api_url && !rails_api_url.empty? && rails_api_key && !rails_api_key.empty?
194
- # Use published tinker-mcp package
176
+ # Install tinker-mcp locally to ensure we can run it with node (bypassing shebang issues)
177
+ tools_dir = File.expand_path("~/tinker-tools")
178
+ FileUtils.mkdir_p(tools_dir)
179
+
180
+ puts "📦 Installing tinker-mcp..."
181
+ # Redirect output to avoid cluttering logs, unless it fails
182
+ unless system("npm install --prefix #{tools_dir} tinker-mcp > /dev/null 2>&1")
183
+ puts "❌ Failed to install tinker-mcp"
184
+ end
185
+
186
+ script_path = "#{tools_dir}/node_modules/tinker-mcp/dist/index.js"
187
+
195
188
  tinker_server_config = {
196
- "command" => "npx",
197
- "args" => ["-y", "tinker-mcp"],
189
+ "command" => "node",
190
+ "args" => [script_path],
198
191
  "env" => {
199
192
  "RAILS_API_URL" => rails_api_url,
200
193
  "RAILS_API_KEY" => rails_api_key
@@ -426,7 +419,6 @@ puts "🤖 Tinker Agent Setup"
426
419
  puts "====================="
427
420
  puts ""
428
421
 
429
- check_requirements!
430
422
  check_env!
431
423
  setup_mcp_config!
432
424
  setup_claude_config!