Compare commits

..

No commits in common. "f18c31df6c069625a7e86bf09c59755e5389da12" and "3dca3e5b233f63522291df5051abb09c0a4099a2" have entirely different histories.

3 changed files with 19 additions and 11 deletions

1
.gitignore vendored
View File

@ -6,4 +6,3 @@ dist/
build/
*.kate-swp
.directory
CLAUDE.md

View File

@ -79,12 +79,10 @@ class command():
# Pattern 1b: Time/token activity (not percentage-based, so use single beep)
timeMatch = re.search(r'(\d+)s\s', text)
tokenMatch = re.search(r'(\d+)\s+tokens', text)
# Pattern 1c: dd command output (bytes copied with transfer rate)
ddMatch = re.search(r'\d+\s+bytes.*copied.*\d+\s+s.*[kMGT]?B/s', text)
# Pattern 1d: Curl-style transfer data (bytes, speed indicators)
# Pattern 1c: Curl-style transfer data (bytes, speed indicators)
curlMatch = re.search(r'(\d+\s+\d+\s+\d+\s+\d+.*?(?:k|M|G)?.*?--:--:--|Speed)', text)
if timeMatch or tokenMatch or ddMatch or curlMatch:
if timeMatch or tokenMatch or curlMatch:
# For non-percentage progress, use a single activity beep every 2 seconds
if currentTime - self.env['commandBuffer']['lastProgressTime'] >= 2.0:
self.env['runtime']['debug'].writeDebugOut("Playing activity beep for transfer progress", debug.debugLevel.INFO)

View File

@ -45,17 +45,28 @@ class driver(remoteDriver):
continue
if self.fenrirSock in r:
client_sock, client_addr = self.fenrirSock.accept()
response = "ERROR: Failed to process command\n"
try:
rawdata = client_sock.recv(8129)
except:
pass
try:
data = rawdata.decode("utf-8").rstrip().lstrip()
eventQueue.put({"Type":fenrirEventType.RemoteIncomming,
"Data": data
})
if data:
# Process the command and get response
result = self.env['runtime']['remoteManager'].handleRemoteIncommingWithResponse(data)
if result['success']:
response = f"OK: {result['message']}\n"
else:
response = f"ERROR: {result['message']}\n"
else:
response = "ERROR: Empty command\n"
except Exception as e:
response = f"ERROR: {str(e)}\n"
# Send response back to client
try:
client_sock.send(response.encode("utf-8"))
except:
pass
try:
client_sock.close()
except: