mindwire 0.1.29 → 0.1.32
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/dist/{chunk-QPZMGVY7.js → chunk-5X5PAFM7.js} +40 -13
- package/dist/chunk-5X5PAFM7.js.map +1 -0
- package/dist/cli.js +59 -18
- package/dist/cli.js.map +1 -1
- package/dist/computer/connection-flow.d.ts +3 -0
- package/dist/computer/connection-progress.d.ts +14 -0
- package/dist/computer/controller-handoff.d.ts +6 -0
- package/dist/computer/lifecycle.d.ts +5 -0
- package/dist/computer/relay-health.d.ts +21 -0
- package/dist/computer/relay-output.d.ts +19 -0
- package/dist/computer/relay.d.ts +4 -1
- package/dist/computer.d.ts +5 -2
- package/dist/{controller-MNMIJHH5.js → controller-CHJ5MMZS.js} +335 -111
- package/dist/controller-CHJ5MMZS.js.map +1 -0
- package/dist/controller-handoff-7S6SKFHX.js +71 -0
- package/dist/controller-handoff-7S6SKFHX.js.map +1 -0
- package/dist/index.cjs +16 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -12
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/version.d.ts +1 -0
- package/dist/workspace.d.ts +21 -4
- package/package.json +7 -3
- package/dist/chunk-QPZMGVY7.js.map +0 -1
- package/dist/controller-MNMIJHH5.js.map +0 -1
|
@@ -12,12 +12,17 @@ export interface ComputerConfig {
|
|
|
12
12
|
websocketPort: number;
|
|
13
13
|
relay: RelayOptions;
|
|
14
14
|
}
|
|
15
|
+
export declare const CONTROLLER_PROTOCOL = 2;
|
|
15
16
|
export interface ControllerState extends ProcessState {
|
|
17
|
+
protocol?: number;
|
|
18
|
+
cliVersion?: string;
|
|
16
19
|
ready: boolean;
|
|
17
20
|
phase?: string;
|
|
18
21
|
error?: string;
|
|
22
|
+
errorCode?: string;
|
|
19
23
|
recovering?: boolean;
|
|
20
24
|
routes?: ComputerRoute[];
|
|
25
|
+
checkedAt?: number;
|
|
21
26
|
}
|
|
22
27
|
export declare const defaultStateDirectory: () => string;
|
|
23
28
|
export declare const defaultComputerConfig: () => ComputerConfig;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { LookupFunction } from "node:net";
|
|
2
|
+
import type { ComputerRoute } from "../computer.js";
|
|
3
|
+
import type { RelayOptions } from "./relay.js";
|
|
4
|
+
export declare class RelayCheckError extends Error {
|
|
5
|
+
readonly code: "dns" | "timeout" | "proxy" | "connection" | "response";
|
|
6
|
+
constructor(code: "dns" | "timeout" | "proxy" | "connection" | "response", message: string, cause?: Error);
|
|
7
|
+
}
|
|
8
|
+
/** A resolver's negative cache says nothing about the helper's connection.
|
|
9
|
+
* Rotating a live tunnel for NXDOMAIN creates another hostname to cache and
|
|
10
|
+
* strands phones with the previous address. Process exits are handled separately. */
|
|
11
|
+
export declare function relayNeedsRestart(error: unknown, failures: number, failedForMs: number): boolean;
|
|
12
|
+
/** Check the actual WebSocket byte path, not just the helper's PID or its logs.
|
|
13
|
+
* The phone still authenticates and pins the SSH host before sending secrets. */
|
|
14
|
+
export declare function checkRelay(route: ComputerRoute, options?: {
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
timeoutMs?: number;
|
|
17
|
+
lookup?: LookupFunction;
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
/** Don't rotate a quick-tunnel address during an ordinary internet outage.
|
|
20
|
+
* Let the provider reconnect with the same address until it is reachable again. */
|
|
21
|
+
export declare function relayProviderReachable(options: RelayOptions, signal?: AbortSignal): Promise<boolean>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** A provider must not inherit pipes whose reader dies during a controller
|
|
2
|
+
* upgrade. Use a private append-only file descriptor, consume startup output,
|
|
3
|
+
* then discard it. A successor can adopt the same file without touching the
|
|
4
|
+
* provider or its address. Raw provider output is never copied to our logs. */
|
|
5
|
+
export declare class RelayOutput {
|
|
6
|
+
readonly file: string;
|
|
7
|
+
private readonly handle;
|
|
8
|
+
private position;
|
|
9
|
+
private timer?;
|
|
10
|
+
private pending;
|
|
11
|
+
private closing?;
|
|
12
|
+
private constructor();
|
|
13
|
+
static create(directory?: string): Promise<RelayOutput>;
|
|
14
|
+
static adopt(directory: string, file: string): Promise<RelayOutput | undefined>;
|
|
15
|
+
get fd(): number;
|
|
16
|
+
read(): Promise<Buffer>;
|
|
17
|
+
discard(): void;
|
|
18
|
+
close(): Promise<void>;
|
|
19
|
+
}
|
package/dist/computer/relay.d.ts
CHANGED
|
@@ -11,13 +11,16 @@ export interface RelayHandle {
|
|
|
11
11
|
route?: ComputerRoute;
|
|
12
12
|
process?: ChildProcess;
|
|
13
13
|
owner?: OwnedProcess;
|
|
14
|
+
outputFile?: string;
|
|
14
15
|
close(): void | Promise<void>;
|
|
15
16
|
}
|
|
17
|
+
export declare function adoptRelay(owner: OwnedProcess, route: ComputerRoute | undefined, directory: string, outputFile?: string): Promise<RelayHandle>;
|
|
16
18
|
export declare function websocketURL(value: string): string;
|
|
17
19
|
/** Both providers forward encrypted SSH bytes to one loopback WebSocket bridge. */
|
|
18
20
|
export declare function startRelay(options: RelayOptions, port: number, runtime?: {
|
|
19
21
|
cacheDir?: string;
|
|
22
|
+
outputDirectory?: string;
|
|
20
23
|
onProgress?: (message: string) => void | Promise<void>;
|
|
21
24
|
signal?: AbortSignal;
|
|
22
|
-
onSpawn?: (owner: OwnedProcess) => Promise<void>;
|
|
25
|
+
onSpawn?: (owner: OwnedProcess, outputFile: string) => Promise<void>;
|
|
23
26
|
}): Promise<RelayHandle>;
|
package/dist/computer.d.ts
CHANGED
|
@@ -40,7 +40,9 @@ export interface ComputerDevice {
|
|
|
40
40
|
}
|
|
41
41
|
/** Signature is a base64 Ed25519 proof over
|
|
42
42
|
* `mindwire-computer-pairing-v1\n${pairingId}\n${id}\n${name}\n${publicKey}`.
|
|
43
|
-
* With pairingVersion >= 2 an already approved key reconnects without a prompt.
|
|
43
|
+
* With pairingVersion >= 2 an already approved key reconnects without a prompt.
|
|
44
|
+
* Version 3 requires a signature on every device POST /pair (including retries).
|
|
45
|
+
* Owner-facing pairing status omits the proof; GET /pair/{id} never returns a token. */
|
|
44
46
|
export interface ComputerPairRequest {
|
|
45
47
|
id: string;
|
|
46
48
|
name: string;
|
|
@@ -74,7 +76,8 @@ export interface ComputerInfo {
|
|
|
74
76
|
sshPort: number;
|
|
75
77
|
websocketPort: number;
|
|
76
78
|
portForwardingVersion?: number;
|
|
77
|
-
/** 2 supports signed reconnection and atomic replacement of lost device keys.
|
|
79
|
+
/** 2 supports signed reconnection and atomic replacement of lost device keys.
|
|
80
|
+
* 3 requires signed pairing acknowledgements and expires/revokes pairing transports. */
|
|
78
81
|
pairingVersion?: number;
|
|
79
82
|
}
|
|
80
83
|
export interface ComputerForwardRequest {
|