import { type WorkerBootstrapResponse, type SessionBlob, type SocialAccount } from "dp-shared";
import { DipclawConfig } from "./types.js";
/**
 * Translate a dp-center bootstrap response into the local
 * `DipclawConfig` shape this worker process needs to boot.
 *
 * Two §worker-D guarantees are enforced here:
 *
 *   1. `org` is unconditionally stripped. The OrgManager (file-system-based
 *      multi-agent coordination) was a pre-center stopgap; in center mode, group
 *      task dispatch comes from dp-center directly, and the OrgManager
 *      polling loop would compete with center task dispatch for the
 *      BrowserLock. Even if a stale center release pushed an `org` field, it
 *      will not reach the running Agent.
 *
 *   2. `workspace` is chosen by the worker host process (not by center), so it's
 *      passed in via opts rather than read from the bootstrap response.
 *      The workspace path is filesystem-shaped state — backups, logs,
 *      memory — that survives across worker spawns.
 *
 * center-only fields (config_etag, social_accounts, session_blob,
 * worker_id) are returned in `extras` for the center-client / center-frontend to wire
 * up; they are intentionally NOT part of DipclawConfig because the
 * existing local-mode code path doesn't know about them.
 */
export interface CenterBootstrapExtras {
    workerId: string;
    configEtag: string;
    socialAccounts: SocialAccount[];
    sessionBlob?: SessionBlob;
}
export interface CenterConfigOpts {
    /** Filesystem path the worker process should use for skills/memory/logs/browser-data. */
    workspace: string;
    /**
     * Local fallback for Chrome headless. As of M6 the center bootstrap
     * response carries `config.headless` per worker (operator-controlled
     * from the Web UI), so this opts.headless is only consulted when
     * the bootstrap response leaves it unset — currently only happens
     * for older center releases. Default behaviour: center value wins, then CLI
     * `--headless`, then false.
     */
    headless?: boolean;
}
export interface ParsedCenterBootstrap {
    config: DipclawConfig;
    extras: CenterBootstrapExtras;
}
/**
 * Validate a raw bootstrap response payload (anything that survives JSON
 * deserialization), then transform it into a runtime-ready DipclawConfig
 * plus the center-only extras. Throws on schema failure with a Zod-formatted
 * issue list.
 */
export declare function parseCenterBootstrap(raw: unknown, opts: CenterConfigOpts): ParsedCenterBootstrap;
/**
 * Lower-level variant for callers that already validated the response via
 * dp-shared's schema (e.g. the center-client's fetch wrapper).
 */
export declare function bootstrapResponseToConfig(response: WorkerBootstrapResponse, opts: CenterConfigOpts): ParsedCenterBootstrap;
