@dmsdc-ai/aterm-darwin-arm64 0.1.55 → 0.1.57

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
@@ -3,6 +3,14 @@
3
3
  # Sends NDJSON over $ATERM_IPC_SOCKET. Falls back to telepty outside aterm.
4
4
  set -euo pipefail
5
5
 
6
+ # Ensure aterm Resources/bin is in PATH (survives shell PATH reset)
7
+ if [[ -n "${ATERM_RESOURCES_BIN:-}" && -d "$ATERM_RESOURCES_BIN" ]]; then
8
+ case ":$PATH:" in
9
+ *":$ATERM_RESOURCES_BIN:"*) ;;
10
+ *) export PATH="$ATERM_RESOURCES_BIN:$PATH" ;;
11
+ esac
12
+ fi
13
+
6
14
  ATERM_IPC_SOCKET="${ATERM_IPC_SOCKET:-}"
7
15
 
8
16
  detect_ui_lang() {
@@ -92,6 +100,7 @@ show_help() {
92
100
  | `aterm theme <name>` | 테마 변경 (colorScheme 설정 단축키) |
93
101
  | `aterm attach <external-id>` | 외부 세션 연결 |
94
102
  | `aterm send-key <workspace> <key>` | 키 전송 (ctrl+c, enter, tab, esc 등) |
103
+ | `aterm subscribe [--events e1,e2]` | 워크스페이스 이벤트 실시간 스트림 (Created,Closed,StatusChanged,TitleChanged) |
95
104
  | `aterm help` | 이 도움말 표시 |
96
105
 
97
106
  ## 에코시스템
@@ -171,6 +180,7 @@ HELP
171
180
  | `aterm theme <name>` | Change theme (shortcut for settings set colorScheme) |
172
181
  | `aterm attach <external-id>` | Attach an external session |
173
182
  | `aterm send-key <workspace> <key>` | Send key to workspace (ctrl+c, enter, tab, esc, etc.) |
183
+ | `aterm subscribe [--events e1,e2]` | Stream workspace events in real-time (Created,Closed,StatusChanged,TitleChanged) |
174
184
  | `aterm help` | Show this help |
175
185
 
176
186
  ## Ecosystem
@@ -233,6 +243,10 @@ payloads = {
233
243
  "inject": lambda: {"action": "Inject", "workspace": args[0],
234
244
  "text": " ".join(args[1:]),
235
245
  "from": __import__("os").environ.get("ATERM_WORKSPACE_NAME")},
246
+ "inject-force": lambda: {"action": "Inject", "workspace": args[0],
247
+ "text": " ".join(args[1:]),
248
+ "from": __import__("os").environ.get("ATERM_WORKSPACE_NAME"),
249
+ "force": True},
236
250
  "status": lambda: {"action": "WorkspaceStatus", "workspace": args[0]},
237
251
  "focus": lambda: {"action": "FocusWorkspace", "workspace": args[0]},
238
252
  "rename": lambda: {"action": "RenameWorkspace", "old_name": args[0], "new_name": args[1]},
@@ -422,8 +436,18 @@ else:
422
436
  fi ;;
423
437
  inject)
424
438
  if [[ -z "$ATERM_IPC_SOCKET" ]]; then exec telepty inject "${@:2}"; fi
425
- [[ $# -lt 3 ]] && { echo '{"error":"usage: aterm inject <workspace> <text>"}' >&2; exit 1; }
426
- aterm_ipc inject "${@:2}" ;;
439
+ local _force_flag=false
440
+ local _inject_args=()
441
+ for _arg in "${@:2}"; do
442
+ if [[ "$_arg" == "--force" ]]; then _force_flag=true
443
+ else _inject_args+=("$_arg"); fi
444
+ done
445
+ [[ ${#_inject_args[@]} -lt 2 ]] && { echo '{"error":"usage: aterm inject <workspace> <text> [--force]"}' >&2; exit 1; }
446
+ if $_force_flag; then
447
+ aterm_ipc inject-force "${_inject_args[@]}"
448
+ else
449
+ aterm_ipc inject "${_inject_args[@]}"
450
+ fi ;;
427
451
  status)
428
452
  if [[ $# -eq 1 ]]; then
429
453
  print_ecosystem_status
@@ -930,6 +954,75 @@ print(json.dumps({"status": "ok", "file": os.path.abspath(filename)}))
930
954
  [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"send-key requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
931
955
  [[ $# -lt 3 ]] && { echo '{"error":"usage: aterm send-key <workspace> <key>"}' >&2; exit 1; }
932
956
  aterm_ipc send-key "$2" "$3" ;;
957
+ subscribe)
958
+ [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"subscribe requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
959
+ # Parse --events flag
960
+ _events="[]"
961
+ shift
962
+ while [[ $# -gt 0 ]]; do
963
+ case "$1" in
964
+ --events) _events="$2"; shift 2 ;;
965
+ *) shift ;;
966
+ esac
967
+ done
968
+ python3 -c '
969
+ import os, socket, sys, json, signal
970
+
971
+ sock_path = sys.argv[1]
972
+ raw_events = sys.argv[2]
973
+
974
+ # Parse events: comma-separated string → JSON array
975
+ if raw_events == "[]":
976
+ events = []
977
+ else:
978
+ events = [e.strip() for e in raw_events.split(",") if e.strip()]
979
+
980
+ payload = json.dumps({"action": "Subscribe", "events": events}) + "\n"
981
+
982
+ sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
983
+ try:
984
+ sock.connect(sock_path)
985
+ sock.sendall(payload.encode())
986
+
987
+ # Read initial OK response (first line)
988
+ buf = b""
989
+ while b"\n" not in buf:
990
+ chunk = sock.recv(4096)
991
+ if not chunk:
992
+ print(json.dumps({"error": "connection closed before response"}), file=sys.stderr)
993
+ sys.exit(1)
994
+ buf += chunk
995
+
996
+ first_line, remainder = buf.split(b"\n", 1)
997
+ resp = json.loads(first_line.decode())
998
+ if resp.get("status") == "Error":
999
+ print(json.dumps({"error": resp.get("message", "subscribe failed")}), file=sys.stderr)
1000
+ sys.exit(1)
1001
+
1002
+ # Stream events (NDJSON) until interrupted or connection closed
1003
+ # Process any data already in remainder
1004
+ buf = remainder
1005
+ while True:
1006
+ while b"\n" in buf:
1007
+ line, buf = buf.split(b"\n", 1)
1008
+ line = line.strip()
1009
+ if line:
1010
+ print(line.decode(), flush=True)
1011
+ try:
1012
+ chunk = sock.recv(4096)
1013
+ except (KeyboardInterrupt, BrokenPipeError):
1014
+ break
1015
+ if not chunk:
1016
+ break
1017
+ buf += chunk
1018
+ except KeyboardInterrupt:
1019
+ pass
1020
+ except Exception as e:
1021
+ print(json.dumps({"error": str(e)}), file=sys.stderr)
1022
+ sys.exit(1)
1023
+ finally:
1024
+ sock.close()
1025
+ ' "$ATERM_IPC_SOCKET" "$_events" ;;
933
1026
  help|--help|-h)
934
1027
  show_help
935
1028
  ;;
@@ -6,7 +6,7 @@
6
6
  <dict>
7
7
  <key>Resources/bin/aterm</key>
8
8
  <data>
9
- i2hlQ0H8m/iG4PV7blPDAFsXFfE=
9
+ itfmCcgdge1W6o0mK/bb13CUhzs=
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
- lKyYLg8/yYbZ5bjOH/7dc9PdIOs=
18
+ oUyF1oqsAfhcCAlhaK4uJpM+RiI=
19
19
  </data>
20
20
  <key>requirement</key>
21
- <string>cdhash H"94ac982e0f3fc986d9e5b8ce1ffedd73d3dd20eb"</string>
21
+ <string>cdhash H"a14c85d68aac01f85c08096168ae2e26933e4622"</string>
22
22
  </dict>
23
23
  <key>Resources/bin/aterm</key>
24
24
  <dict>
25
25
  <key>hash2</key>
26
26
  <data>
27
- uzdbvs4rORXxogXVjWU4YSGdhoC0qGoBtZ+LGOH/Csc=
27
+ rVXEtM6V0Kycicu7+OB658eGv0qwiUWAu+zjrp49AsA=
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.55",
3
+ "version": "0.1.57",
4
4
  "description": "darwin-arm64 native bundle for @dmsdc-ai/aterm",
5
5
  "type": "module",
6
6
  "files": [