MCPcopy Create free account
hub / github.com/coder/coder / executeToolParsedCommands

Function executeToolParsedCommands

coderd/x/chatd/chatprompt/chatprompt.go:1278–1293  ·  view source on GitHub ↗
(toolName string, args json.RawMessage)

Source from the content-addressed store, hash-verified

1276}
1277
1278func executeToolParsedCommands(toolName string, args json.RawMessage) [][]string {
1279 if toolName != chattool.ExecuteToolName || len(args) == 0 {
1280 return nil
1281 }
1282 var parsed struct {
1283 Command string `json:"command"`
1284 }
1285 if err := json.Unmarshal(args, &parsed); err != nil || parsed.Command == "" {
1286 return nil
1287 }
1288 steps, err := shellparse.Parse(parsed.Command)
1289 if err != nil {
1290 return nil
1291 }
1292 return steps
1293}
1294
1295// TODO: Replace filename-based detection with explicit origin metadata.
1296func isSyntheticPaste(name string, mediaType string) bool {

Callers 1

sdkPartFromContentFunction · 0.85

Calls 2

ParseFunction · 0.92
UnmarshalMethod · 0.45

Tested by

no test coverage detected