@farmslot/adapter-web 0.19.14 → 0.19.16
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/CHANGELOG.md +8 -0
- package/package.json +4 -4
- package/src/launch-browser.cjs +23 -8
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,14 @@ All notable changes to `@farmslot/adapter-web` are tracked here.
|
|
|
6
6
|
|
|
7
7
|
- Active-development baseline; add user-facing changes here before release or package publication.
|
|
8
8
|
|
|
9
|
+
## 0.19.16 - 2026-11-15
|
|
10
|
+
|
|
11
|
+
- Align exact package dependencies with the protocol 0.86.0 and runtime 0.48.1 release cohort.
|
|
12
|
+
|
|
13
|
+
## 0.19.15 - 2026-11-15
|
|
14
|
+
|
|
15
|
+
- Release provisional browser quarantine after a launch with the exact nonce times out and its profile processes are confirmed stopped, so a temporary CDP readiness failure does not permanently block later launches. Unseen detached submissions remain quarantined.
|
|
16
|
+
|
|
9
17
|
## 0.19.14 - 2026-11-15
|
|
10
18
|
|
|
11
19
|
- Align exact package dependencies with the protocol 0.85.0 and runtime 0.48.0 release cohort.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farmslot/adapter-web",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.16",
|
|
4
4
|
"description": "Web platform adapter for Farmslot recipes: resolve and launch an isolated Chromium, own its CDP port, load unpacked extensions, and keep macOS focus.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"exports": {
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"prepublishOnly": "node ../../scripts/quality/check-farmslot-package-readiness.mjs --publish --packages @farmslot/adapter-web"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@farmslot/adapter-sdk": "0.27.
|
|
91
|
-
"@farmslot/protocol": "0.
|
|
92
|
-
"@farmslot/recipe-runner": "0.46.
|
|
90
|
+
"@farmslot/adapter-sdk": "0.27.9",
|
|
91
|
+
"@farmslot/protocol": "0.86.0",
|
|
92
|
+
"@farmslot/recipe-runner": "0.46.18",
|
|
93
93
|
"ws": "^8.18.0"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
package/src/launch-browser.cjs
CHANGED
|
@@ -286,13 +286,20 @@ function runLaunch(opts, acquireLock) {
|
|
|
286
286
|
};
|
|
287
287
|
// Any outcome but an owned listener stops what this launch started, a ps or
|
|
288
288
|
// lsof failure mid-wait included. The launch markers stay until ownership is
|
|
289
|
-
// proven, except when
|
|
290
|
-
//
|
|
291
|
-
//
|
|
289
|
+
// proven, except when the exact launch was seen and has now stopped, or a
|
|
290
|
+
// foreign process took the port from its stopped browser. Unseen submissions
|
|
291
|
+
// stay quarantined because Launch Services may still start them later.
|
|
292
292
|
const awaitOwnedListener = (stopOptions, firstSightingMs) => {
|
|
293
293
|
let waited;
|
|
294
294
|
try {
|
|
295
|
-
waited = waitForOwnedCdpPid(
|
|
295
|
+
waited = waitForOwnedCdpPid(
|
|
296
|
+
cdpPort,
|
|
297
|
+
ownedBrowser,
|
|
298
|
+
profile,
|
|
299
|
+
opts.progress,
|
|
300
|
+
firstSightingMs,
|
|
301
|
+
runtimeNonce,
|
|
302
|
+
);
|
|
296
303
|
} catch (error) {
|
|
297
304
|
try {
|
|
298
305
|
stopProfileProcessesSync(profile, stopOptions);
|
|
@@ -309,7 +316,7 @@ function runLaunch(opts, acquireLock) {
|
|
|
309
316
|
}
|
|
310
317
|
if (waited.pid !== undefined) return waited.pid;
|
|
311
318
|
stopProfileProcessesSync(profile, stopOptions);
|
|
312
|
-
if (waited.foreignPids && waited.seen) clearLaunchMarkers();
|
|
319
|
+
if ((waited.foreignPids && waited.seen) || waited.observedLaunch) clearLaunchMarkers();
|
|
313
320
|
throw ownedListenerMissing(waited);
|
|
314
321
|
};
|
|
315
322
|
const logFd = fs.openSync(opts.chromeLog, 'a');
|
|
@@ -570,11 +577,12 @@ function foreignPortError(port, pids, next = 'pick a free --cdp-port, or stop th
|
|
|
570
577
|
// profile. Either must hold for a second, so a brief ps/lsof gap is not taken
|
|
571
578
|
// for a failure. "Exited" counts only once a profile process has been seen, or
|
|
572
579
|
// after `firstSightingMs` with none. `seen` says whether one was.
|
|
573
|
-
function waitForOwnedCdpPid(port, ownedBrowser, profile, progress, firstSightingMs) {
|
|
580
|
+
function waitForOwnedCdpPid(port, ownedBrowser, profile, progress, firstSightingMs, runtimeNonce) {
|
|
574
581
|
const budgetMs = 30_000;
|
|
575
582
|
const confirmMs = 1000;
|
|
576
583
|
const startedAt = Date.now();
|
|
577
584
|
let seen = false;
|
|
585
|
+
let observedLaunch = false;
|
|
578
586
|
let exitedSince = null;
|
|
579
587
|
let foreignSince = null;
|
|
580
588
|
let reportedAt = startedAt;
|
|
@@ -583,8 +591,13 @@ function waitForOwnedCdpPid(port, ownedBrowser, profile, progress, firstSighting
|
|
|
583
591
|
const pid = listeners.find(ownedBrowser);
|
|
584
592
|
if (pid !== undefined) return { pid };
|
|
585
593
|
const now = Date.now();
|
|
586
|
-
|
|
594
|
+
const profilePids = profileProcessPids(profile);
|
|
595
|
+
if (profilePids.length > 0) {
|
|
587
596
|
seen = true;
|
|
597
|
+
// A nonce binds this appearance to the submitted launch, not another profile owner.
|
|
598
|
+
observedLaunch ||= profilePids.some((pid) =>
|
|
599
|
+
processCommand(pid)?.includes(`--farmslot-runtime-nonce=${runtimeNonce}`),
|
|
600
|
+
);
|
|
588
601
|
exitedSince = null;
|
|
589
602
|
} else if (seen || now - startedAt >= firstSightingMs) {
|
|
590
603
|
exitedSince ??= now;
|
|
@@ -605,7 +618,9 @@ function waitForOwnedCdpPid(port, ownedBrowser, profile, progress, firstSighting
|
|
|
605
618
|
}
|
|
606
619
|
spawnSync('sleep', ['0.1']);
|
|
607
620
|
}
|
|
608
|
-
|
|
621
|
+
// A known-started launch can be released after its processes are confirmed stopped.
|
|
622
|
+
// Unseen Launch Services submissions retain their quarantine against delayed startup.
|
|
623
|
+
return { seen, observedLaunch };
|
|
609
624
|
}
|
|
610
625
|
|
|
611
626
|
function assertIsolatedProfile(profile) {
|