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

Function taskResult

packages/opencode/src/cli/cmd/run/tool.ts:759–775  ·  view source on GitHub ↗
(output: string)

Source from the content-addressed store, hash-verified

757}
758
759function taskResult(output: string): string | undefined {
760 if (!output.trim()) {
761 return undefined
762 }
763
764 const match = output.match(/<task_result>\s*([\s\S]*?)\s*<\/task_result>/)
765 if (match) {
766 return match[1].trim() || undefined
767 }
768
769 const next = output
770 .split("\n")
771 .filter((line) => !line.startsWith("task_id:"))
772 .join("\n")
773 .trim()
774 return next || undefined
775}
776
777function scrollTaskFinal(p: ToolProps<typeof TaskTool>): string {
778 if (p.frame.status === "error") {

Callers 1

toolEntryBodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected