MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / extractWritePath

Function extractWritePath

internal/agent/agent.go:206–214  ·  view source on GitHub ↗

extractWritePath pulls the path out of a write_file tool input so the approval prompt can name the target file. Returns "" on any parse failure — the caller falls back to a generic prompt.

(rawInput string)

Source from the content-addressed store, hash-verified

204// approval prompt can name the target file. Returns "" on any parse
205// failure — the caller falls back to a generic prompt.
206func extractWritePath(rawInput string) string {
207 var in struct {
208 Path string `json:"path"`
209 }
210 if err := json.Unmarshal([]byte(rawInput), &in); err != nil {
211 return ""
212 }
213 return in.Path
214}

Callers 1

executeToolMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected