(value any)
| 839 | return command, ok |
| 840 | } |
| 841 | |
| 842 | func skillShellRequestParts(value any) (string, string, bool) { |
| 843 | switch req := value.(type) { |
| 844 | case nil: |
| 845 | return "", "", false |
| 846 | case skills.SkillShellPermissionRequest: |
| 847 | return req.SkillName, req.Command, true |
| 848 | case *skills.SkillShellPermissionRequest: |
| 849 | if req == nil { |
| 850 | return "", "", false |
| 851 | } |
| 852 | return req.SkillName, req.Command, true |
| 853 | case map[string]any: |
| 854 | return stringFromAny(req["skill_name"]), stringFromAny(req["command"]), true |
| 855 | case map[string]string: |
| 856 | return req["skill_name"], req["command"], true |
| 857 | } |
| 858 | rv := reflect.ValueOf(value) |
| 859 | if rv.Kind() == reflect.Pointer { |
| 860 | if rv.IsNil() { |
| 861 | return "", "", false |
| 862 | } |
| 863 | rv = rv.Elem() |
| 864 | } |
| 865 | if rv.Kind() != reflect.Struct { |
| 866 | return "", "", false |
| 867 | } |
| 868 | return stringFieldByNames(rv, "SkillName", "skill_name"), stringFieldByNames(rv, "Command", "command"), true |
| 869 | } |
| 870 | |
| 871 | func normalizeMCPTrustRequest(value any) ([]map[string]any, bool) { |
no test coverage detected