MCPcopy Create free account
hub / github.com/diillson/chatcli / jsonString

Function jsonString

cli/plugins/args_extract.go:93–95  ·  view source on GitHub ↗

jsonString is the shorthand used by atomic-tool plugins (@read, @search, @tree, @todo, …) that own the parsed JSON object directly. Tries each alias in order and returns the first non-empty string value. Numbers/booleans/null are ignored — atomic-tool string fields (file, term, dir, …) must be strin

(raw map[string]json.RawMessage, keys ...string)

Source from the content-addressed store, hash-verified

91// value. Numbers/booleans/null are ignored — atomic-tool string fields
92// (file, term, dir, …) must be strings, never coerced.
93func jsonString(raw map[string]json.RawMessage, keys ...string) string {
94 return stringFromMap(raw, keys)
95}
96
97// jsonInt mirrors jsonString for integer fields. Tries each alias,
98// returns the first parseable int. Strings that contain a valid int

Callers 14

parseDocsFlattenArgsFunction · 0.85
parseDiagramArgsFunction · 0.85
ExecuteWithStreamMethod · 0.85
parseGraphViewArgsFunction · 0.85
parseSearchArgsFunction · 0.85
TestContextArgvFormFunction · 0.85
contextSubcommandFunction · 0.85
parseReadArgsFunction · 0.85
parseRegistryTagsArgsFunction · 0.85
ExecuteWithStreamMethod · 0.85
rawJSONStringFunction · 0.85

Calls 1

stringFromMapFunction · 0.85

Tested by 1

TestContextArgvFormFunction · 0.68