@ai-devkit/agent-manager 0.16.0 → 0.18.0
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/.swcrc +27 -0
- package/dist/AgentManager.js +72 -74
- package/dist/AgentManager.js.map +1 -1
- package/dist/__tests__/AgentManager.test.js +564 -0
- package/dist/__tests__/AgentManager.test.js.map +1 -0
- package/dist/__tests__/adapters/ClaudeCodeAdapter.test.js +2157 -0
- package/dist/__tests__/adapters/ClaudeCodeAdapter.test.js.map +1 -0
- package/dist/__tests__/adapters/CodexAdapter.test.js +1419 -0
- package/dist/__tests__/adapters/CodexAdapter.test.js.map +1 -0
- package/dist/__tests__/adapters/CopilotAdapter.test.js +500 -0
- package/dist/__tests__/adapters/CopilotAdapter.test.js.map +1 -0
- package/dist/__tests__/adapters/GeminiCliAdapter.test.js +1229 -0
- package/dist/__tests__/adapters/GeminiCliAdapter.test.js.map +1 -0
- package/dist/__tests__/adapters/OpenCodeAdapter.test.js +626 -0
- package/dist/__tests__/adapters/OpenCodeAdapter.test.js.map +1 -0
- package/dist/__tests__/adapters/PiAdapter.test.js +590 -0
- package/dist/__tests__/adapters/PiAdapter.test.js.map +1 -0
- package/dist/__tests__/terminal/TmuxManager.test.js +159 -0
- package/dist/__tests__/terminal/TmuxManager.test.js.map +1 -0
- package/dist/__tests__/terminal/TtyWriter.test.js +162 -0
- package/dist/__tests__/terminal/TtyWriter.test.js.map +1 -0
- package/dist/__tests__/utils/AgentRegistry.test.js +282 -0
- package/dist/__tests__/utils/AgentRegistry.test.js.map +1 -0
- package/dist/__tests__/utils/ClaudeSessionParser.test.js +312 -0
- package/dist/__tests__/utils/ClaudeSessionParser.test.js.map +1 -0
- package/dist/__tests__/utils/matching.test.js +324 -0
- package/dist/__tests__/utils/matching.test.js.map +1 -0
- package/dist/__tests__/utils/process.test.js +177 -0
- package/dist/__tests__/utils/process.test.js.map +1 -0
- package/dist/__tests__/utils/session.test.js +158 -0
- package/dist/__tests__/utils/session.test.js.map +1 -0
- package/dist/adapters/AgentAdapter.d.ts +1 -1
- package/dist/adapters/AgentAdapter.d.ts.map +1 -1
- package/dist/adapters/AgentAdapter.js +8 -7
- package/dist/adapters/AgentAdapter.js.map +1 -1
- package/dist/adapters/ClaudeCodeAdapter.js +66 -77
- package/dist/adapters/ClaudeCodeAdapter.js.map +1 -1
- package/dist/adapters/CodexAdapter.d.ts +13 -0
- package/dist/adapters/CodexAdapter.d.ts.map +1 -1
- package/dist/adapters/CodexAdapter.js +225 -141
- package/dist/adapters/CodexAdapter.js.map +1 -1
- package/dist/adapters/CopilotAdapter.d.ts +44 -0
- package/dist/adapters/CopilotAdapter.d.ts.map +1 -0
- package/dist/adapters/CopilotAdapter.js +314 -0
- package/dist/adapters/CopilotAdapter.js.map +1 -0
- package/dist/adapters/GeminiCliAdapter.d.ts +2 -0
- package/dist/adapters/GeminiCliAdapter.d.ts.map +1 -1
- package/dist/adapters/GeminiCliAdapter.js +138 -156
- package/dist/adapters/GeminiCliAdapter.js.map +1 -1
- package/dist/adapters/OpenCodeAdapter.js +60 -69
- package/dist/adapters/OpenCodeAdapter.js.map +1 -1
- package/dist/adapters/PiAdapter.d.ts +62 -0
- package/dist/adapters/PiAdapter.d.ts.map +1 -0
- package/dist/adapters/PiAdapter.js +450 -0
- package/dist/adapters/PiAdapter.js.map +1 -0
- package/dist/adapters/index.d.ts +2 -0
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +3 -0
- package/dist/adapters/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/terminal/TerminalFocusManager.js +62 -49
- package/dist/terminal/TerminalFocusManager.js.map +1 -1
- package/dist/terminal/TmuxManager.js +59 -34
- package/dist/terminal/TmuxManager.js.map +1 -1
- package/dist/terminal/TtyWriter.js +37 -16
- package/dist/terminal/TtyWriter.js.map +1 -1
- package/dist/terminal/index.js +1 -0
- package/dist/terminal/index.js.map +1 -1
- package/dist/utils/AgentRegistry.js +41 -32
- package/dist/utils/AgentRegistry.js.map +1 -1
- package/dist/utils/ClaudeSessionParser.js +46 -87
- package/dist/utils/ClaudeSessionParser.js.map +1 -1
- package/dist/utils/agents.d.ts +1 -1
- package/dist/utils/agents.d.ts.map +1 -1
- package/dist/utils/agents.js +22 -11
- package/dist/utils/agents.js.map +1 -1
- package/dist/utils/applescript.js +3 -6
- package/dist/utils/applescript.js.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/matching.js +21 -29
- package/dist/utils/matching.js.map +1 -1
- package/dist/utils/process.js +77 -56
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/session.js +20 -34
- package/dist/utils/session.js.map +1 -1
- package/dist/utils/sortAgents.js +6 -8
- package/dist/utils/sortAgents.js.map +1 -1
- package/package.json +11 -7
- package/src/__tests__/adapters/ClaudeCodeAdapter.test.ts +2 -0
- package/src/__tests__/adapters/CodexAdapter.test.ts +145 -0
- package/src/__tests__/adapters/CopilotAdapter.test.ts +411 -0
- package/src/__tests__/adapters/GeminiCliAdapter.test.ts +74 -1
- package/src/__tests__/adapters/PiAdapter.test.ts +435 -0
- package/src/adapters/AgentAdapter.ts +1 -1
- package/src/adapters/CodexAdapter.ts +164 -6
- package/src/adapters/CopilotAdapter.ts +453 -0
- package/src/adapters/GeminiCliAdapter.ts +42 -3
- package/src/adapters/PiAdapter.ts +597 -0
- package/src/adapters/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/utils/agents.ts +1 -1
|
@@ -3,18 +3,17 @@ import { promisify } from 'util';
|
|
|
3
3
|
import { getProcessTty } from '../utils/process.js';
|
|
4
4
|
import { escapeAppleScript } from '../utils/applescript.js';
|
|
5
5
|
const execFileAsync = promisify(execFile);
|
|
6
|
-
export var TerminalType
|
|
7
|
-
(function (TerminalType) {
|
|
6
|
+
export var TerminalType = /*#__PURE__*/ function(TerminalType) {
|
|
8
7
|
TerminalType["TMUX"] = "tmux";
|
|
9
8
|
TerminalType["ITERM2"] = "iterm2";
|
|
10
9
|
TerminalType["TERMINAL_APP"] = "terminal-app";
|
|
11
10
|
TerminalType["UNKNOWN"] = "unknown";
|
|
12
|
-
|
|
11
|
+
return TerminalType;
|
|
12
|
+
}({});
|
|
13
13
|
export class TerminalFocusManager {
|
|
14
14
|
/**
|
|
15
15
|
* Find the terminal location (emulator info) for a given process ID
|
|
16
|
-
*/
|
|
17
|
-
async findTerminal(pid) {
|
|
16
|
+
*/ async findTerminal(pid) {
|
|
18
17
|
const ttyShort = getProcessTty(pid);
|
|
19
18
|
// If no TTY or invalid, we can't find the terminal
|
|
20
19
|
if (!ttyShort || ttyShort === '?') {
|
|
@@ -23,73 +22,71 @@ export class TerminalFocusManager {
|
|
|
23
22
|
const fullTty = `/dev/${ttyShort}`;
|
|
24
23
|
// 1. Check tmux (most specific if running inside it)
|
|
25
24
|
const tmuxLocation = await this.findTmuxPane(fullTty);
|
|
26
|
-
if (tmuxLocation)
|
|
27
|
-
return tmuxLocation;
|
|
25
|
+
if (tmuxLocation) return tmuxLocation;
|
|
28
26
|
// 2. Check iTerm2
|
|
29
27
|
const itermLocation = await this.findITerm2Session(fullTty);
|
|
30
|
-
if (itermLocation)
|
|
31
|
-
return itermLocation;
|
|
28
|
+
if (itermLocation) return itermLocation;
|
|
32
29
|
// 3. Check Terminal.app
|
|
33
30
|
const terminalAppLocation = await this.findTerminalAppWindow(fullTty);
|
|
34
|
-
if (terminalAppLocation)
|
|
35
|
-
return terminalAppLocation;
|
|
31
|
+
if (terminalAppLocation) return terminalAppLocation;
|
|
36
32
|
// 4. Fallback: we know the TTY but not the emulator wrapper
|
|
37
33
|
return {
|
|
38
|
-
type:
|
|
34
|
+
type: "unknown",
|
|
39
35
|
identifier: '',
|
|
40
36
|
tty: fullTty
|
|
41
37
|
};
|
|
42
38
|
}
|
|
43
39
|
/**
|
|
44
40
|
* Focus the terminal identified by the location
|
|
45
|
-
*/
|
|
46
|
-
async focusTerminal(location) {
|
|
41
|
+
*/ async focusTerminal(location) {
|
|
47
42
|
try {
|
|
48
|
-
switch
|
|
49
|
-
case
|
|
43
|
+
switch(location.type){
|
|
44
|
+
case "tmux":
|
|
50
45
|
return await this.focusTmuxPane(location.identifier);
|
|
51
|
-
case
|
|
46
|
+
case "iterm2":
|
|
52
47
|
return await this.focusITerm2Session(location.tty);
|
|
53
|
-
case
|
|
48
|
+
case "terminal-app":
|
|
54
49
|
return await this.focusTerminalAppWindow(location.tty);
|
|
55
50
|
default:
|
|
56
51
|
return false;
|
|
57
52
|
}
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
53
|
+
} catch {
|
|
60
54
|
return false;
|
|
61
55
|
}
|
|
62
56
|
}
|
|
63
57
|
async findTmuxPane(tty) {
|
|
64
58
|
try {
|
|
65
59
|
const { stdout } = await execFileAsync('tmux', [
|
|
66
|
-
'list-panes',
|
|
60
|
+
'list-panes',
|
|
61
|
+
'-a',
|
|
62
|
+
'-F',
|
|
63
|
+
'#{pane_tty}|#{session_name}:#{window_index}.#{pane_index}'
|
|
67
64
|
]);
|
|
68
65
|
const lines = stdout.trim().split('\n');
|
|
69
|
-
for (const line of lines)
|
|
70
|
-
if (!line.trim())
|
|
71
|
-
continue;
|
|
66
|
+
for (const line of lines){
|
|
67
|
+
if (!line.trim()) continue;
|
|
72
68
|
const [paneTty, identifier] = line.split('|');
|
|
73
69
|
if (paneTty === tty && identifier) {
|
|
74
70
|
return {
|
|
75
|
-
type:
|
|
71
|
+
type: "tmux",
|
|
76
72
|
identifier,
|
|
77
73
|
tty
|
|
78
74
|
};
|
|
79
75
|
}
|
|
80
76
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// tmux might not be installed or running
|
|
77
|
+
} catch {
|
|
78
|
+
// tmux might not be installed or running
|
|
84
79
|
}
|
|
85
80
|
return null;
|
|
86
81
|
}
|
|
87
82
|
async findITerm2Session(tty) {
|
|
88
83
|
try {
|
|
89
84
|
// Check if iTerm2 is running first to avoid launching it
|
|
90
|
-
await execFileAsync('pgrep', [
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
await execFileAsync('pgrep', [
|
|
86
|
+
'-x',
|
|
87
|
+
'iTerm2'
|
|
88
|
+
]);
|
|
89
|
+
} catch {
|
|
93
90
|
return null;
|
|
94
91
|
}
|
|
95
92
|
try {
|
|
@@ -107,26 +104,30 @@ export class TerminalFocusManager {
|
|
|
107
104
|
end repeat
|
|
108
105
|
end tell
|
|
109
106
|
`;
|
|
110
|
-
const { stdout } = await execFileAsync('osascript', [
|
|
107
|
+
const { stdout } = await execFileAsync('osascript', [
|
|
108
|
+
'-e',
|
|
109
|
+
script
|
|
110
|
+
]);
|
|
111
111
|
if (stdout.trim() === "found") {
|
|
112
112
|
return {
|
|
113
|
-
type:
|
|
113
|
+
type: "iterm2",
|
|
114
114
|
identifier: tty,
|
|
115
115
|
tty
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// iTerm2 script failed
|
|
118
|
+
} catch {
|
|
119
|
+
// iTerm2 script failed
|
|
121
120
|
}
|
|
122
121
|
return null;
|
|
123
122
|
}
|
|
124
123
|
async findTerminalAppWindow(tty) {
|
|
125
124
|
try {
|
|
126
125
|
// Check if Terminal.app is running
|
|
127
|
-
await execFileAsync('pgrep', [
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
await execFileAsync('pgrep', [
|
|
127
|
+
'-x',
|
|
128
|
+
'Terminal'
|
|
129
|
+
]);
|
|
130
|
+
} catch {
|
|
130
131
|
return null;
|
|
131
132
|
}
|
|
132
133
|
try {
|
|
@@ -142,26 +143,31 @@ export class TerminalFocusManager {
|
|
|
142
143
|
end repeat
|
|
143
144
|
end tell
|
|
144
145
|
`;
|
|
145
|
-
const { stdout } = await execFileAsync('osascript', [
|
|
146
|
+
const { stdout } = await execFileAsync('osascript', [
|
|
147
|
+
'-e',
|
|
148
|
+
script
|
|
149
|
+
]);
|
|
146
150
|
if (stdout.trim() === "found") {
|
|
147
151
|
return {
|
|
148
|
-
type:
|
|
152
|
+
type: "terminal-app",
|
|
149
153
|
identifier: tty,
|
|
150
154
|
tty
|
|
151
155
|
};
|
|
152
156
|
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// Terminal.app script failed
|
|
157
|
+
} catch {
|
|
158
|
+
// Terminal.app script failed
|
|
156
159
|
}
|
|
157
160
|
return null;
|
|
158
161
|
}
|
|
159
162
|
async focusTmuxPane(identifier) {
|
|
160
163
|
try {
|
|
161
|
-
await execFileAsync('tmux', [
|
|
164
|
+
await execFileAsync('tmux', [
|
|
165
|
+
'switch-client',
|
|
166
|
+
'-t',
|
|
167
|
+
identifier
|
|
168
|
+
]);
|
|
162
169
|
return true;
|
|
163
|
-
}
|
|
164
|
-
catch {
|
|
170
|
+
} catch {
|
|
165
171
|
return false;
|
|
166
172
|
}
|
|
167
173
|
}
|
|
@@ -182,7 +188,10 @@ export class TerminalFocusManager {
|
|
|
182
188
|
end repeat
|
|
183
189
|
end tell
|
|
184
190
|
`;
|
|
185
|
-
const { stdout } = await execFileAsync('osascript', [
|
|
191
|
+
const { stdout } = await execFileAsync('osascript', [
|
|
192
|
+
'-e',
|
|
193
|
+
script
|
|
194
|
+
]);
|
|
186
195
|
return stdout.trim() === "true";
|
|
187
196
|
}
|
|
188
197
|
async focusTerminalAppWindow(tty) {
|
|
@@ -201,8 +210,12 @@ export class TerminalFocusManager {
|
|
|
201
210
|
end repeat
|
|
202
211
|
end tell
|
|
203
212
|
`;
|
|
204
|
-
const { stdout } = await execFileAsync('osascript', [
|
|
213
|
+
const { stdout } = await execFileAsync('osascript', [
|
|
214
|
+
'-e',
|
|
215
|
+
script
|
|
216
|
+
]);
|
|
205
217
|
return stdout.trim() === "true";
|
|
206
218
|
}
|
|
207
219
|
}
|
|
220
|
+
|
|
208
221
|
//# sourceMappingURL=TerminalFocusManager.js.map
|
|
@@ -1 +1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;QACpE,OAAO,MAAM,CAAC,IAAI,EAAE,KAAK,MAAM,CAAC;IACpC,CAAC;CACJ"}
|
|
1
|
+
{"version":3,"sources":["../../src/terminal/TerminalFocusManager.ts"],"sourcesContent":["import { execFile } from 'child_process';\nimport { promisify } from 'util';\nimport { getProcessTty } from '../utils/process.js';\nimport { escapeAppleScript } from '../utils/applescript.js';\n\nconst execFileAsync = promisify(execFile);\n\nexport enum TerminalType {\n TMUX = 'tmux',\n ITERM2 = 'iterm2',\n TERMINAL_APP = 'terminal-app',\n UNKNOWN = 'unknown',\n}\n\nexport interface TerminalLocation {\n type: TerminalType;\n identifier: string; // e.g., \"session:window.pane\" for tmux, or TTY for others\n tty: string; // e.g., \"/dev/ttys030\"\n}\n\nexport class TerminalFocusManager {\n /**\n * Find the terminal location (emulator info) for a given process ID\n */\n async findTerminal(pid: number): Promise<TerminalLocation | null> {\n const ttyShort = getProcessTty(pid);\n\n // If no TTY or invalid, we can't find the terminal\n if (!ttyShort || ttyShort === '?') {\n return null;\n }\n\n const fullTty = `/dev/${ttyShort}`;\n\n // 1. Check tmux (most specific if running inside it)\n const tmuxLocation = await this.findTmuxPane(fullTty);\n if (tmuxLocation) return tmuxLocation;\n\n // 2. Check iTerm2\n const itermLocation = await this.findITerm2Session(fullTty);\n if (itermLocation) return itermLocation;\n\n // 3. Check Terminal.app\n const terminalAppLocation = await this.findTerminalAppWindow(fullTty);\n if (terminalAppLocation) return terminalAppLocation;\n\n // 4. Fallback: we know the TTY but not the emulator wrapper\n return {\n type: TerminalType.UNKNOWN,\n identifier: '',\n tty: fullTty\n };\n }\n\n /**\n * Focus the terminal identified by the location\n */\n async focusTerminal(location: TerminalLocation): Promise<boolean> {\n try {\n switch (location.type) {\n case TerminalType.TMUX:\n return await this.focusTmuxPane(location.identifier);\n case TerminalType.ITERM2:\n return await this.focusITerm2Session(location.tty);\n case TerminalType.TERMINAL_APP:\n return await this.focusTerminalAppWindow(location.tty);\n default:\n return false;\n }\n } catch {\n return false;\n }\n }\n\n private async findTmuxPane(tty: string): Promise<TerminalLocation | null> {\n try {\n const { stdout } = await execFileAsync('tmux', [\n 'list-panes', '-a', '-F', '#{pane_tty}|#{session_name}:#{window_index}.#{pane_index}'\n ]);\n\n const lines = stdout.trim().split('\\n');\n for (const line of lines) {\n if (!line.trim()) continue;\n const [paneTty, identifier] = line.split('|');\n if (paneTty === tty && identifier) {\n return {\n type: TerminalType.TMUX,\n identifier,\n tty\n };\n }\n }\n } catch {\n // tmux might not be installed or running\n }\n return null;\n }\n\n private async findITerm2Session(tty: string): Promise<TerminalLocation | null> {\n try {\n // Check if iTerm2 is running first to avoid launching it\n await execFileAsync('pgrep', ['-x', 'iTerm2']);\n } catch {\n return null;\n }\n\n try {\n const escapedTty = escapeAppleScript(tty);\n const script = `\n tell application \"iTerm\"\n repeat with w in windows\n repeat with t in tabs of w\n repeat with s in sessions of t\n if tty of s is \"${escapedTty}\" then\n return \"found\"\n end if\n end repeat\n end repeat\n end repeat\n end tell\n `;\n\n const { stdout } = await execFileAsync('osascript', ['-e', script]);\n if (stdout.trim() === \"found\") {\n return {\n type: TerminalType.ITERM2,\n identifier: tty,\n tty\n };\n }\n } catch {\n // iTerm2 script failed\n }\n return null;\n }\n\n private async findTerminalAppWindow(tty: string): Promise<TerminalLocation | null> {\n try {\n // Check if Terminal.app is running\n await execFileAsync('pgrep', ['-x', 'Terminal']);\n } catch {\n return null;\n }\n\n try {\n const escapedTty = escapeAppleScript(tty);\n const script = `\n tell application \"Terminal\"\n repeat with w in windows\n repeat with t in tabs of w\n if tty of t is \"${escapedTty}\" then\n return \"found\"\n end if\n end repeat\n end repeat\n end tell\n `;\n\n const { stdout } = await execFileAsync('osascript', ['-e', script]);\n if (stdout.trim() === \"found\") {\n return {\n type: TerminalType.TERMINAL_APP,\n identifier: tty,\n tty\n };\n }\n } catch {\n // Terminal.app script failed\n }\n return null;\n }\n\n private async focusTmuxPane(identifier: string): Promise<boolean> {\n try {\n await execFileAsync('tmux', ['switch-client', '-t', identifier]);\n return true;\n } catch {\n return false;\n }\n }\n\n private async focusITerm2Session(tty: string): Promise<boolean> {\n const escapedTty = escapeAppleScript(tty);\n const script = `\n tell application \"iTerm\"\n activate\n repeat with w in windows\n repeat with t in tabs of w\n repeat with s in sessions of t\n if tty of s is \"${escapedTty}\" then\n select s\n return \"true\"\n end if\n end repeat\n end repeat\n end repeat\n end tell\n `;\n const { stdout } = await execFileAsync('osascript', ['-e', script]);\n return stdout.trim() === \"true\";\n }\n\n private async focusTerminalAppWindow(tty: string): Promise<boolean> {\n const escapedTty = escapeAppleScript(tty);\n const script = `\n tell application \"Terminal\"\n activate\n repeat with w in windows\n repeat with t in tabs of w\n if tty of t is \"${escapedTty}\" then\n set index of w to 1\n set selected tab of w to t\n return \"true\"\n end if\n end repeat\n end repeat\n end tell\n `;\n const { stdout } = await execFileAsync('osascript', ['-e', script]);\n return stdout.trim() === \"true\";\n }\n}\n"],"names":["execFile","promisify","getProcessTty","escapeAppleScript","execFileAsync","TerminalType","TerminalFocusManager","findTerminal","pid","ttyShort","fullTty","tmuxLocation","findTmuxPane","itermLocation","findITerm2Session","terminalAppLocation","findTerminalAppWindow","type","identifier","tty","focusTerminal","location","focusTmuxPane","focusITerm2Session","focusTerminalAppWindow","stdout","lines","trim","split","line","paneTty","escapedTty","script"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,iBAAiB,QAAQ,0BAA0B;AAE5D,MAAMC,gBAAgBH,UAAUD;AAEhC,OAAO,IAAA,AAAKK,sCAAAA;;;;;WAAAA;MAKX;AAQD,OAAO,MAAMC;IACT;;KAEC,GACD,MAAMC,aAAaC,GAAW,EAAoC;QAC9D,MAAMC,WAAWP,cAAcM;QAE/B,mDAAmD;QACnD,IAAI,CAACC,YAAYA,aAAa,KAAK;YAC/B,OAAO;QACX;QAEA,MAAMC,UAAU,CAAC,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;;;;KAQvC,CAAC;QACE,MAAM,EAAEN,MAAM,EAAE,GAAG,MAAMrB,cAAc,aAAa;YAAC;YAAM4B;SAAO;QAClE,OAAOP,OAAOE,IAAI,OAAO;IAC7B;IAEA,MAAcH,uBAAuBL,GAAW,EAAoB;QAChE,MAAMY,aAAa5B,kBAAkBgB;QACrC,MAAMa,SAAS,CAAC;;;;;6BAKK,EAAED,WAAW;;;;;;;;IAQtC,CAAC;QACG,MAAM,EAAEN,MAAM,EAAE,GAAG,MAAMrB,cAAc,aAAa;YAAC;YAAM4B;SAAO;QAClE,OAAOP,OAAOE,IAAI,OAAO;IAC7B;AACJ"}
|
|
@@ -4,34 +4,54 @@ const execFileAsync = promisify(execFile);
|
|
|
4
4
|
export class TmuxManager {
|
|
5
5
|
async isAvailable() {
|
|
6
6
|
try {
|
|
7
|
-
await execFileAsync('tmux', [
|
|
7
|
+
await execFileAsync('tmux', [
|
|
8
|
+
'-V'
|
|
9
|
+
]);
|
|
8
10
|
return true;
|
|
9
|
-
}
|
|
10
|
-
catch {
|
|
11
|
+
} catch {
|
|
11
12
|
return false;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
async sessionExists(name) {
|
|
15
16
|
try {
|
|
16
|
-
await execFileAsync('tmux', [
|
|
17
|
+
await execFileAsync('tmux', [
|
|
18
|
+
'has-session',
|
|
19
|
+
'-t',
|
|
20
|
+
name
|
|
21
|
+
]);
|
|
17
22
|
return true;
|
|
18
|
-
}
|
|
19
|
-
catch {
|
|
23
|
+
} catch {
|
|
20
24
|
return false;
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
27
|
async createSession(name, cwd) {
|
|
24
|
-
await execFileAsync('tmux', [
|
|
28
|
+
await execFileAsync('tmux', [
|
|
29
|
+
'new-session',
|
|
30
|
+
'-d',
|
|
31
|
+
'-s',
|
|
32
|
+
name,
|
|
33
|
+
'-c',
|
|
34
|
+
cwd
|
|
35
|
+
]);
|
|
25
36
|
}
|
|
26
37
|
async sendKeys(session, keys) {
|
|
27
|
-
await execFileAsync('tmux', [
|
|
38
|
+
await execFileAsync('tmux', [
|
|
39
|
+
'send-keys',
|
|
40
|
+
'-t',
|
|
41
|
+
session,
|
|
42
|
+
keys,
|
|
43
|
+
'Enter'
|
|
44
|
+
]);
|
|
28
45
|
}
|
|
29
46
|
async killSession(name) {
|
|
30
47
|
try {
|
|
31
|
-
await execFileAsync('tmux', [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
48
|
+
await execFileAsync('tmux', [
|
|
49
|
+
'kill-session',
|
|
50
|
+
'-t',
|
|
51
|
+
name
|
|
52
|
+
]);
|
|
53
|
+
} catch {
|
|
54
|
+
// Already gone — ignore
|
|
35
55
|
}
|
|
36
56
|
}
|
|
37
57
|
/**
|
|
@@ -49,18 +69,17 @@ export class TmuxManager {
|
|
|
49
69
|
*
|
|
50
70
|
* Returns null when no descendant matches yet (agent still starting); the
|
|
51
71
|
* caller's poll loop retries.
|
|
52
|
-
*/
|
|
53
|
-
async findAgentPid(session, matches) {
|
|
72
|
+
*/ async findAgentPid(session, matches) {
|
|
54
73
|
const panePid = await this.getPanePid(session);
|
|
55
|
-
if (panePid === null)
|
|
56
|
-
return null;
|
|
74
|
+
if (panePid === null) return null;
|
|
57
75
|
const visited = new Set();
|
|
58
|
-
const queue = [
|
|
76
|
+
const queue = [
|
|
77
|
+
panePid
|
|
78
|
+
];
|
|
59
79
|
let deepestMatch = null;
|
|
60
|
-
while
|
|
80
|
+
while(queue.length > 0){
|
|
61
81
|
const pid = queue.shift();
|
|
62
|
-
if (visited.has(pid))
|
|
63
|
-
continue;
|
|
82
|
+
if (visited.has(pid)) continue;
|
|
64
83
|
visited.add(pid);
|
|
65
84
|
if (pid !== panePid) {
|
|
66
85
|
const command = await this.getProcessCommand(pid);
|
|
@@ -76,37 +95,43 @@ export class TmuxManager {
|
|
|
76
95
|
async getPanePid(session) {
|
|
77
96
|
try {
|
|
78
97
|
const { stdout } = await execFileAsync('tmux', [
|
|
79
|
-
'list-panes',
|
|
98
|
+
'list-panes',
|
|
99
|
+
'-t',
|
|
100
|
+
session,
|
|
101
|
+
'-F',
|
|
102
|
+
'#{pane_pid}'
|
|
80
103
|
]);
|
|
81
104
|
const panePid = parseInt(stdout.trim().split('\n')[0], 10);
|
|
82
105
|
return isNaN(panePid) ? null : panePid;
|
|
83
|
-
}
|
|
84
|
-
catch {
|
|
106
|
+
} catch {
|
|
85
107
|
return null;
|
|
86
108
|
}
|
|
87
109
|
}
|
|
88
110
|
async pgrepChildren(pid) {
|
|
89
111
|
try {
|
|
90
|
-
const { stdout } = await execFileAsync('pgrep', [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
catch {
|
|
112
|
+
const { stdout } = await execFileAsync('pgrep', [
|
|
113
|
+
'-P',
|
|
114
|
+
String(pid)
|
|
115
|
+
]);
|
|
116
|
+
return stdout.trim().split('\n').map((s)=>parseInt(s, 10)).filter((n)=>!isNaN(n));
|
|
117
|
+
} catch {
|
|
98
118
|
return [];
|
|
99
119
|
}
|
|
100
120
|
}
|
|
101
121
|
async getProcessCommand(pid) {
|
|
102
122
|
try {
|
|
103
|
-
const { stdout } = await execFileAsync('ps', [
|
|
123
|
+
const { stdout } = await execFileAsync('ps', [
|
|
124
|
+
'-p',
|
|
125
|
+
String(pid),
|
|
126
|
+
'-o',
|
|
127
|
+
'command='
|
|
128
|
+
]);
|
|
104
129
|
const trimmed = stdout.trim();
|
|
105
130
|
return trimmed || null;
|
|
106
|
-
}
|
|
107
|
-
catch {
|
|
131
|
+
} catch {
|
|
108
132
|
return null;
|
|
109
133
|
}
|
|
110
134
|
}
|
|
111
135
|
}
|
|
136
|
+
|
|
112
137
|
//# sourceMappingURL=TmuxManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/terminal/TmuxManager.ts"],"sourcesContent":["import { execFile } from 'child_process';\nimport { promisify } from 'util';\n\nconst execFileAsync = promisify(execFile);\n\nexport class TmuxManager {\n async isAvailable(): Promise<boolean> {\n try {\n await execFileAsync('tmux', ['-V']);\n return true;\n } catch {\n return false;\n }\n }\n\n async sessionExists(name: string): Promise<boolean> {\n try {\n await execFileAsync('tmux', ['has-session', '-t', name]);\n return true;\n } catch {\n return false;\n }\n }\n\n async createSession(name: string, cwd: string): Promise<void> {\n await execFileAsync('tmux', ['new-session', '-d', '-s', name, '-c', cwd]);\n }\n\n async sendKeys(session: string, keys: string): Promise<void> {\n await execFileAsync('tmux', ['send-keys', '-t', session, keys, 'Enter']);\n }\n\n async killSession(name: string): Promise<void> {\n try {\n await execFileAsync('tmux', ['kill-session', '-t', name]);\n } catch {\n // Already gone — ignore\n }\n }\n\n /**\n * Find the actual agent process PID inside a tmux pane.\n *\n * Strategy: BFS the process tree, return the deepest descendant whose\n * `ps` command line is accepted by `matches`. The caller supplies the\n * matcher so this method has no agent-type knowledge.\n *\n * This handles two real-world process shapes:\n * - Wrapper case: shell → claude-wrapper (matches) → claude (matches, deeper)\n * → returns the deeper one\n * - Subprocess case: shell → claude (matches) → MCP server child (doesn't match)\n * → returns claude, not the subprocess\n *\n * Returns null when no descendant matches yet (agent still starting); the\n * caller's poll loop retries.\n */\n async findAgentPid(session: string, matches: (psCommand: string) => boolean): Promise<number | null> {\n const panePid = await this.getPanePid(session);\n if (panePid === null) return null;\n\n const visited = new Set<number>();\n const queue: number[] = [panePid];\n let deepestMatch: number | null = null;\n\n while (queue.length > 0) {\n const pid = queue.shift()!;\n if (visited.has(pid)) continue;\n visited.add(pid);\n\n if (pid !== panePid) {\n const command = await this.getProcessCommand(pid);\n if (command && matches(command)) {\n deepestMatch = pid;\n }\n }\n\n const children = await this.pgrepChildren(pid);\n queue.push(...children);\n }\n\n return deepestMatch;\n }\n\n private async getPanePid(session: string): Promise<number | null> {\n try {\n const { stdout } = await execFileAsync('tmux', [\n 'list-panes', '-t', session, '-F', '#{pane_pid}',\n ]);\n const panePid = parseInt(stdout.trim().split('\\n')[0], 10);\n return isNaN(panePid) ? null : panePid;\n } catch {\n return null;\n }\n }\n\n private async pgrepChildren(pid: number): Promise<number[]> {\n try {\n const { stdout } = await execFileAsync('pgrep', ['-P', String(pid)]);\n return stdout\n .trim()\n .split('\\n')\n .map((s) => parseInt(s, 10))\n .filter((n) => !isNaN(n));\n } catch {\n return [];\n }\n }\n\n private async getProcessCommand(pid: number): Promise<string | null> {\n try {\n const { stdout } = await execFileAsync('ps', ['-p', String(pid), '-o', 'command=']);\n const trimmed = stdout.trim();\n return trimmed || null;\n } catch {\n return null;\n }\n }\n}\n"],"names":["execFile","promisify","execFileAsync","TmuxManager","isAvailable","sessionExists","name","createSession","cwd","sendKeys","session","keys","killSession","findAgentPid","matches","panePid","getPanePid","visited","Set","queue","deepestMatch","length","pid","shift","has","add","command","getProcessCommand","children","pgrepChildren","push","stdout","parseInt","trim","split","isNaN","String","map","s","filter","n","trimmed"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,SAAS,QAAQ,OAAO;AAEjC,MAAMC,gBAAgBD,UAAUD;AAEhC,OAAO,MAAMG;IACT,MAAMC,cAAgC;QAClC,IAAI;YACA,MAAMF,cAAc,QAAQ;gBAAC;aAAK;YAClC,OAAO;QACX,EAAE,OAAM;YACJ,OAAO;QACX;IACJ;IAEA,MAAMG,cAAcC,IAAY,EAAoB;QAChD,IAAI;YACA,MAAMJ,cAAc,QAAQ;gBAAC;gBAAe;gBAAMI;aAAK;YACvD,OAAO;QACX,EAAE,OAAM;YACJ,OAAO;QACX;IACJ;IAEA,MAAMC,cAAcD,IAAY,EAAEE,GAAW,EAAiB;QAC1D,MAAMN,cAAc,QAAQ;YAAC;YAAe;YAAM;YAAMI;YAAM;YAAME;SAAI;IAC5E;IAEA,MAAMC,SAASC,OAAe,EAAEC,IAAY,EAAiB;QACzD,MAAMT,cAAc,QAAQ;YAAC;YAAa;YAAMQ;YAASC;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aAAK;YACnE,OAAOS,OACFE,IAAI,GACJC,KAAK,CAAC,MACNG,GAAG,CAAC,CAACC,IAAMN,SAASM,GAAG,KACvBC,MAAM,CAAC,CAACC,IAAM,CAACL,MAAMK;QAC9B,EAAE,OAAM;YACJ,OAAO,EAAE;QACb;IACJ;IAEA,MAAcb,kBAAkBL,GAAW,EAA0B;QACjE,IAAI;YACA,MAAM,EAAES,MAAM,EAAE,GAAG,MAAM7B,cAAc,MAAM;gBAAC;gBAAMkC,OAAOd;gBAAM;gBAAM;aAAW;YAClF,MAAMmB,UAAUV,OAAOE,IAAI;YAC3B,OAAOQ,WAAW;QACtB,EAAE,OAAM;YACJ,OAAO;QACX;IACJ;AACJ"}
|
|
@@ -18,9 +18,8 @@ export class TtyWriter {
|
|
|
18
18
|
* @param location Terminal location from TerminalFocusManager.findTerminal()
|
|
19
19
|
* @param message Text to send
|
|
20
20
|
* @throws Error if terminal type is unsupported or send fails
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
switch (location.type) {
|
|
21
|
+
*/ static async send(location, message) {
|
|
22
|
+
switch(location.type){
|
|
24
23
|
case TerminalType.TMUX:
|
|
25
24
|
return TtyWriter.sendViaTmux(location.identifier, message);
|
|
26
25
|
case TerminalType.ITERM2:
|
|
@@ -28,8 +27,7 @@ export class TtyWriter {
|
|
|
28
27
|
case TerminalType.TERMINAL_APP:
|
|
29
28
|
return TtyWriter.sendViaTerminalApp(location.tty, message);
|
|
30
29
|
default:
|
|
31
|
-
throw new Error(`Cannot send input: unsupported terminal type "${location.type}". ` +
|
|
32
|
-
'Supported: tmux, iTerm2, Terminal.app.');
|
|
30
|
+
throw new Error(`Cannot send input: unsupported terminal type "${location.type}". ` + 'Supported: tmux, iTerm2, Terminal.app.');
|
|
33
31
|
}
|
|
34
32
|
}
|
|
35
33
|
static async sendViaTmux(identifier, message) {
|
|
@@ -38,16 +36,26 @@ export class TtyWriter {
|
|
|
38
36
|
// Claude Code) has bracketed paste enabled, tmux wraps the send-keys
|
|
39
37
|
// payload in paste brackets — if Enter is included, it gets swallowed
|
|
40
38
|
// as part of the paste instead of acting as a submit action.
|
|
41
|
-
await execFileAsync('tmux', [
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
await execFileAsync('tmux', [
|
|
40
|
+
'send-keys',
|
|
41
|
+
'-t',
|
|
42
|
+
identifier,
|
|
43
|
+
'-l',
|
|
44
|
+
message
|
|
45
|
+
]);
|
|
46
|
+
await new Promise((resolve)=>setTimeout(resolve, 150));
|
|
47
|
+
await execFileAsync('tmux', [
|
|
48
|
+
'send-keys',
|
|
49
|
+
'-t',
|
|
50
|
+
identifier,
|
|
51
|
+
'Enter'
|
|
52
|
+
]);
|
|
44
53
|
}
|
|
45
54
|
/**
|
|
46
55
|
* Build an AppleScript that finds an iTerm2 session by TTY and runs a
|
|
47
56
|
* command against it. The `sessionCommand` is inserted inside a
|
|
48
57
|
* `tell targetSession` block.
|
|
49
|
-
*/
|
|
50
|
-
static iterm2SessionScript(tty, sessionCommand) {
|
|
58
|
+
*/ static iterm2SessionScript(tty, sessionCommand) {
|
|
51
59
|
return `
|
|
52
60
|
tell application "iTerm"
|
|
53
61
|
set targetSession to missing value
|
|
@@ -75,14 +83,20 @@ return "ok"`;
|
|
|
75
83
|
// iTerm2 appends the newline after the paste-end marker (\e[201~), so
|
|
76
84
|
// the inner TUI (Claude Code, Codex) sees it as a real submit action.
|
|
77
85
|
const textScript = TtyWriter.iterm2SessionScript(tty, `write text "${escaped}" newline no`);
|
|
78
|
-
const { stdout: textResult } = await execFileAsync('osascript', [
|
|
86
|
+
const { stdout: textResult } = await execFileAsync('osascript', [
|
|
87
|
+
'-e',
|
|
88
|
+
textScript
|
|
89
|
+
]);
|
|
79
90
|
if (textResult.trim() !== 'ok') {
|
|
80
91
|
throw new Error(`iTerm2 session not found for TTY ${tty}`);
|
|
81
92
|
}
|
|
82
93
|
// Wait for the paste to complete before sending Enter separately
|
|
83
|
-
await new Promise((resolve)
|
|
94
|
+
await new Promise((resolve)=>setTimeout(resolve, 150));
|
|
84
95
|
const enterScript = TtyWriter.iterm2SessionScript(tty, 'write text "" newline yes');
|
|
85
|
-
const { stdout: enterResult } = await execFileAsync('osascript', [
|
|
96
|
+
const { stdout: enterResult } = await execFileAsync('osascript', [
|
|
97
|
+
'-e',
|
|
98
|
+
enterScript
|
|
99
|
+
]);
|
|
86
100
|
if (enterResult.trim() !== 'ok') {
|
|
87
101
|
throw new Error(`iTerm2 session disappeared before Enter could be sent for TTY ${tty}`);
|
|
88
102
|
}
|
|
@@ -113,12 +127,15 @@ tell application "Terminal"
|
|
|
113
127
|
do script "${escaped}" in targetTab
|
|
114
128
|
end tell
|
|
115
129
|
return "ok"`;
|
|
116
|
-
const { stdout: textResult } = await execFileAsync('osascript', [
|
|
130
|
+
const { stdout: textResult } = await execFileAsync('osascript', [
|
|
131
|
+
'-e',
|
|
132
|
+
textScript
|
|
133
|
+
]);
|
|
117
134
|
if (textResult.trim() !== 'ok') {
|
|
118
135
|
throw new Error(`Terminal.app tab not found for TTY ${tty}`);
|
|
119
136
|
}
|
|
120
137
|
// Wait for the text to be delivered before sending Enter
|
|
121
|
-
await new Promise((resolve)
|
|
138
|
+
await new Promise((resolve)=>setTimeout(resolve, 150));
|
|
122
139
|
const enterScript = `
|
|
123
140
|
tell application "Terminal"
|
|
124
141
|
set targetTab to missing value
|
|
@@ -136,10 +153,14 @@ tell application "Terminal"
|
|
|
136
153
|
do script "" in targetTab
|
|
137
154
|
end tell
|
|
138
155
|
return "ok"`;
|
|
139
|
-
const { stdout: enterResult } = await execFileAsync('osascript', [
|
|
156
|
+
const { stdout: enterResult } = await execFileAsync('osascript', [
|
|
157
|
+
'-e',
|
|
158
|
+
enterScript
|
|
159
|
+
]);
|
|
140
160
|
if (enterResult.trim() !== 'ok') {
|
|
141
161
|
throw new Error(`Terminal.app tab disappeared before Enter could be sent for TTY ${tty}`);
|
|
142
162
|
}
|
|
143
163
|
}
|
|
144
164
|
}
|
|
165
|
+
|
|
145
166
|
//# sourceMappingURL=TtyWriter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/terminal/TtyWriter.ts"],"sourcesContent":["import { execFile } from 'child_process';\nimport { promisify } from 'util';\nimport type { TerminalLocation } from './TerminalFocusManager.js';\nimport { TerminalType } from './TerminalFocusManager.js';\nimport { escapeAppleScript } from '../utils/applescript.js';\n\nconst execFileAsync = promisify(execFile);\n\nexport class TtyWriter {\n /**\n * Send a message as keyboard input to a terminal session.\n *\n * Dispatches to the correct mechanism based on terminal type:\n * - tmux: `tmux send-keys`\n * - iTerm2: Two separate AppleScript `write text` calls (text then newline)\n * - Terminal.app: Two separate AppleScript `do script` calls (text then newline)\n *\n * All AppleScript is executed via `execFile('osascript', ['-e', script])`\n * to avoid shell interpolation and command injection.\n *\n * @param location Terminal location from TerminalFocusManager.findTerminal()\n * @param message Text to send\n * @throws Error if terminal type is unsupported or send fails\n */\n static async send(location: TerminalLocation, message: string): Promise<void> {\n switch (location.type) {\n case TerminalType.TMUX:\n return TtyWriter.sendViaTmux(location.identifier, message);\n case TerminalType.ITERM2:\n return TtyWriter.sendViaITerm2(location.tty, message);\n case TerminalType.TERMINAL_APP:\n return TtyWriter.sendViaTerminalApp(location.tty, message);\n default:\n throw new Error(\n `Cannot send input: unsupported terminal type \"${location.type}\". ` +\n 'Supported: tmux, iTerm2, Terminal.app.'\n );\n }\n }\n\n private static async sendViaTmux(identifier: string, message: string): Promise<void> {\n // Send text and Enter as two separate calls so that Enter arrives\n // outside of bracketed paste mode. When the inner application (e.g.\n // Claude Code) has bracketed paste enabled, tmux wraps the send-keys\n // payload in paste brackets — if Enter is included, it gets swallowed\n // as part of the paste instead of acting as a submit action.\n await execFileAsync('tmux', ['send-keys', '-t', identifier, '-l', message]);\n await new Promise((resolve) => setTimeout(resolve, 150));\n await execFileAsync('tmux', ['send-keys', '-t', identifier, 'Enter']);\n }\n\n /**\n * Build an AppleScript that finds an iTerm2 session by TTY and runs a\n * command against it. The `sessionCommand` is inserted inside a\n * `tell targetSession` block.\n */\n private static iterm2SessionScript(tty: string, sessionCommand: string): string {\n return `\ntell application \"iTerm\"\n set targetSession to missing value\n repeat with w in windows\n repeat with t in tabs of w\n repeat with s in sessions of t\n if tty of s is \"${tty}\" then\n set targetSession to s\n exit repeat\n end if\n end repeat\n if targetSession is not missing value then exit repeat\n end repeat\n if targetSession is not missing value then exit repeat\n end repeat\n if targetSession is missing value then return \"not_found\"\n tell targetSession to ${sessionCommand}\nend tell\nreturn \"ok\"`;\n }\n\n private static async sendViaITerm2(tty: string, message: string): Promise<void> {\n const escaped = escapeAppleScript(message);\n // Send text and Enter as two separate write text calls so the newline\n // is delivered outside the bracketed paste sequence of the message body.\n // iTerm2 appends the newline after the paste-end marker (\\e[201~), so\n // the inner TUI (Claude Code, Codex) sees it as a real submit action.\n const textScript = TtyWriter.iterm2SessionScript(tty, `write text \"${escaped}\" newline no`);\n\n const { stdout: textResult } = await execFileAsync('osascript', ['-e', textScript]);\n if (textResult.trim() !== 'ok') {\n throw new Error(`iTerm2 session not found for TTY ${tty}`);\n }\n\n // Wait for the paste to complete before sending Enter separately\n await new Promise((resolve) => setTimeout(resolve, 150));\n\n const enterScript = TtyWriter.iterm2SessionScript(tty, 'write text \"\" newline yes');\n const { stdout: enterResult } = await execFileAsync('osascript', ['-e', enterScript]);\n if (enterResult.trim() !== 'ok') {\n throw new Error(`iTerm2 session disappeared before Enter could be sent for TTY ${tty}`);\n }\n }\n\n private static async sendViaTerminalApp(tty: string, message: string): Promise<void> {\n const escaped = escapeAppleScript(message);\n // Use Terminal.app's `do script` to send text to the correct tab by TTY.\n // We avoid System Events `keystroke` + `key code 36` because it requires\n // accessibility permissions and unreliably delivers the Return key.\n //\n // `do script` with `in` targets a specific tab without opening a new one.\n // We send text and Enter as two separate calls so the newline arrives\n // outside of bracketed paste mode — same pattern as iTerm2 and tmux.\n const textScript = `\ntell application \"Terminal\"\n set targetTab to missing value\n repeat with w in windows\n repeat with i from 1 to count of tabs of w\n set t to tab i of w\n if tty of t is \"${tty}\" then\n set targetTab to t\n exit repeat\n end if\n end repeat\n if targetTab is not missing value then exit repeat\n end repeat\n if targetTab is missing value then return \"not_found\"\n do script \"${escaped}\" in targetTab\nend tell\nreturn \"ok\"`;\n\n const { stdout: textResult } = await execFileAsync('osascript', ['-e', textScript]);\n if (textResult.trim() !== 'ok') {\n throw new Error(`Terminal.app tab not found for TTY ${tty}`);\n }\n\n // Wait for the text to be delivered before sending Enter\n await new Promise((resolve) => setTimeout(resolve, 150));\n\n const enterScript = `\ntell application \"Terminal\"\n set targetTab to missing value\n repeat with w in windows\n repeat with i from 1 to count of tabs of w\n set t to tab i of w\n if tty of t is \"${tty}\" then\n set targetTab to t\n exit repeat\n end if\n end repeat\n if targetTab is not missing value then exit repeat\n end repeat\n if targetTab is missing value then return \"not_found\"\n do script \"\" in targetTab\nend tell\nreturn \"ok\"`;\n\n const { stdout: enterResult } = await execFileAsync('osascript', ['-e', enterScript]);\n if (enterResult.trim() !== 'ok') {\n throw new Error(`Terminal.app tab disappeared before Enter could be sent for TTY ${tty}`);\n }\n }\n}\n"],"names":["execFile","promisify","TerminalType","escapeAppleScript","execFileAsync","TtyWriter","send","location","message","type","TMUX","sendViaTmux","identifier","ITERM2","sendViaITerm2","tty","TERMINAL_APP","sendViaTerminalApp","Error","Promise","resolve","setTimeout","iterm2SessionScript","sessionCommand","escaped","textScript","stdout","textResult","trim","enterScript","enterResult"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,SAAS,QAAQ,OAAO;AAEjC,SAASC,YAAY,QAAQ,4BAA4B;AACzD,SAASC,iBAAiB,QAAQ,0BAA0B;AAE5D,MAAMC,gBAAgBH,UAAUD;AAEhC,OAAO,MAAMK;IACT;;;;;;;;;;;;;;KAcC,GACD,aAAaC,KAAKC,QAA0B,EAAEC,OAAe,EAAiB;QAC1E,OAAQD,SAASE,IAAI;YAC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ourcesContent":["export { TerminalFocusManager } from './TerminalFocusManager.js';\nexport { TerminalType } from './TerminalFocusManager.js';\nexport type { TerminalLocation } from './TerminalFocusManager.js';\nexport { TtyWriter } from './TtyWriter.js';\n"],"names":["TerminalFocusManager","TerminalType","TtyWriter"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,YAAY,QAAQ,4BAA4B;AAEzD,SAASC,SAAS,QAAQ,iBAAiB"}
|