@geohar/un-bien 0.7.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 +21 -0
- package/README.md +726 -0
- package/dist/actions/handlers.d.ts +77 -0
- package/dist/actions/handlers.js +26 -0
- package/dist/actions/handlers.js.map +1 -0
- package/dist/actions/registry.d.ts +39 -0
- package/dist/actions/registry.js +62 -0
- package/dist/actions/registry.js.map +1 -0
- package/dist/bin/supervisord.d.ts +2 -0
- package/dist/bin/supervisord.js +86 -0
- package/dist/bin/supervisord.js.map +1 -0
- package/dist/config.d.ts +84 -0
- package/dist/config.js +115 -0
- package/dist/config.js.map +1 -0
- package/dist/daemon/client.d.ts +20 -0
- package/dist/daemon/client.js +131 -0
- package/dist/daemon/client.js.map +1 -0
- package/dist/daemon/control_protocol.d.ts +176 -0
- package/dist/daemon/control_protocol.js +63 -0
- package/dist/daemon/control_protocol.js.map +1 -0
- package/dist/daemon/cron_log.d.ts +45 -0
- package/dist/daemon/cron_log.js +71 -0
- package/dist/daemon/cron_log.js.map +1 -0
- package/dist/daemon/cron_registry.d.ts +80 -0
- package/dist/daemon/cron_registry.js +198 -0
- package/dist/daemon/cron_registry.js.map +1 -0
- package/dist/daemon/id.d.ts +24 -0
- package/dist/daemon/id.js +36 -0
- package/dist/daemon/id.js.map +1 -0
- package/dist/daemon/install.d.ts +170 -0
- package/dist/daemon/install.js +603 -0
- package/dist/daemon/install.js.map +1 -0
- package/dist/daemon/registry.d.ts +63 -0
- package/dist/daemon/registry.js +153 -0
- package/dist/daemon/registry.js.map +1 -0
- package/dist/daemon/rpc_child.d.ts +194 -0
- package/dist/daemon/rpc_child.js +419 -0
- package/dist/daemon/rpc_child.js.map +1 -0
- package/dist/daemon/supervisor.d.ts +93 -0
- package/dist/daemon/supervisor.js +666 -0
- package/dist/daemon/supervisor.js.map +1 -0
- package/dist/extension_ui_bridge.d.ts +26 -0
- package/dist/extension_ui_bridge.js +341 -0
- package/dist/extension_ui_bridge.js.map +1 -0
- package/dist/index.d.ts +197 -0
- package/dist/index.js +5750 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/mesh_result.d.ts +10 -0
- package/dist/mcp/mesh_result.js +42 -0
- package/dist/mcp/mesh_result.js.map +1 -0
- package/dist/mcp/mesh_server.d.ts +16 -0
- package/dist/mcp/mesh_server.js +373 -0
- package/dist/mcp/mesh_server.js.map +1 -0
- package/dist/mesh/canonical.d.ts +30 -0
- package/dist/mesh/canonical.js +63 -0
- package/dist/mesh/canonical.js.map +1 -0
- package/dist/mesh/client.d.ts +18 -0
- package/dist/mesh/client.js +127 -0
- package/dist/mesh/client.js.map +1 -0
- package/dist/mesh/encoding.d.ts +38 -0
- package/dist/mesh/encoding.js +217 -0
- package/dist/mesh/encoding.js.map +1 -0
- package/dist/mesh/self_revoke.d.ts +73 -0
- package/dist/mesh/self_revoke.js +407 -0
- package/dist/mesh/self_revoke.js.map +1 -0
- package/dist/mesh/siblings.d.ts +49 -0
- package/dist/mesh/siblings.js +159 -0
- package/dist/mesh/siblings.js.map +1 -0
- package/dist/mesh/types.d.ts +34 -0
- package/dist/mesh/types.js +11 -0
- package/dist/mesh/types.js.map +1 -0
- package/dist/mesh/verify.d.ts +17 -0
- package/dist/mesh/verify.js +86 -0
- package/dist/mesh/verify.js.map +1 -0
- package/dist/pairing/crypto.d.ts +8 -0
- package/dist/pairing/crypto.js +22 -0
- package/dist/pairing/crypto.js.map +1 -0
- package/dist/pairing/qr.d.ts +59 -0
- package/dist/pairing/qr.js +127 -0
- package/dist/pairing/qr.js.map +1 -0
- package/dist/pairing/storage.d.ts +120 -0
- package/dist/pairing/storage.js +614 -0
- package/dist/pairing/storage.js.map +1 -0
- package/dist/panel_bridge.d.ts +15 -0
- package/dist/panel_bridge.js +409 -0
- package/dist/panel_bridge.js.map +1 -0
- package/dist/paths.d.ts +39 -0
- package/dist/paths.js +51 -0
- package/dist/paths.js.map +1 -0
- package/dist/protocol/codec.d.ts +7 -0
- package/dist/protocol/codec.js +48 -0
- package/dist/protocol/codec.js.map +1 -0
- package/dist/protocol/types.d.ts +404 -0
- package/dist/protocol/types.js +2 -0
- package/dist/protocol/types.js.map +1 -0
- package/dist/rooms.d.ts +42 -0
- package/dist/rooms.js +78 -0
- package/dist/rooms.js.map +1 -0
- package/dist/session/bridge.d.ts +37 -0
- package/dist/session/bridge.js +134 -0
- package/dist/session/bridge.js.map +1 -0
- package/dist/session/broker.d.ts +189 -0
- package/dist/session/broker.js +527 -0
- package/dist/session/broker.js.map +1 -0
- package/dist/session/broker_remote.d.ts +74 -0
- package/dist/session/broker_remote.js +581 -0
- package/dist/session/broker_remote.js.map +1 -0
- package/dist/session/cwd_lock.d.ts +33 -0
- package/dist/session/cwd_lock.js +127 -0
- package/dist/session/cwd_lock.js.map +1 -0
- package/dist/session/debug_log.d.ts +3 -0
- package/dist/session/debug_log.js +32 -0
- package/dist/session/debug_log.js.map +1 -0
- package/dist/session/envelope.d.ts +33 -0
- package/dist/session/envelope.js +117 -0
- package/dist/session/envelope.js.map +1 -0
- package/dist/session/global_config.d.ts +33 -0
- package/dist/session/global_config.js +73 -0
- package/dist/session/global_config.js.map +1 -0
- package/dist/session/ipc.d.ts +27 -0
- package/dist/session/ipc.js +22 -0
- package/dist/session/ipc.js.map +1 -0
- package/dist/session/leader_election.d.ts +32 -0
- package/dist/session/leader_election.js +108 -0
- package/dist/session/leader_election.js.map +1 -0
- package/dist/session/local_config.d.ts +67 -0
- package/dist/session/local_config.js +193 -0
- package/dist/session/local_config.js.map +1 -0
- package/dist/session/mesh_node.d.ts +116 -0
- package/dist/session/mesh_node.js +596 -0
- package/dist/session/mesh_node.js.map +1 -0
- package/dist/session/peer.d.ts +139 -0
- package/dist/session/peer.js +474 -0
- package/dist/session/peer.js.map +1 -0
- package/dist/session/peer_inventory.d.ts +13 -0
- package/dist/session/peer_inventory.js +48 -0
- package/dist/session/peer_inventory.js.map +1 -0
- package/dist/session/peer_limits.d.ts +9 -0
- package/dist/session/peer_limits.js +24 -0
- package/dist/session/peer_limits.js.map +1 -0
- package/dist/session/rpc_envelope.d.ts +108 -0
- package/dist/session/rpc_envelope.js +221 -0
- package/dist/session/rpc_envelope.js.map +1 -0
- package/dist/session/rpc_inbound.d.ts +55 -0
- package/dist/session/rpc_inbound.js +136 -0
- package/dist/session/rpc_inbound.js.map +1 -0
- package/dist/session/setup_wizard.d.ts +39 -0
- package/dist/session/setup_wizard.js +63 -0
- package/dist/session/setup_wizard.js.map +1 -0
- package/dist/session/tools.d.ts +24 -0
- package/dist/session/tools.js +272 -0
- package/dist/session/tools.js.map +1 -0
- package/dist/session/wizard.d.ts +13 -0
- package/dist/session/wizard.js +20 -0
- package/dist/session/wizard.js.map +1 -0
- package/dist/transport/peer_channel.d.ts +52 -0
- package/dist/transport/peer_channel.js +145 -0
- package/dist/transport/peer_channel.js.map +1 -0
- package/dist/transport/pi_forward_client.d.ts +29 -0
- package/dist/transport/pi_forward_client.js +68 -0
- package/dist/transport/pi_forward_client.js.map +1 -0
- package/dist/transport/relay_client.d.ts +96 -0
- package/dist/transport/relay_client.js +210 -0
- package/dist/transport/relay_client.js.map +1 -0
- package/dist/ui/footer.d.ts +32 -0
- package/dist/ui/footer.js +34 -0
- package/dist/ui/footer.js.map +1 -0
- package/docs/daemon.md +289 -0
- package/package.json +92 -0
- package/service-templates/launchd.plist.template +35 -0
- package/service-templates/systemd.service.template +19 -0
- package/service-templates/task-launcher.vbs.template +10 -0
- package/service-templates/task-scheduler.xml.template +38 -0
- package/skills/agent-network/SKILL.md +310 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable 8-character hex id for a daemon, derived from the cwd it manages.
|
|
3
|
+
*
|
|
4
|
+
* Derivation: `sha256(realpath(cwd))` truncated to 8 hex chars (32 bits ≈
|
|
5
|
+
* 4 billion). Collision risk is negligible at fleet sizes a single user
|
|
6
|
+
* will ever have (<1000 daemons), and 8 hex characters are short enough
|
|
7
|
+
* to type on the CLI (`/unbien send a1b2c3d4 "..."`).
|
|
8
|
+
*
|
|
9
|
+
* Same scheme as `roomIdForCwd` in `src/rooms.ts` — but we use hex
|
|
10
|
+
* instead of base64url so the id has no `_`/`-` (cleaner double-click
|
|
11
|
+
* selection in terminals).
|
|
12
|
+
*
|
|
13
|
+
* Symlinks resolve to a single canonical id via `realpath`, so
|
|
14
|
+
* `/Users/x/Movies` and `/Users/x/link-to-Movies` map to the same daemon.
|
|
15
|
+
* Falls back to the raw path when realpath fails (cwd doesn't exist —
|
|
16
|
+
* shouldn't happen in production but covers test sandboxes).
|
|
17
|
+
*
|
|
18
|
+
* plan/41 audit (2026-06-08): this stays **per-cwd** (no name axis). The
|
|
19
|
+
* multiagent-per-folder model (plan/38/41) applies to the App↔Pi room and the
|
|
20
|
+
* mesh address; a *supervisor daemon* is **one per cwd** by design — the
|
|
21
|
+
* registry keys exactly one entry per cwd (`registry.ts`), so a daemon id never
|
|
22
|
+
* needs the name to disambiguate. Decision: leave `daemonIdForCwd` cwd-only.
|
|
23
|
+
*/
|
|
24
|
+
export declare function daemonIdForCwd(cwd: string): string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
3
|
+
/**
|
|
4
|
+
* Stable 8-character hex id for a daemon, derived from the cwd it manages.
|
|
5
|
+
*
|
|
6
|
+
* Derivation: `sha256(realpath(cwd))` truncated to 8 hex chars (32 bits ≈
|
|
7
|
+
* 4 billion). Collision risk is negligible at fleet sizes a single user
|
|
8
|
+
* will ever have (<1000 daemons), and 8 hex characters are short enough
|
|
9
|
+
* to type on the CLI (`/unbien send a1b2c3d4 "..."`).
|
|
10
|
+
*
|
|
11
|
+
* Same scheme as `roomIdForCwd` in `src/rooms.ts` — but we use hex
|
|
12
|
+
* instead of base64url so the id has no `_`/`-` (cleaner double-click
|
|
13
|
+
* selection in terminals).
|
|
14
|
+
*
|
|
15
|
+
* Symlinks resolve to a single canonical id via `realpath`, so
|
|
16
|
+
* `/Users/x/Movies` and `/Users/x/link-to-Movies` map to the same daemon.
|
|
17
|
+
* Falls back to the raw path when realpath fails (cwd doesn't exist —
|
|
18
|
+
* shouldn't happen in production but covers test sandboxes).
|
|
19
|
+
*
|
|
20
|
+
* plan/41 audit (2026-06-08): this stays **per-cwd** (no name axis). The
|
|
21
|
+
* multiagent-per-folder model (plan/38/41) applies to the App↔Pi room and the
|
|
22
|
+
* mesh address; a *supervisor daemon* is **one per cwd** by design — the
|
|
23
|
+
* registry keys exactly one entry per cwd (`registry.ts`), so a daemon id never
|
|
24
|
+
* needs the name to disambiguate. Decision: leave `daemonIdForCwd` cwd-only.
|
|
25
|
+
*/
|
|
26
|
+
export function daemonIdForCwd(cwd) {
|
|
27
|
+
let target;
|
|
28
|
+
try {
|
|
29
|
+
target = realpathSync(cwd);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
target = cwd;
|
|
33
|
+
}
|
|
34
|
+
return createHash("sha256").update(target).digest("hex").slice(0, 8);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.js","sourceRoot":"","sources":["../../src/daemon/id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC;QACH,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,GAAG,GAAG,CAAC;IACf,CAAC;IACD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates and activates a system service for `pi-supervisord` so the
|
|
3
|
+
* daemon fleet survives reboots (plan/26 W3).
|
|
4
|
+
*
|
|
5
|
+
* Platform support:
|
|
6
|
+
* - **macOS**: writes `~/Library/LaunchAgents/dev.unbien.supervisord.plist`
|
|
7
|
+
* and runs `launchctl bootstrap gui/<uid> <plist>` (modern API) with a
|
|
8
|
+
* fallback to `launchctl load` for older macOS.
|
|
9
|
+
* - **Linux**: writes `~/.config/systemd/user/unbien-supervisord.service`
|
|
10
|
+
* and runs `systemctl --user daemon-reload && systemctl --user enable
|
|
11
|
+
* --now unbien-supervisord.service`.
|
|
12
|
+
*
|
|
13
|
+
* Uninstall reverses both. Idempotent — re-running install over an existing
|
|
14
|
+
* unit refreshes it (paths could have changed if user moved node_modules).
|
|
15
|
+
*
|
|
16
|
+
* **What does NOT happen here**: the actual `npm install -g un-bien` step.
|
|
17
|
+
* The user has to make the supervisor bin reachable on disk before install
|
|
18
|
+
* can wire up the service. The `findSupervisorScript` resolver detects
|
|
19
|
+
* common cases (npm global, pnpm global, local dev clone) and yields a
|
|
20
|
+
* clear error otherwise.
|
|
21
|
+
*/
|
|
22
|
+
export type SupervisorPlatform = "macos" | "linux" | "windows" | "unsupported";
|
|
23
|
+
export declare function detectPlatform(): SupervisorPlatform;
|
|
24
|
+
/**
|
|
25
|
+
* Absolute path to the supervisor's compiled entry. We resolve from
|
|
26
|
+
* `import.meta.url` (this file's location) since wherever the daemon
|
|
27
|
+
* module lives, `bin/supervisord.js` is a sibling of `daemon/` under
|
|
28
|
+
* `dist/`.
|
|
29
|
+
*
|
|
30
|
+
* After build: `dist/daemon/install.js` → `dist/bin/supervisord.js`.
|
|
31
|
+
* In dev (`tsx`): same path resolution still lands inside `src/`, which
|
|
32
|
+
* isn't directly runnable by `node` — dev install isn't expected.
|
|
33
|
+
*/
|
|
34
|
+
export declare function findSupervisorScript(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Absolute path to the extension's CLI entry (`dist/index.js`). This is
|
|
37
|
+
* the file we symlink to `~/.local/bin/unbien` so the user can run
|
|
38
|
+
* `un-bien <subcommand>` from any shell after installing the extension
|
|
39
|
+
* through Pi (`pi install npm:un-bien`).
|
|
40
|
+
*
|
|
41
|
+
* Same resolution strategy as `findSupervisorScript`: from
|
|
42
|
+
* `dist/daemon/install.js` → `dist/index.js`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function findRemotePiScript(): string;
|
|
45
|
+
export declare function findNodeBinary(): string;
|
|
46
|
+
export declare function findTemplate(name: "systemd" | "launchd" | "taskscheduler" | "vbs-launcher"): string;
|
|
47
|
+
export declare function systemdUnitPath(): string;
|
|
48
|
+
export declare function launchdPlistPath(): string;
|
|
49
|
+
export declare const LAUNCHD_LABEL = "dev.unbien.supervisord";
|
|
50
|
+
/** systemd --user unit name (with `.service`) for the supervisor. */
|
|
51
|
+
export declare const SYSTEMD_UNIT = "unbien-supervisord.service";
|
|
52
|
+
/** Windows Task Scheduler task name (plan/40). */
|
|
53
|
+
export declare const WINDOWS_TASK_NAME = "RemotePiSupervisor";
|
|
54
|
+
/** Path of the rendered Task Scheduler XML (input to `schtasks /Create /XML`). */
|
|
55
|
+
export declare function taskXmlPath(): string;
|
|
56
|
+
/**
|
|
57
|
+
* Path of the rendered VBScript launcher the Task Scheduler action invokes
|
|
58
|
+
* via `wscript.exe` (plan/40, Windows). Launching node through this hidden
|
|
59
|
+
* wrapper is what keeps the supervisor from flashing a console window.
|
|
60
|
+
*/
|
|
61
|
+
export declare function vbsLauncherPath(): string;
|
|
62
|
+
/**
|
|
63
|
+
* Combined stdout/stderr log for the Windows supervisor. The Task Scheduler
|
|
64
|
+
* launches it hidden via wscript, so without this redirect its output (and the
|
|
65
|
+
* forwarded daemon-child stderr) would vanish — mirrors launchd/systemd, which
|
|
66
|
+
* already log to `~/.pi/un-bien/supervisord.log`.
|
|
67
|
+
*/
|
|
68
|
+
export declare function supervisordLogPath(): string;
|
|
69
|
+
export interface RenderVars {
|
|
70
|
+
node: string;
|
|
71
|
+
supervisor: string;
|
|
72
|
+
home: string;
|
|
73
|
+
user: string;
|
|
74
|
+
/** PATH inherited so `pi --mode rpc` resolves the same way it does
|
|
75
|
+
* interactively. We snapshot `process.env.PATH` at install time. */
|
|
76
|
+
path: string;
|
|
77
|
+
/** Windows only: absolute path of the VBScript launcher the Task Scheduler
|
|
78
|
+
* action runs via `wscript.exe`. Empty on POSIX (templates ignore `{VBS}`). */
|
|
79
|
+
vbs: string;
|
|
80
|
+
/** Windows only: combined stdout/stderr log the hidden supervisor appends to.
|
|
81
|
+
* Empty on POSIX (templates ignore `{LOG}`). */
|
|
82
|
+
logPath: string;
|
|
83
|
+
}
|
|
84
|
+
export declare function defaultRenderVars(): RenderVars;
|
|
85
|
+
/** Replace `{NODE}` / `{SUPERVISOR}` / `{USER}` / `{HOME}` / `{PATH}` / `{VBS}` / `{LOG}`. */
|
|
86
|
+
export declare function renderTemplate(template: string, vars: RenderVars): string;
|
|
87
|
+
export interface InstallResult {
|
|
88
|
+
platform: SupervisorPlatform;
|
|
89
|
+
unitPath: string;
|
|
90
|
+
/** Lines describing each step taken — surfaced to the user via notify. */
|
|
91
|
+
log: string[];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Writes the unit/plist, runs the platform's activation command. Throws
|
|
95
|
+
* on unsupported OS or when the supervisor script isn't found.
|
|
96
|
+
*
|
|
97
|
+
* Idempotent: re-running re-writes the unit (paths could have changed)
|
|
98
|
+
* and re-activates via the platform tool's idempotent flag.
|
|
99
|
+
*/
|
|
100
|
+
export declare function installService(vars?: RenderVars): InstallResult;
|
|
101
|
+
export interface UninstallResult {
|
|
102
|
+
platform: SupervisorPlatform;
|
|
103
|
+
unitPath: string;
|
|
104
|
+
removed: boolean;
|
|
105
|
+
log: string[];
|
|
106
|
+
}
|
|
107
|
+
export declare function uninstallService(): UninstallResult;
|
|
108
|
+
/**
|
|
109
|
+
* Build the batch script run elevated. Each command line redirects its output
|
|
110
|
+
* to `logFile` so the (separate, elevated) process's output can be read back by
|
|
111
|
+
* the parent. Control-flow lines (`if`/`exit`/`rem`/`@`) run bare — redirecting
|
|
112
|
+
* them would swallow the exit code. Pure + exported for tests.
|
|
113
|
+
*/
|
|
114
|
+
export declare function buildElevatedCmd(lines: string[], logFile: string): string;
|
|
115
|
+
export interface LinkBinariesResult {
|
|
116
|
+
/** `~/.local/bin/`. The two symlinks land here. */
|
|
117
|
+
binDir: string;
|
|
118
|
+
/** Paths of the two symlinks we created/refreshed. */
|
|
119
|
+
links: Array<{
|
|
120
|
+
name: string;
|
|
121
|
+
path: string;
|
|
122
|
+
target: string;
|
|
123
|
+
}>;
|
|
124
|
+
/** True when `binDir` is already on `$PATH`. False → caller surfaces the
|
|
125
|
+
* "add this line to your shell rc" hint to the user. */
|
|
126
|
+
onPath: boolean;
|
|
127
|
+
log: string[];
|
|
128
|
+
}
|
|
129
|
+
export declare function userLocalBinDir(home?: string): string;
|
|
130
|
+
/**
|
|
131
|
+
* Check whether `dir` is on `process.env.PATH`. Tolerates trailing
|
|
132
|
+
* slashes and relative entries (which we treat as not matching — `~/.local/bin`
|
|
133
|
+
* is always absolute on our end).
|
|
134
|
+
*/
|
|
135
|
+
export declare function isOnPath(dir: string, envPath?: string): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Create (or refresh) the `un-bien` + `pi-supervisord` symlinks in
|
|
138
|
+
* `~/.local/bin/`. Idempotent — replaces stale links pointing at old
|
|
139
|
+
* extension paths (Pi can reinstall the extension to a different hash dir
|
|
140
|
+
* on upgrades, so this MUST overwrite).
|
|
141
|
+
*
|
|
142
|
+
* Returns `onPath: false` when `~/.local/bin` isn't in the user's `$PATH`.
|
|
143
|
+
* The caller is responsible for surfacing the shell-rc instruction —
|
|
144
|
+
* we don't edit the user's shell config files automatically.
|
|
145
|
+
*/
|
|
146
|
+
export declare function linkCliBinaries(home?: string, paths?: {
|
|
147
|
+
remotePi?: string;
|
|
148
|
+
supervisord?: string;
|
|
149
|
+
}, opts?: {
|
|
150
|
+
node?: string;
|
|
151
|
+
mutatePath?: boolean;
|
|
152
|
+
}): LinkBinariesResult;
|
|
153
|
+
/** A Windows `.cmd` shim that forwards all args to `node "<target>"`. Pure. */
|
|
154
|
+
export declare function buildCmdShim(node: string, target: string): string;
|
|
155
|
+
/**
|
|
156
|
+
* Remove the symlinks `linkCliBinaries` created. Idempotent — missing
|
|
157
|
+
* links are a no-op. Returns whether each link was actually present so
|
|
158
|
+
* the caller can render a useful summary. Targets (the extension files)
|
|
159
|
+
* are NOT touched here — they live outside this dir and belong to Pi.
|
|
160
|
+
*/
|
|
161
|
+
export interface UnlinkBinariesResult {
|
|
162
|
+
binDir: string;
|
|
163
|
+
removed: Array<{
|
|
164
|
+
name: string;
|
|
165
|
+
path: string;
|
|
166
|
+
existed: boolean;
|
|
167
|
+
}>;
|
|
168
|
+
log: string[];
|
|
169
|
+
}
|
|
170
|
+
export declare function unlinkCliBinaries(home?: string): UnlinkBinariesResult;
|