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

Function snapWrite

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

Source from the content-addressed store, hash-verified

498}
499
500function snapWrite(p: ToolProps<typeof WriteTool>): ToolSnapshot | undefined {
501 const file = p.input.filePath || ""
502 const content = p.input.content || ""
503 if (!file && !content) {
504 return undefined
505 }
506
507 return {
508 kind: "code",
509 title: `# Wrote ${toolPath(file)}`,
510 content,
511 file,
512 }
513}
514
515function snapEdit(p: ToolProps<typeof EditTool>): ToolSnapshot | undefined {
516 const file = p.input.filePath || ""

Callers

nothing calls this directly

Calls 1

toolPathFunction · 0.85

Tested by

no test coverage detected