MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / parseTermCommandOutputInput

Function parseTermCommandOutputInput

pkg/aiusechat/tools_term.go:221–242  ·  view source on GitHub ↗
(input any)

Source from the content-addressed store, hash-verified

219}
220
221func parseTermCommandOutputInput(input any) (*TermCommandOutputToolInput, error) {
222 result := &TermCommandOutputToolInput{}
223
224 if input == nil {
225 return nil, fmt.Errorf("widget_id is required")
226 }
227
228 inputBytes, err := json.Marshal(input)
229 if err != nil {
230 return nil, fmt.Errorf("failed to marshal input: %w", err)
231 }
232
233 if err := json.Unmarshal(inputBytes, result); err != nil {
234 return nil, fmt.Errorf("failed to unmarshal input: %w", err)
235 }
236
237 if result.WidgetId == "" {
238 return nil, fmt.Errorf("widget_id is required")
239 }
240
241 return result, nil
242}
243
244func GetTermCommandOutputToolDefinition(tabId string) uctypes.ToolDefinition {
245 return uctypes.ToolDefinition{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected