/** * Shared failure-text extraction for the adapter spawn adapters. * * A vendor CLI prints its banner, resolved config, and startup warnings first, * and the reason it actually failed last. Every adapter used to keep the FIRST * 500 characters of the transcript, which reliably preserved the banner and * discarded the answer: a child that died with "your workspace is out of * credits" reported a cosmetic startup warning instead. * * Two rules follow. Keep the tail. Include both streams, because which one * carries the reason varies by vendor and by failure. */ /** Bounded failure text from a finished child, tail-preserving. */ export declare function vendorFailureText(raw: { stdout?: string; stderr?: string; }, maxChars?: number): string; /** * Whether failure text names an UPSTREAM refusal — the vendor was reached and * refused (a 5xx/429 status or circuit-open wording), as opposed to a work * failure (the model ran and produced a wrong or incomplete result). * * There is no structural upstream signal the way ENOENT structurally marks a * missing binary, so this is the one text match in the classifier. It is kept * SHORT and documented on purpose: a per-vendor regex zoo would rot, and a * false positive here wrongly withholds a charge, so both the phrase list and * the numeric match stay tight — the number must sit in HTTP-status context, not * merely fall in the 429/5xx range. Anything it does not match falls through to * a charged work failure. */ export declare function isUpstreamFailureText(text: string): boolean; //# sourceMappingURL=spawn-failure.d.ts.map