@dmsdc-ai/aterm-darwin-arm64 0.1.63 → 0.1.65
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.
|
Binary file
|
|
Binary file
|
|
@@ -762,23 +762,39 @@ def select_cli(description):
|
|
|
762
762
|
return "gemini"
|
|
763
763
|
return "claude"
|
|
764
764
|
|
|
765
|
-
# ──
|
|
766
|
-
|
|
767
|
-
def
|
|
768
|
-
"""
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
state
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
765
|
+
# ── Wait for state (event-driven IPC) ──────────────────────
|
|
766
|
+
|
|
767
|
+
def ipc_wait_until(sock_path, workspace, state="idle", timeout_ms=300000):
|
|
768
|
+
"""Send WaitUntil IPC — blocks server-side until state reached or timeout."""
|
|
769
|
+
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
770
|
+
try:
|
|
771
|
+
s.settimeout(timeout_ms / 1000 + 10) # server timeout + margin
|
|
772
|
+
s.connect(sock_path)
|
|
773
|
+
payload = json.dumps({
|
|
774
|
+
"action": "WaitUntil",
|
|
775
|
+
"workspace": workspace,
|
|
776
|
+
"state": state,
|
|
777
|
+
"timeout_ms": timeout_ms
|
|
778
|
+
})
|
|
779
|
+
s.sendall((payload + "\n").encode())
|
|
780
|
+
s.shutdown(socket.SHUT_WR)
|
|
781
|
+
data = b""
|
|
782
|
+
while True:
|
|
783
|
+
chunk = s.recv(4096)
|
|
784
|
+
if not chunk:
|
|
785
|
+
break
|
|
786
|
+
data += chunk
|
|
787
|
+
if b"\n" in data:
|
|
788
|
+
break
|
|
789
|
+
resp = json.loads(data.decode().strip().split("\n")[0])
|
|
790
|
+
resp_data = resp.get("data", resp)
|
|
791
|
+
if resp_data.get("reached", False):
|
|
792
|
+
return "complete"
|
|
793
|
+
return "timeout"
|
|
794
|
+
except Exception:
|
|
795
|
+
return "error"
|
|
796
|
+
finally:
|
|
797
|
+
s.close()
|
|
782
798
|
|
|
783
799
|
# ── Main ────────────────────────────────────────────────────
|
|
784
800
|
|
|
@@ -864,8 +880,10 @@ def main():
|
|
|
864
880
|
reports.append({"name": name, "status": "create_failed", "cli": cli, "error": str(e)})
|
|
865
881
|
continue
|
|
866
882
|
|
|
867
|
-
# Wait for session to
|
|
868
|
-
|
|
883
|
+
# Wait for session shell to be ready (event-driven, up to 15s)
|
|
884
|
+
ready = ipc_wait_until(sock_path, name, "running", 15000)
|
|
885
|
+
if ready == "error":
|
|
886
|
+
time.sleep(2) # fallback: brief pause if WaitUntil unavailable
|
|
869
887
|
|
|
870
888
|
# Inject task description
|
|
871
889
|
try:
|
|
@@ -885,7 +903,7 @@ def main():
|
|
|
885
903
|
desc = st.get("description", st) if isinstance(st, dict) else str(st)
|
|
886
904
|
cli = select_cli(desc)
|
|
887
905
|
break
|
|
888
|
-
status =
|
|
906
|
+
status = ipc_wait_until(sock_path, name, "idle", 300000)
|
|
889
907
|
reports.append({"name": name, "status": status, "cli": cli})
|
|
890
908
|
|
|
891
909
|
# Kill all sub-sessions
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<dict>
|
|
7
7
|
<key>Resources/bin/aterm</key>
|
|
8
8
|
<data>
|
|
9
|
-
|
|
9
|
+
tIo3NDPGo7JLQVRgUHNAk16pLmk=
|
|
10
10
|
</data>
|
|
11
11
|
</dict>
|
|
12
12
|
<key>files2</key>
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
<dict>
|
|
16
16
|
<key>cdhash</key>
|
|
17
17
|
<data>
|
|
18
|
-
|
|
18
|
+
NGOetGPZLX39y2PTpAMQXneYv4s=
|
|
19
19
|
</data>
|
|
20
20
|
<key>requirement</key>
|
|
21
|
-
<string>cdhash H"
|
|
21
|
+
<string>cdhash H"34639eb463d92d7dfdcb63d3a403105e7798bf8b"</string>
|
|
22
22
|
</dict>
|
|
23
23
|
<key>Resources/bin/aterm</key>
|
|
24
24
|
<dict>
|
|
25
25
|
<key>hash2</key>
|
|
26
26
|
<data>
|
|
27
|
-
|
|
27
|
+
0HwbMXWMMjB4PRwGkESoIwx+vDZVllDgwT/AwIYDVwk=
|
|
28
28
|
</data>
|
|
29
29
|
</dict>
|
|
30
30
|
</dict>
|