@farmslot/adapter-web 0.7.1 → 0.7.2
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 +4 -0
- package/package.json +1 -1
- package/src/web-dapp/index.mjs +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,10 @@ All notable changes to `@farmslot/adapter-web` are tracked here.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 0.7.2 - 2026-10-12
|
|
8
|
+
|
|
9
|
+
- Record web-dapp recipes through the shared recorder, selecting only the owned browser on the requested CDP port.
|
|
10
|
+
|
|
7
11
|
## 0.7.1 - 2026-10-12
|
|
8
12
|
|
|
9
13
|
- Update shared runtime dependencies for corrected keyboard events and bounded log observations.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farmslot/adapter-web",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
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": {
|
package/src/web-dapp/index.mjs
CHANGED
|
@@ -17,7 +17,9 @@ import { fileURLToPath } from 'node:url';
|
|
|
17
17
|
|
|
18
18
|
import { recipeRuntimePath, shellQuote } from './lib/paths.mjs';
|
|
19
19
|
import { POLICY_ENV, webDappAdapterId, webDappPolicy } from './lib/policy.mjs';
|
|
20
|
+
import { cdpListenerPids, ownsProcess } from './lib/processes.mjs';
|
|
20
21
|
import { check, webDappReadiness } from './lib/readiness.mjs';
|
|
22
|
+
import { cdpPort, readBrowserState, webDappRuntimeDir } from './lib/runtime.mjs';
|
|
21
23
|
import { defaultSigner, loadSigners, SIGNER_MODULE_ENV } from './lib/signers.mjs';
|
|
22
24
|
import { resolveBrowser } from './launch.mjs';
|
|
23
25
|
|
|
@@ -324,6 +326,26 @@ export function createWebDappAdapter(factoryOptions = {}) {
|
|
|
324
326
|
sdkVersion: 1,
|
|
325
327
|
headless: false,
|
|
326
328
|
|
|
329
|
+
recording: {
|
|
330
|
+
async target(context) {
|
|
331
|
+
const port = cdpPort(context, context.env);
|
|
332
|
+
const state = await readBrowserState(context.projectRoot);
|
|
333
|
+
const pid = state?.browserPid;
|
|
334
|
+
if (
|
|
335
|
+
!Number.isInteger(pid) ||
|
|
336
|
+
pid <= 0 ||
|
|
337
|
+
state.cdpPort !== port ||
|
|
338
|
+
!ownsProcess('browser', pid, webDappRuntimeDir(context.projectRoot)) ||
|
|
339
|
+
!cdpListenerPids(port).includes(pid)
|
|
340
|
+
) {
|
|
341
|
+
throw new Error(
|
|
342
|
+
`Could not resolve the owned ${webDappAdapterId()} browser for recording on CDP ${port}. Next: launch and verify the selected slot browser.`,
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
return { kind: 'pid', pid };
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
|
|
327
349
|
resolveSlotPorts() {
|
|
328
350
|
// Ports come from the slot (Farmslot {{port}} / {{cdp_port}}) through
|
|
329
351
|
// --watcher-port / --cdp-port or the runtime context; nothing is claimed here.
|