@opencode/browse 0.0.17-dev.180 → 0.0.17-dev.182
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-dbb5bjne.mjs → cli-29nz7n5s.mjs} +42 -41
- package/dist/cli.mjs +14 -14
- package/dist/{helpers-mbetgbwv.mjs → helpers-vyfqh9b2.mjs} +1 -3
- package/dist/{index-j79y2me1.mjs → index-gjq7chrk.mjs} +2 -2
- package/dist/{legacy-runtime-eky6yenx.mjs → legacy-runtime-6hnptg9g.mjs} +30 -17
- package/dist/main-4vvyemrj.mjs +4 -0
- package/dist/{main-awaqqre9.mjs → main-6a10pzcy.mjs} +117 -4
- package/dist/{main-f98q5tcf.mjs → main-6hvv25x8.mjs} +27 -29
- package/dist/main-6yn76a8h.mjs +1014 -0
- package/dist/{main-q2d5bd1e.mjs → main-7y95agwd.mjs} +8 -10
- package/dist/{main-3mhynene.mjs → main-9frwnsnf.mjs} +3 -5
- package/dist/{main-048kx59h.mjs → main-akpa411k.mjs} +6 -8
- package/dist/{main-v2a390e1.mjs → main-ddha60b9.mjs} +7 -9
- package/dist/{main-wfmad10p.mjs → main-emsvawnv.mjs} +16 -18
- package/dist/{main-g1frnq76.mjs → main-fak5r9je.mjs} +8 -7
- package/dist/{main-fpn564ph.mjs → main-gffzw2p5.mjs} +7 -4
- package/dist/{main-s3g4jwx5.mjs → main-jeta10c6.mjs} +23 -25
- package/dist/{main-wpt5ha44.mjs → main-m45zegrn.mjs} +371 -167
- package/dist/{main-46wtkfsd.mjs → main-qrjqb2nq.mjs} +200 -989
- package/dist/{main-jwss6gk9.mjs → main-s32xre10.mjs} +2 -2
- package/dist/main-wr4d7914.mjs +213 -0
- package/dist/{main-r8g3xydm.mjs → main-yegq8f5a.mjs} +3 -5
- package/dist/{main-44rp8pxg.mjs → main-zhhwe1b2.mjs} +4 -4
- package/dist/{mcp-amxrbrbd.mjs → mcp-s4zq3r5e.mjs} +37 -32
- package/dist/{migrate-07f3f3yp.mjs → migrate-bjbv00k0.mjs} +5 -6
- package/dist/{relay-e7fx469h.mjs → relay-c4d4s5wv.mjs} +134 -63
- package/dist/{runtime-update-xt7x7j6c.mjs → runtime-update-dxb97fdt.mjs} +9 -9
- package/dist/{setup-m85mamg6.mjs → setup-mjb2zzdx.mjs} +196 -129
- package/dist/{skill-text-7bqtc16a.mjs → skill-text-1rg5b5np.mjs} +12 -0
- package/dist/{supervisor-6zbwkkpt.mjs → supervisor-vwmswj0w.mjs} +10 -6
- package/dist/{update-drswqt2m.mjs → update-b708rvmn.mjs} +3 -4
- package/dist/{version-v3heqz8b.mjs → version-qnx1byw6.mjs} +1 -1
- package/package.json +1 -1
- package/skills/browse/SKILL.md +12 -0
- package/dist/main-4h7rfhhr.mjs +0 -61
- package/dist/main-amkq7v9m.mjs +0 -4
- package/dist/main-gg7f12gg.mjs +0 -114
- package/dist/main-qazf3bhk.mjs +0 -223
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
opencodeBrowserVersion2,
|
|
6
6
|
opencodeBrowserBuildId2
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-4vvyemrj.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-awaqqre9.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-6a10pzcy.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-46wtkfsd.mjs";
|
|
97
|
+
dataUrlDocument2
|
|
98
|
+
} from "./main-6yn76a8h.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-gffzw2p5.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-7y95agwd.mjs";
|
|
153
140
|
import {
|
|
154
141
|
defaultJournalBaseDir,
|
|
155
142
|
makeJournalEntry,
|
|
156
143
|
appendJournalEntry,
|
|
157
144
|
startJournalRetention
|
|
158
|
-
} from "./main-
|
|
145
|
+
} from "./main-ddha60b9.mjs";
|
|
159
146
|
import {
|
|
160
147
|
createUpdateWatcher2
|
|
161
|
-
} from "./main-
|
|
148
|
+
} from "./main-yegq8f5a.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-emsvawnv.mjs";
|
|
170
157
|
import {
|
|
171
158
|
relayHostname,
|
|
172
159
|
isLocalPeer,
|
|
173
160
|
installedDevExtension,
|
|
174
161
|
syncDevExtension
|
|
175
|
-
} from "./main-
|
|
162
|
+
} from "./main-zhhwe1b2.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-qrjqb2nq.mjs";
|
|
183
180
|
import {
|
|
184
181
|
relayTokenQueryParam,
|
|
185
182
|
relayToken,
|
|
186
183
|
secretsEqual,
|
|
187
184
|
ensurePrivateDirectory
|
|
188
|
-
} from "./main-
|
|
185
|
+
} from "./main-s32xre10.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-wr4d7914.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";
|
|
@@ -13412,6 +13415,7 @@ function sessionSummary(session) {
|
|
|
13412
13415
|
stateKeys: status.stateKeys,
|
|
13413
13416
|
...session.readOnly ? { readOnly: true } : {},
|
|
13414
13417
|
...session.allowedOrigins ? { allowedOrigins: [...session.allowedOrigins] } : {},
|
|
13418
|
+
...session.keepVisible ? { keepVisible: true } : {},
|
|
13415
13419
|
...session.browser ? { browser: session.browser.id } : {}
|
|
13416
13420
|
};
|
|
13417
13421
|
}
|
|
@@ -13429,6 +13433,7 @@ function persistedSession(session) {
|
|
|
13429
13433
|
updatedAt: session.updatedAt,
|
|
13430
13434
|
readOnly: session.readOnly,
|
|
13431
13435
|
...session.allowedOrigins ? { allowedOrigins: [...session.allowedOrigins] } : {},
|
|
13436
|
+
...session.keepVisible ? { keepVisible: true } : {},
|
|
13432
13437
|
...session.browser ? { browser: session.browser.id, ...session.browser.key ? { browserKey: session.browser.key } : {} } : {},
|
|
13433
13438
|
...target ? { target } : {},
|
|
13434
13439
|
...session.clientPid === undefined ? {} : { clientPid: session.clientPid }
|
|
@@ -13712,6 +13717,8 @@ function cleanupSettledAdoption(context, session, created, previousTarget, previ
|
|
|
13712
13717
|
});
|
|
13713
13718
|
if (session.allowedOrigins)
|
|
13714
13719
|
replacement.allowedOrigins = session.allowedOrigins;
|
|
13720
|
+
if (session.keepVisible)
|
|
13721
|
+
replacement.keepVisible = true;
|
|
13715
13722
|
if (session.browser)
|
|
13716
13723
|
replacement.browser = session.browser;
|
|
13717
13724
|
context.sessions.set(session.id, replacement);
|
|
@@ -13955,6 +13962,8 @@ class OpenCodeBrowserSessions {
|
|
|
13955
13962
|
});
|
|
13956
13963
|
if (entry.allowedOrigins && entry.allowedOrigins.length > 0)
|
|
13957
13964
|
session.allowedOrigins = entry.allowedOrigins;
|
|
13965
|
+
if (entry.keepVisible === true)
|
|
13966
|
+
session.keepVisible = true;
|
|
13958
13967
|
if (entry.browser)
|
|
13959
13968
|
session.browser = { id: entry.browser, ...entry.browserKey ? { key: entry.browserKey } : {} };
|
|
13960
13969
|
if (entry.target)
|
|
@@ -14000,6 +14009,8 @@ class OpenCodeBrowserSessions {
|
|
|
14000
14009
|
const session = this.createOpenCodeBrowserSession(sessionId, options?.readOnly === true);
|
|
14001
14010
|
if (options?.allowedOrigins && options.allowedOrigins.length > 0)
|
|
14002
14011
|
session.allowedOrigins = options.allowedOrigins;
|
|
14012
|
+
if (options?.keepVisible === true)
|
|
14013
|
+
session.keepVisible = true;
|
|
14003
14014
|
if (browser)
|
|
14004
14015
|
session.browser = browser;
|
|
14005
14016
|
this.sessions.set(sessionId, session);
|
|
@@ -14067,6 +14078,9 @@ class OpenCodeBrowserSessions {
|
|
|
14067
14078
|
return sessionSummary(session);
|
|
14068
14079
|
});
|
|
14069
14080
|
}
|
|
14081
|
+
keepsTabsVisible(id) {
|
|
14082
|
+
return this.sessions.get(id)?.keepVisible === true;
|
|
14083
|
+
}
|
|
14070
14084
|
isExecuting(id) {
|
|
14071
14085
|
return this.executing.has(id);
|
|
14072
14086
|
}
|
|
@@ -14214,6 +14228,8 @@ class OpenCodeBrowserSessions {
|
|
|
14214
14228
|
const session = manager.createOpenCodeBrowserSession(id, existing.readOnly);
|
|
14215
14229
|
if (existing.allowedOrigins)
|
|
14216
14230
|
session.allowedOrigins = existing.allowedOrigins;
|
|
14231
|
+
if (existing.keepVisible)
|
|
14232
|
+
session.keepVisible = true;
|
|
14217
14233
|
if (existing.browser)
|
|
14218
14234
|
session.browser = existing.browser;
|
|
14219
14235
|
if (existing.clientPid !== undefined)
|
|
@@ -14224,6 +14240,13 @@ class OpenCodeBrowserSessions {
|
|
|
14224
14240
|
}));
|
|
14225
14241
|
yield* manager.releaseSessionTargetOwnership(existing);
|
|
14226
14242
|
yield* manager.closeOpenCodeBrowserSession(existing);
|
|
14243
|
+
yield* sync2(() => {
|
|
14244
|
+
try {
|
|
14245
|
+
manager.hooks.onSessionDeleted?.(id);
|
|
14246
|
+
} catch (error) {
|
|
14247
|
+
console.error("Session reset hook failed", error);
|
|
14248
|
+
}
|
|
14249
|
+
});
|
|
14227
14250
|
return sessionSummary(session);
|
|
14228
14251
|
})));
|
|
14229
14252
|
return { session, ...stopped ? { stopped } : {} };
|
|
@@ -15681,6 +15704,7 @@ function handleCliRequest(options) {
|
|
|
15681
15704
|
const session = yield* options.sessions.create(optionalSessionId2(request.id), {
|
|
15682
15705
|
readOnly: request.readOnly === true,
|
|
15683
15706
|
...allowedOrigins ? { allowedOrigins } : {},
|
|
15707
|
+
...request.keepVisible === true ? { keepVisible: true } : {},
|
|
15684
15708
|
...request.browser ? { browser: request.browser } : {}
|
|
15685
15709
|
});
|
|
15686
15710
|
noteClient(options.request, options.sessions, session.id);
|
|
@@ -18385,6 +18409,9 @@ function createRelaySettingsSync(options) {
|
|
|
18385
18409
|
var attachedBadge = { text: "ON", color: "#7c3aed", title: "Detach from browse" };
|
|
18386
18410
|
var executingBadge = { text: "RUN", color: "#f59e0b", title: "browse is running a script. Click to stop it and take this tab back." };
|
|
18387
18411
|
var waitingBadge = (message) => ({ text: "WAIT", color: "#2563eb", title: `browse is waiting for you: ${message} Click here when you're done.` });
|
|
18412
|
+
function keepsTabVisible(sessionId, keepVisible, target) {
|
|
18413
|
+
return keepVisible && target?.owner === "relay" && target.opencodeBrowserSessionId === sessionId;
|
|
18414
|
+
}
|
|
18388
18415
|
function createTabPresentation(options) {
|
|
18389
18416
|
const {
|
|
18390
18417
|
registry,
|
|
@@ -18576,7 +18603,10 @@ function createTabPresentation(options) {
|
|
|
18576
18603
|
}
|
|
18577
18604
|
activeHandoffTabs.delete(sessionId);
|
|
18578
18605
|
}
|
|
18579
|
-
return executing ? void_3 : tabActivity.finish(sessionId);
|
|
18606
|
+
return executing ? void_3 : tabActivity.finish(sessionId, { keep: (tabId) => keepsVisible(sessionId, tabId) });
|
|
18607
|
+
}
|
|
18608
|
+
function keepsVisible(sessionId, tabId) {
|
|
18609
|
+
return keepsTabVisible(sessionId, getSessions().keepsTabsVisible(sessionId), registry.tabTargets.get(tabId));
|
|
18580
18610
|
}
|
|
18581
18611
|
function handleToolbarClick(tabId) {
|
|
18582
18612
|
const sessions = getSessions();
|
|
@@ -19108,6 +19138,7 @@ var PersistedSession = Struct({
|
|
|
19108
19138
|
updatedAt: String3,
|
|
19109
19139
|
readOnly: Boolean3,
|
|
19110
19140
|
allowedOrigins: optionalKey(ArraySchema(String3)),
|
|
19141
|
+
keepVisible: optionalKey(Boolean3),
|
|
19111
19142
|
browser: optionalKey(String3),
|
|
19112
19143
|
browserKey: optionalKey(String3),
|
|
19113
19144
|
target: optionalKey(Struct({
|
|
@@ -19386,12 +19417,27 @@ class TabActivity {
|
|
|
19386
19417
|
this.focusedBy.set(tabId, owners);
|
|
19387
19418
|
}));
|
|
19388
19419
|
}
|
|
19389
|
-
finish(sessionId) {
|
|
19420
|
+
finish(sessionId, options = {}) {
|
|
19390
19421
|
return this.focusLock.withPermit(gen({ self: this }, function* () {
|
|
19391
19422
|
for (const [tabId, owners] of this.focusedBy) {
|
|
19392
|
-
if (!owners.
|
|
19423
|
+
if (!owners.has(sessionId))
|
|
19393
19424
|
continue;
|
|
19394
19425
|
this.touch(tabId);
|
|
19426
|
+
if (options.keep?.(tabId) === true)
|
|
19427
|
+
continue;
|
|
19428
|
+
owners.delete(sessionId);
|
|
19429
|
+
if (owners.size > 0)
|
|
19430
|
+
continue;
|
|
19431
|
+
this.focusedBy.delete(tabId);
|
|
19432
|
+
yield* this.setFocus(tabId, false).pipe(ignore);
|
|
19433
|
+
}
|
|
19434
|
+
}));
|
|
19435
|
+
}
|
|
19436
|
+
release(sessionId) {
|
|
19437
|
+
return this.focusLock.withPermit(gen({ self: this }, function* () {
|
|
19438
|
+
for (const [tabId, owners] of this.focusedBy) {
|
|
19439
|
+
if (!owners.delete(sessionId))
|
|
19440
|
+
continue;
|
|
19395
19441
|
if (owners.size > 0)
|
|
19396
19442
|
continue;
|
|
19397
19443
|
this.focusedBy.delete(tabId);
|
|
@@ -19413,14 +19459,24 @@ var startRelay = fn("Relay.start")(function* (options = {}) {
|
|
|
19413
19459
|
var makeRelay = fnUntraced(function* (options = {}) {
|
|
19414
19460
|
const listenHost = relayHostname();
|
|
19415
19461
|
const host = "127.0.0.1";
|
|
19416
|
-
const
|
|
19462
|
+
const configuredPort = options.port ?? configuredRelayPort();
|
|
19463
|
+
const port = yield* tryPromise({
|
|
19464
|
+
try: () => chooseRelayPort({
|
|
19465
|
+
configuredPort,
|
|
19466
|
+
pinned: options.port !== undefined || relayPortPinned(),
|
|
19467
|
+
host: listenHost,
|
|
19468
|
+
...options.portCandidates ? { candidates: options.portCandidates } : {}
|
|
19469
|
+
}),
|
|
19470
|
+
catch: (cause) => cause instanceof Error ? cause : new Error("Choose the relay port", { cause })
|
|
19471
|
+
});
|
|
19417
19472
|
const releaseTargetGraceMs = Math.max(0, options.releaseTargetGraceMs ?? 1e4);
|
|
19418
19473
|
const browserId = crypto10.randomUUID();
|
|
19474
|
+
const startedAt = new Date().toISOString();
|
|
19419
19475
|
const endpointUrl = `http://${formatHostForUrl2(host)}:${port}`;
|
|
19420
19476
|
const additionalChromeExtensionOrigins = new Set(options.additionalExtensionOrigins ?? []);
|
|
19421
19477
|
const storeId = storeConfig().id ?? PUBLIC_STORE_ID;
|
|
19422
19478
|
additionalChromeExtensionOrigins.add(`chrome-extension://${storeId}`);
|
|
19423
|
-
const sessionCatalog = options.sessionCatalogPath === null ? undefined : new SessionCatalog(options.sessionCatalogPath ?? defaultSessionCatalogPath(
|
|
19479
|
+
const sessionCatalog = options.sessionCatalogPath === null ? undefined : new SessionCatalog(options.sessionCatalogPath ?? defaultSessionCatalogPath(configuredPort));
|
|
19424
19480
|
let catalogWritesEnabled = false;
|
|
19425
19481
|
const registry = new TargetRegistry;
|
|
19426
19482
|
const authToken = yield* try_2({
|
|
@@ -19628,6 +19684,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
19628
19684
|
}),
|
|
19629
19685
|
onSessionDeleted: (sessionId) => {
|
|
19630
19686
|
deviceMetricsOverrides.take(sessionId);
|
|
19687
|
+
runPromise(ignore(tabActivity.release(sessionId))).catch(() => {});
|
|
19631
19688
|
},
|
|
19632
19689
|
onExecuteRecord: (record) => {
|
|
19633
19690
|
const entry = makeJournalEntry({
|
|
@@ -19719,7 +19776,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
19719
19776
|
const restartTimeoutMs = yield* Int("OPENCODE_BROWSER_RESTART_TIMEOUT_MS").pipe(withDefault(1e4));
|
|
19720
19777
|
const clientGoneGraceMs = yield* Int("OPENCODE_BROWSER_CLIENT_GONE_GRACE_MS").pipe(withDefault(60000));
|
|
19721
19778
|
const restartRequestId = yield* option(String2("OPENCODE_BROWSER_RESTART_REQUEST_ID"));
|
|
19722
|
-
const lifecycleLogPath = path14.join(stateRoot(), "relays", String(
|
|
19779
|
+
const lifecycleLogPath = path14.join(stateRoot(), "relays", String(configuredPort), "lifecycle.jsonl");
|
|
19723
19780
|
const audit = (event) => try_2(() => appendRelayLifecycleEvent(lifecycleLogPath, event));
|
|
19724
19781
|
function setProtectedUi(tabId, protectedUi) {
|
|
19725
19782
|
const changed = registry.markRootTargetProtectedUi(tabId, protectedUi);
|
|
@@ -19976,7 +20033,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
19976
20033
|
port,
|
|
19977
20034
|
browserId,
|
|
19978
20035
|
authToken,
|
|
19979
|
-
relayInstance: { id: browserId, startedAt
|
|
20036
|
+
relayInstance: { id: browserId, startedAt, pid: process.pid, managed },
|
|
19980
20037
|
shutdown: shutdownControl,
|
|
19981
20038
|
registry,
|
|
19982
20039
|
recordingRelay,
|
|
@@ -20033,16 +20090,30 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
20033
20090
|
for (const link of browsers.list())
|
|
20034
20091
|
link.rpc.close();
|
|
20035
20092
|
yield* closeWebSocketServer2(websocketServer).pipe(logCloseError2("Failed to close websocket server"));
|
|
20036
|
-
yield* closeHttpServer2(httpServer).pipe(logCloseError2("Failed to close http server"));
|
|
20093
|
+
yield* closeHttpServer2(httpServer).pipe(logCloseError2("Failed to close http server"), ensuring(sync2(() => removeRelayState(browserId, stateRoot(), configuredPort))));
|
|
20037
20094
|
});
|
|
20038
20095
|
const close = cleanup();
|
|
20039
|
-
yield* catch_(
|
|
20040
|
-
|
|
20041
|
-
|
|
20042
|
-
|
|
20043
|
-
|
|
20044
|
-
|
|
20045
|
-
|
|
20096
|
+
yield* catch_(gen(function* () {
|
|
20097
|
+
yield* listenHttpServer2({ server: httpServer, host: listenHost, port });
|
|
20098
|
+
yield* try_2({
|
|
20099
|
+
try: () => writeRelayState({ port, configuredPort, pid: process.pid, instanceId: browserId, startedAt }),
|
|
20100
|
+
catch: (cause) => new Error("Write the relay port file", { cause })
|
|
20101
|
+
}).pipe(catch_((error) => {
|
|
20102
|
+
relayLog("relay.state.write_failed", { port, configuredPort, error: error.message });
|
|
20103
|
+
return port === configuredPort ? void_3 : fail6(error);
|
|
20104
|
+
}));
|
|
20105
|
+
yield* try_2({
|
|
20106
|
+
try: () => writeLastRelayPort(port, stateRoot(), configuredPort),
|
|
20107
|
+
catch: (cause) => new Error("Write the last relay port", { cause })
|
|
20108
|
+
}).pipe(catch_((error) => {
|
|
20109
|
+
relayLog("relay.last_port.write_failed", { port, configuredPort, error: error.message });
|
|
20110
|
+
return void_3;
|
|
20111
|
+
}));
|
|
20112
|
+
yield* sync2(() => pruneStaleExecuteFilesDirectories());
|
|
20113
|
+
}), (error) => gen(function* () {
|
|
20114
|
+
yield* cleanup();
|
|
20115
|
+
return yield* fail6(error);
|
|
20116
|
+
}));
|
|
20046
20117
|
yield* catch_(gen(function* () {
|
|
20047
20118
|
const restoredSessions = yield* tryPromise({
|
|
20048
20119
|
try: async () => {
|
|
@@ -20086,7 +20157,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
20086
20157
|
}
|
|
20087
20158
|
const dev = devExtension();
|
|
20088
20159
|
if (dev && installedDevExtension()) {
|
|
20089
|
-
syncDevExtension(dev).then((result) => {
|
|
20160
|
+
syncDevExtension(dev, { port }).then((result) => {
|
|
20090
20161
|
if (result === "updated")
|
|
20091
20162
|
relayLog("extension.dev_updated", { file: dev.file });
|
|
20092
20163
|
for (const link of browsers.list())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-9frwnsnf.mjs";
|
|
2
2
|
import"./main-pmfd055v.mjs";
|
|
3
|
-
import"./main-
|
|
3
|
+
import"./main-4vvyemrj.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-6a10pzcy.mjs";
|
|
22
|
+
import"./main-6yn76a8h.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-jwss6gk9.mjs";
|
|
29
|
+
} from "./main-qrjqb2nq.mjs";
|
|
30
|
+
import"./main-s32xre10.mjs";
|
|
31
|
+
import"./main-wr4d7914.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 + `
|