@booki-aui/readiness 0.2.1 → 0.2.3
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 +12 -0
- package/README.md +3 -1
- package/dist/{chunk-6SBJYJ2U.js → chunk-OLKBQ7N4.js} +7 -6
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @booki/readiness
|
|
2
2
|
|
|
3
|
+
## 0.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#132](https://github.com/Walgermo/booki/pull/132) [`e4d4d0d`](https://github.com/Walgermo/booki/commit/e4d4d0d19a303ad7b27588b8045712e59d94e907) Thanks [@Walgermo](https://github.com/Walgermo)! - The JSON report's `tool.version` is the installed version of `@booki-aui/readiness`; it always said 0.1.0.
|
|
8
|
+
|
|
9
|
+
## 0.2.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#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".
|
|
14
|
+
|
|
3
15
|
## 0.2.1
|
|
4
16
|
|
|
5
17
|
### 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`).
|
|
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.
|
|
@@ -236,6 +236,7 @@ function estimateTokens(text) {
|
|
|
236
236
|
|
|
237
237
|
// src/audit.ts
|
|
238
238
|
import { existsSync } from "fs";
|
|
239
|
+
import { createRequire } from "module";
|
|
239
240
|
import path from "path";
|
|
240
241
|
import { pathToFileURL } from "url";
|
|
241
242
|
import { chromium } from "playwright-core";
|
|
@@ -444,16 +445,16 @@ async function readBridge() {
|
|
|
444
445
|
try {
|
|
445
446
|
if (typeof g.agent?.snapshot === "function") {
|
|
446
447
|
const components = toList(await g.agent.snapshot());
|
|
447
|
-
return { source: "window.agent", components, tools, error: null };
|
|
448
|
+
return { source: "window.agent", components, tools, snapshotRead: true, error: null };
|
|
448
449
|
}
|
|
449
450
|
const snapshotTool = (g.__readinessTools ?? []).find((tool) => tool.name === "snapshot");
|
|
450
451
|
if (snapshotTool?.execute) {
|
|
451
452
|
const components = toList(await snapshotTool.execute({}));
|
|
452
|
-
return { source: "webmcp", components, tools, error: null };
|
|
453
|
+
return { source: "webmcp", components, tools, snapshotRead: true, error: null };
|
|
453
454
|
}
|
|
454
|
-
return { source: tools.length ? "webmcp" : null, components: [], tools, error: null };
|
|
455
|
+
return { source: tools.length ? "webmcp" : null, components: [], tools, snapshotRead: false, error: null };
|
|
455
456
|
} catch (error) {
|
|
456
|
-
return { source: null, components: [], tools, error: String(error) };
|
|
457
|
+
return { source: null, components: [], tools, snapshotRead: false, error: String(error) };
|
|
457
458
|
}
|
|
458
459
|
}
|
|
459
460
|
function bridgeCoverage(element2, entries) {
|
|
@@ -556,7 +557,7 @@ function onlyInSecrets(value) {
|
|
|
556
557
|
}
|
|
557
558
|
|
|
558
559
|
// src/audit.ts
|
|
559
|
-
var VERSION = "
|
|
560
|
+
var VERSION = createRequire(import.meta.url)("../package.json").version;
|
|
560
561
|
var FIELD_ROLES = /* @__PURE__ */ new Set([
|
|
561
562
|
"textbox",
|
|
562
563
|
"searchbox",
|
|
@@ -777,7 +778,7 @@ async function check(page, url = page.url()) {
|
|
|
777
778
|
}
|
|
778
779
|
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
780
|
const truncated = raw.components.some((c) => c.component === "more");
|
|
780
|
-
if (
|
|
781
|
+
if (raw.snapshotRead && !truncated) {
|
|
781
782
|
const norm = (text) => text.replace(/\s+/g, " ").trim().toLowerCase();
|
|
782
783
|
const labels = new Set(entries.map((e) => norm(e.label)).filter(Boolean));
|
|
783
784
|
const seenGroups = /* @__PURE__ */ new Set();
|
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -152,7 +152,8 @@ type AuditOptions = {
|
|
|
152
152
|
*/
|
|
153
153
|
timeout?: number;
|
|
154
154
|
};
|
|
155
|
-
|
|
155
|
+
/** The installed tool's own version, as the JSON report states it. */
|
|
156
|
+
declare const VERSION: string;
|
|
156
157
|
declare function looksLikeIconName(name: string, iconFont: boolean): boolean;
|
|
157
158
|
/** Buttons that post, pay, send, approve or otherwise cannot be taken back. */
|
|
158
159
|
declare const IRREVERSIBLE: RegExp;
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@booki-aui/readiness",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
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",
|