@nextclaw/x-harness 0.2.3 → 0.2.5

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/SOURCE.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Corresponding source
2
2
 
3
- Version 0.2.3, commit 51c80ceb827a4eb28c4fbbd78b9182ba3332156d.
3
+ Version 0.2.5, commit 21296078d83715b8a40b2bd80cf18ef0df01076c.
4
4
 
5
- Complete source, build scripts and dependencies: https://github.com/Peiiii/x-harness/tree/51c80ceb827a4eb28c4fbbd78b9182ba3332156d
5
+ Complete source, build scripts and dependencies: https://github.com/Peiiii/x-harness/tree/21296078d83715b8a40b2bd80cf18ef0df01076c
6
6
 
7
7
  Clone this revision, run npm ci, npm run bootstrap and npm run release:build.
8
8
 
@@ -367,9 +367,21 @@ export class DOMEditing {
367
367
  const submits = result.buttons.filter((b) => /^(回复|Reply|发帖|发布|Post|更新|Update)$/i.test(b.label));
368
368
  if (submits.length !== 1)
369
369
  throw new Error("编辑后提交入口不唯一");
370
- await this.#locator("button", submits[0].label)
371
- .and(this.#tab.playwright.locator(':not([disabled]):not([aria-disabled="true"])'))
372
- .waitFor({ state: "visible", timeoutMs: 5000 });
370
+ const enabled = this.#locator("button", submits[0].label).and(this.#tab.playwright.locator(':not([disabled]):not([aria-disabled="true"])'));
371
+ // Some hosts cap each locator wait at 5s. Bound video processing to 12 waits;
372
+ // this never retries a submission and every subsequent step re-observes.
373
+ const waits = result.videos?.length ? 12 : 1;
374
+ for (let attempt = 0; attempt < waits; attempt++) {
375
+ try {
376
+ await enabled.waitFor({ state: "visible", timeoutMs: 5000 });
377
+ break;
378
+ }
379
+ catch (error) {
380
+ if (attempt + 1 === waits ||
381
+ !/timed out|deadline exceeded/i.test(error.message))
382
+ throw error;
383
+ }
384
+ }
373
385
  return { completed: true };
374
386
  return { completed: false, loc, submittedEditor };
375
387
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/x-harness",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "type": "module",
5
5
  "description": "Typed X task harness with compact business results and explicit diagnostics.",
6
6
  "main": "./dist/index.js",
@@ -42,5 +42,5 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "51c80ceb827a4eb28c4fbbd78b9182ba3332156d"
45
+ "gitHead": "21296078d83715b8a40b2bd80cf18ef0df01076c"
46
46
  }