@pecot/workflow-mcp 5.0.0 → 7.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 (188) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +27 -22
  3. package/cli/dist/cli.js +6 -1
  4. package/cli/dist/commands/board-add.d.ts +3 -0
  5. package/cli/dist/commands/board-add.js +69 -0
  6. package/cli/dist/commands/board-judgment.d.ts +69 -0
  7. package/cli/dist/commands/board-judgment.js +150 -0
  8. package/cli/dist/commands/board-move.d.ts +3 -0
  9. package/cli/dist/commands/board-move.js +65 -0
  10. package/cli/dist/commands/board-readiness.d.ts +34 -0
  11. package/cli/dist/commands/board-readiness.js +108 -0
  12. package/cli/dist/commands/board-show.d.ts +3 -0
  13. package/cli/dist/commands/board-show.js +75 -0
  14. package/cli/dist/commands/board-sync.d.ts +3 -0
  15. package/cli/dist/commands/board-sync.js +120 -0
  16. package/cli/dist/commands/board-view.d.ts +151 -0
  17. package/cli/dist/commands/board-view.js +293 -0
  18. package/cli/dist/commands/board.d.ts +3 -0
  19. package/cli/dist/commands/board.js +12 -0
  20. package/cli/dist/commands/branch.d.ts +3 -0
  21. package/cli/dist/commands/branch.js +111 -0
  22. package/cli/dist/commands/command-binding.js +4 -0
  23. package/cli/dist/commands/command-definition.d.ts +39 -8
  24. package/cli/dist/commands/command-definition.js +20 -7
  25. package/cli/dist/commands/command-help.js +2 -2
  26. package/cli/dist/commands/command-hint.d.ts +5 -0
  27. package/cli/dist/commands/command-hint.js +13 -0
  28. package/cli/dist/commands/command-stop.d.ts +5 -3
  29. package/cli/dist/commands/command-stop.js +7 -6
  30. package/cli/dist/commands/failure-kind.d.ts +3 -0
  31. package/cli/dist/commands/failure-kind.js +35 -0
  32. package/cli/dist/commands/failure.d.ts +6 -0
  33. package/cli/dist/commands/failure.js +29 -3
  34. package/cli/dist/commands/github-client.d.ts +6 -2
  35. package/cli/dist/commands/github-client.js +13 -3
  36. package/cli/dist/commands/help.js +8 -13
  37. package/cli/dist/commands/issue-board.d.ts +61 -0
  38. package/cli/dist/commands/issue-board.js +85 -1
  39. package/cli/dist/commands/issue-comment.js +66 -30
  40. package/cli/dist/commands/issue-create.js +632 -92
  41. package/cli/dist/commands/issue-dependency.d.ts +3 -0
  42. package/cli/dist/commands/issue-dependency.js +310 -0
  43. package/cli/dist/commands/issue-readiness.d.ts +122 -0
  44. package/cli/dist/commands/issue-readiness.js +253 -0
  45. package/cli/dist/commands/issue-reopen.d.ts +3 -0
  46. package/cli/dist/commands/issue-reopen.js +130 -0
  47. package/cli/dist/commands/issue-shared.d.ts +33 -20
  48. package/cli/dist/commands/issue-shared.js +84 -76
  49. package/cli/dist/commands/issue-show.d.ts +3 -0
  50. package/cli/dist/commands/issue-show.js +239 -0
  51. package/cli/dist/commands/issue.d.ts +0 -1
  52. package/cli/dist/commands/issue.js +6 -8
  53. package/cli/dist/commands/names.d.ts +33 -0
  54. package/cli/dist/commands/names.js +63 -0
  55. package/cli/dist/commands/output.d.ts +32 -4
  56. package/cli/dist/commands/output.js +28 -8
  57. package/cli/dist/commands/pr-merge.d.ts +3 -0
  58. package/cli/dist/commands/pr-merge.js +230 -0
  59. package/cli/dist/commands/pr-reference.d.ts +8 -0
  60. package/cli/dist/commands/pr-reference.js +30 -0
  61. package/cli/dist/commands/pr-restack.d.ts +6 -0
  62. package/cli/dist/commands/pr-restack.js +233 -0
  63. package/cli/dist/commands/pr-waiting.d.ts +59 -0
  64. package/cli/dist/commands/pr-waiting.js +143 -0
  65. package/cli/dist/commands/pr.d.ts +23 -0
  66. package/cli/dist/commands/pr.js +378 -366
  67. package/cli/dist/commands/project-sync.d.ts +12 -3
  68. package/cli/dist/commands/project-sync.js +23 -13
  69. package/cli/dist/commands/project.d.ts +3 -2
  70. package/cli/dist/commands/project.js +371 -177
  71. package/cli/dist/commands/registry.js +15 -10
  72. package/cli/dist/commands/release.d.ts +2 -2
  73. package/cli/dist/commands/release.js +118 -130
  74. package/cli/dist/commands/renamed-commands.d.ts +26 -0
  75. package/cli/dist/commands/renamed-commands.js +53 -0
  76. package/cli/dist/commands/repository-match.js +9 -3
  77. package/cli/dist/commands/session-finish.d.ts +3 -0
  78. package/cli/dist/commands/session-finish.js +383 -0
  79. package/cli/dist/commands/session-start.d.ts +3 -0
  80. package/cli/dist/commands/session-start.js +252 -0
  81. package/cli/dist/commands/session.d.ts +3 -0
  82. package/cli/dist/commands/session.js +186 -32
  83. package/cli/dist/commands/tracker-sync-dependabot.d.ts +7 -0
  84. package/cli/dist/commands/{dependabot.js → tracker-sync-dependabot.js} +76 -68
  85. package/cli/dist/commands/tracker-sync-security.d.ts +7 -0
  86. package/cli/dist/commands/{security.js → tracker-sync-security.js} +71 -64
  87. package/cli/dist/commands/tracker-sync.d.ts +37 -0
  88. package/cli/dist/commands/tracker-sync.js +18 -6
  89. package/cli/dist/commands/tracker.d.ts +3 -0
  90. package/cli/dist/commands/tracker.js +20 -0
  91. package/cli/dist/commands/usage-error.d.ts +4 -0
  92. package/cli/dist/commands/usage-error.js +6 -0
  93. package/cli/dist/commands/work-target.d.ts +20 -3
  94. package/cli/dist/commands/work-target.js +49 -6
  95. package/cli/dist/commands/worktree.js +103 -33
  96. package/cli/dist/domain/batch-plan.d.ts +73 -0
  97. package/cli/dist/domain/batch-plan.js +114 -0
  98. package/cli/dist/domain/blocked-by-change.d.ts +99 -0
  99. package/cli/dist/domain/blocked-by-change.js +101 -0
  100. package/cli/dist/domain/board-move.d.ts +90 -0
  101. package/cli/dist/domain/board-move.js +92 -0
  102. package/cli/dist/domain/branch-name.js +1 -1
  103. package/cli/dist/domain/command-hint.d.ts +85 -0
  104. package/cli/dist/domain/command-hint.js +148 -0
  105. package/cli/dist/domain/config.d.ts +4 -0
  106. package/cli/dist/domain/config.js +11 -1
  107. package/cli/dist/domain/dependabot.js +1 -1
  108. package/cli/dist/domain/errors.d.ts +5 -0
  109. package/cli/dist/domain/errors.js +5 -0
  110. package/cli/dist/domain/format.d.ts +51 -4
  111. package/cli/dist/domain/format.js +72 -6
  112. package/cli/dist/domain/frontmatter.d.ts +18 -3
  113. package/cli/dist/domain/frontmatter.js +38 -12
  114. package/cli/dist/domain/issue-order.d.ts +55 -0
  115. package/cli/dist/domain/issue-order.js +65 -0
  116. package/cli/dist/domain/issue-readout.d.ts +36 -4
  117. package/cli/dist/domain/pull-request.d.ts +71 -4
  118. package/cli/dist/domain/pull-request.js +59 -10
  119. package/cli/dist/domain/readiness.d.ts +44 -0
  120. package/cli/dist/domain/readiness.js +153 -5
  121. package/cli/dist/domain/reference-parser.d.ts +3 -1
  122. package/cli/dist/domain/reference-parser.js +6 -2
  123. package/cli/dist/domain/release.d.ts +7 -3
  124. package/cli/dist/domain/release.js +5 -12
  125. package/cli/dist/domain/repository-policy.d.ts +9 -3
  126. package/cli/dist/domain/repository-policy.js +8 -7
  127. package/cli/dist/domain/repository-resolver.js +4 -1
  128. package/cli/dist/domain/restack.d.ts +62 -0
  129. package/cli/dist/domain/restack.js +53 -0
  130. package/cli/dist/domain/security-alerts.js +1 -1
  131. package/cli/dist/domain/state.d.ts +69 -0
  132. package/cli/dist/domain/state.js +67 -1
  133. package/cli/dist/domain/work-start.d.ts +30 -0
  134. package/cli/dist/domain/work-start.js +42 -0
  135. package/cli/dist/infra/authored-notes.d.ts +1 -1
  136. package/cli/dist/infra/authored-notes.js +10 -4
  137. package/cli/dist/infra/config-store.d.ts +4 -0
  138. package/cli/dist/infra/config-store.js +13 -0
  139. package/cli/dist/infra/git.d.ts +76 -0
  140. package/cli/dist/infra/git.js +123 -1
  141. package/cli/dist/infra/github/client.d.ts +5 -0
  142. package/cli/dist/infra/github/client.js +10 -7
  143. package/cli/dist/infra/github/errors.d.ts +18 -0
  144. package/cli/dist/infra/github/errors.js +22 -0
  145. package/cli/dist/infra/github/issues.d.ts +39 -3
  146. package/cli/dist/infra/github/issues.js +178 -23
  147. package/cli/dist/infra/github/projects.d.ts +35 -0
  148. package/cli/dist/infra/github/projects.js +89 -8
  149. package/cli/dist/infra/github/pulls.d.ts +105 -2
  150. package/cli/dist/infra/github/pulls.js +172 -5
  151. package/cli/dist/infra/github/queries.d.ts +15 -4
  152. package/cli/dist/infra/github/queries.js +203 -40
  153. package/cli/dist/infra/github/readout.d.ts +5 -1
  154. package/cli/dist/infra/github/readout.js +11 -33
  155. package/cli/dist/infra/github/repos.d.ts +18 -0
  156. package/cli/dist/infra/github/repos.js +31 -0
  157. package/cli/dist/infra/nx-scope.d.ts +1 -1
  158. package/cli/dist/infra/nx-scope.js +1 -1
  159. package/cli/dist/infra/state-store.d.ts +10 -1
  160. package/cli/dist/infra/state-store.js +14 -2
  161. package/cli/dist/infra/worktree-links.d.ts +3 -0
  162. package/cli/dist/infra/worktree-links.js +8 -1
  163. package/cli/dist/infra/worktree.d.ts +12 -1
  164. package/cli/dist/infra/worktree.js +40 -23
  165. package/cli/dist/mcp/result.d.ts +82 -7
  166. package/cli/dist/mcp/result.js +139 -19
  167. package/cli/dist/mcp/server.d.ts +2 -2
  168. package/cli/dist/mcp/server.js +57 -10
  169. package/cli/templates/comment/plan.md +14 -0
  170. package/cli/templates/comment/review-findings.md +3 -2
  171. package/cli/templates/issue/bug.md +13 -4
  172. package/cli/templates/issue/task-implement.md +13 -6
  173. package/cli/templates/issue/task.md +13 -4
  174. package/cli/templates/workflow/pecot-board-sync.yml +84 -0
  175. package/npm-shrinkwrap.json +2 -2
  176. package/package.json +1 -1
  177. package/cli/dist/commands/dependabot.d.ts +0 -3
  178. package/cli/dist/commands/issue-project.d.ts +0 -3
  179. package/cli/dist/commands/issue-project.js +0 -176
  180. package/cli/dist/commands/issue-quick.d.ts +0 -3
  181. package/cli/dist/commands/issue-quick.js +0 -126
  182. package/cli/dist/commands/issue-read.d.ts +0 -3
  183. package/cli/dist/commands/issue-read.js +0 -80
  184. package/cli/dist/commands/project-info.d.ts +0 -48
  185. package/cli/dist/commands/project-info.js +0 -181
  186. package/cli/dist/commands/repository.d.ts +0 -5
  187. package/cli/dist/commands/repository.js +0 -265
  188. package/cli/dist/commands/security.d.ts +0 -3
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pecot-w",
3
- "version": "5.0.0",
3
+ "version": "7.0.0",
4
4
  "description": "pecot-w (pecot-workflow) workflow automation plugin for Claude Code - skills, hooks, agents, and commands for AI-assisted development",
