@vigilbase/cli
Version:
Vigilbase CLI — security scanners, agent tools, and Vigilbase One from the terminal.
25 lines (24 loc) • 1.72 kB
TypeScript
import type { AgentToolDefinition, AgentToolExecuteResponse, AgentToolsCatalogResponse, CliOutputMode } from '../types.js';
export type Writer = {
stdout: (line?: string) => void;
stderr: (line?: string) => void;
};
/** A scan that ended without a result: com's copy (apps/com/lib/tools/execute-internal-scan.ts). */
export declare const SCAN_FAILED_MESSAGE = "The scan couldn't be completed. Try again later.";
/** Untrusted API data must never become terminal control sequences or bidi overrides. */
export declare function sanitizeTerminal(value: string): string;
/** One sanitised line, cut to `maxLength` characters with an ellipsis. */
export declare function singleLine(value: string, maxLength?: number): string;
export declare function createWriter(stdout?: NodeJS.WritableStream, stderr?: NodeJS.WritableStream): Writer;
export declare function printJson(writer: Writer, value: unknown): void;
export declare function formatToolsList(catalog: AgentToolsCatalogResponse, mode: CliOutputMode, writer: Writer, options?: {
authRequiredTools?: readonly string[];
/** @deprecated Use authRequiredTools */
sensitiveTools?: readonly string[];
isAuthenticated?: boolean;
}): void;
export declare function formatToolDescription(tool: AgentToolDefinition, mode: CliOutputMode, writer: Writer, skillMarkdown?: string): void;
/** Whether a scan produced a result; the exit code follows it. */
export declare function isSuccessfulScan(result: AgentToolExecuteResponse): boolean;
export declare function formatExecuteResult(result: AgentToolExecuteResponse, mode: CliOutputMode, writer: Writer): void;
export declare function formatError(error: unknown, mode: CliOutputMode, writer: Writer): void;