MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / mapStringAny

Function mapStringAny

ui/runtime.go:870–901  ·  view source on GitHub ↗
(value any)

Source from the content-addressed store, hash-verified

868 return stringFieldByNames(rv, "SkillName", "skill_name"), stringFieldByNames(rv, "Command", "command"), true
869}
870
871func normalizeMCPTrustRequest(value any) ([]map[string]any, bool) {
872 switch req := value.(type) {
873 case nil:
874 return nil, false
875 case []map[string]any:
876 return req, true
877 case []any:
878 items := make([]map[string]any, 0, len(req))
879 for _, raw := range req {
880 if item, ok := mapStringAny(raw); ok {
881 items = append(items, item)
882 }
883 }
884 return items, true
885 default:
886 rv := reflect.ValueOf(value)
887 if rv.Kind() == reflect.Slice || rv.Kind() == reflect.Array {
888 items := make([]map[string]any, 0, rv.Len())
889 for i := 0; i < rv.Len(); i++ {
890 if item, ok := mapStringAny(rv.Index(i).Interface()); ok {
891 items = append(items, item)
892 }
893 }
894 return items, true
895 }
896 }
897 return nil, false
898}
899
900func normalizeSandboxSetupRequest(value any) (map[string]any, bool) {
901 return mapStringAny(value)
902}
903
904func sandboxSetupTarget(request map[string]any, toolCall any) string {

Callers 1

normalizeMCPTrustRequestFunction · 0.85

Calls 2

fieldByNamesFunction · 0.85
exportedFieldNameFunction · 0.85

Tested by

no test coverage detected