@pecot/workflow-mcp 7.0.1-dev.32 → 7.0.1-dev.34

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pecot-w",
3
- "version": "7.0.1-dev.32",
3
+ "version": "7.0.1-dev.34",
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"
@@ -12,7 +12,7 @@ import { splitOwnerRepository, createRepositoryReference } from '../domain/repos
12
12
  import { FrontmatterError, stripFrontmatter, stripLeadingHtmlComment } from '../domain/frontmatter.js';
13
13
  import { findBatchDuplicate, planOrders } from '../domain/issue-order.js';
14
14
  import { upsertWaitsForMerge } from '../domain/prerequisites.js';
15
- import { compareStrings, pythonRightStrip, pythonStrip, pythonStringRepr, truncateCodePoints } from '../domain/python-format.js';
15
+ import { PYTHON_LINE_BREAK, compareStrings, pythonRightStrip, pythonStrip, pythonStringRepr, truncateCodePoints } from '../domain/python-format.js';
16
16
  import { createIssueReference, issueReferenceKey, issueReferenceToCliReference } from '../domain/reference-parser.js';
17
17
  import { describeReadiness, displayReference, hasStarted, stackChains } from '../domain/readiness.js';
18
18
  import { parseIssueFile } from '../infra/frontmatter-file.js';
@@ -744,7 +744,7 @@ function freeformFields(issueType, status, priority, size) {
744
744
  ...chosenSize === undefined ? [] : [{ fieldName: 'size', optionName: chosenSize, label: `size ${chosenSize}` }],
745
745
  ];
746
746
  }
