@nextclaw/x-harness 0.2.51 → 0.2.52

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.51, commit 4fcb5b63209a99a05a176cc9a7242c1f7de614ea.
3
+ Version 0.2.52, commit b3e3310d4977db067f05ee409f58ae619f042c9a.
4
4
 
5
- Complete source, build scripts and dependencies: https://github.com/Peiiii/x-harness/tree/4fcb5b63209a99a05a176cc9a7242c1f7de614ea
5
+ Complete source, build scripts and dependencies: https://github.com/Peiiii/x-harness/tree/b3e3310d4977db067f05ee409f58ae619f042c9a
6
6
 
7
7
  Clone this revision, run npm ci, npm run bootstrap and npm run release:build.
8
8
 
@@ -71,6 +71,12 @@ export class DOMNavigation {
71
71
  return;
72
72
  }
73
73
  async handleWaitForFolder(command) {
74
+ if (command.selected) {
75
+ await this.#tab.playwright
76
+ .getByRole("heading", { name: command.folder, exact: true })
77
+ .waitFor({ state: "visible", timeoutMs: 5000 });
78
+ return;
79
+ }
74
80
  if (command.folderDiscovery) {
75
81
  // "All bookmarks" renders before the asynchronously loaded named cards.
76
82
  // Wait for any named card inside that specific menu, never an unrelated
@@ -9,6 +9,7 @@ export declare class PlatformCollections {
9
9
  private handleCollectSources;
10
10
  private handleReadCreator;
11
11
  private handleReadBookmarks;
12
+ private confirmBookmarkFolder;
12
13
  private bookmarkDiscovery;
13
14
  private waitForBookmarkLabel;
14
15
  private handleSearchSources;
@@ -294,15 +294,9 @@ export class PlatformCollections {
294
294
  folder,
295
295
  controls: nav.controls,
296
296
  };
297
- const selected = await this.#ready({ view: "navigation" });
298
- if (selected.page === nav.page && !selected.headings?.includes(folder))
299
- return {
300
- status: "needsDecision",
301
- complete: false,
302
- missing: ["folder-selection-unconfirmed"],
303
- folder,
304
- page: selected.page,
305
- };
297
+ const selected = await this.confirmBookmarkFolder(folder);
298
+ if (selected.status)
299
+ return selected;
306
300
  const value = await this.handleCollectSources(window);
307
301
  return {
308
302
  ...value,
@@ -314,6 +308,35 @@ export class PlatformCollections {
314
308
  },
315
309
  };
316
310
  }
311
+ async confirmBookmarkFolder(folder) {
312
+ let selected = await this.#ready({ view: "navigation" });
313
+ if (!selected.headings?.includes(folder)) {
314
+ try {
315
+ await this.#browser.act({
316
+ operation: "waitForFolder",
317
+ folder,
318
+ selected: true,
319
+ });
320
+ }
321
+ catch (error) {
322
+ if (!/timed out|timeout/i.test(error.message))
323
+ throw error;
324
+ }
325
+ selected = await this.#ready({ view: "navigation" });
326
+ }
327
+ if (!selected.headings?.includes(folder) ||
328
+ !/\/i\/(?:history\/)?bookmarks\//.test(selected.page ?? "") ||
329
+ selected.needsStateCheck ||
330
+ selected.alerts?.length)
331
+ return {
332
+ status: "needsDecision",
333
+ complete: false,
334
+ missing: ["folder-selection-unconfirmed"],
335
+ folder,
336
+ page: selected.page,
337
+ };
338
+ return selected;
339
+ }
317
340
  bookmarkDiscovery(nav) {
318
341
  const folders = nav.bookmarkFolders ?? [];
319
342
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/x-harness",
3
- "version": "0.2.51",
3
+ "version": "0.2.52",
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": "4fcb5b63209a99a05a176cc9a7242c1f7de614ea"
45
+ "gitHead": "b3e3310d4977db067f05ee409f58ae619f042c9a"
46
46
  }