issue-scribe-mcp 1.2.0 → 1.3.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/.github/workflows/ci.yml +29 -0
- package/README.md +110 -5
- package/README_EN.md +108 -3
- package/dist/index.js +7 -1689
- package/dist/lib/env.js +9 -0
- package/dist/lib/errors.js +46 -0
- package/dist/lib/octokit.js +13 -0
- package/dist/lib/pagination.js +44 -0
- package/dist/lib/response.js +32 -0
- package/dist/lib/safety.js +12 -0
- package/dist/lib/search.js +32 -0
- package/dist/lib/version.js +14 -0
- package/dist/tools/branches.js +249 -0
- package/dist/tools/comments.js +233 -0
- package/dist/tools/index.js +29 -0
- package/dist/tools/issues.js +393 -0
- package/dist/tools/labels.js +204 -0
- package/dist/tools/pull-requests.js +724 -0
- package/dist/tools/types.js +1 -0
- package/package.json +3 -3
- package/src/index.ts +7 -1869
- package/src/lib/env.ts +15 -0
- package/src/lib/errors.ts +64 -0
- package/src/lib/octokit.ts +17 -0
- package/src/lib/pagination.ts +72 -0
- package/src/lib/response.ts +42 -0
- package/src/lib/safety.ts +25 -0
- package/src/lib/search.ts +52 -0
- package/src/lib/version.ts +19 -0
- package/src/tools/branches.ts +287 -0
- package/src/tools/comments.ts +272 -0
- package/src/tools/index.ts +39 -0
- package/src/tools/issues.ts +452 -0
- package/src/tools/labels.ts +239 -0
- package/src/tools/pull-requests.ts +838 -0
- package/src/tools/types.ts +18 -0
- package/test/safety.test.mjs +28 -0
- package/test/search.test.mjs +28 -0
- package/test/version-and-metadata.test.mjs +32 -0
- package/test-local.sh +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
|
|
3
|
+
export interface ToolDefinition {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: Record<string, unknown>;
|
|
9
|
+
required?: string[];
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type ToolHandler = (args: unknown) => Promise<CallToolResult>;
|
|
14
|
+
|
|
15
|
+
export interface ToolRegistration {
|
|
16
|
+
definition: ToolDefinition;
|
|
17
|
+
handler: ToolHandler;
|
|
18
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import { assertConfirmation, assertExpectedValue, CONFIRM_TOKEN_VALUE } from "../dist/lib/safety.js";
|
|
5
|
+
|
|
6
|
+
test("assertConfirmation accepts the expected confirmation token", () => {
|
|
7
|
+
assert.doesNotThrow(() => {
|
|
8
|
+
assertConfirmation(CONFIRM_TOKEN_VALUE, "merge");
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test("assertConfirmation rejects missing token", () => {
|
|
13
|
+
assert.throws(() => {
|
|
14
|
+
assertConfirmation(undefined, "merge");
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test("assertExpectedValue passes on equal values", () => {
|
|
19
|
+
assert.doesNotThrow(() => {
|
|
20
|
+
assertExpectedValue("abc", "abc", "sha");
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test("assertExpectedValue rejects mismatch", () => {
|
|
25
|
+
assert.throws(() => {
|
|
26
|
+
assertExpectedValue("abc", "def", "sha");
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import { buildRepositorySearchQuery, normalizeSearchSort } from "../dist/lib/search.js";
|
|
5
|
+
|
|
6
|
+
test("buildRepositorySearchQuery includes repo, type, state, labels, and qualifiers", () => {
|
|
7
|
+
const query = buildRepositorySearchQuery({
|
|
8
|
+
owner: "octo",
|
|
9
|
+
repo: "hello",
|
|
10
|
+
kind: "issue",
|
|
11
|
+
state: "open",
|
|
12
|
+
query: "memory leak",
|
|
13
|
+
labels: ["bug", "urgent"],
|
|
14
|
+
qualifiers: ["author:alice", "is:unmerged"],
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
assert.equal(
|
|
18
|
+
query,
|
|
19
|
+
'memory leak repo:octo/hello is:issue is:open label:"bug" label:"urgent" author:alice is:unmerged'
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test("normalizeSearchSort maps legacy values and best-match", () => {
|
|
24
|
+
assert.equal(normalizeSearchSort("best-match"), undefined);
|
|
25
|
+
assert.equal(normalizeSearchSort("popularity"), "comments");
|
|
26
|
+
assert.equal(normalizeSearchSort("long-running"), "updated");
|
|
27
|
+
assert.equal(normalizeSearchSort("created"), "created");
|
|
28
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import test from "node:test";
|
|
4
|
+
|
|
5
|
+
import { SERVER_VERSION } from "../dist/lib/version.js";
|
|
6
|
+
import { toolCount, toolDefinitions } from "../dist/tools/index.js";
|
|
7
|
+
|
|
8
|
+
const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
9
|
+
const testLocalScript = readFileSync(new URL("../test-local.sh", import.meta.url), "utf8");
|
|
10
|
+
const readmeKo = readFileSync(new URL("../README.md", import.meta.url), "utf8");
|
|
11
|
+
const readmeEn = readFileSync(new URL("../README_EN.md", import.meta.url), "utf8");
|
|
12
|
+
|
|
13
|
+
test("server version follows package.json version", () => {
|
|
14
|
+
assert.equal(SERVER_VERSION, packageJson.version);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test("tool registry exposes consistent count", () => {
|
|
18
|
+
assert.equal(toolCount, toolDefinitions.length);
|
|
19
|
+
assert.ok(toolCount > 0);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test("README tool sections stay in sync with tool registry count", () => {
|
|
23
|
+
const koToolSections = (readmeKo.match(/^### github_/gm) ?? []).length;
|
|
24
|
+
const enToolSections = (readmeEn.match(/^### github_/gm) ?? []).length;
|
|
25
|
+
|
|
26
|
+
assert.equal(koToolSections, toolCount);
|
|
27
|
+
assert.equal(enToolSections, toolCount);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test("test-local script does not hardcode obsolete tool count", () => {
|
|
31
|
+
assert.equal(testLocalScript.includes("9개가 보여야 함"), false);
|
|
32
|
+
});
|
package/test-local.sh
CHANGED
|
@@ -51,7 +51,7 @@ echo "브라우저가 자동으로 열립니다."
|
|
|
51
51
|
echo ""
|
|
52
52
|
echo "💡 사용 방법:"
|
|
53
53
|
echo " 1. 브라우저에서 'Connect' 버튼 클릭"
|
|
54
|
-
echo " 2. 왼쪽에서 사용 가능한 Tools 확인
|
|
54
|
+
echo " 2. 왼쪽에서 사용 가능한 Tools 확인"
|
|
55
55
|
echo " 3. Tool을 선택하고 파라미터 입력 후 테스트"
|
|
56
56
|
echo " 4. 예시: github_get_issue_context"
|
|
57
57
|
echo " - owner: gay00ung"
|