@dmsdc-ai/aterm-darwin-arm64 0.1.56 → 0.1.58

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
@@ -4,7 +4,7 @@
4
4
  set -euo pipefail
5
5
 
6
6
  # Ensure aterm Resources/bin is in PATH (survives shell PATH reset)
7
- if [[ -n "${ATERM_RESOURCES_BIN:-}" && -d "$ATERM_RESOURCES_BIN" ]]; then
7
+ if [ -n "${ATERM_RESOURCES_BIN:-}" ] && [ -d "$ATERM_RESOURCES_BIN" ]; then
8
8
  case ":$PATH:" in
9
9
  *":$ATERM_RESOURCES_BIN:"*) ;;
10
10
  *) export PATH="$ATERM_RESOURCES_BIN:$PATH" ;;
@@ -16,11 +16,10 @@ ATERM_IPC_SOCKET="${ATERM_IPC_SOCKET:-}"
16
16
  detect_ui_lang() {
17
17
  local raw="${ATERM_UI_LANG:-${LC_ALL:-${LC_MESSAGES:-${LANG:-}}}}"
18
18
  raw="$(printf '%s' "$raw" | tr '[:upper:]' '[:lower:]')"
19
- if [[ "$raw" == ko* || "$raw" == *"ko_"* || "$raw" == *"ko-"* ]]; then
20
- echo "ko"
21
- else
22
- echo "en"
23
- fi
19
+ case "$raw" in
20
+ ko*|*ko_*|*ko-*) echo "ko" ;;
21
+ *) echo "en" ;;
22
+ esac
24
23
  }
25
24
 
26
25
  ATERM_UI_LANG="$(detect_ui_lang)"
@@ -48,7 +47,7 @@ ensure_lessons_file() {
48
47
  }
49
48
 
50
49
  print_ecosystem_status() {
51
- if [[ "$ATERM_UI_LANG" == "ko" ]]; then
50
+ if [ "$ATERM_UI_LANG" = "ko" ]; then
52
51
  cat <<'STATUS'
53
52
  brain: ✅ 설치됨
54
53
  telepty: ✅ 설치됨
@@ -66,7 +65,7 @@ STATUS
66
65
  }
67
66
 
68
67
  show_help() {
69
- if [[ "$ATERM_UI_LANG" == "ko" ]]; then
68
+ if [ "$ATERM_UI_LANG" = "ko" ]; then
70
69
  cat <<'HELP'
71
70
  # aterm — AI 네이티브 터미널 세션 통신
72
71
 
@@ -285,9 +284,16 @@ try:
285
284
  sys.exit(1)
286
285
  elif action == "list":
287
286
  if __import__("os").environ.get("ATERM_LIST_JSON"):
288
- print(json.dumps({"sessions": resp.get("data", [])}))
287
+ sessions = [
288
+ session for session in resp.get("data", [])
289
+ if session.get("status") not in ("dead", "closing")
290
+ ]
291
+ print(json.dumps({"sessions": sessions}))
289
292
  else:
290
- sessions = resp.get("data", [])
293
+ sessions = [
294
+ session for session in resp.get("data", [])
295
+ if session.get("status") not in ("dead", "closing")
296
+ ]
291
297
  if not sessions:
292
298
  print("(워크스페이스 없음)" if lang == "ko" else "(no workspaces)")
293
299
  else:
@@ -326,7 +332,7 @@ finally:
326
332
 
327
333
  case "${1:-help}" in
328
334
  list)
329
- if [[ "${2:-}" == "--json" ]]; then
335
+ if [ "${2:-}" = "--json" ]; then
330
336
  # JSON mode: output merged JSON
331
337
  python3 -c '
332
338
  import json, sys, os, subprocess, os.path
@@ -352,6 +358,8 @@ if sock:
352
358
  s.close()
353
359
  resp = json.loads(data.decode().strip().split("\n")[0])
354
360
  for ws in resp.get("data", []):
361
+ if ws.get("status") in ("dead", "closing"):
362
+ continue
355
363
  ws["terminal"] = "aterm"
356
364
  ws.setdefault("name", os.path.basename(ws.get("cwd", "")) or ws.get("id", "?"))
357
365
  sessions.append(ws)
