@nextclaw/x-harness 0.2.50 → 0.2.51
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
|
+
Version 0.2.51, commit 4fcb5b63209a99a05a176cc9a7242c1f7de614ea.
|
|
4
4
|
|
|
5
|
-
Complete source, build scripts and dependencies: https://github.com/Peiiii/x-harness/tree/
|
|
5
|
+
Complete source, build scripts and dependencies: https://github.com/Peiiii/x-harness/tree/4fcb5b63209a99a05a176cc9a7242c1f7de614ea
|
|
6
6
|
|
|
7
7
|
Clone this revision, run npm ci, npm run bootstrap and npm run release:build.
|
|
8
8
|
|
|
@@ -30,16 +30,23 @@ export class DOMNavigation {
|
|
|
30
30
|
posts?.length !== 1 ||
|
|
31
31
|
posts[0].quoteCards?.length !== 1 ||
|
|
32
32
|
posts[0].quoteCards[0].text !== command.cardText)
|
|
33
|
-
throw Error(
|
|
33
|
+
throw Error(`unique-observed-quote-required:snapshot:${posts?.length ?? 0}:${posts?.[0]?.quoteCards?.length ?? 0}`);
|
|
34
34
|
const article = this.#tab.playwright.getByRole("article").filter({
|
|
35
35
|
has: this.#tab.playwright.locator(`a[href=${JSON.stringify(posts[0].primary)}]`),
|
|
36
36
|
});
|
|
37
|
-
const
|
|
37
|
+
const cards = article
|
|
38
38
|
.locator('[role="link"][tabindex="0"]')
|
|
39
|
-
.filter({ visible: true
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
.filter({ visible: true });
|
|
40
|
+
const count = await cards.count();
|
|
41
|
+
const matches = [];
|
|
42
|
+
for (let i = 0; i < count; i++) {
|
|
43
|
+
const candidate = cards.nth(i);
|
|
44
|
+
if ((await candidate.innerText()) === command.cardText)
|
|
45
|
+
matches.push(candidate);
|
|
46
|
+
}
|
|
47
|
+
if (matches.length !== 1)
|
|
48
|
+
throw Error(`unique-observed-quote-required:controls:${count}:matches:${matches.length}`);
|
|
49
|
+
const card = matches[0];
|
|
43
50
|
this.#session.current = null;
|
|
44
51
|
await this.#tab.playwright.expectNavigation(() => card.click(), {
|
|
45
52
|
waitUntil: "commit",
|
package/dist/browser.js
CHANGED
|
@@ -138,7 +138,7 @@ export function readXSurface({ view, posts = [], targetId, replyTargetId, } = {}
|
|
|
138
138
|
.querySelector?.("time")
|
|
139
139
|
?.getAttribute("datetime"),
|
|
140
140
|
}))
|
|
141
|
-
.filter((card) => card.text?.trim()
|
|
141
|
+
.filter((card) => card.text?.trim())
|
|
142
142
|
: [],
|
|
143
143
|
};
|
|
144
144
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/x-harness",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.51",
|
|
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": "
|
|
45
|
+
"gitHead": "4fcb5b63209a99a05a176cc9a7242c1f7de614ea"
|
|
46
46
|
}
|