747
- // テンプレートを確かめずに、メッセージだけで Issue を作る。タイトルは先頭 50 文字の空白を 1 つにまとめたもの
747
+ // テンプレートを確かめずに、メッセージだけで Issue を作る。タイトルは 1 行目の先頭 50 文字の空白を 1 つにまとめたもの
748
748
  async function createFreeform(output, input, isDryRun) {
749
749
  const { message, repo, type: issueType } = input;
750
750
  if (message === undefined || pythonStrip(message) === '')
@@ -763,7 +763,8 @@ async function createFreeform(output, input, isDryRun) {
763
763
  const [owner, repository] = validateRepositoryShape(output, repo);
764
764
  const config = requireActiveConfigPlain(output);
765
765
  const parentReference = parentReferenceOf(normalizeParentEpicCli(input.parent_epic), config, owner, repository);
766
- const cleaned = pythonStrip(truncateCodePoints(message, FREEFORM_TITLE_LENGTH).replaceAll(PYTHON_WHITESPACE_RUN, ' '));
766
+ const [firstLine = ''] = pythonStrip(message).split(PYTHON_LINE_BREAK);
767
+ const cleaned = pythonStrip(truncateCodePoints(firstLine, FREEFORM_TITLE_LENGTH).replaceAll(PYTHON_WHITESPACE_RUN, ' '));
767
768
  const title = buildIssueTitle(issueType, cleaned, { parentEpic: parentReference?.number, order: input.order });
768
769
  const client = await clientForIssueCreate(output, config, owner, repository, repo, parentReference, input.order);
769
770
  if (parentReference !== undefined && issueType === 'epic')
@@ -823,7 +824,7 @@ const ISSUE_CREATE = defineCommand({
823
824
  order: z.int().optional().describe('Order number of the subtask (used with parent_epic)'),
824
825
  label: LABEL_SCHEMA,
825
826
  dry_run: z.boolean().default(false).describe('Show what would be created without writing anything (with files: the progression table and stackable chains)'),
826
- freeform: z.boolean().default(false).describe('Create the Issue from a free-format message without the template check (title from the first 50 characters; priority medium and size s unless given)'),
827
+ freeform: z.boolean().default(false).describe('Create the Issue from a free-format message without the template check (title from the first 50 characters of the first line; priority medium and size s unless given)'),
827
828
  prepare: z.boolean().default(false).describe('Copy a template to the work directory'),
828
829
  template: TEMPLATE_SCHEMA,
829
830
  suffix: z.string().optional().describe('Suffix of the output file name (only with --prepare)'),
@@ -2,7 +2,7 @@
2
2
  // ファイルは読まない。内容(文字列)を受けて値を返す。ファイルを読む側は infra/changelog-file.ts にある。
3
3
  // Python の re と同じ判定にする(\d は Unicode の 10 進数字、\s は str.isspace、$ は末尾の改行 1 つの前でも合う)。
4
4
  import { PecotError, BaseError } from './errors.js';
5
- import { pythonStrip, splitCodePoints } from './python-format.js';
5
+ import { PYTHON_LINE_BREAK, pythonStrip, splitCodePoints } from './python-format.js';
6
6
  export class ChangelogError extends PecotError {
7
7
  }
8
8
  /**
@@ -26,12 +26,8 @@ export const CHANGELOG_FALLBACK_FILES = ['CHANGELOG.md', 'AIST-CHANGELOG.md'];
26
26
  const SEMVER_PATTERN = /^\p{Nd}+\.\p{Nd}+\.\p{Nd}+\n?$/u;
27
27
  // バージョン行の見出し記号と空白より後ろを見る。行の形は `## [X.Y.Z] - YYYY-MM-DD`。
28
28
  const VERSION_PATTERN = /^\[(\p{Nd}+\.\p{Nd}+\.\p{Nd}+)\]/u;
29
- // str.splitlines() の区切り。U+001C〜U+001E も含む。量指定子は無く、unsafe-regex は誤検知。
30
- // eslint-disable-next-line no-control-regex, security/detect-unsafe-regex -- 区切りの制御文字と誤検知
31
- const LINE_BREAK = /[\n\r\v\f\u{1C}-\u{1E}\u{85}\u{2028}\u{2029}]/u;
32
29
  function splitLines(content) {
33
- // 改行コードの \r\n は区切り 1 つと数えるため、先に \n へ揃える
34
- const lines = content.replaceAll('\r\n', '\n').split(LINE_BREAK);
30
+ const lines = content.split(PYTHON_LINE_BREAK);
35
31
  if (lines.at(-1) === '')
36
32
  lines.pop();
37
33
  return lines;
@@ -8,10 +8,9 @@ export interface RemoteLocation {
8
8
  }
9
9
  /**
10
10
  リモート URL を分ける。前後の空白は除く。
11
- 対応する形式は次の 3 つ。
12
- - 形式 1: `https://host/owner/repo[.git]`。
13
- - 形式 2: `git@host:owner/repo[.git]`。
14
- - 形式 3: `ssh://[user@]host[:port]/owner/repo[.git][/]`。
11
+ 対応する形式は次の 2 つ。
12
+ - スキーム付き: `(http|https|ssh|git|ftp|ftps)://[userinfo@]host[:port]/owner/repo[.git][/]`。
13
+ - scp 風: `[user@]host:[/]owner/repo[.git][/]`。
15
14
  */
16
15
  export declare function parseRemoteUrl(url: string): RemoteLocation;
17
16
  //# sourceMappingURL=git-url.d.ts.map
@@ -1,27 +1,26 @@
1
- // Git リモート URL の解析。HTTPS / SSH 形式から (host, owner, repository) を取り出す。
1
+ // Git リモート URL の解析。git-clone の GIT URLS(スキーム付きと scp 風)から (host, owner, repository) を取り出す。
2
2
  import { InvalidValueError } from './errors.js';
3
3
  import { pythonStrip } from './python-format.js';
4
4
  export class RemoteUrlFormatError extends InvalidValueError {
5
5
  }
6
- const HTTPS_URL_PATTERN = /^https?:\/\/([^/]+)\/([^/]+)\/([^/]+?)(?:\.git)?$/u;
7
- const SSH_URL_PATTERN = /^git@([^:]+):([^/]+)\/([^/]+?)(?:\.git)?$/u;
8
- const USERINFO_PATTERN = /^([a-z][a-z0-9+.-]*:\/\/)[^/]*@/iu;
9
6
  // eslint-disable-next-line security/detect-unsafe-regex -- 入力はリモート URL 1 本で、バックトラックの幅は URL の長さに収まる
10
- const SSH_SCHEME_URL_PATTERN = /^ssh:\/\/(?:[^@/]+@)?([^/:@]+)(?::\p{Nd}+)?\/([^/]+)\/([^/]+?)(?:\.git)?\/?$/u;
7
+ const SCHEME_URL_PATTERN = /^(?:https?|ssh|git|ftps?):\/\/(?:[^/@]+@)?([^/:@]+)(?::\d+)?\/([^/~][^/]*)\/([^/]+?)(?:\.git)?\/?$/u;
8
+ // 先頭が `C:` のようなドライブ文字なら、git(Windows)と同じくローカルのパスとみなす。
9
+ // eslint-disable-next-line security/detect-unsafe-regex -- 入力はリモート URL 1 本で、バックトラックの幅は URL の長さに収まる
10
+ const SCP_LIKE_URL_PATTERN = /^(?![A-Za-z]:)(?:[^@/:]+@)?([^/:@]+):\/?([^/~][^/]*)\/([^/]+?)(?:\.git)?\/?$/u;
11
+ const USERINFO_PATTERN = /^([a-z][a-z0-9+.-]*:\/\/)[^/]*@/iu;
11
12
  /**
12
13
  リモート URL を分ける。前後の空白は除く。
13
- 対応する形式は次の 3 つ。
14
- - 形式 1: `https://host/owner/repo[.git]`。
15
- - 形式 2: `git@host:owner/repo[.git]`。
16
- - 形式 3: `ssh://[user@]host[:port]/owner/repo[.git][/]`。
14
+ 対応する形式は次の 2 つ。
15
+ - スキーム付き: `(http|https|ssh|git|ftp|ftps)://[userinfo@]host[:port]/owner/repo[.git][/]`。
16
+ - scp 風: `[user@]host:[/]owner/repo[.git][/]`。
17
17
  */
18
18
  export function parseRemoteUrl(url) {
19
19
  const trimmed = pythonStrip(url);
20
- for (const pattern of [HTTPS_URL_PATTERN, SSH_URL_PATTERN, SSH_SCHEME_URL_PATTERN]) {
20
+ for (const pattern of [SCHEME_URL_PATTERN, SCP_LIKE_URL_PATTERN]) {
21
21
  const [, host, owner, repository] = pattern.exec(trimmed) ?? [];
22
22
  if (host !== undefined && owner !== undefined && repository !== undefined) {
23
- // https://user:token@host/... の userinfo は host に含めない
24
- return { host: host.slice(host.lastIndexOf('@') + 1), owner, repository };
23
+ return { host, owner, repository };
25
24
  }
26
25
  }
27
26
  // エラー文に認証情報(userinfo)を出さない
@@ -1,7 +1,7 @@
1
1
  // PR コマンドの入出力を持たない関数。本文の検証、Closes の抽出と追記、`pr show` の Markdown の整形、preflight の警告の判定。
2
2
  // 引数の型は、infra/github/pulls.ts の返す値が構造として満たす形をここに持つ(domain は infra を import できない)。
3
3
  import { commandHint, hinted, inputHint, inputNameHint, joinHinted } from './command-hint.js';
4
- import { parsePythonInteger, pythonRightStrip, pythonStrip, splitCodePoints, truncateCodePoints } from './python-format.js';
4
+ import { PYTHON_LINE_BREAK, parsePythonInteger, pythonRightStrip, pythonStrip, splitCodePoints, truncateCodePoints } from './python-format.js';
5
5
  import { hasSummaryImage, validateBodyStyle, validateHeadingSummaries, validateSections } from './sections.js';
6
6
  import { RESTACK_PATH } from './restack.js';
7
7
  // Issue 参照(`#N`、URL 内のフラグメントは除く)。`owner/repo#N` の形も受ける
@@ -11,9 +11,6 @@ const PYTHON_SPACE = String.raw `[\t\n\v\f\r\u{1C}-\u{20}\u{85}\u{A0}\u{1680}\u{
11
11
  // GitHub が認識する close・fix・resolve と、それぞれの -s / -es / -d 付きの形。`owner/repo#N` の形も受ける
12
12
  // eslint-disable-next-line security/detect-non-literal-regexp -- 固定の文字列から組み立てる
13
13
  const CLOSING_KEYWORDS_PATTERN = new RegExp(String.raw `(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)${PYTHON_SPACE}+(?:[\w-]+/[\w.-]+)?#(\p{Nd}+)`, 'giu');
14
- // stash の件数を数える行の区切り。str.splitlines と同じ。
15
- // eslint-disable-next-line no-control-regex, security/detect-unsafe-regex -- 区切りの制御文字と誤検知
16
- const LINE_BREAK = /\r\n|[\n\r\v\f\u{1C}-\u{1E}\u{85}\u{2028}\u{2029}]/u;
17
14
  const PR_CREATE_PATH = ['pr', 'create'];
18
15
  export const SCREENSHOT_MISSING_ERROR = hinted `Summary has no image and \`screenshot\` gives no reason to omit one. If the change alters a screen, Markdown the tool writes for GitHub, or CLI output text, take a screenshot and add it to Summary as \`![alt](./<file>.png)\`. Otherwise, write the reason in the \`screenshot\` frontmatter field (\`${inputNameHint(PR_CREATE_PATH, 'screenshot')}\` with \`${inputNameHint(PR_CREATE_PATH, 'message')}\`)`;
19
16
  /**
@@ -284,7 +281,7 @@ export function collectPreflightWarnings(facts) {
284
281
  if (hasStatusChanges(facts.gitStatus))
285
282
  warnings.push({ label: 'Git Status', message: 'modified or untracked files', fixHint: hinted `commit` });
286
283
  if (hasStashEntries(facts.stashList)) {
287
- const count = facts.stashList.split(LINE_BREAK).filter(line => pythonStrip(line) !== '').length;
284
+ const count = facts.stashList.split(PYTHON_LINE_BREAK).filter(line => pythonStrip(line) !== '').length;
288
285
  warnings.push({ label: 'Stash List', message: `${String(count)} stash entries`, fixHint: hinted `check them` });
289
286
  }
290
287
  return warnings;
@@ -2,6 +2,7 @@ import { InvalidValueError } from './errors.js';
2
2
  export type JsonValue = string | number | boolean | null | readonly JsonValue[] | {
3
3
  readonly [key: string]: JsonValue;
4
4
  };
5
+ export declare const PYTHON_LINE_BREAK: RegExp;
5
6
  /**
6
7
  universal newlines と同じ。`\r\n` と `\r` を `\n` に揃える(Python の text=True・read_text())
7
8
  */
@@ -16,6 +16,9 @@ function isPythonWhitespace(character) {
16
16
  const code = character.codePointAt(0) ?? 0;
17
17
  return (character.trim() === '' && code !== 0xFE_FF) || (code >= 0x1C && code <= 0x1F) || code === 0x85;
18
18
  }
19
+ // str.splitlines() の行の区切り。U+001C〜U+001E も含む。量指定子は無く、unsafe-regex は誤検知。
20
+ // eslint-disable-next-line no-control-regex, security/detect-unsafe-regex -- 区切りの制御文字と誤検知
21
+ export const PYTHON_LINE_BREAK = /\r\n|[\n\r\v\f\u{1C}-\u{1E}\u{85}\u{2028}\u{2029}]/u;
19
22
  /**
20
23
  universal newlines と同じ。`\r\n` と `\r` を `\n` に揃える(Python の text=True・read_text())
21
24
  */
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@pecot/workflow-mcp",
3
- "version": "7.0.1-dev.32",
3
+ "version": "7.0.1-dev.34",
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.32",
9
+ "version": "7.0.1-dev.34",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@modelcontextprotocol/server": "^2.4.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pecot/workflow-mcp",
3
- "version": "7.0.1-dev.32",
3
+ "version": "7.0.1-dev.34",
4
4
  "type": "module",
5
5
  "description": "pecot-workflow MCP server (standalone distribution)",
6
6
  "license": "MIT",