Skip to content

Commit 71a9067

Browse files
Merge branch 'main' into search-commit
2 parents 8364cd1 + 8a48d07 commit 71a9067

19 files changed

Lines changed: 2583 additions & 222 deletions

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,23 @@ The following sets of tools are available:
730730

731731
<summary><picture><source media="(prefers-color-scheme: dark)" srcset="pkg/octicons/icons/comment-discussion-dark.png"><source media="(prefers-color-scheme: light)" srcset="pkg/octicons/icons/comment-discussion-light.png"><img src="pkg/octicons/icons/comment-discussion-light.png" width="20" height="20" alt="comment-discussion"></picture> Discussions</summary>
732732

733+
- **discussion_comment_write** - Manage discussion comments
734+
- **Required OAuth Scopes**: `repo`
735+
- `body`: Comment content (required for 'add', 'reply', and 'update' methods) (string, optional)
736+
- `commentNodeID`: The Node ID of the discussion comment (required for 'reply', 'update', 'delete', 'mark_answer', and 'unmark_answer' methods). For 'reply', this is the top-level comment to reply to; GitHub Discussions only support one level of nesting. (string, optional)
737+
- `discussionNumber`: Discussion number (required for 'add' and 'reply' methods) (number, optional)
738+
- `method`: Write operation to perform on a discussion comment.
739+
Options are:
740+
- 'add' - adds a new top-level comment to a discussion.
741+
- 'reply' - replies to a top-level discussion comment (GitHub Discussions only support one level of nesting).
742+
- 'update' - updates an existing discussion comment.
743+
- 'delete' - deletes a discussion comment.
744+
- 'mark_answer' - marks a discussion comment as the answer (Q&A only).
745+
- 'unmark_answer' - unmarks a discussion comment as the answer (Q&A only).
746+
(string, required)
747+
- `owner`: Repository owner (required for 'add' and 'reply' methods) (string, optional)
748+
- `repo`: Repository name (required for 'add' and 'reply' methods) (string, optional)
749+
733750
- **get_discussion** - Get discussion
734751
- **Required OAuth Scopes**: `repo`
735752
- `discussionNumber`: Discussion Number (number, required)
@@ -740,6 +757,7 @@ The following sets of tools are available:
740757
- **Required OAuth Scopes**: `repo`
741758
- `after`: Cursor for pagination. Use the endCursor from the previous page's PageInfo for GraphQL APIs. (string, optional)
742759
- `discussionNumber`: Discussion Number (number, required)
760+
- `includeReplies`: When true, each top-level comment will include its replies nested within it (up to 100 replies per comment, which is the GitHub API maximum). Defaults to false. (boolean, optional)
743761
- `owner`: Repository owner (string, required)
744762
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
745763
- `repo`: Repository name (string, required)
@@ -1256,6 +1274,14 @@ The following sets of tools are available:
12561274
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
12571275
- `repo`: Repository name (string, required)
12581276

1277+
- **list_repository_collaborators** - List repository collaborators
1278+
- **Required OAuth Scopes**: `repo`
1279+
- `affiliation`: Filter by affiliation. Can be one of: 'outside' (outside collaborators), 'direct' (all with permissions regardless of org membership), 'all' (all collaborators). Default: 'all' (string, optional)
1280+
- `owner`: Repository owner (string, required)
1281+
- `page`: Page number for pagination (default 1, min 1) (number, optional)
1282+
- `perPage`: Results per page for pagination (default 30, min 1, max 100) (number, optional)
1283+
- `repo`: Repository name (string, required)
1284+
12591285
- **list_tags** - List tags
12601286
- **Required OAuth Scopes**: `repo`
12611287
- `owner`: Repository owner (string, required)
@@ -1421,6 +1447,11 @@ The following sets of tools are available:
14211447

14221448
<summary>Copilot Spaces</summary>
14231449

