MCPcopy
hub / github.com/anomalyco/opencode / mustTruncate

Function mustTruncate

packages/opencode/test/tool/shell.test.ts:173–181  ·  view source on GitHub ↗
(result: {
  metadata: { truncated?: boolean; exit?: number | null } & Record<string, unknown>
  output: string
})

Source from the content-addressed store, hash-verified

171})
172
173const mustTruncate = (result: {
174 metadata: { truncated?: boolean; exit?: number | null } & Record<string, unknown>
175 output: string
176}) => {
177 if (result.metadata.truncated) return
178 throw new Error(
179 [`shell: ${process.env.SHELL || ""}`, `exit: ${String(result.metadata.exit)}`, "output:", result.output].join("\n"),
180 )
181}
182
183describe("tool.shell", () => {
184 each("basic", () =>

Callers 1

shell.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected