Cotal TypeScript packages
    Preparing search index...

    Function userAuthStateDir

    • The SPACE-SCOPED user-auth state dir (<root>/.cotal/auth/space.<hex>) — the one layout fact the workstation layer owns about user auth: the auth provider persists its material under this dir (opaque to us). A regular provider pin inside the real directory marks user-auth state. Keyed by spaceSegment so two case-differing tenants can never share one state dir and no space name can alias a reserved sibling of the auth dir. Fails loud on a degenerate space — BEFORE any caller can mutate at an aliased path.

      Also the ONE migration point for pre-hex layouts (<authDir>/<encodeURIComponent(space)>): every consumer of a space's user-auth state — the marker check, the provider's dir, and the secret-store keys resolved beside it — obtains this path first, so renaming the legacy dir to the canonical segment HERE means no flow can ever read (or worse, ensure*-REGENERATE) beside material the old layout still holds. Deliberately not in hasUserAuthState alone: a user-mode connect through a registry record never consults the marker before minting.

      Parameters

      • root: string
      • space: string
      • options: { readOnly?: boolean } = {}

      Returns string