@opencode/browse 0.0.17-dev.179 → 0.0.17-dev.181
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/{Runtime-jrg7sc9p.mjs → Runtime-xss8qan1.mjs} +1 -1
- package/dist/{cli-ndjnhr9r.mjs → cli-1bdh4p0a.mjs} +60 -46
- package/dist/cli.mjs +14 -14
- package/dist/{helpers-tnqjatbp.mjs → helpers-bbaa1vjs.mjs} +1 -3
- package/dist/{index-j79y2me1.mjs → index-gjq7chrk.mjs} +2 -2
- package/dist/{legacy-runtime-we32g1pw.mjs → legacy-runtime-yjsm0xpg.mjs} +30 -17
- package/dist/{main-5hymrtzq.mjs → main-32bwyqja.mjs} +4 -4
- package/dist/{main-f98q5tcf.mjs → main-6hvv25x8.mjs} +27 -29
- package/dist/{main-tr20hmvg.mjs → main-6qfvnjxc.mjs} +7 -9
- package/dist/{main-3mhynene.mjs → main-9frwnsnf.mjs} +3 -5
- package/dist/{main-048kx59h.mjs → main-akpa411k.mjs} +6 -8
- package/dist/main-bt237ys7.mjs +1012 -0
- package/dist/main-d5ke1bpm.mjs +4 -0
- package/dist/{main-s3g4jwx5.mjs → main-jeta10c6.mjs} +23 -25
- package/dist/{main-wpt5ha44.mjs → main-m45zegrn.mjs} +371 -167
- package/dist/{main-46fba60d.mjs → main-pq962g72.mjs} +7 -4
- package/dist/main-q4typx7c.mjs +213 -0
- package/dist/{main-nesqaw1p.mjs → main-qccyxwg8.mjs} +3 -5
- package/dist/{main-zw20hm01.mjs → main-rb7dermc.mjs} +117 -4
- package/dist/{main-g131p1r6.mjs → main-reh7k0hv.mjs} +199 -989
- package/dist/{main-8jd0y17d.mjs → main-rvn834gn.mjs} +2 -2
- package/dist/{main-9fev890k.mjs → main-sfxkq31s.mjs} +16 -18
- package/dist/{main-thhv62x3.mjs → main-tg0r67xj.mjs} +8 -10
- package/dist/{main-rpzzm8dd.mjs → main-tk2thty0.mjs} +8 -7
- package/dist/{mcp-g9gatach.mjs → mcp-rjpmt73q.mjs} +31 -32
- package/dist/{migrate-9dmw3qm4.mjs → migrate-hggn66v2.mjs} +5 -6
- package/dist/{relay-bgmpqtc8.mjs → relay-fm6q9hnx.mjs} +128 -64
- package/dist/{runtime-update-6r9m6y2b.mjs → runtime-update-vdw1eajx.mjs} +9 -9
- package/dist/{setup-3be5gs2p.mjs → setup-wyrpwq4c.mjs} +196 -129
- package/dist/{supervisor-a9hk630y.mjs → supervisor-nbce8yhg.mjs} +10 -6
- package/dist/{update-xy15yz2m.mjs → update-be8dfw51.mjs} +3 -4
- package/dist/{version-5gnas829.mjs → version-6j8cdg2k.mjs} +1 -1
- package/package.json +1 -1
- package/dist/main-4h7rfhhr.mjs +0 -61
- package/dist/main-b3jrctcx.mjs +0 -114
- package/dist/main-qazf3bhk.mjs +0 -223
- package/dist/main-x0s8gad5.mjs +0 -4
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
opencodeBrowserVersion2,
|
|
6
6
|
opencodeBrowserBuildId2
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-d5ke1bpm.mjs";
|
|
8
8
|
import {
|
|
9
9
|
defaultRoots,
|
|
10
10
|
configRoot2,
|
|
@@ -21,15 +21,6 @@ import {
|
|
|
21
21
|
devExtension,
|
|
22
22
|
storeUrl,
|
|
23
23
|
installCommand,
|
|
24
|
-
autoUpdateModes,
|
|
25
|
-
installedRuntime2,
|
|
26
|
-
autoUpdateOverride,
|
|
27
|
-
storedMode,
|
|
28
|
-
setStoredMode,
|
|
29
|
-
autoUpdateStatus,
|
|
30
|
-
createAutoUpdater
|
|
31
|
-
} from "./main-zw20hm01.mjs";
|
|
32
|
-
import {
|
|
33
24
|
extensionProtocolVersion,
|
|
34
25
|
minExtensionProtocolVersion,
|
|
35
26
|
browserUnresponsive,
|
|
@@ -42,22 +33,21 @@ import {
|
|
|
42
33
|
isCdpRequest,
|
|
43
34
|
isExtensionResponse,
|
|
44
35
|
isExtensionEvent,
|
|
45
|
-
isJsonObject
|
|
46
|
-
|
|
36
|
+
isJsonObject,
|
|
37
|
+
autoUpdateModes,
|
|
38
|
+
installedRuntime2,
|
|
39
|
+
autoUpdateOverride,
|
|
40
|
+
storedMode,
|
|
41
|
+
setStoredMode,
|
|
42
|
+
autoUpdateStatus,
|
|
43
|
+
createAutoUpdater
|
|
44
|
+
} from "./main-rb7dermc.mjs";
|
|
47
45
|
import {
|
|
48
46
|
isNodeError,
|
|
49
47
|
isUnsupportedDirectorySyncError,
|
|
50
48
|
writeJsonFileAtomically,
|
|
51
49
|
ensurePrivateDirectorySync,
|
|
52
|
-
writePrivateJsonFileSync
|
|
53
|
-
} from "./main-4h7rfhhr.mjs";
|
|
54
|
-
import {
|
|
55
|
-
map,
|
|
56
|
-
withDefault,
|
|
57
|
-
option,
|
|
58
|
-
String2,
|
|
59
|
-
Int,
|
|
60
|
-
Boolean2,
|
|
50
|
+
writePrivateJsonFileSync,
|
|
61
51
|
ExecuteRequest,
|
|
62
52
|
SessionAdoptRequest,
|
|
63
53
|
SessionNewRequest,
|
|
@@ -89,7 +79,6 @@ import {
|
|
|
89
79
|
validateHostHeader2,
|
|
90
80
|
validateBrowserFetchSite2,
|
|
91
81
|
validateWebSocketOrigin2,
|
|
92
|
-
defaultPort2,
|
|
93
82
|
optionalSessionId2,
|
|
94
83
|
isValidSessionId2,
|
|
95
84
|
requiredSessionId2,
|
|
@@ -105,10 +94,8 @@ import {
|
|
|
105
94
|
getTargetInfo2,
|
|
106
95
|
isRestrictedTarget2,
|
|
107
96
|
isRestrictedUrl2,
|
|
108
|
-
dataUrlDocument2
|
|
109
|
-
|
|
110
|
-
relayLog
|
|
111
|
-
} from "./main-g131p1r6.mjs";
|
|
97
|
+
dataUrlDocument2
|
|
98
|
+
} from "./main-bt237ys7.mjs";
|
|
112
99
|
import {
|
|
113
100
|
context,
|
|
114
101
|
pendingPairingCodeKeys,
|
|
@@ -126,7 +113,7 @@ import {
|
|
|
126
113
|
pairingSessionKey,
|
|
127
114
|
sessionProof,
|
|
128
115
|
wrapToken
|
|
129
|
-
} from "./main-
|
|
116
|
+
} from "./main-pq962g72.mjs";
|
|
130
117
|
import {
|
|
131
118
|
makeUnsafe,
|
|
132
119
|
terminateChildProcess,
|
|
@@ -149,16 +136,16 @@ import {
|
|
|
149
136
|
checkNavigationUrl,
|
|
150
137
|
readSecret,
|
|
151
138
|
secretText
|
|
152
|
-
} from "./main-
|
|
139
|
+
} from "./main-tg0r67xj.mjs";
|
|
153
140
|
import {
|
|
154
141
|
defaultJournalBaseDir,
|
|
155
142
|
makeJournalEntry,
|
|
156
143
|
appendJournalEntry,
|
|
157
144
|
startJournalRetention
|
|
158
|
-
} from "./main-
|
|
145
|
+
} from "./main-6qfvnjxc.mjs";
|
|
159
146
|
import {
|
|
160
147
|
createUpdateWatcher2
|
|
161
|
-
} from "./main-
|
|
148
|
+
} from "./main-qccyxwg8.mjs";
|
|
162
149
|
import {
|
|
163
150
|
SettingsInputError,
|
|
164
151
|
parseSettingChanges,
|
|
@@ -166,31 +153,49 @@ import {
|
|
|
166
153
|
settingsToExtension,
|
|
167
154
|
describeSettings,
|
|
168
155
|
describeChanges
|
|
169
|
-
} from "./main-
|
|
156
|
+
} from "./main-sfxkq31s.mjs";
|
|
170
157
|
import {
|
|
171
158
|
relayHostname,
|
|
172
159
|
isLocalPeer,
|
|
173
160
|
installedDevExtension,
|
|
174
161
|
syncDevExtension
|
|
175
|
-
} from "./main-
|
|
162
|
+
} from "./main-32bwyqja.mjs";
|
|
176
163
|
import {
|
|
177
164
|
currentTimeMillis,
|
|
178
165
|
value,
|
|
179
166
|
when,
|
|
180
167
|
orElse,
|
|
181
168
|
exhaustive
|
|
182
|
-
} from "./main-
|
|
169
|
+
} from "./main-akpa411k.mjs";
|
|
170
|
+
import {
|
|
171
|
+
map,
|
|
172
|
+
withDefault,
|
|
173
|
+
option,
|
|
174
|
+
String2,
|
|
175
|
+
Int,
|
|
176
|
+
Boolean2,
|
|
177
|
+
appendManagedRelayProcessLog,
|
|
178
|
+
relayLog
|
|
179
|
+
} from "./main-reh7k0hv.mjs";
|
|
183
180
|
import {
|
|
184
181
|
relayTokenQueryParam,
|
|
185
182
|
relayToken,
|
|
186
183
|
secretsEqual,
|
|
187
184
|
ensurePrivateDirectory
|
|
188
|
-
} from "./main-
|
|
185
|
+
} from "./main-rvn834gn.mjs";
|
|
189
186
|
import {
|
|
190
187
|
join,
|
|
191
188
|
interrupt,
|
|
192
189
|
makeUnsafe2
|
|
193
|
-
} from "./main-
|
|
190
|
+
} from "./main-jeta10c6.mjs";
|
|
191
|
+
import {
|
|
192
|
+
configuredRelayPort,
|
|
193
|
+
relayPortPinned,
|
|
194
|
+
writeLastRelayPort,
|
|
195
|
+
writeRelayState,
|
|
196
|
+
removeRelayState,
|
|
197
|
+
chooseRelayPort
|
|
198
|
+
} from "./main-q4typx7c.mjs";
|
|
194
199
|
import {
|
|
195
200
|
taggedEnum,
|
|
196
201
|
is2,
|
|
@@ -211,8 +216,16 @@ import {
|
|
|
211
216
|
Int2,
|
|
212
217
|
Defect,
|
|
213
218
|
TaggedError2
|
|
214
|
-
} from "./main-
|
|
219
|
+
} from "./main-6hvv25x8.mjs";
|
|
215
220
|
import {
|
|
221
|
+
isString,
|
|
222
|
+
isNumber,
|
|
223
|
+
isBoolean,
|
|
224
|
+
isBigInt,
|
|
225
|
+
isSymbol,
|
|
226
|
+
isFunction,
|
|
227
|
+
isObjectOrArray,
|
|
228
|
+
isObject,
|
|
216
229
|
isNone,
|
|
217
230
|
isSome,
|
|
218
231
|
getOrElse,
|
|
@@ -290,17 +303,7 @@ import {
|
|
|
290
303
|
runSync,
|
|
291
304
|
fnUntraced,
|
|
292
305
|
fn
|
|
293
|
-
} from "./main-
|
|
294
|
-
import {
|
|
295
|
-
isString,
|
|
296
|
-
isNumber,
|
|
297
|
-
isBoolean,
|
|
298
|
-
isBigInt,
|
|
299
|
-
isSymbol,
|
|
300
|
-
isFunction,
|
|
301
|
-
isObjectOrArray,
|
|
302
|
-
isObject
|
|
303
|
-
} from "./main-qazf3bhk.mjs";
|
|
306
|
+
} from "./main-m45zegrn.mjs";
|
|
304
307
|
|
|
305
308
|
// src/relay.ts
|
|
306
309
|
import crypto10 from "node:crypto";
|
|
@@ -314,6 +317,16 @@ import path from "node:path";
|
|
|
314
317
|
|
|
315
318
|
// src/relay/rpc.ts
|
|
316
319
|
import { WebSocket } from "ws";
|
|
320
|
+
var extensionCommandTimeout = { fallback: 30000, min: 15000, max: 300000 };
|
|
321
|
+
var extensionPingTimeout = { fallback: 1e4, min: 1000, max: 30000 };
|
|
322
|
+
function configuredTimeoutMs(value, setting) {
|
|
323
|
+
const trimmed = value?.trim();
|
|
324
|
+
if (!trimmed)
|
|
325
|
+
return setting.fallback;
|
|
326
|
+
const parsed = Number(trimmed);
|
|
327
|
+
return Number.isInteger(parsed) ? Math.min(Math.max(parsed, setting.min), setting.max) : setting.fallback;
|
|
328
|
+
}
|
|
329
|
+
|
|
317
330
|
class ExtensionRpc {
|
|
318
331
|
timeouts;
|
|
319
332
|
socket;
|
|
@@ -323,6 +336,7 @@ class ExtensionRpc {
|
|
|
323
336
|
unansweredSince;
|
|
324
337
|
nextRequestId = 1;
|
|
325
338
|
pendingRequests = new Map;
|
|
339
|
+
pendingPings = new Set;
|
|
326
340
|
livenessProbe;
|
|
327
341
|
version;
|
|
328
342
|
protocolVersion;
|
|
@@ -334,6 +348,9 @@ class ExtensionRpc {
|
|
|
334
348
|
get connected() {
|
|
335
349
|
return this.socket?.readyState === WebSocket.OPEN && this.ready && !this.unresponsive && this.protocolCompatible !== false;
|
|
336
350
|
}
|
|
351
|
+
get pingPending() {
|
|
352
|
+
return this.pendingPings.size > 0;
|
|
353
|
+
}
|
|
337
354
|
get acceptsEvents() {
|
|
338
355
|
return this.socket?.readyState === WebSocket.OPEN && this.protocolCompatible === true;
|
|
339
356
|
}
|
|
@@ -427,7 +444,7 @@ class ExtensionRpc {
|
|
|
427
444
|
const replies = this.replies;
|
|
428
445
|
const message = { ...command, id };
|
|
429
446
|
let completed = false;
|
|
430
|
-
const timeoutMs = awaitsPagePromise(command) ? this.timeouts.awaitPromiseTimeoutMs ?? 5 * 60000 : command.method === "ping" ? this.timeouts.pingTimeoutMs ??
|
|
447
|
+
const timeoutMs = awaitsPagePromise(command) ? this.timeouts.awaitPromiseTimeoutMs ?? 5 * 60000 : command.method === "ping" ? this.timeouts.pingTimeoutMs ?? extensionPingTimeout.fallback : command.method === "debugger.sendCommand" ? this.timeouts.debuggerCommandTimeoutMs ?? 60000 : this.timeouts.commandTimeoutMs ?? extensionCommandTimeout.fallback;
|
|
431
448
|
const finish = (effect) => {
|
|
432
449
|
if (completed) {
|
|
433
450
|
return;
|
|
@@ -435,6 +452,7 @@ class ExtensionRpc {
|
|
|
435
452
|
completed = true;
|
|
436
453
|
clearTimeout(timeout);
|
|
437
454
|
this.pendingRequests.delete(id);
|
|
455
|
+
this.pendingPings.delete(id);
|
|
438
456
|
resume(effect);
|
|
439
457
|
};
|
|
440
458
|
const timeout = setTimeout(() => {
|
|
@@ -462,6 +480,8 @@ class ExtensionRpc {
|
|
|
462
480
|
},
|
|
463
481
|
...debuggerTabId === undefined ? {} : { debuggerTabId }
|
|
464
482
|
});
|
|
483
|
+
if (command.method === "ping")
|
|
484
|
+
this.pendingPings.add(id);
|
|
465
485
|
try {
|
|
466
486
|
socket.send(JSON.stringify(message), (error) => {
|
|
467
487
|
if (error) {
|
|
@@ -475,6 +495,7 @@ class ExtensionRpc {
|
|
|
475
495
|
completed = true;
|
|
476
496
|
clearTimeout(timeout);
|
|
477
497
|
this.pendingRequests.delete(id);
|
|
498
|
+
this.pendingPings.delete(id);
|
|
478
499
|
});
|
|
479
500
|
});
|
|
480
501
|
}
|
|
@@ -590,7 +611,7 @@ class BrowserLinks {
|
|
|
590
611
|
key: options.key,
|
|
591
612
|
id: this.identify(options.key, options.name),
|
|
592
613
|
name: options.name,
|
|
593
|
-
rpc: new ExtensionRpc,
|
|
614
|
+
rpc: new ExtensionRpc(this.options.timeouts),
|
|
594
615
|
socket: options.socket,
|
|
595
616
|
generation: ++this.generation,
|
|
596
617
|
connectedAt: Date.now(),
|
|
@@ -18234,6 +18255,8 @@ function createRelayHousekeeping(options) {
|
|
|
18234
18255
|
for (const link of browsers.list()) {
|
|
18235
18256
|
if (!link.rpc.connected && !link.rpc.unresponsive)
|
|
18236
18257
|
continue;
|
|
18258
|
+
if (link.rpc.pingPending)
|
|
18259
|
+
continue;
|
|
18237
18260
|
runPromise(link.rpc.send({ method: "ping" })).catch(() => {
|
|
18238
18261
|
if (!link.rpc.unresponsive || browsers.byKey(link.key) !== link)
|
|
18239
18262
|
return;
|
|
@@ -19393,14 +19416,24 @@ var startRelay = fn("Relay.start")(function* (options = {}) {
|
|
|
19393
19416
|
var makeRelay = fnUntraced(function* (options = {}) {
|
|
19394
19417
|
const listenHost = relayHostname();
|
|
19395
19418
|
const host = "127.0.0.1";
|
|
19396
|
-
const
|
|
19419
|
+
const configuredPort = options.port ?? configuredRelayPort();
|
|
19420
|
+
const port = yield* tryPromise({
|
|
19421
|
+
try: () => chooseRelayPort({
|
|
19422
|
+
configuredPort,
|
|
19423
|
+
pinned: options.port !== undefined || relayPortPinned(),
|
|
19424
|
+
host: listenHost,
|
|
19425
|
+
...options.portCandidates ? { candidates: options.portCandidates } : {}
|
|
19426
|
+
}),
|
|
19427
|
+
catch: (cause) => cause instanceof Error ? cause : new Error("Choose the relay port", { cause })
|
|
19428
|
+
});
|
|
19397
19429
|
const releaseTargetGraceMs = Math.max(0, options.releaseTargetGraceMs ?? 1e4);
|
|
19398
19430
|
const browserId = crypto10.randomUUID();
|
|
19431
|
+
const startedAt = new Date().toISOString();
|
|
19399
19432
|
const endpointUrl = `http://${formatHostForUrl2(host)}:${port}`;
|
|
19400
19433
|
const additionalChromeExtensionOrigins = new Set(options.additionalExtensionOrigins ?? []);
|
|
19401
19434
|
const storeId = storeConfig().id ?? PUBLIC_STORE_ID;
|
|
19402
19435
|
additionalChromeExtensionOrigins.add(`chrome-extension://${storeId}`);
|
|
19403
|
-
const sessionCatalog = options.sessionCatalogPath === null ? undefined : new SessionCatalog(options.sessionCatalogPath ?? defaultSessionCatalogPath(
|
|
19436
|
+
const sessionCatalog = options.sessionCatalogPath === null ? undefined : new SessionCatalog(options.sessionCatalogPath ?? defaultSessionCatalogPath(configuredPort));
|
|
19404
19437
|
let catalogWritesEnabled = false;
|
|
19405
19438
|
const registry = new TargetRegistry;
|
|
19406
19439
|
const authToken = yield* try_2({
|
|
@@ -19410,7 +19443,16 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
19410
19443
|
},
|
|
19411
19444
|
catch: (cause) => new Error("Create the relay token", { cause })
|
|
19412
19445
|
});
|
|
19413
|
-
const
|
|
19446
|
+
const extensionTimeoutEnv = getOrUndefined(yield* option(String2("OPENCODE_BROWSER_EXTENSION_TIMEOUT_MS")));
|
|
19447
|
+
const pingTimeoutEnv = getOrUndefined(yield* option(String2("OPENCODE_BROWSER_PING_TIMEOUT_MS")));
|
|
19448
|
+
const extensionCommandTimeoutMs = configuredTimeoutMs(extensionTimeoutEnv, extensionCommandTimeout);
|
|
19449
|
+
const extensionPingTimeoutMs = configuredTimeoutMs(pingTimeoutEnv, extensionPingTimeout);
|
|
19450
|
+
const browsers = new BrowserLinks({
|
|
19451
|
+
timeouts: {
|
|
19452
|
+
commandTimeoutMs: extensionCommandTimeoutMs,
|
|
19453
|
+
pingTimeoutMs: extensionPingTimeoutMs
|
|
19454
|
+
}
|
|
19455
|
+
});
|
|
19414
19456
|
const { sendToExtension, sendExtensionBestEffort, sendToEveryBrowser, sendToEach, cleanupTabs } = createExtensionCommands({ browsers, registry, onTabGone: forgetMissingTab });
|
|
19415
19457
|
const debugEnabled = yield* Boolean2("OPENCODE_BROWSER_DEBUG").pipe(withDefault(false));
|
|
19416
19458
|
const debugLog = debugEnabled ? (line) => console.error(`[bc ${new Date().toISOString().slice(11, 23)}] ${line}`) : undefined;
|
|
@@ -19690,7 +19732,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
19690
19732
|
const restartTimeoutMs = yield* Int("OPENCODE_BROWSER_RESTART_TIMEOUT_MS").pipe(withDefault(1e4));
|
|
19691
19733
|
const clientGoneGraceMs = yield* Int("OPENCODE_BROWSER_CLIENT_GONE_GRACE_MS").pipe(withDefault(60000));
|
|
19692
19734
|
const restartRequestId = yield* option(String2("OPENCODE_BROWSER_RESTART_REQUEST_ID"));
|
|
19693
|
-
const lifecycleLogPath = path14.join(stateRoot(), "relays", String(
|
|
19735
|
+
const lifecycleLogPath = path14.join(stateRoot(), "relays", String(configuredPort), "lifecycle.jsonl");
|
|
19694
19736
|
const audit = (event) => try_2(() => appendRelayLifecycleEvent(lifecycleLogPath, event));
|
|
19695
19737
|
function setProtectedUi(tabId, protectedUi) {
|
|
19696
19738
|
const changed = registry.markRootTargetProtectedUi(tabId, protectedUi);
|
|
@@ -19947,7 +19989,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
19947
19989
|
port,
|
|
19948
19990
|
browserId,
|
|
19949
19991
|
authToken,
|
|
19950
|
-
relayInstance: { id: browserId, startedAt
|
|
19992
|
+
relayInstance: { id: browserId, startedAt, pid: process.pid, managed },
|
|
19951
19993
|
shutdown: shutdownControl,
|
|
19952
19994
|
registry,
|
|
19953
19995
|
recordingRelay,
|
|
@@ -20004,16 +20046,30 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
20004
20046
|
for (const link of browsers.list())
|
|
20005
20047
|
link.rpc.close();
|
|
20006
20048
|
yield* closeWebSocketServer2(websocketServer).pipe(logCloseError2("Failed to close websocket server"));
|
|
20007
|
-
yield* closeHttpServer2(httpServer).pipe(logCloseError2("Failed to close http server"));
|
|
20049
|
+
yield* closeHttpServer2(httpServer).pipe(logCloseError2("Failed to close http server"), ensuring(sync2(() => removeRelayState(browserId, stateRoot(), configuredPort))));
|
|
20008
20050
|
});
|
|
20009
20051
|
const close = cleanup();
|
|
20010
|
-
yield* catch_(
|
|
20011
|
-
|
|
20012
|
-
|
|
20013
|
-
|
|
20014
|
-
|
|
20015
|
-
|
|
20016
|
-
|
|
20052
|
+
yield* catch_(gen(function* () {
|
|
20053
|
+
yield* listenHttpServer2({ server: httpServer, host: listenHost, port });
|
|
20054
|
+
yield* try_2({
|
|
20055
|
+
try: () => writeRelayState({ port, configuredPort, pid: process.pid, instanceId: browserId, startedAt }),
|
|
20056
|
+
catch: (cause) => new Error("Write the relay port file", { cause })
|
|
20057
|
+
}).pipe(catch_((error) => {
|
|
20058
|
+
relayLog("relay.state.write_failed", { port, configuredPort, error: error.message });
|
|
20059
|
+
return port === configuredPort ? void_3 : fail6(error);
|
|
20060
|
+
}));
|
|
20061
|
+
yield* try_2({
|
|
20062
|
+
try: () => writeLastRelayPort(port, stateRoot(), configuredPort),
|
|
20063
|
+
catch: (cause) => new Error("Write the last relay port", { cause })
|
|
20064
|
+
}).pipe(catch_((error) => {
|
|
20065
|
+
relayLog("relay.last_port.write_failed", { port, configuredPort, error: error.message });
|
|
20066
|
+
return void_3;
|
|
20067
|
+
}));
|
|
20068
|
+
yield* sync2(() => pruneStaleExecuteFilesDirectories());
|
|
20069
|
+
}), (error) => gen(function* () {
|
|
20070
|
+
yield* cleanup();
|
|
20071
|
+
return yield* fail6(error);
|
|
20072
|
+
}));
|
|
20017
20073
|
yield* catch_(gen(function* () {
|
|
20018
20074
|
const restoredSessions = yield* tryPromise({
|
|
20019
20075
|
try: async () => {
|
|
@@ -20057,7 +20113,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
20057
20113
|
}
|
|
20058
20114
|
const dev = devExtension();
|
|
20059
20115
|
if (dev && installedDevExtension()) {
|
|
20060
|
-
syncDevExtension(dev).then((result) => {
|
|
20116
|
+
syncDevExtension(dev, { port }).then((result) => {
|
|
20061
20117
|
if (result === "updated")
|
|
20062
20118
|
relayLog("extension.dev_updated", { file: dev.file });
|
|
20063
20119
|
for (const link of browsers.list())
|
|
@@ -20065,7 +20121,15 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
20065
20121
|
handshake.reloadOutdatedDevExtension(link);
|
|
20066
20122
|
}, (error) => relayLog("extension.dev_update_failed", { error: error.message }));
|
|
20067
20123
|
}
|
|
20068
|
-
relayLog("relay.ready", {
|
|
20124
|
+
relayLog("relay.ready", {
|
|
20125
|
+
url: endpointUrl,
|
|
20126
|
+
version: opencodeBrowserVersion2,
|
|
20127
|
+
build: opencodeBrowserBuildId2,
|
|
20128
|
+
pid: process.pid,
|
|
20129
|
+
managed,
|
|
20130
|
+
extensionTimeoutMs: extensionCommandTimeoutMs,
|
|
20131
|
+
pingTimeoutMs: extensionPingTimeoutMs
|
|
20132
|
+
});
|
|
20069
20133
|
}), (error) => gen(function* () {
|
|
20070
20134
|
yield* cleanup();
|
|
20071
20135
|
return yield* fail6(error);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-9frwnsnf.mjs";
|
|
2
2
|
import"./main-pmfd055v.mjs";
|
|
3
|
-
import"./main-
|
|
3
|
+
import"./main-d5ke1bpm.mjs";
|
|
4
4
|
import {
|
|
5
5
|
cliCommand,
|
|
6
6
|
installCommand,
|
|
@@ -18,17 +18,17 @@ import {
|
|
|
18
18
|
registryUrl,
|
|
19
19
|
fetchPublished,
|
|
20
20
|
runInstaller
|
|
21
|
-
} from "./main-
|
|
22
|
-
import"./main-
|
|
21
|
+
} from "./main-rb7dermc.mjs";
|
|
22
|
+
import"./main-bt237ys7.mjs";
|
|
23
|
+
import"./main-jeta10c6.mjs";
|
|
23
24
|
import {
|
|
24
25
|
Service,
|
|
25
26
|
layerFetch,
|
|
26
27
|
restartRelay,
|
|
27
28
|
startManagedRelay
|
|
28
|
-
} from "./main-
|
|
29
|
-
import"./main-
|
|
30
|
-
import"./main-
|
|
31
|
-
import"./main-8jd0y17d.mjs";
|
|
29
|
+
} from "./main-reh7k0hv.mjs";
|
|
30
|
+
import"./main-rvn834gn.mjs";
|
|
31
|
+
import"./main-q4typx7c.mjs";
|
|
32
32
|
import {
|
|
33
33
|
succeed6,
|
|
34
34
|
gen,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
catch_,
|
|
37
37
|
provide3,
|
|
38
38
|
runPromise
|
|
39
|
-
} from "./main-
|
|
39
|
+
} from "./main-m45zegrn.mjs";
|
|
40
40
|
|
|
41
41
|
// src/update/runtime-update.ts
|
|
42
42
|
var log = (line) => process.stdout.write(line + `
|