/**
 * Cloud Submit Utility
 *
 * Submits a skill to Crewly Cloud, which opens a PR to the marketplace repo on
 * the user's behalf using a server-side bot token. Unlike `submitToGitHub`
 * (which requires the user's own `gh` CLI + GitHub account), this path only
 * needs the user to be logged in to Crewly Cloud (`crewly cloud login`).
 *
 * The skill's files are read from disk, base64-encoded, and POSTed to the cloud
 * `POST /api/registry/submit` endpoint with the user's cloud JWT. The server
 * authenticates, rate-limits, validates, and opens/updates the PR.
 *
 * @module cli/utils/cloud-submit
 */
import type { SkillManifest } from './package-validator.js';
/** Result returned by the cloud submit endpoint. */
export interface CloudSubmitResult {
    /** URL of the opened/updated pull request. */
    prUrl: string;
    /** Branch used (`skill/<id>`). */
    branch: string;
    /** True when an existing PR was updated rather than newly opened. */
    updated: boolean;
}
/** A single file payload entry sent to the cloud. */
export interface CloudSubmitFile {
    /** Path relative to the skill directory, forward-slashed. */
    path: string;
    /** File contents, base64-encoded. */
    contentBase64: string;
    /** Whether the file carries the executable bit. */
    executable: boolean;
}
/** Loaded cloud credentials. */
interface CloudToken {
    token: string;
    cloudUrl: string;
}
/**
 * Load the cloud token saved by `crewly cloud login`.
 *
 * @returns The token and cloud base URL, or null if not logged in.
 */
export declare function loadCloudToken(): CloudToken | null;
/**
 * Recursively collect a skill directory's files as base64 payload entries.
 *
 * Skips VCS/dependency dirs. The executable bit is set for files with a Unix
 * exec mode or a `.sh` extension. Enforces the total-size cap client-side so a
 * too-large submission fails fast before hitting the network.
 *
 * @param skillDir - Absolute path to the skill directory.
 * @returns The collected files (paths relative to `skillDir`, forward-slashed).
 * @throws Error if the collected files exceed the size cap.
 */
export declare function collectSkillFiles(skillDir: string): CloudSubmitFile[];
/**
 * Submit a skill to Crewly Cloud, which opens/updates the marketplace PR.
 *
 * @param skillDir - Absolute path to the validated skill directory.
 * @param manifest - Parsed skill.json.
 * @returns The PR result from the cloud.
 * @throws Error with a user-actionable message on auth failure (not logged in /
 *   expired), rate limiting (429), server misconfiguration (503), or network errors.
 */
export declare function submitToCloud(skillDir: string, manifest: SkillManifest): Promise<CloudSubmitResult>;
export {};
//# sourceMappingURL=cloud-submit.d.ts.map