@pecot/workflow-mcp 5.0.0 → 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 +1 -1
- package/README.md +80 -22
- package/cli/dist/cli.js +6 -1
- 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/{project-info.d.ts → board-view.d.ts} +21 -7
- package/cli/dist/commands/{project-info.js → board-view.js} +22 -12
- 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/command-binding.js +4 -0
- package/cli/dist/commands/command-definition.d.ts +20 -6
- package/cli/dist/commands/command-definition.js +11 -7
- package/cli/dist/commands/command-help.js +2 -2
- 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 +5 -3
- package/cli/dist/commands/command-stop.js +7 -6
- 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 +6 -0
- package/cli/dist/commands/failure.js +29 -3
- package/cli/dist/commands/github-client.d.ts +6 -2
- package/cli/dist/commands/github-client.js +13 -3
- package/cli/dist/commands/help.js +8 -13
- package/cli/dist/commands/issue-board.d.ts +33 -0
- package/cli/dist/commands/issue-board.js +61 -1
- package/cli/dist/commands/issue-comment.js +47 -28
- package/cli/dist/commands/issue-create.js +548 -91
- 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 +32 -19
- package/cli/dist/commands/issue-shared.js +82 -75
- 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 +0 -1
- package/cli/dist/commands/issue.js +6 -8
- package/cli/dist/commands/names.d.ts +33 -0
- package/cli/dist/commands/names.js +62 -0
- package/cli/dist/commands/output.d.ts +14 -2
- package/cli/dist/commands/output.js +14 -7
- 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 +19 -0
- package/cli/dist/commands/pr.js +242 -323
- package/cli/dist/commands/project-sync.d.ts +2 -1
- package/cli/dist/commands/project-sync.js +18 -9
- package/cli/dist/commands/project.d.ts +3 -2
- package/cli/dist/commands/project.js +212 -175
- package/cli/dist/commands/registry.js +13 -10
- package/cli/dist/commands/release.d.ts +2 -2
- package/cli/dist/commands/release.js +53 -114
- package/cli/dist/commands/renamed-commands.d.ts +26 -0
- package/cli/dist/commands/renamed-commands.js +53 -0
- package/cli/dist/commands/repository-match.js +3 -2
- 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/{repository.js → session-start.js} +99 -128
- package/cli/dist/commands/session.d.ts +3 -0
- package/cli/dist/commands/session.js +82 -29
- package/cli/dist/commands/tracker-sync-dependabot.d.ts +7 -0
- package/cli/dist/commands/{dependabot.js → tracker-sync-dependabot.js} +57 -66
- package/cli/dist/commands/tracker-sync-security.d.ts +7 -0
- package/cli/dist/commands/{security.js → tracker-sync-security.js} +50 -61
- package/cli/dist/commands/tracker-sync.d.ts +7 -0
- package/cli/dist/commands/tracker-sync.js +3 -6
- 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 +4 -0
- package/cli/dist/commands/usage-error.js +6 -0
- package/cli/dist/commands/work-target.d.ts +12 -3
- package/cli/dist/commands/work-target.js +46 -5
- package/cli/dist/commands/worktree.js +32 -28
- 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.js +1 -1
- 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 +4 -0
- package/cli/dist/domain/config.js +11 -1
- package/cli/dist/domain/dependabot.js +1 -1
- package/cli/dist/domain/errors.d.ts +5 -0
- package/cli/dist/domain/errors.js +5 -0
- package/cli/dist/domain/format.d.ts +51 -4
- package/cli/dist/domain/format.js +72 -6
- package/cli/dist/domain/frontmatter.d.ts +18 -3
- package/cli/dist/domain/frontmatter.js +38 -12
- 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 +36 -0
- package/cli/dist/domain/pull-request.d.ts +71 -4
- package/cli/dist/domain/pull-request.js +59 -10
- package/cli/dist/domain/readiness.d.ts +27 -0
- package/cli/dist/domain/readiness.js +114 -3
- package/cli/dist/domain/reference-parser.d.ts +3 -1
- package/cli/dist/domain/reference-parser.js +6 -2
- package/cli/dist/domain/release.d.ts +7 -3
- package/cli/dist/domain/release.js +5 -12
- package/cli/dist/domain/repository-policy.d.ts +9 -3
- package/cli/dist/domain/repository-policy.js +8 -7
- package/cli/dist/domain/repository-resolver.js +4 -1
- package/cli/dist/domain/security-alerts.js +1 -1
- package/cli/dist/domain/state.d.ts +30 -0
- package/cli/dist/domain/state.js +39 -0
- package/cli/dist/domain/work-start.d.ts +34 -0
- package/cli/dist/domain/work-start.js +49 -0
- package/cli/dist/infra/authored-notes.d.ts +1 -1
- package/cli/dist/infra/authored-notes.js +10 -4
- package/cli/dist/infra/config-store.d.ts +4 -0
- package/cli/dist/infra/config-store.js +13 -0
- package/cli/dist/infra/git.d.ts +12 -0
- package/cli/dist/infra/git.js +13 -1
- package/cli/dist/infra/github/client.d.ts +5 -0
- package/cli/dist/infra/github/client.js +10 -7
- package/cli/dist/infra/github/errors.d.ts +18 -0
- package/cli/dist/infra/github/errors.js +22 -0
- package/cli/dist/infra/github/issues.d.ts +39 -3
- package/cli/dist/infra/github/issues.js +178 -23
- package/cli/dist/infra/github/projects.d.ts +35 -0
- package/cli/dist/infra/github/projects.js +89 -8
- package/cli/dist/infra/github/pulls.d.ts +24 -0
- package/cli/dist/infra/github/pulls.js +56 -0
- package/cli/dist/infra/github/queries.d.ts +12 -4
- package/cli/dist/infra/github/queries.js +156 -8
- package/cli/dist/infra/github/readout.d.ts +5 -1
- package/cli/dist/infra/github/readout.js +11 -0
- package/cli/dist/infra/github/repos.d.ts +18 -0
- package/cli/dist/infra/github/repos.js +31 -0
- package/cli/dist/infra/nx-scope.d.ts +1 -1
- package/cli/dist/infra/nx-scope.js +1 -1
- package/cli/dist/infra/state-store.d.ts +10 -1
- package/cli/dist/infra/state-store.js +14 -2
- package/cli/dist/infra/worktree-links.d.ts +3 -0
- package/cli/dist/infra/worktree-links.js +8 -1
- package/cli/dist/infra/worktree.d.ts +12 -1
- package/cli/dist/infra/worktree.js +40 -23
- package/cli/dist/mcp/result.d.ts +34 -6
- package/cli/dist/mcp/result.js +62 -18
- package/cli/dist/mcp/server.d.ts +2 -2
- package/cli/dist/mcp/server.js +24 -10
- package/cli/templates/comment/plan.md +14 -0
- package/cli/templates/issue/bug.md +1 -1
- package/cli/templates/issue/task-implement.md +13 -6
- package/cli/templates/issue/task.md +1 -1
- package/cli/templates/workflow/pecot-board-sync.yml +84 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/cli/dist/commands/dependabot.d.ts +0 -3
- package/cli/dist/commands/issue-project.d.ts +0 -3
- package/cli/dist/commands/issue-project.js +0 -176
- package/cli/dist/commands/issue-quick.d.ts +0 -3
- package/cli/dist/commands/issue-quick.js +0 -126
- package/cli/dist/commands/issue-read.d.ts +0 -3
- package/cli/dist/commands/issue-read.js +0 -80
- package/cli/dist/commands/repository.d.ts +0 -5
- package/cli/dist/commands/security.d.ts +0 -3
|
@@ -79,7 +79,7 @@ export declare function buildRepository(parts: Readonly<RepositoryParts>): Repos
|
|
|
79
79
|
/**
|
|
80
80
|
GitHub Projects V2 の情報から設定ファイルを作るか更新し、アクティブにする。作った設定ファイルのパスを返す。
|
|
81
81
|
pecot-workflow に合うプロジェクトだけを扱う。suffix はその名前の workflow フィールドを使う。
|
|
82
|
-
skipIfUnchanged
|
|
82
|
+
skipIfUnchanged は、設定ファイルの内容が同じなら何も書かない。isDryRun は読むだけで、書く操作を planned で出す
|
|
83
83
|
*/
|
|
84
84
|
export declare function syncProjectConfig(out: Readonly<Output>, client: Readonly<GitHubClient>, target: Readonly<{
|
|
85
85
|
owner: string;
|
|
@@ -87,5 +87,6 @@ export declare function syncProjectConfig(out: Readonly<Output>, client: Readonl
|
|
|
87
87
|
host: string;
|
|
88
88
|
suffix?: string | undefined;
|
|
89
89
|
skipIfUnchanged?: boolean | undefined;
|
|
90
|
+
isDryRun?: boolean | undefined;
|
|
90
91
|
}>): Promise<string>;
|
|
91
92
|
//# sourceMappingURL=project-sync.d.ts.map
|
|
@@ -6,7 +6,9 @@ import { isJsonObject, jsonField, parseJsonText } from '../domain/json.js';
|
|
|
6
6
|
import { pythonRepr } from '../domain/python-format.js';
|
|
7
7
|
import { loadConfig, projectsDirectory, saveConfig, setActiveConfig } from '../infra/config-store.js';
|
|
8
8
|
import { asArray, isTruthy, requireNumber, requireString } from '../infra/github/payload.js';
|
|
9
|
+
import { commandHint, hinted, placeholder } from './command-hint.js';
|
|
9
10
|
import { stopWith } from './command-stop.js';
|
|
11
|
+
import { kindOfFailure } from './failure.js';
|
|
10
12
|
const WORKFLOW_FIELD_PREFIX = 'pecot-workflow-';
|
|
11
13
|
/**
|
|
12
14
|
前提を待つ Issue を pecot が置く列
|
|
@@ -60,7 +62,7 @@ export const SIZE_FIELD_OPTIONS = [
|
|
|
60
62
|
export function failApi(out, action, error) {
|
|
61
63
|
const detail = error.message;
|
|
62
64
|
const status = error.statusCode ?? 0;
|
|
63
|
-
return stopWith(out, status === 0 ? `could not ${action}: ${detail}` : `could not ${action} (status ${String(status)}): ${detail}
|
|
65
|
+
return stopWith(out, status === 0 ? `could not ${action}: ${detail}` : `could not ${action} (status ${String(status)}): ${detail}`, kindOfFailure(error));
|
|
64
66
|
}
|
|
65
67
|
/**
|
|
66
68
|
Python の str() に当たる文字列。値が無いときは None
|
|
@@ -91,7 +93,7 @@ export async function findProjectByTitle(out, client, owner, name) {
|
|
|
91
93
|
if (found !== undefined)
|
|
92
94
|
return found;
|
|
93
95
|
const titles = projects.map(project => `- ${textOf(jsonField(project, 'title'))}`).join('\n');
|
|
94
|
-
return stopWith(out, `project not found: ${name}\navailable projects:\n${titles}
|
|
96
|
+
return stopWith(out, `project not found: ${name}\navailable projects:\n${titles}`, 'project-not-found');
|
|
95
97
|
}
|
|
96
98
|
/**
|
|
97
99
|
workflow フィールドに足りない必須の選択肢(要る順。optional は数えない。名前は大文字と小文字を区別しない)
|
|
@@ -104,7 +106,7 @@ export function missingRequiredOptions(field) {
|
|
|
104
106
|
必須の選択肢が欠けたときの、終了コード 1 の止め方
|
|
105
107
|
*/
|
|
106
108
|
export function stopMissingOptions(out, missing) {
|
|
107
|
-
return stopWith(out, `pecot-workflow field is missing options: ${missing.join(', ')}\nrequired options: Backlog / Pending / Ready / Active / In Review / Archived
|
|
109
|
+
return stopWith(out, `pecot-workflow field is missing options: ${missing.join(', ')}\nrequired options: Backlog / Pending / Ready / Active / In Review / Archived`, 'not-initialized');
|
|
108
110
|
}
|
|
109
111
|
function lowerName(option) {
|
|
110
112
|
const name = jsonField(option, 'name');
|
|
@@ -118,13 +120,13 @@ async function fetchValidatedFields(out, client, target) {
|
|
|
118
120
|
const { owner, name, host, number, suffix } = target;
|
|
119
121
|
const projectInfo = await client.getProjectFields(owner, number);
|
|
120
122
|
if (projectInfo === undefined || !isTruthy(projectInfo))
|
|
121
|
-
return stopWith(out, `could not read project fields: ${name}
|
|
123
|
+
return stopWith(out, `could not read project fields: ${name}`, 'not-initialized');
|
|
122
124
|
const fields = fieldNodesOf(projectInfo);
|
|
123
125
|
const workflowField = findWorkflowField(fields, suffix);
|
|
124
126
|
if (workflowField === undefined) {
|
|
125
|
-
return stopWith(out, `project "${name}" has no pecot-workflow-* field
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
return stopWith(out, hinted `project "${name}" has no pecot-workflow-* field
|
|
128
|
+
required field: pecot-workflow-<suffix> (Backlog/Pending/Ready/Active/In Review/Archived)
|
|
129
|
+
run: ${commandHint(['project', 'init'], { owner, name, host, suffix: placeholder('suffix') })}`, 'not-initialized');
|
|
128
130
|
}
|
|
129
131
|
const missing = missingRequiredOptions(workflowField);
|
|
130
132
|
if (missing.length > 0)
|
|
@@ -227,7 +229,7 @@ function loadExistingConfig(configPath) {
|
|
|
227
229
|
/**
|
|
228
230
|
GitHub Projects V2 の情報から設定ファイルを作るか更新し、アクティブにする。作った設定ファイルのパスを返す。
|
|
229
231
|
pecot-workflow に合うプロジェクトだけを扱う。suffix はその名前の workflow フィールドを使う。
|
|
230
|
-
skipIfUnchanged
|
|
232
|
+
skipIfUnchanged は、設定ファイルの内容が同じなら何も書かない。isDryRun は読むだけで、書く操作を planned で出す
|
|
231
233
|
*/
|
|
232
234
|
export async function syncProjectConfig(out, client, target) {
|
|
233
235
|
const { owner, name, host, skipIfUnchanged = false } = target;
|
|
@@ -261,9 +263,16 @@ export async function syncProjectConfig(out, client, target) {
|
|
|
261
263
|
};
|
|
262
264
|
// 読み直して保存と同じ形にそろえてから比べる
|
|
263
265
|
const normalized = parseProjectConfig(parseJsonText(serializeProjectConfig(config)));
|
|
264
|
-
if (skipIfUnchanged && existing !== undefined && serializeProjectConfig(existing) === serializeProjectConfig(normalized))
|
|
266
|
+
if (skipIfUnchanged && existing !== undefined && serializeProjectConfig(existing) === serializeProjectConfig(normalized)) {
|
|
267
|
+
out.planned({ verb: 'unchanged', target: `config file ${configPath}` });
|
|
265
268
|
return configPath;
|
|
269
|
+
}
|
|
266
270
|
const verb = existing === undefined ? 'create' : 'update';
|
|
271
|
+
if (target.isDryRun === true) {
|
|
272
|
+
out.planned({ verb, target: `config file ${configPath}` });
|
|
273
|
+
out.planned({ verb: 'set', target: `active project to ${path.parse(configPath).name}` });
|
|
274
|
+
return configPath;
|
|
275
|
+
}
|
|
267
276
|
saveConfig(config, configPath);
|
|
268
277
|
out.done({ verb, target: `config file ${configPath}` });
|
|
269
278
|
setActiveConfig(configPath);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { CommandDefinition } from './command-definition.js';
|
|
1
2
|
/**
|
|
2
|
-
project
|
|
3
|
+
project のグループのコマンド。並びは help の一覧の順
|
|
3
4
|
*/
|
|
4
|
-
export declare const PROJECT_COMMANDS:
|
|
5
|
+
export declare const PROJECT_COMMANDS: readonly CommandDefinition[];
|
|
5
6
|
//# sourceMappingURL=project.d.ts.map
|