/** * Per-server auth token for the browser-facing mutating API. * * The loopback + Origin checks in security.ts stop remote and cross-site * callers, but they authenticate a NETWORK LOCATION, not a process: every other * program on this machine shares localhost, and the mutating routes now spawn * `claude` subprocesses. This token proves the caller is a page THIS server * served — it is minted fresh at every server start and injected into the * served index.html (see static.ts), so the SPA holds it from first paint and * no other local process can guess it. * * Deliberately per-SERVER, not per-project: it authenticates the browser tab, * and one tab drives every project. Verification always reads the in-memory * value, never the file, so a second server started against the same data dir * cannot authorize requests to this one — it only replaces the on-disk copy. * Exactly one token is live per PROCESS: a second createApp in the same process * rotates it and every app then verifies against the newest value. ARCS runs * one server per process, so that is a test-only nuance. * * The file exists for out-of-band consumers (scripts, tests) and is written * 0o600: the token is never passed on an argv or in an env var a `ps` can read. */ export declare function webTokenPath(): string; /** * Mints this server's token, replacing any previous one, and persists it 0o600. * Called once from createApp, before any route can be served: the middleware * and the index.html transform both read the value it installs. */ export declare function mintWebToken(): string; /** This server's live token, or undefined before mintWebToken() has run. */ export declare function currentWebToken(): string | undefined; /** * Constant-time token comparison. Returns false when no token has been minted * yet, so a request that arrives before startup finished cannot be authorized * by an empty header. */ export declare function verifyWebToken(candidate: string): boolean; //# sourceMappingURL=web-token.d.ts.map