libraryPackage manifestv2.0.4

lib.authos-runtime

Pure deterministic AuthOS runtime projections and security gates over AuthOS contracts.

@lssm-tech/lib.authos-runtime
Source, release and verification context

Source snapshot bcc79fcc · Declared package version 2.0.4. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.

Package source ↗ Manifest ↗
servernode
EXPLORE THE PACKAGE

See where this package fits.

Follow a declared connection, inspect an import, then open the source guide when you need the detail.

THIS PACKAGElib.authos-runtimedomains

Arrows point from a package to its direct dependency. Each count is derived from the captured manifests.

4 declarationsSELECT TO INSPECT

@lssm-tech/lib.authos-runtime

The ./ssr request-edge APIs bind the shared server-only UI subject scope. runWithSubject, cached reads, nested/concurrent request isolation and SubjectContextMissingError remain compatible. AuthOS still owns subject construction; the lower propagation port makes no policy decisions.

Pure deterministic AuthOS runtime projections and security gates over @lssm-tech/lib.authos-spec.

This package does not authenticate users, call Better Auth, access databases, or execute providers. It converts AuthOS contracts into safe runtime-facing projections for RBAC, RoleMorph, personalization, data-transmission, database/form metadata, Connect with LSSM, redaction, and production IdP readiness.

The runtime also includes a deterministic domain-command persistence helper. It turns approved or approval-required AuthOS command contracts into immutable local runtime events with governance metadata, while returning canExecute: false plans so provider, database, and Better Auth execution remains outside this package.

The ecosystem provisioning reducer applies redacted, idempotent receipts for identity, entitlement, product-local membership, activation, and revocation. It never activates partial provisioning, rejects scope and idempotency conflicts, resumes after retry evidence, and can rebuild state from durable receipts without calling an identity provider or product API.

Subject providers and subject modes

The ./subject subpath ships the production-grade SubjectProvider port implementation consumed by @lssm-tech/lib.contracts-spec/rich-reference (S-3) and the per-call subject-mode factories used by the AI-agent surface (S-9):

  • createSubjectProvider({ resolve, cache }) — request-scoped resolver with optional dual-key tenant-scoped LRU cache. Returns undefined (deny-closed) when the strategy throws or yields a malformed shape.
  • createDelegatedSubject({ userSession, agentId, signature }, verifier) — builds an agent-on-behalf-of-user Subject with kind='user' and delegationChain=[userId, agentId] so the audit record carries both identities. Throws on bad signature; resolveSubjectMode turns that into a deny-closed undefined.
  • createAgentSubject(identity) — first-class agent identity (kind='agent', no delegation chain).
  • resolveSubjectMode(ctx) — per-call dispatcher selected by the caller via ctx.mode.

The createHmacDelegationVerifier(secret) helper produces a server-side HMAC-SHA-256 verifier; secrets must come from the orchestration boundary that issues delegation contracts.

Auth read models and lifecycles over injected ports

These subpaths hold the reusable rules; hosts keep storage, transport and environment wiring and implement the ports.

  • ./auth-audit — the public auth-audit taxonomy (AUTH_AUDIT_EVENT_TYPES), redacted action -> event projection, page-limit clamp, actor scoping (non tenant readers are forced to their own actor) and the tenant-bound HMAC-SHA-256 pagination cursor (constant-time verified, INVALID_CURSOR on any failure). The host maps each event type to its own query filter.
  • ./auth-email-address — the secondary email lifecycle behind the auth-email-address-* operations over an AuthEmailAddressStore port: syntax/length validation, a uniform 6-digit code stored only as sha256:<HMAC>, 10-minute expiry, store-enforced attempt limit, constant-time verification, non-enumerating collisions and typed AuthEmailLifecycleError codes. Ids, codes and the clock are injectable.
  • ./waitlist-admin — the approve/reject workflow over a WaitlistAdminStore port, generic over the host actor, record and invitation types: verified-email gate, eligibility, idempotent re-approve and reject, lowest-privilege default role, post-condition check, best-effort invite delivery and PII-free WAITLIST_APPROVED/WAITLIST_REJECTED events.
  • ./operator-auth — the operator-auth lifecycle generic over the host operator role: invitation pending -> processing -> accepted/revoked with exact code-ref checks, observed-claim completion/release, 5-minute stale-claim takeover (every store, guarded by compare-and-set), 24h resend rotation; single-use, operator-bound 5-minute passkey challenges; refs-only credentials (raw key/token/password material is refused); 5-failure / 15-minute lockout; admin/reader role gating via OperatorAuthPolicy. The clock and id source are injectable (OperatorAuthRuntime). InMemoryOperatorAuthRepository is a process-local store for tests and explicitly enabled local mode; durable hosts implement OperatorAuthRepository and apply the same rules in their guarded writes.
  • ./oauth-request — the Passport OAuth gates: resolvePassportOAuthRequest admits a serialized Better Auth OAuth query only for a catalog relying party carrying the signed envelope (sig, exp, ba_iat, ba_param, 8 KiB cap), and assertSafeOAuthRedirect(url, { identityOrigin }) is the open-redirect allowlist (identity-origin continuation paths or an exact registered relying-party callback origin + path; userinfo, other schemes/ports/origins and unparsable input fail closed with OAUTH_REDIRECT_NOT_REGISTERED). The host supplies the identity origin.

