/**
 * Shared helpers used by both onboarding entry points:
 *   - `runSetup()` in `./index.ts`              (interactive CLI)
 *   - `runSetupStepCli()` in `./setup-steps.ts` (Electron GUI step runner)
 *
 * Anything deterministic (config object construction, identity-memory
 * formatting, profile-photo download, GitHub username resolution) lives
 * here so the two entry points can share a single source of truth.
 *
 * Anything that requires a user prompt or a real browser session stays in
 * the interactive `index.ts` flow; anything that emits structured JSON for
 * the GUI stays in `setup-steps.ts`.
 */
import { type Model, type VisionClawConfig } from "../config/types.js";
import type { ProvisioningSpec } from "./provisioning-spec.js";
import type { SetupState } from "./setup-state.js";
/**
 * Resolve the local GitHub username via `gh api user`. Returns undefined
 * when `gh` is not authenticated or unavailable.
 */
export declare function resolveGithubUsername(): string | undefined;
export declare function authenticateGithubWithPat(pat: string): {
    ok: boolean;
    username?: string;
    error?: string;
};
/**
 * Expand `~` / `~/...` to the user's home directory; pass other paths
 * through unchanged. The interactive CLI variant trims the input first;
 * callers that already trimmed (or never had whitespace) can pass the
 * raw value.
 */
export declare function resolveLocalPath(source: string): string;
/**
 * Resolve the OBS tunnel name + hostname for the saved config.
 *
 * Precedence:
 *   1. `spec.cloudflared.tunnelName` / `tunnelHostname` — the onboarding
 *      service emits these, derived from the canonical `emailUsername`.
 *      They are the authoritative value because the server-issued runtime
 *      tunnel credential will use the same name.
 *   2. `sanitizeTunnelName(spec.agentName)` — local fallback that keeps
 *      legacy specs (which don't carry tunnel fields) working.
 *
 * Returns `{ undefined, undefined }` when cloudflared is disabled in the
 * spec, so callers can spread the result into the obs config without
 * special-casing.
 */
export declare function resolveObsTunnelIdentity(spec: ProvisioningSpec): {
    tunnelName: string | undefined;
    tunnelHostname: string | undefined;
};
export interface BuildVisionClawConfigInput {
    spec: ProvisioningSpec;
    state: SetupState;
    /** Email address to record under `gmail`. */
    gmail: string;
    /** Optional gmail password. Falls back to `state.gmailPassword`. */
    gmailPassword?: string;
    /** AI model to record. The GUI flow has no picker and pins this. */
    model: Model;
}
/**
 * Build the persisted `VisionClawConfig` for a freshly-set-up agent.
 *
 * This is the single source of truth for the post-setup config layout —
 * both onboarding entry points (`runSetup` and the GUI `save-config`
 * step) call into here so the obs/tunnel/AWS/channels block can never
 * drift between them again.
 */
export declare function buildVisionClawConfig(input: BuildVisionClawConfigInput): VisionClawConfig;
export interface WriteIdentityMemoryInput {
    gmail: string;
    gmailPassword: string | undefined;
    systemPassword: string | undefined;
    wallet: {
        address: string;
        privateKey: string;
        mnemonic: string;
    };
    /** Saved profile photo filenames, relative to `getProfilePhotosDir()`. */
    profilePhotos: string[];
    githubUsername: string | undefined;
}
/**
 * Write the post-setup `identity.md` memory file. Both entry points
 * produce the same file layout; centralising it here keeps the two
 * onboarding paths in lockstep when fields are added.
 */
export declare function writeIdentityMemory(input: WriteIdentityMemoryInput): void;
/**
 * Optional reporter passed to `downloadProfilePhotos`. The interactive
 * CLI uses `console.log` here; the GUI step swallows everything because
 * it emits a single structured JSON result at the end. Defaults to
 * silent.
 */
export type ProfilePhotoReporter = (message: string) => void;
/**
 * Download/copy each `profilePhotoSources` entry into the profile
 * photos directory. URLs are fetched with a 30s timeout; local paths
 * support `~` expansion via {@link resolveLocalPath}. Per-photo errors
 * are reported and skipped rather than aborting the batch — a single
 * dead URL must not stop onboarding.
 *
 * Returns the list of saved filenames (relative to
 * `getProfilePhotosDir()`), in the order they were processed.
 */
export declare function downloadProfilePhotos(sources: readonly string[], report?: ProfilePhotoReporter): Promise<string[]>;
/**
 * Upload the first downloaded profile photo to the Google Workspace
 * user record. No-op when there are no photos. Failures are reported
 * (or swallowed when no reporter is provided) — they must not block
 * onboarding because the photo upload is cosmetic.
 */
export declare function applyWorkspaceProfilePhoto(spec: ProvisioningSpec, gmail: string, savedPhotos: readonly string[], report?: ProfilePhotoReporter): Promise<void>;
//# sourceMappingURL=setup-shared.d.ts.map