MCPcopy Create free account
hub / github.com/anomalyco/opencode / modelOutput

Function modelOutput

packages/core/src/tool/bash.ts:51–57  ·  view source on GitHub ↗
(output: Output)

Source from the content-addressed store, hash-verified

49const defaultShell = () => (process.platform === "win32" ? (process.env.COMSPEC ?? "cmd.exe") : "/bin/sh")
50
51const modelOutput = (output: Output) => {
52 const warnings = output.warnings?.length
53 ? `\n\nWarnings:\n${output.warnings.map((warning) => `- ${warning}`).join("\n")}`
54 : ""
55 if (output.timeout) return `${warnings.trimStart()}${warnings ? "\n\n" : ""}Command timed out before completion.`
56 return `${warnings.trimStart()}${warnings ? "\n\n" : ""}Command exited with code ${output.exit}.`
57}
58
59const isTimeout = (error: AppProcess.AppProcessError) =>
60 error.cause instanceof Error && error.cause.message === "Timed out"

Callers 1

bash.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected