@michaelmagan/dnumb 0.1.0
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/AGENTS.md +180 -0
- package/LICENSE +21 -0
- package/README.md +297 -0
- package/dist/analysis/cluster.cjs +114 -0
- package/dist/analysis/cluster.d.cts +68 -0
- package/dist/analysis/cluster.d.ts +68 -0
- package/dist/analysis/cluster.js +109 -0
- package/dist/analysis/distances.cjs +124 -0
- package/dist/analysis/distances.d.cts +58 -0
- package/dist/analysis/distances.d.ts +58 -0
- package/dist/analysis/distances.js +119 -0
- package/dist/analysis/geometry.cjs +60 -0
- package/dist/analysis/geometry.d.cts +34 -0
- package/dist/analysis/geometry.d.ts +34 -0
- package/dist/analysis/geometry.js +53 -0
- package/dist/analysis/layout-tree.cjs +245 -0
- package/dist/analysis/layout-tree.d.cts +45 -0
- package/dist/analysis/layout-tree.d.ts +45 -0
- package/dist/analysis/layout-tree.js +242 -0
- package/dist/analysis/region-query.cjs +71 -0
- package/dist/analysis/region-query.d.cts +25 -0
- package/dist/analysis/region-query.d.ts +25 -0
- package/dist/analysis/region-query.js +67 -0
- package/dist/analysis/types.cjs +7 -0
- package/dist/analysis/types.d.cts +143 -0
- package/dist/analysis/types.d.ts +143 -0
- package/dist/analysis/types.js +6 -0
- package/dist/bundle.cjs +182 -0
- package/dist/bundle.d.cts +91 -0
- package/dist/bundle.d.ts +91 -0
- package/dist/bundle.js +175 -0
- package/dist/cli.cjs +755 -0
- package/dist/cli.d.cts +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +719 -0
- package/dist/diff/changes.cjs +656 -0
- package/dist/diff/changes.d.cts +2 -0
- package/dist/diff/changes.d.ts +2 -0
- package/dist/diff/changes.js +653 -0
- package/dist/diff/identity.cjs +167 -0
- package/dist/diff/identity.d.cts +62 -0
- package/dist/diff/identity.d.ts +62 -0
- package/dist/diff/identity.js +159 -0
- package/dist/diff/index.cjs +84 -0
- package/dist/diff/index.d.cts +76 -0
- package/dist/diff/index.d.ts +76 -0
- package/dist/diff/index.js +68 -0
- package/dist/diff/match.cjs +156 -0
- package/dist/diff/match.d.cts +17 -0
- package/dist/diff/match.d.ts +17 -0
- package/dist/diff/match.js +152 -0
- package/dist/diff/render.cjs +540 -0
- package/dist/diff/render.d.cts +2 -0
- package/dist/diff/render.d.ts +2 -0
- package/dist/diff/render.js +537 -0
- package/dist/diff/types.cjs +2 -0
- package/dist/diff/types.d.cts +211 -0
- package/dist/diff/types.d.ts +211 -0
- package/dist/diff/types.js +1 -0
- package/dist/digest/index.cjs +8 -0
- package/dist/digest/index.d.cts +4 -0
- package/dist/digest/index.d.ts +4 -0
- package/dist/digest/index.js +2 -0
- package/dist/digest/parse.cjs +163 -0
- package/dist/digest/parse.d.cts +80 -0
- package/dist/digest/parse.d.ts +80 -0
- package/dist/digest/parse.js +160 -0
- package/dist/digest/render.cjs +1575 -0
- package/dist/digest/render.d.cts +41 -0
- package/dist/digest/render.d.ts +41 -0
- package/dist/digest/render.js +1571 -0
- package/dist/digest/types.cjs +10 -0
- package/dist/digest/types.d.cts +86 -0
- package/dist/digest/types.d.ts +86 -0
- package/dist/digest/types.js +9 -0
- package/dist/index.cjs +61 -0
- package/dist/index.d.cts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +19 -0
- package/dist/page.cjs +35 -0
- package/dist/page.d.cts +40 -0
- package/dist/page.d.ts +40 -0
- package/dist/page.js +31 -0
- package/dist/playwright.cjs +138 -0
- package/dist/playwright.d.cts +69 -0
- package/dist/playwright.d.ts +69 -0
- package/dist/playwright.js +131 -0
- package/dist/query.cjs +1152 -0
- package/dist/query.d.cts +47 -0
- package/dist/query.d.ts +47 -0
- package/dist/query.js +1146 -0
- package/dist/snapshot/capture.cjs +80 -0
- package/dist/snapshot/capture.d.cts +34 -0
- package/dist/snapshot/capture.d.ts +34 -0
- package/dist/snapshot/capture.js +77 -0
- package/dist/snapshot/cdp.cjs +450 -0
- package/dist/snapshot/cdp.d.cts +36 -0
- package/dist/snapshot/cdp.d.ts +36 -0
- package/dist/snapshot/cdp.js +447 -0
- package/dist/snapshot/clip.cjs +100 -0
- package/dist/snapshot/clip.d.cts +26 -0
- package/dist/snapshot/clip.d.ts +26 -0
- package/dist/snapshot/clip.js +96 -0
- package/dist/snapshot/collect.cjs +358 -0
- package/dist/snapshot/collect.d.cts +18 -0
- package/dist/snapshot/collect.d.ts +18 -0
- package/dist/snapshot/collect.js +355 -0
- package/dist/snapshot/color.cjs +1039 -0
- package/dist/snapshot/color.d.cts +316 -0
- package/dist/snapshot/color.d.ts +316 -0
- package/dist/snapshot/color.js +1026 -0
- package/dist/snapshot/facts.cjs +167 -0
- package/dist/snapshot/facts.d.cts +48 -0
- package/dist/snapshot/facts.d.ts +48 -0
- package/dist/snapshot/facts.js +161 -0
- package/dist/snapshot/limits.cjs +69 -0
- package/dist/snapshot/limits.d.cts +59 -0
- package/dist/snapshot/limits.d.ts +59 -0
- package/dist/snapshot/limits.js +65 -0
- package/dist/snapshot/not-measured.cjs +44 -0
- package/dist/snapshot/not-measured.d.cts +14 -0
- package/dist/snapshot/not-measured.d.ts +14 -0
- package/dist/snapshot/not-measured.js +41 -0
- package/dist/snapshot/types.cjs +2 -0
- package/dist/snapshot/types.d.cts +238 -0
- package/dist/snapshot/types.d.ts +238 -0
- package/dist/snapshot/types.js +1 -0
- package/dist/spec/index.cjs +9 -0
- package/dist/spec/index.d.cts +15 -0
- package/dist/spec/index.d.ts +15 -0
- package/dist/spec/index.js +6 -0
- package/package.json +141 -0
- package/skills/dnumb/SKILL.md +136 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a capture as the text an agent reads instead of raw JSON.
|
|
3
|
+
*
|
|
4
|
+
* The line grammar is carried over from the prototype unchanged. It survived
|
|
5
|
+
* two cold reads there and a third here, and it is the one part of this project
|
|
6
|
+
* that five registry searches found no substitute for, so it is deliberately
|
|
7
|
+
* not being redesigned:
|
|
8
|
+
*
|
|
9
|
+
* ```
|
|
10
|
+
* # dnumb digest v2 — <url> — <viewport> — <state>
|
|
11
|
+
* # grammar: id tag[.role|#testid] ["text"] @x,y WxH [flow] [↓gap|→gap to prev sibling] [facts]; px, integers; y>viewport.height is below the fold
|
|
12
|
+
* e13 span "Task Board 1" @71,164 263x18 →10
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Two things are new in v2.
|
|
16
|
+
*
|
|
17
|
+
* **Facts are joined by element id, not by selector.** The prototype matched
|
|
18
|
+
* check findings to digest lines through a CSS selector string, which is how it
|
|
19
|
+
* shipped the Step 16 misattribution bug: two elements resolving to the same
|
|
20
|
+
* selector meant a fact landing on the wrong line. Facts here are computed from
|
|
21
|
+
* the same records the lines are, and carried on the record.
|
|
22
|
+
*
|
|
23
|
+
* **The header names the state.** Without it two captures of one URL are
|
|
24
|
+
* indistinguishable in their own headers, and the whole point of the format is
|
|
25
|
+
* to describe more than one moment of a page.
|
|
26
|
+
*/
|
|
27
|
+
import type { Snapshot } from "../snapshot/types.cjs";
|
|
28
|
+
import type { DigestMeta, RenderDigestOptions } from "./types.cjs";
|
|
29
|
+
/**
|
|
30
|
+
* The refusal surface's second line always opens with this exact prefix --
|
|
31
|
+
* the single signal a caller needs to detect `sparseCapture` from rendered
|
|
32
|
+
* text alone, without re-deriving `renderDigest`'s own gate expression a
|
|
33
|
+
* second time somewhere else (the CLI's `--json` envelope, in particular --
|
|
34
|
+
* see `src/cli.ts`). `docs/notes/07-refusal.md` §4: "Keep the single source;
|
|
35
|
+
* do not re-derive it." A rendered digest is the one place that decision is
|
|
36
|
+
* already made; this constant is how a caller reads it back off the text
|
|
37
|
+
* instead of recomputing `elements >= 20 && dropped/total >= 0.9 &&
|
|
38
|
+
* page.height <= 2` against a bundle it may not even have the same shape of.
|
|
39
|
+
*/
|
|
40
|
+
export declare const SPARSE_CAPTURE_MARKER = "# no layout to digest:";
|
|
41
|
+
export declare function renderDigest(snapshot: Snapshot, meta: DigestMeta, options?: RenderDigestOptions): string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a capture as the text an agent reads instead of raw JSON.
|
|
3
|
+
*
|
|
4
|
+
* The line grammar is carried over from the prototype unchanged. It survived
|
|
5
|
+
* two cold reads there and a third here, and it is the one part of this project
|
|
6
|
+
* that five registry searches found no substitute for, so it is deliberately
|
|
7
|
+
* not being redesigned:
|
|
8
|
+
*
|
|
9
|
+
* ```
|
|
10
|
+
* # dnumb digest v2 — <url> — <viewport> — <state>
|
|
11
|
+
* # grammar: id tag[.role|#testid] ["text"] @x,y WxH [flow] [↓gap|→gap to prev sibling] [facts]; px, integers; y>viewport.height is below the fold
|
|
12
|
+
* e13 span "Task Board 1" @71,164 263x18 →10
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Two things are new in v2.
|
|
16
|
+
*
|
|
17
|
+
* **Facts are joined by element id, not by selector.** The prototype matched
|
|
18
|
+
* check findings to digest lines through a CSS selector string, which is how it
|
|
19
|
+
* shipped the Step 16 misattribution bug: two elements resolving to the same
|
|
20
|
+
* selector meant a fact landing on the wrong line. Facts here are computed from
|
|
21
|
+
* the same records the lines are, and carried on the record.
|
|
22
|
+
*
|
|
23
|
+
* **The header names the state.** Without it two captures of one URL are
|
|
24
|
+
* indistinguishable in their own headers, and the whole point of the format is
|
|
25
|
+
* to describe more than one moment of a page.
|
|
26
|
+
*/
|
|
27
|
+
import type { Snapshot } from "../snapshot/types.js";
|
|
28
|
+
import type { DigestMeta, RenderDigestOptions } from "./types.js";
|
|
29
|
+
/**
|
|
30
|
+
* The refusal surface's second line always opens with this exact prefix --
|
|
31
|
+
* the single signal a caller needs to detect `sparseCapture` from rendered
|
|
32
|
+
* text alone, without re-deriving `renderDigest`'s own gate expression a
|
|
33
|
+
* second time somewhere else (the CLI's `--json` envelope, in particular --
|
|
34
|
+
* see `src/cli.ts`). `docs/notes/07-refusal.md` §4: "Keep the single source;
|
|
35
|
+
* do not re-derive it." A rendered digest is the one place that decision is
|
|
36
|
+
* already made; this constant is how a caller reads it back off the text
|
|
37
|
+
* instead of recomputing `elements >= 20 && dropped/total >= 0.9 &&
|
|
38
|
+
* page.height <= 2` against a bundle it may not even have the same shape of.
|
|
39
|
+
*/
|
|
40
|
+
export declare const SPARSE_CAPTURE_MARKER = "# no layout to digest:";
|
|
41
|
+
export declare function renderDigest(snapshot: Snapshot, meta: DigestMeta, options?: RenderDigestOptions): string;
|