@promptbook/node
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
22 lines (21 loc) • 859 B
TypeScript
import { NotAllowed } from '../../../../src/errors/NotAllowed';
/**
* Failure category used by OpenAI Codex retry/fail-fast handling.
*/
export type CodexFailureKind = 'credits-required' | 'rate-limit' | 'other';
/**
* Classifies one Codex failure message into retry/fail-fast categories.
*/
export declare function classifyCodexFailure(details: string): CodexFailureKind;
/**
* Builds a fail-fast error for cases where credit spending is disallowed.
*/
export declare function buildCreditsDisallowedError(details: string): NotAllowed;
/**
* Extracts a text description from unknown thrown values.
*/
export declare function extractCodexFailureDetails(error: unknown): string;
/**
* Trims very long CLI error output to keep logs and thrown messages readable.
*/
export declare function limitErrorDetails(details: string, maxChars?: number): string;