import type { SweepableSecrets } from '../config/plaintext-credential-sweep.js'; import { type MigratableSecretStore } from '../config/daemon-credential-migration.js'; import type { ConfigManager } from '../config/manager.js'; /** * Guarantee the shared activity logger has somewhere to write. * * The daemon is the process that runs the chat surfaces, so it is the one * process where "the bot token was rejected", "this surface is enabled but * cannot start", and "the reply had nowhere to go" are the only evidence an * operator will ever get. Those all go through `logger`, which discards every * entry until a host names a destination. One shipped daemon binary never * named one, and the result was a process that ran the entire channel stack * and said nothing about any of it for its whole lifetime, an enabled, * configured, inert surface and a healthy-looking daemon. * * A host that already configured a log keeps it; this never relocates one. */ export declare function ensureDaemonActivityLog(workingDirectory: string): void; /** * Fold any daemon-owned key still sitting in a client store into the daemon * store, then re-read so the running process sees what it just moved. * * Idempotent and self-limiting: the migration records the ownership set its * marker covers, so a start whose owned set is unchanged does nothing. That * record is also what makes ownership GROWTH safe, a key promoted to * daemon-owned in a later release migrates on the next daemon start instead of * never, which is exactly how `conversationGate.*` stayed in a client file the * daemon does not read. * * A failure is reported and does not stop the daemon: a setting in the wrong * file is a bad day, a daemon that refuses to boot is a worse one. */ export declare function migrateDaemonOwnedConfigOnBoot(configManager: ConfigManager, homeDirectory: string): void; /** * Lift any credential the daemon needs out of the surface silo it was captured * in, into the daemon's own store. * * The config sibling above moves SETTINGS. This moves the credentials those * settings point at, and it exists because routing new writes correctly does * nothing for the person who already ran setup. The owner did: `/google adopt` * reported success in the agent, and the daemon answering Telegram, with the * agent closed, said no email integration was available. * * Ordering is the safety property, and it is enforced in the migration itself: * the surface copy is removed only after the daemon copy has been read BACK and * compared. A daemon store that cannot be written leaves the credential exactly * where it is and working, and the next start tries again. * * A failure is reported and does not stop the daemon, for the same reason the * config migration does not: a credential in the wrong tier is a bad day, a * daemon that refuses to boot is a worse one. */ export declare function migrateDaemonNeededCredentialsOnBoot(secrets: MigratableSecretStore, homeDirectory?: string): Promise; /** Where the receipt lives: beside the daemon's own state, not in a surface silo. */ export declare function credentialMigrationReceiptPath(homeDirectory: string): string; /** * Every boot guarantee, in the order they depend on each other. * * One call rather than three at the call site, because the ORDER matters and a * host reading three separate lines cannot see that: the log has to exist * before anything can report, the settings have to move before the credentials * they point at, and both have to finish before anything resolves a credential. */ export declare function runDaemonBootGuarantees(configManager: ConfigManager, services: DaemonBootServices): Promise; /** * What the guarantees need from the runtime, structurally. * * Structural rather than a `RuntimeServices` import so this module keeps the * narrow surface it has: it takes a secret store it can list, read, write and * delete through, and two directory paths. Nothing else. */ export interface DaemonBootServices { readonly secretsManager: MigratableSecretStore & SweepableSecrets; readonly shellPaths: { readonly workingDirectory: string; readonly homeDirectory: string; }; } //# sourceMappingURL=facade-boot-guarantees.d.ts.map