@qpjoy/electron-launcher 0.2.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 +164 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.js +62 -0
- package/dist/network-diagnostics.d.ts +42 -0
- package/dist/network-diagnostics.js +254 -0
- package/dist/network-ownership-registry.d.ts +68 -0
- package/dist/network-ownership-registry.js +286 -0
- package/dist/release-updater.d.ts +129 -0
- package/dist/release-updater.js +195 -0
- package/dist/standalone-data-plane.d.ts +119 -0
- package/dist/standalone-data-plane.js +441 -0
- package/dist/system-domain-proxy.d.ts +91 -0
- package/dist/system-domain-proxy.js +2729 -0
- package/dist/wireguard.d.ts +289 -0
- package/dist/wireguard.js +902 -0
- package/package.json +61 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { buildHdoRouteProbe, type WireGuardServiceIdentity } from '@qpjoy/electron-core-wireguard';
|
|
2
|
+
import type { LauncherRoutePlan } from '@qpjoy/mx-launcher-core';
|
|
3
|
+
export type ElectronLauncherWireGuardAction = 'up' | 'down' | 'restart';
|
|
4
|
+
export type ElectronLauncherWireGuardPathPreference = 'auto' | 'direct' | 'relay' | 'hybrid';
|
|
5
|
+
export type ElectronLauncherWireGuardPath = 'h2i-direct' | 'hdi-relay' | 'h2i-hybrid';
|
|
6
|
+
export interface ElectronLauncherWireGuardRuntimeOptions {
|
|
7
|
+
userDataDir: string;
|
|
8
|
+
profileName?: string;
|
|
9
|
+
installDir?: string;
|
|
10
|
+
bundledDir?: string | null;
|
|
11
|
+
allowSystemFallback?: boolean;
|
|
12
|
+
darwinLaunchDaemon?: boolean | null;
|
|
13
|
+
darwinServiceIdentity?: WireGuardServiceIdentity;
|
|
14
|
+
fallbackToAppManaged?: boolean | null;
|
|
15
|
+
}
|
|
16
|
+
export interface ElectronLauncherWireGuardPeerInput extends ElectronLauncherWireGuardRuntimeOptions {
|
|
17
|
+
routePlan: LauncherRoutePlan;
|
|
18
|
+
privateKey: string;
|
|
19
|
+
dnsDomains?: string[];
|
|
20
|
+
suppressWireGuardDns?: boolean | null;
|
|
21
|
+
mtu?: number | null;
|
|
22
|
+
pathPreference?: ElectronLauncherWireGuardPathPreference;
|
|
23
|
+
}
|
|
24
|
+
export interface ElectronLauncherWireGuardProbeInput {
|
|
25
|
+
targetIp: string;
|
|
26
|
+
expectedInterfaceName?: string | null;
|
|
27
|
+
expectedInterfaceAddresses?: string[] | null;
|
|
28
|
+
}
|
|
29
|
+
export interface ElectronLauncherWireGuardEndpointProbeInput {
|
|
30
|
+
endpoint: string | null | undefined;
|
|
31
|
+
}
|
|
32
|
+
export interface ElectronLauncherWireGuardPeer {
|
|
33
|
+
address: string;
|
|
34
|
+
allowedIps: string[];
|
|
35
|
+
config: string;
|
|
36
|
+
configPath: string;
|
|
37
|
+
dns: string[];
|
|
38
|
+
endpoint: string;
|
|
39
|
+
endpoints: string[];
|
|
40
|
+
path: ElectronLauncherWireGuardPath;
|
|
41
|
+
publicKey: string;
|
|
42
|
+
publicKeys: string[];
|
|
43
|
+
routeCidrs: string[];
|
|
44
|
+
routePriorityCidrs: string[];
|
|
45
|
+
routeProbe: ReturnType<typeof buildHdoRouteProbe>;
|
|
46
|
+
}
|
|
47
|
+
export declare function prepareLauncherWireGuardPeer(input: ElectronLauncherWireGuardPeerInput): ElectronLauncherWireGuardPeer;
|
|
48
|
+
export declare function resolveLauncherWireGuardRuntime(input: ElectronLauncherWireGuardRuntimeOptions): import("@qpjoy/electron-core-wireguard").WireGuardConnectionRuntimeStatus;
|
|
49
|
+
export declare function connectLauncherWireGuardPeer(input: ElectronLauncherWireGuardPeerInput & {
|
|
50
|
+
action?: ElectronLauncherWireGuardAction;
|
|
51
|
+
}): Promise<{
|
|
52
|
+
ok: boolean;
|
|
53
|
+
action: "up" | "restart";
|
|
54
|
+
peer: ElectronLauncherWireGuardPeer;
|
|
55
|
+
runtime: import("@qpjoy/electron-core-wireguard").WireGuardConnectionRuntimeStatus;
|
|
56
|
+
status: import("@qpjoy/electron-core-wireguard").WireGuardTunnelStatus | null;
|
|
57
|
+
launchDaemon: import("@qpjoy/electron-core-wireguard").WireGuardLaunchDaemonResult;
|
|
58
|
+
tunnel: {
|
|
59
|
+
ok: boolean;
|
|
60
|
+
configPath: string;
|
|
61
|
+
routeLogPath: string | null | undefined;
|
|
62
|
+
routeLogTail: string | null | undefined;
|
|
63
|
+
message: string;
|
|
64
|
+
};
|
|
65
|
+
message: string;
|
|
66
|
+
} | {
|
|
67
|
+
ok: boolean;
|
|
68
|
+
action: ElectronLauncherWireGuardAction;
|
|
69
|
+
peer: ElectronLauncherWireGuardPeer;
|
|
70
|
+
runtime: import("@qpjoy/electron-core-wireguard").WireGuardConnectionRuntimeStatus;
|
|
71
|
+
status: import("@qpjoy/electron-core-wireguard").WireGuardTunnelStatus | null;
|
|
72
|
+
tunnel: import("@qpjoy/electron-core-wireguard").WireGuardTunnelResult;
|
|
73
|
+
message: string;
|
|
74
|
+
launchDaemon?: undefined;
|
|
75
|
+
}>;
|
|
76
|
+
export declare function stopLauncherWireGuardPeer(input: ElectronLauncherWireGuardRuntimeOptions): Promise<{
|
|
77
|
+
ok: boolean;
|
|
78
|
+
skipped: boolean;
|
|
79
|
+
reason: string;
|
|
80
|
+
configPath: string;
|
|
81
|
+
runtime?: undefined;
|
|
82
|
+
status?: undefined;
|
|
83
|
+
launchDaemon?: undefined;
|
|
84
|
+
tunnel?: undefined;
|
|
85
|
+
message?: undefined;
|
|
86
|
+
} | {
|
|
87
|
+
ok: boolean;
|
|
88
|
+
skipped: boolean;
|
|
89
|
+
configPath: string;
|
|
90
|
+
runtime: import("@qpjoy/electron-core-wireguard").WireGuardConnectionRuntimeStatus;
|
|
91
|
+
status: import("@qpjoy/electron-core-wireguard").WireGuardTunnelStatus | null;
|
|
92
|
+
launchDaemon: import("@qpjoy/electron-core-wireguard").WireGuardLaunchDaemonResult;
|
|
93
|
+
tunnel: {
|
|
94
|
+
ok: boolean;
|
|
95
|
+
configPath: string;
|
|
96
|
+
routeLogPath: string | null | undefined;
|
|
97
|
+
routeLogTail: string | null | undefined;
|
|
98
|
+
message: string;
|
|
99
|
+
};
|
|
100
|
+
message: string;
|
|
101
|
+
reason?: undefined;
|
|
102
|
+
} | {
|
|
103
|
+
ok: boolean;
|
|
104
|
+
skipped: boolean;
|
|
105
|
+
configPath: string;
|
|
106
|
+
runtime: import("@qpjoy/electron-core-wireguard").WireGuardConnectionRuntimeStatus;
|
|
107
|
+
status: import("@qpjoy/electron-core-wireguard").WireGuardTunnelStatus | null;
|
|
108
|
+
tunnel: import("@qpjoy/electron-core-wireguard").WireGuardTunnelResult;
|
|
109
|
+
message: string;
|
|
110
|
+
reason?: undefined;
|
|
111
|
+
launchDaemon?: undefined;
|
|
112
|
+
}>;
|
|
113
|
+
export declare function repairLauncherWireGuardPeerRoutes(input: ElectronLauncherWireGuardRuntimeOptions): Promise<{
|
|
114
|
+
ok: boolean;
|
|
115
|
+
skipped: boolean;
|
|
116
|
+
reason: string;
|
|
117
|
+
configPath: string;
|
|
118
|
+
} | {
|
|
119
|
+
ok: boolean;
|
|
120
|
+
configPath: string;
|
|
121
|
+
runtime: import("@qpjoy/electron-core-wireguard").WireGuardConnectionRuntimeStatus;
|
|
122
|
+
status: import("@qpjoy/electron-core-wireguard").WireGuardTunnelStatus | null;
|
|
123
|
+
missingRoutes: string[];
|
|
124
|
+
message: string;
|
|
125
|
+
mode: string;
|
|
126
|
+
interfaceName: string | null;
|
|
127
|
+
realInterfaceName: string | null;
|
|
128
|
+
command: string;
|
|
129
|
+
routeLogPath?: string | null;
|
|
130
|
+
routeLogTail?: string | null;
|
|
131
|
+
stdout?: string;
|
|
132
|
+
stderr?: string;
|
|
133
|
+
skipped?: undefined;
|
|
134
|
+
reason?: undefined;
|
|
135
|
+
}>;
|
|
136
|
+
export declare function recoverLauncherWireGuardPeer(input: ElectronLauncherWireGuardRuntimeOptions & {
|
|
137
|
+
reason?: string | null;
|
|
138
|
+
}): Promise<{
|
|
139
|
+
ok: boolean;
|
|
140
|
+
skipped: boolean;
|
|
141
|
+
reason: string;
|
|
142
|
+
recoveryReason: string | null;
|
|
143
|
+
configPath: string;
|
|
144
|
+
runtime?: undefined;
|
|
145
|
+
status?: undefined;
|
|
146
|
+
action?: undefined;
|
|
147
|
+
launchDaemon?: undefined;
|
|
148
|
+
tunnel?: undefined;
|
|
149
|
+
message?: undefined;
|
|
150
|
+
} | {
|
|
151
|
+
ok: boolean;
|
|
152
|
+
skipped: boolean;
|
|
153
|
+
reason: string;
|
|
154
|
+
recoveryReason: string | null;
|
|
155
|
+
configPath: string;
|
|
156
|
+
runtime: import("@qpjoy/electron-core-wireguard").WireGuardConnectionRuntimeStatus;
|
|
157
|
+
status: import("@qpjoy/electron-core-wireguard").WireGuardTunnelStatus;
|
|
158
|
+
action?: undefined;
|
|
159
|
+
launchDaemon?: undefined;
|
|
160
|
+
tunnel?: undefined;
|
|
161
|
+
message?: undefined;
|
|
162
|
+
} | {
|
|
163
|
+
action: string;
|
|
164
|
+
recoveryReason: string | null;
|
|
165
|
+
ok: boolean;
|
|
166
|
+
skipped: boolean;
|
|
167
|
+
reason: string;
|
|
168
|
+
configPath: string;
|
|
169
|
+
runtime?: undefined;
|
|
170
|
+
status?: undefined;
|
|
171
|
+
launchDaemon?: undefined;
|
|
172
|
+
tunnel?: undefined;
|
|
173
|
+
message?: undefined;
|
|
174
|
+
} | {
|
|
175
|
+
action: string;
|
|
176
|
+
recoveryReason: string | null;
|
|
177
|
+
ok: boolean;
|
|
178
|
+
configPath: string;
|
|
179
|
+
runtime: import("@qpjoy/electron-core-wireguard").WireGuardConnectionRuntimeStatus;
|
|
180
|
+
status: import("@qpjoy/electron-core-wireguard").WireGuardTunnelStatus | null;
|
|
181
|
+
missingRoutes: string[];
|
|
182
|
+
message: string;
|
|
183
|
+
mode: string;
|
|
184
|
+
interfaceName: string | null;
|
|
185
|
+
realInterfaceName: string | null;
|
|
186
|
+
command: string;
|
|
187
|
+
routeLogPath?: string | null;
|
|
188
|
+
routeLogTail?: string | null;
|
|
189
|
+
stdout?: string;
|
|
190
|
+
stderr?: string;
|
|
191
|
+
skipped?: undefined;
|
|
192
|
+
reason?: undefined;
|
|
193
|
+
launchDaemon?: undefined;
|
|
194
|
+
tunnel?: undefined;
|
|
195
|
+
} | {
|
|
196
|
+
ok: boolean;
|
|
197
|
+
action: string;
|
|
198
|
+
recoveryReason: string | null;
|
|
199
|
+
configPath: string;
|
|
200
|
+
runtime: import("@qpjoy/electron-core-wireguard").WireGuardConnectionRuntimeStatus;
|
|
201
|
+
status: import("@qpjoy/electron-core-wireguard").WireGuardTunnelStatus | null;
|
|
202
|
+
launchDaemon: import("@qpjoy/electron-core-wireguard").WireGuardLaunchDaemonResult;
|
|
203
|
+
tunnel: {
|
|
204
|
+
ok: boolean;
|
|
205
|
+
configPath: string;
|
|
206
|
+
routeLogPath: string | null | undefined;
|
|
207
|
+
routeLogTail: string | null | undefined;
|
|
208
|
+
message: string;
|
|
209
|
+
};
|
|
210
|
+
message: string;
|
|
211
|
+
skipped?: undefined;
|
|
212
|
+
reason?: undefined;
|
|
213
|
+
} | {
|
|
214
|
+
ok: boolean;
|
|
215
|
+
action: string;
|
|
216
|
+
recoveryReason: string | null;
|
|
217
|
+
configPath: string;
|
|
218
|
+
runtime: import("@qpjoy/electron-core-wireguard").WireGuardConnectionRuntimeStatus;
|
|
219
|
+
status: import("@qpjoy/electron-core-wireguard").WireGuardTunnelStatus | null;
|
|
220
|
+
tunnel: import("@qpjoy/electron-core-wireguard").WireGuardTunnelResult;
|
|
221
|
+
message: string;
|
|
222
|
+
skipped?: undefined;
|
|
223
|
+
reason?: undefined;
|
|
224
|
+
launchDaemon?: undefined;
|
|
225
|
+
}>;
|
|
226
|
+
export declare function getLauncherWireGuardPeerStatus(input: ElectronLauncherWireGuardRuntimeOptions): import("@qpjoy/electron-core-wireguard").WireGuardTunnelStatus | {
|
|
227
|
+
ok: boolean;
|
|
228
|
+
active: boolean;
|
|
229
|
+
configPath: string;
|
|
230
|
+
error: string;
|
|
231
|
+
} | {
|
|
232
|
+
launchDaemon: import("@qpjoy/electron-core-wireguard").WireGuardLaunchDaemonStatus;
|
|
233
|
+
ok: boolean;
|
|
234
|
+
active: boolean;
|
|
235
|
+
mode: import("@qpjoy/electron-core-wireguard").WireGuardConnectionRuntimeStatus["method"];
|
|
236
|
+
interfaceName: string | null;
|
|
237
|
+
realInterfaceName: string | null;
|
|
238
|
+
configPath: string;
|
|
239
|
+
addresses: string[];
|
|
240
|
+
allowedIps: string[];
|
|
241
|
+
missingRoutes: string[];
|
|
242
|
+
routeProbes: import("@qpjoy/electron-core-wireguard").WireGuardRouteProbeStatus[];
|
|
243
|
+
routeLogPath: string | null;
|
|
244
|
+
routeLogTail: string | null;
|
|
245
|
+
peers: import("@qpjoy/electron-core-wireguard").WireGuardPeerRuntimeStatus[];
|
|
246
|
+
routes: string[];
|
|
247
|
+
ifconfig: string | null;
|
|
248
|
+
rawDump: string | null;
|
|
249
|
+
runtime: import("@qpjoy/electron-core-wireguard").WireGuardConnectionRuntimeStatus;
|
|
250
|
+
serviceState?: string | null;
|
|
251
|
+
error?: string | null;
|
|
252
|
+
} | {
|
|
253
|
+
launchDaemon: import("@qpjoy/electron-core-wireguard").WireGuardLaunchDaemonStatus;
|
|
254
|
+
ok: false;
|
|
255
|
+
active: false;
|
|
256
|
+
configPath: string;
|
|
257
|
+
error: string;
|
|
258
|
+
} | null;
|
|
259
|
+
export declare function probeLauncherWireGuardRoute(input: ElectronLauncherWireGuardProbeInput): {
|
|
260
|
+
ok: boolean;
|
|
261
|
+
targetIp: string;
|
|
262
|
+
interfaceName: string | null;
|
|
263
|
+
gateway: string | null;
|
|
264
|
+
viaLoopback: boolean;
|
|
265
|
+
expectedInterfaceName: string | null;
|
|
266
|
+
raw: string | null;
|
|
267
|
+
error: string | null;
|
|
268
|
+
};
|
|
269
|
+
export declare function probeLauncherWireGuardEndpoint(input: ElectronLauncherWireGuardEndpointProbeInput): {
|
|
270
|
+
ok: boolean;
|
|
271
|
+
endpoint: string | null;
|
|
272
|
+
host: string | null;
|
|
273
|
+
interfaceName: null;
|
|
274
|
+
gateway: null;
|
|
275
|
+
viaProxyTun: boolean;
|
|
276
|
+
raw: null;
|
|
277
|
+
error: string;
|
|
278
|
+
} | {
|
|
279
|
+
ok: boolean;
|
|
280
|
+
endpoint: string;
|
|
281
|
+
host: string;
|
|
282
|
+
interfaceName: string | null;
|
|
283
|
+
gateway: string | null;
|
|
284
|
+
viaProxyTun: boolean;
|
|
285
|
+
raw: string | null;
|
|
286
|
+
error: string | null;
|
|
287
|
+
};
|
|
288
|
+
export declare function launcherWireGuardConfigPath(input: ElectronLauncherWireGuardRuntimeOptions): string;
|
|
289
|
+
export declare function defaultBundledWireGuardDir(): string;
|