@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.
- package/.claude-plugin/plugin.json +8 -0
- package/LICENSE +21 -0
- package/README.md +184 -2
- package/bin/pecot-workflow-mcp.mjs +10 -0
- package/cli/dist/cli.d.ts +26 -0
- package/cli/dist/cli.js +227 -0
- package/cli/dist/commands/board-add.d.ts +3 -0
- package/cli/dist/commands/board-add.js +59 -0
- package/cli/dist/commands/board-judgment.d.ts +60 -0
- package/cli/dist/commands/board-judgment.js +144 -0
- package/cli/dist/commands/board-move.d.ts +3 -0
- package/cli/dist/commands/board-move.js +57 -0
- package/cli/dist/commands/board-readiness.d.ts +34 -0
- package/cli/dist/commands/board-readiness.js +108 -0
- package/cli/dist/commands/board-show.d.ts +3 -0
- package/cli/dist/commands/board-show.js +72 -0
- package/cli/dist/commands/board-sync.d.ts +3 -0
- package/cli/dist/commands/board-sync.js +111 -0
- package/cli/dist/commands/board-view.d.ts +62 -0
- package/cli/dist/commands/board-view.js +191 -0
- package/cli/dist/commands/board.d.ts +3 -0
- package/cli/dist/commands/board.js +12 -0
- package/cli/dist/commands/branch.d.ts +3 -0
- package/cli/dist/commands/branch.js +100 -0
- package/cli/dist/commands/cell-table.d.ts +3 -0
- package/cli/dist/commands/cell-table.js +495 -0
- package/cli/dist/commands/command-binding.d.ts +26 -0
- package/cli/dist/commands/command-binding.js +270 -0
- package/cli/dist/commands/command-definition.d.ts +150 -0
- package/cli/dist/commands/command-definition.js +105 -0
- package/cli/dist/commands/command-help.d.ts +8 -0
- package/cli/dist/commands/command-help.js +173 -0
- package/cli/dist/commands/command-hint.d.ts +5 -0
- package/cli/dist/commands/command-hint.js +13 -0
- package/cli/dist/commands/command-stop.d.ts +21 -0
- package/cli/dist/commands/command-stop.js +31 -0
- package/cli/dist/commands/directory-option.d.ts +7 -0
- package/cli/dist/commands/directory-option.js +48 -0
- package/cli/dist/commands/failure-kind.d.ts +3 -0
- package/cli/dist/commands/failure-kind.js +34 -0
- package/cli/dist/commands/failure.d.ts +19 -0
- package/cli/dist/commands/failure.js +59 -0
- package/cli/dist/commands/fuzzy.d.ts +7 -0
- package/cli/dist/commands/fuzzy.js +79 -0
- package/cli/dist/commands/github-client.d.ts +16 -0
- package/cli/dist/commands/github-client.js +33 -0
- package/cli/dist/commands/global-options.d.ts +25 -0
- package/cli/dist/commands/global-options.js +83 -0
- package/cli/dist/commands/help-layout.d.ts +40 -0
- package/cli/dist/commands/help-layout.js +117 -0
- package/cli/dist/commands/help.d.ts +8 -0
- package/cli/dist/commands/help.js +50 -0
- package/cli/dist/commands/input-schema.d.ts +14 -0
- package/cli/dist/commands/input-schema.js +56 -0
- package/cli/dist/commands/issue-board.d.ts +71 -0
- package/cli/dist/commands/issue-board.js +122 -0
- package/cli/dist/commands/issue-comment.d.ts +3 -0
- package/cli/dist/commands/issue-comment.js +215 -0
- package/cli/dist/commands/issue-create.d.ts +3 -0
- package/cli/dist/commands/issue-create.js +786 -0
- package/cli/dist/commands/issue-dependency.d.ts +3 -0
- package/cli/dist/commands/issue-dependency.js +282 -0
- package/cli/dist/commands/issue-readiness.d.ts +94 -0
- package/cli/dist/commands/issue-readiness.js +218 -0
- package/cli/dist/commands/issue-reopen.d.ts +3 -0
- package/cli/dist/commands/issue-reopen.js +115 -0
- package/cli/dist/commands/issue-shared.d.ts +172 -0
- package/cli/dist/commands/issue-shared.js +426 -0
- package/cli/dist/commands/issue-show.d.ts +3 -0
- package/cli/dist/commands/issue-show.js +169 -0
- package/cli/dist/commands/issue.d.ts +3 -0
- package/cli/dist/commands/issue.js +13 -0
- package/cli/dist/commands/names.d.ts +42 -0
- package/cli/dist/commands/names.js +78 -0
- package/cli/dist/commands/output.d.ts +90 -0
- package/cli/dist/commands/output.js +194 -0
- package/cli/dist/commands/pr-waiting.d.ts +20 -0
- package/cli/dist/commands/pr-waiting.js +106 -0
- package/cli/dist/commands/pr.d.ts +22 -0
- package/cli/dist/commands/pr.js +852 -0
- package/cli/dist/commands/project-sync.d.ts +92 -0
- package/cli/dist/commands/project-sync.js +282 -0
- package/cli/dist/commands/project.d.ts +6 -0
- package/cli/dist/commands/project.js +714 -0
- package/cli/dist/commands/registry.d.ts +6 -0
- package/cli/dist/commands/registry.js +30 -0
- package/cli/dist/commands/release.d.ts +10 -0
- package/cli/dist/commands/release.js +353 -0
- package/cli/dist/commands/renamed-commands.d.ts +26 -0
- package/cli/dist/commands/renamed-commands.js +53 -0
- package/cli/dist/commands/repository-display.d.ts +3 -0
- package/cli/dist/commands/repository-display.js +7 -0
- package/cli/dist/commands/repository-match.d.ts +14 -0
- package/cli/dist/commands/repository-match.js +34 -0
- package/cli/dist/commands/rich-panel.d.ts +22 -0
- package/cli/dist/commands/rich-panel.js +295 -0
- package/cli/dist/commands/session-finish.d.ts +3 -0
- package/cli/dist/commands/session-finish.js +267 -0
- package/cli/dist/commands/session-start.d.ts +3 -0
- package/cli/dist/commands/session-start.js +236 -0
- package/cli/dist/commands/session.d.ts +6 -0
- package/cli/dist/commands/session.js +214 -0
- package/cli/dist/commands/tracker-sync-dependabot.d.ts +7 -0
- package/cli/dist/commands/tracker-sync-dependabot.js +156 -0
- package/cli/dist/commands/tracker-sync-security.d.ts +7 -0
- package/cli/dist/commands/tracker-sync-security.js +153 -0
- package/cli/dist/commands/tracker-sync.d.ts +65 -0
- package/cli/dist/commands/tracker-sync.js +50 -0
- package/cli/dist/commands/tracker.d.ts +3 -0
- package/cli/dist/commands/tracker.js +18 -0
- package/cli/dist/commands/usage-error.d.ts +51 -0
- package/cli/dist/commands/usage-error.js +78 -0
- package/cli/dist/commands/value-types.d.ts +46 -0
- package/cli/dist/commands/value-types.js +94 -0
- package/cli/dist/commands/work-target.d.ts +22 -0
- package/cli/dist/commands/work-target.js +82 -0
- package/cli/dist/commands/worktree.d.ts +3 -0
- package/cli/dist/commands/worktree.js +339 -0
- package/cli/dist/domain/api-error-detail.d.ts +10 -0
- package/cli/dist/domain/api-error-detail.js +25 -0
- package/cli/dist/domain/batch-plan.d.ts +73 -0
- package/cli/dist/domain/batch-plan.js +114 -0
- package/cli/dist/domain/blocked-by-change.d.ts +99 -0
- package/cli/dist/domain/blocked-by-change.js +101 -0
- package/cli/dist/domain/board-move.d.ts +90 -0
- package/cli/dist/domain/board-move.js +92 -0
- package/cli/dist/domain/branch-name.d.ts +5 -0
- package/cli/dist/domain/branch-name.js +10 -0
- package/cli/dist/domain/changelog.d.ts +43 -0
- package/cli/dist/domain/changelog.js +107 -0
- package/cli/dist/domain/command-hint.d.ts +85 -0
- package/cli/dist/domain/command-hint.js +148 -0
- package/cli/dist/domain/config.d.ts +219 -0
- package/cli/dist/domain/config.js +310 -0
- package/cli/dist/domain/dependabot-pull-requests.d.ts +82 -0
- package/cli/dist/domain/dependabot-pull-requests.js +338 -0
- package/cli/dist/domain/dependabot-source.d.ts +51 -0
- package/cli/dist/domain/dependabot-source.js +4 -0
- package/cli/dist/domain/dependabot.d.ts +47 -0
- package/cli/dist/domain/dependabot.js +88 -0
- package/cli/dist/domain/errors.d.ts +24 -0
- package/cli/dist/domain/errors.js +36 -0
- package/cli/dist/domain/field-options.d.ts +31 -0
- package/cli/dist/domain/field-options.js +44 -0
- package/cli/dist/domain/format.d.ts +94 -0
- package/cli/dist/domain/format.js +234 -0
- package/cli/dist/domain/frontmatter.d.ts +137 -0
- package/cli/dist/domain/frontmatter.js +290 -0
- package/cli/dist/domain/git-runner.d.ts +10 -0
- package/cli/dist/domain/git-runner.js +4 -0
- package/cli/dist/domain/git-url.d.ts +17 -0
- package/cli/dist/domain/git-url.js +30 -0
- package/cli/dist/domain/issue-kind.d.ts +16 -0
- package/cli/dist/domain/issue-kind.js +16 -0
- package/cli/dist/domain/issue-order.d.ts +55 -0
- package/cli/dist/domain/issue-order.js +65 -0
- package/cli/dist/domain/issue-readout.d.ts +143 -0
- package/cli/dist/domain/issue-readout.js +4 -0
- package/cli/dist/domain/json-null.d.ts +2 -0
- package/cli/dist/domain/json-null.js +5 -0
- package/cli/dist/domain/json.d.ts +21 -0
- package/cli/dist/domain/json.js +47 -0
- package/cli/dist/domain/prerequisites.d.ts +32 -0
- package/cli/dist/domain/prerequisites.js +192 -0
- package/cli/dist/domain/pull-request.d.ts +201 -0
- package/cli/dist/domain/pull-request.js +281 -0
- package/cli/dist/domain/python-format.d.ts +105 -0
- package/cli/dist/domain/python-format.js +304 -0
- package/cli/dist/domain/readiness.d.ts +199 -0
- package/cli/dist/domain/readiness.js +391 -0
- package/cli/dist/domain/reference-parser.d.ts +51 -0
- package/cli/dist/domain/reference-parser.js +123 -0
- package/cli/dist/domain/release.d.ts +53 -0
- package/cli/dist/domain/release.js +65 -0
- package/cli/dist/domain/repository-policy.d.ts +38 -0
- package/cli/dist/domain/repository-policy.js +66 -0
- package/cli/dist/domain/repository-resolver.d.ts +57 -0
- package/cli/dist/domain/repository-resolver.js +122 -0
- package/cli/dist/domain/sections.d.ts +69 -0
- package/cli/dist/domain/sections.js +514 -0
- package/cli/dist/domain/security-alerts-source.d.ts +29 -0
- package/cli/dist/domain/security-alerts-source.js +4 -0
- package/cli/dist/domain/security-alerts.d.ts +52 -0
- package/cli/dist/domain/security-alerts.js +107 -0
- package/cli/dist/domain/security-tracker.d.ts +115 -0
- package/cli/dist/domain/security-tracker.js +353 -0
- package/cli/dist/domain/state.d.ts +59 -0
- package/cli/dist/domain/state.js +95 -0
- package/cli/dist/domain/tracker-body.d.ts +70 -0
- package/cli/dist/domain/tracker-body.js +65 -0
- package/cli/dist/domain/work-start.d.ts +34 -0
- package/cli/dist/domain/work-start.js +49 -0
- package/cli/dist/domain/yaml-document.d.ts +5 -0
- package/cli/dist/domain/yaml-document.js +206 -0
- package/cli/dist/infra/authored-notes.d.ts +37 -0
- package/cli/dist/infra/authored-notes.js +72 -0
- package/cli/dist/infra/changelog-file.d.ts +19 -0
- package/cli/dist/infra/changelog-file.js +43 -0
- package/cli/dist/infra/child-stdin.d.ts +4 -0
- package/cli/dist/infra/child-stdin.js +8 -0
- package/cli/dist/infra/config-store.d.ts +53 -0
- package/cli/dist/infra/config-store.js +134 -0
- package/cli/dist/infra/diagnostics.d.ts +9 -0
- package/cli/dist/infra/diagnostics.js +2 -0
- package/cli/dist/infra/file-kind.d.ts +9 -0
- package/cli/dist/infra/file-kind.js +26 -0
- package/cli/dist/infra/frontmatter-file.d.ts +14 -0
- package/cli/dist/infra/frontmatter-file.js +30 -0
- package/cli/dist/infra/git.d.ts +86 -0
- package/cli/dist/infra/git.js +145 -0
- package/cli/dist/infra/github/auth.d.ts +60 -0
- package/cli/dist/infra/github/auth.js +158 -0
- package/cli/dist/infra/github/client.d.ts +178 -0
- package/cli/dist/infra/github/client.js +579 -0
- package/cli/dist/infra/github/dependabot-source.d.ts +13 -0
- package/cli/dist/infra/github/dependabot-source.js +33 -0
- package/cli/dist/infra/github/errors.d.ts +65 -0
- package/cli/dist/infra/github/errors.js +64 -0
- package/cli/dist/infra/github/index.d.ts +13 -0
- package/cli/dist/infra/github/index.js +19 -0
- package/cli/dist/infra/github/issues.d.ts +165 -0
- package/cli/dist/infra/github/issues.js +428 -0
- package/cli/dist/infra/github/payload.d.ts +44 -0
- package/cli/dist/infra/github/payload.js +80 -0
- package/cli/dist/infra/github/projects.d.ts +143 -0
- package/cli/dist/infra/github/projects.js +384 -0
- package/cli/dist/infra/github/pulls.d.ts +104 -0
- package/cli/dist/infra/github/pulls.js +217 -0
- package/cli/dist/infra/github/queries.d.ts +44 -0
- package/cli/dist/infra/github/queries.js +1031 -0
- package/cli/dist/infra/github/readout.d.ts +22 -0
- package/cli/dist/infra/github/readout.js +167 -0
- package/cli/dist/infra/github/repos.d.ts +86 -0
- package/cli/dist/infra/github/repos.js +168 -0
- package/cli/dist/infra/github/rest-path.d.ts +14 -0
- package/cli/dist/infra/github/rest-path.js +31 -0
- package/cli/dist/infra/github/security-alerts-source.d.ts +15 -0
- package/cli/dist/infra/github/security-alerts-source.js +73 -0
- package/cli/dist/infra/gitignore-spec.d.ts +36 -0
- package/cli/dist/infra/gitignore-spec.js +235 -0
- package/cli/dist/infra/nx-scope.d.ts +51 -0
- package/cli/dist/infra/nx-scope.js +182 -0
- package/cli/dist/infra/os-error.d.ts +24 -0
- package/cli/dist/infra/os-error.js +38 -0
- package/cli/dist/infra/paths.d.ts +88 -0
- package/cli/dist/infra/paths.js +234 -0
- package/cli/dist/infra/state-store.d.ts +54 -0
- package/cli/dist/infra/state-store.js +130 -0
- package/cli/dist/infra/template-store.d.ts +15 -0
- package/cli/dist/infra/template-store.js +34 -0
- package/cli/dist/infra/text-file.d.ts +12 -0
- package/cli/dist/infra/text-file.js +33 -0
- package/cli/dist/infra/worktree-copy.d.ts +24 -0
- package/cli/dist/infra/worktree-copy.js +95 -0
- package/cli/dist/infra/worktree-links.d.ts +142 -0
- package/cli/dist/infra/worktree-links.js +440 -0
- package/cli/dist/infra/worktree-setup.d.ts +21 -0
- package/cli/dist/infra/worktree-setup.js +41 -0
- package/cli/dist/infra/worktree.d.ts +185 -0
- package/cli/dist/infra/worktree.js +584 -0
- package/cli/dist/mcp/result.d.ts +61 -0
- package/cli/dist/mcp/result.js +96 -0
- package/cli/dist/mcp/serve.d.ts +51 -0
- package/cli/dist/mcp/serve.js +183 -0
- package/cli/dist/mcp/server.d.ts +21 -0
- package/cli/dist/mcp/server.js +142 -0
- package/cli/dist/mcp/session-directory.d.ts +26 -0
- package/cli/dist/mcp/session-directory.js +84 -0
- package/cli/dist/package.json +1 -0
- package/cli/dist/version.d.ts +17 -0
- package/cli/dist/version.js +42 -0
- package/cli/templates/comment/merge-diff.md +34 -0
- package/cli/templates/comment/plan.md +195 -0
- package/cli/templates/comment/precede-notify.md +33 -0
- package/cli/templates/comment/review-findings.md +42 -0
- package/cli/templates/comment/review-resolution.md +48 -0
- package/cli/templates/issue/bug.md +63 -0
- package/cli/templates/issue/epic.md +54 -0
- package/cli/templates/issue/task-implement.md +74 -0
- package/cli/templates/issue/task.md +48 -0
- package/cli/templates/issue/tracker.md +48 -0
- package/cli/templates/pr/create.md +123 -0
- package/cli/templates/pr/release.md +56 -0
- package/cli/templates/workflow/pecot-board-sync.yml +84 -0
- package/hooks/lib/core/pecot-gitignore-ensure.sh +48 -0
- package/npm-shrinkwrap.json +83 -0
- package/package.json +22 -4
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// コマンドの名前まわりの小さな関数。help・バインド・定義書の書き出しが同じものを使う。
|
|
2
|
+
/**
|
|
3
|
+
入力名を長いオプションの形にする。`force_overwrite_active` は `--force-overwrite-active`
|
|
4
|
+
*/
|
|
5
|
+
export function flagOf(name) {
|
|
6
|
+
return `--${name.replaceAll('_', '-')}`;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
文字列を名前の順(コードユニットの順)に並べる比較関数
|
|
10
|
+
*/
|
|
11
|
+
export function byName(left, right) {
|
|
12
|
+
if (left < right)
|
|
13
|
+
return -1;
|
|
14
|
+
return left > right ? 1 : 0;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
コマンド名の 1 語目に使うグループ。利用者が操作する対象で、help の一覧はこの順に並ぶ
|
|
18
|
+
*/
|
|
19
|
+
export const COMMAND_GROUPS = [
|
|
20
|
+
{ name: 'project', meaning: 'プロジェクトとの接続と設定ファイル。ボードの上の Issue には触らない', help: 'Connect to projects and manage the project config' },
|
|
21
|
+
{ name: 'board', meaning: 'ボードの上の Issue の置き場所。設定ファイルは書かない', help: 'Show the project board and place Issues on it' },
|
|
22
|
+
{ name: 'issue', meaning: 'Issue そのもの', help: 'Work with Issues' },
|
|
23
|
+
{ name: 'session', meaning: '1 つの Issue の作業の始まりから終わりまで', help: 'Start, show, restore and finish the work on an Issue' },
|
|
24
|
+
{ name: 'pr', meaning: 'PR そのもの', help: 'Work with PRs' },
|
|
25
|
+
{ name: 'release', meaning: 'リリース', help: 'Work with releases' },
|
|
26
|
+
{ name: 'tracker', meaning: 'Tracker の Issue の書き直し', help: 'Rewrite the list in a Tracker Issue' },
|
|
27
|
+
{ name: 'worktree', meaning: 'worktree', help: 'Work with worktrees' },
|
|
28
|
+
{ name: 'branch', meaning: 'リモートのブランチ', help: 'Work with remote branches' },
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
コマンド名の 2 語目に使う動詞の語彙。1 語に 1 つの意味を決める
|
|
32
|
+
*/
|
|
33
|
+
export const COMMAND_VERBS = [
|
|
34
|
+
{ name: 'list', meaning: '複数を並べる', readOnly: true },
|
|
35
|
+
{ name: 'search', meaning: 'GitHub を探す', readOnly: true },
|
|
36
|
+
{ name: 'show', meaning: '1 件を出す', readOnly: true },
|
|
37
|
+
{ name: 'get', meaning: '設定の値を出す', readOnly: true },
|
|
38
|
+
{ name: 'check', meaning: '次の操作の前に確かめる', readOnly: true },
|
|
39
|
+
{ name: 'create', meaning: 'GitHub のものを作る' },
|
|
40
|
+
{ name: 'delete', meaning: 'GitHub のものを消す' },
|
|
41
|
+
{ name: 'add', meaning: '集まりに入れる' },
|
|
42
|
+
{ name: 'remove', meaning: '集まりから出す' },
|
|
43
|
+
{ name: 'init', meaning: '既にあるものを pecot で使える状態にする' },
|
|
44
|
+
{ name: 'set', meaning: '設定のキーに値を入れる' },
|
|
45
|
+
{ name: 'unset', meaning: '設定のキーの値を消す' },
|
|
46
|
+
{ name: 'link', meaning: 'リポジトリをプロジェクトにつなぐ' },
|
|
47
|
+
{ name: 'activate', meaning: '使うプロジェクトを切り替える' },
|
|
48
|
+
{ name: 'start', meaning: '作業を始める' },
|
|
49
|
+
{ name: 'restore', meaning: '作業の状態を戻す' },
|
|
50
|
+
{ name: 'finish', meaning: '作業を終えて片付ける' },
|
|
51
|
+
{ name: 'sync', meaning: '判定や一覧に合わせて書き直す' },
|
|
52
|
+
{ name: 'move', meaning: 'ボードの列を移す' },
|
|
53
|
+
{ name: 'merge', meaning: 'PR をマージする' },
|
|
54
|
+
{ name: 'comment', meaning: 'コメントを書く' },
|
|
55
|
+
{ name: 'reopen', meaning: '閉じたものを開き直す' },
|
|
56
|
+
{ name: 'block', meaning: '前提を付ける' },
|
|
57
|
+
{ name: 'unblock', meaning: '前提を外す' },
|
|
58
|
+
];
|
|
59
|
+
const COMMAND_WORD_COUNT = 2;
|
|
60
|
+
function isListed(words, word) {
|
|
61
|
+
return word === undefined || words.some(listed => listed.name === word);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
コマンド名の決まり(`<グループ> <動詞>` の 2 語で、1 語目が COMMAND_GROUPS、2 語目が COMMAND_VERBS にある)に合わない path を、渡された順で返す。全部が合えば空
|
|
65
|
+
*/
|
|
66
|
+
export function commandNameViolations(paths) {
|
|
67
|
+
return paths
|
|
68
|
+
.map(path => ({
|
|
69
|
+
path: path.join(' '),
|
|
70
|
+
reason: [
|
|
71
|
+
...path.length === COMMAND_WORD_COUNT ? [] : [`has ${String(path.length)} word(s); a command name is '<group> <verb>' (2 words)`],
|
|
72
|
+
...isListed(COMMAND_GROUPS, path.at(0)) ? [] : [`'${String(path.at(0))}' is not a group in COMMAND_GROUPS`],
|
|
73
|
+
...isListed(COMMAND_VERBS, path.at(1)) ? [] : [`'${String(path.at(1))}' is not a verb in COMMAND_VERBS`],
|
|
74
|
+
].join('; '),
|
|
75
|
+
}))
|
|
76
|
+
.filter(violation => violation.reason !== '');
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=names.js.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { HintedText } from '../domain/command-hint.js';
|
|
3
|
+
import type { CommandIo } from './registry.js';
|
|
4
|
+
/**
|
|
5
|
+
操作の動詞。自由な文字列を受け取らない
|
|
6
|
+
*/
|
|
7
|
+
export declare const VerbSchema: z.ZodEnum<{
|
|
8
|
+
add: "add";
|
|
9
|
+
close: "close";
|
|
10
|
+
create: "create";
|
|
11
|
+
delete: "delete";
|
|
12
|
+
merge: "merge";
|
|
13
|
+
move: "move";
|
|
14
|
+
remove: "remove";
|
|
15
|
+
reopen: "reopen";
|
|
16
|
+
set: "set";
|
|
17
|
+
skip: "skip";
|
|
18
|
+
unchanged: "unchanged";
|
|
19
|
+
update: "update";
|
|
20
|
+
}>;
|
|
21
|
+
export type Verb = z.infer<typeof VerbSchema>;
|
|
22
|
+
/**
|
|
23
|
+
動詞の過去分詞。done の前置きになる
|
|
24
|
+
*/
|
|
25
|
+
export declare function pastOf(verb: Verb): string;
|
|
26
|
+
/**
|
|
27
|
+
plan と result の元になる操作
|
|
28
|
+
*/
|
|
29
|
+
export interface Operation {
|
|
30
|
+
readonly verb: Verb;
|
|
31
|
+
readonly target: string;
|
|
32
|
+
/**
|
|
33
|
+
本題でない片付けの操作。行は同じに出し、MCP の結果の message には選ばない
|
|
34
|
+
*/
|
|
35
|
+
readonly aside?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface Output {
|
|
38
|
+
/**
|
|
39
|
+
dry-run のときだけ、実行する操作を stderr に出す
|
|
40
|
+
*/
|
|
41
|
+
readonly planned: (operation: Operation) => void;
|
|
42
|
+
/**
|
|
43
|
+
dry-run でないときだけ、実行した操作を stderr に出す
|
|
44
|
+
*/
|
|
45
|
+
readonly done: (operation: Operation) => void;
|
|
46
|
+
/**
|
|
47
|
+
案内(HintedText)は io の出し先の形にする
|
|
48
|
+
*/
|
|
49
|
+
readonly warning: (message: string | HintedText) => void;
|
|
50
|
+
readonly error: (message: string | HintedText) => void;
|
|
51
|
+
/**
|
|
52
|
+
value が未設定なら `unknown` と出す
|
|
53
|
+
*/
|
|
54
|
+
readonly count: (label: string, value: number | undefined) => void;
|
|
55
|
+
/**
|
|
56
|
+
結果の本体を stdout にそのまま出す。末尾に改行が無ければ 1 つ足す
|
|
57
|
+
*/
|
|
58
|
+
readonly data: (text: string) => void;
|
|
59
|
+
}
|
|
60
|
+
export declare function createOutput(isDryRun: boolean, io: CommandIo): Output;
|
|
61
|
+
/**
|
|
62
|
+
fd から buffer へ読んだバイト数。0 は終端
|
|
63
|
+
*/
|
|
64
|
+
export type ReadBytes = (fd: number, buffer: Uint8Array) => number;
|
|
65
|
+
/**
|
|
66
|
+
1 バイトずつ読むのは、次の行を先読みして取りこぼさず、process.stdin に触れないため。read と wait はテスト用の差し替え口
|
|
67
|
+
*/
|
|
68
|
+
export declare function createLineReader(fd: number, read?: ReadBytes, wait?: () => void): () => string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
process.stdout・process.stderr に書き、fd(既定は標準入力)から読む CommandIo。src/cli.ts の main が使う
|
|
71
|
+
*/
|
|
72
|
+
export declare function createProcessIo(fd?: number): CommandIo;
|
|
73
|
+
/**
|
|
74
|
+
確認の途中で入力が終わった(Python の click の Abort)。
|
|
75
|
+
code を持たせない(link の処理は code を持つ例外を握るため、これは握られずに最上位まで届く)
|
|
76
|
+
*/
|
|
77
|
+
export declare class AbortedError extends Error {
|
|
78
|
+
constructor();
|
|
79
|
+
}
|
|
80
|
+
export declare const ABORTED_EXIT_CODE = 1;
|
|
81
|
+
/**
|
|
82
|
+
中止を stderr に出して、終了コードを返す。`Aborted.` の前に改行は入らない
|
|
83
|
+
*/
|
|
84
|
+
export declare function reportAborted(io: CommandIo): number;
|
|
85
|
+
/**
|
|
86
|
+
末尾の空白 1 つを stdout に出すのは、既存の CLI の出力(問いは stderr、空白だけ stdout)を変えないため。
|
|
87
|
+
readLine が無い(MCP)か入力が終わると AbortedError を投げる
|
|
88
|
+
*/
|
|
89
|
+
export declare function isConfirmed(io: CommandIo, text: string): boolean;
|
|
90
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
// CLI の出力の行をそろえる共通の関数。
|
|
2
|
+
//
|
|
3
|
+
// 行の形は specs/021-cli-output-functions/contracts/output-lines.md が決める。
|
|
4
|
+
// コマンドは操作(動詞と対象)を 1 つ作り、実行の前に planned を、実行の後に done を呼ぶ。
|
|
5
|
+
// 期待の行は tests/output/cases.json に置き、Python の側と同じ値を共有する。
|
|
6
|
+
import { readSync } from 'node:fs';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { formatHinted } from '../domain/command-hint.js';
|
|
9
|
+
import { hasErrorCode } from '../infra/os-error.js';
|
|
10
|
+
/**
|
|
11
|
+
操作の動詞。自由な文字列を受け取らない
|
|
12
|
+
*/
|
|
13
|
+
export const VerbSchema = z.enum(['create', 'update', 'delete', 'add', 'remove', 'close', 'reopen', 'merge', 'move', 'set', 'skip', 'unchanged']);
|
|
14
|
+
/**
|
|
15
|
+
動詞の過去分詞。done の前置きになる
|
|
16
|
+
*/
|
|
17
|
+
export function pastOf(verb) {
|
|
18
|
+
switch (verb) {
|
|
19
|
+
case 'create': {
|
|
20
|
+
return 'created';
|
|
21
|
+
}
|
|
22
|
+
case 'update': {
|
|
23
|
+
return 'updated';
|
|
24
|
+
}
|
|
25
|
+
case 'delete': {
|
|
26
|
+
return 'deleted';
|
|
27
|
+
}
|
|
28
|
+
case 'add': {
|
|
29
|
+
return 'added';
|
|
30
|
+
}
|
|
31
|
+
case 'remove': {
|
|
32
|
+
return 'removed';
|
|
33
|
+
}
|
|
34
|
+
case 'close': {
|
|
35
|
+
return 'closed';
|
|
36
|
+
}
|
|
37
|
+
case 'reopen': {
|
|
38
|
+
return 'reopened';
|
|
39
|
+
}
|
|
40
|
+
case 'merge': {
|
|
41
|
+
return 'merged';
|
|
42
|
+
}
|
|
43
|
+
case 'move': {
|
|
44
|
+
return 'moved';
|
|
45
|
+
}
|
|
46
|
+
case 'set': {
|
|
47
|
+
return 'set';
|
|
48
|
+
}
|
|
49
|
+
case 'skip': {
|
|
50
|
+
return 'skipped';
|
|
51
|
+
}
|
|
52
|
+
case 'unchanged': {
|
|
53
|
+
return 'unchanged';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
末尾の改行を取り除き、2 行目以降の先頭に空白 2 つを付け、末尾に改行を 1 つ付ける
|
|
59
|
+
*/
|
|
60
|
+
function formatMessage(prefix, message) {
|
|
61
|
+
const lines = message.replace(/\n+$/, '').split('\n');
|
|
62
|
+
return `${prefix}: ${lines.join('\n ')}\n`;
|
|
63
|
+
}
|
|
64
|
+
export function createOutput(isDryRun, io) {
|
|
65
|
+
const render = (message) => formatHinted(message, io.surface ?? 'cli');
|
|
66
|
+
const writeResult = (line, aside) => {
|
|
67
|
+
io.stderr(`${line}\n`);
|
|
68
|
+
if (aside !== true)
|
|
69
|
+
io.resultLine?.(line);
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
planned: ({ verb, target, aside }) => {
|
|
73
|
+
if (!isDryRun)
|
|
74
|
+
return;
|
|
75
|
+
// unchanged に現在形は無いので、文を変える
|
|
76
|
+
writeResult(verb === 'unchanged' ? `dry-run: would leave ${target} unchanged` : `dry-run: would ${verb} ${target}`, aside);
|
|
77
|
+
},
|
|
78
|
+
done: ({ verb, target, aside }) => {
|
|
79
|
+
if (isDryRun)
|
|
80
|
+
return;
|
|
81
|
+
writeResult(`${pastOf(verb)}: ${target}`, aside);
|
|
82
|
+
},
|
|
83
|
+
warning: (message) => {
|
|
84
|
+
io.stderr(formatMessage('warning', render(message)));
|
|
85
|
+
},
|
|
86
|
+
error: (message) => {
|
|
87
|
+
io.stderr(formatMessage('error', render(message)));
|
|
88
|
+
},
|
|
89
|
+
count: (label, value) => {
|
|
90
|
+
io.stderr(`count: ${label}: ${value === undefined ? 'unknown' : String(value)}\n`);
|
|
91
|
+
},
|
|
92
|
+
data: (text) => {
|
|
93
|
+
io.stdout(text.endsWith('\n') ? text : `${text}\n`);
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const RETRY_WAIT_MILLISECONDS = 10;
|
|
98
|
+
/**
|
|
99
|
+
非ブロッキングの入力が空のとき、読み直す前に待つ
|
|
100
|
+
*/
|
|
101
|
+
/* v8 ignore next 3 -- 本物の EAGAIN は再現できないので、テストは wait を差し替える */
|
|
102
|
+
function sleepBriefly() {
|
|
103
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, RETRY_WAIT_MILLISECONDS);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
1 バイトずつ読むのは、次の行を先読みして取りこぼさず、process.stdin に触れないため。read と wait はテスト用の差し替え口
|
|
107
|
+
*/
|
|
108
|
+
export function createLineReader(fd, read = (source, buffer) => readSync(source, buffer), wait = sleepBriefly) {
|
|
109
|
+
const NEWLINE = 10;
|
|
110
|
+
return () => {
|
|
111
|
+
const bytes = [];
|
|
112
|
+
const buffer = new Uint8Array(1);
|
|
113
|
+
for (;;) {
|
|
114
|
+
let count;
|
|
115
|
+
try {
|
|
116
|
+
count = read(fd, buffer);
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
// 非ブロッキングの入力が空のとき。process.stdin に触ると入力が非ブロッキングになる環境がある
|
|
120
|
+
if (hasErrorCode(error) && error.code === 'EAGAIN') {
|
|
121
|
+
wait();
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
if (count === 0)
|
|
127
|
+
return bytes.length === 0 ? undefined : Buffer.from(bytes).toString('utf8');
|
|
128
|
+
const byte = buffer[0] ?? NEWLINE;
|
|
129
|
+
if (byte === NEWLINE)
|
|
130
|
+
return Buffer.from(bytes).toString('utf8');
|
|
131
|
+
bytes.push(byte);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
process.stdout・process.stderr に書き、fd(既定は標準入力)から読む CommandIo。src/cli.ts の main が使う
|
|
137
|
+
*/
|
|
138
|
+
export function createProcessIo(fd = 0) {
|
|
139
|
+
return {
|
|
140
|
+
stdout: (text) => {
|
|
141
|
+
process.stdout.write(text);
|
|
142
|
+
},
|
|
143
|
+
stderr: (text) => {
|
|
144
|
+
process.stderr.write(text);
|
|
145
|
+
},
|
|
146
|
+
readLine: createLineReader(fd),
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
確認の途中で入力が終わった(Python の click の Abort)。
|
|
151
|
+
code を持たせない(link の処理は code を持つ例外を握るため、これは握られずに最上位まで届く)
|
|
152
|
+
*/
|
|
153
|
+
export class AbortedError extends Error {
|
|
154
|
+
constructor() {
|
|
155
|
+
super('Aborted.');
|
|
156
|
+
this.name = 'AbortedError';
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
export const ABORTED_EXIT_CODE = 1;
|
|
160
|
+
/**
|
|
161
|
+
中止を stderr に出して、終了コードを返す。`Aborted.` の前に改行は入らない
|
|
162
|
+
*/
|
|
163
|
+
export function reportAborted(io) {
|
|
164
|
+
io.stderr('Aborted.\n');
|
|
165
|
+
return ABORTED_EXIT_CODE;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
末尾の空白 1 つを stdout に出すのは、既存の CLI の出力(問いは stderr、空白だけ stdout)を変えないため。
|
|
169
|
+
readLine が無い(MCP)か入力が終わると AbortedError を投げる
|
|
170
|
+
*/
|
|
171
|
+
export function isConfirmed(io, text) {
|
|
172
|
+
for (;;) {
|
|
173
|
+
io.stderr(`${text} [y/N]:`);
|
|
174
|
+
io.stdout(' ');
|
|
175
|
+
const line = io.readLine?.();
|
|
176
|
+
if (line === undefined)
|
|
177
|
+
throw new AbortedError();
|
|
178
|
+
switch (line.trim().toLowerCase()) {
|
|
179
|
+
case 'y':
|
|
180
|
+
case 'yes': {
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
case 'n':
|
|
184
|
+
case 'no':
|
|
185
|
+
case '': {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
default: {
|
|
189
|
+
io.stderr('Error: invalid input\n');
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ProjectConfig } from '../domain/config.js';
|
|
2
|
+
import type { RepositoryReference } from '../domain/repository-resolver.js';
|
|
3
|
+
import type { GitHubClient } from '../infra/github/index.js';
|
|
4
|
+
import type { Output } from './output.js';
|
|
5
|
+
export interface CreatedPullRequest {
|
|
6
|
+
readonly repository: RepositoryReference;
|
|
7
|
+
/**
|
|
8
|
+
head ブランチの末尾の番号の Issue
|
|
9
|
+
*/
|
|
10
|
+
readonly issueNumber: number;
|
|
11
|
+
/**
|
|
12
|
+
作った PR の番号。応答に無ければ undefined(読み直しの確かめを省く)
|
|
13
|
+
*/
|
|
14
|
+
readonly pullRequest: number | undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
head の Issue を待つ Issue を読み、判定に合わせてボードの列と札を動かす。読むのは、待つ Issue のボードの項目だけ
|
|
18
|
+
*/
|
|
19
|
+
export declare function moveWaitingIssues(out: Readonly<Output>, client: GitHubClient, config: ProjectConfig, created: CreatedPullRequest): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=pr-waiting.d.ts.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- 引数の型は readonly にできない */
|
|
2
|
+
// pr create の後に、head の Issue を待つ Issue(blocking)の列と札を、判定で動かす。
|
|
3
|
+
// どの失敗も warning にとどめ、終了コードを変えない。
|
|
4
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
5
|
+
import { homeRepositoryOf, workflowFieldName } from '../domain/config.js';
|
|
6
|
+
import { boardItemKey } from '../domain/format.js';
|
|
7
|
+
import { displayReference } from '../domain/readiness.js';
|
|
8
|
+
import { createIssueReference, issueReferenceKey } from '../domain/reference-parser.js';
|
|
9
|
+
import { DependenciesUnsupportedError, GitHubNotFoundError } from '../infra/github/errors.js';
|
|
10
|
+
import { applyJudgedMoves, judgeBoard, SYNCED_COLUMNS } from './board-judgment.js';
|
|
11
|
+
import { mapWithLimit } from './board-view.js';
|
|
12
|
+
import { commandHint, hinted } from './command-hint.js';
|
|
13
|
+
import { apiFailureMessage } from './github-client.js';
|
|
14
|
+
// GitHub は書いた直後の読み取りの一致を保証しない。読み直す前に、反映を待つ時間
|
|
15
|
+
const RECHECK_DELAY_MILLISECONDS = 1500;
|
|
16
|
+
const READ_MAX_WORKERS = 8;
|
|
17
|
+
// 判定の前提の中の head の Issue に、作った PR が出ているか
|
|
18
|
+
function hasCreatedPullRequest(judged, waiting) {
|
|
19
|
+
const { created, head } = waiting;
|
|
20
|
+
if (created.pullRequest === undefined || judged.result.kind !== 'judged')
|
|
21
|
+
return true;
|
|
22
|
+
const headKey = issueReferenceKey(head);
|
|
23
|
+
const prerequisite = judged.result.prerequisites.find(({ issue }) => issueReferenceKey(issue.ref) === headKey);
|
|
24
|
+
return prerequisite?.issue.pullRequests.some(pullRequest => pullRequest.number === created.pullRequest) ?? false;
|
|
25
|
+
}
|
|
26
|
+
async function judgeKeys(waiting, items, keys) {
|
|
27
|
+
const { client, config } = waiting.context;
|
|
28
|
+
return await judgeBoard(client, config, items, new Map(), { columns: SYNCED_COLUMNS, withoutRead: target => (keys.has(target.key) ? undefined : 'skip') });
|
|
29
|
+
}
|
|
30
|
+
// 作った PR が判定に出ていない分を、少し待ってから 1 回だけ読み直す
|
|
31
|
+
async function judgeConfirmed(waiting, items) {
|
|
32
|
+
const first = await judgeKeys(waiting, items, new Set(items.flatMap(item => boardItemKey(item) ?? [])));
|
|
33
|
+
if (first === undefined)
|
|
34
|
+
return undefined;
|
|
35
|
+
const stale = new Set(first.filter(judged => !hasCreatedPullRequest(judged, waiting)).map(judged => judged.target.key));
|
|
36
|
+
if (stale.size > 0)
|
|
37
|
+
await delay(RECHECK_DELAY_MILLISECONDS);
|
|
38
|
+
const second = stale.size === 0 ? [] : await judgeKeys(waiting, items, stale);
|
|
39
|
+
if (second === undefined)
|
|
40
|
+
return undefined;
|
|
41
|
+
const latest = [...first.filter(judged => !stale.has(judged.target.key)), ...second];
|
|
42
|
+
return { confirmed: latest.filter(judged => hasCreatedPullRequest(judged, waiting)), unconfirmed: latest.filter(judged => !hasCreatedPullRequest(judged, waiting)) };
|
|
43
|
+
}
|
|
44
|
+
// head の Issue が PR のリポに無いとき(集約リポの運用・番号が Issue でないブランチ)と、依存関係に対応しない GHES では、何も出さない
|
|
45
|
+
async function readWaitingIssues(waiting) {
|
|
46
|
+
const { context: { out, client, home }, created, head } = waiting;
|
|
47
|
+
const name = displayReference(head, home);
|
|
48
|
+
const failed = `could not read the Issues waiting for ${name}`;
|
|
49
|
+
let read;
|
|
50
|
+
try {
|
|
51
|
+
read = await client.getIssueBlockingReferences(created.repository.owner, created.repository.repository, created.issueNumber);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
if (error instanceof DependenciesUnsupportedError || error instanceof GitHubNotFoundError)
|
|
55
|
+
return undefined;
|
|
56
|
+
out.warning(`${failed}: ${apiFailureMessage(error)}`);
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
if (read.kind === 'read-failed') {
|
|
60
|
+
out.warning(`${failed}: ${read.reason}`);
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
const partial = read.total > read.issues.length ? `read ${String(read.issues.length)} of ${String(read.total)} Issues waiting for ${name}; the rest were not moved` : undefined;
|
|
64
|
+
return { issues: read.issues, partial };
|
|
65
|
+
}
|
|
66
|
+
// 待つ Issue のうち、開いていてボードに載っているものの項目だけを読む
|
|
67
|
+
async function readBoardItems(waiting, issues) {
|
|
68
|
+
const { client, config } = waiting.context;
|
|
69
|
+
const field = workflowFieldName(config);
|
|
70
|
+
const open = issues.filter(issue => issue.state === 'OPEN');
|
|
71
|
+
const items = await mapWithLimit(open, READ_MAX_WORKERS, async ({ repository, number }) => await client.getIssueBoardItem(config.project.id, repository.owner, repository.repository, number, field));
|
|
72
|
+
return items.flatMap(item => item ?? []);
|
|
73
|
+
}
|
|
74
|
+
async function moveWaiting(waiting, issues) {
|
|
75
|
+
const { context, created } = waiting;
|
|
76
|
+
const items = await readBoardItems(waiting, issues);
|
|
77
|
+
if (items.length === 0)
|
|
78
|
+
return;
|
|
79
|
+
const judged = await judgeConfirmed(waiting, items);
|
|
80
|
+
if (judged === undefined)
|
|
81
|
+
return;
|
|
82
|
+
await applyJudgedMoves(context, judged.confirmed);
|
|
83
|
+
for (const { target } of judged.unconfirmed) {
|
|
84
|
+
context.out.warning(hinted `could not confirm that GitHub reflects PR #${String(created.pullRequest)} in the readiness of ${displayReference(target.ref, context.home)}; its column was not moved; run ${commandHint(['board', 'sync'])} later to move it`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
head の Issue を待つ Issue を読み、判定に合わせてボードの列と札を動かす。読むのは、待つ Issue のボードの項目だけ
|
|
89
|
+
*/
|
|
90
|
+
export async function moveWaitingIssues(out, client, config, created) {
|
|
91
|
+
const context = { out, client, config, home: homeRepositoryOf(config) };
|
|
92
|
+
const waiting = { context, created, head: createIssueReference(created.repository, created.issueNumber) };
|
|
93
|
+
const read = await readWaitingIssues(waiting);
|
|
94
|
+
if (read === undefined)
|
|
95
|
+
return;
|
|
96
|
+
try {
|
|
97
|
+
if (read.issues.length > 0)
|
|
98
|
+
await moveWaiting(waiting, read.issues);
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
out.warning(`could not move the Issues waiting for ${displayReference(waiting.head, context.home)}: ${apiFailureMessage(error)}`);
|
|
102
|
+
}
|
|
103
|
+
if (read.partial !== undefined)
|
|
104
|
+
out.warning(read.partial);
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=pr-waiting.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { RemoteLocation } from '../domain/git-url.js';
|
|
2
|
+
import type { Output } from './output.js';
|
|
3
|
+
import type { CommandDefinition } from './command-definition.js';
|
|
4
|
+
export declare const PR_REFERENCE_DESCRIPTION = "PR reference (`owner/repo/N`, or the short form `N` in the repository of `--repo`, or else of the git remote of the current directory)";
|
|
5
|
+
export declare function reasonOf(error: unknown): string;
|
|
6
|
+
export declare function isPositive(value: number | undefined): value is number;
|
|
7
|
+
export interface PrimaryRemote {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly url: string;
|
|
10
|
+
/**
|
|
11
|
+
URL が読めなければ undefined
|
|
12
|
+
*/
|
|
13
|
+
readonly location: RemoteLocation | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare function primaryRemote(directory: string): PrimaryRemote | undefined;
|
|
16
|
+
export declare function parseReference(reference: string, globalRepository: string | undefined, out: Readonly<Output>): {
|
|
17
|
+
readonly owner: string;
|
|
18
|
+
readonly repository: string;
|
|
19
|
+
readonly number: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const PR_COMMANDS: readonly CommandDefinition[];
|
|
22
|
+
//# sourceMappingURL=pr.d.ts.map
|