MCPcopy Index your code
hub / github.com/anomalyco/opencode / scrollPatchFinal

Function scrollPatchFinal

packages/opencode/src/cli/cmd/run/tool.ts:726–753  ·  view source on GitHub ↗
(p: ToolProps<typeof ApplyPatchTool>)

Source from the content-addressed store, hash-verified

724}
725
726function scrollPatchFinal(p: ToolProps<typeof ApplyPatchTool>): string {
727 if (p.frame.status === "error") {
728 return fail(p.frame)
729 }
730
731 const files = list<PatchFile>(p.frame.meta.files)
732 if (files.length === 0) {
733 const time = span(p.frame.state)
734 if (!time) {
735 return "patch"
736 }
737
738 return `patch · ${time}`
739 }
740
741 const show_updates = !files.some((file) => file?.type && file.type !== "update")
742 const shown = files.filter((file) => show_updates || file.type !== "update")
743 const rows = shown.slice(0, 6).map(patchLine)
744 if (shown.length > 6) {
745 rows.push(`... and ${shown.length - 6} more`)
746 }
747
748 if (rows.length > 0) {
749 return rows.join("\n")
750 }
751
752 return patchLine(files[0]!)
753}
754
755function scrollTaskStart(_: ToolProps<typeof TaskTool>): string {
756 return ""

Callers

nothing calls this directly

Calls 5

patchLineFunction · 0.85
pushMethod · 0.80
failFunction · 0.70
listFunction · 0.70
spanFunction · 0.70

Tested by

no test coverage detected