@booki-aui/readiness 0.2.1 → 0.2.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @booki/readiness
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#125](https://github.com/Walgermo/booki/pull/125) [`815a6ad`](https://github.com/Walgermo/booki/commit/815a6ad8b7506ca0d1b1b939f622c967c125564b) Thanks [@Walgermo](https://github.com/Walgermo)! - A page whose bridge (window.agent, or a WebMCP snapshot tool) has no controls but which has fields of its own (plain selects and text areas that are not on the bridge) no longer scores 100. Each such field is now reported as `field-not-on-bridge`, as it already was when the bridge had some controls. A page with an empty bridge and nothing else to judge is still "not measured".
8
+
3
9
  ## 0.2.1
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -246,7 +246,9 @@ The command line never clicks. A form that appears only after a row is
246
246
  selected or a button is pressed is not on the page it loads, so the bridge has
247
247
  no controls and the page has no fields or charts for the other checks to judge.
248
248
  A page without a bridge but with fields is still scored (and gets
249
- `bridge-missing`). When nothing is there to judge, the tool prints `no score` instead of a figure, the HTML report says the same,
249
+ `bridge-missing`). A bridge with no controls on a page that has fields of its
250
+ own is scored too: each field is reported as `field-not-on-bridge`, so it is
251
+ not a pass. When nothing is there to judge, the tool prints `no score` instead of a figure, the HTML report says the same,
250
252
  and the JSON report has `measured: false`, `grade: "not measured"` and a
251
253
  `notMeasured` text. `score` stays in the JSON so its shape does not change,
252
254
  but it is not a pass. With `--fail-under`, an unmeasured page exits with code 1.
@@ -444,16 +444,16 @@ async function readBridge() {
444
444
  try {
445
445
  if (typeof g.agent?.snapshot === "function") {
446
446
  const components = toList(await g.agent.snapshot());
447
- return { source: "window.agent", components, tools, error: null };
447
+ return { source: "window.agent", components, tools, snapshotRead: true, error: null };
448
448
  }
449
449
  const snapshotTool = (g.__readinessTools ?? []).find((tool) => tool.name === "snapshot");
450
450
  if (snapshotTool?.execute) {
451
451
  const components = toList(await snapshotTool.execute({}));
452
- return { source: "webmcp", components, tools, error: null };
452
+ return { source: "webmcp", components, tools, snapshotRead: true, error: null };
453
453
  }
454
- return { source: tools.length ? "webmcp" : null, components: [], tools, error: null };
454
+ return { source: tools.length ? "webmcp" : null, components: [], tools, snapshotRead: false, error: null };
455
455
  } catch (error) {
456
- return { source: null, components: [], tools, error: String(error) };
456
+ return { source: null, components: [], tools, snapshotRead: false, error: String(error) };
457
457
  }
458
458
  }
459
459
  function bridgeCoverage(element2, entries) {
@@ -777,7 +777,7 @@ async function check(page, url = page.url()) {
777
777
  }
778
778
  const entries = raw.components.filter((c) => !c.offPage && c.component !== "more").map((c) => ({ component: String(c.component ?? ""), label: typeof c.label === "string" ? c.label : "" }));
779
779
  const truncated = raw.components.some((c) => c.component === "more");
780
- if (hasBridge && entries.length && !truncated) {
780
+ if (raw.snapshotRead && !truncated) {
781
781
  const norm = (text) => text.replace(/\s+/g, " ").trim().toLowerCase();
782
782
  const labels = new Set(entries.map((e) => norm(e.label)).filter(Boolean));
783
783
  const seenGroups = /* @__PURE__ */ new Set();
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  toConsole,
5
5
  toHtml,
6
6
  toJson
7
- } from "./chunk-6SBJYJ2U.js";
7
+ } from "./chunk-2ZR5XHHK.js";
8
8
  import "./chunk-5SCOA3ZP.js";
9
9
 
10
10
  // src/cli.ts
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  toConsole,
14
14
  toHtml,
15
15
  toJson
16
- } from "./chunk-6SBJYJ2U.js";
16
+ } from "./chunk-2ZR5XHHK.js";
17
17
  import {
18
18
  PERSON_ACTION,
19
19
  findSecrets,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@booki-aui/readiness",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Agent readiness check for accounting screens: what stops an AI agent on a page, scored 0-100 against the Agent Contract, with fixes.",
5
5
  "type": "module",
6
6
  "license": "MIT",