dsh-browser-playwright-codex 0.7.8 → 0.8.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/CHANGELOG.md +64 -0
- package/NOTICE.md +26 -5
- package/README.md +27 -4
- package/lib/browser-lifecycle.js +27 -1
- package/lib/client.js +1219 -647
- package/lib/config.d.ts +26 -0
- package/lib/config.js +20 -0
- package/lib/page-actions.js +32 -1
- package/lib/provider.js +8 -0
- package/lib/read-deadline.d.ts +5 -1
- package/lib/read-deadline.js +10 -3
- package/lib/runtime-state.d.ts +26 -0
- package/lib/runtime-state.js +100 -0
- package/lib/session.d.ts +11 -0
- package/lib/session.js +25 -2
- package/lib/settings-card.js +123 -0
- package/lib/swarm-contract.d.ts +226 -0
- package/lib/swarm-contract.js +209 -0
- package/lib/swarm-curtain.d.ts +22 -0
- package/lib/swarm-curtain.js +115 -0
- package/lib/swarm-intro.d.ts +66 -0
- package/lib/swarm-intro.js +827 -0
- package/lib/tool.js +14 -4
- package/package.json +4 -2
package/lib/tool.js
CHANGED
|
@@ -138,13 +138,18 @@ export function apply(ctx, config) {
|
|
|
138
138
|
waitFor: {
|
|
139
139
|
type: 'string',
|
|
140
140
|
enum: ['load', 'domcontentloaded', 'networkidle'],
|
|
141
|
-
description: 'Load condition to wait for. Defaults to load
|
|
141
|
+
description: 'Load condition to wait for. Defaults to domcontentloaded; load never fires on long-polling or ' +
|
|
142
|
+
'download pages and hangs the call (issue #5).',
|
|
142
143
|
},
|
|
143
144
|
},
|
|
144
145
|
output: { schema: SNAPSHOT_SCHEMA, render: renderSnapshotValue },
|
|
145
146
|
async execute(args, exec) {
|
|
146
147
|
const session = await acquire(exec);
|
|
147
|
-
|
|
148
|
+
// domcontentloaded, not load: a page with an endless subresource (long
|
|
149
|
+
// poll, streaming download, ad frame that never settles) never reaches
|
|
150
|
+
// 'load', so the default burned the whole navigation timeout on pages
|
|
151
|
+
// that were perfectly usable already (issue #5).
|
|
152
|
+
const waitUntil = args.waitFor ?? 'domcontentloaded';
|
|
148
153
|
return snapshotValue(await session.navigate(args.url, waitUntil, exec.signal));
|
|
149
154
|
},
|
|
150
155
|
}));
|
|
@@ -435,13 +440,18 @@ export function apply(ctx, config) {
|
|
|
435
440
|
waitFor: {
|
|
436
441
|
type: 'string',
|
|
437
442
|
enum: ['load', 'domcontentloaded', 'networkidle'],
|
|
438
|
-
description: 'Load condition to wait for. Defaults to load
|
|
443
|
+
description: 'Load condition to wait for. Defaults to domcontentloaded; load never fires on long-polling or ' +
|
|
444
|
+
'download pages and hangs the call (issue #5).',
|
|
439
445
|
},
|
|
440
446
|
},
|
|
441
447
|
output: { schema: SNAPSHOT_SCHEMA, render: renderSnapshotValue },
|
|
442
448
|
async execute(args, exec) {
|
|
443
449
|
const session = await acquire(exec);
|
|
444
|
-
|
|
450
|
+
// domcontentloaded, not load: a page with an endless subresource (long
|
|
451
|
+
// poll, streaming download, ad frame that never settles) never reaches
|
|
452
|
+
// 'load', so the default burned the whole navigation timeout on pages
|
|
453
|
+
// that were perfectly usable already (issue #5).
|
|
454
|
+
const waitUntil = args.waitFor ?? 'domcontentloaded';
|
|
445
455
|
return snapshotValue(await session.openTab(args.url, waitUntil, exec.signal));
|
|
446
456
|
},
|
|
447
457
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-browser-playwright-codex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Browser automation for DeepSeek Harness, one plugin: fill in forms, scrape lists and work across tabs in real pages, using the logins you already have. Runs in a visible window that stays quiet when minimised; native dialogs are parked instead of confirmed, CAPTCHA pages are flagged with a note that says stop and hand the page back, password / one-time-code / card fields are refused by browser_fill, and the Settings card (enable/disable, page-reading mode, capability gates) now lives inside this package.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -57,10 +57,12 @@
|
|
|
57
57
|
"verify": "npm run build && node scripts/dsh-browser-verify.mjs",
|
|
58
58
|
"verify:live": "npm run build && node scripts/dsh-browser-verify.mjs --live",
|
|
59
59
|
"doctor": "node scripts/doctor.mjs",
|
|
60
|
+
"swarm:patch": "node scripts/swarm-patch.mjs",
|
|
61
|
+
"swarm:check": "node scripts/swarm-patch.mjs --check",
|
|
60
62
|
"cost": "node node_modules/tsx/dist/cli.mjs scripts/measure-prompt-cost.mjs",
|
|
61
63
|
"format": "node node_modules/prettier/bin/prettier.cjs --write \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.mjs\"",
|
|
62
64
|
"format:check": "node node_modules/prettier/bin/prettier.cjs --check \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.mjs\"",
|
|
63
|
-
"prepublishOnly": "npm run build && npm run typecheck && npm test && npm run verify && npm run preflight",
|
|
65
|
+
"prepublishOnly": "npm run build && npm run typecheck && npm test && npm run swarm:check && npm run verify && npm run preflight",
|
|
64
66
|
"preflight": "node scripts/preflight.mjs ."
|
|
65
67
|
},
|
|
66
68
|
"dependencies": {
|