1450+
- **Authentication note**
1451+
- Fine-grained PATs are not hidden by classic PAT scope filtering, so these tools may still appear even when the token cannot use them.
1452+
- For org-owned spaces, fine-grained PATs must be installed on the owning organization and include `organization_copilot_spaces: read`.
1453+
- If an org-owned space contains repository-backed resources, the token must also have access to every referenced repository or the space may be treated as not found.
1454+
14241455
- **get_copilot_space** - Get Copilot Space
14251456
- `owner`: The owner of the space. (string, required)
14261457
- `name`: The name of the space. (string, required)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"annotations": {
3+
"destructiveHint": true,
4+
"title": "Manage discussion comments"
5+
},
6+
"description": "Write operations for discussion comments.\nSupports adding top-level comments, replying to existing comments, updating comment content, deleting comments, and marking or unmarking comments as the answer.",
7+
"inputSchema": {
8+
"properties": {
9+
"body": {
10+
"description": "Comment content (required for 'add', 'reply', and 'update' methods)",
11+
"type": "string"
12+
},
13+
"commentNodeID": {
14+
"description": "The Node ID of the discussion comment (required for 'reply', 'update', 'delete', 'mark_answer', and 'unmark_answer' methods). For 'reply', this is the top-level comment to reply to; GitHub Discussions only support one level of nesting.",
15+
"type": "string"
16+
},
17+
"discussionNumber": {
18+
"description": "Discussion number (required for 'add' and 'reply' methods)",
19+
"type": "number"
20+
},
21+
"method": {
22+
"description": "Write operation to perform on a discussion comment.\nOptions are:\n- 'add' - adds a new top-level comment to a discussion.\n- 'reply' - replies to a top-level discussion comment (GitHub Discussions only support one level of nesting).\n- 'update' - updates an existing discussion comment.\n- 'delete' - deletes a discussion comment.\n- 'mark_answer' - marks a discussion comment as the answer (Q\u0026A only).\n- 'unmark_answer' - unmarks a discussion comment as the answer (Q\u0026A only).\n",
23+
"enum": [
24+
"add",
25+
"reply",
26+
"update",
27+
"delete",
28+
"mark_answer",
29+
"unmark_answer"
30+
],
31+
"type": "string"
32+
},
33+
"owner": {
34+
"description": "Repository owner (required for 'add' and 'reply' methods)",
35+
"type": "string"
36+
},
37+
"repo": {
38+
"description": "Repository name (required for 'add' and 'reply' methods)",
39+
"type": "string"
40+
}
41+
},
42+
"required": [
43+
"method"
44+
],
45+
"type": "object"
46+
},
47+
"name": "discussion_comment_write"
48+
}

pkg/github/__toolsnaps__/get_discussion_comments.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"description": "Discussion Number",
1515
"type": "number"
1616
},
17+
"includeReplies": {
18+
"description": "When true, each top-level comment will include its replies nested within it (up to 100 replies per comment, which is the GitHub API maximum). Defaults to false.",
19+
"type": "boolean"
20+
},
1721
"owner": {
1822
"description": "Repository owner",
1923
"type": "string"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"annotations": {
3+
"readOnlyHint": true,
4+
"title": "List repository collaborators"
5+
},
6+
"description": "List collaborators of a GitHub repository. Results are paginated; the response includes `nextPage`, `prevPage`, `firstPage`, and `lastPage` fields. To get the next page, use the `nextPage` value as the `page` parameter.",
7+
"inputSchema": {
8+
"properties": {
9+
"affiliation": {
10+
"description": "Filter by affiliation. Can be one of: 'outside' (outside collaborators), 'direct' (all with permissions regardless of org membership), 'all' (all collaborators). Default: 'all'",
11+
"enum": [
12+
"outside",
13+
"direct",
14+
"all"
15+
],
16+
"type": "string"
17+
},
18+
"owner": {
19+
"description": "Repository owner",
20+
"type": "string"
21+
},
22+
"page": {
23+
"description": "Page number for pagination (default 1, min 1)",
24+
"minimum": 1,
25+
"type": "number"
26+
},
27+
"perPage": {
28+
"description": "Results per page for pagination (default 30, min 1, max 100)",
29+
"maximum": 100,
30+
"minimum": 1,
31+
"type": "number"
32+
},
33+
"repo": {
34+
"description": "Repository name",
35+
"type": "string"
36+
}
37+
},
38+
"required": [
39+
"owner",
40+
"repo"
41+
],
42+
"type": "object"
43+
},
44+
"name": "list_repository_collaborators"
45+
}

pkg/github/context_tools_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,7 @@ func Test_GetMe_IFC_InsidersMode(t *testing.T) {
192192
require.NoError(t, err)
193193

194194
assert.Equal(t, "trusted", ifcMap["integrity"])
195-
confList, ok := ifcMap["confidentiality"].([]any)
196-
require.True(t, ok, "confidentiality should be a list")
197-
require.Len(t, confList, 1)
198-
assert.Equal(t, "public", confList[0])
195+
assert.Equal(t, "public", ifcMap["confidentiality"])
199196
})
200197
}
201198

0 commit comments

Comments
 (0)