Declared capabilities.

Lib Authos Runtime

Pure deterministic AuthOS runtime projections and security gates over AuthOS contracts.

Use it to

  • Adopt pure deterministic authos runtime projections and security gates over authos contracts

Requires

  • TypeScript

Choose another boundary when

  • The @lssm-tech/lib.authos-runtime package constraints do not match the target runtime or platform.

@lssm-tech/lib.authos-runtime

@lssm-tech/lib.authos-runtime/auth-audit

@lssm-tech/lib.authos-runtime/auth-email-address

@lssm-tech/lib.authos-runtime/oauth-request

@lssm-tech/lib.authos-runtime/operator-auth

@lssm-tech/lib.authos-runtime/projections

@lssm-tech/lib.authos-runtime/provisioning

@lssm-tech/lib.authos-runtime/security-gates

@lssm-tech/lib.authos-runtime/ssr

@lssm-tech/lib.authos-runtime/ssr/subject-context

@lssm-tech/lib.authos-runtime/subject

@lssm-tech/lib.authos-runtime/subject/agent

@lssm-tech/lib.authos-runtime/subject/delegated

@lssm-tech/lib.authos-runtime/subject/subject-provider

@lssm-tech/lib.authos-runtime/waitlist

@lssm-tech/lib.authos-runtime/waitlist-admin

Imports and export paths.

17 entries

These are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.

17 imports

Dependencies and related packages.

Runtime dependencies 4
Peer dependencies 1
react
catalog:
Development dependencies 8
@types/react
catalog:types
@types/react-dom
catalog:types
react
catalog:
react-dom
catalog:
typescript
catalog:

Package scripts.

Commands declared by this package. Review its setup requirements before running them; no command here was executed by this review.

publish:pkgbun publish --tolerate-republish --ignore-scripts --verbose
publish:pkg:canarybun publish:pkg --tag canary
buildcontractspec-bun-build build
build:bundlecontractspec-bun-build transpile
build:typescontractspec-bun-build types
devcontractspec-bun-build dev
cleanrimraf dist .turbo
lintbun lint:fix
lint:fixnode ../../../../scripts/biome.cjs check --write .
lint:checknode ../../../../scripts/biome.cjs check .
testbun test
prebuildcontractspec-bun-build prebuild
typechecktsgo --noEmit
Your view

Make room for your context.

Shape the presentation around this moment. You can change it whenever you need.

Your context

The different parts of you

Choose a starting point

A useful mix of context, visuals and gentle guidance.

Tune each dimension
Each dimension can change independently. Product permissions and available actions stay unchanged.

Support the way you begin and return

Tune your support

Reading comfort

Choose your language

Interface language changes text only. Markets, prices and workflows keep their own settings.

Translation coverage

Original source

Navigation151
Graph616
Categories378
Portfolio833
Examples2,035
Source preview1,542

More translations will be added as content is reviewed.

This preference is saved on this browser.

Search the website

Useful starting points

No results. Try a shorter phrase, an operation name or another search area.

A LITTLE ROOM TO EXPLORE

Find something to explore.

Open a closer look on this page, try a different perspective, or follow the detail into its own page.

How previews and controls work
01

Look before you leave

Hover a link or focus it with Tab to see a preview. Clicking the original link or pressing Enter always opens its destination.

02

Stay with the context

Move into the preview to explore its sections. Use Alt + ↓ from a focused link to enter it with the keyboard. Escape closes it.

03

Open the possibilities

Disclosure rows, perspective choices and highlighted controls reveal more. Your view changes reading comfort and the context you explore.

A separate button for a closer look

Show small preview buttons beside links where there is room. Tap the eye to inspect, or tap the link to go straight there. This choice stays in this tab.

No browsing history is collected. Reduced motion follows your device and Your view.