{"_id":"@bun-win32/cldapi","_rev":"4-2fb6f04e61192e00817b54e924b2f062","name":"@bun-win32/cldapi","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/cldapi","version":"1.0.0","keywords":["bun","ffi","win32","windows","cldapi","cfapi","cloud-files","cloud-filter","placeholder","sync-root","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/cldapi@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":"26e93291ca1f67aa9ef1156422b38a6472a54273","tarball":"https://registry.npmjs.org/@bun-win32/cldapi/-/cldapi-1.0.0.tgz","fileCount":6,"integrity":"sha512-cx71i2qyFTgVRmCEdO+dyLdRyirmetSRnLMD00DOEZR7sLnsyGCGkRzyhq+eYQxBTpt5A3I0uHa81KpHJ/BbIQ==","signatures":[{"sig":"MEUCIA91z1X3oszo5+QtaY3Pb7WYEQaqD9EeicIsZNTp9HM4AiEA+Rp36hpkLvXGi4FuCMEohMmcMsbrVR/+zUoBZbraAfQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37737},"main":"./index.ts","type":"module","module":"index.ts","shasum":"26e93291ca1f67aa9ef1156422b38a6472a54273","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:cloud-mirage":"bun ./example/cloud-mirage.ts","example:placeholder-diagnostic":"bun ./example/placeholder-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-cx71i2qyFTgVRmCEdO+dyLdRyirmetSRnLMD00DOEZR7sLnsyGCGkRzyhq+eYQxBTpt5A3I0uHa81KpHJ/BbIQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/cldapi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 CLDAPI (Cloud Filter API) 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","@bun-win32/kernel32":"1.0.24"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/cldapi_1.0.0_1780539745937_0.6707865592319096","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/cldapi","version":"1.0.1","keywords":["bun","ffi","win32","windows","cldapi","cfapi","cloud-files","cloud-filter","placeholder","sync-root","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/cldapi@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":"d638367bf3b5bd998285628a0af71b0fc9545466","tarball":"https://registry.npmjs.org/@bun-win32/cldapi/-/cldapi-1.0.1.tgz","fileCount":6,"integrity":"sha512-sfOddu5FX1QMDAXhVsoMZlfsrQl7fqli5N3HyZhMKDOBw3BIKZnEZa22qBsoL+aA5o3yqQxGbaAyDdg7swv4QQ==","signatures":[{"sig":"MEYCIQCQIy9BzsHy7Y/zazsf0YAHBKNiNFnt83Zpp5cz5hilzgIhAIzsVi5H1MoaLOA3Ao/c1IXPDWN9YKvLMy5dDWQnHHmB","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37742},"main":"./index.ts","type":"module","module":"index.ts","shasum":"d638367bf3b5bd998285628a0af71b0fc9545466","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:cloud-mirage":"bun ./example/cloud-mirage.ts","example:placeholder-diagnostic":"bun ./example/placeholder-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-sfOddu5FX1QMDAXhVsoMZlfsrQl7fqli5N3HyZhMKDOBw3BIKZnEZa22qBsoL+aA5o3yqQxGbaAyDdg7swv4QQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/cldapi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 CLDAPI (Cloud Filter API) 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","@bun-win32/kernel32":"1.0.26"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/cldapi_1.0.1_1781130794956_0.01665440901263593","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/cldapi","version":"2.0.0","keywords":["bun","ffi","win32","windows","cldapi","cfapi","cloud-files","cloud-filter","placeholder","sync-root","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/cldapi@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":"f5a54eac8e8432663923bd7c328a4fe06a8d4159","tarball":"https://registry.npmjs.org/@bun-win32/cldapi/-/cldapi-2.0.0.tgz","fileCount":6,"integrity":"sha512-9F3YqsUviXtdl0MFpayze0+cM/B2k0UVduy8HY3qGBjiP+thNrnPKWtQgQHWjkc7JmxzS3RJNfkcoQDOF3wwrQ==","signatures":[{"sig":"MEUCIEsI7iwom/D80BWcQ35Rh2+f4eDvyvd39MLdLX3CLpWjAiEAq0Jm0J7Nq1H/mnKwCMe0GxIldU3+C7llaWu74+DwvBk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39327},"main":"./index.ts","type":"module","module":"index.ts","shasum":"f5a54eac8e8432663923bd7c328a4fe06a8d4159","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:cloud-mirage":"bun ./example/cloud-mirage.ts","example:placeholder-diagnostic":"bun ./example/placeholder-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-9F3YqsUviXtdl0MFpayze0+cM/B2k0UVduy8HY3qGBjiP+thNrnPKWtQgQHWjkc7JmxzS3RJNfkcoQDOF3wwrQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/cldapi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 CLDAPI (Cloud Filter API) 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","@bun-win32/kernel32":"2.0.0"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/cldapi_2.0.0_1782435275550_0.976483973257398","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 CLDAPI (Cloud Filter API) bindings for Bun (FFI) on Windows.","devDependencies":{"@bun-win32/kernel32":"2.0.1","@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/cldapi","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/cldapi"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","cldapi","cfapi","cloud-files","cloud-filter","placeholder","sync-root","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:cloud-mirage":"bun ./example/cloud-mirage.ts","example:placeholder-diagnostic":"bun ./example/placeholder-diagnostic.ts"},"_id":"@bun-win32/cldapi@2.0.1","_integrity":"sha512-rU8Vyi/k6FjqQaRLbcqqQKwfhjQ5qRRhDTa+sP72REYnzowuNc15+JZ5R7how98tEl85FmXqp7vpAPK+jMDm1Q==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"0f1f9e0b0f183f6a92d34a935807c3a9eb9be38e","dist":{"integrity":"sha512-rU8Vyi/k6FjqQaRLbcqqQKwfhjQ5qRRhDTa+sP72REYnzowuNc15+JZ5R7how98tEl85FmXqp7vpAPK+jMDm1Q==","shasum":"0f1f9e0b0f183f6a92d34a935807c3a9eb9be38e","tarball":"https://registry.npmjs.org/@bun-win32/cldapi/-/cldapi-2.0.1.tgz","fileCount":6,"unpackedSize":39327,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGj/RethUMdFgpfPAOPXVH0afRQ+8xwp7usUOP4eg31UAiBhdAfNiTepb72Z+LTkffvT6uqhCp08BcTVjrlzW5vpUA=="}]},"_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/cldapi_2.0.1_1782437731759_0.14772474335175856"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-04T02:22:25.797Z","modified":"2026-06-26T01:35:32.058Z","1.0.0":"2026-06-04T02:22:26.061Z","1.0.1":"2026-06-10T22:33:15.144Z","2.0.0":"2026-06-26T00:54:35.795Z","2.0.1":"2026-06-26T01:35:31.934Z"},"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","cldapi","cfapi","cloud-files","cloud-filter","placeholder","sync-root","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/cldapi"},"description":"Zero-dependency, zero-overhead Win32 CLDAPI (Cloud Filter API) bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/cldapi\n\nZero-dependency, zero-overhead Win32 Cloud Filter API (`cldapi.dll`) bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/cldapi` exposes the `cldapi.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Cldapi`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\n`cldapi.dll` is the Cloud Files API (header `cfapi.h`) — the platform behind OneDrive Files On-Demand. It lets a sync provider register a sync root, project **placeholder** files (files that appear with full size and metadata in Explorer but occupy no disk until hydrated), hydrate/dehydrate on demand, and inspect the placeholder/sync-root state of any file.\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 `cldapi.dll` (sync roots, placeholders, hydration, transfer keys, platform info).\n- In-source docs in `structs/Cldapi.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Cldapi.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Cldapi.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 version 1709 or later\n\n## Installation\n\n```sh\nbun add @bun-win32/cldapi\n```\n\n## Quick Start\n\n```ts\nimport Cldapi from '@bun-win32/cldapi';\n\n// CF_PLATFORM_INFO { DWORD BuildNumber; DWORD RevisionNumber; DWORD IntegrationNumber; }\nconst info = Buffer.alloc(12);\nconst hr = Cldapi.CfGetPlatformInfo(info.ptr!);\n\nif (hr === 0) {\n  console.log('Build      :', info.readUInt32LE(0));\n  console.log('Revision   :', info.readUInt32LE(4));\n  console.log('Integration: 0x' + info.readUInt32LE(8).toString(16));\n}\n\n// Decode the placeholder state of any file straight from its attributes/reparse tag\nconst FILE_ATTRIBUTE_DIRECTORY = 0x10;\nconst state = Cldapi.CfGetPlaceholderStateFromAttributeTag(FILE_ATTRIBUTE_DIRECTORY, 0);\nconsole.log('Placeholder state:', state);\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/cloud-mirage.ts\nbun run example/placeholder-diagnostic.ts\n```\n\n- **cloud-mirage** — registers a real sync root in a temp directory and projects a catalog of multi-gigabyte placeholder \"files\" that occupy zero bytes on disk, then animates the reveal and decodes every placeholder's state. Pure FFI; no provider process.\n- **placeholder-diagnostic** — a full Cloud Files report: platform version + integration capability gates, sync-root detection for any directory (OneDrive included), and per-file placeholder/pin/in-sync/on-disk-vs-logical analysis.\n\n## Notes\n\n- Either rely on lazy binding or call `Cldapi.Preload()`.\n- `HRESULT` returns are `number`; `S_OK` is `0`. Negative-looking values are error HRESULTs — mask with `>>> 0` to print as hex.\n- `CF_CONNECTION_KEY`, `CF_TRANSFER_KEY`, and `CF_REQUEST_KEY` are opaque 8-byte keys modeled as `bigint` (passed/returned by value); their `P*` pointer forms are `Pointer` out-params.\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"}