import type { InferSchema } from "../../../src/extensions/schema/index.js"; import { type ApiClient, type ResolvedConfig } from "../../shared/config.js"; import { type IgnoreChecker } from "../../sync/ignore.js"; import { type PullSource } from "../pull/index.js"; import { type GitSource } from "../../shared/deployment-provenance.js"; import { type PlannedDelete, type PlannedUpload } from "./plan.js"; /** * Schema factory for push command arguments */ export declare const getPushArgsSchema: () => import("../../../src/internal-agents/schema.js").Schema; projectDir: import("../../../src/internal-agents/schema.js").Schema; branch: import("../../../src/internal-agents/schema.js").Schema; /** Intentionally overwrite remote changes and bypass concurrency guards. */ force: import("../../../src/internal-agents/schema.js").Schema; prune: import("../../../src/internal-agents/schema.js").Schema; dryRun: import("../../../src/internal-agents/schema.js").Schema; quiet: import("../../../src/internal-agents/schema.js").Schema; }>>; export declare const PushArgsSchema: import("../../../src/internal-agents/schema.js").Schema; projectDir: import("../../../src/internal-agents/schema.js").Schema; branch: import("../../../src/internal-agents/schema.js").Schema; /** Intentionally overwrite remote changes and bypass concurrency guards. */ force: import("../../../src/internal-agents/schema.js").Schema; prune: import("../../../src/internal-agents/schema.js").Schema; dryRun: import("../../../src/internal-agents/schema.js").Schema; quiet: import("../../../src/internal-agents/schema.js").Schema; }>>; export type PushArgs = InferSchema>; /** * Parse push command arguments from CLI args */ declare const parseKnownPushArgs: (args: import("../../shared/types.js").ParsedArgs) => import("../../shared/args.js").SafeParseResult; projectDir: import("../../../src/internal-agents/schema.js").Schema; branch: import("../../../src/internal-agents/schema.js").Schema; /** Intentionally overwrite remote changes and bypass concurrency guards. */ force: import("../../../src/internal-agents/schema.js").Schema; prune: import("../../../src/internal-agents/schema.js").Schema; dryRun: import("../../../src/internal-agents/schema.js").Schema; quiet: import("../../../src/internal-agents/schema.js").Schema; }>>; export declare function parsePushArgs(args: Parameters[0]): ReturnType; /** * Push command options */ export interface PushOptions { /** Project slug to push to (overrides config) */ projectSlug?: string; /** Project directory (defaults to cwd) */ projectDir?: string; /** Branch name to update (defaults to main) */ branch?: string; /** Intentionally overwrite remote changes and bypass concurrency guards. */ force?: boolean; /** Prune remote files that are missing locally. */ prune?: boolean; /** Dry run - show what would be uploaded without uploading */ dryRun?: boolean; /** Quiet mode - suppress spinner/progress output */ quiet?: boolean; } /** * File upload operation */ export interface UploadOp extends PlannedUpload { /** Relative path from project root (sent to API) */ path: string; content: string; } export interface PushSourceSnapshot { files: UploadOp[]; gitSource: GitSource; sourceDigest: string; } /** * API response for branch creation */ export interface BranchResponse { id: string; name: string; projectId: string; } interface BranchListItem { id: string; name: string; } interface EnsuredBranch extends BranchListItem { created: boolean; } interface PushRemoteTarget { branchId: string | null; remoteFiles: RemoteFile[]; source: PullSource; branchExists: boolean; } interface RemoteFile { path: string; content?: string; version_id?: string; } export declare function scanLocalFiles(projectDir: string, ignoreChecker: IgnoreChecker): Promise; export declare function capturePushSourceSnapshot(projectDir: string, ignoreChecker: IgnoreChecker): Promise; /** * Build a timestamped isolation branch name for pushes that are staged for review. * * The timestamp has one-second resolution, so it alone lets two pushes started in * the same second share a branch and the second upload land on top of the first's * staged work. The random suffix separates them. Both stay lowercase alphanumeric * so the name is inside {@link PREVIEW_BRANCH_PATTERN} and can round-trip through * preview DNS. */ export declare function generateBranchName(): string; /** * Push options for programmatic callers (TUI shortcuts) that stage work for review. * * These callers never prompt, so they must not target main: the branch is what makes * "merge in Studio" true rather than an in-place overwrite of the project's main. */ export declare function createStagedPushOptions(projectSlug: string, projectDir: string): PushOptions; export declare function buildPushUrls(projectSlug: string, branchName: string): { studio: string; preview: string; }; export declare function createBranch(client: ApiClient, projectSlug: string, branchName: string): Promise; export declare function ensureBranch(client: ApiClient, projectSlug: string, branchName: string): Promise; export declare function resolvePushRemoteFiles(client: ApiClient, projectSlug: string, branchName: string, mainFiles: RemoteFile[]): Promise; export declare function uploadFiles(client: ApiClient, projectSlug: string, branchId: string | null, ops: UploadOp[], dryRun: boolean): Promise<{ uploaded: number; failed: number; conflicts: string[]; applied: string[]; }>; export declare function deleteFiles(client: ApiClient, projectSlug: string, branchId: string | null, ops: PlannedDelete[], dryRun: boolean): Promise<{ deleted: number; failed: number; conflicts: string[]; applied: string[]; }>; export declare function recordPushReceipt(client: ApiClient, config: ResolvedConfig, projectDir: string, branch: string, snapshot: PushSourceSnapshot, ignoreChecker: IgnoreChecker, pushedSourceDigest?: string): Promise; export declare function pushCommand(options?: PushOptions): Promise; export {}; //# sourceMappingURL=command.d.ts.map