MCPcopy Index your code
hub / github.com/AI45Lab/Code / parse

Method parse

core/src/skills/mod.rs:72–87  ·  view source on GitHub ↗

Parse a tool permission from Claude Code format Examples: - "Bash(gh issue view:*)" -> ToolPermission { tool: "Bash", pattern: "gh issue view:*" } - "read(*)" -> ToolPermission { tool: "read", pattern: "*" }

(s: &str)

Source from the content-addressed store, hash-verified

70 /// - "Bash(gh issue view:*)" -> ToolPermission { tool: "Bash", pattern: "gh issue view:*" }
71 /// - "read(*)" -> ToolPermission { tool: "read", pattern: "*" }
72 pub fn parse(s: &str) -> Option<Self> {
73 let s = s.trim();
74
75 // Find opening parenthesis
76 let open = s.find('(')?;
77 let close = s.rfind(')')?;
78
79 if close <= open {
80 return None;
81 }
82
83 let tool = s[..open].trim().to_string();
84 let pattern = s[open + 1..close].trim().to_string();
85
86 Some(ToolPermission { tool, pattern })
87 }
88}
89
90/// Skill definition (Claude Code compatible)

Callers 13

list_stashesFunction · 0.45
parse_hunk_headerFunction · 0.45
connect_with_timeoutMethod · 0.45
connect_with_timeoutMethod · 0.45
request_headersMethod · 0.45
live_configFunction · 0.45
startFakeOpenAiServerFunction · 0.45
onceFunction · 0.45
eventDataFunction · 0.45
extractNewsItemsMethod · 0.45
mainFunction · 0.45

Calls 1

lenMethod · 0.45

Tested by 1

live_configFunction · 0.36