{"_id":"@bun-win32/oleacc","_rev":"4-6a098ce473ec0f2608d07df5dede3ed8","name":"@bun-win32/oleacc","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/oleacc","version":"1.0.0","keywords":["bun","ffi","win32","windows","oleacc","msaa","accessibility","iaccessible","ui-automation","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/oleacc@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"053a45c0af5c2b51ba73170902335f35709b1902","tarball":"https://registry.npmjs.org/@bun-win32/oleacc/-/oleacc-1.0.0.tgz","fileCount":6,"integrity":"sha512-7FbHInBfq7qg82jfe8BjBnFkJ1lgXpPSJMXaat+S3GmslINNCNU/wHzQbOizzi3pJ+YLq2WlvtznFEwENDqM9w==","signatures":[{"sig":"MEYCIQCNHOGxNYZKmYQ817X9fmZTlgEXopbyTzYxN5/GxMP2rwIhANlJQtlGZNfdTAdwDar+mf1leL3oGbDXLrBHdsipDH2q","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22238},"main":"./index.ts","type":"module","module":"index.ts","shasum":"053a45c0af5c2b51ba73170902335f35709b1902","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:ui-tree-inspector":"bun ./example/ui-tree-inspector.ts","example:accessibility-radar":"bun ./example/accessibility-radar.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-7FbHInBfq7qg82jfe8BjBnFkJ1lgXpPSJMXaat+S3GmslINNCNU/wHzQbOizzi3pJ+YLq2WlvtznFEwENDqM9w==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/oleacc"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 OLEACC (Microsoft Active Accessibility) bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/oleacc_1.0.0_1779150543227_0.311965673763543","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/oleacc","version":"1.0.1","keywords":["bun","ffi","win32","windows","oleacc","msaa","accessibility","iaccessible","ui-automation","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/oleacc@1.0.1","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"1b8560d54d648f5fd8a01582b309eb912b58ded2","tarball":"https://registry.npmjs.org/@bun-win32/oleacc/-/oleacc-1.0.1.tgz","fileCount":6,"integrity":"sha512-jdzftJmqV+qVcfKVswUdCui2ZmSvr9/gfvKDBZ/RxyH92YGHAkTaO5Pd1FcGcdS7OYrs1ELQo68ZR9M+Wt156A==","signatures":[{"sig":"MEQCIAj4ANN6iGTeudmug0HL7/wF8Rticqz0DSsj+EJVtwPdAiB6vcNNd0F/r5wZL39CfLBIlCWVVjf8wsXZq+JVqj9RMw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22243},"main":"./index.ts","type":"module","module":"index.ts","shasum":"1b8560d54d648f5fd8a01582b309eb912b58ded2","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:ui-tree-inspector":"bun ./example/ui-tree-inspector.ts","example:accessibility-radar":"bun ./example/accessibility-radar.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-jdzftJmqV+qVcfKVswUdCui2ZmSvr9/gfvKDBZ/RxyH92YGHAkTaO5Pd1FcGcdS7OYrs1ELQo68ZR9M+Wt156A==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/oleacc"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 OLEACC (Microsoft Active Accessibility) bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/oleacc_1.0.1_1781375538326_0.5030138544837393","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/oleacc","version":"2.0.0","keywords":["bun","ffi","win32","windows","oleacc","msaa","accessibility","iaccessible","ui-automation","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/oleacc@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"669a34f0e34f45f10d3fb99bb8868a83610323ea","tarball":"https://registry.npmjs.org/@bun-win32/oleacc/-/oleacc-2.0.0.tgz","fileCount":6,"integrity":"sha512-9ABMVAyI1l6TKABRjUd6QEb1X2TZx4CyVTJO/Bzu6+Rvnr7Yjvvzo/aeGmDtsqNQ65CaawJMZ3iWyxHqAYOFRA==","signatures":[{"sig":"MEUCIDPWc6mYCg8VK+V1iHlVgeVfF35Z0Nz/iJWlfFMpWLOBAiEAp0VkyV3cEwnERUPufE7lrSDW/BtNSdteOkGnpDEk3/8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23664},"main":"./index.ts","type":"module","module":"index.ts","shasum":"669a34f0e34f45f10d3fb99bb8868a83610323ea","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:ui-tree-inspector":"bun ./example/ui-tree-inspector.ts","example:accessibility-radar":"bun ./example/accessibility-radar.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-9ABMVAyI1l6TKABRjUd6QEb1X2TZx4CyVTJO/Bzu6+Rvnr7Yjvvzo/aeGmDtsqNQ65CaawJMZ3iWyxHqAYOFRA==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/oleacc"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 OLEACC (Microsoft Active Accessibility) bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/oleacc_2.0.0_1782435485642_0.9589148065390878","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 OLEACC (Microsoft Active Accessibility) bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/oleacc","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/oleacc"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","oleacc","msaa","accessibility","iaccessible","ui-automation","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:accessibility-radar":"bun ./example/accessibility-radar.ts","example:ui-tree-inspector":"bun ./example/ui-tree-inspector.ts"},"_id":"@bun-win32/oleacc@2.0.1","_integrity":"sha512-Uj/99JShbKwR65D+yp5SYA31F9k1u9sAvcM+7gtTS6IYRvTVrI98GKdw5YT4hyrwEGz8rFsdelewrgBCogwR2A==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"578f7fc6537175dfbdc36b4c04764fe1ceb671e8","dist":{"integrity":"sha512-Uj/99JShbKwR65D+yp5SYA31F9k1u9sAvcM+7gtTS6IYRvTVrI98GKdw5YT4hyrwEGz8rFsdelewrgBCogwR2A==","shasum":"578f7fc6537175dfbdc36b4c04764fe1ceb671e8","tarball":"https://registry.npmjs.org/@bun-win32/oleacc/-/oleacc-2.0.1.tgz","fileCount":6,"unpackedSize":23664,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDB7YVO5qgciz6AxaYdcOi7AV09nTExtmV6SKlkLaPrXwIgAu14GrIvFFoIhqahI7p4PEV6a2pmDsqR76PgmQietYg="}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/oleacc_2.0.1_1782438145605_0.9757459219717828"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T00:29:03.168Z","modified":"2026-06-26T01:42:25.904Z","1.0.0":"2026-05-19T00:29:03.387Z","1.0.1":"2026-06-13T18:32:18.464Z","2.0.0":"2026-06-26T00:58:05.785Z","2.0.1":"2026-06-26T01:42:25.747Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","oleacc","msaa","accessibility","iaccessible","ui-automation","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/oleacc"},"description":"Zero-dependency, zero-overhead Win32 OLEACC (Microsoft Active Accessibility) bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/oleacc\n\nZero-dependency, zero-overhead Win32 Oleacc bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/oleacc` exposes the `oleacc.dll` exports — Microsoft Active Accessibility (MSAA) — using [Bun](https://bun.sh)'s FFI. It provides a single class, `Oleacc`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\nMSAA complements UI Automation: `AccessibleObjectFromWindow` / `AccessibleObjectFromPoint` resolve an `IAccessible` for legacy and modern apps alike — the foundation for UI scraping, RPA, QA automation, and assistive tooling.\n\nThe bindings are strongly typed for a smooth DX in TypeScript.\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `oleacc.dll` (IAccessible from a window/point, role & state text decoding, object↔LRESULT marshaling).\n- In-source docs in `structs/Oleacc.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Oleacc.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases plus `ROLE_SYSTEM`, `STATE_SYSTEM`, `OBJID` enums and the `IID_IAccessible` GUID (see `types/Oleacc.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n\n## Installation\n\n```sh\nbun add @bun-win32/oleacc\n```\n\n## Quick Start\n\n```ts\nimport Oleacc, { IID_IAccessible, OBJID, ROLE_SYSTEM } from '@bun-win32/oleacc';\nimport User32 from '@bun-win32/user32';\n\n// Build the IID_IAccessible GUID bytes the API expects.\nfunction guidBytes(value: string): Buffer {\n  const m = /^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(value)!;\n  const [, d1, d2, d3, d4h, d4l] = m;\n  const b = Buffer.alloc(16);\n  b.writeUInt32LE(parseInt(d1, 16), 0);\n  b.writeUInt16LE(parseInt(d2, 16), 4);\n  b.writeUInt16LE(parseInt(d3, 16), 6);\n  const tail = `${d4h}${d4l}`;\n  for (let i = 0; i < 8; i += 1) b[8 + i] = parseInt(tail.slice(i * 2, i * 2 + 2), 16);\n  return b;\n}\n\nconst iid = guidBytes(IID_IAccessible);\nconst ppAcc = Buffer.alloc(8);\n\n// Resolve the IAccessible for the foreground window.\nconst hr = Oleacc.AccessibleObjectFromWindow(User32.GetForegroundWindow(), OBJID.OBJID_WINDOW >>> 0, iid.ptr!, ppAcc.ptr!);\nconst pAcc = ppAcc.readBigUInt64LE(0); // an IAccessible* token — call its vtable\n\n// Decode any ROLE_SYSTEM_* / STATE_SYSTEM_* value to text.\nconst roleName = Buffer.alloc(128);\nconst n = Oleacc.GetRoleTextW(ROLE_SYSTEM.ROLE_SYSTEM_PUSHBUTTON, roleName.ptr!, 64);\nconsole.log(roleName.toString('utf16le', 0, n * 2)); // \"push button\"\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples:\n\n```sh\nbun run example:accessibility-radar\nbun run example:ui-tree-inspector\n```\n\n- **accessibility-radar** — a live ANSI dashboard that follows your mouse, resolving the `IAccessible` under the pointer with `AccessibleObjectFromPoint` and rendering a scaled screen radar with the focused element's bounding box.\n- **ui-tree-inspector** — a thorough diagnostic that resolves the foreground window's root `IAccessible` and recursively walks the whole accessibility tree (name / role / state / rectangle) with a role histogram summary.\n\n## Notes\n\n- COM interface pointers (`IAccessible*`, `IUnknown*`) are opaque `bigint` tokens. Read the address back from the out-buffer and invoke its vtable directly.\n- `IAccessible` extends `IDispatch`; its property accessors take a `VARIANT varChild` by value — on x64 that 24-byte struct is passed as a pointer to a caller-allocated copy.\n- Either rely on lazy binding or call `Oleacc.Preload()`.\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}