tinker-agent 1.0.3 → 1.0.5
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/bin/agent-bridge-tmux +1 -1
- package/package.json +1 -1
- package/setup-agent.rb +29 -14
package/bin/agent-bridge-tmux
CHANGED
|
@@ -43,7 +43,7 @@ tmux set-option -t "$SESSION" remain-on-exit off
|
|
|
43
43
|
tmux set-option -t "$SESSION" mouse on
|
|
44
44
|
|
|
45
45
|
# Run agent-bridge in tmux session
|
|
46
|
-
tmux send-keys -t "$SESSION" "export STATUS_FILE='$STATUS_FILE' AGENT_TYPE='$AGENT_TYPE' && agent-bridge" C-m
|
|
46
|
+
tmux send-keys -t "$SESSION" "export STATUS_FILE='$STATUS_FILE' AGENT_TYPE='$AGENT_TYPE' && export INSIDE_TMUX=1 && agent-bridge" C-m
|
|
47
47
|
|
|
48
48
|
# Attach or wait
|
|
49
49
|
if [ -t 0 ]; then
|
package/package.json
CHANGED
package/setup-agent.rb
CHANGED
|
@@ -326,7 +326,18 @@ def setup_github_auth!
|
|
|
326
326
|
end
|
|
327
327
|
|
|
328
328
|
def download_agent_bridge!
|
|
329
|
-
|
|
329
|
+
# Detect architecture
|
|
330
|
+
arch = `uname -m`.strip
|
|
331
|
+
if arch == "x86_64"
|
|
332
|
+
arch = "amd64"
|
|
333
|
+
elsif arch == "aarch64" || arch == "arm64"
|
|
334
|
+
arch = "arm64"
|
|
335
|
+
else
|
|
336
|
+
puts "❌ Unsupported architecture: #{arch}"
|
|
337
|
+
exit 1
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
bridge_url = "#{TINKER_RAW_URL}/bin/agent-bridge-linux-#{arch}"
|
|
330
341
|
bridge_tmux_url = "#{TINKER_RAW_URL}/bin/agent-bridge-tmux"
|
|
331
342
|
target_dir = "/usr/local/bin"
|
|
332
343
|
|
|
@@ -336,7 +347,7 @@ def download_agent_bridge!
|
|
|
336
347
|
system("sudo cp /tmp/agent-bridge #{target_dir}/agent-bridge")
|
|
337
348
|
system("sudo chmod +x #{target_dir}/agent-bridge")
|
|
338
349
|
else
|
|
339
|
-
puts "📥 Downloading agent-bridge..."
|
|
350
|
+
puts "📥 Downloading agent-bridge for linux-#{arch}..."
|
|
340
351
|
system("sudo curl -fsSL #{bridge_url} -o #{target_dir}/agent-bridge")
|
|
341
352
|
system("sudo chmod +x #{target_dir}/agent-bridge")
|
|
342
353
|
end
|
|
@@ -353,23 +364,27 @@ def download_agent_bridge!
|
|
|
353
364
|
puts "✅ agent-bridge installed to #{target_dir}"
|
|
354
365
|
|
|
355
366
|
# Patch agent-bridge-tmux to force INSIDE_TMUX=1
|
|
367
|
+
# Note: This is now fixed in the repo, but we keep this for backward compatibility
|
|
368
|
+
# with older agent-bridge-tmux scripts if cached
|
|
356
369
|
puts "🔧 Patching agent-bridge-tmux to force INSIDE_TMUX=1..."
|
|
357
370
|
|
|
358
371
|
# Read the file (we can read /usr/local/bin files usually)
|
|
359
372
|
content = File.read("#{target_dir}/agent-bridge-tmux")
|
|
360
373
|
|
|
361
|
-
# Replace the command
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
374
|
+
# Replace the command if not already present
|
|
375
|
+
unless content.include?("export INSIDE_TMUX=1")
|
|
376
|
+
new_content = content.gsub(
|
|
377
|
+
"&& agent-bridge\"",
|
|
378
|
+
"&& export INSIDE_TMUX=1 && agent-bridge\""
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
# Write to temp file
|
|
382
|
+
File.write("/tmp/agent-bridge-tmux-patched", new_content)
|
|
383
|
+
|
|
384
|
+
# Move to destination with sudo
|
|
385
|
+
system("sudo mv /tmp/agent-bridge-tmux-patched #{target_dir}/agent-bridge-tmux")
|
|
386
|
+
system("sudo chmod +x #{target_dir}/agent-bridge-tmux")
|
|
387
|
+
end
|
|
373
388
|
|
|
374
389
|
return target_dir
|
|
375
390
|
end
|