@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
@@ -762,23 +762,39 @@ def select_cli(description):
762
762
  return "gemini"
763
763
  return "claude"
764
764
 
765
- # ── Poll for completion ─────────────────────────────────────
766
-
767
- def poll_session(sock_path, name, timeout=300, interval=10):
768
- """Poll workspace status until idle or timeout."""
769
- elapsed = 0
770
- while elapsed < timeout:
771
- time.sleep(interval)
772
- elapsed += interval
773
- try:
774
- resp = ipc_status(sock_path, name)
775
- status_data = resp.get("data", resp)
776
- state = status_data.get("state", "")
777
- if state == "idle":
778
- return "complete"
779
- except Exception:
780
- pass
781
- return "timeout"
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 start
868
- time.sleep(2)
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 = poll_session(sock_path, name)
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
- P/uIgNhm9toASMimI4RR0juDghA=
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
- VynS/HJeAVrTcPYdAZYRTRu7QTc=
18
+ NGOetGPZLX39y2PTpAMQXneYv4s=
19
19
  </data>
20
20
  <key>requirement</key>
21
- <string>cdhash H"5729d2fc725e015ad370f61d0196114d1bbb4137"</string>
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
- s5bUwTZCPnhDBHD2yJTrPYbiUW/tvS95Jp51csx2xCg=
27
+ 0HwbMXWMMjB4PRwGkESoIwx+vDZVllDgwT/AwIYDVwk=
28
28
  </data>
29
29
  </dict>
30
30
  </dict>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmsdc-ai/aterm-darwin-arm64",
3
- "version": "0.1.63",
3
+ "version": "0.1.65",
4
4
  "description": "darwin-arm64 native bundle for @dmsdc-ai/aterm",
5
5
  "type": "module",
6
6
  "files": [