Skip to main content

Module parse

Module parse 

Source
Expand description

Shared parsers for foreign JSON / JSONC / TOML settings.

Functionsยง

hook_event_from_name
hook_from_command
hooks_from_claude_object
Claude settings.json hooks object: { "PreToolUse": [ { matcher, hooks: [{type,command}] } ] }.
hooks_from_grok_value
Grok [hooks.<event>] TOML tables (or JSON object of the same shape).
map_tool_name
mcp_from_map
mcp_from_object
Map a generic MCP object (Claude / Cursor / VS Code style mcpServers).
parse_jsonc
Strip // and /* */ comments plus trailing commas so JSONC parses as JSON.
permission_from_lists
Claude / Grok allow-ask-deny lists (["Bash", "Read"] or "Bash(git *)").
permission_from_map
OpenCode-style { "bash": "ask", "edit": "allow" }.
string_list
string_map
toml_to_json