{"_id":"@ariada-org/core-browser","_rev":"2-090961d549d4470315a7fc37ba20d019","name":"@ariada-org/core-browser","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@ariada-org/core-browser","version":"0.1.0","license":"EUPL-1.2","_id":"@ariada-org/core-browser@0.1.0","maintainers":[{"name":"agonist","email":"ab@agonist.ai"}],"homepage":"https://github.com/ariada-org/ariada#readme","bugs":{"url":"https://github.com/ariada-org/ariada/issues"},"dist":{"shasum":"087c9e2d63e915210361e20bdd3943a288da6a73","tarball":"https://registry.npmjs.org/@ariada-org/core-browser/-/core-browser-0.1.0.tgz","fileCount":26,"integrity":"sha512-woyFtwTCOzWEl202VZtgQI5uhZFnGvYGs5or/ybqdtdpUyQDVxRezkkU/2h+JCV/Qe9yn5ijF79i9skNN3uncQ==","signatures":[{"sig":"MEUCIQC6IR2XFGg+2aaY+Ukwg0VVFoa1THpcv/HwR2V63y4aHAIgCHgqfOHG6TkqXPuvAkS3sozKMdXH4cIi32v3l7780N0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ariada-org%2fcore-browser@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":93656},"main":"./dist/index.js","type":"module","_from":"file:ariada-org-core-browser-0.1.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"lint":"eslint src tests","test":"vitest run","build":"tsc -p tsconfig.json","clean":"rimraf dist coverage bundle.min.js bundle.meta.json test-results playwright-report","test:e2e":"playwright test","typecheck":"tsc -p tsconfig.typecheck.json","test:watch":"vitest","bundle:size":"esbuild src/index.ts --bundle --minify --format=esm --target=es2022 --external:@ariada-org/core-engine --metafile=bundle.meta.json --outfile=bundle.min.js","test:e2e:ui":"playwright test --ui"},"_npmUser":{"name":"agonist","email":"ab@agonist.ai"},"_resolved":"/tmp/1785e8800482968c2758e906d6ea554e/ariada-org-core-browser-0.1.0.tgz","_integrity":"sha512-woyFtwTCOzWEl202VZtgQI5uhZFnGvYGs5or/ybqdtdpUyQDVxRezkkU/2h+JCV/Qe9yn5ijF79i9skNN3uncQ==","repository":{"url":"git+https://github.com/ariada-org/ariada.git","type":"git","directory":"packages/core-browser"},"_npmVersion":"10.9.8","description":"In-browser DOM adapter for @ariada-org/core-engine — used by the ariada Chrome extension to scan the live document without Node or Playwright.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"@ariada-org/core-engine":"0.1.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.1","vitest":"^4.1.0","esbuild":"^0.28.0","happy-dom":"20.10.2","playwright":"^1.60.0","typescript":"^5.7.2","@types/node":"^22.10.2","@playwright/test":"^1.60.0","@ariada-org/test-fixtures":"0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/core-browser_0.1.0_1781537794463_0.9563741473233978","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@ariada-org/core-browser","version":"0.1.1","description":"In-browser DOM adapter for @ariada-org/core-engine — used by the ariada Chrome extension to scan the live document without Node or Playwright.","license":"EUPL-1.2","publishConfig":{"access":"public"},"type":"module","sideEffects":false,"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"dependencies":{"@ariada-org/core-engine":"0.2.0"},"devDependencies":{"@playwright/test":"^1.60.0","@types/node":"^22.10.2","esbuild":"^0.28.0","happy-dom":"^20.9.0","playwright":"^1.60.0","rimraf":"^6.0.1","typescript":"^5.7.2","vitest":"^4.1.0","@ariada-org/test-fixtures":"0.2.0"},"engines":{"node":">=22"},"repository":{"type":"git","url":"git+https://github.com/ariada-org/ariada.git","directory":"packages/core-browser"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.typecheck.json","lint":"eslint src tests","test":"vitest run","test:watch":"vitest","test:e2e":"playwright test","test:e2e:ui":"playwright test --ui","bundle:size":"esbuild src/index.ts --bundle --minify --format=esm --target=es2022 --external:@ariada-org/core-engine --metafile=bundle.meta.json --outfile=bundle.min.js","clean":"rimraf dist coverage bundle.min.js bundle.meta.json test-results playwright-report"},"_id":"@ariada-org/core-browser@0.1.1","bugs":{"url":"https://github.com/ariada-org/ariada/issues"},"homepage":"https://github.com/ariada-org/ariada#readme","_integrity":"sha512-TrPXlIscditxqcsLLawBWrkrzmRpnEMVITofElTL9tiL5JCT/r+QhYqkKtSwFrlEYJb+bts2o9ZrIm05QjlsQQ==","_resolved":"/private/var/folders/2c/_42xj0l179z8yc7wmp5k91s00000gn/T/7d176a2ca52ede04ae5dbc7d767dcadd/ariada-org-core-browser-0.1.1.tgz","_from":"file:ariada-org-core-browser-0.1.1.tgz","_nodeVersion":"26.5.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-TrPXlIscditxqcsLLawBWrkrzmRpnEMVITofElTL9tiL5JCT/r+QhYqkKtSwFrlEYJb+bts2o9ZrIm05QjlsQQ==","shasum":"d1cc9dcc9ee83808d5b9629dda4b9e1f77bc61cd","tarball":"https://registry.npmjs.org/@ariada-org/core-browser/-/core-browser-0.1.1.tgz","fileCount":26,"unpackedSize":93752,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFFfuGKM6XbbiQjpVEukLRr7AWr4MPptRzarNJjXBc+OAiEA1yzYnFFblkLn8zBncHuFJX1W53QQHgjaLosUCRFiGiI="}]},"_npmUser":{"name":"agonist","email":"ab@agonist.ai"},"directories":{},"maintainers":[{"name":"agonist","email":"ab@agonist.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core-browser_0.1.1_1784942574405_0.417243501208691"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-15T15:36:34.249Z","modified":"2026-07-25T01:22:54.751Z","0.1.0":"2026-06-15T15:36:34.628Z","0.1.1":"2026-07-25T01:22:54.557Z"},"bugs":{"url":"https://github.com/ariada-org/ariada/issues"},"license":"EUPL-1.2","homepage":"https://github.com/ariada-org/ariada#readme","repository":{"type":"git","url":"git+https://github.com/ariada-org/ariada.git","directory":"packages/core-browser"},"description":"In-browser DOM adapter for @ariada-org/core-engine — used by the ariada Chrome extension to scan the live document without Node or Playwright.","maintainers":[{"name":"agonist","email":"ab@agonist.ai"}],"readme":"# @ariada-org/core-browser\n\nIn-browser DOM adapter for [`@ariada-org/core-engine`](../core-engine). Powers the\nariada Chrome extension and any other browser-context consumer that needs to\nrun a scan without Node, Playwright, or pino in the bundle.\n\n| Field          | Value                                                            |\n| -------------- | ---------------------------------------------------------------- |\n| Package name   | `@ariada-org/core-browser`                                           |\n| Version        | 0.1.0                                                            |\n| Licence        | EUPL-1.2 (European Union Public Licence)                         |\n| Runtime        | Browser only (ES2022, no Node API surface)                       |\n| Dependencies   | `@ariada-org/core-engine` (workspace)                                |\n| Bundle size    | ≤ 50 KB minified (esbuild target, verified via `bundle:size`)    |\n| REUSE-compliant | yes — `REUSE.toml` + per-file SPDX headers                      |\n\n## Public API (v0.1)\n\n```ts\nimport {\n  captureBrowserSnapshot,\n  scanCurrentDocument,\n  createDomBoundingBoxResolver,\n} from '@ariada-org/core-browser';\n```\n\n- `captureBrowserSnapshot(opts)` — read a `UnifiedSnapshot` from a live\n  `Document`. Optionally pulls the full AX tree via a `chrome.debugger`\n  shim (extension context only).\n- `scanCurrentDocument(opts?)` — run the engine orchestration end-to-end\n  against the current document. Drop-in equivalent of\n  [`@ariada-org/core-playwright`](../core-playwright)'s `scan()` but for\n  browser context. Returns a `Promise<UnifiedReport>`.\n- `createDomBoundingBoxResolver(document)` — element-iter resolver that wraps\n  `Element.getBoundingClientRect`.\n\n## Usage — Chrome extension content script\n\n```ts\n// content-script.ts\nimport { scanCurrentDocument } from '@ariada-org/core-browser';\n\nchrome.runtime.onMessage.addListener(async (msg, _sender, send) => {\n  if (msg.type !== 'ARIADA_SCAN_REQUEST') return;\n  // `scanCurrentDocument` returns a `ScanResult` (engine type) — pull\n  // `.report` for the `UnifiedReport`. Pass `analyzers` (engine\n  // `DomainAnalyzer[]`); the package adds no domain-name shorthand on top.\n  const result = await scanCurrentDocument({ document, analyzers: [] });\n  send({ type: 'ARIADA_SCAN_RESULT', report: result.report });\n  return true; // async\n});\n```\n\n## Usage — generic in-browser embed\n\n```ts\nimport {\n  captureBrowserSnapshot,\n  scanCurrentDocument,\n} from '@ariada-org/core-browser';\n\n// Snapshot-only capture (no engine orchestration). `scanId` is required.\nconst snapshot = await captureBrowserSnapshot({ document, scanId: 'my-scan' });\n\n// Or full scan end-to-end. Returns a `ScanResult`; `.report` is the\n// `UnifiedReport`. Pass engine `DomainAnalyzer[]` as `analyzers` (this\n// package adds no domain-name shorthand on top of the engine API).\nconst { report } = await scanCurrentDocument({ document, analyzers: [] });\n```\n\n## Bundle-size discipline\n\nThe package ships **only** ES2022 modules; the public bundle target is\n≤ 50 KB minified, verified via `pnpm --filter @ariada-org/core-browser bundle:size`\nand recorded in the engine-split `BUILD_REPORT`. The size budget is enforced\nbecause the Chrome extension content-script must stay under the MV3 (Manifest\nV3) inline-script size limit for fast injection. Avoid pulling Node-only\nmodules — there is no polyfill layer.\n\n## Testing\n\nUnit tests run with vitest + happy-dom:\n\n```bash\npnpm --filter @ariada-org/core-browser test\n```\n\n## Layout\n\n```\nsrc/\n  index.ts            — public exports\n  browser-runner.ts   — scanCurrentDocument()\n  dom-snapshot.ts     — captureBrowserSnapshot()\n  bbox-resolver.ts    — createDomBoundingBoxResolver()\ntests/\n  *.test.ts           — vitest + happy-dom\n```\n\n## Licence\n\nEUPL-1.2 — see `LICENSE`. Per-file SPDX headers + `REUSE.toml` keep\nmachine-readable metadata in sync. Trademarks not granted; see `TRADEMARK.md`.\n\n## Security\n\nVulnerability reports → `https://github.com/ariada-org/ariada/security/advisories/new`\nor `security@ariada.org`. See `SECURITY.md`.\n","readmeFilename":"README.md"}