mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-16 21:53:07 +00:00
* Changes from fix/agent-output-summary-for-pipeline-steps * feat: Optimize pipeline summary extraction and fix regex vulnerability * fix: Use fallback summary for pipeline steps when extraction fails * fix: Strip follow-up session scaffold from pipeline step fallback summaries
15 lines
469 B
TypeScript
15 lines
469 B
TypeScript
export type SummaryValue = string | null | undefined;
|
|
|
|
/**
|
|
* Returns the first summary candidate that contains non-whitespace content.
|
|
* The original string is returned (without trimming) to preserve formatting.
|
|
*/
|
|
export function getFirstNonEmptySummary(...candidates: SummaryValue[]): string | null {
|
|
for (const candidate of candidates) {
|
|
if (typeof candidate === 'string' && candidate.trim().length > 0) {
|
|
return candidate;
|
|
}
|
|
}
|
|
return null;
|
|
}
|