@oss-autopilot/core - v3.14.5
    Preparing search index...

    Type Alias GistPersistenceStatus

    GistPersistenceStatus:
        | "local-mode"
        | "state-unreadable"
        | "no-token"
        | "gist"
        | "degraded"

    Bootstrap helper for processes that may run in Gist persistence mode.

    Peeks at the state file to check if Gist mode is configured. If so and a valid token is provided, pre-sets the singleton via getStateManagerAsync so subsequent synchronous getStateManager calls return the Gist-backed instance. No-op when the state file is absent, unparseable, or not in Gist mode.

    Consolidates identical filesystem-peek + getStateManagerAsync logic that was duplicated between the CLI bootstrap (cli.ts) and MCP tool bootstrap (mcp-server/src/tools.ts) — #1000.

    Type Declaration

    • "local-mode"

      No state file yet, or config does not request gist mode.

    • "state-unreadable"

      The state file exists but could not be read/parsed for this attempt (permissions, transient FS error, corrupt JSON). Callers must NOT memoize this as "local mode chosen" — a later attempt may succeed.

    • "no-token"

      Gist mode is configured but no token was available for this attempt.

    • "gist"

      Gist mode active: the singleton is gist-backed AND the store is armed (the bootstrap actually verified its Gist — not a degraded fallback).

    • "degraded"

      Gist mode is configured and a token was available, but this process is not writing to the Gist: init either fell back to a local-only manager (transient network failure) or bootstrapped DEGRADED off the local cache (#1443 — gist-backed but disarmed, reads stale and pushes fail). A later call may recover.

    GitHub token with gist scope, or null to skip activation

    // CLI bootstrap
    await ensureGistPersistence(token);