/**
 * Linux secret storage via libsecret (GNOME Keyring / Secret Service API).
 *
 * Primary backend: `secret-tool` CLI (libsecret-tools package).
 *
 * Headless fallback: when the default Secret Service collection is locked
 * (common on server-class Linux — no graphical login means the keyring
 * passphrase never enters the daemon, so `secret-tool store` fails with
 * "Cannot create an item in a locked collection"), we transparently switch
 * to the AES-256-GCM encrypted-file store in ./filestore.ts. The decision is
 * cached per process; one stderr line is emitted the first time the fallback
 * activates.
 *
 * Secrets stored via secret-tool use:
 *   service = "agents-cli"
 *   account = username
 *   item    = the secret identifier
 */
import type { KeychainBackend } from './index.js';
import { type NativeImportReport } from './fallback.js';
export { encryptForFallback, decryptForFallback, fileBackend, type EncFile, } from './filestore.js';
/**
 * True when secret operations currently route to the encrypted-file store
 * instead of the Secret Service (the headless / locked-collection fallback).
 *
 * Runs the same `preflight()` decision every read and write uses, so it can't
 * drift from where bytes actually land. `preflight()` throws only in the
 * interactive / no-secret-tool / no-passphrase case — where nothing is stored
 * — so treat that as "not on the file path".
 *
 * `listBundles()` needs this: under the fallback the keychain enumeration
 * (`linuxBackend.list`) and the file enumeration read the SAME store, so
 * without this signal every file-backed bundle would be listed twice.
 */
export declare function usesFileFallback(): boolean;
/** secret-tool lookup attributes:
 *   service=agents-cli account=<user> item=<itemName> */
export declare function hasSecretToolToken(item: string): boolean;
export declare function getSecretToolToken(item: string): string;
export declare function setSecretToolToken(item: string, value: string): void;
export declare function deleteSecretToolToken(item: string): boolean;
/**
 * Parse the item names out of `secret-tool search --all` output, keeping only
 * those starting with `prefix`. Exported for tests.
 *
 * `output` must be the combined stdout+stderr of the search: libsecret splits
 * the dump across both streams — the value/label/schema lines go to stdout
 * while the `attribute.*` lines (which carry `attribute.item`, the only place
 * the item name is reliably machine-readable) go to stderr (observed on
 * libsecret 0.21.4). Which stream each line lands on has varied across
 * libsecret versions, so callers concatenate both rather than bet on one.
 */
export declare function parseSecretToolItems(output: string, prefix: string): string[];
/**
 * List secrets by prefix. secret-tool doesn't have a list command,
 * so we use secret-tool search which outputs in a specific format.
 */
export declare function listSecretToolItems(prefix: string): string[];
/**
 * Copy agents-cli items from the keyring into the file store (the `import-keyring`
 * backend for Linux). Requires an unlocked keyring; items already in the file
 * store are left untouched. With `commit=false` it reports what it *would* do.
 */
export declare function importNativeSecretToolItems(prefix: string, commit: boolean): NativeImportReport;
/** KeychainBackend implementation for Linux. Routes through secret-tool
 *  with a transparent encrypted-file fallback when the default Secret
 *  Service collection is locked (or libsecret-tools is not installed but
 *  AGENTS_SECRETS_PASSPHRASE is set). */
export declare const linuxBackend: KeychainBackend;
/** Test-only: reset module state so independent test cases don't bleed
 *  passphrase / fallback decisions across each other. File-store state (file
 *  dir + cached passphrase) lives in ./filestore.ts and is reset there. */
export declare function _resetForTest(opts?: {
    fileDir?: string | null;
    forceFileFallback?: boolean;
    passphrase?: string | null;
}): void;
