@pecot/workflow-mcp 0.0.0-stage → 6.0.0

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.
Files changed (287) hide show
  1. package/.claude-plugin/plugin.json +8 -0
  2. package/LICENSE +21 -0
  3. package/README.md +184 -2
  4. package/bin/pecot-workflow-mcp.mjs +10 -0
  5. package/cli/dist/cli.d.ts +26 -0
  6. package/cli/dist/cli.js +227 -0
  7. package/cli/dist/commands/board-add.d.ts +3 -0
  8. package/cli/dist/commands/board-add.js +59 -0
  9. package/cli/dist/commands/board-judgment.d.ts +60 -0
  10. package/cli/dist/commands/board-judgment.js +144 -0
  11. package/cli/dist/commands/board-move.d.ts +3 -0
  12. package/cli/dist/commands/board-move.js +57 -0
  13. package/cli/dist/commands/board-readiness.d.ts +34 -0
  14. package/cli/dist/commands/board-readiness.js +108 -0
  15. package/cli/dist/commands/board-show.d.ts +3 -0
  16. package/cli/dist/commands/board-show.js +72 -0
  17. package/cli/dist/commands/board-sync.d.ts +3 -0
  18. package/cli/dist/commands/board-sync.js +111 -0
  19. package/cli/dist/commands/board-view.d.ts +62 -0
  20. package/cli/dist/commands/board-view.js +191 -0
  21. package/cli/dist/commands/board.d.ts +3 -0
  22. package/cli/dist/commands/board.js +12 -0
  23. package/cli/dist/commands/branch.d.ts +3 -0
  24. package/cli/dist/commands/branch.js +100 -0
  25. package/cli/dist/commands/cell-table.d.ts +3 -0
  26. package/cli/dist/commands/cell-table.js +495 -0
  27. package/cli/dist/commands/command-binding.d.ts +26 -0
  28. package/cli/dist/commands/command-binding.js +270 -0
  29. package/cli/dist/commands/command-definition.d.ts +150 -0
  30. package/cli/dist/commands/command-definition.js +105 -0
  31. package/cli/dist/commands/command-help.d.ts +8 -0
  32. package/cli/dist/commands/command-help.js +173 -0
  33. package/cli/dist/commands/command-hint.d.ts +5 -0
  34. package/cli/dist/commands/command-hint.js +13 -0
  35. package/cli/dist/commands/command-stop.d.ts +21 -0
  36. package/cli/dist/commands/command-stop.js +31 -0
  37. package/cli/dist/commands/directory-option.d.ts +7 -0
  38. package/cli/dist/commands/directory-option.js +48 -0
  39. package/cli/dist/commands/failure-kind.d.ts +3 -0
  40. package/cli/dist/commands/failure-kind.js +34 -0
  41. package/cli/dist/commands/failure.d.ts +19 -0
  42. package/cli/dist/commands/failure.js +59 -0
  43. package/cli/dist/commands/fuzzy.d.ts +7 -0
  44. package/cli/dist/commands/fuzzy.js +79 -0
  45. package/cli/dist/commands/github-client.d.ts +16 -0
  46. package/cli/dist/commands/github-client.js +33 -0
  47. package/cli/dist/commands/global-options.d.ts +25 -0
  48. package/cli/dist/commands/global-options.js +83 -0
  49. package/cli/dist/commands/help-layout.d.ts +40 -0
  50. package/cli/dist/commands/help-layout.js +117 -0
  51. package/cli/dist/commands/help.d.ts +8 -0
  52. package/cli/dist/commands/help.js +50 -0
  53. package/cli/dist/commands/input-schema.d.ts +14 -0
  54. package/cli/dist/commands/input-schema.js +56 -0
  55. package/cli/dist/commands/issue-board.d.ts +71 -0
  56. package/cli/dist/commands/issue-board.js +122 -0
  57. package/cli/dist/commands/issue-comment.d.ts +3 -0
  58. package/cli/dist/commands/issue-comment.js +215 -0
  59. package/cli/dist/commands/issue-create.d.ts +3 -0
  60. package/cli/dist/commands/issue-create.js +786 -0
  61. package/cli/dist/commands/issue-dependency.d.ts +3 -0
  62. package/cli/dist/commands/issue-dependency.js +282 -0
  63. package/cli/dist/commands/issue-readiness.d.ts +94 -0
  64. package/cli/dist/commands/issue-readiness.js +218 -0
  65. package/cli/dist/commands/issue-reopen.d.ts +3 -0
  66. package/cli/dist/commands/issue-reopen.js +115 -0
  67. package/cli/dist/commands/issue-shared.d.ts +172 -0
  68. package/cli/dist/commands/issue-shared.js +426 -0
  69. package/cli/dist/commands/issue-show.d.ts +3 -0
  70. package/cli/dist/commands/issue-show.js +169 -0
  71. package/cli/dist/commands/issue.d.ts +3 -0
  72. package/cli/dist/commands/issue.js +13 -0
  73. package/cli/dist/commands/names.d.ts +42 -0
  74. package/cli/dist/commands/names.js +78 -0
  75. package/cli/dist/commands/output.d.ts +90 -0
  76. package/cli/dist/commands/output.js +194 -0
  77. package/cli/dist/commands/pr-waiting.d.ts +20 -0
  78. package/cli/dist/commands/pr-waiting.js +106 -0
  79. package/cli/dist/commands/pr.d.ts +22 -0
  80. package/cli/dist/commands/pr.js +852 -0
  81. package/cli/dist/commands/project-sync.d.ts +92 -0
  82. package/cli/dist/commands/project-sync.js +282 -0
  83. package/cli/dist/commands/project.d.ts +6 -0
  84. package/cli/dist/commands/project.js +714 -0
  85. package/cli/dist/commands/registry.d.ts +6 -0
  86. package/cli/dist/commands/registry.js +30 -0
  87. package/cli/dist/commands/release.d.ts +10 -0
  88. package/cli/dist/commands/release.js +353 -0
  89. package/cli/dist/commands/renamed-commands.d.ts +26 -0
  90. package/cli/dist/commands/renamed-commands.js +53 -0
  91. package/cli/dist/commands/repository-display.d.ts +3 -0
  92. package/cli/dist/commands/repository-display.js +7 -0
  93. package/cli/dist/commands/repository-match.d.ts +14 -0
  94. package/cli/dist/commands/repository-match.js +34 -0
  95. package/cli/dist/commands/rich-panel.d.ts +22 -0
  96. package/cli/dist/commands/rich-panel.js +295 -0
  97. package/cli/dist/commands/session-finish.d.ts +3 -0
  98. package/cli/dist/commands/session-finish.js +267 -0
  99. package/cli/dist/commands/session-start.d.ts +3 -0
  100. package/cli/dist/commands/session-start.js +236 -0
  101. package/cli/dist/commands/session.d.ts +6 -0
  102. package/cli/dist/commands/session.js +214 -0
  103. package/cli/dist/commands/tracker-sync-dependabot.d.ts +7 -0
  104. package/cli/dist/commands/tracker-sync-dependabot.js +156 -0
  105. package/cli/dist/commands/tracker-sync-security.d.ts +7 -0
  106. package/cli/dist/commands/tracker-sync-security.js +153 -0
  107. package/cli/dist/commands/tracker-sync.d.ts +65 -0
  108. package/cli/dist/commands/tracker-sync.js +50 -0
  109. package/cli/dist/commands/tracker.d.ts +3 -0
  110. package/cli/dist/commands/tracker.js +18 -0
  111. package/cli/dist/commands/usage-error.d.ts +51 -0
  112. package/cli/dist/commands/usage-error.js +78 -0
  113. package/cli/dist/commands/value-types.d.ts +46 -0
  114. package/cli/dist/commands/value-types.js +94 -0
  115. package/cli/dist/commands/work-target.d.ts +22 -0
  116. package/cli/dist/commands/work-target.js +82 -0
  117. package/cli/dist/commands/worktree.d.ts +3 -0
  118. package/cli/dist/commands/worktree.js +339 -0
  119. package/cli/dist/domain/api-error-detail.d.ts +10 -0
  120. package/cli/dist/domain/api-error-detail.js +25 -0
  121. package/cli/dist/domain/batch-plan.d.ts +73 -0
  122. package/cli/dist/domain/batch-plan.js +114 -0
  123. package/cli/dist/domain/blocked-by-change.d.ts +99 -0
  124. package/cli/dist/domain/blocked-by-change.js +101 -0
  125. package/cli/dist/domain/board-move.d.ts +90 -0
  126. package/cli/dist/domain/board-move.js +92 -0
  127. package/cli/dist/domain/branch-name.d.ts +5 -0
  128. package/cli/dist/domain/branch-name.js +10 -0
  129. package/cli/dist/domain/changelog.d.ts +43 -0
  130. package/cli/dist/domain/changelog.js +107 -0
  131. package/cli/dist/domain/command-hint.d.ts +85 -0
  132. package/cli/dist/domain/command-hint.js +148 -0
  133. package/cli/dist/domain/config.d.ts +219 -0
  134. package/cli/dist/domain/config.js +310 -0
  135. package/cli/dist/domain/dependabot-pull-requests.d.ts +82 -0
  136. package/cli/dist/domain/dependabot-pull-requests.js +338 -0
  137. package/cli/dist/domain/dependabot-source.d.ts +51 -0
  138. package/cli/dist/domain/dependabot-source.js +4 -0
  139. package/cli/dist/domain/dependabot.d.ts +47 -0
  140. package/cli/dist/domain/dependabot.js +88 -0
  141. package/cli/dist/domain/errors.d.ts +24 -0
  142. package/cli/dist/domain/errors.js +36 -0
  143. package/cli/dist/domain/field-options.d.ts +31 -0
  144. package/cli/dist/domain/field-options.js +44 -0
  145. package/cli/dist/domain/format.d.ts +94 -0
  146. package/cli/dist/domain/format.js +234 -0
  147. package/cli/dist/domain/frontmatter.d.ts +137 -0
  148. package/cli/dist/domain/frontmatter.js +290 -0
  149. package/cli/dist/domain/git-runner.d.ts +10 -0
  150. package/cli/dist/domain/git-runner.js +4 -0
  151. package/cli/dist/domain/git-url.d.ts +17 -0
  152. package/cli/dist/domain/git-url.js +30 -0
  153. package/cli/dist/domain/issue-kind.d.ts +16 -0
  154. package/cli/dist/domain/issue-kind.js +16 -0
  155. package/cli/dist/domain/issue-order.d.ts +55 -0
  156. package/cli/dist/domain/issue-order.js +65 -0
  157. package/cli/dist/domain/issue-readout.d.ts +143 -0
  158. package/cli/dist/domain/issue-readout.js +4 -0
  159. package/cli/dist/domain/json-null.d.ts +2 -0
  160. package/cli/dist/domain/json-null.js +5 -0
  161. package/cli/dist/domain/json.d.ts +21 -0
  162. package/cli/dist/domain/json.js +47 -0
  163. package/cli/dist/domain/prerequisites.d.ts +32 -0
  164. package/cli/dist/domain/prerequisites.js +192 -0
  165. package/cli/dist/domain/pull-request.d.ts +201 -0
  166. package/cli/dist/domain/pull-request.js +281 -0
  167. package/cli/dist/domain/python-format.d.ts +105 -0
  168. package/cli/dist/domain/python-format.js +304 -0
  169. package/cli/dist/domain/readiness.d.ts +199 -0
  170. package/cli/dist/domain/readiness.js +391 -0
  171. package/cli/dist/domain/reference-parser.d.ts +51 -0
  172. package/cli/dist/domain/reference-parser.js +123 -0
  173. package/cli/dist/domain/release.d.ts +53 -0
  174. package/cli/dist/domain/release.js +65 -0
  175. package/cli/dist/domain/repository-policy.d.ts +38 -0
  176. package/cli/dist/domain/repository-policy.js +66 -0
  177. package/cli/dist/domain/repository-resolver.d.ts +57 -0
  178. package/cli/dist/domain/repository-resolver.js +122 -0
  179. package/cli/dist/domain/sections.d.ts +69 -0
  180. package/cli/dist/domain/sections.js +514 -0
  181. package/cli/dist/domain/security-alerts-source.d.ts +29 -0
  182. package/cli/dist/domain/security-alerts-source.js +4 -0
  183. package/cli/dist/domain/security-alerts.d.ts +52 -0
  184. package/cli/dist/domain/security-alerts.js +107 -0
  185. package/cli/dist/domain/security-tracker.d.ts +115 -0
  186. package/cli/dist/domain/security-tracker.js +353 -0
  187. package/cli/dist/domain/state.d.ts +59 -0
  188. package/cli/dist/domain/state.js +95 -0
  189. package/cli/dist/domain/tracker-body.d.ts +70 -0
  190. package/cli/dist/domain/tracker-body.js +65 -0
  191. package/cli/dist/domain/work-start.d.ts +34 -0
  192. package/cli/dist/domain/work-start.js +49 -0
  193. package/cli/dist/domain/yaml-document.d.ts +5 -0
  194. package/cli/dist/domain/yaml-document.js +206 -0
  195. package/cli/dist/infra/authored-notes.d.ts +37 -0
  196. package/cli/dist/infra/authored-notes.js +72 -0
  197. package/cli/dist/infra/changelog-file.d.ts +19 -0
  198. package/cli/dist/infra/changelog-file.js +43 -0
  199. package/cli/dist/infra/child-stdin.d.ts +4 -0
  200. package/cli/dist/infra/child-stdin.js +8 -0
  201. package/cli/dist/infra/config-store.d.ts +53 -0
  202. package/cli/dist/infra/config-store.js +134 -0
  203. package/cli/dist/infra/diagnostics.d.ts +9 -0
  204. package/cli/dist/infra/diagnostics.js +2 -0
  205. package/cli/dist/infra/file-kind.d.ts +9 -0
  206. package/cli/dist/infra/file-kind.js +26 -0
  207. package/cli/dist/infra/frontmatter-file.d.ts +14 -0
  208. package/cli/dist/infra/frontmatter-file.js +30 -0
  209. package/cli/dist/infra/git.d.ts +86 -0
  210. package/cli/dist/infra/git.js +145 -0
  211. package/cli/dist/infra/github/auth.d.ts +60 -0
  212. package/cli/dist/infra/github/auth.js +158 -0
  213. package/cli/dist/infra/github/client.d.ts +178 -0
  214. package/cli/dist/infra/github/client.js +579 -0
  215. package/cli/dist/infra/github/dependabot-source.d.ts +13 -0
  216. package/cli/dist/infra/github/dependabot-source.js +33 -0
  217. package/cli/dist/infra/github/errors.d.ts +65 -0
  218. package/cli/dist/infra/github/errors.js +64 -0
  219. package/cli/dist/infra/github/index.d.ts +13 -0
  220. package/cli/dist/infra/github/index.js +19 -0
  221. package/cli/dist/infra/github/issues.d.ts +165 -0
  222. package/cli/dist/infra/github/issues.js +428 -0
  223. package/cli/dist/infra/github/payload.d.ts +44 -0
  224. package/cli/dist/infra/github/payload.js +80 -0
  225. package/cli/dist/infra/github/projects.d.ts +143 -0
  226. package/cli/dist/infra/github/projects.js +384 -0
  227. package/cli/dist/infra/github/pulls.d.ts +104 -0
  228. package/cli/dist/infra/github/pulls.js +217 -0
  229. package/cli/dist/infra/github/queries.d.ts +44 -0
  230. package/cli/dist/infra/github/queries.js +1031 -0
  231. package/cli/dist/infra/github/readout.d.ts +22 -0
  232. package/cli/dist/infra/github/readout.js +167 -0
  233. package/cli/dist/infra/github/repos.d.ts +86 -0
  234. package/cli/dist/infra/github/repos.js +168 -0
  235. package/cli/dist/infra/github/rest-path.d.ts +14 -0
  236. package/cli/dist/infra/github/rest-path.js +31 -0
  237. package/cli/dist/infra/github/security-alerts-source.d.ts +15 -0
  238. package/cli/dist/infra/github/security-alerts-source.js +73 -0
  239. package/cli/dist/infra/gitignore-spec.d.ts +36 -0
  240. package/cli/dist/infra/gitignore-spec.js +235 -0
  241. package/cli/dist/infra/nx-scope.d.ts +51 -0
  242. package/cli/dist/infra/nx-scope.js +182 -0
  243. package/cli/dist/infra/os-error.d.ts +24 -0
  244. package/cli/dist/infra/os-error.js +38 -0
  245. package/cli/dist/infra/paths.d.ts +88 -0
  246. package/cli/dist/infra/paths.js +234 -0
  247. package/cli/dist/infra/state-store.d.ts +54 -0
  248. package/cli/dist/infra/state-store.js +130 -0
  249. package/cli/dist/infra/template-store.d.ts +15 -0
  250. package/cli/dist/infra/template-store.js +34 -0
  251. package/cli/dist/infra/text-file.d.ts +12 -0
  252. package/cli/dist/infra/text-file.js +33 -0
  253. package/cli/dist/infra/worktree-copy.d.ts +24 -0
  254. package/cli/dist/infra/worktree-copy.js +95 -0
  255. package/cli/dist/infra/worktree-links.d.ts +142 -0
  256. package/cli/dist/infra/worktree-links.js +440 -0
  257. package/cli/dist/infra/worktree-setup.d.ts +21 -0
  258. package/cli/dist/infra/worktree-setup.js +41 -0
  259. package/cli/dist/infra/worktree.d.ts +185 -0
  260. package/cli/dist/infra/worktree.js +584 -0
  261. package/cli/dist/mcp/result.d.ts +61 -0
  262. package/cli/dist/mcp/result.js +96 -0
  263. package/cli/dist/mcp/serve.d.ts +51 -0
  264. package/cli/dist/mcp/serve.js +183 -0
  265. package/cli/dist/mcp/server.d.ts +21 -0
  266. package/cli/dist/mcp/server.js +142 -0
  267. package/cli/dist/mcp/session-directory.d.ts +26 -0
  268. package/cli/dist/mcp/session-directory.js +84 -0
  269. package/cli/dist/package.json +1 -0
  270. package/cli/dist/version.d.ts +17 -0
  271. package/cli/dist/version.js +42 -0
  272. package/cli/templates/comment/merge-diff.md +34 -0
  273. package/cli/templates/comment/plan.md +195 -0
  274. package/cli/templates/comment/precede-notify.md +33 -0
  275. package/cli/templates/comment/review-findings.md +42 -0
  276. package/cli/templates/comment/review-resolution.md +48 -0
  277. package/cli/templates/issue/bug.md +63 -0
  278. package/cli/templates/issue/epic.md +54 -0
  279. package/cli/templates/issue/task-implement.md +74 -0
  280. package/cli/templates/issue/task.md +48 -0
  281. package/cli/templates/issue/tracker.md +48 -0
  282. package/cli/templates/pr/create.md +123 -0
  283. package/cli/templates/pr/release.md +56 -0
  284. package/cli/templates/workflow/pecot-board-sync.yml +84 -0
  285. package/hooks/lib/core/pecot-gitignore-ensure.sh +48 -0
  286. package/npm-shrinkwrap.json +83 -0
  287. package/package.json +22 -4
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "pecot-w",
3
+ "version": "6.0.0",
4
+ "description": "pecot-w (pecot-workflow) workflow automation plugin for Claude Code - skills, hooks, agents, and commands for AI-assisted development",
5
+ "author": {
6
+ "name": "pecot"
7
+ }
8
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kohei Hayakawa
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,185 @@
1
- # Temporary Holding Version
1
+ # @pecot/workflow-mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ pecot-workflow プラグインの MCP サーバを、npm のパッケージとして単体で配布したものです。プラグインを導入していない環境でも、
4
+ MCP クライアントに 1 エントリ登録するだけで、Issue・PR・ボード・リリース・worktree のツールが使えます。
5
+
6
+ ## 前提
7
+
8
+ - Node.js 24 系は 24.22.1 以上、26 系は 26.12.1 以上。下限に満たない Node でも npm は警告だけで起動しますが、脆弱性の修正を含まない版では使わないでください
9
+ - `git` と `gh` が PATH にあり、`gh auth status` が通ること。ツールは両方をそのまま起動する
10
+ - Windows ネイティブ環境は対象外です(Linux / macOS / WSL2 で使用してください)
11
+
12
+ ## 登録
13
+
14
+ 使用する MCP クライアントの設定に次の 1 エントリを追加します。
15
+
16
+ ```json
17
+ {
18
+ "mcpServers": {
19
+ "pecot-workflow": {
20
+ "command": "npx",
21
+ "args": ["-y", "--prefix=/", "@pecot/workflow-mcp"]
22
+ }
23
+ }
24
+ }
25
+ ```
26
+
27
+ `--prefix=/` は、pnpm の `devEngines` を宣言したリポジトリの中で起動しても止まらないようにするための指定です。
28
+ `--prefix` を付けないと、そのリポジトリを cwd にした npx が `EBADDEVENGINES` で止まります。
29
+ npm には devEngines の判定だけを外す公式の手段が無く、要望(npm/rfcs#830)は not_planned で閉じています。
30
+
31
+ パッケージは `--package=` ではなく、位置引数で渡してください。
32
+ `--package=` で渡すと、npm が `npm_config_package` をサーバの子プロセスに残します。
33
+ すると、`worktree_add` の `setup_command` などが打つ npx が、これを読んで別のパッケージを実行します。
34
+
35
+ `--prefix=/` には次の副作用があります。
36
+
37
+ - 利用者のリポジトリの `.npmrc` を読まず、globalconfig も `/etc/npmrc` になる。registry・proxy・cafile は `~/.npmrc` に置く
38
+ - `npm_config_prefix=/` などの環境変数がサーバに引き継がれる。`worktree_add` の `setup_command` で `npm i -g` を打つと `/lib/node_modules` を向く
39
+
40
+ この副作用を避けたいときは、先に `npm i -g @pecot/workflow-mcp` で入れて、コマンドを直接登録します。
41
+
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "pecot-workflow": {
46
+ "command": "pecot-workflow-mcp"
47
+ }
48
+ }
49
+ }
50
+ ```
51
+
52
+ Windows の MCP クライアントから使う場合は WSL2 経由で起動します。
53
+
54
+ ```json
55
+ {
56
+ "mcpServers": {
57
+ "pecot-workflow": {
58
+ "command": "wsl",
59
+ "args": ["npx", "-y", "--prefix=/", "@pecot/workflow-mcp"]
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ WSL 内の npx が非ログインシェルの PATH に無い場合は、`args` を次に差し替えます。
66
+
67
+ ```json
68
+ ["-e", "bash", "-lc", "npx -y --prefix=/ @pecot/workflow-mcp"]
69
+ ```
70
+
71
+ 版を固定するときは、`@pecot/workflow-mcp@1.2.3` のように版を付けます。
72
+ 依存は `npm-shrinkwrap.json` で固定されているため、同じ版なら同じ依存が入ります。
73
+
74
+ ツールが対象にするリポジトリは、サーバを起動したディレクトリを含むリポジトリです。
75
+ Claude Code では、Claude Code がサーバを起動するディレクトリ(通常はプロジェクトの root)になります。
76
+
77
+ プラグインの hooks は働きません。`issue_create`・`pr_create` の確認は、MCP クライアント自身の確認だけになります。
78
+ これらのツールは自動で許可しないでください。また、`--help` を打つと、プラグインで出る補足の節は出ません。
79
+
80
+ ## ツール
81
+
82
+ ツール名は `<対象>_<動詞>` の形です。
83
+
84
+ | ツール | 内容 |
85
+ |---|---|
86
+ | `project_list` | 使えるプロジェクトを一覧する |
87
+ | `project_search` | GitHub API でプロジェクトを検索する |
88
+ | `project_init` | 既存のプロジェクトに pecot-workflow のフィールドを足す |
89
+ | `project_create` | プロジェクトを新規に作る |
90
+ | `project_activate` | 初期化済みのプロジェクトを有効にする |
91
+ | `project_link` | プロジェクトの設定にリポジトリを足す・更新する |
92
+ | `project_get` | プロジェクトの設定の値を表示する(`key` は今は `aggregation_repo` だけ。Epic の集約先リポジトリ) |
93
+ | `project_set` | プロジェクトの設定の値を設定する(`key` は今は `aggregation_repo` だけ) |
94
+ | `project_unset` | プロジェクトの設定の値を解除する(`key` は今は `aggregation_repo` だけ) |
95
+ | `board_show` | ボードの状態をまとめて表示する |
96
+ | `board_add` | プロジェクトボードに Issue を足す(pecot の外で作った Issue 用) |
97
+ | `board_move` | Issue 番号でボードのステータスを更新する |
98
+ | `board_sync` | ボードの Ready・Blocked・Active・In Review の Issue を、判定に合う列と札へ直す(`dry_run`・`project` を取る) |
99
+ | `issue_create` | frontmatter 付きの Markdown から Issue を作る(`freeform: true` と `repo`・`message` で、自由形式のメッセージから作る。`dry_run: true` は作らずに予定だけ出す) |
100
+ | `issue_show` | Issue の詳細を必要な項目だけ取得する |
101
+ | `issue_comment` | Issue にコメントを投稿する |
102
+ | `issue_block` | Issue に前提(blocked by)を付ける。付いている前提の種類と理由を変えるのにも使う |
103
+ | `issue_unblock` | Issue から前提(blocked by)を外す |
104
+ | `issue_reopen` | 閉じた Issue を開き直す(ボードのステータスも戻す) |
105
+ | `session_start` | Issue の作業を始める(ブランチを作り、ボードを Active にし、作業対象を記録する) |
106
+ | `session_show` | セッションのフラグ、ブランチ、推定した Issue を表示する |
107
+ | `session_restore` | 失われたセッションのフラグをブランチから復元する |
108
+ | `session_finish` | 作業を終える(マージ後の後処理として、Issue のクローズ、ブランチ削除、ローカルの整理をする) |
109
+ | `pr_create` | PR を作る |
110
+ | `pr_show` | PR の詳細を必要な項目だけ取得する |
111
+ | `pr_check` | PR を作る前に確かめる情報をまとめて表示する |
112
+ | `release_check` | リリース前の確認をする |
113
+ | `release_create` | GitHub のリリースとタグを作る(ノートは CHANGELOG から取る) |
114
+ | `release_merge` | リリースの PR を通常のマージで取り込む |
115
+ | `tracker_sync` | 開いている Tracker の一覧を書き直す(`source` が `dependabot` なら Dependabot PR、`security` ならセキュリティアラート) |
116
+ | `worktree_add` | worktree を作る |
117
+ | `worktree_remove` | worktree を削除する |
118
+ | `worktree_init` | メイン worktree に worktree の設定ファイルを作る |
119
+ | `worktree_link` | 既存の worktree にシンボリックリンクを適用・更新する |
120
+ | `branch_delete` | リモートブランチを削除する(保護ブランチは消さない) |
121
+
122
+ ## 古いツール名からの移行
123
+
124
+ 次の 17 個は、名前が変わりました。古い名前は登録していないので、呼ぶと `Tool <名前> not found` で失敗します。
125
+
126
+ - `add_to_project` → `board_add`
127
+ - `update_issue_status` → `board_move`
128
+ - `project_info` → `board_show`
129
+ - `create_branch` → `session_start`
130
+ - `pr_cleanup` → `session_finish`
131
+ - `session_status` → `session_show`
132
+ - `delete_branch` → `branch_delete`
133
+ - `project_set_repo` → `project_link`
134
+ - `project_show_aggregation_repo` → `project_get`(`key: "aggregation_repo"` を足す)
135
+ - `project_set_aggregation_repo` → `project_set`(`key: "aggregation_repo"` を足す)
136
+ - `project_unset_aggregation_repo` → `project_unset`(`key: "aggregation_repo"` を足す)
137
+ - `issue_read` → `issue_show`
138
+ - `pr_read` → `pr_show`
139
+ - `pr_preflight` → `pr_check`
140
+ - `release_preflight` → `release_check`
141
+ - `dependabot_sync` → `tracker_sync`(`source: "dependabot"` を足す)
142
+ - `security_sync` → `tracker_sync`(`source: "security"` を足す)
143
+
144
+ `issue_quick` は、なくなりました。Issue の作成と作業の開始を 2 回の呼び出しに分けます。
145
+
146
+ - `issue_quick` の代わりに、次の 2 つを順に呼ぶ
147
+ - `issue_create`(`freeform: true`・`repo`・`message`)で Issue を作る
148
+ - `session_start`(`issue_ref`・`branch`)でブランチを作って作業を始める
149
+ - `issue_create` は Issue だけを作る。ブランチの作成と作業対象の記録はしない
150
+
151
+ 許可の設定に古い名前を書いているときは、`mcp__pecot-workflow__<ツール名>` の `<ツール名>` を新しい名前に書き換えてください。
152
+ 書き換えるまでは、確認のダイアログが出るだけで、失敗はしません。
153
+ 入力の `delete_branch`(`session_finish`・`release_merge`)は変わりません。
154
+
155
+ ## 古い入力名からの移行
156
+
157
+ 同じものを指す入力の名前をそろえました。古い入力名を渡すと、実行せずに失敗します。結果は、新しい名前を案内する形です。
158
+
159
+ `invalid input: unknown key 'issue' ('issue' was renamed to 'issue_ref')`
160
+
161
+ - `issue_comment`・`session_restore`: `issue` → `issue_ref`
162
+ - `branch_delete`: `repo_ref` → `repo`
163
+ - `project_link`: `owner_repo` → `repo`
164
+ - `session_start`: `branch_name` → `branch`
165
+ - `issue_create`: `plan` → `dry_run`
166
+
167
+ 書き込む 15 個のツールに、何も書かずに予定だけを出す `dry_run` が付きました。
168
+
169
+ - `board_add`・`board_move`
170
+ - `issue_comment`・`issue_create`・`issue_reopen`
171
+ - `project_activate`・`project_create`・`project_init`・`project_link`・`project_set`・`project_unset`
172
+ - `session_restore`・`session_start`
173
+ - `worktree_init`・`worktree_remove`
174
+
175
+ `board_show` は Archived の古い項目を消さなくなり(整理は `board_sync`)、`release_check` は `git fetch` をしなくなりました。
176
+
177
+ ## 失敗したとき
178
+
179
+ - 初回の起動は依存の取得に時間がかかる。Claude Code で起動が 30 秒を超えて失敗したら、環境変数 `MCP_TIMEOUT` を延ばす
180
+ - ツールの結果は JSON で返る。失敗すると `ok` が `false` になり、原因の名前が `kind`、終了コードが `exitCode` に入る。標準出力と標準エラーは `stdout` と `stderr` に入る
181
+ - `EBADDEVENGINES` で止まるときは、登録の `args` に `--prefix=/` が付いているか確認する
182
+
183
+ ## 版
184
+
185
+ npm の版は pecot-workflow プラグインの版と一致します。
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import path from 'node:path'
3
+ import { fileURLToPath, pathToFileURL } from 'node:url'
4
+
5
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
6
+ for (const name of ['CLAUDE_PLUGIN_ROOT', 'PLUGIN_ROOT', 'COPILOT_PLUGIN_ROOT']) delete process.env[name]
7
+ if (process.argv.length === 2) process.argv.push('mcp')
8
+ // 絶対パスの動的 import は Windows で ERR_UNSUPPORTED_ESM_URL_SCHEME になるため file URL を通す。
9
+ const { main } = await import(pathToFileURL(path.join(root, 'cli/dist/cli.js')).href)
10
+ main()
@@ -0,0 +1,26 @@
1
+ import type { CommandDefinition, CommandIo } from './commands/registry.js';
2
+ export interface CliContext {
3
+ readonly commands: readonly CommandDefinition[];
4
+ readonly io: CommandIo;
5
+ readonly cwd: string;
6
+ /**
7
+ rich の幅を決める環境変数(TERMINAL_WIDTH・COLUMNS)
8
+ */
9
+ readonly environment: Readonly<Record<string, string | undefined>>;
10
+ /**
11
+ 端末の幅。端末につながっていなければ undefined
12
+ */
13
+ readonly terminalColumns: number | undefined;
14
+ }
15
+ /**
16
+ argv(node とスクリプトを除く)を実行して終了コードを返す。
17
+ 使い方の誤りは枠付きで stderr に出して 2。確認の中止は Aborted. で 1。独自の例外は error の行で 1。それ以外の例外は伝える
18
+ */
19
+ export declare function runCli(argv: readonly string[], context: Readonly<CliContext>): Promise<number>;
20
+ /**
21
+ 出力先のパイプが閉じられたとき(`pecot ... | head`)に、エラーを出さず静かに終わる。
22
+ Python の __main__.py は SIGPIPE を既定の動作に戻し、BrokenPipeError も握って終了コード 0 で終わる。Node は EPIPE を error イベントで受ける
23
+ */
24
+ export declare function exitQuietlyOnBrokenPipe(stream: Readonly<Pick<NodeJS.WritableStream, 'on'>>, finish: () => void): void;
25
+ export declare function main(): Promise<void>;
26
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1,227 @@
1
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- zod のスキーマは深い readonly にできない */
2
+ // pecot-workflow の Node CLI のエントリポイント。
3
+ // グローバルオプションは Python の CLI(typer)と同じ順で処理する。
4
+ // 1. 解析の誤り(未知のオプション・値の欠け)。
5
+ // 2. eager な --version・--help。他の引数が不正でも実行する。
6
+ // 3. --repo の形式。不正なら使い方の誤りの枠を出して終了コード 2。
7
+ // 3.5. `mcp`。コマンドではないので、名前の解決の前に MCP サーバを stdio で起動する(help の一覧と打ち間違いの候補に出さない)。
8
+ // 4. コマンド名の解決。
9
+ // 5. PECOT_GITHUB_API_URL の検証。不正なら文言を出して終了コード 1。
10
+ // 6. --show-repo。解決して 2 行を出し、終了コード 0。
11
+ // 7. コマンドの --help。`--` より前に --help があれば、ほかの引数を検証せずに help を出して終了コード 0。
12
+ // 8. コマンドの実行。コマンドが無ければ終了コード 0。
13
+ //
14
+ // 例外は、使い方の誤りなら枠付きで終了コード 2、独自の例外なら failure.ts の文で終了コード 1 にする。
15
+ import { realpathSync } from 'node:fs';
16
+ import { pathToFileURL } from 'node:url';
17
+ import { InvalidValueError } from './domain/errors.js';
18
+ import { AmbiguousRepositoryError, parseOwnerRepository, resolveRepository } from './domain/repository-resolver.js';
19
+ import { readAuthoredNotes } from './infra/authored-notes.js';
20
+ import { gitRunnerFor } from './infra/git.js';
21
+ import { resolveApiUrlOverride } from './infra/github/client.js';
22
+ import { hasErrorCode } from './infra/os-error.js';
23
+ import { extraArgumentsMessage, isHelpRequested, runDefinition } from './commands/command-binding.js';
24
+ import { commandHelpText } from './commands/command-help.js';
25
+ import { interfaceIdOf } from './commands/command-definition.js';
26
+ import { invalidRepositoryMessage, parseGlobalOptions, ROOT_USAGE } from './commands/global-options.js';
27
+ import { exitCodeOfFailure } from './commands/failure.js';
28
+ import { closeMatches } from './commands/fuzzy.js';
29
+ import { helpText } from './commands/help.js';
30
+ import { COMMANDS, findCommand } from './commands/registry.js';
31
+ import { createOutput, createProcessIo } from './commands/output.js';
32
+ import { formatResolvedRepository } from './commands/repository-display.js';
33
+ import { outputWidth } from './commands/rich-panel.js';
34
+ import { COMMAND_SYNOPSIS, MISSING_COMMAND_MESSAGE, noSuchCommandMessage, noSuchOptionMessage, renamedCommandMessage, USAGE_EXIT_CODE, UsageError, } from './commands/usage-error.js';
35
+ import { findRenamedCommand } from './commands/renamed-commands.js';
36
+ import { readVersion } from './version.js';
37
+ function isUnderGroup(path, group) {
38
+ return group.every((segment, index) => path.at(index) === segment);
39
+ }
40
+ /**
41
+ コマンド名を、グループをたどって解決する。見つからなければ UsageError
42
+ */
43
+ function resolveCommand(group, rest, commands) {
44
+ const context = { commandPath: group, synopsis: COMMAND_SYNOPSIS };
45
+ const [name, ...tail] = rest;
46
+ if (name === undefined)
47
+ throw new UsageError(MISSING_COMMAND_MESSAGE, context);
48
+ if (group.length > 0 && name.startsWith('-')) {
49
+ if (name === '--help')
50
+ return { kind: 'help', path: group };
51
+ throw new UsageError(noSuchOptionMessage(name, name.startsWith('--') ? closeMatches(name, ['--help']) : []), context);
52
+ }
53
+ const path = [...group, name];
54
+ const names = commands
55
+ .filter(command => command.path.length > group.length && isUnderGroup(command.path, group))
56
+ .map(command => command.path.slice(group.length, group.length + 1).join(''));
57
+ if (!names.includes(name)) {
58
+ const renamed = findRenamedCommand(path);
59
+ if (renamed !== undefined)
60
+ throw new UsageError(renamedCommandMessage(...renamed), context);
61
+ const possibilities = closeMatches(name, [...new Set(names)]);
62
+ throw new UsageError(noSuchCommandMessage(name, possibilities), context);
63
+ }
64
+ const definition = findCommand(path, commands);
65
+ return definition === undefined ? resolveCommand(path, tail, commands) : { kind: 'command', definition, argv: tail };
66
+ }
67
+ function validateRepository(repository) {
68
+ if (repository === undefined)
69
+ return;
70
+ try {
71
+ parseOwnerRepository(repository);
72
+ }
73
+ catch (error) {
74
+ if (!(error instanceof InvalidValueError))
75
+ throw error;
76
+ throw new UsageError(invalidRepositoryMessage(error.message), ROOT_USAGE);
77
+ }
78
+ }
79
+ function showRepository(repository, context) {
80
+ try {
81
+ // Python の resolve_repo も GIT_* を外さずに git を呼ぶ(git の hook の下では GIT_DIR が cwd より優先される)。同じ動作にそろえる
82
+ const resolved = resolveRepository(repository, gitRunnerFor(context.cwd));
83
+ context.io.stdout(formatResolvedRepository(resolved));
84
+ return 0;
85
+ }
86
+ catch (error) {
87
+ // eslint-disable-next-line no-restricted-syntax -- CLI の最上位でグローバルの --repo を読むときだけ出る
88
+ if (error instanceof InvalidValueError)
89
+ context.io.stderr(`error: --repo: ${error.message}\n`);
90
+ else if (error instanceof AmbiguousRepositoryError)
91
+ context.io.stderr(`error: ${error.message}\n`);
92
+ else
93
+ throw error;
94
+ return USAGE_EXIT_CODE;
95
+ }
96
+ }
97
+ /**
98
+ コマンドの help を stdout に出して 0 を返す。details・constraints・examples・default_notes は定義書の手書きの側から読む。
99
+ 読めなければ Constraints・Details・Examples と初期値の補足を出さず、stderr に場所と理由の warning を 1 行出す(help を誤りで止めない)
100
+ */
101
+ function showCommandHelp(definition, context, width) {
102
+ const result = readAuthoredNotes(interfaceIdOf(definition.path));
103
+ if (result.kind === 'unreadable')
104
+ createOutput(false, context.io).warning(`could not read the details of '${definition.path.join(' ')}' from ${result.file}: ${result.reason}; they are left out of this help`);
105
+ context.io.stdout(commandHelpText(definition, result.kind === 'read' ? result.notes : undefined, width));
106
+ return 0;
107
+ }
108
+ const MCP_COMMAND = 'mcp';
109
+ // mcp の待ち受け中は、stdout の EPIPE を serve.ts が終了コード 1 で報告する。main の静かな終了にしない
110
+ const serving = { isActive: false };
111
+ /**
112
+ `pecot mcp` を stdio の MCP サーバとして起動する。待ち受けは stdin が閉じるまで続くので、起動の結果の終了コードを返す
113
+ */
114
+ async function startMcp(extras) {
115
+ if (extras.length > 0)
116
+ throw new UsageError(extraArgumentsMessage(extras), { commandPath: [MCP_COMMAND], synopsis: '[OPTIONS]' });
117
+ const { executeMcpServe } = await import('./mcp/serve.js');
118
+ serving.isActive = true;
119
+ return executeMcpServe();
120
+ }
121
+ async function execute(argv, context, width) {
122
+ const options = parseGlobalOptions(argv);
123
+ if (argv.length === 0) {
124
+ context.io.stdout(helpText([], context.commands, width));
125
+ return USAGE_EXIT_CODE;
126
+ }
127
+ if (options.eager === 'version') {
128
+ context.io.stdout(`pecot version ${readVersion()}\n`);
129
+ return 0;
130
+ }
131
+ if (options.eager === 'help') {
132
+ context.io.stdout(helpText([], context.commands, width));
133
+ return 0;
134
+ }
135
+ validateRepository(options.repo);
136
+ if (options.rest[0] === MCP_COMMAND)
137
+ return await startMcp(options.rest.slice(1));
138
+ const resolution = options.rest.length === 0 ? undefined : resolveCommand([], options.rest, context.commands);
139
+ try {
140
+ resolveApiUrlOverride();
141
+ }
142
+ catch (error) {
143
+ if (!(error instanceof InvalidValueError))
144
+ throw error;
145
+ context.io.stderr(`error: ${error.message}\n`);
146
+ return 1;
147
+ }
148
+ if (options.showRepo)
149
+ return showRepository(options.repo, context);
150
+ if (resolution === undefined)
151
+ return 0;
152
+ if (resolution.kind === 'help') {
153
+ context.io.stdout(helpText(resolution.path, context.commands, width));
154
+ return 0;
155
+ }
156
+ return isHelpRequested(resolution.argv)
157
+ ? showCommandHelp(resolution.definition, context, width)
158
+ : await runDefinition(resolution.definition, resolution.argv, context.io, options.repo);
159
+ }
160
+ /**
161
+ argv(node とスクリプトを除く)を実行して終了コードを返す。
162
+ 使い方の誤りは枠付きで stderr に出して 2。確認の中止は Aborted. で 1。独自の例外は error の行で 1。それ以外の例外は伝える
163
+ */
164
+ export async function runCli(argv, context) {
165
+ const width = outputWidth(context.environment, context.terminalColumns);
166
+ try {
167
+ return await execute(argv, context, width);
168
+ }
169
+ catch (error) {
170
+ return exitCodeOfFailure(error, context.io, width);
171
+ }
172
+ }
173
+ /**
174
+ 出力先のパイプが閉じられたとき(`pecot ... | head`)に、エラーを出さず静かに終わる。
175
+ Python の __main__.py は SIGPIPE を既定の動作に戻し、BrokenPipeError も握って終了コード 0 で終わる。Node は EPIPE を error イベントで受ける
176
+ */
177
+ export function exitQuietlyOnBrokenPipe(stream, finish) {
178
+ stream.on('error', (error) => {
179
+ if (hasErrorCode(error) && error.code === 'EPIPE')
180
+ finish();
181
+ else
182
+ throw error;
183
+ });
184
+ }
185
+ /**
186
+ 端末の幅。rich は標準入力・標準出力・標準エラーの順に、端末につながったものの幅を使う。Node では出力側の 2 つを見る
187
+ */
188
+ function terminalColumns() {
189
+ if (process.stderr.isTTY)
190
+ return process.stderr.columns;
191
+ return process.stdout.isTTY ? process.stdout.columns : undefined;
192
+ }
193
+ export async function main() {
194
+ const io = createProcessIo();
195
+ const pipe = { isClosed: false };
196
+ const finish = () => {
197
+ if (serving.isActive)
198
+ return;
199
+ pipe.isClosed = true;
200
+ process.exitCode = 0;
201
+ process.stdout.destroy();
202
+ };
203
+ exitQuietlyOnBrokenPipe(process.stdout, finish);
204
+ exitQuietlyOnBrokenPipe(process.stderr, finish);
205
+ const code = await runCli(process.argv.slice(2), {
206
+ commands: COMMANDS,
207
+ io,
208
+ cwd: process.cwd(),
209
+ // interface-env: TERMINAL_WIDTH COLUMNS
210
+ environment: process.env,
211
+ terminalColumns: terminalColumns(),
212
+ });
213
+ if (!pipe.isClosed)
214
+ process.exitCode = code;
215
+ }
216
+ /* v8 ignore start -- 直接起動時にだけ通る */
217
+ if (process.argv[1] !== undefined) {
218
+ // import.meta.url は symlink を解決した実体パスを指すため、argv[1] 側も realpath に揃える。
219
+ // 揃えないと symlink 経由起動で一致せず、何もせず exit 0 で終わる。
220
+ // eslint-disable-next-line security/detect-non-literal-fs-filename -- 起動された自分自身のパス
221
+ const selfUrl = pathToFileURL(realpathSync(process.argv[1])).href;
222
+ if (import.meta.url === selfUrl) {
223
+ await main();
224
+ }
225
+ }
226
+ /* v8 ignore stop */
227
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1,3 @@
1
+ import type { CommandDefinition } from './command-definition.js';
2
+ export declare const BOARD_ADD_COMMANDS: readonly CommandDefinition[];
3
+ //# sourceMappingURL=board-add.d.ts.map
@@ -0,0 +1,59 @@
1
+ // board add。cli/commands/issue.py の add_to_project の移植。
2
+ import { z } from 'zod';
3
+ import { GitHubAPIError } from '../infra/github/errors.js';
4
+ import { defineCommand } from './command-definition.js';
5
+ import { addIssueToBoard, isStatusConfigured, setIssueField } from './issue-board.js';
6
+ import { stopWith, requireActiveConfigPlain } from './command-stop.js';
7
+ import { kindOfFailure } from './failure.js';
8
+ import { connectToProject, exitInvalidStatus, ISSUE_REF_DESCRIPTION, issuePath, notConfiguredMessage, parseIssueReferenceOrExit, runWithExit, VALID_STATUSES, } from './issue-shared.js';
9
+ import { createOutput } from './output.js';
10
+ const BOARD_ADD = defineCommand({
11
+ path: ['board', 'add'],
12
+ description: 'Add an Issue to the project board with a GraphQL mutation (for an Issue created outside pecot)',
13
+ input: z.object({
14
+ issue_ref: z.string().describe(ISSUE_REF_DESCRIPTION),
15
+ status: z.string().default('ready').describe('Initial status (backlog/pending/blocked/ready/active/in_review/archived)'),
16
+ dry_run: z.boolean().default(false).describe('Show what would change without writing anything'),
17
+ }),
18
+ positional: ['issue_ref'],
19
+ shortFlags: { status: '-s', dry_run: '-n' },
20
+ interactive: false,
21
+ run: async (input, io) => {
22
+ const output = createOutput(input.dry_run, io);
23
+ return await runWithExit(async () => {
24
+ const { status } = input;
25
+ if (status !== '' && !VALID_STATUSES.has(status))
26
+ exitInvalidStatus(output, status);
27
+ const config = requireActiveConfigPlain(output);
28
+ if (status !== '' && !isStatusConfigured(config, status)) {
29
+ stopWith(output, notConfiguredMessage(status), 'status-not-configured');
30
+ }
31
+ const { owner, repository, number } = parseIssueReferenceOrExit(output, input.repo, input.issue_ref);
32
+ const target = `Issue ${issuePath(owner, repository, number)}`;
33
+ try {
34
+ const client = await connectToProject(output, config, owner, repository);
35
+ if (input.dry_run) {
36
+ // Issue が読めることだけ確かめる
37
+ await client.getIssueNodeId(owner, repository, number);
38
+ output.planned({ verb: 'add', target: `${target} to project` });
39
+ if (status !== '')
40
+ output.planned({ verb: 'set', target: `${target} status ${status}` });
41
+ return;
42
+ }
43
+ const { itemId } = await addIssueToBoard(client, config, owner, repository, number, undefined);
44
+ output.done({ verb: 'add', target: `${target} to project` });
45
+ if (status !== '') {
46
+ await setIssueField(client, config, itemId, 'workflow', status);
47
+ output.done({ verb: 'set', target: `${target} status ${status}` });
48
+ }
49
+ }
50
+ catch (error) {
51
+ if (!(error instanceof GitHubAPIError))
52
+ throw error;
53
+ stopWith(output, `could not add ${target} to project: ${error.message}`, kindOfFailure(error));
54
+ }
55
+ });
56
+ },
57
+ });
58
+ export const BOARD_ADD_COMMANDS = [BOARD_ADD];
59
+ //# sourceMappingURL=board-add.js.map
@@ -0,0 +1,60 @@
1
+ import type { BoardMove, MissingValue } from '../domain/board-move.js';
2
+ import type { ProjectConfig } from '../domain/config.js';
3
+ import type { BoardItem, BoardProgress } from '../domain/format.js';
4
+ import type { IssueReference } from '../domain/reference-parser.js';
5
+ import type { RepositoryReference } from '../domain/repository-resolver.js';
6
+ import type { GitHubClient } from '../infra/github/index.js';
7
+ import type { IssueReadiness, IssueSnapshot, JudgedIssue } from './issue-readiness.js';
8
+ import type { HintedText } from './command-hint.js';
9
+ import type { Output } from './output.js';
10
+ /**
11
+ board sync と pr create が判定し直す列
12
+ */
13
+ export declare const SYNCED_COLUMNS: ReadonlySet<string>;
14
+ /**
15
+ 動かす先の値がボードに無いときの warning の文
16
+ */
17
+ export declare function missingWarning(missing: ReadonlySet<MissingValue>): HintedText;
18
+ export interface BoardTarget {
19
+ readonly item: BoardItem;
20
+ readonly key: string;
21
+ readonly ref: IssueReference;
22
+ }
23
+ export interface JudgedTarget {
24
+ readonly target: BoardTarget;
25
+ readonly result: IssueReadiness;
26
+ }
27
+ export interface JudgeBoardOptions {
28
+ /**
29
+ 判定の対象にする列
30
+ */
31
+ readonly columns: ReadonlySet<string>;
32
+ /**
33
+ 個別の読み取りを省く Issue。'skip' は判定から外し、IssueSnapshot は一覧の値だけで判定し、undefined は個別に読む
34
+ */
35
+ readonly withoutRead: (target: BoardTarget, progress: BoardProgress | undefined) => IssueSnapshot | 'skip' | undefined;
36
+ }
37
+ /**
38
+ 対象の列の Issue の前提と着手の跡を読み、輪も含めて判定する。
39
+ Issue の依存関係に対応しない GHES では undefined を返す。warning は呼ぶ側が出す
40
+ */
41
+ export declare function judgeBoard(client: GitHubClient, config: ProjectConfig, items: readonly BoardItem[], progress: ReadonlyMap<string, BoardProgress>, options: JudgeBoardOptions): Promise<readonly JudgedTarget[] | undefined>;
42
+ /**
43
+ 列と札を動かす処理が共有する、出力先・クライアント・設定・表示の基準のリポ
44
+ */
45
+ export interface BoardContext {
46
+ readonly out: Readonly<Output>;
47
+ readonly client: GitHubClient;
48
+ readonly config: ProjectConfig;
49
+ readonly home: RepositoryReference | undefined;
50
+ }
51
+ /**
52
+ 判定の結果に合わせて、列と札を動かす。読めない Issue は warning にし、ボードに無い値は最後に 1 行の warning にまとめる。
53
+ isDryRun は同じ文を予定の行で出し、書かない。書き込みに失敗した Issue の数を返す
54
+ */
55
+ export declare function applyJudgedMoves(context: Readonly<BoardContext>, judged: readonly JudgedTarget[], isDryRun?: boolean): Promise<number>;
56
+ /**
57
+ 判定から、列と札の動かし方を決める。info の数え方と board sync の書き込みが同じ規則を使う(FR-083)
58
+ */
59
+ export declare function boardMoveOf(config: ProjectConfig, target: BoardTarget, result: JudgedIssue): BoardMove | undefined;
60
+ //# sourceMappingURL=board-judgment.d.ts.map