Skip to content

Commit 6956e5a

Browse files
authored
claude-code-settings: add permissions.ask support and tests (SchemaStore#5006)
1 parent 980e431 commit 6956e5a

File tree

9 files changed

+20
-1
lines changed

9 files changed

+20
-1
lines changed

src/negative_test/claude-code-settings/invalid-permission-rule.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
"Bash without parentheses",
66
"Read[wrong-brackets]",
77
"WebFetch(invalid:syntax"
8+
],
9+
"ask": [
10+
"AnotherInvalidTool",
11+
"Write missing parentheses",
12+
"LS[wrong-brackets]",
13+
"Edit(invalid:syntax"
814
]
915
}
1016
}

src/negative_test/claude-code-settings/wrong-property-types.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"includeCoAuthoredBy": "yes",
55
"permissions": {
66
"additionalDirectories": "should be array",
7-
"allow": "should be array"
7+
"allow": "should be array",
8+
"ask": "should be array"
89
}
910
}

src/schemas/json/claude-code-settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@
100100
"items": { "$ref": "#/$defs/permissionRule" },
101101
"uniqueItems": true
102102
},
103+
"ask": {
104+
"type": "array",
105+
"description": "List of ask tool permission rules",
106+
"items": { "$ref": "#/$defs/permissionRule" },
107+
"uniqueItems": true
108+
},
103109
"deny": {
104110
"type": "array",
105111
"description": "List of denied tool permission rules",

src/test/claude-code-settings/complete-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"Bash(git log:*)",
1616
"WebFetch(domain:anthropic.com)"
1717
],
18+
"ask": ["Write(/tmp/**)", "WebFetch(domain:trusted.example.com)"],
1819
"deny": [
1920
"Bash(rm:*)",
2021
"Bash(curl:*)",

src/test/claude-code-settings/edge-cases.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"env": {},
55
"permissions": {
66
"allow": [],
7+
"ask": [],
78
"deny": []
89
}
910
}

src/test/claude-code-settings/modern-complete-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"Write",
5656
"mcp__*"
5757
],
58+
"ask": ["TodoRead", "NotebookRead", "Bash(pip:*)", "Write(~/.cache/**)"],
5859
"defaultMode": "plan",
5960
"deny": [
6061
"Bash(sudo:*)",

src/test/claude-code-settings/permissions-advanced.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"mcp__ide__getDiagnostics",
2020
"mcp__ide__executeCode"
2121
],
22+
"ask": ["Write(~/projects/**)", "TodoRead", "NotebookRead", "Bash(make:*)"],
2223
"defaultMode": "acceptEdits",
2324
"deny": ["Bash(rm:*)", "Write(/etc/**)", "WebFetch(domain:malicious.com)"],
2425
"disableBypassPermissionsMode": "disable"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"permissions": {
33
"allow": ["Read(~/.bashrc)", "Bash(pwd:*)"],
4+
"ask": ["Write(/tmp/**)"],
45
"deny": ["Bash(sudo:*)"]
56
}
67
}

src/test/claude-code-settings/permissions-mcp.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"mcp__filesystem(read:/home/user)",
66
"mcp__git(status:*)"
77
],
8+
"ask": ["mcp__filesystem(write:/home/user)"],
89
"deny": []
910
}
1011
}

0 commit comments

Comments
 (0)