@@ -397,6 +405,8 @@ if sock:
397
405
  s.close()
398
406
  resp = json.loads(data.decode().strip().split("\n")[0])
399
407
  for ws in resp.get("data", []):
408
+ if ws.get("status") in ("dead", "closing"):
409
+ continue
400
410
  name = ws.get("name") or os.path.basename(ws.get("cwd", "")) or ws.get("id", "?")
401
411
  cli = ws.get("cli", "")
402
412
  cwd = ws.get("cwd", "")
@@ -435,64 +445,67 @@ else:
435
445
  '
436
446
  fi ;;
437
447
  inject)
438
- if [[ -z "$ATERM_IPC_SOCKET" ]]; then exec telepty inject "${@:2}"; fi
439
- local _force_flag=false
440
- local _inject_args=()
448
+ if [ -z "$ATERM_IPC_SOCKET" ]; then exec telepty inject "${@:2}"; fi
449
+ _force_flag=false
450
+ _inject_args=()
441
451
  for _arg in "${@:2}"; do
442
- if [[ "$_arg" == "--force" ]]; then _force_flag=true
452
+ if [ "$_arg" = "--force" ]; then _force_flag=true
443
453
  else _inject_args+=("$_arg"); fi
444
454
  done
445
- [[ ${#_inject_args[@]} -lt 2 ]] && { echo '{"error":"usage: aterm inject <workspace> <text> [--force]"}' >&2; exit 1; }
446
- if $_force_flag; then
455
+ [ ${#_inject_args[@]} -lt 2 ] && { echo '{"error":"usage: aterm inject <workspace> <text> [--force]"}' >&2; exit 1; }
456
+ if [ "$_force_flag" = "true" ]; then
447
457
  aterm_ipc inject-force "${_inject_args[@]}"
448
458
  else
449
459
  aterm_ipc inject "${_inject_args[@]}"
450
460
  fi ;;
451
461
  status)
452
- if [[ $# -eq 1 ]]; then
462
+ if [ "$#" -eq 1 ]; then
453
463
  print_ecosystem_status
454
464
  exit 0
455
465
  fi
456
- if [[ -z "$ATERM_IPC_SOCKET" ]]; then exec telepty status "${@:2}"; fi
457
- [[ $# -lt 2 ]] && { echo '{"error":"usage: aterm status <workspace>"}' >&2; exit 1; }
466
+ if [ -z "$ATERM_IPC_SOCKET" ]; then exec telepty status "${@:2}"; fi
467
+ [ "$#" -lt 2 ] && { echo '{"error":"usage: aterm status <workspace>"}' >&2; exit 1; }
458
468
  aterm_ipc status "$2" ;;
459
469
  focus)
460
- [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"focus requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
461
- [[ $# -lt 2 ]] && { echo '{"error":"usage: aterm focus <workspace>"}' >&2; exit 1; }
470
+ [ -z "$ATERM_IPC_SOCKET" ] && { echo '{"error":"focus requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
471
+ [ "$#" -lt 2 ] && { echo '{"error":"usage: aterm focus <workspace>"}' >&2; exit 1; }
462
472
  aterm_ipc focus "$2" ;;
463
473
  rename)
464
- [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"rename requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
465
- [[ $# -lt 3 ]] && { echo '{"error":"usage: aterm rename <old> <new>"}' >&2; exit 1; }
474
+ [ -z "$ATERM_IPC_SOCKET" ] && { echo '{"error":"rename requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
475
+ [ "$#" -lt 3 ] && { echo '{"error":"usage: aterm rename <old> <new>"}' >&2; exit 1; }
466
476
  aterm_ipc rename "$2" "$3" ;;
467
477
  clear)
468
- [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"clear requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
469
- [[ $# -lt 2 ]] && { echo '{"error":"usage: aterm clear <workspace>"}' >&2; exit 1; }
478
+ [ -z "$ATERM_IPC_SOCKET" ] && { echo '{"error":"clear requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
479
+ [ "$#" -lt 2 ] && { echo '{"error":"usage: aterm clear <workspace>"}' >&2; exit 1; }
470
480
  aterm_ipc clear "$2" ;;
471
481
  create)
472
- [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"create requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
482
+ [ -z "$ATERM_IPC_SOCKET" ] && { echo '{"error":"create requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
473
483
  # Parse: aterm create <name> --cli <cli> --cwd <path>
474
484
  shift
475
485
  _name="${1:-}"; shift || true
476
486
  _cli=""; _cwd=""
477
- while [[ $# -gt 0 ]]; do
487
+ while [ "$#" -gt 0 ]; do
478
488
  case "$1" in
479
489
  --cli) _cli="$2"; shift 2 ;;
480
490
  --cwd) _cwd="$2"; shift 2 ;;
481
491
  *) shift ;;
482
492
  esac
483
493
  done
484
- [[ -z "$_name" || -z "$_cli" || -z "$_cwd" ]] && { echo '{"error":"usage: aterm create <name> --cli <cli> --cwd <path>"}' >&2; exit 1; }
494
+ if [ -z "$_name" ] || [ -z "$_cli" ] || [ -z "$_cwd" ]; then
495
+ echo '{"error":"usage: aterm create <name> --cli <cli> --cwd <path>"}' >&2
496
+ exit 1
497
+ fi
485
498
  aterm_ipc create "$_name" "$_cli" "$_cwd" ;;
486
499
  restart)
487
- [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"restart requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
488
- [[ $# -lt 2 ]] && { echo '{"error":"usage: aterm restart <workspace>"}' >&2; exit 1; }
500
+ [ -z "$ATERM_IPC_SOCKET" ] && { echo '{"error":"restart requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
501
+ [ "$#" -lt 2 ] && { echo '{"error":"usage: aterm restart <workspace>"}' >&2; exit 1; }
489
502
  aterm_ipc restart "$2" ;;
490
503
  kill)
491
- [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"kill requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
492
- [[ $# -lt 2 ]] && { echo '{"error":"usage: aterm kill <workspace>"}' >&2; exit 1; }
504
+ [ -z "$ATERM_IPC_SOCKET" ] && { echo '{"error":"kill requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
505
+ [ "$#" -lt 2 ] && { echo '{"error":"usage: aterm kill <workspace>"}' >&2; exit 1; }
493
506
  aterm_ipc kill "$2" ;;
494
507
  restart-all)
495
- [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"restart-all requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
508
+ [ -z "$ATERM_IPC_SOCKET" ] && { echo '{"error":"restart-all requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
496
509
  aterm_ipc restart-all ;;
497
510
  tasks)
498
511
  ensure_tasks_file
@@ -510,7 +523,7 @@ for i, t in enumerate(data["tasks"]):
510
523
  print(f" [{tid}] {desc}")
511
524
  ' "$(tasks_file)" ;;
512
525
  add)
513
- [[ $# -lt 3 ]] && { echo '{"error":"usage: aterm tasks add <description>"}' >&2; exit 1; }
526
+ [ "$#" -lt 3 ] && { echo '{"error":"usage: aterm tasks add <description>"}' >&2; exit 1; }
514
527
  python3 -c '
515
528
  import json, sys, time
516
529
  f = sys.argv[1]; desc = " ".join(sys.argv[2:])
@@ -521,7 +534,7 @@ with open(f, "w") as fh: json.dump(data, fh, indent=2, ensure_ascii=False); fh.w
521
534
  print(json.dumps({"status":"ok","id": tid}))
522
535
  ' "$(tasks_file)" "${@:3}" ;;
523
536
  done)
524
- [[ $# -lt 3 ]] && { echo '{"error":"usage: aterm tasks done <id>"}' >&2; exit 1; }
537
+ [ "$#" -lt 3 ] && { echo '{"error":"usage: aterm tasks done <id>"}' >&2; exit 1; }
525
538
  python3 -c '
526
539
  import json, sys
527
540
  f = sys.argv[1]; target = int(sys.argv[2])
@@ -560,7 +573,7 @@ if fail:
560
573
  for l in fail: print(f" - {l}")
561
574
  ' "$(lessons_file)" ;;
562
575
  add)
563
- [[ $# -lt 3 ]] && { echo '{"error":"usage: aterm lessons add <lesson> [--type invariant|failed]"}' >&2; exit 1; }
576
+ [ "$#" -lt 3 ] && { echo '{"error":"usage: aterm lessons add <lesson> [--type invariant|failed]"}' >&2; exit 1; }
564
577
  python3 -c '
565
578
  import json, sys
566
579
  f = sys.argv[1]; lesson = sys.argv[2]
@@ -577,7 +590,7 @@ print(json.dumps({"status":"ok","type": ltype}))
577
590
  *) echo '{"error":"usage: aterm lessons [list|add]"}' >&2; exit 1 ;;
578
591
  esac ;;
579
592
  dispatch)
580
- [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"dispatch requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
593
+ [ -z "$ATERM_IPC_SOCKET" ] && { echo '{"error":"dispatch requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
581
594
  python3 -c '
582
595
  import socket
583
596
  import subprocess
@@ -825,7 +838,7 @@ main()
825
838
  settings)
826
839
  case "${2:-}" in
827
840
  get)
828
- [[ $# -lt 3 ]] && { echo '{"error":"usage: aterm settings get <key>"}' >&2; exit 1; }
841
+ [ "$#" -lt 3 ] && { echo '{"error":"usage: aterm settings get <key>"}' >&2; exit 1; }
829
842
  python3 -c '
830
843
  import json, sys, os
831
844
  f = os.path.expanduser("~/.aigentry/config/aterm.json")
@@ -849,7 +862,7 @@ else:
849
862
  print(json.dumps(val))
850
863
  ' "$3" ;;
851
864
  set)
852
- [[ $# -lt 4 ]] && { echo '{"error":"usage: aterm settings set <key> <value>"}' >&2; exit 1; }
865
+ [ "$#" -lt 4 ] && { echo '{"error":"usage: aterm settings set <key> <value>"}' >&2; exit 1; }
853
866
  python3 -c '
854
867
  import json, sys, os
855
868
  f = os.path.expanduser("~/.aigentry/config/aterm.json")
@@ -874,13 +887,13 @@ with open(f, "w") as fh:
874
887
  fh.write("\n")
875
888
  print(json.dumps({"status": "ok", "key": key, "value": val}))
876
889
  ' "$3" "$4"
877
- if [[ -n "$ATERM_IPC_SOCKET" ]]; then
890
+ if [ -n "$ATERM_IPC_SOCKET" ]; then
878
891
  aterm_ipc reload-settings 2>/dev/null || true
879
892
  fi ;;
880
893
  *) echo '{"error":"usage: aterm settings [get|set]"}' >&2; exit 1 ;;
881
894
  esac ;;
882
895
  theme)
883
- [[ $# -lt 2 ]] && { echo '{"error":"usage: aterm theme <name>"}' >&2; exit 1; }
896
+ [ "$#" -lt 2 ] && { echo '{"error":"usage: aterm theme <name>"}' >&2; exit 1; }
884
897
  python3 -c '
885
898
  import json, sys, os
886
899
  f = os.path.expanduser("~/.aigentry/config/aterm.json")
@@ -895,20 +908,20 @@ with open(f, "w") as fh:
895
908
  fh.write("\n")
896
909
  print(json.dumps({"status": "ok", "key": "colorScheme", "value": sys.argv[1]}))
897
910
  ' "$2"
898
- if [[ -n "$ATERM_IPC_SOCKET" ]]; then
911
+ if [ -n "$ATERM_IPC_SOCKET" ]; then
899
912
  aterm_ipc reload-settings 2>/dev/null || true
900
913
  fi ;;
901
914
  log)
902
- [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"log requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
903
- [[ $# -lt 2 ]] && { echo '{"error":"usage: aterm log <workspace> [--lines N]"}' >&2; exit 1; }
915
+ [ -z "$ATERM_IPC_SOCKET" ] && { echo '{"error":"log requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
916
+ [ "$#" -lt 2 ] && { echo '{"error":"usage: aterm log <workspace> [--lines N]"}' >&2; exit 1; }
904
917
  _ws="$2"; _lines=100
905
- if [[ "${3:-}" == "--lines" && -n "${4:-}" ]]; then _lines="$4"; fi
918
+ if [ "${3:-}" = "--lines" ] && [ -n "${4:-}" ]; then _lines="$4"; fi
906
919
  aterm_ipc read-screen "$_ws" "$_lines" ;;
907
920
  export)
908
- [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"export requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
909
- [[ $# -lt 2 ]] && { echo '{"error":"usage: aterm export <workspace> [--format md|txt]"}' >&2; exit 1; }
921
+ [ -z "$ATERM_IPC_SOCKET" ] && { echo '{"error":"export requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
922
+ [ "$#" -lt 2 ] && { echo '{"error":"usage: aterm export <workspace> [--format md|txt]"}' >&2; exit 1; }
910
923
  _ws="$2"; _fmt="txt"
911
- if [[ "${3:-}" == "--format" && -n "${4:-}" ]]; then _fmt="$4"; fi
924
+ if [ "${3:-}" = "--format" ] && [ -n "${4:-}" ]; then _fmt="$4"; fi
912
925
  python3 -c '
913
926
  import os, socket, sys, json, time
914
927
 
@@ -947,19 +960,19 @@ with open(filename, "w") as f:
947
960
  print(json.dumps({"status": "ok", "file": os.path.abspath(filename)}))
948
961
  ' "$ATERM_IPC_SOCKET" "$_ws" "$_fmt" ;;
949
962
  attach)
950
- [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"attach requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
951
- [[ $# -lt 2 ]] && { echo '{"error":"usage: aterm attach <external-id>"}' >&2; exit 1; }
963
+ [ -z "$ATERM_IPC_SOCKET" ] && { echo '{"error":"attach requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
964
+ [ "$#" -lt 2 ] && { echo '{"error":"usage: aterm attach <external-id>"}' >&2; exit 1; }
952
965
  aterm_ipc attach-external "$2" ;;
953
966
  send-key)
954
- [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"send-key requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
955
- [[ $# -lt 3 ]] && { echo '{"error":"usage: aterm send-key <workspace> <key>"}' >&2; exit 1; }
967
+ [ -z "$ATERM_IPC_SOCKET" ] && { echo '{"error":"send-key requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
968
+ [ "$#" -lt 3 ] && { echo '{"error":"usage: aterm send-key <workspace> <key>"}' >&2; exit 1; }
956
969
  aterm_ipc send-key "$2" "$3" ;;
957
970
  subscribe)
958
- [[ -z "$ATERM_IPC_SOCKET" ]] && { echo '{"error":"subscribe requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
971
+ [ -z "$ATERM_IPC_SOCKET" ] && { echo '{"error":"subscribe requires aterm (ATERM_IPC_SOCKET not set)"}' >&2; exit 1; }
959
972
  # Parse --events flag
960
973
  _events="[]"
961
974
  shift
962
- while [[ $# -gt 0 ]]; do
975
+ while [ "$#" -gt 0 ]; do
963
976
  case "$1" in
964
977
  --events) _events="$2"; shift 2 ;;
965
978
  *) shift ;;
@@ -6,7 +6,7 @@
6
6
  <dict>
7
7
  <key>Resources/bin/aterm</key>
8
8
  <data>
9
- itfmCcgdge1W6o0mK/bb13CUhzs=
9
+ JLY7c+Sc374KBcuKBzvkRcGJq08=
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
- Tv4AinWPMtkoQ7N0szHw9MFqc0E=
18
+ DmiwEicLH+10dGphCI1TyKZ7Z1U=
19
19
  </data>
20
20
  <key>requirement</key>
21
- <string>cdhash H"4efe008a758f32d92843b374b331f0f4c16a7341"</string>
21
+ <string>cdhash H"0e68b012270b1fed74746a61088d53c8a67b6755"</string>
22
22
  </dict>
23
23
  <key>Resources/bin/aterm</key>
24
24
  <dict>
25
25
  <key>hash2</key>
26
26
  <data>
27
- rVXEtM6V0Kycicu7+OB658eGv0qwiUWAu+zjrp49AsA=
27
+ If4LFiLeJX+JDDWTyW26tv/qQtvI6PlqpTgQDw49vLI=
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.56",
3
+ "version": "0.1.58",
4
4
  "description": "darwin-arm64 native bundle for @dmsdc-ai/aterm",
5
5
  "type": "module",
6
6
  "files": [