@dmsdc-ai/aterm-darwin-arm64 0.1.64 → 0.1.66

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,7 @@ 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
+ # CreateWorkspace IPC waits for shell ready internally — no sleep needed
869
884
 
870
885
  # Inject task description
871
886
  try:
@@ -885,7 +900,7 @@ def main():
885
900
  desc = st.get("description", st) if isinstance(st, dict) else str(st)
886
901
  cli = select_cli(desc)
887
902
  break
888
- status = poll_session(sock_path, name)
903
+ status = ipc_wait_until(sock_path, name, "idle", 300000)
889
904
  reports.append({"name": name, "status": status, "cli": cli})
890
905
 
891
906
  # 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
+ a7xcdscixnWkjqJmTUbe/vKkTTI=
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
- 6cQPpgJpKTXYfCGMQoAloeI9h4w=
18
+ gGYPlZwoykeKlKpPtY0kcAyfBQ8=
19
19
  </data>
20
20
  <key>requirement</key>
21
- <string>cdhash H"e9c40fa602692935d87c218c428025a1e23d878c"</string>
21
+ <string>cdhash H"80660f959c28ca478a94aa4fb58d24700c9f050f"</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
+ qCrRT1jDYVBPcBz2wRCSkP41ElzmAjSDGwizxkMlV9Y=
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.64",
3
+ "version": "0.1.66",
4
4
  "description": "darwin-arm64 native bundle for @dmsdc-ai/aterm",
5
5
  "type": "module",
6
6
  "files": [