@zeph-to/cli 2.6.0 → 2.8.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/README.md +39 -1
- package/dist/ask.js +1 -1
- package/dist/cli.js +13 -0
- package/dist/config.d.ts +7 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +10 -3
- package/dist/installer.d.ts +11 -0
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +61 -2
- package/dist/listener-process.d.ts +1 -0
- package/dist/listener-process.d.ts.map +1 -1
- package/dist/listener-process.js +13 -5
- package/dist/listener-service.d.ts +165 -0
- package/dist/listener-service.d.ts.map +1 -0
- package/dist/listener-service.js +424 -0
- package/dist/listener.d.ts +59 -0
- package/dist/listener.d.ts.map +1 -1
- package/dist/listener.js +0 -0
- package/dist/remote-hook.d.ts.map +1 -1
- package/dist/remote-hook.js +6 -3
- package/dist/session-registry.d.ts +13 -0
- package/dist/session-registry.d.ts.map +1 -1
- package/dist/session-registry.js +22 -1
- package/dist/uninstall.d.ts +8 -0
- package/dist/uninstall.d.ts.map +1 -1
- package/dist/uninstall.js +28 -1
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js +11 -1
- package/dist/wrapper.d.ts.map +1 -1
- package/dist/wrapper.js +23 -3
- package/package.json +1 -1
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serviceHealthChecks = exports.defaultServiceProbe = exports.restartService = exports.stopService = exports.uninstallService = exports.installService = exports.defaultServiceOpDeps = exports.serviceStatus = exports.renderLaunchAgentPlist = exports.resolveServiceSpec = exports.defaultServiceEnv = exports.serviceInstalled = exports.servicePlistPath = exports.serviceSupported = exports.SERVICE_LABEL = void 0;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_os_1 = require("node:os");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const listener_process_js_1 = require("./listener-process.js");
|
|
9
|
+
/**
|
|
10
|
+
* The listener as an OS service: a launchd LaunchAgent that starts it at user
|
|
11
|
+
* login so the phone's picker is populated without anyone opening a terminal.
|
|
12
|
+
*
|
|
13
|
+
* Until this existed, the only thing that ever started the daemon was
|
|
14
|
+
* `zeph cc` (wrapper.ts → spawnListenerDetached). After a reboot that means an
|
|
15
|
+
* empty picker until the user happens to launch an agent — the machine is
|
|
16
|
+
* online, the past sessions are on disk, and the app says "no agents".
|
|
17
|
+
*
|
|
18
|
+
* Two constraints shape this file:
|
|
19
|
+
*
|
|
20
|
+
* 1. **Node builtins only.** wrapper.ts reads `serviceInstalled()` on the
|
|
21
|
+
* `zeph cc` hot path, and the same rule that keeps listener.ts out of
|
|
22
|
+
* wrapper.ts (ws + the crypto stack on every agent launch) applies here.
|
|
23
|
+
* listener-process.ts is the one import, and it is builtins-only too.
|
|
24
|
+
*
|
|
25
|
+
* 2. **Everything the job needs is resolved at install time and baked into
|
|
26
|
+
* the plist.** launchd hands a job `/usr/bin:/bin:/usr/sbin:/sbin` and
|
|
27
|
+
* nothing else — no shell profile, no homebrew prefix. `verifyTmux()`
|
|
28
|
+
* (listener.ts) exits 127 when tmux is not on PATH, so a plist without a
|
|
29
|
+
* baked PATH produces a service that dies at every login and is restarted
|
|
30
|
+
* forever by KeepAlive. The interpreter is baked for the same reason.
|
|
31
|
+
*/
|
|
32
|
+
/** Reverse-DNS launchd label. Lives on the user's machine once installed —
|
|
33
|
+
* renaming it orphans every plist already out there. */
|
|
34
|
+
exports.SERVICE_LABEL = 'to.zeph.listener';
|
|
35
|
+
/** `package.json` engines floor. A node below this starts and dies. */
|
|
36
|
+
const MIN_NODE_MAJOR = 18;
|
|
37
|
+
/** What launchd itself puts on PATH. Ours is prepended, never replaces this. */
|
|
38
|
+
const LAUNCHD_BASE_PATH = ['/usr/bin', '/bin', '/usr/sbin', '/sbin'];
|
|
39
|
+
/** Interpreters to try when the CLI's own install prefix has none. */
|
|
40
|
+
const NODE_FALLBACKS = ['/opt/homebrew/bin/node', '/usr/local/bin/node'];
|
|
41
|
+
/**
|
|
42
|
+
* Locale to fall back on when the shell has none, or has a non-UTF-8 one.
|
|
43
|
+
*
|
|
44
|
+
* launchd hands a job no LANG at all. tmux then runs in the C locale and
|
|
45
|
+
* escapes every non-ASCII byte of its format output to `_` — including the
|
|
46
|
+
* U+241F separator the session inventory is split on. The daemon starts
|
|
47
|
+
* clean, tmux answers, and every session is discarded as unparseable: the
|
|
48
|
+
* phone shows nothing while `launchctl list` and the log both look healthy.
|
|
49
|
+
*/
|
|
50
|
+
const FALLBACK_LANG = 'en_US.UTF-8';
|
|
51
|
+
/** tmux locations to try when the shell can't answer `command -v`. */
|
|
52
|
+
const TMUX_FALLBACKS = ['/opt/homebrew/bin/tmux', '/usr/local/bin/tmux', '/usr/bin/tmux'];
|
|
53
|
+
/** Version-manager roots. A node under one of these is gone after the next
|
|
54
|
+
* upgrade, which silently breaks the service months later. */
|
|
55
|
+
const VERSION_MANAGER_DIRS = ['/.nvm/', '/.fnm/', '/.volta/', '/.nodenv/', '/.asdf/', '/.n/'];
|
|
56
|
+
/** launchd only exists on macOS. Every other platform is an explicit refusal,
|
|
57
|
+
* never a quiet success. */
|
|
58
|
+
const serviceSupported = () => process.platform === 'darwin';
|
|
59
|
+
exports.serviceSupported = serviceSupported;
|
|
60
|
+
const servicePlistPath = () => (0, node_path_1.join)((0, node_os_1.homedir)(), 'Library', 'LaunchAgents', `${exports.SERVICE_LABEL}.plist`);
|
|
61
|
+
exports.servicePlistPath = servicePlistPath;
|
|
62
|
+
const serviceInstalled = () => (0, node_fs_1.existsSync)((0, exports.servicePlistPath)());
|
|
63
|
+
exports.serviceInstalled = serviceInstalled;
|
|
64
|
+
/** This user's launchd GUI domain, and our job within it. Not exported: every
|
|
65
|
+
* launchctl call lives in this file, and the label is an implementation
|
|
66
|
+
* detail of that. */
|
|
67
|
+
const serviceDomain = () => `gui/${process.getuid?.() ?? 0}`;
|
|
68
|
+
const serviceTarget = () => `${serviceDomain()}/${exports.SERVICE_LABEL}`;
|
|
69
|
+
const nodeMajorOf = (path) => {
|
|
70
|
+
try {
|
|
71
|
+
const out = (0, node_child_process_1.execFileSync)(path, ['-v'], { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'ignore'] });
|
|
72
|
+
const major = Number(out.trim().replace(/^v/, '').split('.')[0]);
|
|
73
|
+
return Number.isFinite(major) ? major : null;
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const whichTmuxFromShell = () => {
|
|
80
|
+
try {
|
|
81
|
+
// `/bin/sh -c` on purpose: `which` in an interactive zsh resolves the
|
|
82
|
+
// user's tmux *alias*, which is not a path we can hand to launchd.
|
|
83
|
+
const out = (0, node_child_process_1.execFileSync)('/bin/sh', ['-c', 'command -v tmux'], {
|
|
84
|
+
encoding: 'utf-8',
|
|
85
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
86
|
+
}).trim();
|
|
87
|
+
return out.startsWith('/') ? out : null;
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
exports.defaultServiceEnv = {
|
|
94
|
+
exists: node_fs_1.existsSync,
|
|
95
|
+
nodeMajor: nodeMajorOf,
|
|
96
|
+
whichTmux: whichTmuxFromShell,
|
|
97
|
+
cliPath: listener_process_js_1.resolveCliPath,
|
|
98
|
+
lang: () => process.env.LANG,
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* The interpreter that owns the CLI's install prefix.
|
|
102
|
+
*
|
|
103
|
+
* A global install lives at `<prefix>/lib/node_modules/@zeph-to/cli/dist/cli.js`
|
|
104
|
+
* and its node is `<prefix>/bin/node`. Preferring it keeps the plist internally
|
|
105
|
+
* consistent; picking whichever node happens to exist can pair a homebrew
|
|
106
|
+
* interpreter with a `~/.local` install — a combination that works on the
|
|
107
|
+
* machine that wrote it and breaks on the next one.
|
|
108
|
+
*/
|
|
109
|
+
const prefixNodeFor = (cliPath) => {
|
|
110
|
+
const marker = '/lib/node_modules/';
|
|
111
|
+
const at = cliPath.indexOf(marker);
|
|
112
|
+
if (at < 0)
|
|
113
|
+
return null;
|
|
114
|
+
return (0, node_path_1.join)(cliPath.slice(0, at), 'bin', 'node');
|
|
115
|
+
};
|
|
116
|
+
const isVersionManaged = (nodePath) => VERSION_MANAGER_DIRS.some((dir) => nodePath.includes(dir));
|
|
117
|
+
const dedupe = (values) => [...new Set(values)];
|
|
118
|
+
/**
|
|
119
|
+
* Decide what to bake into the plist, or say why we can't. Nothing is written
|
|
120
|
+
* and nothing is registered — a caller that gets `ok: false` has touched
|
|
121
|
+
* nothing on the machine.
|
|
122
|
+
*/
|
|
123
|
+
const resolveServiceSpec = (env = exports.defaultServiceEnv) => {
|
|
124
|
+
const cliPath = env.cliPath();
|
|
125
|
+
if (!cliPath) {
|
|
126
|
+
return { ok: false, reason: 'could not resolve the zeph CLI entry (dist/cli.js) to run' };
|
|
127
|
+
}
|
|
128
|
+
const tmuxPath = env.whichTmux() ?? TMUX_FALLBACKS.find(env.exists) ?? null;
|
|
129
|
+
if (!tmuxPath) {
|
|
130
|
+
return { ok: false, reason: 'tmux not found — install tmux first (the listener drives tmux panes)' };
|
|
131
|
+
}
|
|
132
|
+
const prefixNode = prefixNodeFor(cliPath);
|
|
133
|
+
const candidates = dedupe([...(prefixNode ? [prefixNode] : []), ...NODE_FALLBACKS, process.execPath]);
|
|
134
|
+
const nodePath = candidates.find((c) => env.exists(c) && (env.nodeMajor(c) ?? 0) >= MIN_NODE_MAJOR);
|
|
135
|
+
if (!nodePath) {
|
|
136
|
+
return { ok: false, reason: `no node >= ${MIN_NODE_MAJOR} found to run the listener with` };
|
|
137
|
+
}
|
|
138
|
+
const pathEnv = dedupe([(0, node_path_1.dirname)(tmuxPath), (0, node_path_1.dirname)(nodePath), ...LAUNCHD_BASE_PATH]).join(':');
|
|
139
|
+
const shellLang = env.lang();
|
|
140
|
+
const lang = shellLang && /utf-?8$/i.test(shellLang) ? shellLang : FALLBACK_LANG;
|
|
141
|
+
const spec = { nodePath, cliPath, tmuxPath, logPath: listener_process_js_1.LISTENER_LOG_FILE, pathEnv, lang };
|
|
142
|
+
if (isVersionManaged(nodePath)) {
|
|
143
|
+
return {
|
|
144
|
+
ok: true,
|
|
145
|
+
value: spec,
|
|
146
|
+
warning: `${nodePath} belongs to a node version manager — the service will stop working ` +
|
|
147
|
+
`after a node upgrade. Re-run \`zeph listener --install-service\` if that happens ` +
|
|
148
|
+
`(\`zeph verify\` reports it).`,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
return { ok: true, value: spec };
|
|
152
|
+
};
|
|
153
|
+
exports.resolveServiceSpec = resolveServiceSpec;
|
|
154
|
+
const escapeXml = (value) => value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
155
|
+
const renderLaunchAgentPlist = (spec) => {
|
|
156
|
+
const s = (value) => `<string>${escapeXml(value)}</string>`;
|
|
157
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
158
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
159
|
+
<plist version="1.0">
|
|
160
|
+
<dict>
|
|
161
|
+
<key>Label</key>
|
|
162
|
+
${s(exports.SERVICE_LABEL)}
|
|
163
|
+
<key>ProgramArguments</key>
|
|
164
|
+
<array>
|
|
165
|
+
${s(spec.nodePath)}
|
|
166
|
+
${s(spec.cliPath)}
|
|
167
|
+
<string>listener</string>
|
|
168
|
+
</array>
|
|
169
|
+
<key>RunAtLoad</key>
|
|
170
|
+
<true/>
|
|
171
|
+
<key>KeepAlive</key>
|
|
172
|
+
<dict>
|
|
173
|
+
<key>SuccessfulExit</key>
|
|
174
|
+
<false/>
|
|
175
|
+
</dict>
|
|
176
|
+
<key>ThrottleInterval</key>
|
|
177
|
+
<integer>30</integer>
|
|
178
|
+
<key>StandardOutPath</key>
|
|
179
|
+
${s(spec.logPath)}
|
|
180
|
+
<key>StandardErrorPath</key>
|
|
181
|
+
${s(spec.logPath)}
|
|
182
|
+
<key>EnvironmentVariables</key>
|
|
183
|
+
<dict>
|
|
184
|
+
<key>PATH</key>
|
|
185
|
+
${s(spec.pathEnv)}
|
|
186
|
+
<key>LANG</key>
|
|
187
|
+
${s(spec.lang)}
|
|
188
|
+
<key>ZEPH_LISTENER_SERVICE</key>
|
|
189
|
+
<string>1</string>
|
|
190
|
+
</dict>
|
|
191
|
+
</dict>
|
|
192
|
+
</plist>
|
|
193
|
+
`;
|
|
194
|
+
};
|
|
195
|
+
exports.renderLaunchAgentPlist = renderLaunchAgentPlist;
|
|
196
|
+
const unescapeXml = (value) => value.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&');
|
|
197
|
+
/** ProgramArguments strings, in order, from an installed plist. */
|
|
198
|
+
const readProgramArguments = (xml) => {
|
|
199
|
+
const block = /<key>ProgramArguments<\/key>\s*<array>([\s\S]*?)<\/array>/.exec(xml);
|
|
200
|
+
if (!block)
|
|
201
|
+
return [];
|
|
202
|
+
return [...block[1].matchAll(/<string>([\s\S]*?)<\/string>/g)].map((m) => unescapeXml(m[1]));
|
|
203
|
+
};
|
|
204
|
+
const readEnvValue = (xml, key) => {
|
|
205
|
+
const found = new RegExp(`<key>${key}</key>\\s*<string>([\\s\\S]*?)</string>`).exec(xml);
|
|
206
|
+
return found ? unescapeXml(found[1]) : null;
|
|
207
|
+
};
|
|
208
|
+
const NOT_INSTALLED = {
|
|
209
|
+
installed: false,
|
|
210
|
+
nodePath: null,
|
|
211
|
+
cliPath: null,
|
|
212
|
+
pathEnv: null,
|
|
213
|
+
langEnv: null,
|
|
214
|
+
missing: [],
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* What is registered on this machine and whether it can still run. The single
|
|
218
|
+
* source `verify`, `--service-status` and the `zeph cc` branch all read, so
|
|
219
|
+
* they can never disagree about whether a service is installed.
|
|
220
|
+
*/
|
|
221
|
+
const serviceStatus = () => {
|
|
222
|
+
const plistPath = (0, exports.servicePlistPath)();
|
|
223
|
+
const base = { supported: (0, exports.serviceSupported)(), label: exports.SERVICE_LABEL, plistPath };
|
|
224
|
+
if (!(0, node_fs_1.existsSync)(plistPath))
|
|
225
|
+
return { ...base, ...NOT_INSTALLED };
|
|
226
|
+
let xml = '';
|
|
227
|
+
try {
|
|
228
|
+
xml = (0, node_fs_1.readFileSync)(plistPath, 'utf-8');
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
// The plist is there but unreadable — installed, nothing knowable.
|
|
232
|
+
return { ...base, ...NOT_INSTALLED, installed: true };
|
|
233
|
+
}
|
|
234
|
+
const [nodePath = null, cliPath = null] = readProgramArguments(xml);
|
|
235
|
+
const missing = [nodePath, cliPath].filter((p) => !!p && !(0, node_fs_1.existsSync)(p));
|
|
236
|
+
return {
|
|
237
|
+
...base,
|
|
238
|
+
installed: true,
|
|
239
|
+
nodePath,
|
|
240
|
+
cliPath,
|
|
241
|
+
pathEnv: readEnvValue(xml, 'PATH'),
|
|
242
|
+
langEnv: readEnvValue(xml, 'LANG'),
|
|
243
|
+
missing,
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
exports.serviceStatus = serviceStatus;
|
|
247
|
+
/** How long to give launchd to get the daemon up before calling the install
|
|
248
|
+
* a failure. Generous: the daemon writes its pid file as its first act. */
|
|
249
|
+
const POST_INSTALL_SETTLE_MS = 3_000;
|
|
250
|
+
const runLaunchctl = (args) => {
|
|
251
|
+
try {
|
|
252
|
+
(0, node_child_process_1.execFileSync)('launchctl', args, { stdio: ['ignore', 'ignore', 'pipe'] });
|
|
253
|
+
return { ok: true, stderr: '' };
|
|
254
|
+
}
|
|
255
|
+
catch (err) {
|
|
256
|
+
const stderr = err.stderr?.toString().trim() ?? '';
|
|
257
|
+
return { ok: false, stderr };
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
exports.defaultServiceOpDeps = {
|
|
261
|
+
supported: exports.serviceSupported,
|
|
262
|
+
resolveSpec: () => (0, exports.resolveServiceSpec)(),
|
|
263
|
+
runningPid: listener_process_js_1.runningListenerPid,
|
|
264
|
+
stopListener: listener_process_js_1.stopListener,
|
|
265
|
+
launchctl: runLaunchctl,
|
|
266
|
+
settle: listener_process_js_1.sleep,
|
|
267
|
+
};
|
|
268
|
+
const UNSUPPORTED = 'the login-time service needs launchd — only macOS is supported today ' +
|
|
269
|
+
'(run `zeph listener` yourself, or keep using `zeph cc` to autostart it)';
|
|
270
|
+
/**
|
|
271
|
+
* Register the LaunchAgent and get the daemon running under it.
|
|
272
|
+
*
|
|
273
|
+
* The order is load-bearing, not incidental:
|
|
274
|
+
*
|
|
275
|
+
* - **Any listener already running is stopped first.** `handleListener` exits
|
|
276
|
+
* **0** when it finds another listener alive, and it only does so quietly
|
|
277
|
+
* under ZEPH_LISTENER_AUTOSTART, which a launchd job does not have. So a
|
|
278
|
+
* kickstart into a live `zeph cc` daemon produces a clean exit, and
|
|
279
|
+
* `KeepAlive:{SuccessfulExit:false}` reads a clean exit as "stay down" —
|
|
280
|
+
* for the whole login session. `launchctl list` shows the job; nothing runs.
|
|
281
|
+
* - **Nothing is written until the spec resolves.** A refusal leaves the
|
|
282
|
+
* machine exactly as it was.
|
|
283
|
+
* - **The daemon is confirmed alive afterwards.** Without that check the
|
|
284
|
+
* failure above ships silently.
|
|
285
|
+
*/
|
|
286
|
+
const installService = async (deps = exports.defaultServiceOpDeps) => {
|
|
287
|
+
const notes = [];
|
|
288
|
+
if (!deps.supported())
|
|
289
|
+
return { ok: false, reason: UNSUPPORTED, notes };
|
|
290
|
+
const spec = deps.resolveSpec();
|
|
291
|
+
if (!spec.ok)
|
|
292
|
+
return { ok: false, reason: spec.reason, notes };
|
|
293
|
+
if (spec.warning)
|
|
294
|
+
notes.push(spec.warning);
|
|
295
|
+
const running = deps.runningPid();
|
|
296
|
+
if (running !== null) {
|
|
297
|
+
await deps.stopListener(running);
|
|
298
|
+
notes.push(`stopped the listener already running (pid ${running}) so launchd can own it`);
|
|
299
|
+
}
|
|
300
|
+
// Nothing to unload before a first install — that failure is the normal path.
|
|
301
|
+
deps.launchctl(['bootout', serviceTarget()]);
|
|
302
|
+
const plistPath = (0, exports.servicePlistPath)();
|
|
303
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(plistPath), { recursive: true });
|
|
304
|
+
(0, node_fs_1.writeFileSync)(plistPath, (0, exports.renderLaunchAgentPlist)(spec.value));
|
|
305
|
+
notes.push(`wrote ${plistPath}`);
|
|
306
|
+
const bootstrap = deps.launchctl(['bootstrap', serviceDomain(), plistPath]);
|
|
307
|
+
if (!bootstrap.ok) {
|
|
308
|
+
return { ok: false, reason: `launchctl bootstrap failed: ${bootstrap.stderr || 'no detail'}`, notes };
|
|
309
|
+
}
|
|
310
|
+
// Best-effort: a job disabled by an earlier `launchctl disable` (ours never
|
|
311
|
+
// calls it, but a user's hand might have) would otherwise refuse to start.
|
|
312
|
+
deps.launchctl(['enable', serviceTarget()]);
|
|
313
|
+
const kickstart = deps.launchctl(['kickstart', '-k', serviceTarget()]);
|
|
314
|
+
if (!kickstart.ok) {
|
|
315
|
+
return { ok: false, reason: `launchctl kickstart failed: ${kickstart.stderr || 'no detail'}`, notes };
|
|
316
|
+
}
|
|
317
|
+
await deps.settle(POST_INSTALL_SETTLE_MS);
|
|
318
|
+
if (deps.runningPid() === null) {
|
|
319
|
+
return {
|
|
320
|
+
ok: false,
|
|
321
|
+
reason: `the service was registered but the listener did not stay up — see ${listener_process_js_1.LISTENER_LOG_FILE}`,
|
|
322
|
+
notes,
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
return { ok: true, notes };
|
|
326
|
+
};
|
|
327
|
+
exports.installService = installService;
|
|
328
|
+
/** Unregister the job and remove the plist. Doing only one of the two leaves
|
|
329
|
+
* either a running service with no plist or a plist launchd ignores. */
|
|
330
|
+
const uninstallService = async (deps = exports.defaultServiceOpDeps) => {
|
|
331
|
+
const notes = [];
|
|
332
|
+
const plistPath = (0, exports.servicePlistPath)();
|
|
333
|
+
if (!(0, node_fs_1.existsSync)(plistPath))
|
|
334
|
+
return { ok: true, notes: ['service not installed — nothing to remove'] };
|
|
335
|
+
deps.launchctl(['bootout', serviceTarget()]);
|
|
336
|
+
notes.push(`unloaded ${exports.SERVICE_LABEL}`);
|
|
337
|
+
(0, node_fs_1.rmSync)(plistPath, { force: true });
|
|
338
|
+
notes.push(`removed ${plistPath}`);
|
|
339
|
+
return { ok: true, notes };
|
|
340
|
+
};
|
|
341
|
+
exports.uninstallService = uninstallService;
|
|
342
|
+
/** One launchctl call reported as a ServiceOpResult, naming the subcommand in
|
|
343
|
+
* the failure so the user sees which step launchd refused. */
|
|
344
|
+
const askLaunchd = (deps, args, note) => {
|
|
345
|
+
const result = deps.launchctl(args);
|
|
346
|
+
if (result.ok)
|
|
347
|
+
return { ok: true, notes: [note] };
|
|
348
|
+
return { ok: false, reason: `launchctl ${args[0]} failed: ${result.stderr || 'no detail'}`, notes: [] };
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* Stop the service until the next login.
|
|
352
|
+
*
|
|
353
|
+
* `bootout` and not `disable`: disable writes to launchd's persistent disabled
|
|
354
|
+
* database, survives logins, and leaves no obvious way back — a `--stop` that
|
|
355
|
+
* quietly becomes permanent. Session-scoped is what stopping should mean.
|
|
356
|
+
*/
|
|
357
|
+
const stopService = (deps = exports.defaultServiceOpDeps) => askLaunchd(deps, ['bootout', serviceTarget()], `unloaded ${exports.SERVICE_LABEL} — it comes back at the next login`);
|
|
358
|
+
exports.stopService = stopService;
|
|
359
|
+
/** Restart the service in place. `-k` kills the running instance first, so this
|
|
360
|
+
* is also how a version-drifted daemon is replaced. */
|
|
361
|
+
const restartService = (deps = exports.defaultServiceOpDeps) => askLaunchd(deps, ['kickstart', '-k', serviceTarget()], `restarted ${exports.SERVICE_LABEL}`);
|
|
362
|
+
exports.restartService = restartService;
|
|
363
|
+
const pathHasTmux = (pathEnv) => pathEnv.split(':').filter(Boolean).some((dir) => (0, node_fs_1.existsSync)((0, node_path_1.join)(dir, 'tmux')));
|
|
364
|
+
const jobIsLoaded = () => runLaunchctl(['print', serviceTarget()]).ok;
|
|
365
|
+
exports.defaultServiceProbe = { tmuxOnPath: pathHasTmux, loaded: jobIsLoaded };
|
|
366
|
+
/**
|
|
367
|
+
* Why this exists: every way the service breaks leaves it looking installed.
|
|
368
|
+
* `launchctl list` shows the job whether or not its interpreter still exists,
|
|
369
|
+
* and a PATH without tmux makes the daemon exit 127 at every login while the
|
|
370
|
+
* registration sits there unchanged. None of that is visible without asking.
|
|
371
|
+
*/
|
|
372
|
+
const serviceHealthChecks = (status, probe = exports.defaultServiceProbe) => {
|
|
373
|
+
if (!status.supported)
|
|
374
|
+
return [];
|
|
375
|
+
if (!status.installed) {
|
|
376
|
+
return [
|
|
377
|
+
{
|
|
378
|
+
label: 'no login-time service — after a reboot the phone sees nothing until you run `zeph cc` '
|
|
379
|
+
+ '(add it: zeph listener --install-service)',
|
|
380
|
+
state: 'warn',
|
|
381
|
+
},
|
|
382
|
+
];
|
|
383
|
+
}
|
|
384
|
+
const rows = [{ label: `${status.label} registered`, state: 'pass' }];
|
|
385
|
+
if (status.missing.length > 0) {
|
|
386
|
+
rows.push({
|
|
387
|
+
label: `service points at ${status.missing.join(', ')} — gone. Re-run: zeph listener --install-service`,
|
|
388
|
+
state: 'fail',
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
else {
|
|
392
|
+
rows.push({ label: 'service programs still exist', state: 'pass' });
|
|
393
|
+
}
|
|
394
|
+
// launchd hands the job its own bare PATH, so tmux has to come from what
|
|
395
|
+
// the plist baked in. Without it verifyTmux() exits 127 at every login.
|
|
396
|
+
if (status.pathEnv && probe.tmuxOnPath(status.pathEnv)) {
|
|
397
|
+
rows.push({ label: 'tmux reachable from the service PATH', state: 'pass' });
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
rows.push({
|
|
401
|
+
label: 'tmux NOT on the service PATH — the daemon exits 127 at login. '
|
|
402
|
+
+ 'Re-run: zeph listener --install-service',
|
|
403
|
+
state: 'fail',
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
// Without a UTF-8 LANG, tmux escapes the U+241F field separator to `_` and
|
|
407
|
+
// every session is dropped as unparseable — with nothing in the log that
|
|
408
|
+
// says so except a raw line the user has no reason to read as fatal.
|
|
409
|
+
if (status.langEnv && /utf-?8$/i.test(status.langEnv)) {
|
|
410
|
+
rows.push({ label: 'service locale is UTF-8', state: 'pass' });
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
rows.push({
|
|
414
|
+
label: 'service LANG is not UTF-8 — tmux mangles the session separator and every session is dropped. '
|
|
415
|
+
+ 'Re-run: zeph listener --install-service',
|
|
416
|
+
state: 'fail',
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
rows.push(probe.loaded()
|
|
420
|
+
? { label: 'launchd is running the job', state: 'pass' }
|
|
421
|
+
: { label: 'registered but launchd is not running it — it returns at the next login', state: 'warn' });
|
|
422
|
+
return rows;
|
|
423
|
+
};
|
|
424
|
+
exports.serviceHealthChecks = serviceHealthChecks;
|
package/dist/listener.d.ts
CHANGED
|
@@ -303,6 +303,36 @@ export declare const SESSION_EXIT_STEP_MS = 1500;
|
|
|
303
303
|
* that can silently destroy a working agent is a worse thing to have built.
|
|
304
304
|
*/
|
|
305
305
|
export declare const handleSessionExitRequest: (req: SessionExitRequest, send: (data: Record<string, unknown>) => void) => boolean;
|
|
306
|
+
export interface SessionForgetRequest {
|
|
307
|
+
subtype?: string;
|
|
308
|
+
targetDeviceId?: string;
|
|
309
|
+
sessionName?: string;
|
|
310
|
+
requestId?: string;
|
|
311
|
+
}
|
|
312
|
+
export interface SessionForgetResult {
|
|
313
|
+
subtype: 'agent.session.forget.result';
|
|
314
|
+
requestId: string;
|
|
315
|
+
sessionName: string;
|
|
316
|
+
forgotten?: true;
|
|
317
|
+
error?: string;
|
|
318
|
+
at: string;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Delete one ended session from this machine's record, and say what happened.
|
|
322
|
+
* Returns true when the message was ours to answer.
|
|
323
|
+
*
|
|
324
|
+
* The mirror of resume, and destructive where that one is constructive: it
|
|
325
|
+
* takes the entry out of the registry, which is the same file resume reads its
|
|
326
|
+
* whitelist from. After this the session is neither offered nor startable, and
|
|
327
|
+
* nothing puts it back — `rememberSessions` only writes down sessions that are
|
|
328
|
+
* running, so only actually running that name again restores it.
|
|
329
|
+
*
|
|
330
|
+
* The refusals: unknown name is nothing to delete rather than something to
|
|
331
|
+
* guess at. Still running means it is not a past session at all — the phone is
|
|
332
|
+
* looking at a live one, and ending it is a different request that this must
|
|
333
|
+
* not quietly stand in for.
|
|
334
|
+
*/
|
|
335
|
+
export declare const handleSessionForgetRequest: (req: SessionForgetRequest, send: (data: Record<string, unknown>) => void) => boolean;
|
|
306
336
|
/** Ceiling on one page. A page past the frame limit arrives truncated anyway,
|
|
307
337
|
* so let the caller ask for less rather than pay for a capture we discard. */
|
|
308
338
|
export declare const SCREEN_HISTORY_MAX_LINES = 200;
|
|
@@ -362,6 +392,25 @@ export interface ScreenHistorySnapshot {
|
|
|
362
392
|
* half refuses.
|
|
363
393
|
*/
|
|
364
394
|
export declare const handleScreenHistoryRequest: (req: ScreenHistoryRequest, send: (data: Record<string, unknown>) => void) => boolean;
|
|
395
|
+
export interface PaneGeometry {
|
|
396
|
+
x: number;
|
|
397
|
+
y: number;
|
|
398
|
+
height: number;
|
|
399
|
+
/** Lines of scrollback the pane holds above the visible rows. Tells the
|
|
400
|
+
* viewer where this frame's window sits in the buffer, which is what lets
|
|
401
|
+
* it record the lines that scroll past without matching text. Absent when
|
|
402
|
+
* tmux did not answer with a usable number. */
|
|
403
|
+
historySize?: number;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Read the one tmux answer the frame path already asks for per tick.
|
|
407
|
+
*
|
|
408
|
+
* The depth is parsed separately from the cursor on purpose: a tmux that does
|
|
409
|
+
* not report `history_size` still reports the cursor, and refusing the whole
|
|
410
|
+
* answer over the missing field would cost every frame its cursor — a
|
|
411
|
+
* regression in exchange for a feature.
|
|
412
|
+
*/
|
|
413
|
+
export declare const parsePaneGeometry: (raw: string) => PaneGeometry | null;
|
|
365
414
|
/**
|
|
366
415
|
* Translate the cursor into an index into the lines the frame carries.
|
|
367
416
|
*
|
|
@@ -472,6 +521,15 @@ export type StreamFramePayload = {
|
|
|
472
521
|
* constant. Plaintext for the same reason the cursor is: a line count
|
|
473
522
|
* without the lines says nothing. */
|
|
474
523
|
historyLines?: number;
|
|
524
|
+
/** How much scrollback the PANE holds above its visible rows — the depth
|
|
525
|
+
* this frame's window sits in, where `historyLines` is only the slice of
|
|
526
|
+
* it the frame carries. Together they place the frame's top edge in the
|
|
527
|
+
* buffer, which is what lets a viewer record the lines that scroll past
|
|
528
|
+
* without matching text (a redrawing TUI defeats text matching), and lets
|
|
529
|
+
* it see the buffer being cleared as the depth dropping. Absent when tmux
|
|
530
|
+
* would not say. Plaintext for the same reason the cursor is: a line count
|
|
531
|
+
* without the lines says nothing. */
|
|
532
|
+
historySize?: number;
|
|
475
533
|
/** Plaintext pane content — only on unencrypted streams. */
|
|
476
534
|
content?: string;
|
|
477
535
|
/** E2EE envelope — replaces `content` on encrypted streams. */
|
|
@@ -515,6 +573,7 @@ export declare const buildStreamFrame: (captured: {
|
|
|
515
573
|
col: number;
|
|
516
574
|
} | null;
|
|
517
575
|
historyLines?: number;
|
|
576
|
+
historySize?: number;
|
|
518
577
|
}) => Promise<StreamFramePayload | null>;
|
|
519
578
|
/**
|
|
520
579
|
* Handle agent.stream.start / agent.stream.stop. Returns true when the message
|
package/dist/listener.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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1B,SAAS,MAAM,KAChB,MAAM,GAAG,IAIX,CAAC;AA6HF,eAAO,MAAM,cAAc,GAAU,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAG,OAAO,CAAC,MAAM,CAwJ3F,CAAC"}
|
package/dist/listener.js
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-hook.d.ts","sourceRoot":"","sources":["../src/remote-hook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-hook.d.ts","sourceRoot":"","sources":["../src/remote-hook.ts"],"names":[],"mappings":"AAyCA;wEACwE;AACxE,eAAO,MAAM,kBAAkB,8BAA+B,CAAC;AAC/D,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAoClE,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,KAAG,GAAG,IAAI,eACE,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,eAAe,EACtB,OAAO,MAAM,EACb,MAAK,MAAM,CAAC,UAAwB,EACpC,MAAK,MAAM,MAAiB,KAC3B,MAAM,GAAG,IA0CX,CAAC"}
|
package/dist/remote-hook.js
CHANGED
|
@@ -31,6 +31,7 @@ exports.runRemoteHook = exports.isRemoteHookAgent = exports.REMOTE_HOOK_AGENTS =
|
|
|
31
31
|
* context and must never block a prompt.
|
|
32
32
|
*/
|
|
33
33
|
const fs_1 = require("fs");
|
|
34
|
+
const config_js_1 = require("./config.js");
|
|
34
35
|
const gate_js_1 = require("./gate.js");
|
|
35
36
|
/** Agents whose prompt-submit hooks this command serves. Claude Code is
|
|
36
37
|
* NOT here — its hook ships with the plugin (hooks/zeph-remote.sh). */
|
|
@@ -54,7 +55,7 @@ const TWO_WAY_CONTEXT = `# System note (Zeph remote-origin detect)
|
|
|
54
55
|
This user message arrived from the user's phone via Zeph agent chat (verified by the listener — exact text match). The user is driving this session remotely and is NOT at the terminal. Enter sticky REMOTE mode now (CORE_RULES Rule 9): end EVERY response with \`zeph_ask\` (buttons + free-text) until the user exits — an exit signal (done/stop/exit), or a prompt they type at the terminal, which this hook will tell you about. Plain-text questions are invisible to them.`;
|
|
55
56
|
const ONE_WAY_CONTEXT = `# System note (Zeph remote-origin detect)
|
|
56
57
|
|
|
57
|
-
This user message arrived from the user's phone via Zeph agent chat (verified by the listener — exact text match), but
|
|
58
|
+
This user message arrived from the user's phone via Zeph agent chat (verified by the listener — exact text match), but no hook id is configured (neither \`ZEPH_HOOK_ID\` nor \`hookId\` in ~/.zeph/config.json), so two-way tools (zeph_ask/zeph_prompt/zeph_input) are unavailable. Make your final message self-contained — the completion push is the user's only feedback channel. If you have not already mentioned it this session, tell the user once that running \`npx @zeph-to/cli setup\` upgrades this into a two-way remote session (buttons + text replies from the phone).`;
|
|
58
59
|
/**
|
|
59
60
|
* The first prompt a remote session's user types at the terminal. Emitted
|
|
60
61
|
* once — the state is cleared with it, so every later terminal turn is a
|
|
@@ -96,14 +97,16 @@ const runRemoteHook = (agent, stdin, env = process.env, now = Date.now) => {
|
|
|
96
97
|
// leaves the mode as it was.
|
|
97
98
|
const origin = remoteOrigin(prompt, cwd, now);
|
|
98
99
|
if (origin === 'phone') {
|
|
99
|
-
|
|
100
|
+
// Resolved on the two branches that need it, not up front — the common
|
|
101
|
+
// no-marker path never reads the config file.
|
|
102
|
+
if (!(0, config_js_1.resolveHookId)(env))
|
|
100
103
|
return emit(ONE_WAY_CONTEXT);
|
|
101
104
|
// Only a two-way session has a mode to stay in — without zeph_ask there is
|
|
102
105
|
// nothing for a later turn to be reminded of, so no state is recorded.
|
|
103
106
|
(0, gate_js_1.touchRemoteActive)(cwd, now);
|
|
104
107
|
return emit(TWO_WAY_CONTEXT);
|
|
105
108
|
}
|
|
106
|
-
if (origin === 'keyboard' &&
|
|
109
|
+
if (origin === 'keyboard' && (0, gate_js_1.isRemoteActive)(cwd, now) && (0, config_js_1.resolveHookId)(env)) {
|
|
107
110
|
(0, gate_js_1.clearRemoteActive)(cwd);
|
|
108
111
|
return emit(EXIT_CONTEXT);
|
|
109
112
|
}
|
|
@@ -54,6 +54,19 @@ export declare const rememberSessions: (live: Array<{
|
|
|
54
54
|
project?: string | null;
|
|
55
55
|
label?: string | null;
|
|
56
56
|
}>, now?: number) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Forget one session, by name. Returns false when this machine never knew it.
|
|
59
|
+
*
|
|
60
|
+
* This is what deleting a past session means on the machine that ran it: the
|
|
61
|
+
* entry leaves the file, so the phone stops being offered the session AND —
|
|
62
|
+
* since this file is the resume whitelist — stops being able to start it.
|
|
63
|
+
* That is the intended pair, not a side effect.
|
|
64
|
+
*
|
|
65
|
+
* It stays forgotten: `rememberSessions` only writes down sessions that are
|
|
66
|
+
* running, so nothing re-adds an entry for a session that has ended. Running
|
|
67
|
+
* that name again is what brings it back, which is also the only way back.
|
|
68
|
+
*/
|
|
69
|
+
export declare const forgetSession: (name: string) => boolean;
|
|
57
70
|
/** Whether the registry knows this name — the resume whitelist check. */
|
|
58
71
|
export declare const isKnownSession: (name: string, now?: number) => boolean;
|
|
59
72
|
/** Test seam: the file this module reads and writes. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-registry.d.ts","sourceRoot":"","sources":["../src/session-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,MAAM,WAAW,YAAY;IACzB,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,GAAG,EAAE,MAAM,CAAC;IACZ,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC;2DAC2D;AAC3D,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