@dmsdc-ai/aterm-darwin-arm64 0.1.66 → 0.1.68
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
|
|
@@ -140,6 +140,15 @@ show_help() {
|
|
|
140
140
|
2. `telepty list` — 외부 세션 (프로젝트 이름 + 터미널 타입)
|
|
141
141
|
3. `ps aux | grep` 를 주 탐지 수단으로 사용하지 말 것 (프로젝트 이름과 터미널 정보가 없음)
|
|
142
142
|
|
|
143
|
+
## 통신 방법 결정
|
|
144
|
+
|
|
145
|
+
| 상황 | 방법 |
|
|
146
|
+
|------|------|
|
|
147
|
+
| 대상 미지정 | 현재 세션에서 응답 (기본) |
|
|
148
|
+
| 대상이 내부 워크스페이스 | `aterm inject` |
|
|
149
|
+
| 대상이 외부 세션 | `telepty inject` |
|
|
150
|
+
| 대상이 자기 자신 | 경고 (`--force`로 강제 실행) |
|
|
151
|
+
|
|
143
152
|
## 탐지 규칙
|
|
144
153
|
- `$ATERM_IPC_SOCKET` 이 설정되어 있으면 aterm 내부입니다. `aterm` 명령을 사용합니다.
|
|
145
154
|
- `$ATERM_IPC_SOCKET` 이 비어 있으면 aterm 외부입니다. `telepty` 명령을 사용합니다.
|
|
@@ -220,6 +229,15 @@ HELP
|
|
|
220
229
|
2. `telepty list` — external sessions (project names + terminal type)
|
|
221
230
|
3. Never use `ps aux | grep` as the primary detection method (no project names, no terminal info)
|
|
222
231
|
|
|
232
|
+
## Communication Decision
|
|
233
|
+
|
|
234
|
+
| Situation | Method |
|
|
235
|
+
|-----------|--------|
|
|
236
|
+
| No target specified | Reply in current session (default) |
|
|
237
|
+
| Target is internal workspace | `aterm inject` |
|
|
238
|
+
| Target is external session | `telepty inject` |
|
|
239
|
+
| Target is self | Warning (use `--force` to proceed) |
|
|
240
|
+
|
|
223
241
|
## Detection Rules
|
|
224
242
|
- `$ATERM_IPC_SOCKET` set -> inside aterm. Use `aterm` commands.
|
|
225
243
|
- `$ATERM_IPC_SOCKET` unset -> outside aterm. Use `telepty` commands.
|
|
@@ -330,6 +348,35 @@ finally:
|
|
|
330
348
|
' "$ATERM_IPC_SOCKET" "$@"
|
|
331
349
|
}
|
|
332
350
|
|
|
351
|
+
# Early guard: handle commands when outside aterm ($ATERM_IPC_SOCKET not set)
|
|
352
|
+
case "${1:-help}" in
|
|
353
|
+
help|--help|-h|version|--version)
|
|
354
|
+
show_help
|
|
355
|
+
exit 0 ;;
|
|
356
|
+
esac
|
|
357
|
+
if [ -z "$ATERM_IPC_SOCKET" ]; then
|
|
358
|
+
case "${1:-help}" in
|
|
359
|
+
inject)
|
|
360
|
+
shift
|
|
361
|
+
exec telepty inject "$@" ;;
|
|
362
|
+
list)
|
|
363
|
+
shift
|
|
364
|
+
exec telepty list "$@" ;;
|
|
365
|
+
status)
|
|
366
|
+
if [ "$#" -le 1 ]; then
|
|
367
|
+
print_ecosystem_status
|
|
368
|
+
exit 0
|
|
369
|
+
fi
|
|
370
|
+
shift
|
|
371
|
+
exec telepty status "$@" ;;
|
|
372
|
+
tasks|lessons|settings|theme)
|
|
373
|
+
;; # file-based commands — no IPC needed, fall through
|
|
374
|
+
*)
|
|
375
|
+
echo 'Error: aterm is not running ($ATERM_IPC_SOCKET not set). Start aterm or use telepty.' >&2
|
|
376
|
+
exit 1 ;;
|
|
377
|
+
esac
|
|
378
|
+
fi
|
|
379
|
+
|
|
333
380
|
case "${1:-help}" in
|
|
334
381
|
list)
|
|
335
382
|
if [ "${2:-}" = "--json" ]; then
|
|
@@ -480,6 +527,12 @@ remaining = sys.argv[6:]
|
|
|
480
527
|
workspace = remaining[0]
|
|
481
528
|
msg = " ".join(remaining[1:])
|
|
482
529
|
|
|
530
|
+
# Self-inject warning: prevent accidental injection into own session
|
|
531
|
+
current_ws = os.environ.get("ATERM_WORKSPACE_NAME", "")
|
|
532
|
+
if current_ws and workspace == current_ws and not force:
|
|
533
|
+
print("Warning: injecting into your own session. Did you mean to reply instead? Use --force to proceed.", file=sys.stderr)
|
|
534
|
+
sys.exit(1)
|
|
535
|
+
|
|
483
536
|
# Read inject config
|
|
484
537
|
inject_cfg = {}
|
|
485
538
|
cfg_path = os.path.expanduser("~/.aigentry/config/aterm.json")
|
|
@@ -506,40 +559,72 @@ if ref_flag or len(msg) > auto_ref_threshold:
|
|
|
506
559
|
f.write(msg)
|
|
507
560
|
msg = "[context-ref] Read " + ref_path + " and use it as the source of truth for this task."
|
|
508
561
|
|
|
509
|
-
#
|
|
510
|
-
|
|
562
|
+
# Helper: telepty fallback for external sessions
|
|
563
|
+
def telepty_fallback():
|
|
511
564
|
cmd = ["telepty", "inject"]
|
|
512
565
|
if from_sender:
|
|
513
566
|
cmd += ["--from", from_sender]
|
|
514
567
|
cmd += [workspace, msg]
|
|
515
568
|
os.execvp("telepty", cmd)
|
|
569
|
+
|
|
570
|
+
# Dispatch
|
|
571
|
+
if not ipc_socket:
|
|
572
|
+
telepty_fallback()
|
|
516
573
|
else:
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
payload["force"] = True
|
|
520
|
-
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
574
|
+
# Check if target is an internal aterm workspace before routing
|
|
575
|
+
is_internal = False
|
|
521
576
|
try:
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
577
|
+
qs = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
578
|
+
qs.settimeout(5)
|
|
579
|
+
qs.connect(ipc_socket)
|
|
580
|
+
qs.sendall((json.dumps({"action": "ListWorkspaces"}) + "\n").encode())
|
|
581
|
+
qs.shutdown(socket.SHUT_WR)
|
|
582
|
+
qdata = b""
|
|
527
583
|
while True:
|
|
528
|
-
|
|
529
|
-
if not
|
|
530
|
-
|
|
531
|
-
if b"\n" in
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
584
|
+
qchunk = qs.recv(4096)
|
|
585
|
+
if not qchunk: break
|
|
586
|
+
qdata += qchunk
|
|
587
|
+
if b"\n" in qdata: break
|
|
588
|
+
qs.close()
|
|
589
|
+
qresp = json.loads(qdata.decode().strip().split("\n")[0])
|
|
590
|
+
internal_names = set()
|
|
591
|
+
for ws_entry in qresp.get("data", []):
|
|
592
|
+
n = ws_entry.get("name", "") or os.path.basename(ws_entry.get("cwd", "")) or ws_entry.get("id", "")
|
|
593
|
+
if n:
|
|
594
|
+
internal_names.add(n)
|
|
595
|
+
is_internal = workspace in internal_names
|
|
596
|
+
except:
|
|
597
|
+
is_internal = True # On query failure, assume internal (preserve current behavior)
|
|
598
|
+
|
|
599
|
+
if not is_internal:
|
|
600
|
+
telepty_fallback()
|
|
601
|
+
else:
|
|
602
|
+
payload = {"action": "Inject", "workspace": workspace, "text": msg, "from": os.environ.get("ATERM_WORKSPACE_NAME")}
|
|
603
|
+
if force:
|
|
604
|
+
payload["force"] = True
|
|
605
|
+
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
606
|
+
try:
|
|
607
|
+
sock.settimeout(5)
|
|
608
|
+
sock.connect(ipc_socket)
|
|
609
|
+
sock.sendall((json.dumps(payload) + "\n").encode())
|
|
610
|
+
sock.shutdown(socket.SHUT_WR)
|
|
611
|
+
data = b""
|
|
612
|
+
while True:
|
|
613
|
+
chunk = sock.recv(4096)
|
|
614
|
+
if not chunk: break
|
|
615
|
+
data += chunk
|
|
616
|
+
if b"\n" in data: break
|
|
617
|
+
resp = json.loads(data.decode().strip().split("\n")[0])
|
|
618
|
+
if resp.get("status") == "Error":
|
|
619
|
+
print(json.dumps({"error": resp["message"]}), file=sys.stderr)
|
|
620
|
+
sys.exit(1)
|
|
621
|
+
else:
|
|
622
|
+
print(json.dumps({"status": "ok"}))
|
|
623
|
+
except Exception as e:
|
|
624
|
+
print(json.dumps({"error": str(e)}), file=sys.stderr)
|
|
535
625
|
sys.exit(1)
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
except Exception as e:
|
|
539
|
-
print(json.dumps({"error": str(e)}), file=sys.stderr)
|
|
540
|
-
sys.exit(1)
|
|
541
|
-
finally:
|
|
542
|
-
sock.close()
|
|
626
|
+
finally:
|
|
627
|
+
sock.close()
|
|
543
628
|
' "$_force_flag" "$_no_report" "$_ref_flag" "$_from_sender" "${ATERM_IPC_SOCKET:-}" "${_inject_args[@]}" ;;
|
|
544
629
|
status)
|
|
545
630
|
if [ "$#" -eq 1 ]; then
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<dict>
|
|
7
7
|
<key>Resources/bin/aterm</key>
|
|
8
8
|
<data>
|
|
9
|
-
|
|
9
|
+
3wZHfO4XK+8V4zkUYzDZ92a5+uc=
|
|
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
|
+
Dz9Gql645Qy+J+gLoCOkCAg0Aog=
|
|
19
19
|
</data>
|
|
20
20
|
<key>requirement</key>
|
|
21
|
-
<string>cdhash H"
|
|
21
|
+
<string>cdhash H"0f3f46aa5eb8e50cbe27e80ba023a40808340288"</string>
|
|
22
22
|
</dict>
|
|
23
23
|
<key>Resources/bin/aterm</key>
|
|
24
24
|
<dict>
|
|
25
25
|
<key>hash2</key>
|
|
26
26
|
<data>
|
|
27
|
-
|
|
27
|
+
w3AZLTbFJCOTFvjW1mT6wcWYHl+wSZUF7BLtunpniQg=
|
|
28
28
|
</data>
|
|
29
29
|
</dict>
|
|
30
30
|
</dict>
|