@hwip/cli 0.0.1 → 0.1.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/LICENSE +190 -0
- package/NOTICE +11 -0
- package/README.md +1979 -0
- package/dist/agent-list.d.ts +76 -0
- package/dist/agent-list.js +102 -0
- package/dist/agent-read.d.ts +105 -0
- package/dist/agent-read.js +309 -0
- package/dist/agent-rules-fetch.d.ts +51 -0
- package/dist/agent-rules-fetch.js +275 -0
- package/dist/agent-rules.default.d.ts +30 -0
- package/dist/agent-rules.default.js +292 -0
- package/dist/agent-session.d.ts +23 -0
- package/dist/agent-session.js +44 -0
- package/dist/agent-state.d.ts +84 -0
- package/dist/agent-state.js +188 -0
- package/dist/agent-target.d.ts +60 -0
- package/dist/agent-target.js +81 -0
- package/dist/agents.d.ts +31 -0
- package/dist/agents.js +75 -0
- package/dist/api.d.ts +28 -0
- package/dist/api.js +76 -0
- package/dist/args.d.ts +74 -0
- package/dist/args.js +254 -0
- package/dist/ask-context-attach.d.ts +73 -0
- package/dist/ask-context-attach.js +151 -0
- package/dist/ask-context-screen.d.ts +21 -0
- package/dist/ask-context-screen.js +49 -0
- package/dist/ask-context-switch.d.ts +31 -0
- package/dist/ask-context-switch.js +74 -0
- package/dist/ask-context.d.ts +84 -0
- package/dist/ask-context.js +172 -0
- package/dist/ask-pending.d.ts +47 -0
- package/dist/ask-pending.js +221 -0
- package/dist/ask-seal.d.ts +120 -0
- package/dist/ask-seal.js +179 -0
- package/dist/ask.d.ts +107 -0
- package/dist/ask.js +551 -0
- package/dist/blocked-prompt-seal.d.ts +35 -0
- package/dist/blocked-prompt-seal.js +89 -0
- package/dist/blocked-prompt.d.ts +57 -0
- package/dist/blocked-prompt.js +181 -0
- package/dist/channel.d.ts +67 -0
- package/dist/channel.js +136 -0
- package/dist/check-update.d.ts +28 -0
- package/dist/check-update.js +153 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +813 -0
- package/dist/codex-config.d.ts +24 -0
- package/dist/codex-config.js +169 -0
- package/dist/codex-transcript.d.ts +59 -0
- package/dist/codex-transcript.js +373 -0
- package/dist/command-refusal.d.ts +56 -0
- package/dist/command-refusal.js +127 -0
- package/dist/command-scan.d.ts +46 -0
- package/dist/command-scan.js +154 -0
- package/dist/command-seal.d.ts +57 -0
- package/dist/command-seal.js +88 -0
- package/dist/command-seq.d.ts +30 -0
- package/dist/command-seq.js +150 -0
- package/dist/config.d.ts +156 -0
- package/dist/config.js +392 -0
- package/dist/core-sections.d.ts +18 -0
- package/dist/core-sections.js +28 -0
- package/dist/crypto.d.ts +278 -0
- package/dist/crypto.js +698 -0
- package/dist/desktop-notify.d.ts +33 -0
- package/dist/desktop-notify.js +49 -0
- package/dist/device-directory.d.ts +36 -0
- package/dist/device-directory.js +97 -0
- package/dist/device-presence.d.ts +17 -0
- package/dist/device-presence.js +62 -0
- package/dist/downloads.d.ts +29 -0
- package/dist/downloads.js +106 -0
- package/dist/errors.d.ts +12 -0
- package/dist/errors.js +28 -0
- package/dist/file-crypto.d.ts +94 -0
- package/dist/file-crypto.js +272 -0
- package/dist/file-view-budget.d.ts +15 -0
- package/dist/file-view-budget.js +34 -0
- package/dist/file-view-switch.d.ts +28 -0
- package/dist/file-view-switch.js +122 -0
- package/dist/file-view.d.ts +108 -0
- package/dist/file-view.js +327 -0
- package/dist/gate.d.ts +141 -0
- package/dist/gate.js +336 -0
- package/dist/gemini-transcript.d.ts +32 -0
- package/dist/gemini-transcript.js +189 -0
- package/dist/http-failure.d.ts +98 -0
- package/dist/http-failure.js +349 -0
- package/dist/hwip-core.generated.d.ts +7 -0
- package/dist/hwip-core.generated.js +14 -0
- package/dist/hwip-hook.d.ts +77 -0
- package/dist/hwip-hook.js +340 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +14 -0
- package/dist/input-sequencer.d.ts +65 -0
- package/dist/input-sequencer.js +142 -0
- package/dist/insecure-url.d.ts +16 -0
- package/dist/insecure-url.js +76 -0
- package/dist/installer.d.ts +96 -0
- package/dist/installer.js +850 -0
- package/dist/inventory-offload.d.ts +49 -0
- package/dist/inventory-offload.js +209 -0
- package/dist/inventory-worker.d.ts +2 -0
- package/dist/inventory-worker.js +27 -0
- package/dist/jsonc-doc.d.ts +106 -0
- package/dist/jsonc-doc.js +354 -0
- package/dist/keep-awake.d.ts +32 -0
- package/dist/keep-awake.js +46 -0
- package/dist/key-changes.d.ts +48 -0
- package/dist/key-changes.js +140 -0
- package/dist/lan-auth.d.ts +140 -0
- package/dist/lan-auth.js +217 -0
- package/dist/lan-endpoint.d.ts +41 -0
- package/dist/lan-endpoint.js +115 -0
- package/dist/lan-receiver.d.ts +122 -0
- package/dist/lan-receiver.js +510 -0
- package/dist/lan-sender.d.ts +76 -0
- package/dist/lan-sender.js +184 -0
- package/dist/lan-transfer.d.ts +36 -0
- package/dist/lan-transfer.js +54 -0
- package/dist/listener-device-id.d.ts +20 -0
- package/dist/listener-device-id.js +133 -0
- package/dist/listener-log.d.ts +4 -0
- package/dist/listener-log.js +23 -0
- package/dist/listener-process.d.ts +200 -0
- package/dist/listener-process.js +470 -0
- package/dist/listener-service.d.ts +225 -0
- package/dist/listener-service.js +682 -0
- package/dist/listener-worktree-cleanup.d.ts +27 -0
- package/dist/listener-worktree-cleanup.js +62 -0
- package/dist/listener.d.ts +1325 -0
- package/dist/listener.js +5680 -0
- package/dist/login-address.d.ts +25 -0
- package/dist/login-address.js +97 -0
- package/dist/login-page.d.ts +29 -0
- package/dist/login-page.js +93 -0
- package/dist/login.d.ts +98 -0
- package/dist/login.js +388 -0
- package/dist/mcp-command.d.ts +45 -0
- package/dist/mcp-command.js +50 -0
- package/dist/mcp.d.ts +19 -0
- package/dist/mcp.js +29 -0
- package/dist/node-support.d.ts +19 -0
- package/dist/node-support.js +38 -0
- package/dist/notify-failure.d.ts +57 -0
- package/dist/notify-failure.js +150 -0
- package/dist/opencode-transcript.d.ts +139 -0
- package/dist/opencode-transcript.js +390 -0
- package/dist/optional-features.d.ts +6 -0
- package/dist/optional-features.js +19 -0
- package/dist/pane-fit.d.ts +40 -0
- package/dist/pane-fit.js +119 -0
- package/dist/peer-key.d.ts +33 -0
- package/dist/peer-key.js +34 -0
- package/dist/pi-transcript.d.ts +26 -0
- package/dist/pi-transcript.js +255 -0
- package/dist/presence.d.ts +14 -0
- package/dist/presence.js +124 -0
- package/dist/private-files.d.ts +51 -0
- package/dist/private-files.js +218 -0
- package/dist/project-switch.d.ts +19 -0
- package/dist/project-switch.js +60 -0
- package/dist/redact.d.ts +10 -0
- package/dist/redact.js +21 -0
- package/dist/remote-agents.d.ts +410 -0
- package/dist/remote-agents.js +1218 -0
- package/dist/remote-hook.d.ts +12 -0
- package/dist/remote-hook.js +196 -0
- package/dist/replace-file.d.ts +50 -0
- package/dist/replace-file.js +328 -0
- package/dist/schedule-command.d.ts +35 -0
- package/dist/schedule-command.js +260 -0
- package/dist/schedule-launch.d.ts +15 -0
- package/dist/schedule-launch.js +24 -0
- package/dist/schedule-ready.d.ts +44 -0
- package/dist/schedule-ready.js +71 -0
- package/dist/schedule-remote.d.ts +77 -0
- package/dist/schedule-remote.js +167 -0
- package/dist/schedule-runner.d.ts +89 -0
- package/dist/schedule-runner.js +452 -0
- package/dist/schedule.d.ts +149 -0
- package/dist/schedule.js +428 -0
- package/dist/secret-mask.d.ts +29 -0
- package/dist/secret-mask.js +245 -0
- package/dist/self-register.d.ts +45 -0
- package/dist/self-register.js +67 -0
- package/dist/send.d.ts +56 -0
- package/dist/send.js +104 -0
- package/dist/session-diff.d.ts +161 -0
- package/dist/session-diff.js +445 -0
- package/dist/session-registry.d.ts +143 -0
- package/dist/session-registry.js +216 -0
- package/dist/sessions-report.d.ts +59 -0
- package/dist/sessions-report.js +99 -0
- package/dist/shell-audit.d.ts +34 -0
- package/dist/shell-audit.js +47 -0
- package/dist/subagent-transcripts.d.ts +167 -0
- package/dist/subagent-transcripts.js +437 -0
- package/dist/subscriber-trust.d.ts +128 -0
- package/dist/subscriber-trust.js +397 -0
- package/dist/templates.d.ts +105 -0
- package/dist/templates.js +871 -0
- package/dist/tmux-install.d.ts +44 -0
- package/dist/tmux-install.js +65 -0
- package/dist/tmux-liveness.d.ts +45 -0
- package/dist/tmux-liveness.js +71 -0
- package/dist/tmux-pane.d.ts +55 -0
- package/dist/tmux-pane.js +126 -0
- package/dist/tmux-socket.d.ts +20 -0
- package/dist/tmux-socket.js +292 -0
- package/dist/todo-fold.d.ts +31 -0
- package/dist/todo-fold.js +102 -0
- package/dist/transcript-tail.d.ts +312 -0
- package/dist/transcript-tail.js +718 -0
- package/dist/trust-command.d.ts +49 -0
- package/dist/trust-command.js +200 -0
- package/dist/trust-lock.d.ts +26 -0
- package/dist/trust-lock.js +94 -0
- package/dist/trust-pins.d.ts +37 -0
- package/dist/trust-pins.js +82 -0
- package/dist/turn-recorder-wire.d.ts +70 -0
- package/dist/turn-recorder-wire.js +165 -0
- package/dist/turn-recorder.d.ts +190 -0
- package/dist/turn-recorder.js +695 -0
- package/dist/turn-ring.d.ts +93 -0
- package/dist/turn-ring.js +418 -0
- package/dist/turn-watch.d.ts +177 -0
- package/dist/turn-watch.js +630 -0
- package/dist/types.d.ts +63 -0
- package/dist/types.js +2 -0
- package/dist/uninstall.d.ts +55 -0
- package/dist/uninstall.js +507 -0
- package/dist/usage.d.ts +17 -0
- package/dist/usage.js +421 -0
- package/dist/verify.d.ts +47 -0
- package/dist/verify.js +396 -0
- package/dist/worktree.d.ts +144 -0
- package/dist/worktree.js +310 -0
- package/dist/wrapper.d.ts +254 -0
- package/dist/wrapper.js +704 -0
- package/dist/ws-url.d.ts +109 -0
- package/dist/ws-url.js +202 -0
- package/package.json +78 -10
- package/bin/hwip.js +0 -3
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { type ListenerStop } from './listener-process.js';
|
|
2
|
+
/**
|
|
3
|
+
* The listener as an OS service: a launchd LaunchAgent on macOS, a systemd user
|
|
4
|
+
* unit on Linux, that starts it at user login so the phone's picker is populated
|
|
5
|
+
* without anyone opening a terminal.
|
|
6
|
+
*
|
|
7
|
+
* Until this existed, the only thing that ever started the daemon was
|
|
8
|
+
* `hwip cc` (wrapper.ts → startListenerDetached). After a reboot that means an
|
|
9
|
+
* empty picker until the user happens to launch an agent — the machine is
|
|
10
|
+
* online, the past sessions are on disk, and the app says "no agents".
|
|
11
|
+
*
|
|
12
|
+
* Two constraints shape this file:
|
|
13
|
+
*
|
|
14
|
+
* 1. **Node builtins only.** wrapper.ts reads `serviceInstalled()` on the
|
|
15
|
+
* `hwip cc` hot path, and the same rule that keeps listener.ts out of
|
|
16
|
+
* wrapper.ts (ws + the crypto stack on every agent launch) applies here.
|
|
17
|
+
* listener-process.ts is the one import, and it is builtins-only too.
|
|
18
|
+
*
|
|
19
|
+
* 2. **Everything the job needs is resolved at install time and baked into
|
|
20
|
+
* the plist.** launchd hands a job `/usr/bin:/bin:/usr/sbin:/sbin` and
|
|
21
|
+
* nothing else — no shell profile, no homebrew prefix. `verifyTmux()`
|
|
22
|
+
* (listener.ts) exits 127 when tmux is not on PATH, so a plist without a
|
|
23
|
+
* baked PATH produces a service that dies at every login and is restarted
|
|
24
|
+
* forever by KeepAlive. The interpreter is baked for the same reason.
|
|
25
|
+
*/
|
|
26
|
+
/** Reverse-DNS launchd label. Lives on the user's machine once installed —
|
|
27
|
+
* renaming it orphans every plist already out there. */
|
|
28
|
+
export declare const SERVICE_LABEL = "app.hwip.listener";
|
|
29
|
+
/** The systemd user unit: the same label, so every message that names
|
|
30
|
+
* SERVICE_LABEL names this unit too. */
|
|
31
|
+
export declare const SERVICE_UNIT = "app.hwip.listener.service";
|
|
32
|
+
export type ServiceManager = 'launchd' | 'systemd';
|
|
33
|
+
export interface ServiceSpec {
|
|
34
|
+
readonly nodePath: string;
|
|
35
|
+
readonly cliPath: string;
|
|
36
|
+
readonly tmuxPath: string;
|
|
37
|
+
readonly logPath: string;
|
|
38
|
+
/** PATH baked into the job: tmux dir, node dir, then launchd's own. */
|
|
39
|
+
readonly pathEnv: string;
|
|
40
|
+
/** UTF-8 locale baked into the job. Always UTF-8 — see resolveServiceSpec. */
|
|
41
|
+
readonly lang: string;
|
|
42
|
+
}
|
|
43
|
+
export type SpecResolution = {
|
|
44
|
+
readonly ok: true;
|
|
45
|
+
readonly value: ServiceSpec;
|
|
46
|
+
readonly warning?: string;
|
|
47
|
+
} | {
|
|
48
|
+
readonly ok: false;
|
|
49
|
+
readonly reason: string;
|
|
50
|
+
};
|
|
51
|
+
/** The machine facts spec resolution needs, injectable so tests describe a
|
|
52
|
+
* machine instead of inheriting the developer's own. */
|
|
53
|
+
export interface ServiceEnv {
|
|
54
|
+
readonly exists: (path: string) => boolean;
|
|
55
|
+
/** Version (`v24.15.0`) of the node at `path`, or null when it won't run. */
|
|
56
|
+
readonly nodeVersion: (path: string) => string | null;
|
|
57
|
+
/** Absolute tmux path from the invoking shell's PATH, or null. */
|
|
58
|
+
readonly whichTmux: () => string | null;
|
|
59
|
+
readonly cliPath: () => string | null;
|
|
60
|
+
/** The invoking shell's LANG, or undefined when it has none. */
|
|
61
|
+
readonly lang: () => string | undefined;
|
|
62
|
+
}
|
|
63
|
+
export interface ServiceStatus {
|
|
64
|
+
readonly manager: ServiceManager;
|
|
65
|
+
readonly supported: boolean;
|
|
66
|
+
readonly installed: boolean;
|
|
67
|
+
readonly label: string;
|
|
68
|
+
/** The file the service is registered from: the LaunchAgent plist, or under
|
|
69
|
+
* systemd the unit file. */
|
|
70
|
+
readonly plistPath: string;
|
|
71
|
+
/** Read back from the installed plist — null when nothing is installed. */
|
|
72
|
+
readonly nodePath: string | null;
|
|
73
|
+
readonly cliPath: string | null;
|
|
74
|
+
readonly pathEnv: string | null;
|
|
75
|
+
readonly langEnv: string | null;
|
|
76
|
+
/** Programs the plist names that are no longer on disk. The shape a node
|
|
77
|
+
* upgrade leaves behind: registered, listed by launchctl, unable to run. */
|
|
78
|
+
readonly missing: readonly string[];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Which service manager can run the listener here. macOS always has launchd.
|
|
82
|
+
* Linux has a systemd user manager only when one answers: a container, or a
|
|
83
|
+
* shell without a login session, may have none.
|
|
84
|
+
*/
|
|
85
|
+
export declare const serviceManager: (platform?: NodeJS.Platform, userManagerAnswers?: () => boolean) => ServiceManager | null;
|
|
86
|
+
/** launchd on macOS, a systemd user manager on Linux. Every other platform is
|
|
87
|
+
* an explicit refusal, never a quiet success. */
|
|
88
|
+
export declare const serviceSupported: () => boolean;
|
|
89
|
+
export declare const servicePlistPath: () => string;
|
|
90
|
+
/** Where systemd's user manager reads a user's own units: `$XDG_CONFIG_HOME/systemd/user`,
|
|
91
|
+
* else `~/.config/systemd/user` (systemd.unit(5), user unit search path). */
|
|
92
|
+
export declare const serviceUnitPath: () => string;
|
|
93
|
+
/** Read on the `hwip cc` hot path, so it goes by platform and checks a file —
|
|
94
|
+
* it never runs a program to ask whether systemd is there. */
|
|
95
|
+
export declare const serviceInstalled: () => boolean;
|
|
96
|
+
export declare const defaultServiceEnv: ServiceEnv;
|
|
97
|
+
/**
|
|
98
|
+
* Decide what to bake into the plist, or say why we can't. Nothing is written
|
|
99
|
+
* and nothing is registered — a caller that gets `ok: false` has touched
|
|
100
|
+
* nothing on the machine.
|
|
101
|
+
*/
|
|
102
|
+
export declare const resolveServiceSpec: (env?: ServiceEnv) => SpecResolution;
|
|
103
|
+
export declare const renderLaunchAgentPlist: (spec: ServiceSpec) => string;
|
|
104
|
+
/**
|
|
105
|
+
* What is registered on this machine and whether it can still run. The single
|
|
106
|
+
* source `verify`, `--service-status` and the `hwip cc` branch all read, so
|
|
107
|
+
* they can never disagree about whether a service is installed.
|
|
108
|
+
*/
|
|
109
|
+
export declare const serviceStatus: (manager?: ServiceManager | null) => ServiceStatus;
|
|
110
|
+
/**
|
|
111
|
+
* The unit holds what the plist holds, for the same reasons (see the top of
|
|
112
|
+
* this file): absolute node and CLI paths, a PATH that reaches tmux — the user
|
|
113
|
+
* manager's own PATH is whatever the distribution configured (systemd.exec(5),
|
|
114
|
+
* $PATH) — and a UTF-8 LANG.
|
|
115
|
+
*
|
|
116
|
+
* - `Restart=on-failure` + `RestartSec=30` is `KeepAlive:{SuccessfulExit:false}`
|
|
117
|
+
* + `ThrottleInterval 30`: a crash comes back, a clean exit stays down
|
|
118
|
+
* (systemd.service(5), Restart=).
|
|
119
|
+
* - `KillMode=process`: stop and restart kill the main process only. The
|
|
120
|
+
* default (`control-group`) would kill everything else left in the unit's
|
|
121
|
+
* cgroup — including the tmux server the listener started under this unit,
|
|
122
|
+
* and with it every agent session (launchd's detach spares it).
|
|
123
|
+
* systemd.kill(5) marks process "not recommended!", since it "allows
|
|
124
|
+
* processes to escape the service manager's lifecycle and resource
|
|
125
|
+
* management" — that escape is the point here: the tmux server is shared
|
|
126
|
+
* state, not a child of this service.
|
|
127
|
+
* - `append:` keeps the daemon writing ~/.hwip/listener.log, which `hwip verify`
|
|
128
|
+
* and the log rotation know, instead of the journal (systemd.exec(5)).
|
|
129
|
+
* - `WantedBy=default.target`: the user manager's main target, started with it
|
|
130
|
+
* at login (systemd.special(7), Special User Units).
|
|
131
|
+
*/
|
|
132
|
+
export declare const renderSystemdUnit: (spec: ServiceSpec) => string;
|
|
133
|
+
/**
|
|
134
|
+
* Side effects the service operations need, injectable so tests can drive the
|
|
135
|
+
* launchd sequence without a launchd.
|
|
136
|
+
*/
|
|
137
|
+
export interface ServiceOpDeps {
|
|
138
|
+
readonly supported: () => boolean;
|
|
139
|
+
readonly resolveSpec: () => SpecResolution;
|
|
140
|
+
/** PID of a listener running right now, or null. */
|
|
141
|
+
readonly runningPid: () => number | null;
|
|
142
|
+
readonly stopListener: (pid: number) => Promise<ListenerStop>;
|
|
143
|
+
readonly launchctl: (args: string[]) => {
|
|
144
|
+
ok: boolean;
|
|
145
|
+
stderr: string;
|
|
146
|
+
};
|
|
147
|
+
readonly settle: (ms: number) => Promise<void>;
|
|
148
|
+
}
|
|
149
|
+
/** The same operations under systemd: `systemctl --user` instead of launchctl. */
|
|
150
|
+
export interface SystemdOpDeps extends Omit<ServiceOpDeps, 'launchctl'> {
|
|
151
|
+
readonly systemctl: (args: string[]) => {
|
|
152
|
+
ok: boolean;
|
|
153
|
+
stderr: string;
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
export type ServiceOpResult = {
|
|
157
|
+
readonly ok: true;
|
|
158
|
+
readonly notes: readonly string[];
|
|
159
|
+
} | {
|
|
160
|
+
readonly ok: false;
|
|
161
|
+
readonly reason: string;
|
|
162
|
+
readonly notes: readonly string[];
|
|
163
|
+
};
|
|
164
|
+
export declare const defaultServiceOpDeps: ServiceOpDeps;
|
|
165
|
+
export declare const defaultSystemdOpDeps: SystemdOpDeps;
|
|
166
|
+
type OpDeps = ServiceOpDeps | SystemdOpDeps;
|
|
167
|
+
/**
|
|
168
|
+
* Register the service and get the daemon running under it.
|
|
169
|
+
*
|
|
170
|
+
* The order is load-bearing, not incidental:
|
|
171
|
+
*
|
|
172
|
+
* - **Any listener already running is stopped first.** `handleListener` exits
|
|
173
|
+
* **0** when it finds another listener alive, and it only does so quietly
|
|
174
|
+
* under HWIP_LISTENER_AUTOSTART, which a service does not have. So a
|
|
175
|
+
* kickstart into a live `hwip cc` daemon produces a clean exit, and
|
|
176
|
+
* `KeepAlive:{SuccessfulExit:false}` (systemd: `Restart=on-failure`) reads a
|
|
177
|
+
* clean exit as "stay down" — for the whole login session. The manager lists
|
|
178
|
+
* the job; nothing runs.
|
|
179
|
+
* - **Nothing is written until the spec resolves.** A refusal leaves the
|
|
180
|
+
* machine exactly as it was.
|
|
181
|
+
* - **The daemon is confirmed alive afterwards.** Without that check the
|
|
182
|
+
* failure above ships silently.
|
|
183
|
+
*
|
|
184
|
+
* The deps say which manager: launchctl for launchd, systemctl for systemd.
|
|
185
|
+
*/
|
|
186
|
+
export declare const installService: (deps?: OpDeps) => Promise<ServiceOpResult>;
|
|
187
|
+
/** Unregister the job and remove its file. Doing only one of the two leaves
|
|
188
|
+
* either a running service with no file or a file the manager ignores. */
|
|
189
|
+
export declare const uninstallService: (deps?: OpDeps) => Promise<ServiceOpResult>;
|
|
190
|
+
/**
|
|
191
|
+
* Stop the service until the next login.
|
|
192
|
+
*
|
|
193
|
+
* launchd: `bootout` and not `disable` — disable writes to launchd's persistent
|
|
194
|
+
* disabled database, survives logins, and leaves no obvious way back: a
|
|
195
|
+
* `--stop` that quietly becomes permanent. Session-scoped is what stopping
|
|
196
|
+
* should mean. systemd: `stop` leaves the unit enabled, so the user manager
|
|
197
|
+
* starts it again the next time it starts itself.
|
|
198
|
+
*/
|
|
199
|
+
export declare const stopService: (deps?: OpDeps) => ServiceOpResult;
|
|
200
|
+
/** Restart the service in place. Both kill the running instance first, so this
|
|
201
|
+
* is also how a version-drifted daemon is replaced. */
|
|
202
|
+
export declare const restartService: (deps?: OpDeps) => ServiceOpResult;
|
|
203
|
+
export interface ServiceHealthRow {
|
|
204
|
+
readonly label: string;
|
|
205
|
+
readonly state: 'pass' | 'warn' | 'fail';
|
|
206
|
+
}
|
|
207
|
+
/** The two live facts a health check can't read off the plist. */
|
|
208
|
+
export interface ServiceProbe {
|
|
209
|
+
/** Can a process started with this PATH find tmux? */
|
|
210
|
+
readonly tmuxOnPath: (pathEnv: string) => boolean;
|
|
211
|
+
/** Is the service manager actually running the job right now? */
|
|
212
|
+
readonly loaded: () => boolean;
|
|
213
|
+
}
|
|
214
|
+
export declare const defaultServiceProbe: ServiceProbe;
|
|
215
|
+
/** `is-active` exits 0 when the unit is running (systemctl(1)). */
|
|
216
|
+
export declare const systemdServiceProbe: ServiceProbe;
|
|
217
|
+
/**
|
|
218
|
+
* Why this exists: every way the service breaks leaves it looking installed.
|
|
219
|
+
* `launchctl list` shows the job whether or not its interpreter still exists,
|
|
220
|
+
* and a PATH without tmux makes the daemon exit 127 at every login while the
|
|
221
|
+
* registration sits there unchanged. None of that is visible without asking.
|
|
222
|
+
*/
|
|
223
|
+
export declare const serviceHealthChecks: (status: ServiceStatus, probe?: ServiceProbe) => ServiceHealthRow[];
|
|
224
|
+
export {};
|
|
225
|
+
//# sourceMappingURL=listener-service.d.ts.map
|