5
5
  "author": {
6
6
  "name": "pecot"
package/README.md CHANGED
@@ -74,52 +74,57 @@ WSL 内の npx が非ログインシェルの PATH に無い場合は、`args`
74
74
  ツールが対象にするリポジトリは、サーバを起動したディレクトリを含むリポジトリです。
75
75
  Claude Code では、Claude Code がサーバを起動するディレクトリ(通常はプロジェクトの root)になります。
76
76
 
77
- プラグインの hooks は働きません。`issue_create`・`issue_quick`・`pr_create` の確認は、MCP クライアント自身の確認だけになります。
77
+ プラグインの hooks は働きません。`issue_create`・`pr_create`・`pr_merge` の確認は、MCP クライアント自身の確認だけになります。
78
78
  これらのツールは自動で許可しないでください。また、`--help` を打つと、プラグインで出る補足の節は出ません。
79
79
 
80
80
  ## ツール
81
81
 
82
+ ツール名は `<対象>_<動詞>` の形です。
83
+
82
84
  | ツール | 内容 |
83
85
  |---|---|
84
- | `add_to_project` | プロジェクトボードに Issue を足す(pecot の外で作った Issue 用) |
85
- | `update_issue_status` | Issue 番号でボードのステータスを更新する |
86
- | `create_branch` | Issue に紐づくブランチを作る |
87
- | `delete_branch` | リモートブランチを削除する(保護ブランチは消さない) |
88
86
  | `project_list` | 使えるプロジェクトを一覧する |
89
87
  | `project_search` | GitHub API でプロジェクトを検索する |
90
88
  | `project_init` | 既存のプロジェクトに pecot-workflow のフィールドを足す |
91
89
  | `project_create` | プロジェクトを新規に作る |
92
- | `project_info` | プロジェクトの情報をまとめて表示する |
93
90
  | `project_activate` | 初期化済みのプロジェクトを有効にする |
94
- | `project_set_repo` | プロジェクトの設定にリポジトリを足す・更新する |
95
- | `project_set_aggregation_repo` | Epic の集約先リポジトリを設定する |
96
- | `project_unset_aggregation_repo` | Epic の集約先リポジトリを解除する |
97
- | `project_show_aggregation_repo` | Epic の集約先リポジトリを表示する |
98
- | `issue_create` | frontmatter 付きの Markdown から Issue を作る |
99
- | `issue_quick` | 自由形式のメッセージから Issue をすぐ作る |
100
- | `issue_read` | Issue の詳細を必要な項目だけ取得する |
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
101
  | `issue_comment` | Issue にコメントを投稿する |
102
+ | `issue_block` | Issue に前提(blocked by)を付ける。付いている前提の種類と理由を変えるのにも使う |
103
+ | `issue_unblock` | Issue から前提(blocked by)を外す |
102
104
  | `issue_reopen` | 閉じた Issue を開き直す(ボードのステータスも戻す) |
103
- | `pr_cleanup` | マージ後の後処理をする(Issue のクローズ、ブランチ削除、ローカルの整理) |
104
- | `pr_create` | PR を作る |
105
- | `pr_preflight` | PR を作る前に確かめる情報をまとめて表示する |
106
- | `pr_read` | PR の詳細を必要な項目だけ取得する |
107
- | `session_status` | セッションのフラグ、ブランチ、推定した Issue を表示する |
105
+ | `session_start` | Issue の作業を始める(ブランチを作り、ボードを Active にし、作業対象を記録する) |
106
+ | `session_show` | セッションのフラグ、ブランチ、推定した Issue を表示する |
108
107
  | `session_restore` | 失われたセッションのフラグをブランチから復元する |
109
- | `release_preflight` | リリース前の確認をする |
108
+ | `session_finish` | 作業を終える(マージ後の後処理として、Issue のクローズ、ブランチ削除、ローカルの整理をする) |
109
+ | `pr_create` | PR を作る |
110
+ | `pr_show` | PR の詳細を必要な項目だけ取得する |
111
+ | `pr_check` | PR を作る前に確かめる情報をまとめて表示する |
112
+ | `pr_merge` | PR をマージする(スタックの中の PR は最下段だけ) |
113
+ | `pr_restack` | 積んだブランチを、base にしたブランチの新しい位置へ載せ直す |
114
+ | `release_check` | リリース前の確認をする |
110
115
  | `release_create` | GitHub のリリースとタグを作る(ノートは CHANGELOG から取る) |
111
116
  | `release_merge` | リリースの PR を通常のマージで取り込む |
112
- | `security_sync` | 開いている Tracker のセキュリティアラートの一覧を書き直す |
113
- | `dependabot_sync` | 開いている Tracker の Dependabot PR の一覧を書き直す |
117
+ | `tracker_sync` | 開いている Tracker の一覧を書き直す(`source` が `dependabot` なら Dependabot PR、`security` ならセキュリティアラート) |
114
118
  | `worktree_add` | worktree を作る |
115
119
  | `worktree_remove` | worktree を削除する |
116
120
  | `worktree_init` | メイン worktree に worktree の設定ファイルを作る |
117
121
  | `worktree_link` | 既存の worktree にシンボリックリンクを適用・更新する |
122
+ | `branch_delete` | リモートブランチを削除する(保護ブランチは消さない) |
118
123
 
119
124
  ## 失敗したとき
120
125
 
121
126
  - 初回の起動は依存の取得に時間がかかる。Claude Code で起動が 30 秒を超えて失敗したら、環境変数 `MCP_TIMEOUT` を延ばす
122
- - ツールが失敗すると、結果の末尾に `exit code: <n>` の行が付く。標準出力が空のときは、結果は標準エラーだけになる
127
+ - ツールの結果は JSON で返る。失敗すると `isError` が真になり、原因の名前が `kind`、失敗の文が `detail` に入る。子プロセスの出力は `log` に入る
123
128
  - `EBADDEVENGINES` で止まるときは、登録の `args` に `--prefix=/` が付いているか確認する
124
129
 
125
130
  ## 版
package/cli/dist/cli.js CHANGED
@@ -31,7 +31,8 @@ import { COMMANDS, findCommand } from './commands/registry.js';
31
31
  import { createOutput, createProcessIo } from './commands/output.js';
32
32
  import { formatResolvedRepository } from './commands/repository-display.js';
33
33
  import { outputWidth } from './commands/rich-panel.js';
34
- import { COMMAND_SYNOPSIS, MISSING_COMMAND_MESSAGE, noSuchCommandMessage, noSuchOptionMessage, USAGE_EXIT_CODE, UsageError, } from './commands/usage-error.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';
35
36
  import { readVersion } from './version.js';
36
37
  function isUnderGroup(path, group) {
37
38
  return group.every((segment, index) => path.at(index) === segment);
@@ -54,6 +55,9 @@ function resolveCommand(group, rest, commands) {
54
55
  .filter(command => command.path.length > group.length && isUnderGroup(command.path, group))
55
56
  .map(command => command.path.slice(group.length, group.length + 1).join(''));
56
57
  if (!names.includes(name)) {
58
+ const renamed = findRenamedCommand(path);
59
+ if (renamed !== undefined)
60
+ throw new UsageError(renamedCommandMessage(...renamed), context);
57
61
  const possibilities = closeMatches(name, [...new Set(names)]);
58
62
  throw new UsageError(noSuchCommandMessage(name, possibilities), context);
59
63
  }
@@ -80,6 +84,7 @@ function showRepository(repository, context) {
80
84
  return 0;
81
85
  }
82
86
  catch (error) {
87
+ // eslint-disable-next-line no-restricted-syntax -- CLI の最上位でグローバルの --repo を読むときだけ出る
83
88
  if (error instanceof InvalidValueError)
84
89
  context.io.stderr(`error: --repo: ${error.message}\n`);
85
90
  else if (error instanceof AmbiguousRepositoryError)
@@ -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,69 @@
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, DRY_RUN_FIELD } from './output.js';
10
+ const BOARD_ADD_OUTPUT = z.strictObject({
11
+ issue: z.string().describe('Issue (owner/repo/N)'),
12
+ added: z.boolean().describe('true when the Issue is on the board (on dry_run, would be added)'),
13
+ status: z.string().optional().describe('Status set on the board (omitted when status is empty)'),
14
+ dryRun: DRY_RUN_FIELD,
15
+ });
16
+ const BOARD_ADD = defineCommand({
17
+ path: ['board', 'add'],
18
+ description: 'Add an Issue to the project board with a GraphQL mutation (for an Issue created outside pecot)',
19
+ input: z.object({
20
+ issue_ref: z.string().describe(ISSUE_REF_DESCRIPTION),
21
+ status: z.string().default('ready').describe('Initial status (backlog/pending/blocked/ready/active/in_review/archived)'),
22
+ dry_run: z.boolean().default(false).describe('Show what would change without writing anything'),
23
+ }),
24
+ output: BOARD_ADD_OUTPUT,
25
+ positional: ['issue_ref'],
26
+ shortFlags: { status: '-s', dry_run: '-n' },
27
+ interactive: false,
28
+ run: async (input, io) => {
29
+ const output = createOutput(input.dry_run, io);
30
+ return await runWithExit(async () => {
31
+ const { status } = input;
32
+ if (status !== '' && !VALID_STATUSES.has(status))
33
+ exitInvalidStatus(output, status);
34
+ const config = requireActiveConfigPlain(output);
35
+ if (status !== '' && !isStatusConfigured(config, status)) {
36
+ stopWith(output, notConfiguredMessage(status), 'status-not-configured');
37
+ }
38
+ const { owner, repository, number } = parseIssueReferenceOrExit(output, input.repo, input.issue_ref);
39
+ const target = `Issue ${issuePath(owner, repository, number)}`;
40
+ try {
41
+ const client = await connectToProject(output, config, owner, repository);
42
+ if (input.dry_run) {
43
+ // Issue が読めることだけ確かめる
44
+ await client.getIssueNodeId(owner, repository, number);
45
+ output.planned({ verb: 'add', target: `${target} to project` });
46
+ if (status !== '')
47
+ output.planned({ verb: 'set', target: `${target} status ${status}` });
48
+ output.result({ issue: issuePath(owner, repository, number), added: true, ...status !== '' && { status } });
49
+ return;
50
+ }
51
+ const { itemId } = await addIssueToBoard(client, config, owner, repository, number, undefined);
52
+ output.done({ verb: 'add', target: `${target} to project` });
53
+ output.result({ issue: issuePath(owner, repository, number), added: true });
54
+ if (status !== '') {
55
+ await setIssueField(client, config, itemId, 'workflow', status);
56
+ output.done({ verb: 'set', target: `${target} status ${status}` });
57
+ output.result({ status });
58
+ }
59
+ }
60
+ catch (error) {
61
+ if (!(error instanceof GitHubAPIError))
62
+ throw error;
63
+ stopWith(output, `could not add ${target} to project: ${error.message}`, kindOfFailure(error));
64
+ }
65
+ });
66
+ },
67
+ });
68
+ export const BOARD_ADD_COMMANDS = [BOARD_ADD];
69
+ //# sourceMappingURL=board-add.js.map
@@ -0,0 +1,69 @@
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, ReadinessCache } from './issue-readiness.js';
8
+ import type { HintedText } from './command-hint.js';
9
+ import type { BoardMoveLine } from './issue-board.js';
10
+ import type { Output } from './output.js';
11
+ /**
12
+ board sync と pr create が判定し直す列
13
+ */
14
+ export declare const SYNCED_COLUMNS: ReadonlySet<string>;
15
+ /**
16
+ 動かす先の値がボードに無いときの warning の文
17
+ */
18
+ export declare function missingWarning(missing: ReadonlySet<MissingValue>): HintedText;
19
+ export interface BoardTarget {
20
+ readonly item: BoardItem;
21
+ readonly key: string;
22
+ readonly ref: IssueReference;
23
+ }
24
+ export interface JudgedTarget {
25
+ readonly target: BoardTarget;
26
+ readonly result: IssueReadiness;
27
+ }
28
+ export interface JudgeBoardOptions {
29
+ /**
30
+ 判定の対象にする列
31
+ */
32
+ readonly columns: ReadonlySet<string>;
33
+ /**
34
+ 個別の読み取りを省く Issue。'skip' は判定から外し、IssueSnapshot は一覧の値だけで判定し、undefined は個別に読む
35
+ */
36
+ readonly withoutRead: (target: BoardTarget, progress: BoardProgress | undefined) => IssueSnapshot | 'skip' | undefined;
37
+ /**
38
+ 判定し直す呼び出しと共有するキャッシュ。無ければ判定ごとに作る
39
+ */
40
+ readonly cache?: ReadinessCache;
41
+ }
42
+ /**
43
+ 対象の列の Issue の前提と着手の跡を読み、輪も含めて判定する。
44
+ Issue の依存関係に対応しない GHES では undefined を返す。warning は呼ぶ側が出す
45
+ */
46
+ export declare function judgeBoard(client: GitHubClient, config: ProjectConfig, items: readonly BoardItem[], progress: ReadonlyMap<string, BoardProgress>, options: JudgeBoardOptions): Promise<readonly JudgedTarget[] | undefined>;
47
+ /**
48
+ 列と札を動かす処理が共有する、出力先・クライアント・設定・表示の基準のリポ
49
+ */
50
+ export interface BoardContext {
51
+ readonly out: Readonly<Output>;
52
+ readonly client: GitHubClient;
53
+ readonly config: ProjectConfig;
54
+ readonly home: RepositoryReference | undefined;
55
+ }
56
+ /**
57
+ 判定の結果に合わせて、列と札を動かす。読めない Issue は warning にし、ボードに無い値は最後に 1 行の warning にまとめる。
58
+ isDryRun は同じ文を予定の行で出し、書かない。書き込みに失敗した Issue の数と、行に出した列と札(dry-run では予定)を返す。
59
+ moves を渡すと、行に出した列と札をそこへ足していくので、途中で例外が出ても書けた分が残る
60
+ */
61
+ export declare function applyJudgedMoves(context: Readonly<BoardContext>, judged: readonly JudgedTarget[], isDryRun?: boolean, moves?: BoardMoveLine[]): Promise<{
62
+ readonly failures: number;
63
+ readonly moves: readonly BoardMoveLine[];
64
+ }>;
65
+ /**
66
+ 判定から、列と札の動かし方を決める。info の数え方と board sync の書き込みが同じ規則を使う(FR-083)
67
+ */
68
+ export declare function boardMoveOf(config: ProjectConfig, target: BoardTarget, result: JudgedIssue): BoardMove | undefined;
69
+ //# sourceMappingURL=board-judgment.d.ts.map
@@ -0,0 +1,150 @@
1
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- 引数の型は readonly にできない */
2
+ // ボードの Issue の読み取り・判定と、列と札の動かし方。board show(数えるだけ)と、board sync・pr create(書く)が共有する。
3
+ import { decideBoardMove } from '../domain/board-move.js';
4
+ import { getOptionId } from '../domain/config.js';
5
+ import { boardItemKey } from '../domain/format.js';
6
+ import { compareStrings } from '../domain/python-format.js';
7
+ import { cycleThrough, describeReadiness, displayReference, hasStarted, TRACKER_TITLE_PREFIX } from '../domain/readiness.js';
8
+ import { createIssueReference, issueReferenceKey } from '../domain/reference-parser.js';
9
+ import { createRepositoryReference, splitOwnerRepository } from '../domain/repository-resolver.js';
10
+ import { DependenciesUnsupportedError, GitHubAPIError } from '../infra/github/errors.js';
11
+ import { blockedByReadCount, createReadinessCache, judgeSnapshot, prerequisiteKeys, readIssueSnapshot } from './issue-readiness.js';
12
+ import { mapWithLimit } from './board-view.js';
13
+ import { commandHint, hinted } from './command-hint.js';
14
+ import { applyBoardMove, planBoardMove } from './issue-board.js';
15
+ /**
16
+ 前提の読み取りを並列に行う数の上限
17
+ */
18
+ const READ_MAX_WORKERS = 8;
19
+ /**
20
+ board sync と pr create が判定し直す列
21
+ */
22
+ export const SYNCED_COLUMNS = new Set(['Ready', 'Blocked', 'Active', 'In Review']);
23
+ /**
24
+ 動かす先の値がボードに無いときの warning の文
25
+ */
26
+ export function missingWarning(missing) {
27
+ const names = [...missing].toSorted(compareStrings);
28
+ return hinted `the board has no option ${names.join(', ')}; add ${names.length === 1 ? 'it' : 'them'} with ${commandHint(['project', 'init'])}`;
29
+ }
30
+ // 対象の列の Issue か。PR と Tracker は対象にしない
31
+ function toTarget(item, columns) {
32
+ const key = boardItemKey(item);
33
+ const split = splitOwnerRepository(item.content.repository ?? '');
34
+ const { number } = item.content;
35
+ const url = typeof item.content.url === 'string' ? item.content.url : '';
36
+ const title = typeof item.title === 'string' ? item.title : '';
37
+ const isExcluded = url.includes('/pull/') || title.startsWith(TRACKER_TITLE_PREFIX);
38
+ const isTarget = !isExcluded && typeof item.workflow === 'string' && columns.has(item.workflow) && key !== undefined && split !== undefined && typeof number === 'number';
39
+ return isTarget ? { item, key, ref: createIssueReference(createRepositoryReference(split.owner, split.repository), number) } : undefined;
40
+ }
41
+ /**
42
+ 対象の列の Issue の前提と着手の跡を読み、輪も含めて判定する。
43
+ Issue の依存関係に対応しない GHES では undefined を返す。warning は呼ぶ側が出す
44
+ */
45
+ export async function judgeBoard(client, config, items, progress, options) {
46
+ const targets = items.flatMap(item => toTarget(item, options.columns) ?? []);
47
+ const state = { isUnsupported: false };
48
+ const reads = await mapWithLimit(targets, READ_MAX_WORKERS, async (target) => {
49
+ if (state.isUnsupported)
50
+ return undefined;
51
+ const known = progress.get(target.key);
52
+ const local = options.withoutRead(target, known);
53
+ if (local === 'skip')
54
+ return undefined;
55
+ if (local !== undefined)
56
+ return { target, snapshot: local };
57
+ try {
58
+ return { target, snapshot: await readIssueSnapshot(client, config, target.ref, blockedByReadCount(known?.blockedBy)) };
59
+ }
60
+ catch (error) {
61
+ if (!(error instanceof DependenciesUnsupportedError))
62
+ throw error;
63
+ state.isUnsupported = true;
64
+ return undefined;
65
+ }
66
+ });
67
+ if (state.isUnsupported)
68
+ return undefined;
69
+ const pairs = reads.flatMap(read => read ?? []);
70
+ const edges = new Map();
71
+ for (const { target, snapshot } of pairs) {
72
+ if (snapshot.kind === 'snapshot')
73
+ edges.set(issueReferenceKey(target.ref), prerequisiteKeys(snapshot));
74
+ }
75
+ const cache = options.cache ?? createReadinessCache();
76
+ return await mapWithLimit(pairs, READ_MAX_WORKERS, async ({ target, snapshot }) => {
77
+ if (snapshot.kind === 'unreadable')
78
+ return { target, result: snapshot };
79
+ try {
80
+ return { target, result: await judgeSnapshot(client, snapshot, cache, cycleThrough(issueReferenceKey(target.ref), edges)) };
81
+ }
82
+ catch (error) {
83
+ if (error instanceof GitHubAPIError)
84
+ return { target, result: { kind: 'unreadable', reason: error.message } };
85
+ throw error;
86
+ }
87
+ });
88
+ }
89
+ /**
90
+ 判定の結果に合わせて、列と札を動かす。読めない Issue は warning にし、ボードに無い値は最後に 1 行の warning にまとめる。
91
+ isDryRun は同じ文を予定の行で出し、書かない。書き込みに失敗した Issue の数と、行に出した列と札(dry-run では予定)を返す。
92
+ moves を渡すと、行に出した列と札をそこへ足していくので、途中で例外が出ても書けた分が残る
93
+ */
94
+ export async function applyJudgedMoves(context, judged, isDryRun = false, moves = []) {
95
+ const { out, client, config, home } = context;
96
+ const missing = new Set();
97
+ let failures = 0;
98
+ for (const { target, result } of judged) {
99
+ if (result.kind === 'unreadable') {
100
+ out.warning(`could not judge ${displayReference(target.ref, home)}: ${result.reason.replaceAll(/\s+/gu, ' ')}`);
101
+ continue;
102
+ }
103
+ const { readiness } = result;
104
+ const move = boardMoveOf(config, target, result);
105
+ if (readiness === undefined || move === undefined)
106
+ continue;
107
+ for (const value of move.missing)
108
+ missing.add(value);
109
+ const text = describeReadiness(readiness, result.prerequisites, target.ref.repository);
110
+ const destination = { ref: target.ref, home };
111
+ const itemId = target.item.id;
112
+ if (isDryRun) {
113
+ const planned = planBoardMove(out, destination, move, text);
114
+ if (planned !== undefined)
115
+ moves.push(planned);
116
+ }
117
+ else if (typeof itemId === 'string') {
118
+ const applied = await applyBoardMove(out, client, config, itemId, destination, move, text);
119
+ if (applied.hasFailed)
120
+ failures += 1;
121
+ if (applied.written !== undefined)
122
+ moves.push(applied.written);
123
+ }
124
+ }
125
+ if (missing.size > 0)
126
+ out.warning(missingWarning(missing));
127
+ return { failures, moves };
128
+ }
129
+ /**
130
+ 判定から、列と札の動かし方を決める。info の数え方と board sync の書き込みが同じ規則を使う(FR-083)
131
+ */
132
+ export function boardMoveOf(config, target, result) {
133
+ return decideBoardMove({
134
+ // 常に真でよい。readBoard が返すのは OPEN の Issue だけで、Tracker を対象から外し、Epic の readiness が undefined になる
135
+ eligible: true,
136
+ column: target.item.workflow ?? undefined,
137
+ label: result.target.label,
138
+ hasStarted: hasStarted(result.target),
139
+ hasPrerequisites: result.prerequisites.length > 0,
140
+ readiness: result.readiness,
141
+ // 札を書いたのが自動処理かは記録していない(data-model.md の 6)
142
+ labelWrittenByAutomation: false,
143
+ available: {
144
+ blocked: getOptionId(config, 'workflow', 'blocked') !== undefined,
145
+ needsAttention: getOptionId(config, 'status', 'needs_attention') !== undefined,
146
+ todo: getOptionId(config, 'status', 'todo') !== undefined,
147
+ },
148
+ });
149
+ }
150
+ //# sourceMappingURL=board-judgment.js.map
@@ -0,0 +1,3 @@
1
+ import type { CommandDefinition } from './command-definition.js';
2
+ export declare const BOARD_MOVE_COMMANDS: readonly CommandDefinition[];
3
+ //# sourceMappingURL=board-move.d.ts.map
@@ -0,0 +1,65 @@
1
+ // board move。cli/commands/issue.py の update_issue_status の移植。
2
+ import { z } from 'zod';
3
+ import { GitHubAPIError } from '../infra/github/errors.js';
4
+ import { defineCommand } from './command-definition.js';
5
+ import { isStatusConfigured, setIssueField } from './issue-board.js';
6
+ import { commandHint, hinted } from './command-hint.js';
7
+ import { stopWith, requireActiveConfigPlain } from './command-stop.js';
8
+ import { kindOfFailure } from './failure.js';
9
+ import { connectToProject, exitInvalidStatus, ISSUE_REF_DESCRIPTION, issuePath, notConfiguredMessage, parseIssueReferenceOrExit, runWithExit, VALID_STATUSES, } from './issue-shared.js';
10
+ import { createOutput, DRY_RUN_FIELD } from './output.js';
11
+ const BOARD_MOVE_OUTPUT = z.strictObject({
12
+ issue: z.string().describe('Issue (owner/repo/N)'),
13
+ status: z.string().describe('Status set on the board (on dry_run, to be set)'),
14
+ dryRun: DRY_RUN_FIELD,
15
+ });
16
+ const BOARD_MOVE = defineCommand({
17
+ path: ['board', 'move'],
18
+ description: 'Update the status of an Issue on the project board by Issue number (pecot commands normally set the status themselves)',
19
+ input: z.object({
20
+ issue_ref: z.string().describe(ISSUE_REF_DESCRIPTION),
21
+ status: z.string().describe('Status (backlog/pending/blocked/ready/active/in_review/archived)'),
22
+ dry_run: z.boolean().default(false).describe('Show what would change without writing anything'),
23
+ }),
24
+ output: BOARD_MOVE_OUTPUT,
25
+ positional: ['issue_ref', 'status'],
26
+ shortFlags: { dry_run: '-n' },
27
+ interactive: false,
28
+ run: async (input, io) => {
29
+ const output = createOutput(input.dry_run, io);
30
+ return await runWithExit(async () => {
31
+ const { status } = input;
32
+ if (!VALID_STATUSES.has(status))
33
+ exitInvalidStatus(output, status);
34
+ const config = requireActiveConfigPlain(output);
35
+ const { owner, repository, number } = parseIssueReferenceOrExit(output, input.repo, input.issue_ref);
36
+ const target = `Issue ${issuePath(owner, repository, number)}`;
37
+ try {
38
+ const client = await connectToProject(output, config, owner, repository);
39
+ const itemId = await client.getItemIdByIssue(config.project.id, owner, repository, number);
40
+ if (itemId === undefined) {
41
+ stopWith(output, hinted `${target} is not on the project board\nhint: add it to the board first with ${commandHint(['board', 'add'], { issue_ref: `${owner}/${repository}/${String(number)}` })}`, 'not-on-board');
42
+ }
43
+ if (input.dry_run) {
44
+ if (!isStatusConfigured(config, status))
45
+ stopWith(output, notConfiguredMessage(status), 'status-not-configured');
46
+ output.planned({ verb: 'set', target: `${target} status ${status}` });
47
+ output.result({ issue: issuePath(owner, repository, number), status });
48
+ return;
49
+ }
50
+ if (!await setIssueField(client, config, itemId, 'workflow', status)) {
51
+ stopWith(output, notConfiguredMessage(status), 'status-not-configured');
52
+ }
53
+ output.done({ verb: 'set', target: `${target} status ${status}` });
54
+ output.result({ issue: issuePath(owner, repository, number), status });
55
+ }
56
+ catch (error) {
57
+ if (!(error instanceof GitHubAPIError))
58
+ throw error;
59
+ stopWith(output, `could not set ${target} status ${status}: ${error.message}`, kindOfFailure(error));
60
+ }
61
+ });
62
+ },
63
+ });
64
+ export const BOARD_MOVE_COMMANDS = [BOARD_MOVE];
65
+ //# sourceMappingURL=board-move.js.map
@@ -0,0 +1,34 @@
1
+ import type { ProjectConfig } from '../domain/config.js';
2
+ import type { BoardItem, BoardProgress, StackableChain } from '../domain/format.js';
3
+ import { JSON_NULL } from '../domain/json-null.js';
4
+ import type { GitHubClient } from '../infra/github/index.js';
5
+ import type { BoardReadinessJson } from './issue-readiness.js';
6
+ import type { Output } from './output.js';
7
+ export interface BoardReadiness {
8
+ /**
9
+ boardItemKey → 表の Readiness の列の文。undefined なら列を出さない
10
+ */
11
+ readonly texts: ReadonlyMap<string, string> | undefined;
12
+ /**
13
+ boardItemKey → JSON の readiness。undefined なら JSON に足さない
14
+ */
15
+ readonly json: ReadonlyMap<string, BoardReadinessJson> | undefined;
16
+ readonly chains: readonly StackableChain[];
17
+ /**
18
+ board sync が列か札を動かしそうな Ready・Blocked の Issue の数
19
+ */
20
+ readonly mismatches: number;
21
+ }
22
+ /**
23
+ 判定を読まずに、依存関係に対応しない GHES と同じ扱いにする。warning を 1 回出す
24
+ */
25
+ export declare function skipBoardReadiness(out: Readonly<Output>): BoardReadiness;
26
+ /**
27
+ Ready・Blocked の Issue の前提を読んで判定する。items は表示するアイテム(--repo で絞った後)。列と札は動かさない
28
+ */
29
+ export declare function readBoardReadiness(out: Readonly<Output>, client: GitHubClient, config: ProjectConfig, items: readonly BoardItem[], repository: string | undefined, progress?: ReadonlyMap<string, BoardProgress>): Promise<BoardReadiness>;
30
+ /**
31
+ アイテムのキーを引いて JSON の readiness を返す。判定が無ければ null
32
+ */
33
+ export declare function readinessOf(readiness: BoardReadiness, item: BoardItem): BoardReadinessJson | typeof JSON_NULL;
34
+ //# sourceMappingURL=board-readiness.d.ts.map
@@ -0,0 +1,108 @@
1
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- 引数の型は readonly にできない */
2
+ // board show の着手の判定。盤上の Ready・Blocked の Issue の前提を読んで表示する。列と札は動かさない。
3
+ import { homeRepositoryOf } from '../domain/config.js';
4
+ import { boardItemKey } from '../domain/format.js';
5
+ import { isEpicIssue } from '../domain/issue-kind.js';
6
+ import { JSON_NULL } from '../domain/json-null.js';
7
+ import { describeReadiness, describeUnknown, displayReference, progressionsFromReadiness, stackChains } from '../domain/readiness.js';
8
+ import { createIssueReference, issueReferenceKey } from '../domain/reference-parser.js';
9
+ import { createRepositoryReference, splitOwnerRepository } from '../domain/repository-resolver.js';
10
+ import { boardMoveOf, judgeBoard } from './board-judgment.js';
11
+ import { readinessJson, snapshotWithoutPrerequisites } from './issue-readiness.js';
12
+ const JUDGED_STATUSES = new Set(['Ready', 'Blocked']);
13
+ // 前提の無い Issue を、一覧の値だけで判定の入力にする。前提の件数が一覧に無ければ undefined
14
+ function localSnapshot(config, target, progress) {
15
+ if (progress?.blockedBy !== 0)
16
+ return undefined;
17
+ const split = splitOwnerRepository(progress.parent?.repository ?? '');
18
+ const parent = split === undefined || progress.parent === undefined ? undefined : createIssueReference(createRepositoryReference(split.owner, split.repository), progress.parent.number);
19
+ const isEpic = isEpicIssue({ issue_type: progress.issueType, sub_issues_total: progress.subIssues });
20
+ return snapshotWithoutPrerequisites(config, {
21
+ title: typeof target.item.title === 'string' ? target.item.title : '',
22
+ parent,
23
+ target: {
24
+ ref: target.ref,
25
+ state: 'open',
26
+ column: target.item.workflow ?? undefined,
27
+ label: progress.label,
28
+ kind: isEpic ? 'epic' : 'task',
29
+ // 着手の跡は一覧に無いので、info の案内は「may be」と書く
30
+ branches: [],
31
+ pullRequests: [],
32
+ },
33
+ });
34
+ }
35
+ // 小文字のキーを、元の参照(無ければキーから作る)に戻して表記する
36
+ function displayKey(key, references, home) {
37
+ const known = references.get(key);
38
+ const [repository = '', number = ''] = key.split('#', 2);
39
+ const split = splitOwnerRepository(repository);
40
+ return known === undefined && split === undefined ? key : displayReference(known ?? createIssueReference(createRepositoryReference(split?.owner ?? '', split?.repository ?? ''), Number(number)), home);
41
+ }
42
+ function unsupportedWarning(out) {
43
+ out.warning('this GitHub Enterprise Server does not support issue dependencies (blockedBy); the Readiness column is omitted');
44
+ }
45
+ const PLAIN = { texts: undefined, json: undefined, chains: [], mismatches: 0 };
46
+ /**
47
+ 判定を読まずに、依存関係に対応しない GHES と同じ扱いにする。warning を 1 回出す
48
+ */
49
+ export function skipBoardReadiness(out) {
50
+ unsupportedWarning(out);
51
+ return PLAIN;
52
+ }
53
+ /**
54
+ Ready・Blocked の Issue の前提を読んで判定する。items は表示するアイテム(--repo で絞った後)。列と札は動かさない
55
+ */
56
+ export async function readBoardReadiness(out, client, config, items, repository, progress = new Map()) {
57
+ const judged = await judgeBoard(client, config, items, progress, {
58
+ columns: JUDGED_STATUSES,
59
+ withoutRead: (target, known) => localSnapshot(config, target, known),
60
+ });
61
+ if (judged === undefined) {
62
+ unsupportedWarning(out);
63
+ return PLAIN;
64
+ }
65
+ const home = homeRepositoryOf(config, repository);
66
+ const texts = new Map();
67
+ const json = new Map();
68
+ const readinessByKey = new Map();
69
+ const parents = new Map();
70
+ const references = new Map(judged.map(({ target }) => [target.key, target.ref]));
71
+ let mismatches = 0;
72
+ for (const { target, result } of judged) {
73
+ if (result.kind === 'unreadable') {
74
+ const text = describeUnknown(result.reason.replaceAll(/\s+/gu, ' '));
75
+ texts.set(target.key, text);
76
+ json.set(target.key, { kind: 'unknown', stackOn: JSON_NULL, reason: JSON_NULL, text });
77
+ continue;
78
+ }
79
+ if (result.parent !== undefined)
80
+ parents.set(target.key, result.parent);
81
+ const { readiness } = result;
82
+ if (readiness === undefined)
83
+ continue;
84
+ const text = describeReadiness(readiness, result.prerequisites, target.ref.repository);
85
+ texts.set(target.key, text);
86
+ json.set(target.key, readinessJson(readiness, text));
87
+ readinessByKey.set(target.key, readiness);
88
+ const move = boardMoveOf(config, target, result);
89
+ if (move?.column !== undefined || move?.label !== undefined)
90
+ mismatches += 1;
91
+ if (readiness.stackOn !== undefined)
92
+ references.set(issueReferenceKey(readiness.stackOn.issue), readiness.stackOn.issue);
93
+ }
94
+ const chains = stackChains(progressionsFromReadiness(readinessByKey)).filter(chain => chain.length >= 2).map((chain) => {
95
+ const parentKey = chain.find(key => parents.has(key));
96
+ const parent = parentKey === undefined ? undefined : parents.get(parentKey);
97
+ return { epic: parent === undefined ? undefined : displayReference(parent, home), chain: chain.map(key => displayKey(key, references, home)) };
98
+ });
99
+ return { texts, json, chains, mismatches };
100
+ }
101
+ /**
102
+ アイテムのキーを引いて JSON の readiness を返す。判定が無ければ null
103
+ */
104
+ export function readinessOf(readiness, item) {
105
+ const key = boardItemKey(item);
106
+ return (key === undefined ? undefined : readiness.json?.get(key)) ?? JSON_NULL;
107
+ }
108
+ //# sourceMappingURL=board-readiness.js.map
@@ -0,0 +1,3 @@
1
+ import type { CommandDefinition } from './command-definition.js';
2
+ export declare const BOARD_SHOW_COMMANDS: readonly CommandDefinition[];
3
+ //# sourceMappingURL=board-show.d.ts.map