@capgo/cli
Version:
A CLI to upload to capgo servers
117 lines (116 loc) • 3.5 kB
TypeScript
import type { FC } from 'react';
import type { DiffLine } from '../diff-utils.js';
export declare const Divider: FC<{
width?: number;
}>;
export declare const BOX_HEADER_ROWS = 5;
export declare const COMPACT_HEADER_ROWS = 1;
export declare const WIZARD_PADDING_ROWS = 2;
export declare const SpinnerLine: FC<{
text: string;
}>;
export declare const SuccessLine: FC<{
text: string;
detail?: string;
}>;
export declare const ErrorLine: FC<{
text: string;
}>;
export type AiResultKind = 'already_analyzed' | 'too_big' | 'error';
export declare const AiResultBanner: FC<{
kind: AiResultKind;
message: string;
dense?: boolean;
}>;
/**
* Custom TextInput that filters out specific characters (e.g. '=').
* @inkjs/ui's TextInput is uncontrolled and can't filter keystrokes,
* so we build a minimal one with Ink's useInput.
*/
export declare const FilteredTextInput: FC<{
placeholder?: string;
filter?: string;
mask?: boolean;
onSubmit: (value: string) => void;
}>;
export declare const Header: FC<{
compact?: boolean;
}>;
/**
* Scrollable, fullscreen viewer for the AI build-analysis markdown when it
* is taller than the user's terminal viewport. Mirrors the shape of the
* workflow-file diff viewer on main, but for pre-rendered ANSI lines (no
* `add`/`del` colouring — the markdown renderer already styled them).
*
* Keybindings:
* ↑/k scroll one line up
* ↓/j scroll one line down
* PgUp/u jump up one viewport
* PgDn/d/␣ jump down one viewport
* Home/g jump to top
* End/G jump to bottom
* Esc/Enter dismiss the viewer (returns control to the parent step)
*/
export declare const FullscreenAiViewer: FC<{
title: string;
subtitle?: string;
lines: string[];
terminalRows: number;
onExit: () => void;
}>;
export declare function isBuildCompleteDismissKey(input: string, key: {
return?: boolean;
escape?: boolean;
}): boolean;
export interface BuildScrollState {
scrollOffset: number;
follow: boolean;
}
export declare function buildScrollAction(input: string, key: {
upArrow?: boolean;
downArrow?: boolean;
pageUp?: boolean;
pageDown?: boolean;
}, state: {
scrollOffset: number;
maxScrollOffset: number;
viewportRows: number;
}): BuildScrollState | null;
export declare function formatElapsed(ms: number): string;
export declare const FullscreenBuildOutput: FC<{
title: string;
lines: string[];
terminalRows: number;
}>;
/**
* Minimal bordered table component for the confirm-secrets-push step.
*
* Rolled in-house instead of pulling `ink-table` because that package is
* CommonJS-only and Ink 5 uses top-level await — bun can't bundle the combo.
* Replicates the visual style (box-drawing borders, aligned columns) with
* ~50 lines of Ink primitives, lets us color the Status column per-row, and
* leaves nothing to maintain outside this repo.
*/
export interface SecretRow {
name: string;
status: 'NEW' | 'REPLACE';
}
export declare const DiffSummary: FC<{
title: string;
subtitle?: string;
lines: DiffLine[];
}>;
export declare const FullscreenDiffViewer: FC<{
title: string;
subtitle?: string;
lines: DiffLine[];
terminalRows: number;
onExit: () => void;
}>;
/**
* Render the secrets table inline. Keep this dynamic so the onboarding header
* and prompt stay in one live Ink frame.
*/
export declare const SecretsTable: FC<{
rows: SecretRow[];
}>;