Repository navigation
Expand file tree
/
Copy pathherdr-plugin.toml
More file actions
200 lines (168 loc) · 6.56 KB
/
Copy pathherdr-plugin.toml
File metadata and controls
200 lines (168 loc) · 6.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
id = "jhochenbaum.hunkdiff"
name = "hunk"
version = "0.5.0"
# Requires plugin-root-relative action commands and reliable agent prompt submission from Herdr 0.8.
min_herdr_version = "0.8.0"
description = "Review agent-authored diffs in hunk, and send your inline comments back to the agent that wrote them."
platforms = ["macos", "linux", "windows"]
# Build steps inherit the top-level platforms.
[[build]]
command = ["node", "scripts/install-deps.mjs"]
[[build]]
command = ["node", "scripts/run-script.mjs", "build"]
# Global socket subscriptions require a pane id, so each event runs a short-lived manifest hook.
# Herdr runs hooks from the plugin root, so direct argv needs no shell expansion.
[[events]]
on = "pane.agent_status_changed"
command = ["node", "dist/bin/event.js"]
[[events]]
on = "pane.exited"
command = ["node", "dist/bin/event.js"]
[[events]]
on = "pane.closed"
command = ["node", "dist/bin/event.js"]
[[events]]
on = "worktree.removed"
command = ["node", "dist/bin/event.js"]
# Panes run from the reviewed worktree, so the plugin root comes from HERDR_PLUGIN_ROOT.
# POSIX panes expand it with sh. Windows panes read it in node instead of cmd: Windows argv
# quoting escapes embedded quotes as \" which cmd does not parse, and an unquoted path breaks on
# spaces. The node -e argument has no spaces or double quotes, so it passes through unquoted.
# Herdr requires unique pane ids; each mode therefore has POSIX and Windows entries.
[[panes]]
id = "review"
title = "hunk review"
placement = "split"
platforms = ["macos", "linux"]
command = ["sh", "-c", "exec node \"$HERDR_PLUGIN_ROOT/dist/bin/pane.js\" review"]
[[panes]]
id = "review-windows"
title = "hunk review"
placement = "split"
platforms = ["windows"]
command = ["node", "-e", "process.argv.splice(1,0,require('path').join(process.env.HERDR_PLUGIN_ROOT,'dist','bin','pane.js'));import(require('url').pathToFileURL(process.argv[1]).href)", "review"]
[[panes]]
id = "review-staged"
title = "hunk review (staged)"
placement = "split"
platforms = ["macos", "linux"]
command = ["sh", "-c", "exec node \"$HERDR_PLUGIN_ROOT/dist/bin/pane.js\" review:staged"]
[[panes]]
id = "review-staged-windows"
title = "hunk review (staged)"
placement = "split"
platforms = ["windows"]
command = ["node", "-e", "process.argv.splice(1,0,require('path').join(process.env.HERDR_PLUGIN_ROOT,'dist','bin','pane.js'));import(require('url').pathToFileURL(process.argv[1]).href)", "review:staged"]
[[panes]]
id = "review-branch"
title = "hunk review (branch)"
placement = "split"
platforms = ["macos", "linux"]
command = ["sh", "-c", "exec node \"$HERDR_PLUGIN_ROOT/dist/bin/pane.js\" review:branch"]
[[panes]]
id = "review-branch-windows"
title = "hunk review (branch)"
placement = "split"
platforms = ["windows"]
command = ["node", "-e", "process.argv.splice(1,0,require('path').join(process.env.HERDR_PLUGIN_ROOT,'dist','bin','pane.js'));import(require('url').pathToFileURL(process.argv[1]).href)", "review:branch"]
[[panes]]
id = "review-commit"
title = "hunk review (commit)"
placement = "split"
platforms = ["macos", "linux"]
command = ["sh", "-c", "exec node \"$HERDR_PLUGIN_ROOT/dist/bin/pane.js\" review:commit"]
[[panes]]
id = "review-commit-windows"
title = "hunk review (commit)"
placement = "split"
platforms = ["windows"]
command = ["node", "-e", "process.argv.splice(1,0,require('path').join(process.env.HERDR_PLUGIN_ROOT,'dist','bin','pane.js'));import(require('url').pathToFileURL(process.argv[1]).href)", "review:commit"]
[[panes]]
id = "review-stash"
title = "hunk review (stash)"
placement = "split"
platforms = ["macos", "linux"]
command = ["sh", "-c", "exec node \"$HERDR_PLUGIN_ROOT/dist/bin/pane.js\" review:stash"]
[[panes]]
id = "review-stash-windows"
title = "hunk review (stash)"
placement = "split"
platforms = ["windows"]
command = ["node", "-e", "process.argv.splice(1,0,require('path').join(process.env.HERDR_PLUGIN_ROOT,'dist','bin','pane.js'));import(require('url').pathToFileURL(process.argv[1]).href)", "review:stash"]
[[actions]]
id = "review"
title = "hunk: review changes"
contexts = ["workspace", "pane"]
command = ["node", "dist/bin/action.js", "review"]
[[actions]]
id = "review:staged"
title = "hunk: review staged changes"
contexts = ["workspace"]
command = ["node", "dist/bin/action.js", "review:staged"]
[[actions]]
id = "review:branch"
title = "hunk: review this branch against its base"
contexts = ["workspace", "pane"]
command = ["node", "dist/bin/action.js", "review:branch"]
[[actions]]
id = "review:commit"
title = "hunk: review the last commit (or a clicked GitHub commit link)"
contexts = ["workspace"]
command = ["node", "dist/bin/action.js", "review:commit"]
[[actions]]
id = "send-review"
title = "hunk: send review to agent"
contexts = ["pane"]
command = ["node", "dist/bin/action.js", "send-review"]
[[actions]]
id = "reload"
title = "hunk: reload the open review"
contexts = ["workspace", "pane"]
command = ["node", "dist/bin/action.js", "reload"]
[[actions]]
id = "close-review"
title = "hunk: close the review pane"
contexts = ["pane", "workspace"]
command = ["node", "dist/bin/action.js", "close-review"]
[[actions]]
id = "setup-keys"
title = "hunk: install default keybindings"
contexts = ["workspace"]
command = ["node", "dist/bin/action.js", "setup-keys"]
[[actions]]
id = "remove-keys"
title = "hunk: remove default keybindings"
contexts = ["workspace"]
command = ["node", "dist/bin/action.js", "remove-keys"]
[[actions]]
id = "review:stash"
title = "hunk: review the most recent stash entry"
contexts = ["workspace"]
command = ["node", "dist/bin/action.js", "review:stash"]
[[actions]]
id = "next-comment"
title = "hunk: go to the next review comment"
contexts = ["pane", "workspace"]
command = ["node", "dist/bin/action.js", "next-comment"]
[[actions]]
id = "prev-comment"
title = "hunk: go to the previous review comment"
contexts = ["pane", "workspace"]
command = ["node", "dist/bin/action.js", "prev-comment"]
# Git setup is automatic; jj and sl only expose interactive config editing, so actions give snippets.
[[actions]]
id = "install-pager"
title = "hunk: set up hunk as your VCS pager (git automatically, jj and sl by hand)"
contexts = ["workspace"]
command = ["node", "dist/bin/action.js", "install-pager"]
[[actions]]
id = "uninstall-pager"
title = "hunk: stop using hunk as your VCS pager"
contexts = ["workspace"]
command = ["node", "dist/bin/action.js", "uninstall-pager"]
# Commit SHAs resolve locally; pull request numbers would require network access and authentication.
[[link_handlers]]
id = "github-commit"
title = "hunk: review this GitHub commit"
pattern = "^https://github\\.com/[^/]+/[^/]+/commit/[0-9a-fA-F]{7,40}/?$"
action = "review:commit"