import { type DkgConfig } from './config.js'; import { type ProvisionBlazegraphDockerOptions, type ProvisionBlazegraphDockerResult } from './daemon/blazegraph-docker.js'; export interface PromptStoreBackendOptions { /** `ask` callback that closes over a shared readline interface. */ ask: (q: string, def?: string) => Promise; /** Existing config's store block (used as the wizard's default). */ existingStore?: { backend: string; options?: Record; }; /** Pre-fill from `--store` flag. Always overrides existing config. */ flagBackend?: string; /** Pre-fill from `--store-url` flag. Always overrides existing config. */ flagUrl?: string; /** * Node name from the config — used as the Blazegraph namespace name * when the Docker provisioning branch fires. Falls back to * `"dkg-node"` if absent (matches `loadConfig` default). */ nodeName?: string; /** * Override for the SPARQL HTTP transport. Tests inject a mock so the * URL validation step is deterministic; defaults to `globalThis.fetch` * via the shared health-check helper. */ fetch?: typeof globalThis.fetch; /** Logger for status / warning messages. Defaults to console.log. */ log?: (msg: string) => void; /** * PR 3 Docker convenience path. Tests inject a fake to exercise the * "Docker available + operator accepts" branch without spawning real * containers. Production callers omit these — they default to the * real Docker CLI probe + provisioner. */ isDockerAvailable?: () => Promise; provisionBlazegraphDocker?: (opts: ProvisionBlazegraphDockerOptions) => Promise; } export interface PromptStoreBackendResult { /** * Persisted store block. `null` means "use the local default" (caller * should omit the field or set it to undefined; saveConfig drops * undefined keys). * * `managedByDkg: true` is set by the Docker provisioner branch only; * manual URLs always get `managedByDkg: false`. The chain-reset-wipe * step in PR 1 uses this flag to decide between `DROP ALL` (safe on * DKG-owned namespaces) and scoped DELETE (mandatory on * shared / V6 / V8 instances). */ storeBlock: ExternalStoreBlock | LocalStoreBlock | null; } export type LocalStoreBlock = { backend: 'oxigraph' | 'oxigraph-worker' | 'oxigraph-persistent'; options?: Record; }; export type ExternalStoreBlock = { backend: 'blazegraph'; options: { url: string; managedByDkg: boolean; }; } | { backend: 'sparql-http'; options: { queryEndpoint: string; updateEndpoint: string; managedByDkg: boolean; }; } | { backend: 'oxigraph-server'; options: Record; }; export declare function promptStoreBackend(opts: PromptStoreBackendOptions): Promise; export interface ApplyStoreFlagsOptions { storeFlag?: string; storeUrlFlag?: string; /** Mock for tests; defaults to the real `loadConfig` from config.ts. */ loadConfig?: () => Promise; /** Mock for tests; defaults to the real `saveConfig` from config.ts. */ saveConfig?: (config: DkgConfig) => Promise; /** Mock for tests; defaults to `globalThis.fetch` via the probe helper. */ fetch?: typeof globalThis.fetch; log?: (msg: string) => void; } /** * Non-interactive sibling of `promptStoreBackend`. Used by the * adapter-setup commands which delegate to action modules that don't * run the init wizard — so the operator has no chance to type a URL. * * Validates via the shared boot-time health-check probe, then writes * the store block into `~/.dkg/config.json` after the action module * has already created/updated the rest of the config. * * Returns silently when no flags are passed (default behaviour: leave * the existing config alone). Throws on validation failure so the CLI * dispatch wrapper catches and exits cleanly. */ export declare function applyStoreFlagsToConfig(opts: ApplyStoreFlagsOptions): Promise; //# sourceMappingURL=store-wizard.d.ts.map