@made-by-moonlight/athene-plugin-terminal-iterm2 0.9.1
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/LICENSE +22 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +160 -0
- package/dist/index.js.map +1 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +257 -0
- package/dist/index.test.js.map +1 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Composio, Inc.
|
|
4
|
+
Copyright (c) 2026 slievr (Athene fork)
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Terminal } from "@made-by-moonlight/athene-core";
|
|
2
|
+
export declare const manifest: {
|
|
3
|
+
name: string;
|
|
4
|
+
slot: "terminal";
|
|
5
|
+
description: string;
|
|
6
|
+
version: string;
|
|
7
|
+
};
|
|
8
|
+
export { escapeAppleScript } from "@made-by-moonlight/athene-core";
|
|
9
|
+
export declare function create(): Terminal;
|
|
10
|
+
declare const _default: {
|
|
11
|
+
manifest: {
|
|
12
|
+
name: string;
|
|
13
|
+
slot: "terminal";
|
|
14
|
+
description: string;
|
|
15
|
+
version: string;
|
|
16
|
+
};
|
|
17
|
+
create: typeof create;
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,QAAQ,EAEd,MAAM,gCAAgC,CAAC;AAExC,eAAO,MAAM,QAAQ;;;;;CAKpB,CAAC;AAGF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAkHnE,wBAAgB,MAAM,IAAI,QAAQ,CA4CjC;;;;;;;;;;AAED,wBAAqE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { platform } from "node:os";
|
|
3
|
+
import { escapeAppleScript, } from "@made-by-moonlight/athene-core";
|
|
4
|
+
export const manifest = {
|
|
5
|
+
name: "iterm2",
|
|
6
|
+
slot: "terminal",
|
|
7
|
+
description: "Terminal plugin: macOS iTerm2 tab management",
|
|
8
|
+
version: "0.1.0",
|
|
9
|
+
};
|
|
10
|
+
// Re-export for backwards compatibility
|
|
11
|
+
export { escapeAppleScript } from "@made-by-moonlight/athene-core";
|
|
12
|
+
/**
|
|
13
|
+
* Run an AppleScript snippet and return stdout.
|
|
14
|
+
*/
|
|
15
|
+
function runAppleScript(script) {
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
17
|
+
execFile("osascript", ["-e", script], (err, stdout) => {
|
|
18
|
+
if (err)
|
|
19
|
+
reject(err);
|
|
20
|
+
else
|
|
21
|
+
resolve(stdout.trim());
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Escape a string for safe interpolation inside a shell single-quoted context.
|
|
27
|
+
* Replaces ' with '\'' (end quote, escaped quote, start quote).
|
|
28
|
+
*/
|
|
29
|
+
function shellEscape(s) {
|
|
30
|
+
return s.replace(/'/g, "'\\''");
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Check if an iTerm2 tab already exists for this session by matching session name.
|
|
34
|
+
* Returns true if found (and selects it), false otherwise.
|
|
35
|
+
*/
|
|
36
|
+
async function findAndSelectExistingTab(sessionName) {
|
|
37
|
+
const safe = escapeAppleScript(sessionName);
|
|
38
|
+
const script = `
|
|
39
|
+
tell application "iTerm2"
|
|
40
|
+
repeat with aWindow in windows
|
|
41
|
+
repeat with aTab in tabs of aWindow
|
|
42
|
+
repeat with aSession in sessions of aTab
|
|
43
|
+
try
|
|
44
|
+
if name of aSession is equal to "${safe}" then
|
|
45
|
+
select aWindow
|
|
46
|
+
select aTab
|
|
47
|
+
return "FOUND"
|
|
48
|
+
end if
|
|
49
|
+
end try
|
|
50
|
+
end repeat
|
|
51
|
+
end repeat
|
|
52
|
+
end repeat
|
|
53
|
+
return "NOT_FOUND"
|
|
54
|
+
end tell`;
|
|
55
|
+
const result = await runAppleScript(script);
|
|
56
|
+
return result === "FOUND";
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Check if an iTerm2 tab exists for this session WITHOUT selecting it.
|
|
60
|
+
* Pure query — no side effects on the UI.
|
|
61
|
+
*/
|
|
62
|
+
async function hasExistingTab(sessionName) {
|
|
63
|
+
const safe = escapeAppleScript(sessionName);
|
|
64
|
+
const script = `
|
|
65
|
+
tell application "iTerm2"
|
|
66
|
+
repeat with aWindow in windows
|
|
67
|
+
repeat with aTab in tabs of aWindow
|
|
68
|
+
repeat with aSession in sessions of aTab
|
|
69
|
+
try
|
|
70
|
+
if name of aSession is equal to "${safe}" then
|
|
71
|
+
return "FOUND"
|
|
72
|
+
end if
|
|
73
|
+
end try
|
|
74
|
+
end repeat
|
|
75
|
+
end repeat
|
|
76
|
+
end repeat
|
|
77
|
+
return "NOT_FOUND"
|
|
78
|
+
end tell`;
|
|
79
|
+
const result = await runAppleScript(script);
|
|
80
|
+
return result === "FOUND";
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Open a new iTerm2 tab and attach to the given tmux session.
|
|
84
|
+
* Creates a new window if no window is open.
|
|
85
|
+
*/
|
|
86
|
+
async function openNewTab(sessionName) {
|
|
87
|
+
const safe = escapeAppleScript(sessionName);
|
|
88
|
+
// Double-escape for the write text command: shell-escape first, then AppleScript-escape
|
|
89
|
+
// the whole shell command so it's safe inside the AppleScript double-quoted string.
|
|
90
|
+
const shellSafe = shellEscape(sessionName);
|
|
91
|
+
const shellInAppleScript = escapeAppleScript(shellSafe);
|
|
92
|
+
const script = `
|
|
93
|
+
tell application "iTerm2"
|
|
94
|
+
activate
|
|
95
|
+
if (count of windows) is 0 then
|
|
96
|
+
create window with default profile
|
|
97
|
+
else
|
|
98
|
+
tell current window
|
|
99
|
+
create tab with default profile
|
|
100
|
+
end tell
|
|
101
|
+
end if
|
|
102
|
+
tell current session of current window
|
|
103
|
+
set name to "${safe}"
|
|
104
|
+
write text "printf '\\\\033]0;${shellInAppleScript}\\\\007' && tmux attach -t '${shellInAppleScript}'"
|
|
105
|
+
end tell
|
|
106
|
+
end tell`;
|
|
107
|
+
await runAppleScript(script);
|
|
108
|
+
}
|
|
109
|
+
function getSessionName(session) {
|
|
110
|
+
// Use the runtime handle id if available (tmux session name), otherwise session id
|
|
111
|
+
return session.runtimeHandle?.id ?? session.id;
|
|
112
|
+
}
|
|
113
|
+
function isMacOS() {
|
|
114
|
+
return platform() === "darwin";
|
|
115
|
+
}
|
|
116
|
+
export function create() {
|
|
117
|
+
return {
|
|
118
|
+
name: "iterm2",
|
|
119
|
+
async openSession(session) {
|
|
120
|
+
if (!isMacOS()) {
|
|
121
|
+
// eslint-disable-next-line no-console
|
|
122
|
+
console.warn("[terminal-iterm2] iTerm2 is only available on macOS");
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const sessionName = getSessionName(session);
|
|
126
|
+
// Try to find and select an existing tab first
|
|
127
|
+
const found = await findAndSelectExistingTab(sessionName);
|
|
128
|
+
if (!found) {
|
|
129
|
+
await openNewTab(sessionName);
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
async openAll(sessions) {
|
|
133
|
+
if (!isMacOS() || sessions.length === 0)
|
|
134
|
+
return;
|
|
135
|
+
for (const session of sessions) {
|
|
136
|
+
const sessionName = getSessionName(session);
|
|
137
|
+
const found = await findAndSelectExistingTab(sessionName);
|
|
138
|
+
if (!found) {
|
|
139
|
+
await openNewTab(sessionName);
|
|
140
|
+
}
|
|
141
|
+
// Small delay between tab operations to avoid AppleScript race conditions
|
|
142
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
async isSessionOpen(session) {
|
|
146
|
+
if (!isMacOS())
|
|
147
|
+
return false;
|
|
148
|
+
const sessionName = getSessionName(session);
|
|
149
|
+
try {
|
|
150
|
+
// Query-only check — does NOT select/focus the tab
|
|
151
|
+
return await hasExistingTab(sessionName);
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
export default { manifest, create };
|
|
160
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1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AAC,WAAW,CAAC,CAAC;YAC1D,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;QAED,KAAK,CAAC,OAAO,CAAC,QAAmB;YAC/B,IAAI,CAAC,OAAO,EAAE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO;YAEhD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;gBAC/B,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;gBAC5C,MAAM,KAAK,GAAG,MAAM,wBAAwB,CAAC,WAAW,CAAC,CAAC;gBAC1D,IAAI,CAAC,KAAK,EAAE,CAAC;oBACX,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC;gBAChC,CAAC;gBACD,0EAA0E;gBAC1E,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;QAED,KAAK,CAAC,aAAa,CAAC,OAAgB;YAClC,IAAI,CAAC,OAAO,EAAE;gBAAE,OAAO,KAAK,CAAC;YAC7B,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;YAC5C,IAAI,CAAC;gBACH,mDAAmD;gBACnD,OAAO,MAAM,cAAc,CAAC,WAAW,CAAC,CAAC;YAC3C,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAmC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
+
import { createInitialCanonicalLifecycle, createActivitySignal } from "@made-by-moonlight/athene-core";
|
|
3
|
+
vi.mock("node:child_process", () => ({
|
|
4
|
+
execFile: vi.fn(),
|
|
5
|
+
}));
|
|
6
|
+
vi.mock("node:os", () => ({
|
|
7
|
+
platform: vi.fn(() => "darwin"),
|
|
8
|
+
}));
|
|
9
|
+
import { execFile } from "node:child_process";
|
|
10
|
+
import { platform } from "node:os";
|
|
11
|
+
import { manifest, create, escapeAppleScript } from "./index.js";
|
|
12
|
+
const mockExecFile = execFile;
|
|
13
|
+
const mockPlatform = platform;
|
|
14
|
+
function makeSession(overrides = {}) {
|
|
15
|
+
const lifecycle = createInitialCanonicalLifecycle("worker", new Date());
|
|
16
|
+
lifecycle.session.state = "working";
|
|
17
|
+
lifecycle.session.reason = "task_in_progress";
|
|
18
|
+
lifecycle.session.startedAt = lifecycle.session.lastTransitionAt;
|
|
19
|
+
lifecycle.runtime.state = "alive";
|
|
20
|
+
lifecycle.runtime.reason = "process_running";
|
|
21
|
+
return {
|
|
22
|
+
id: "app-1",
|
|
23
|
+
projectId: "my-project",
|
|
24
|
+
status: "working",
|
|
25
|
+
activity: "active",
|
|
26
|
+
activitySignal: createActivitySignal("valid", {
|
|
27
|
+
activity: "active",
|
|
28
|
+
timestamp: new Date(),
|
|
29
|
+
source: "native",
|
|
30
|
+
}),
|
|
31
|
+
lifecycle,
|
|
32
|
+
branch: "feat/test",
|
|
33
|
+
issueId: null,
|
|
34
|
+
pr: null,
|
|
35
|
+
prs: [],
|
|
36
|
+
workspacePath: "/tmp/workspace",
|
|
37
|
+
runtimeHandle: null,
|
|
38
|
+
agentInfo: null,
|
|
39
|
+
createdAt: new Date(),
|
|
40
|
+
lastActivityAt: new Date(),
|
|
41
|
+
metadata: {},
|
|
42
|
+
...overrides,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function simulateOsascript(stdout) {
|
|
46
|
+
mockExecFile.mockImplementation((_cmd, _args, cb) => {
|
|
47
|
+
cb(null, stdout);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function simulateOsascriptSequence(results) {
|
|
51
|
+
let callIndex = 0;
|
|
52
|
+
mockExecFile.mockImplementation((_cmd, _args, cb) => {
|
|
53
|
+
const result = results[callIndex] ?? "NOT_FOUND";
|
|
54
|
+
callIndex++;
|
|
55
|
+
cb(null, result);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
describe("terminal-iterm2", () => {
|
|
59
|
+
beforeEach(() => {
|
|
60
|
+
vi.clearAllMocks();
|
|
61
|
+
vi.useFakeTimers();
|
|
62
|
+
mockPlatform.mockReturnValue("darwin");
|
|
63
|
+
});
|
|
64
|
+
describe("manifest", () => {
|
|
65
|
+
it("has correct metadata", () => {
|
|
66
|
+
expect(manifest.name).toBe("iterm2");
|
|
67
|
+
expect(manifest.slot).toBe("terminal");
|
|
68
|
+
expect(manifest.version).toBe("0.1.0");
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
describe("escapeAppleScript", () => {
|
|
72
|
+
it("escapes double quotes", () => {
|
|
73
|
+
expect(escapeAppleScript('hello "world"')).toBe('hello \\"world\\"');
|
|
74
|
+
});
|
|
75
|
+
it("escapes backslashes", () => {
|
|
76
|
+
expect(escapeAppleScript("path\\to\\file")).toBe("path\\\\to\\\\file");
|
|
77
|
+
});
|
|
78
|
+
it("escapes both backslashes and quotes together", () => {
|
|
79
|
+
expect(escapeAppleScript('a\\b"c')).toBe('a\\\\b\\"c');
|
|
80
|
+
});
|
|
81
|
+
it("returns plain strings unchanged", () => {
|
|
82
|
+
expect(escapeAppleScript("hello-world_123")).toBe("hello-world_123");
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
describe("create", () => {
|
|
86
|
+
it("returns a terminal with name 'iterm2'", () => {
|
|
87
|
+
const terminal = create();
|
|
88
|
+
expect(terminal.name).toBe("iterm2");
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
describe("openSession", () => {
|
|
92
|
+
it("uses session.id as session name by default", async () => {
|
|
93
|
+
simulateOsascript("NOT_FOUND\n");
|
|
94
|
+
const terminal = create();
|
|
95
|
+
await terminal.openSession(makeSession({ id: "backend-5" }));
|
|
96
|
+
expect(mockExecFile).toHaveBeenCalledTimes(2);
|
|
97
|
+
const newTabScript = mockExecFile.mock.calls[1][1][1];
|
|
98
|
+
expect(newTabScript).toContain("backend-5");
|
|
99
|
+
});
|
|
100
|
+
it("uses runtimeHandle.id when available", async () => {
|
|
101
|
+
simulateOsascript("NOT_FOUND\n");
|
|
102
|
+
const terminal = create();
|
|
103
|
+
await terminal.openSession(makeSession({
|
|
104
|
+
id: "app-1",
|
|
105
|
+
runtimeHandle: { id: "tmux-session-42", runtimeName: "tmux", data: {} },
|
|
106
|
+
}));
|
|
107
|
+
const newTabScript = mockExecFile.mock.calls[1][1][1];
|
|
108
|
+
expect(newTabScript).toContain("tmux-session-42");
|
|
109
|
+
expect(newTabScript).not.toContain("app-1");
|
|
110
|
+
});
|
|
111
|
+
it("reuses existing tab when found", async () => {
|
|
112
|
+
simulateOsascript("FOUND\n");
|
|
113
|
+
const terminal = create();
|
|
114
|
+
await terminal.openSession(makeSession());
|
|
115
|
+
expect(mockExecFile).toHaveBeenCalledTimes(1);
|
|
116
|
+
});
|
|
117
|
+
it("opens new tab when not found", async () => {
|
|
118
|
+
simulateOsascript("NOT_FOUND\n");
|
|
119
|
+
const terminal = create();
|
|
120
|
+
await terminal.openSession(makeSession());
|
|
121
|
+
expect(mockExecFile).toHaveBeenCalledTimes(2);
|
|
122
|
+
});
|
|
123
|
+
it("escapes special chars in session name for AppleScript", async () => {
|
|
124
|
+
simulateOsascript("NOT_FOUND\n");
|
|
125
|
+
const terminal = create();
|
|
126
|
+
await terminal.openSession(makeSession({ id: 'session"with"quotes' }));
|
|
127
|
+
const findScript = mockExecFile.mock.calls[0][1][1];
|
|
128
|
+
expect(findScript).toContain('session\\"with\\"quotes');
|
|
129
|
+
expect(findScript).not.toContain('session"with"quotes');
|
|
130
|
+
const openScript = mockExecFile.mock.calls[1][1][1];
|
|
131
|
+
expect(openScript).toContain('session\\"with\\"quotes');
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
describe("AppleScript commands", () => {
|
|
135
|
+
it("findAndSelectExistingTab checks session name and selects", async () => {
|
|
136
|
+
simulateOsascript("NOT_FOUND\n");
|
|
137
|
+
const terminal = create();
|
|
138
|
+
await terminal.openSession(makeSession({ id: "my-session" }));
|
|
139
|
+
const findScript = mockExecFile.mock.calls[0][1][1];
|
|
140
|
+
expect(findScript).toContain('tell application "iTerm2"');
|
|
141
|
+
expect(findScript).toContain("name of aSession");
|
|
142
|
+
expect(findScript).not.toContain("profile name of aSession");
|
|
143
|
+
expect(findScript).toContain('"my-session"');
|
|
144
|
+
expect(findScript).toContain("select aWindow");
|
|
145
|
+
expect(findScript).toContain("select aTab");
|
|
146
|
+
});
|
|
147
|
+
it("openNewTab creates tab and attaches to tmux with shell-safe quoting", async () => {
|
|
148
|
+
simulateOsascript("NOT_FOUND\n");
|
|
149
|
+
const terminal = create();
|
|
150
|
+
await terminal.openSession(makeSession({ id: "app-7" }));
|
|
151
|
+
const openScript = mockExecFile.mock.calls[1][1][1];
|
|
152
|
+
expect(openScript).toContain("create tab with default profile");
|
|
153
|
+
expect(openScript).toContain('set name to "app-7"');
|
|
154
|
+
expect(openScript).toContain("tmux attach -t 'app-7'");
|
|
155
|
+
});
|
|
156
|
+
it("shell-escapes session names with single quotes in tmux command", async () => {
|
|
157
|
+
simulateOsascript("NOT_FOUND\n");
|
|
158
|
+
const terminal = create();
|
|
159
|
+
await terminal.openSession(makeSession({ id: "it's-a-test" }));
|
|
160
|
+
const openScript = mockExecFile.mock.calls[1][1][1];
|
|
161
|
+
// Single quotes in the session name should be shell-escaped then AppleScript-escaped.
|
|
162
|
+
// Shell escape: 'it'\''s-a-test' → AppleScript escape doubles the backslash: 'it'\\''s-a-test'
|
|
163
|
+
expect(openScript).toContain("tmux attach -t 'it'\\\\''s-a-test'");
|
|
164
|
+
});
|
|
165
|
+
it("always calls osascript as the command", async () => {
|
|
166
|
+
simulateOsascript("NOT_FOUND\n");
|
|
167
|
+
const terminal = create();
|
|
168
|
+
await terminal.openSession(makeSession());
|
|
169
|
+
for (const call of mockExecFile.mock.calls) {
|
|
170
|
+
expect(call[0]).toBe("osascript");
|
|
171
|
+
expect(call[1][0]).toBe("-e");
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
describe("openAll", () => {
|
|
176
|
+
it("does nothing for empty session list", async () => {
|
|
177
|
+
const terminal = create();
|
|
178
|
+
await terminal.openAll([]);
|
|
179
|
+
expect(mockExecFile).not.toHaveBeenCalled();
|
|
180
|
+
});
|
|
181
|
+
it("opens tabs for each session", async () => {
|
|
182
|
+
simulateOsascript("NOT_FOUND\n");
|
|
183
|
+
const terminal = create();
|
|
184
|
+
const sessions = [makeSession({ id: "app-1" }), makeSession({ id: "app-2" })];
|
|
185
|
+
const promise = terminal.openAll(sessions);
|
|
186
|
+
await vi.advanceTimersByTimeAsync(300);
|
|
187
|
+
await vi.advanceTimersByTimeAsync(300);
|
|
188
|
+
await promise;
|
|
189
|
+
// 2 sessions * 2 calls each (find + open) = 4
|
|
190
|
+
expect(mockExecFile).toHaveBeenCalledTimes(4);
|
|
191
|
+
});
|
|
192
|
+
it("skips opening tabs for existing sessions", async () => {
|
|
193
|
+
simulateOsascriptSequence(["FOUND\n", "NOT_FOUND\n", ""]);
|
|
194
|
+
const terminal = create();
|
|
195
|
+
const sessions = [makeSession({ id: "existing-1" }), makeSession({ id: "new-1" })];
|
|
196
|
+
const promise = terminal.openAll(sessions);
|
|
197
|
+
await vi.advanceTimersByTimeAsync(300);
|
|
198
|
+
await vi.advanceTimersByTimeAsync(300);
|
|
199
|
+
await promise;
|
|
200
|
+
// existing-1: 1 call (find=FOUND), new-1: 2 calls (find=NOT_FOUND + open)
|
|
201
|
+
expect(mockExecFile).toHaveBeenCalledTimes(3);
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
describe("platform guard", () => {
|
|
205
|
+
it("openSession is a no-op on non-macOS", async () => {
|
|
206
|
+
mockPlatform.mockReturnValue("linux");
|
|
207
|
+
const warnSpy = vi.spyOn(console, "warn").mockImplementation(() => { });
|
|
208
|
+
const terminal = create();
|
|
209
|
+
await terminal.openSession(makeSession());
|
|
210
|
+
expect(mockExecFile).not.toHaveBeenCalled();
|
|
211
|
+
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining("only available on macOS"));
|
|
212
|
+
warnSpy.mockRestore();
|
|
213
|
+
});
|
|
214
|
+
it("isSessionOpen returns false on non-macOS", async () => {
|
|
215
|
+
mockPlatform.mockReturnValue("win32");
|
|
216
|
+
const terminal = create();
|
|
217
|
+
const result = await terminal.isSessionOpen(makeSession());
|
|
218
|
+
expect(result).toBe(false);
|
|
219
|
+
expect(mockExecFile).not.toHaveBeenCalled();
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
describe("isSessionOpen", () => {
|
|
223
|
+
it("returns true when tab exists", async () => {
|
|
224
|
+
simulateOsascript("FOUND\n");
|
|
225
|
+
const terminal = create();
|
|
226
|
+
const result = await terminal.isSessionOpen(makeSession({ id: "app-1" }));
|
|
227
|
+
expect(result).toBe(true);
|
|
228
|
+
});
|
|
229
|
+
it("returns false when tab does not exist", async () => {
|
|
230
|
+
simulateOsascript("NOT_FOUND\n");
|
|
231
|
+
const terminal = create();
|
|
232
|
+
const result = await terminal.isSessionOpen(makeSession({ id: "app-1" }));
|
|
233
|
+
expect(result).toBe(false);
|
|
234
|
+
});
|
|
235
|
+
it("returns false when osascript fails", async () => {
|
|
236
|
+
mockExecFile.mockImplementation((_cmd, _args, cb) => {
|
|
237
|
+
cb(new Error("osascript failed"), "");
|
|
238
|
+
});
|
|
239
|
+
const terminal = create();
|
|
240
|
+
const result = await terminal.isSessionOpen(makeSession());
|
|
241
|
+
expect(result).toBe(false);
|
|
242
|
+
});
|
|
243
|
+
it("does NOT select the tab (no side effect)", async () => {
|
|
244
|
+
simulateOsascript("FOUND\n");
|
|
245
|
+
const terminal = create();
|
|
246
|
+
await terminal.isSessionOpen(makeSession({ id: "check-only" }));
|
|
247
|
+
// isSessionOpen uses hasExistingTab which does NOT contain select commands
|
|
248
|
+
const script = mockExecFile.mock.calls[0][1][1];
|
|
249
|
+
expect(script).not.toContain("select aWindow");
|
|
250
|
+
expect(script).not.toContain("select aTab");
|
|
251
|
+
// Uses session name, not profile name
|
|
252
|
+
expect(script).toContain("name of aSession");
|
|
253
|
+
expect(script).not.toContain("profile name");
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
//# sourceMappingURL=index.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAa,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,+BAA+B,EAAE,oBAAoB,EAAgB,MAAM,gCAAgC,CAAC;AAErH,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC;IACnC,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE;CAClB,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;IACxB,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC;CAChC,CAAC,CAAC,CAAC;AAEJ,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,YAAY,GAAG,QAA2B,CAAC;AACjD,MAAM,YA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kBAAkB,CAAC,CAAC;YAC7C,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@made-by-moonlight/athene-plugin-terminal-iterm2",
|
|
3
|
+
"version": "0.9.1",
|
|
4
|
+
"description": "Terminal plugin: macOS iTerm2",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/slievr/Athene.git",
|
|
21
|
+
"directory": "packages/plugins/terminal-iterm2"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/slievr/Athene",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/slievr/Athene/issues"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=20.0.0"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@made-by-moonlight/athene-core": "0.9.1"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^25.2.3",
|
|
35
|
+
"typescript": "^5.7.0",
|
|
36
|
+
"vitest": "^3.0.0"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc",
|
|
43
|
+
"typecheck": "tsc --noEmit",
|
|
44
|
+
"test": "vitest run",
|
|
45
|
+
"clean": "rm -rf dist"
|
|
46
|
+
}
|
|
47
|
+
}
|