{"_id":"@bun-win32/wuapi","_rev":"3-c0c8234f4c85fcdbc9789b17579e770c","name":"@bun-win32/wuapi","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/wuapi","version":"1.0.0","keywords":["bun","ffi","win32","windows","wuapi","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/wuapi@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":"adddfeebd3cd40cf0b449eecde58578cae0a7077","tarball":"https://registry.npmjs.org/@bun-win32/wuapi/-/wuapi-1.0.0.tgz","fileCount":6,"integrity":"sha512-ZJzBFW9TfU9c12wnPJJEEJvSJ7rMSrWNduuvjItOTLwM87BYRY7eP5e4g/DtW9wuEOSFtmBdTDdyCEFgWjLAug==","signatures":[{"sig":"MEQCICV9g70InxsxrTBZ2PpRJW6HpyL+/sMM4Vfp9/mbYprsAiBv7nbJLYZzU7i9qihl49oZScFFJUAgypNtgaSoER5v0w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12118},"main":"./index.ts","type":"module","module":"index.ts","shasum":"adddfeebd3cd40cf0b449eecde58578cae0a7077","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:patch-constellation":"bun ./example/patch-constellation.ts","example:update-history-forensics":"bun ./example/update-history-forensics.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-ZJzBFW9TfU9c12wnPJJEEJvSJ7rMSrWNduuvjItOTLwM87BYRY7eP5e4g/DtW9wuEOSFtmBdTDdyCEFgWjLAug==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/wuapi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 WUAPI (Windows Update Agent) 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/wuapi_1.0.0_1779222166085_0.9526798331225157","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/wuapi","version":"2.0.0","keywords":["bun","ffi","win32","windows","wuapi","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/wuapi@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":"1cbcb3d8c04298391659a70292613a8591703952","tarball":"https://registry.npmjs.org/@bun-win32/wuapi/-/wuapi-2.0.0.tgz","fileCount":6,"integrity":"sha512-njgXSC0jDRyluqY2Z0gAvwoVfYAE4AFxwdLiSMfuazZDQ+VP8WgX7k2a6ti4N16G04RMGgdGZ4BDPV+dj8oIkg==","signatures":[{"sig":"MEUCIQDjIM0iiU3sEv2EdjCjHZL3s/2QFPxvRDeaYv9/ZEAfNwIgWXZzE9A5O0S3Q4Nqc2dOlOLWqD3QxA6uOo5vtV6XwPE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13371},"main":"./index.ts","type":"module","module":"index.ts","shasum":"1cbcb3d8c04298391659a70292613a8591703952","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:patch-constellation":"bun ./example/patch-constellation.ts","example:update-history-forensics":"bun ./example/update-history-forensics.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-njgXSC0jDRyluqY2Z0gAvwoVfYAE4AFxwdLiSMfuazZDQ+VP8WgX7k2a6ti4N16G04RMGgdGZ4BDPV+dj8oIkg==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/wuapi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 WUAPI (Windows Update Agent) 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/wuapi_2.0.0_1782436009534_0.8195276433166199","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 WUAPI (Windows Update Agent) bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/wuapi","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/wuapi"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","wuapi","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:patch-constellation":"bun ./example/patch-constellation.ts","example:update-history-forensics":"bun ./example/update-history-forensics.ts"},"_id":"@bun-win32/wuapi@2.0.1","_integrity":"sha512-hGwkZsssLY1toDU8lSi3r3MV2x/3Zrc1HPMIIPorMd5ht24frYJ1ggj8bDTYpNkgn0+MQsxx0WJymiRfRs1DkQ==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"0ce04478e9eabab7fe4599c44ce9fe77a2f4320c","dist":{"integrity":"sha512-hGwkZsssLY1toDU8lSi3r3MV2x/3Zrc1HPMIIPorMd5ht24frYJ1ggj8bDTYpNkgn0+MQsxx0WJymiRfRs1DkQ==","shasum":"0ce04478e9eabab7fe4599c44ce9fe77a2f4320c","tarball":"https://registry.npmjs.org/@bun-win32/wuapi/-/wuapi-2.0.1.tgz","fileCount":6,"unpackedSize":13371,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIE0YvTknTUdbKWweG/uMCAVjXY7v54B3xD1xRhNdsg/YAiEAhAPhVPmZsUB1oty0fBToByFcdQHKI97X2iiSvWC7cdg="}]},"_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/wuapi_2.0.1_1782438234616_0.10359482205488968"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T20:22:45.934Z","modified":"2026-06-26T01:43:54.853Z","1.0.0":"2026-05-19T20:22:46.227Z","2.0.0":"2026-06-26T01:06:49.672Z","2.0.1":"2026-06-26T01:43:54.735Z"},"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","wuapi","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/wuapi"},"description":"Zero-dependency, zero-overhead Win32 WUAPI (Windows Update Agent) bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/wuapi\n\nZero-dependency, zero-overhead Win32 Wuapi bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/wuapi` exposes the `wuapi.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Wuapi`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\n`wuapi.dll` is the **Windows Update Agent COM server**. Its only flat exports are the four standard in-process COM server entry points (`DllCanUnloadNow`, `DllGetClassObject`, `DllRegisterServer`, `DllUnregisterServer`). The Windows Update object model — `IUpdateSession`, `IUpdateSearcher`, `ISearchResult`, `IUpdateHistoryEntryCollection`, ... — is reached via `CoCreateInstance(CLSID_UpdateSession)` (ProgID `Microsoft.Update.Session`) and driven over the COM vtable. This package binds the flat exports and re-exports every relevant CLSID, IID, and result/operation enum from `types/Wuapi.ts` so consumers can drive the object model over FFI (see the examples).\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 `wuapi.dll` (Windows Update Agent COM server).\n- In-source docs in `structs/Wuapi.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Wuapi.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Wuapi.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/wuapi\n```\n\n## Quick Start\n\n```ts\nimport Wuapi, { CLSID_UpdateSession, IID_IUpdateSession } from '@bun-win32/wuapi';\n\n// Flat export: ask the in-process server whether it can unload.\nconst hr = Wuapi.DllCanUnloadNow(); // 0 = S_OK, 1 = S_FALSE\n\n// The Windows Update object model is reached via COM (CoCreateInstance of\n// CLSID_UpdateSession), then driven over the interface vtable. The exported\n// CLSID_*/IID_* GUID strings and the OperationResultCode / UpdateOperation /\n// ServerSelection enums are all you need to walk it — see the examples for a\n// complete, cast-free vtable invoker.\nconsole.log(CLSID_UpdateSession, IID_IUpdateSession);\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:update-history-forensics   # exhaustive read-only servicing-history audit\nbun run example:patch-constellation        # live animated star map of update history\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Wuapi.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"}