@dmsdc-ai/aigentry-telepty 0.1.96 → 0.1.98
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.
- package/cli.js +16 -8
- package/daemon.js +68 -25
- package/package.json +4 -4
- package/session-state.js +154 -51
- package/skills/telepty/SKILL.md +39 -118
- package/skills/telepty-allow/SKILL.md +78 -0
- package/skills/telepty-attach/SKILL.md +52 -0
- package/skills/telepty-broadcast/SKILL.md +63 -0
- package/skills/telepty-daemon/SKILL.md +94 -0
- package/skills/telepty-inject/SKILL.md +93 -0
- package/skills/telepty-list/SKILL.md +81 -0
- package/skills/telepty-listen/SKILL.md +86 -0
- package/skills/telepty-rename/SKILL.md +63 -0
- package/skills/telepty-session/SKILL.md +83 -0
- package/specs/codex-inject-spec.md +201 -0
- package/src/mailbox/config.js +4 -0
- package/src/mailbox/delivery.js +93 -32
- package/src/mailbox/index.js +11 -0
- package/src/mailbox/storage.js +84 -5
package/skills/telepty/SKILL.md
CHANGED
|
@@ -1,140 +1,61 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: telepty
|
|
3
|
-
description:
|
|
3
|
+
description: Overview of telepty — PTY multiplexer for AI session orchestration. Use this when user asks "what is telepty" or needs a getting-started guide.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# telepty
|
|
6
|
+
# telepty — Overview
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
telepty is a PTY multiplexer and session orchestrator. It creates, connects, and controls multiple AI CLI sessions (Claude, Gemini, Codex) from a single terminal.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## Default approach
|
|
13
|
-
|
|
14
|
-
- For interactive human guidance, prefer LLM CLI prompt examples first, then the `telepty` TUI, and only then raw commands.
|
|
15
|
-
- When explaining telepty usage to a user, always lead with a skill-style or natural-language example first.
|
|
16
|
-
- Only show raw CLI commands after the skill-style example, as the secondary option.
|
|
17
|
-
- For agent execution inside a CLI session, run the underlying `telepty` command directly.
|
|
18
|
-
- When the request is about a broken or duplicated local daemon, repair the daemon before doing session work.
|
|
19
|
-
|
|
20
|
-
## User-facing response order
|
|
21
|
-
|
|
22
|
-
When the user asks how to do something with telepty, respond in this order:
|
|
23
|
-
|
|
24
|
-
1. Show a plain-language or skill-style example first.
|
|
25
|
-
2. Then show the matching CLI command.
|
|
26
|
-
3. Keep maintenance commands behind the user-facing flow unless the user is clearly operating as a CLI power user.
|
|
27
|
-
|
|
28
|
-
Example:
|
|
29
|
-
|
|
30
|
-
- Skill-style example: "telepty에서 해당 세션에 붙어줘" 또는 "telepty에서 로컬 데몬 복구해줘"
|
|
31
|
-
- CLI follow-up: `telepty attach <session_id>` 또는 `telepty cleanup-daemons`
|
|
32
|
-
|
|
33
|
-
## Common actions
|
|
34
|
-
|
|
35
|
-
1. Check whether the current shell is already inside a telepty session:
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
echo "$TELEPTY_SESSION_ID"
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
2. Inspect active sessions:
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
telepty list
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
3. Attach to a room:
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
telepty attach <session_id>
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
4. Inject a command or prompt:
|
|
10
|
+
## Quick Start
|
|
54
11
|
|
|
55
12
|
```bash
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
When the same session ID exists on multiple hosts, use `session_id@host`.
|
|
60
|
-
|
|
61
|
-
**Return address rule**: If you expect a reply from the target session, you MUST include your own session ID in the inject message so the recipient knows where to send the response:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
telepty inject <target_session_id> "your message here. 응답은 telepty inject <your_session_id> 로 보내줘."
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Your session ID is available via `echo $TELEPTY_SESSION_ID`.
|
|
68
|
-
|
|
69
|
-
**Reliable inject pattern (2-step)**: Some CLIs (e.g. codex) do not submit on `\r` alone. For reliable delivery, use the REST API in two steps:
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
TOKEN=$(cat ~/.telepty/config.json | grep authToken | cut -d '"' -f 4)
|
|
73
|
-
# Step 1: send content without enter
|
|
74
|
-
curl -s -X POST "http://127.0.0.1:3848/api/sessions/<target_id>/inject" \
|
|
75
|
-
-H "Content-Type: application/json" -H "x-telepty-token: $TOKEN" \
|
|
76
|
-
-d '{"prompt": "<content>", "no_enter": true}'
|
|
77
|
-
# Step 2: send enter separately
|
|
78
|
-
curl -s -X POST "http://127.0.0.1:3848/api/sessions/<target_id>/inject" \
|
|
79
|
-
-H "Content-Type: application/json" -H "x-telepty-token: $TOKEN" \
|
|
80
|
-
-d '{"prompt": "\n"}'
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
5. Allow inject on a local CLI:
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
telepty allow --id <session_id> <command> [args...]
|
|
87
|
-
```
|
|
13
|
+
# Start daemon
|
|
14
|
+
telepty daemon
|
|
88
15
|
|
|
89
|
-
|
|
16
|
+
# Create a session wrapping Claude Code
|
|
17
|
+
telepty allow --id my-session claude
|
|
90
18
|
|
|
91
|
-
|
|
92
|
-
telepty
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
7. Listen to the event bus:
|
|
19
|
+
# Send a message to the session
|
|
20
|
+
telepty inject my-session "analyze the auth module"
|
|
96
21
|
|
|
97
|
-
|
|
98
|
-
telepty
|
|
99
|
-
```
|
|
22
|
+
# List all sessions
|
|
23
|
+
telepty list
|
|
100
24
|
|
|
101
|
-
|
|
25
|
+
# Attach to a session interactively
|
|
26
|
+
telepty attach my-session
|
|
102
27
|
|
|
103
|
-
|
|
104
|
-
telepty
|
|
28
|
+
# Open TUI dashboard
|
|
29
|
+
telepty tui
|
|
105
30
|
```
|
|
106
31
|
|
|
107
|
-
##
|
|
108
|
-
|
|
109
|
-
When the user reports any of these symptoms, repair the local daemon first:
|
|
32
|
+
## Core Concepts
|
|
110
33
|
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
34
|
+
- **Session**: A PTY-wrapped CLI process managed by telepty (spawned or wrapped via `allow`)
|
|
35
|
+
- **Daemon**: Background HTTP/WS server on port 3848 managing all sessions
|
|
36
|
+
- **Inject**: Send text to a session's PTY input
|
|
37
|
+
- **Allow-bridge**: Wraps an existing CLI for remote control via telepty
|
|
115
38
|
|
|
116
|
-
|
|
39
|
+
## Environment
|
|
117
40
|
|
|
118
|
-
|
|
41
|
+
- `TELEPTY_SESSION_ID` — set inside telepty-managed sessions; use to identify yourself
|
|
42
|
+
- `TELEPTY_AVAILABLE=true` — set when running inside a telepty allow session
|
|
119
43
|
|
|
120
|
-
|
|
44
|
+
## Default Approach
|
|
121
45
|
|
|
122
|
-
|
|
46
|
+
- For humans: prefer natural-language examples and TUI, then raw CLI commands
|
|
47
|
+
- For AI agents: use raw `telepty` commands directly for execution
|
|
48
|
+
- When daemon is broken: repair first with `telepty cleanup-daemons && telepty daemon`
|
|
123
49
|
|
|
124
|
-
|
|
125
|
-
telepty cleanup-daemons
|
|
126
|
-
telepty daemon
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
If the daemon still does not come up, rerun the installer.
|
|
130
|
-
|
|
131
|
-
## Notes
|
|
132
|
-
|
|
133
|
-
- `TELEPTY_SESSION_ID` is only set inside telepty-managed sessions.
|
|
134
|
-
- For non-interactive `telepty allow` use cases, set terminal dimensions if the environment does not provide them:
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
COLUMNS=120 LINES=40 telepty allow --id <session_id> <command>
|
|
138
|
-
```
|
|
50
|
+
## Related Skills
|
|
139
51
|
|
|
140
|
-
|
|
52
|
+
Each telepty feature has its own detailed skill:
|
|
53
|
+
- `telepty-inject` — send messages to sessions
|
|
54
|
+
- `telepty-allow` — create and manage sessions
|
|
55
|
+
- `telepty-list` — discover sessions and check status
|
|
56
|
+
- `telepty-attach` — attach interactively to a session
|
|
57
|
+
- `telepty-broadcast` — send to multiple sessions
|
|
58
|
+
- `telepty-daemon` — daemon management, repair, update
|
|
59
|
+
- `telepty-rename` — rename, delete, clean sessions
|
|
60
|
+
- `telepty-listen` — monitor events and read screen
|
|
61
|
+
- `telepty-session` — multi-session start and layout
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: telepty-allow
|
|
3
|
+
description: Create telepty sessions by wrapping CLI processes. Covers the allow/enable/wrap command for session creation and PTY management.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# telepty-allow — Create and Manage Sessions
|
|
7
|
+
|
|
8
|
+
## allow — Wrap a CLI for remote control
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
telepty allow --id <session_id> <command> [args...]
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Natural-language: "세션 만들어줘", "create a new Claude session", "wrap this CLI"
|
|
15
|
+
|
|
16
|
+
Wraps a CLI process (Claude, Gemini, Codex, or any command) so telepty can inject messages, monitor output, and manage it remotely.
|
|
17
|
+
|
|
18
|
+
### Options
|
|
19
|
+
|
|
20
|
+
| Flag | Description |
|
|
21
|
+
|------|-------------|
|
|
22
|
+
| `--id <name>` | Session identifier (required) |
|
|
23
|
+
| `--auto-restart` | Automatically restart if the CLI crashes (up to 3 times) |
|
|
24
|
+
|
|
25
|
+
### Examples
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Wrap Claude Code
|
|
29
|
+
telepty allow --id my-claude claude
|
|
30
|
+
|
|
31
|
+
# Wrap Gemini CLI
|
|
32
|
+
telepty allow --id my-gemini gemini
|
|
33
|
+
|
|
34
|
+
# Wrap Codex with auto-restart
|
|
35
|
+
telepty allow --id my-codex --auto-restart codex
|
|
36
|
+
|
|
37
|
+
# Wrap any command
|
|
38
|
+
telepty allow --id my-shell bash
|
|
39
|
+
|
|
40
|
+
# Non-interactive (headless) — set terminal dimensions
|
|
41
|
+
COLUMNS=120 LINES=40 telepty allow --id headless-session claude
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### What happens
|
|
45
|
+
|
|
46
|
+
1. Daemon auto-starts if not running
|
|
47
|
+
2. Session registers with daemon via WebSocket
|
|
48
|
+
3. Child process spawns in a PTY (preserves isTTY, env, shell config)
|
|
49
|
+
4. Allow-bridge relays: daemon WS inject → child PTY write
|
|
50
|
+
5. Output streams back to daemon for monitoring
|
|
51
|
+
6. Prompt-ready detection gates inject delivery (safe idle-aware injection)
|
|
52
|
+
|
|
53
|
+
### Environment inside the session
|
|
54
|
+
|
|
55
|
+
| Variable | Value |
|
|
56
|
+
|----------|-------|
|
|
57
|
+
| `TELEPTY_SESSION_ID` | The session ID you specified |
|
|
58
|
+
| `TELEPTY_AVAILABLE` | `true` |
|
|
59
|
+
|
|
60
|
+
### Aliases
|
|
61
|
+
|
|
62
|
+
`telepty enable` and `telepty wrap` are aliases for `telepty allow`.
|
|
63
|
+
|
|
64
|
+
## spawn — Create a daemon-managed PTY session
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
telepty spawn --id <session_id> --command <cmd>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Creates a session managed entirely by the daemon (no allow-bridge). Useful for background processes.
|
|
71
|
+
|
|
72
|
+
## Common Errors
|
|
73
|
+
|
|
74
|
+
| Error | Cause | Fix |
|
|
75
|
+
|-------|-------|-----|
|
|
76
|
+
| `Failed to start daemon` | Port 3848 in use or permission issue | `telepty cleanup-daemons` then retry |
|
|
77
|
+
| `Session ID already active` | Duplicate ID | Use a different ID or delete the existing session |
|
|
78
|
+
| `Terminal input interrupted` | PTY EIO error | Session auto-recovers; restart if persistent |
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: telepty-attach
|
|
3
|
+
description: Attach interactively to a telepty session to view output and send input in real-time.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# telepty-attach — Interactive Session Attachment
|
|
7
|
+
|
|
8
|
+
## attach — Connect to a session
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
telepty attach <session_id>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Natural-language: "세션에 붙어줘", "attach to my claude session", "show me what's happening in that session"
|
|
15
|
+
|
|
16
|
+
Opens an interactive terminal connection to a running session. You see its output in real-time and can type input directly.
|
|
17
|
+
|
|
18
|
+
### Behavior
|
|
19
|
+
|
|
20
|
+
- Multiple viewers can attach to the same session simultaneously
|
|
21
|
+
- The session owner (allow-bridge) receives your input as inject
|
|
22
|
+
- Output is relayed from the session to all attached clients
|
|
23
|
+
- Press `Ctrl+C` to detach (session continues running)
|
|
24
|
+
|
|
25
|
+
### Examples
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Attach to a local session
|
|
29
|
+
telepty attach my-claude
|
|
30
|
+
|
|
31
|
+
# Attach to a remote session
|
|
32
|
+
telepty attach analyst-claude@remote-host
|
|
33
|
+
|
|
34
|
+
# Interactive selection (from TUI)
|
|
35
|
+
telepty tui
|
|
36
|
+
# Then select a session and press Enter
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Cross-host attach
|
|
40
|
+
|
|
41
|
+
When the session is on a remote host:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
telepty attach session_id@user@hostname
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Common Errors
|
|
48
|
+
|
|
49
|
+
| Error | Cause | Fix |
|
|
50
|
+
|-------|-------|-----|
|
|
51
|
+
| `Session not found` | Session ID doesn't exist | Check `telepty list` |
|
|
52
|
+
| `Connection closed` | Session ended or daemon restarted | Re-attach after daemon recovers |
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: telepty-broadcast
|
|
3
|
+
description: Send messages to multiple telepty sessions at once. Covers broadcast (all sessions) and multicast (selected targets).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# telepty-broadcast — Multi-Target Messaging
|
|
7
|
+
|
|
8
|
+
## broadcast — Send to ALL sessions
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
telepty broadcast "<message>"
|
|
12
|
+
telepty broadcast --ref "<message>"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Natural-language: "모든 세션에 보내줘", "broadcast to all sessions", "tell everyone to stop"
|
|
16
|
+
|
|
17
|
+
Sends a message to every active local session simultaneously.
|
|
18
|
+
|
|
19
|
+
### Options
|
|
20
|
+
|
|
21
|
+
| Flag | Description |
|
|
22
|
+
|------|-------------|
|
|
23
|
+
| `--from <id>` | Set sender session ID |
|
|
24
|
+
| `--ref` | Store payload in shared file (one file reused for all sessions) |
|
|
25
|
+
| `--ref <file>` | Store file contents in shared reference |
|
|
26
|
+
|
|
27
|
+
### Examples
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Broadcast a message to all sessions
|
|
31
|
+
telepty broadcast "context window 높아지면 /compact 실행해"
|
|
32
|
+
|
|
33
|
+
# Broadcast with shared reference (efficient for large payloads)
|
|
34
|
+
telepty broadcast --ref "review the updated spec at the shared path"
|
|
35
|
+
|
|
36
|
+
# Broadcast file contents
|
|
37
|
+
telepty broadcast --ref ./updated-spec.md "review this updated spec"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## multicast — Send to selected sessions
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
telepty multicast --targets <id1>,<id2>,... "<message>"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Natural-language: "이 세션들에만 보내줘", "send to analyst and brain only"
|
|
47
|
+
|
|
48
|
+
### Examples
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Send to specific sessions
|
|
52
|
+
telepty multicast --targets analyst-claude,brain-claude "coordinate on the auth refactor"
|
|
53
|
+
|
|
54
|
+
# With return address
|
|
55
|
+
telepty multicast --targets analyst-claude,brain-claude "report status" --from orchestrator-claude
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Common Errors
|
|
59
|
+
|
|
60
|
+
| Error | Cause | Fix |
|
|
61
|
+
|-------|-------|-----|
|
|
62
|
+
| `No active sessions` | No sessions running | Start sessions first |
|
|
63
|
+
| `Partial failure` | Some targets unreachable | Check individual session status |
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: telepty-daemon
|
|
3
|
+
description: Manage the telepty daemon — start, stop, repair, update, and TUI dashboard. Use when daemon is broken or needs maintenance.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# telepty-daemon — Daemon Management
|
|
7
|
+
|
|
8
|
+
## daemon — Start the daemon
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
telepty daemon
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Starts the telepty daemon on port 3848. The daemon manages all sessions, handles inject delivery, and serves the HTTP/WS API.
|
|
15
|
+
|
|
16
|
+
The daemon auto-starts when needed (e.g., `telepty allow` starts it automatically). Manual start is rarely needed.
|
|
17
|
+
|
|
18
|
+
## cleanup-daemons — Kill stale daemon processes
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
telepty cleanup-daemons
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Natural-language: "데몬 복구해줘", "fix the broken daemon", "kill stale daemons"
|
|
25
|
+
|
|
26
|
+
Finds and kills ALL telepty daemon processes (by PID file and process scan), then clears the state file. Use this when:
|
|
27
|
+
- `Failed to connect to local daemon` errors
|
|
28
|
+
- Duplicate daemon processes running
|
|
29
|
+
- Version mismatch after update
|
|
30
|
+
- Port 3848 already in use
|
|
31
|
+
|
|
32
|
+
### Full recovery sequence
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
telepty cleanup-daemons
|
|
36
|
+
telepty daemon
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## tui — Interactive dashboard
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
telepty tui
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Natural-language: "대시보드 열어줘", "show the TUI", "open dashboard"
|
|
46
|
+
|
|
47
|
+
Opens a blessed-based TUI with session list, health status, and quick actions:
|
|
48
|
+
- `s` — start a new session
|
|
49
|
+
- `k` — kill selected session
|
|
50
|
+
- `p` — purge stale sessions
|
|
51
|
+
- `Enter` — attach to selected session
|
|
52
|
+
|
|
53
|
+
## update — Self-update telepty
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
telepty update
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Runs `npm install -g @dmsdc-ai/aigentry-telepty@latest` and restarts the daemon with the new version.
|
|
60
|
+
|
|
61
|
+
## delete — Remove a session
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
telepty delete <session_id>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Forcefully removes a session from the daemon registry and kills its PTY process.
|
|
68
|
+
|
|
69
|
+
## clean — Remove ghost sessions
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
telepty clean
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Finds and removes sessions with `STALE` or `DISCONNECTED` health status.
|
|
76
|
+
|
|
77
|
+
## API Health Check
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
curl http://127.0.0.1:3848/api/health
|
|
81
|
+
# → {"status":"ok","version":"0.1.96"}
|
|
82
|
+
|
|
83
|
+
curl http://127.0.0.1:3848/api/meta
|
|
84
|
+
# → {"name":"...","version":"...","capabilities":[...],"pid":...}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Common Errors
|
|
88
|
+
|
|
89
|
+
| Error | Cause | Fix |
|
|
90
|
+
|-------|-------|-----|
|
|
91
|
+
| `Port 3848 already in use` | Another daemon or process on port | `telepty cleanup-daemons` |
|
|
92
|
+
| `Daemon version mismatch` | Old daemon after npm update | Auto-restarts; if stuck: `telepty cleanup-daemons && telepty daemon` |
|
|
93
|
+
| `ECONNREFUSED` | Daemon not running | `telepty daemon` |
|
|
94
|
+
| `Singleton lock held` | Another daemon owns the lock | `telepty cleanup-daemons` |
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: telepty-inject
|
|
3
|
+
description: Send messages, commands, and keystrokes to telepty sessions. Covers inject, enter, send-key, and reply commands.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# telepty-inject — Send Messages to Sessions
|
|
7
|
+
|
|
8
|
+
## inject — Send text to a session
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
telepty inject <session_id> "<prompt text>"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Natural-language: "이 세션에 메시지 보내줘", "send this to the analyst session"
|
|
15
|
+
|
|
16
|
+
### Options
|
|
17
|
+
|
|
18
|
+
| Flag | Description |
|
|
19
|
+
|------|-------------|
|
|
20
|
+
| `--from <id>` | Set sender session ID (auto-set inside telepty sessions via `$TELEPTY_SESSION_ID`) |
|
|
21
|
+
| `--reply-to <id>` | Set reply-to address (defaults to `--from`) |
|
|
22
|
+
| `--submit` | Use terminal-level Enter (osascript/cmux) instead of PTY CR |
|
|
23
|
+
| `--ref` | Store payload in shared file, inject only a pointer prompt |
|
|
24
|
+
| `--ref <file>` | Store file contents + message in shared file |
|
|
25
|
+
| `--reply-expected` | Mark that you expect a reply from the target |
|
|
26
|
+
|
|
27
|
+
### Examples
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Basic inject
|
|
31
|
+
telepty inject my-claude "analyze the auth module"
|
|
32
|
+
|
|
33
|
+
# With return address (so target knows where to reply)
|
|
34
|
+
telepty inject analyst-claude "review this PR. 응답은 telepty inject orchestrator-claude 로 보내줘." --from orchestrator-claude
|
|
35
|
+
|
|
36
|
+
# Large payload via shared reference file
|
|
37
|
+
telepty inject brain-claude --ref "analyze this codebase for security issues"
|
|
38
|
+
|
|
39
|
+
# Inject file contents
|
|
40
|
+
telepty inject analyst-claude --ref ./report.md "summarize this report"
|
|
41
|
+
|
|
42
|
+
# Inject with terminal-level submit (for CLIs that need it)
|
|
43
|
+
telepty inject codex-session "fix the build" --submit
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Return Address Rule
|
|
47
|
+
|
|
48
|
+
If you expect a reply, ALWAYS include `--from` so the target knows where to respond:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
telepty inject <target> "your message" --from $(echo $TELEPTY_SESSION_ID)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Cross-host inject
|
|
55
|
+
|
|
56
|
+
When the same session ID exists on multiple hosts:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
telepty inject session_id@remote-host "message"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## enter — Send Enter keystroke only
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
telepty enter <session_id>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Sends a bare Enter to the session. Useful when text was injected with `no_enter` and you need to submit separately.
|
|
69
|
+
|
|
70
|
+
## send-key — Send terminal-level keystroke
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
telepty send-key <session_id> [key]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Sends a terminal-level keystroke (default: Enter) via osascript or cmux backend. Bypasses PTY entirely.
|
|
77
|
+
|
|
78
|
+
## reply — Reply to the last inject sender
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
telepty reply "<message>"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Automatically targets the session that last injected into yours (uses stored `lastInjectFrom`).
|
|
85
|
+
|
|
86
|
+
## Common Errors
|
|
87
|
+
|
|
88
|
+
| Error | Cause | Fix |
|
|
89
|
+
|-------|-------|-----|
|
|
90
|
+
| `Session not found` | Target session doesn't exist | Check `telepty list` |
|
|
91
|
+
| `Session owner is disconnected` | allow-bridge not running | Restart the target session |
|
|
92
|
+
| `STALE` | Session idle too long | Restart or clean: `telepty clean` |
|
|
93
|
+
| `DELIVERY_REJECTED` | Target rejected the payload | Check target session logs |
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: telepty-list
|
|
3
|
+
description: Discover telepty sessions, check status and health. Covers list, session info, and status commands.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# telepty-list — Discover Sessions and Check Status
|
|
7
|
+
|
|
8
|
+
## list — Show all active sessions
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
telepty list
|
|
12
|
+
telepty list --json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Natural-language: "세션 목록 보여줘", "what sessions are running", "show active sessions"
|
|
16
|
+
|
|
17
|
+
### Output fields
|
|
18
|
+
|
|
19
|
+
| Field | Description |
|
|
20
|
+
|-------|-------------|
|
|
21
|
+
| ID | Session identifier |
|
|
22
|
+
| Host | `Local` or remote hostname |
|
|
23
|
+
| Command | The wrapped CLI command |
|
|
24
|
+
| Status | `CONNECTED`, `DISCONNECTED`, `STALE` |
|
|
25
|
+
| Terminal | `ghostty`, `kitty`, `aterm`, `daemon-pty` |
|
|
26
|
+
| Clients | Number of attached viewers |
|
|
27
|
+
| CWD | Working directory |
|
|
28
|
+
|
|
29
|
+
### Examples
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Human-readable list
|
|
33
|
+
telepty list
|
|
34
|
+
|
|
35
|
+
# JSON output (for scripting)
|
|
36
|
+
telepty list --json
|
|
37
|
+
|
|
38
|
+
# Pipe to jq for filtering
|
|
39
|
+
telepty list --json | jq '.[] | select(.healthStatus == "CONNECTED")'
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## session info — Detailed session information
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
telepty session info <session_id>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Shows detailed metadata including terminal type, delivery endpoint, semantic state, and transport info.
|
|
49
|
+
|
|
50
|
+
## status — Quick health check
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
telepty status <session_id>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Returns session health status: `CONNECTED`, `DISCONNECTED`, or `STALE` with reason codes.
|
|
57
|
+
|
|
58
|
+
### Health Status Reference
|
|
59
|
+
|
|
60
|
+
| Status | Reason | Meaning |
|
|
61
|
+
|--------|--------|---------|
|
|
62
|
+
| `CONNECTED` | `OWNER_CONNECTED` | Allow-bridge active |
|
|
63
|
+
| `CONNECTED` | `DELIVERY_ENDPOINT_AVAILABLE` | aterm UDS socket reachable |
|
|
64
|
+
| `CONNECTED` | `PTY_RUNNING` | Daemon-managed PTY alive |
|
|
65
|
+
| `DISCONNECTED` | `OWNER_DISCONNECTED` | Allow-bridge lost connection |
|
|
66
|
+
| `STALE` | `OWNER_DISCONNECTED_STALE` | Disconnected > 60s |
|
|
67
|
+
|
|
68
|
+
## status-report — Publish semantic self-report
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
telepty status-report --phase <phase> [--task "<task>"] [--blocker "<blocker>"]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Publishes a semantic state report for the current session to the event bus.
|
|
75
|
+
|
|
76
|
+
## Common Errors
|
|
77
|
+
|
|
78
|
+
| Error | Cause | Fix |
|
|
79
|
+
|-------|-------|-----|
|
|
80
|
+
| `No active sessions found` | Daemon not running or no sessions | Start daemon: `telepty daemon` |
|
|
81
|
+
| `Failed to discover sessions` | Network/daemon issue | Check `telepty cleanup-daemons` |
|