SolverBot: - Inject active project path into agent system prompts so agents know which directory to scope file operations to GuruRMM: - Bump agent version to 0.6.0 - Add serde aliases for PowerShell/ClaudeTask command types - Add typed CommandType enum on server for proper serialization - Support claude_task command type in send_command API Dataforth: - Fix SCP space-escaping in Sync-FromNAS.ps1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
import requests, json, time, sys
|
|
|
|
# Auth
|
|
token_r = requests.post('http://172.16.3.30:3001/api/auth/login', json={
|
|
'email': 'claude-api@azcomputerguru.com',
|
|
'password': 'ClaudeAPI2026!@#'
|
|
})
|
|
token = token_r.json()['token']
|
|
headers = {'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json'}
|
|
agent_id = 'd28a1c90-47d7-448f-a287-197bc8892234'
|
|
|
|
# Send download command via PowerShell
|
|
cmd = (
|
|
"New-Item -ItemType Directory -Path C:/Temp -Force | Out-Null; "
|
|
"Invoke-WebRequest -Uri 'http://172.16.3.30/gururmm-agent-new.exe' "
|
|
"-OutFile 'C:/Temp/gururmm-agent-new.exe' -UseBasicParsing; "
|
|
"$f = Get-Item 'C:/Temp/gururmm-agent-new.exe'; "
|
|
"Write-Output ('Downloaded: ' + $f.Length.ToString() + ' bytes')"
|
|
)
|
|
|
|
r = requests.post(
|
|
'http://172.16.3.30:3001/api/agents/' + agent_id + '/command',
|
|
headers=headers,
|
|
json={'command_type': 'powershell', 'command': cmd, 'timeout_seconds': 120}
|
|
)
|
|
print('Send:', r.json())
|
|
cmd_id = r.json()['command_id']
|
|
|
|
# Wait and check
|
|
time.sleep(20)
|
|
r2 = requests.get('http://172.16.3.30:3001/api/commands/' + cmd_id, headers=headers)
|
|
d = r2.json()
|
|
print('Status:', d['status'])
|
|
print('stdout:', d.get('stdout', ''))
|
|
print('stderr:', (d.get('stderr', '') or '')[:500])
|