MCPcopy Create free account
hub / github.com/block/buzz / summarizePlanUpdate

Function summarizePlanUpdate

desktop/src/features/agents/ui/agentSessionTranscript.ts:542–555  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

540}
541
542function summarizePlanUpdate(text: string) {
543 const taskMatches = [...text.matchAll(/\[[ xX]\]/g)];
544 if (taskMatches.length > 0) {
545 const completed = taskMatches.filter((match) =>
546 match[0].toLowerCase().includes("x"),
547 ).length;
548 return `${completed}/${taskMatches.length} complete`;
549 }
550
551 const stepCount = text
552 .split(/\r?\n/)
553 .filter((line) => /^\s*(?:[-*]|\d+[.)])\s+\S/.test(line)).length;
554 return stepCount > 0 ? `${stepCount} step${stepCount === 1 ? "" : "s"}` : "";
555}
556
557function upsertMetadata(
558 d: TranscriptDraft,

Callers 1

upsertPlanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected