@amonstack/gitea-mcp 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -2
- package/README.zh-CN.md +25 -2
- package/dist/assets/instructions.md +20 -3
- package/dist/assets/resources/field-reference.md +29 -0
- package/dist/assets/resources/tool-cookbook.md +16 -0
- package/dist/assets/skills/gitea-create-pull/SKILL.md +48 -0
- package/dist/assets/skills/gitea-find-pulls/SKILL.md +39 -0
- package/dist/assets/skills/gitea-merge-pull/SKILL.md +28 -0
- package/dist/assets/skills/gitea-summarize-pull/SKILL.md +23 -0
- package/dist/assets/skills/gitea-update-pull/SKILL.md +24 -0
- package/dist/git-config.d.ts +16 -0
- package/dist/git-config.js +76 -5
- package/dist/git-config.js.map +1 -1
- package/dist/gitea-client.d.ts +103 -0
- package/dist/gitea-client.js +109 -2
- package/dist/gitea-client.js.map +1 -1
- package/dist/server.js +144 -3
- package/dist/server.js.map +1 -1
- package/dist/tools.d.ts +87 -0
- package/dist/tools.js +74 -0
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -294,6 +294,23 @@ gitea-mcp
|
|
|
294
294
|
| `add_topic` | Add a single topic by name |
|
|
295
295
|
| `remove_topic` | Remove a single topic by name |
|
|
296
296
|
|
|
297
|
+
### Pull Requests
|
|
298
|
+
|
|
299
|
+
| Tool | Description |
|
|
300
|
+
|------|-------------|
|
|
301
|
+
| `list_pull_requests` | List pull requests in a repo (filter by state, labels, sort, milestone) |
|
|
302
|
+
| `get_pull_request` | Fetch one pull request by its number |
|
|
303
|
+
| `create_pull_request` | Create a pull request (title, head, base, body) |
|
|
304
|
+
| `update_pull_request` | Edit a pull request or close/reopen it (state: open \| closed) |
|
|
305
|
+
| `merge_pull_request` | Merge a pull request (strategy: merge \| squash \| rebase \| rebase-merge) — **irreversible** |
|
|
306
|
+
| `is_pull_merged` | Check whether a pull request has been merged |
|
|
307
|
+
| `list_pull_commits` | List the commits in a pull request |
|
|
308
|
+
| `list_pull_files` | List the files changed in a pull request |
|
|
309
|
+
|
|
310
|
+
> **Note:** a pull request shares its number space with issues (PR #N == Issue #N).
|
|
311
|
+
> Comments, labels, and milestones on a PR reuse the **issue** tools — pass the PR
|
|
312
|
+
> number as the `index`. Only PR-specific operations use the tools above.
|
|
313
|
+
|
|
297
314
|
### Repository Helpers
|
|
298
315
|
|
|
299
316
|
| Tool | Description |
|
|
@@ -312,8 +329,9 @@ through three channels:
|
|
|
312
329
|
- **Tool descriptions** — every tool's description flags its key risk (pagination,
|
|
313
330
|
label ID-vs-name, destructive scope) and a minimal usage example.
|
|
314
331
|
- **Prompts & resources** — workflow templates (`triage_issues`,
|
|
315
|
-
`summarize_issue`, `
|
|
316
|
-
|
|
332
|
+
`summarize_issue`, `triage_pull_requests`, `summarize_pull_request`,
|
|
333
|
+
`audit_labels`, `milestone_report`) and on-demand reference docs (field
|
|
334
|
+
reference, label guide, tool cookbook) for clients that surface them.
|
|
317
335
|
|
|
318
336
|
### Action skills
|
|
319
337
|
|
|
@@ -334,6 +352,11 @@ say, delete instructions while creating). Install them with the
|
|
|
334
352
|
| `gitea-plan-milestones` | creating / editing / closing milestones |
|
|
335
353
|
| `gitea-resolve-repo` | resolving owner/repo or listing repositories |
|
|
336
354
|
| `gitea-configure` | fixing the connection — instance URL, token, or 401/403 errors |
|
|
355
|
+
| `gitea-find-pulls` | discovering / reading pull requests, their commits and files |
|
|
356
|
+
| `gitea-create-pull` | creating a pull request (after a duplicate check) |
|
|
357
|
+
| `gitea-update-pull` | editing fields, closing without merging, reopening, WIP toggle |
|
|
358
|
+
| `gitea-merge-pull` | merging a pull request (after mergeability check + user confirmation) |
|
|
359
|
+
| `gitea-summarize-pull` | reading and summarizing a pull request for review |
|
|
337
360
|
|
|
338
361
|
Each skill is a short, AI-facing action flow (purpose, when to use, when not to,
|
|
339
362
|
rules, and what to check first). The create, comment, and milestone skills also
|
package/README.zh-CN.md
CHANGED
|
@@ -281,6 +281,23 @@ gitea-mcp
|
|
|
281
281
|
| `add_topic` | 按名称添加单个主题 |
|
|
282
282
|
| `remove_topic` | 按名称移除单个主题 |
|
|
283
283
|
|
|
284
|
+
### 合并请求 (Pull Requests)
|
|
285
|
+
|
|
286
|
+
| 工具 | 说明 |
|
|
287
|
+
|------|------|
|
|
288
|
+
| `list_pull_requests` | 列出仓库的 PR(按状态、标签、排序、里程碑筛选) |
|
|
289
|
+
| `get_pull_request` | 按 PR 编号获取单个 PR 详情 |
|
|
290
|
+
| `create_pull_request` | 创建 PR(标题、源分支 head、目标分支 base、正文) |
|
|
291
|
+
| `update_pull_request` | 编辑 PR 或关闭/重开(state: open \| closed) |
|
|
292
|
+
| `merge_pull_request` | 合并 PR(策略: merge \| squash \| rebase \| rebase-merge)—— **不可逆** |
|
|
293
|
+
| `is_pull_merged` | 检查 PR 是否已合并 |
|
|
294
|
+
| `list_pull_commits` | 列出 PR 中的提交 |
|
|
295
|
+
| `list_pull_files` | 列出 PR 变更的文件 |
|
|
296
|
+
|
|
297
|
+
> **说明:** PR 与 issue 共享编号空间(PR #N == Issue #N)。PR 的评论、标签、
|
|
298
|
+
> 里程碑复用 **issue** 工具——把 PR 编号当作 `index` 传入即可。只有 PR 专属操作
|
|
299
|
+
> 才使用上表工具。
|
|
300
|
+
|
|
284
301
|
### 仓库辅助 (Repository Helpers)
|
|
285
302
|
|
|
286
303
|
| 工具 | 说明 |
|
|
@@ -298,8 +315,9 @@ gitea-mcp
|
|
|
298
315
|
- **工具描述** —— 每个工具的描述都标出其关键风险(分页、标签 ID 与名称、破坏性
|
|
299
316
|
作用范围)和最小用法示例。
|
|
300
317
|
- **Prompts 与 Resources** —— 工作流模板(`triage_issues`、`summarize_issue`、
|
|
301
|
-
`audit_labels
|
|
302
|
-
|
|
318
|
+
`triage_pull_requests`、`summarize_pull_request`、`audit_labels`、
|
|
319
|
+
`milestone_report`)与按需参考文档(字段参考、标签指南、工具食谱),供支持的
|
|
320
|
+
客户端使用。
|
|
303
321
|
|
|
304
322
|
### 动作技能
|
|
305
323
|
|
|
@@ -319,6 +337,11 @@ gitea-mcp
|
|
|
319
337
|
| `gitea-plan-milestones` | 创建 / 编辑 / 关闭里程碑 |
|
|
320
338
|
| `gitea-resolve-repo` | 解析 owner/repo 或列出仓库 |
|
|
321
339
|
| `gitea-configure` | 修复连接——实例地址、令牌或 401/403 报错 |
|
|
340
|
+
| `gitea-find-pulls` | 发现 / 读取 PR 及其提交与变更文件 |
|
|
341
|
+
| `gitea-create-pull` | 创建 PR(先做查重) |
|
|
342
|
+
| `gitea-update-pull` | 编辑字段、关闭不合并、重开、WIP 切换 |
|
|
343
|
+
| `gitea-merge-pull` | 合并 PR(先检查可合并性并经用户确认) |
|
|
344
|
+
| `gitea-summarize-pull` | 读取并总结 PR 以供审查 |
|
|
322
345
|
|
|
323
346
|
每个技能都是面向 AI 的简短动作流程(目的、何时用、何时不用、规则、先检查什么)。
|
|
324
347
|
创建、评论、里程碑三类技能还内嵌**正文模板**(bug / 新功能 / 性能 issue、评论、
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Gitea MCP — usage strategy
|
|
2
2
|
|
|
3
|
-
You manage Gitea issues, comments, labels, milestones,
|
|
4
|
-
Every tool returns Gitea's JSON verbatim
|
|
5
|
-
correctly.
|
|
3
|
+
You manage Gitea issues, comments, labels, milestones, repository topics, and
|
|
4
|
+
pull requests through this MCP server. Every tool returns Gitea's JSON verbatim
|
|
5
|
+
as text. Follow these rules to use them correctly.
|
|
6
6
|
|
|
7
7
|
## Config is auto-discovered from git (env vars optional)
|
|
8
8
|
|
|
@@ -58,10 +58,27 @@ These are irreversible on most Gitea instances (no trash/recycle):
|
|
|
58
58
|
- `delete_issue`, `delete_label`, `delete_milestone`, `delete_comment`
|
|
59
59
|
- `clear_issue_labels`, `replace_issue_labels` (replaces the ENTIRE label set)
|
|
60
60
|
- `replace_topics` (replaces the ENTIRE topic set; pass `[]` to clear all topics)
|
|
61
|
+
- `merge_pull_request` (IRREVERSIBLE — merging is final; confirm the index and strategy)
|
|
61
62
|
|
|
62
63
|
Confirm the target id/index and scope with the user before calling. For labels,
|
|
63
64
|
`replace_issue_labels` overwrites — read current labels first if any must survive.
|
|
64
65
|
|
|
66
|
+
## Pull requests — PR is an Issue superset
|
|
67
|
+
|
|
68
|
+
A pull request shares its number space with issues (PR #N == Issue #N). Comments,
|
|
69
|
+
labels, and milestones on a PR reuse the **issue** tools — pass the PR `index` to
|
|
70
|
+
`list_comments`, `create_comment`, `add_issue_labels`, etc. Only PR-specific
|
|
71
|
+
operations (create/update/merge, commits, files, merge-check) use the
|
|
72
|
+
`*_pull_request` / `list_pull_*` tools.
|
|
73
|
+
|
|
74
|
+
- WIP / draft: Gitea blocks merges when the PR title starts with `WIP:`, `[WIP]`,
|
|
75
|
+
or `Draft:`. Toggle the prefix via `update_pull_request({ title })`.
|
|
76
|
+
- Close WITHOUT merging: `update_pull_request({ state: "closed" })` — the commits
|
|
77
|
+
stay on the head branch.
|
|
78
|
+
- Merge: `merge_pull_request` is IRREVERSIBLE. Check `is_pull_merged` first, confirm
|
|
79
|
+
`mergeable: true` via `get_pull_request`, and get explicit user approval before
|
|
80
|
+
choosing a `Do` strategy (merge / squash / rebase / rebase-merge).
|
|
81
|
+
|
|
65
82
|
## Search vs list
|
|
66
83
|
|
|
67
84
|
- `list_issues` — one repo, paginated, filterable by state/labels.
|
|
@@ -53,3 +53,32 @@ Use this to read results correctly and pick the right identifier.
|
|
|
53
53
|
`replace_topics` sends this object back to SET the whole set (empty array
|
|
54
54
|
clears all topics); `add_topic` / `remove_topic` operate on a single name and
|
|
55
55
|
return no body.
|
|
56
|
+
|
|
57
|
+
## PullRequest (from list_pull_requests / get_pull_request / create / update)
|
|
58
|
+
- `id` (number) — internal id. NOT used by tools; tools use `number`.
|
|
59
|
+
- `number` (number) — the PR index shown in the URL (#42). This is the `index`
|
|
60
|
+
passed to get/update/merge_pull_request and list_pull_commits/files. Shares the
|
|
61
|
+
number space with issues (PR #N == Issue #N — comments/labels reuse issue tools).
|
|
62
|
+
- `title` (string), `body` (string?), `state` ("open" | "closed")
|
|
63
|
+
- `html_url`, `url` (string)
|
|
64
|
+
- `labels` (Label[]), `assignee` (User?), `assignees` (User[]?), `milestone` (Milestone?)
|
|
65
|
+
- `user` (User) — PR author
|
|
66
|
+
- `base` / `head` (PullRequestBranch) — `{ label, ref, sha, repo }`. `head.ref` is the
|
|
67
|
+
source branch; `base.ref` is the target branch.
|
|
68
|
+
- `merged` (boolean?) — whether the PR has been merged
|
|
69
|
+
- `merged_at` (string?, ISO) — merge timestamp
|
|
70
|
+
- `mergeable` (boolean?) — whether Gitea can auto-merge (no conflicts). Check before
|
|
71
|
+
calling merge_pull_request.
|
|
72
|
+
- `draft` (boolean?) — draft / WIP status
|
|
73
|
+
- `created_at`, `updated_at` (string ISO); `closed_at` (string?, when closed)
|
|
74
|
+
|
|
75
|
+
## PullCommit (from list_pull_commits)
|
|
76
|
+
- `sha` (string), `html_url` (string)
|
|
77
|
+
- `commit.message` (string), `commit.author` ({ name, email, date? })
|
|
78
|
+
- `author` (User?) — the Gitea user, if linked
|
|
79
|
+
|
|
80
|
+
## PullFile (from list_pull_files)
|
|
81
|
+
- `sha` (string), `filename` (string) — path in the repo
|
|
82
|
+
- `status` (string) — "added" | "modified" | "deleted" | "renamed" | "copied"
|
|
83
|
+
- `additions`, `deletions`, `changes` (number) — line counts
|
|
84
|
+
- `html_url` (string) — link to the diff
|
|
@@ -44,6 +44,22 @@ Quick recipes for common goals. Always resolve owner/repo first (explicit args,
|
|
|
44
44
|
`replace_topics({ topics: ["go","mcp"] })` — REPLACES the whole set; pass `[]` to
|
|
45
45
|
clear. Confirm with the user before replacing.
|
|
46
46
|
|
|
47
|
+
## Pull requests
|
|
48
|
+
- List a repo's open PRs → `list_pull_requests({ state: "open", page: 1, limit: 50 })`,
|
|
49
|
+
page until a page returns < 50. Filter by `labels` (names) or `sort`.
|
|
50
|
+
- PRs across repos by keyword → `search_issues({ type: "pulls", query })`.
|
|
51
|
+
- One PR's full picture → `get_pull_request` (check `mergeable`, `merged`, `draft`),
|
|
52
|
+
then `list_pull_commits` + `list_pull_files` for scope, then `list_comments` for
|
|
53
|
+
the review thread (PR #N == Issue #N — comments are shared; one default page).
|
|
54
|
+
- Create a PR → `create_pull_request({ title, head, base, body? })`. Prefix title
|
|
55
|
+
with `WIP:` while in progress. For forks use `"owner:branch"` in `head`. Link an
|
|
56
|
+
issue with `Closes #123` in the body.
|
|
57
|
+
- Edit a PR → `update_pull_request({ index, title?, body?, state? })`. `state:
|
|
58
|
+
"closed"` closes WITHOUT merging. Remove the `WIP:` prefix to mark ready.
|
|
59
|
+
- Merge a PR (IRREVERSIBLE) → `is_pull_merged` first; `get_pull_request` to confirm
|
|
60
|
+
`mergeable: true`; get user approval; then `merge_pull_request({ index, Do })`.
|
|
61
|
+
`Do`: `merge` / `squash` / `rebase` / `rebase-merge`.
|
|
62
|
+
|
|
47
63
|
## Pagination pattern (all list tools)
|
|
48
64
|
```
|
|
49
65
|
page = 1
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitea-create-pull
|
|
3
|
+
description: Invoke to CREATE / OPEN a new Gitea pull request. The flow confirms the branch exists and checks for an existing open PR on the same head/base first, then creates. Do NOT invoke to edit/close (gitea-update-pull), merge (gitea-merge-pull), read/find (gitea-find-pulls), or post a review comment (gitea-comment-issue).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# gitea-create-pull
|
|
7
|
+
|
|
8
|
+
Open one new pull request after ruling out a duplicate. Tools: `list_pull_requests`, `create_pull_request`.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
- Resolve `owner`+`repo`: pass explicitly, else `GITEA_DEFAULT_OWNER`/`GITEA_DEFAULT_REPO`, else `resolve_repo` (gitea-resolve-repo). Never guess — wrong values create the PR in the wrong repo.
|
|
12
|
+
- The `head` (source) branch MUST already exist and contain the commits to merge; the `base` (target) branch is typically the default branch.
|
|
13
|
+
|
|
14
|
+
## Flow
|
|
15
|
+
1. DUPLICATE CHECK (always first): `list_pull_requests({ state: "open" })`. If an open PR with the same `head`/`base` already exists, comment on it (gitea-comment-issue) instead of creating a duplicate. Do NOT skip this — creation does not de-duplicate.
|
|
16
|
+
2. CREATE: `create_pull_request({ title, head, base, body? })`.
|
|
17
|
+
|
|
18
|
+
## create_pull_request
|
|
19
|
+
- RULES: `title`, `head`, and `base` are required. For cross-fork PRs use `"owner:branch"` in `head` (e.g. `"ake131998:feat/my-change"`). `body` is Markdown.
|
|
20
|
+
- Do NOT pass `labels` or `milestone` here: `labels` expect IDs (error-prone). Create WITHOUT them, then attach labels by name via `add_issue_labels` (gitea-label-issue — PR #N == Issue #N) and set the milestone via `update_pull_request`.
|
|
21
|
+
- WIP / draft: Gitea blocks merges when the title starts with `WIP:`, `[WIP]`, or `Draft:`. Prefix the title while work is in progress; remove the prefix when ready to merge (gitea-update-pull).
|
|
22
|
+
- CHECK FIRST: confirm no duplicate open PR (step 1), that `head` exists and is pushed, and that `owner`/`repo` are correct before writing.
|
|
23
|
+
- CHECK AFTER: the returned object's `number` is the new PR index; `mergeable` indicates whether Gitea can auto-merge it.
|
|
24
|
+
|
|
25
|
+
## Body template — standardize what you write into `body`
|
|
26
|
+
Always structure `body`. Ask the user for details if the change is not obvious. Drop a section only when it is genuinely empty; never invent data.
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
## Summary
|
|
30
|
+
<1-2 sentences: what this PR changes and why>
|
|
31
|
+
|
|
32
|
+
## Changes
|
|
33
|
+
- <bullet: specific change>
|
|
34
|
+
- <bullet: specific change>
|
|
35
|
+
|
|
36
|
+
## Related issues
|
|
37
|
+
Closes #<issue number>
|
|
38
|
+
|
|
39
|
+
## Checklist
|
|
40
|
+
- [ ] Tests added/updated
|
|
41
|
+
- [ ] Documentation updated
|
|
42
|
+
- [ ] Breaking changes noted below
|
|
43
|
+
|
|
44
|
+
## Breaking changes
|
|
45
|
+
<none, or describe>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Use `Closes #123` / `Fixes #123` in the body to auto-close the linked issue when the PR merges.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitea-find-pulls
|
|
3
|
+
description: Invoke to DISCOVER or READ Gitea pull requests — listing one repo's PRs, cross-repo PR search, reading a single PR, its commits, or its changed files. Do NOT invoke to create/edit/close/merge (gitea-create-pull / gitea-update-pull / gitea-merge-pull), or to read the comment discussion (gitea-summarize-pull).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# gitea-find-pulls
|
|
7
|
+
|
|
8
|
+
Read-only pull request discovery. Tools: `list_pull_requests`, `search_issues`, `get_pull_request`, `list_pull_commits`, `list_pull_files`.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
- Resolve `owner`+`repo` for `list_pull_requests`/`get_pull_request`/`list_pull_commits`/`list_pull_files`: pass explicitly, else `GITEA_DEFAULT_OWNER`/`GITEA_DEFAULT_REPO`, else `resolve_repo` (gitea-resolve-repo). Never guess — wrong values 404 or silently target the wrong repo.
|
|
12
|
+
- Paginate 1-based, `limit` ≤ 100. A page is final ONLY when it returns fewer than `limit` items. Always set `limit` (default page size is server-controlled).
|
|
13
|
+
|
|
14
|
+
## Choose the tool
|
|
15
|
+
- ONE repo's PRs, filtered by state/labels/sort/milestone → `list_pull_requests`.
|
|
16
|
+
- ACROSS repos by keyword → `search_issues({ type: "pulls" })` (global; no owner/repo).
|
|
17
|
+
- ONE PR's full detail (branches, mergeable, merged) → `get_pull_request`.
|
|
18
|
+
- Commits in one PR → `list_pull_commits`.
|
|
19
|
+
- Files changed in one PR → `list_pull_files`.
|
|
20
|
+
|
|
21
|
+
## list_pull_requests
|
|
22
|
+
- RULES: `labels` = comma-separated NAMES, AND-matched; a mistyped or non-existent name returns EMPTY with no error. `sort` options: `oldest`, `recentupdate`, `leastupdate`, `mostcomment`, `leastcomment`, `priority`. `state` default is `open`.
|
|
23
|
+
- CHECK FIRST: confirm label names via `list_labels` (gitea-manage-labels) before filtering by labels.
|
|
24
|
+
- CHECK AFTER: if `length === limit`, fetch the next page before treating the list as complete.
|
|
25
|
+
|
|
26
|
+
## search_issues
|
|
27
|
+
- RULES: GLOBAL — no owner/repo; each result carries its own `repository`. Set `type: "pulls"` to search only PRs. `labels` = names. `query` matches title + body.
|
|
28
|
+
- CHECK FIRST: set `type` deliberately.
|
|
29
|
+
- CHECK AFTER: page fully if completeness matters.
|
|
30
|
+
|
|
31
|
+
## get_pull_request
|
|
32
|
+
- RULES: pass `index` = the PR `number` (URL #42 → 42), never the internal `id`.
|
|
33
|
+
- NOTE: the response carries `mergeable` (boolean), `merged` (boolean), `merged_at`, `draft`, plus `base`/`head` branch objects. Check `mergeable` before attempting a merge (gitea-merge-pull).
|
|
34
|
+
|
|
35
|
+
## list_pull_commits / list_pull_files
|
|
36
|
+
- RULES: pass the PR `index`. Both paginate 1-based.
|
|
37
|
+
- Commits: each has `sha`, `html_url`, `commit.message`, optional `author`.
|
|
38
|
+
- Files: each has `filename`, `status` (added/modified/deleted/renamed), `additions`, `deletions`, `changes`, `html_url`.
|
|
39
|
+
- CHECK AFTER: if `length === limit`, fetch the next page.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitea-merge-pull
|
|
3
|
+
description: Invoke to MERGE one Gitea pull request after confirming it is mergeable and the user has explicitly approved the strategy. IRREVERSIBLE. Do NOT invoke to create (gitea-create-pull), edit/close without merging (gitea-update-pull), find/read (gitea-find-pulls), or check merge status only (gitea-find-pulls get_pull_request).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# gitea-merge-pull
|
|
7
|
+
|
|
8
|
+
Merge one pull request. IRREVERSIBLE. Tools: `get_pull_request`, `is_pull_merged`, `merge_pull_request`.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
- Resolve `owner`+`repo`: pass explicitly, else `GITEA_DEFAULT_OWNER`/`GITEA_DEFAULT_REPO`, else `resolve_repo` (gitea-resolve-repo).
|
|
12
|
+
- This is DESTRUCTIVE and IRREVERSIBLE — merging is final. Always confirm the index, the strategy, and the user's approval BEFORE calling `merge_pull_request`.
|
|
13
|
+
|
|
14
|
+
## Flow
|
|
15
|
+
1. CHECK MERGED: `is_pull_merged({ index })` — if already merged, STOP and report; do not attempt a redundant merge.
|
|
16
|
+
2. CHECK MERGEABLE: `get_pull_request({ index })` — confirm `mergeable: true`, `state: "open"`, and that the PR is not `draft` or WIP-titled. If `mergeable` is false or null, STOP — conflicts must be resolved on the branch first.
|
|
17
|
+
3. CONFIRM: state the index, the chosen `Do` strategy, and ask the user for explicit approval.
|
|
18
|
+
4. MERGE: `merge_pull_request({ index, Do, MergeTitleField?, MergeMessageField?, SHA? })`.
|
|
19
|
+
|
|
20
|
+
## merge_pull_request
|
|
21
|
+
- RULES: `Do` is required and selects the strategy:
|
|
22
|
+
- `merge` — creates a merge commit (preserves all individual commits).
|
|
23
|
+
- `squash` — squashes all commits into one on the base branch.
|
|
24
|
+
- `rebase` — rebases commits onto the base branch, then fast-forwards.
|
|
25
|
+
- `rebase-merge` — rebases commits, then creates a merge commit.
|
|
26
|
+
- `MergeTitleField` / `MergeMessageField` customize the merge commit message. `SHA` pins the expected HEAD — the merge FAILS if the branch moved since (guards against racing pushes).
|
|
27
|
+
- CHECK FIRST: `is_pull_merged` (step 1) + `get_pull_request` `mergeable` (step 2) + user confirmation (step 3).
|
|
28
|
+
- CHECK AFTER: the tool returns a text confirmation. If it errors with 409, the PR is not mergeable (conflicts or already merged) — re-read `get_pull_request` and do NOT retry blindly.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitea-summarize-pull
|
|
3
|
+
description: Invoke to READ and SUMMARIZE a pull request — the PR body, commits, changed files, and comment thread. Produces a review-oriented summary (what it changes, mergeability, open questions). Do NOT invoke to create/edit/merge/close a PR (gitea-create-pull / gitea-update-pull / gitea-merge-pull), or to post a comment (gitea-comment-issue).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# gitea-summarize-pull
|
|
7
|
+
|
|
8
|
+
Read a pull request and its discussion, then synthesize. Tools: `get_pull_request`, `list_pull_commits`, `list_pull_files`, `list_comments`.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
- Resolve `owner`+`repo`: pass explicitly, else `GITEA_DEFAULT_OWNER`/`GITEA_DEFAULT_REPO`, else `resolve_repo` (gitea-resolve-repo).
|
|
12
|
+
|
|
13
|
+
## Flow
|
|
14
|
+
1. `get_pull_request({ index })` — `index` = PR `number` (URL #N → N), never the internal `id`. Read title, body, `base`/`head`, `mergeable`, `merged`, `draft`, labels, milestone.
|
|
15
|
+
2. `list_pull_commits({ index })` — the commit history (page if `length === limit`).
|
|
16
|
+
3. `list_pull_files({ index })` — the diff scope: filenames, statuses, additions/deletions (page if `length === limit`).
|
|
17
|
+
4. `list_comments({ index })` — the review discussion. PR #N == Issue #N — the comment endpoints are shared.
|
|
18
|
+
|
|
19
|
+
## list_comments — TRUNCATION TRAP
|
|
20
|
+
- This tool passes NO page/limit and returns at most the server's default page size. For long review threads the list is SILENTLY TRUNCATED. If the `comments` count (from `get_pull_request`) exceeds the number returned, warn that part of the thread is missing and do NOT claim a complete summary.
|
|
21
|
+
|
|
22
|
+
## Synthesis
|
|
23
|
+
- Report: the PR state (open/closed/merged/draft), WHAT it changes (from commits + files), the mergeability/conflict status, then the thread's consensus / decisions / open questions. Attribute by author. Flag unresolved review feedback or blocking questions explicitly — do not paper over disagreement. End with one recommended NEXT ACTION (merge / request changes / close).
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitea-update-pull
|
|
3
|
+
description: Invoke to EDIT fields, CLOSE (without merging), REOPEN, retarget, or toggle WIP on ONE existing Gitea pull request. Do NOT invoke to create (gitea-create-pull), merge (gitea-merge-pull — destructive), find/read (gitea-find-pulls), or change a single label (gitea-label-issue).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# gitea-update-pull
|
|
7
|
+
|
|
8
|
+
Edit one pull request's fields or change its state. Tools: `get_pull_request`, `update_pull_request`.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
- Resolve `owner`+`repo`: pass explicitly, else `GITEA_DEFAULT_OWNER`/`GITEA_DEFAULT_REPO`, else `resolve_repo` (gitea-resolve-repo).
|
|
12
|
+
- There is NO optimistic locking — always read current state first.
|
|
13
|
+
|
|
14
|
+
## Flow
|
|
15
|
+
1. READ CURRENT: `get_pull_request({ index })` — `index` = PR `number` (URL #N → N), never the internal `id`.
|
|
16
|
+
2. APPLY: `update_pull_request({ index, ...changedFields })`.
|
|
17
|
+
|
|
18
|
+
## update_pull_request
|
|
19
|
+
- RULES: PATCH — only fields you pass change; omit = unchanged. To CLEAR a field pass its EMPTY form, do NOT omit it: `milestone: 0` clears the milestone, `assignees: []` clears assignees. Use `assignees` (array), not the deprecated `assignee`. State values are `open` | `closed`.
|
|
20
|
+
- CLOSE WITHOUT MERGING: `update_pull_request({ index, state: "closed" })`. This closes the PR but does NOT merge it — the commits stay on the `head` branch. Reopen later with `state: "open"`.
|
|
21
|
+
- WIP TOGGLE: to mark work-in-progress, prefix the title with `WIP:` or `[WIP]`. To mark ready, remove the prefix. Pass the full new `title`.
|
|
22
|
+
- RETARGET: `base` changes the target branch. RARELY REVERSIBLE — confirm with the user before retargeting; it can invalidate reviews and conflict checks.
|
|
23
|
+
- NOT FOR single-label changes: `labels` here are IDs and REPLACE the entire set — to add/remove one label use `add_issue_labels` / `remove_issue_label` (gitea-label-issue, PR #N == Issue #N).
|
|
24
|
+
- CHECK FIRST: `get_pull_request` for current values if state may have changed since your last read; state the intended change to the user before writing.
|
package/dist/git-config.d.ts
CHANGED
|
@@ -70,6 +70,22 @@ export declare function readTokenFromGitConfig(content: string, baseUrl: string)
|
|
|
70
70
|
export declare function parseGitCredentials(content: string, host: string): ParsedCredentialEntry[];
|
|
71
71
|
/** Default credential-store paths: `$XDG_CONFIG_HOME/git/credentials` then `~/.git-credentials`. */
|
|
72
72
|
export declare function defaultCredentialsPaths(): string[];
|
|
73
|
+
/**
|
|
74
|
+
* Resolve the absolute path to the git config file for a working directory,
|
|
75
|
+
* handling both normal repositories and linked working trees (`git worktree`).
|
|
76
|
+
*
|
|
77
|
+
* In a normal repo `<cwd>/.git` is a directory and config lives at
|
|
78
|
+
* `<cwd>/.git/config`. In a linked worktree `<cwd>/.git` is a FILE whose
|
|
79
|
+
* `gitdir: <path>` line points at a private per-worktree directory; that
|
|
80
|
+
* directory's `commondir` file (absolute, or relative to itself) points at the
|
|
81
|
+
* shared common directory where `config` actually lives. A submodule uses the
|
|
82
|
+
* same `gitdir:` pointer but has no `commondir`, so its config is read directly
|
|
83
|
+
* from the pointed-to directory.
|
|
84
|
+
*
|
|
85
|
+
* When no `.git` exists at all the conventional path is returned so the caller
|
|
86
|
+
* can treat the missing file as empty content.
|
|
87
|
+
*/
|
|
88
|
+
export declare function resolveGitConfigPath(cwd: string): Promise<string>;
|
|
73
89
|
/**
|
|
74
90
|
* Discover the Gitea connection config from env + the local git context.
|
|
75
91
|
*
|
package/dist/git-config.js
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { join } from "node:path";
|
|
2
|
+
import { join, isAbsolute, resolve } from "node:path";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { orderSchemesForCredentialStore, } from "./credentials.js";
|
|
5
|
+
/**
|
|
6
|
+
* Sanitize an owner/repo segment extracted from file content by retaining
|
|
7
|
+
* only characters valid in Gitea repository names (alphanumeric, dot, dash,
|
|
8
|
+
* underscore). Returns null when nothing remains, signalling the caller to
|
|
9
|
+
* discard the remote. This breaks the CodeQL file-access-to-http taint chain
|
|
10
|
+
* at the source rather than at the fetch call site.
|
|
11
|
+
*/
|
|
12
|
+
function sanitizeSegment(value) {
|
|
13
|
+
const sanitized = value.replace(/[^a-zA-Z0-9._-]/g, "");
|
|
14
|
+
return sanitized || null;
|
|
15
|
+
}
|
|
5
16
|
/**
|
|
6
17
|
* Parse a git remote URL into host/baseUrl/owner/repo. Accepts `ssh://`, the
|
|
7
18
|
* scp-like `user@host:owner/repo` form, and `http(s)://`. SSH URLs derive an
|
|
@@ -13,18 +24,30 @@ export function parseGitRemoteUrl(url, remote = "origin") {
|
|
|
13
24
|
let m = u.match(/^ssh:\/\/(?:[^@/\s]+@)?([^:/\s]+)(?::\d+)?\/([^/\s]+)\/([^/\s]+?)(?:\.git)?$/);
|
|
14
25
|
if (m) {
|
|
15
26
|
const [, host, owner, repo] = m;
|
|
16
|
-
|
|
27
|
+
const so = sanitizeSegment(owner);
|
|
28
|
+
const sr = sanitizeSegment(repo);
|
|
29
|
+
if (!so || !sr)
|
|
30
|
+
return null;
|
|
31
|
+
return { remote, url: u, host, baseUrl: `https://${host}`, owner: so, repo: sr };
|
|
17
32
|
}
|
|
18
33
|
m = u.match(/^(https?:)\/\/(?:[^@/\s]+@)?([^:/\s]+)(?::(\d+))?\/([^/\s]+)\/([^/\s]+?)(?:\.git)?$/);
|
|
19
34
|
if (m) {
|
|
20
35
|
const [, scheme, host, port, owner, repo] = m;
|
|
36
|
+
const so = sanitizeSegment(owner);
|
|
37
|
+
const sr = sanitizeSegment(repo);
|
|
38
|
+
if (!so || !sr)
|
|
39
|
+
return null;
|
|
21
40
|
const baseUrl = port ? `${scheme}//${host}:${port}` : `${scheme}//${host}`;
|
|
22
|
-
return { remote, url: u, host: port ? `${host}:${port}` : host, baseUrl, owner, repo };
|
|
41
|
+
return { remote, url: u, host: port ? `${host}:${port}` : host, baseUrl, owner: so, repo: sr };
|
|
23
42
|
}
|
|
24
43
|
m = u.match(/^(?:[^@/\s]+@)?([^@:/\s]+):([^/\s]+)\/([^/\s]+?)(?:\.git)?$/);
|
|
25
44
|
if (m) {
|
|
26
45
|
const [, host, owner, repo] = m;
|
|
27
|
-
|
|
46
|
+
const so = sanitizeSegment(owner);
|
|
47
|
+
const sr = sanitizeSegment(repo);
|
|
48
|
+
if (!so || !sr)
|
|
49
|
+
return null;
|
|
50
|
+
return { remote, url: u, host, baseUrl: `https://${host}`, owner: so, repo: sr };
|
|
28
51
|
}
|
|
29
52
|
return null;
|
|
30
53
|
}
|
|
@@ -160,6 +183,53 @@ async function readOptionalFile(path) {
|
|
|
160
183
|
return "";
|
|
161
184
|
}
|
|
162
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Resolve the absolute path to the git config file for a working directory,
|
|
188
|
+
* handling both normal repositories and linked working trees (`git worktree`).
|
|
189
|
+
*
|
|
190
|
+
* In a normal repo `<cwd>/.git` is a directory and config lives at
|
|
191
|
+
* `<cwd>/.git/config`. In a linked worktree `<cwd>/.git` is a FILE whose
|
|
192
|
+
* `gitdir: <path>` line points at a private per-worktree directory; that
|
|
193
|
+
* directory's `commondir` file (absolute, or relative to itself) points at the
|
|
194
|
+
* shared common directory where `config` actually lives. A submodule uses the
|
|
195
|
+
* same `gitdir:` pointer but has no `commondir`, so its config is read directly
|
|
196
|
+
* from the pointed-to directory.
|
|
197
|
+
*
|
|
198
|
+
* When no `.git` exists at all the conventional path is returned so the caller
|
|
199
|
+
* can treat the missing file as empty content.
|
|
200
|
+
*/
|
|
201
|
+
export async function resolveGitConfigPath(cwd) {
|
|
202
|
+
const dotGit = join(cwd, ".git");
|
|
203
|
+
const conventionalConfig = join(dotGit, "config");
|
|
204
|
+
// Read .git in a single operation to avoid a TOCTOU race: a separate
|
|
205
|
+
// stat + readFile would let the entry be swapped between check and use.
|
|
206
|
+
// EISDIR means .git is a directory (normal repo); ENOENT means absent.
|
|
207
|
+
let gitFile;
|
|
208
|
+
try {
|
|
209
|
+
gitFile = await readFile(dotGit, "utf-8");
|
|
210
|
+
}
|
|
211
|
+
catch (err) {
|
|
212
|
+
const code = err.code;
|
|
213
|
+
if (code === "EISDIR" || code === "ENOENT")
|
|
214
|
+
return conventionalConfig;
|
|
215
|
+
throw err;
|
|
216
|
+
}
|
|
217
|
+
// .git is a file — parse the gitdir pointer (worktree / submodule).
|
|
218
|
+
const m = gitFile.match(/^gitdir:\s*(.+?)\s*$/m);
|
|
219
|
+
if (!m)
|
|
220
|
+
return conventionalConfig;
|
|
221
|
+
const gitdir = isAbsolute(m[1]) ? m[1] : resolve(cwd, m[1]);
|
|
222
|
+
const commondirRaw = await readOptionalFile(join(gitdir, "commondir"));
|
|
223
|
+
const commondirTrimmed = commondirRaw.trim();
|
|
224
|
+
if (commondirTrimmed) {
|
|
225
|
+
const common = isAbsolute(commondirTrimmed)
|
|
226
|
+
? commondirTrimmed
|
|
227
|
+
: resolve(gitdir, commondirTrimmed);
|
|
228
|
+
return join(common, "config");
|
|
229
|
+
}
|
|
230
|
+
// Submodule (gitdir without commondir): config lives in the gitdir itself.
|
|
231
|
+
return join(gitdir, "config");
|
|
232
|
+
}
|
|
163
233
|
/**
|
|
164
234
|
* Build a `CandidateCredential` from a parsed credential-store entry.
|
|
165
235
|
*
|
|
@@ -219,7 +289,8 @@ export async function discoverConfig(options = {}) {
|
|
|
219
289
|
const cwd = options.cwd ?? process.cwd();
|
|
220
290
|
const env = options.env ?? process.env;
|
|
221
291
|
const envBaseUrl = env.GITEA_BASE_URL;
|
|
222
|
-
const
|
|
292
|
+
const gitConfigPath = await resolveGitConfigPath(cwd);
|
|
293
|
+
const gitConfigContent = await readOptionalFile(gitConfigPath);
|
|
223
294
|
const parsedRemotes = parseRemotes(gitConfigContent);
|
|
224
295
|
const selected = selectRemote(parsedRemotes);
|
|
225
296
|
const baseUrl = envBaseUrl ?? selected?.baseUrl;
|
package/dist/git-config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-config.js","sourceRoot":"","sources":["../src/git-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,I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