MCPcopy
hub / github.com/wavetermdev/waveterm / parseEditTextFileInput

Function parseEditTextFileInput

pkg/aiusechat/tools_writefile.go:225–245  ·  view source on GitHub ↗
(input any)

Source from the content-addressed store, hash-verified

223}
224
225func parseEditTextFileInput(input any) (*editTextFileParams, error) {
226 result := &editTextFileParams{}
227
228 if input == nil {
229 return nil, fmt.Errorf("input is required")
230 }
231
232 if err := utilfn.ReUnmarshal(result, input); err != nil {
233 return nil, fmt.Errorf("invalid input format: %w", err)
234 }
235
236 if result.Filename == "" {
237 return nil, fmt.Errorf("missing filename parameter")
238 }
239
240 if len(result.Edits) == 0 {
241 return nil, fmt.Errorf("missing edits parameter")
242 }
243
244 return result, nil
245}
246
247func verifyEditTextFileInput(input any, toolUseData *uctypes.UIMessageDataToolUse) error {
248 params, err := parseEditTextFileInput(input)

Callers 4

verifyEditTextFileInputFunction · 0.85
EditTextFileDryRunFunction · 0.85
editTextFileCallbackFunction · 0.85

Calls 1

ReUnmarshalFunction · 0.92

Tested by

no test coverage detected