yatfa 1.0.79 → 1.0.80
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/install-agent.sh +13 -9
- package/lib/yatfa_agent/agent.rb +8 -29
- package/package.json +2 -1
- package/setup/setup-agent.rb +1038 -0
- package/setup/setup-claw-agent.rb +494 -0
- package/setup/setup-github.rb +222 -0
package/bin/install-agent.sh
CHANGED
|
@@ -101,16 +101,20 @@ YATFA_VERSION=${YATFA_VERSION:-main}
|
|
|
101
101
|
cat << 'EOF' > /usr/local/bin/setup-agent
|
|
102
102
|
#!/bin/bash
|
|
103
103
|
YATFA_VERSION=${YATFA_VERSION:-main}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
BASE_URL="https://objectstore.fra1.civo.com/yatfa/${YATFA_VERSION}"
|
|
105
|
+
# Use local setup/ dir if mounted (dev mode), otherwise download all from remote
|
|
106
|
+
if [ -f "/tmp/setup/setup-agent.rb" ]; then
|
|
107
|
+
echo "🔧 Using local setup/ (dev mode)"
|
|
108
|
+
ruby /tmp/setup/setup-agent.rb
|
|
108
109
|
else
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
# Download
|
|
112
|
-
curl -fsSL
|
|
113
|
-
|
|
110
|
+
mkdir -p /tmp/setup
|
|
111
|
+
echo "Downloading setup scripts (version: ${YATFA_VERSION})..."
|
|
112
|
+
# Download manifest listing all setup files
|
|
113
|
+
MANIFEST=$(curl -fsSL "${BASE_URL}/setup/MANIFEST" 2>/dev/null || echo "setup-agent.rb")
|
|
114
|
+
for file in ${MANIFEST}; do
|
|
115
|
+
curl -fsSL "${BASE_URL}/setup/${file}" -o "/tmp/setup/${file}" 2>/dev/null || true
|
|
116
|
+
done
|
|
117
|
+
ruby /tmp/setup/setup-agent.rb
|
|
114
118
|
fi
|
|
115
119
|
EOF
|
|
116
120
|
chmod +x /usr/local/bin/setup-agent
|
package/lib/yatfa_agent/agent.rb
CHANGED
|
@@ -320,10 +320,10 @@ module YatfaAgent
|
|
|
320
320
|
add_development_mounts!(docker_cmd)
|
|
321
321
|
end
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
local_setup_dir = File.join(File.dirname(__FILE__), "..", "..", "setup")
|
|
324
324
|
|
|
325
|
-
if File.
|
|
326
|
-
docker_cmd += [Config.image_name(config), "ruby", "/tmp/setup-agent.rb"]
|
|
325
|
+
if File.directory?(local_setup_dir)
|
|
326
|
+
docker_cmd += [Config.image_name(config), "ruby", "/tmp/setup/setup-agent.rb"]
|
|
327
327
|
else
|
|
328
328
|
docker_cmd += [Config.image_name(config)]
|
|
329
329
|
end
|
|
@@ -389,33 +389,12 @@ module YatfaAgent
|
|
|
389
389
|
end
|
|
390
390
|
|
|
391
391
|
def self.add_development_mounts!(docker_cmd)
|
|
392
|
-
# Check for local setup
|
|
393
|
-
|
|
394
|
-
setup_script_paths = [
|
|
395
|
-
File.join(File.dirname(__FILE__), "..", "..", "setup-agent.rb"), # Relative to gem
|
|
396
|
-
File.join(Dir.pwd, "tinker-public", "setup-agent.rb"), # Running from metafolder
|
|
397
|
-
File.join(Dir.pwd, "setup-agent.rb"), # Running from yatfa-public
|
|
398
|
-
]
|
|
392
|
+
# Check for local setup/ directory (for development)
|
|
393
|
+
setup_dir = File.join(File.dirname(__FILE__), "..", "..", "setup")
|
|
399
394
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
local_setup_script = path
|
|
404
|
-
break
|
|
405
|
-
end
|
|
406
|
-
end
|
|
407
|
-
|
|
408
|
-
# Mount local setup-agent.rb for development if present
|
|
409
|
-
# Binaries are always fetched from bucket by setup-agent.rb
|
|
410
|
-
if local_setup_script
|
|
411
|
-
puts "🔧 Using local setup-agent.rb for development"
|
|
412
|
-
docker_cmd.concat(["-v", "#{File.expand_path(local_setup_script)}:/tmp/setup-agent.rb:ro"])
|
|
413
|
-
|
|
414
|
-
# Mount companion scripts that setup-agent.rb loads via require_relative
|
|
415
|
-
Dir.glob(File.join(File.dirname(local_setup_script), "setup-*.rb")).each do |companion|
|
|
416
|
-
basename = File.basename(companion)
|
|
417
|
-
docker_cmd.concat(["-v", "#{File.expand_path(companion)}:/tmp/#{basename}:ro"])
|
|
418
|
-
end
|
|
395
|
+
if File.directory?(setup_dir)
|
|
396
|
+
puts "🔧 Using local setup/ for development"
|
|
397
|
+
docker_cmd.concat(["-v", "#{File.expand_path(setup_dir)}:/tmp/setup:ro"])
|
|
419
398
|
end
|
|
420
399
|
end
|
|
421
400
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yatfa",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.80",
|
|
4
4
|
"description": "YATFA - Yet Another Tool For Agents",
|
|
5
5
|
"bin": "./bin/run-yatfa-agent.rb",
|
|
6
6
|
"files": [
|
|
7
7
|
"bin/run-yatfa-agent.rb",
|
|
8
8
|
"agents.rb",
|
|
9
9
|
"lib/",
|
|
10
|
+
"setup/",
|
|
10
11
|
"bin/agent-bridge-tmux",
|
|
11
12
|
"bin/install-agent.sh"
|
|
12
13
|
],
|