@pecot/workflow-mcp 7.0.1-dev.30 → 7.0.1-dev.32
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.
|
@@ -4,6 +4,7 @@ import { setTimeout as delay } from 'node:timers/promises';
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { GitHubAPIError } from '../infra/github/errors.js';
|
|
6
6
|
import { defineCommand } from './command-definition.js';
|
|
7
|
+
import { hinted, inputNameHint } from './command-hint.js';
|
|
7
8
|
import { isStatusConfigured, setIssueField } from './issue-board.js';
|
|
8
9
|
import { stopWith, requireActiveConfigPlain } from './command-stop.js';
|
|
9
10
|
import { kindOfFailure } from './failure.js';
|
|
@@ -80,7 +81,15 @@ async function confirmReopened(output, client, issue, comment) {
|
|
|
80
81
|
output.done({ verb: 'reopen', target });
|
|
81
82
|
if (comment === undefined || comment === '')
|
|
82
83
|
return;
|
|
83
|
-
|
|
84
|
+
// Issue は開いているので、投稿の失敗は reopen の失敗と分けて伝える
|
|
85
|
+
try {
|
|
86
|
+
await client.addIssueComment(owner, repository, number, comment);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
if (!(error instanceof GitHubAPIError))
|
|
90
|
+
throw error;
|
|
91
|
+
stopWith(output, `could not comment on ${target}: ${error.message}`, kindOfFailure(error));
|
|
92
|
+
}
|
|
84
93
|
output.done({ verb: 'create', target: `comment on ${issuePath(owner, repository, number)}` });
|
|
85
94
|
output.result({ commented: true });
|
|
86
95
|
}
|
|
@@ -108,8 +117,9 @@ async function reopenIssue(output, client, config, issue, status, comment) {
|
|
|
108
117
|
await reopenAndSetStatus(output, client, config, issue, status);
|
|
109
118
|
await confirmReopened(output, client, issue, comment);
|
|
110
119
|
}
|
|
120
|
+
const REOPEN_PATH = ['issue', 'reopen'];
|
|
111
121
|
const ISSUE_REOPEN = defineCommand({
|
|
112
|
-
path:
|
|
122
|
+
path: REOPEN_PATH,
|
|
113
123
|
description: 'Reopen a closed Issue (also sets the status on the board)',
|
|
114
124
|
input: z.object({
|
|
115
125
|
issue_ref: z.string().describe(ISSUE_REF_DESCRIPTION),
|
|
@@ -127,6 +137,10 @@ const ISSUE_REOPEN = defineCommand({
|
|
|
127
137
|
const { status, comment } = input;
|
|
128
138
|
if (!VALID_STATUSES.has(status))
|
|
129
139
|
exitInvalidStatus(output, status);
|
|
140
|
+
// 空白だけの理由は GitHub が 422 で拒むので、開き直す前に止める
|
|
141
|
+
if (comment !== undefined && comment !== '' && comment.trim() === '') {
|
|
142
|
+
stopWith(output, hinted `${inputNameHint(REOPEN_PATH, 'comment')} is blank: give a reason or omit it`, 'invalid-input');
|
|
143
|
+
}
|
|
130
144
|
const config = requireActiveConfigPlain(output);
|
|
131
145
|
const { owner, repository, number } = parseIssueReferenceOrExit(output, input.repo, input.issue_ref);
|
|
132
146
|
const target = `Issue ${issuePath(owner, repository, number)}`;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pecot/workflow-mcp",
|
|
3
|
-
"version": "7.0.1-dev.
|
|
3
|
+
"version": "7.0.1-dev.32",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@pecot/workflow-mcp",
|
|
9
|
-
"version": "7.0.1-dev.
|
|
9
|
+
"version": "7.0.1-dev.32",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@modelcontextprotocol/server": "^2.4.0",
|