{"_id":"@access-lens/core","name":"@access-lens/core","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@access-lens/core","version":"0.1.0","description":"Framework-agnostic access observability core. Record every gated UI decision (permission, feature flag, plan, entitlement, tenant config) with the exact reason it produced.","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"sideEffects":false,"keywords":["access-control","rbac","abac","permissions","feature-flags","entitlements","observability","saas","authorization","typescript","headless"],"author":{"name":"Shahar Amir","email":"shahramir3@gmail.com"},"license":"MIT","homepage":"https://github.com/Shaharamir/access-lens#readme","repository":{"type":"git","url":"git+https://github.com/Shaharamir/access-lens.git","directory":"packages/core"},"bugs":{"url":"https://github.com/Shaharamir/access-lens/issues"},"engines":{"node":">=18"},"publishConfig":{"access":"public","provenance":false},"devDependencies":{"typescript":"^5.6.3","vitest":"^2.1.9"},"scripts":{"build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test":"vitest run","test:watch":"vitest","clean":"rm -rf dist"},"_id":"@access-lens/core@0.1.0","_integrity":"sha512-oG6tTS6wKRn7FleB/o0SUnkU5x4vGv5SUcsQDkIZVb7CPMfG5+0AJGLMsKPTvirkx/rpApmCa+06/6maRRcCVg==","_resolved":"C:\\Users\\shahar-a\\AppData\\Local\\Temp\\8773a2385dcc492e91dcf7dd4b92e9c2\\access-lens-core-0.1.0.tgz","_from":"file:access-lens-core-0.1.0.tgz","_nodeVersion":"22.15.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-oG6tTS6wKRn7FleB/o0SUnkU5x4vGv5SUcsQDkIZVb7CPMfG5+0AJGLMsKPTvirkx/rpApmCa+06/6maRRcCVg==","shasum":"0d3a508d471973de0c57093a32303cb9c5b6541e","tarball":"https://registry.npmjs.org/@access-lens/core/-/core-0.1.0.tgz","fileCount":9,"unpackedSize":150079,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHWHGPJJiCkVhFYO1eHpTWiVIuylZNiCHKHk7tdt0cSKAiAmhiAto0eZ1WLQq0186oyoD/+L2i28GmNi09ibp1AGEw=="}]},"_npmUser":{"name":"shahar.amir","email":"shahramir3@gmail.com"},"directories":{},"maintainers":[{"name":"shahar.amir","email":"shahramir3@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_0.1.0_1781408095823_0.650647711967913"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-14T03:34:55.615Z","0.1.0":"2026-06-14T03:34:55.982Z","modified":"2026-06-14T03:34:56.256Z"},"maintainers":[{"name":"shahar.amir","email":"shahramir3@gmail.com"}],"description":"Framework-agnostic access observability core. Record every gated UI decision (permission, feature flag, plan, entitlement, tenant config) with the exact reason it produced.","homepage":"https://github.com/Shaharamir/access-lens#readme","keywords":["access-control","rbac","abac","permissions","feature-flags","entitlements","observability","saas","authorization","typescript","headless"],"repository":{"type":"git","url":"git+https://github.com/Shaharamir/access-lens.git","directory":"packages/core"},"author":{"name":"Shahar Amir","email":"shahramir3@gmail.com"},"bugs":{"url":"https://github.com/Shaharamir/access-lens/issues"},"license":"MIT","readme":"# @access-lens/core\n\nFramework-agnostic core for Access Lens. Pure TypeScript. No React. No DOM assumptions.\n\n## Install\n\n```bash\npnpm add @access-lens/core\n```\n\n## What it provides\n\n- Access decision model (`AccessNode`, `AccessReason`, `AccessStatus`).\n- Reason helpers (`permission`, `featureFlag`, `entitlement`, `plan`, `tenantConfig`, `condition`, `customReason`).\n- `evaluateAccess()` — pure function turning reasons into an `AccessNode`.\n- `AccessLensClient` — registry + snapshot + subscribe API for adapters.\n\n## Basic usage\n\n```ts\nimport {\n  createAccessLensClient,\n  evaluateAccess,\n  permission,\n  featureFlag,\n  entitlement,\n} from \"@access-lens/core\";\n\nconst client = createAccessLensClient();\n\nconst node = evaluateAccess({\n  id: \"sidebar.billing\",\n  label: \"Billing\",\n  type: \"sidebar_item\",\n  reasons: [\n    permission(\"billing.read\", user.permissions.includes(\"billing.read\")),\n    featureFlag(\"billing_v2\", flags.billing_v2),\n    entitlement(\"billing\", tenant.entitlements.billing),\n  ],\n});\n\nclient.registerNode(node);\n\n// Subscribe to snapshot changes.\nconst unsubscribe = client.subscribe((snapshot) => {\n  console.log(snapshot.counts, snapshot.nodes);\n});\n```\n\n## Why a headless core?\n\nAdapters (React, Vue, Angular, plain DOM, server) all share the same evaluation rules. The core owns the model and registry, adapters own how nodes get registered and how denied UI is rendered.\n","readmeFilename":"README.md","_rev":"1-fa0b0943a5e5051c52c56ad2f5408ef0"}