git-mob-mcp-server 1.0.0 → 1.0.2

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/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
2
3
  import { createGitMobServer } from "./gitMobServerFactory.js";
3
4
  (async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-mob-mcp-server",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "MCP Server for git-mob CLI app",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -25,6 +25,7 @@
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public",
28
+ "provenance": true,
28
29
  "registry": "https://registry.npmjs.org/",
29
30
  "tag": "latest"
30
31
  },
@@ -1,114 +0,0 @@
1
- import { describe, test, expect, beforeEach, jest } from "@jest/globals";
2
- import * as gitMobClient from "./gitMobClient";
3
- import { runCliCommand } from "../helpers/index.js";
4
- jest.mock("../helpers/index.js", () => ({
5
- runCliCommand: jest.fn(),
6
- }));
7
- const mockRunCmd = runCliCommand;
8
- describe("[clients] gitMobClient", () => {
9
- beforeEach(() => {
10
- jest.resetAllMocks();
11
- });
12
- test("setupGlobal", async () => {
13
- mockRunCmd.mockResolvedValue({ ok: true, value: "Setup complete" });
14
- const result = await gitMobClient.setupGlobal();
15
- expect(runCliCommand).toHaveBeenCalledWith("git-mob", [
16
- "setup",
17
- "--global",
18
- ]);
19
- expect(result).toEqual({ ok: true, value: "Setup complete" });
20
- });
21
- test("setupLocal", async () => {
22
- mockRunCmd.mockResolvedValue({ ok: true, value: "Setup complete" });
23
- const result = await gitMobClient.setupLocal();
24
- expect(runCliCommand).toHaveBeenCalledWith("git-mob", ["setup", "--local"]);
25
- expect(result).toEqual({ ok: true, value: "Setup complete" });
26
- });
27
- test("addCoauthor", async () => {
28
- mockRunCmd.mockResolvedValue({
29
- ok: true,
30
- value: "Alice Bob <alice@example.com>",
31
- });
32
- const result = await gitMobClient.addCoauthor("ab", "Alice Bob", "alice@example.com");
33
- expect(runCliCommand).toHaveBeenCalledWith("git-mob", [
34
- "coauthor",
35
- "--add",
36
- "ab",
37
- "Alice Bob",
38
- "alice@example.com",
39
- ]);
40
- expect(result).toEqual({
41
- ok: true,
42
- value: "Alice Bob <alice@example.com>",
43
- });
44
- });
45
- test("deleteCoauthor", async () => {
46
- mockRunCmd.mockResolvedValue({ ok: true, value: "" });
47
- const result = await gitMobClient.deleteCoauthor("ab");
48
- expect(runCliCommand).toHaveBeenCalledWith("git-mob", [
49
- "coauthor",
50
- "--delete",
51
- "ab",
52
- ]);
53
- expect(result).toEqual({ ok: true, value: "" });
54
- });
55
- test("listCoauthors", async () => {
56
- const coauthorList = "leo Leo Messi <leo.messi@arg.com>\nab Alice Bob <alice@example.com>";
57
- mockRunCmd.mockResolvedValue({ ok: true, value: coauthorList });
58
- const result = await gitMobClient.listCoauthors();
59
- expect(runCliCommand).toHaveBeenCalledWith("git-mob", [
60
- "coauthor",
61
- "--list",
62
- ]);
63
- expect(result).toEqual({ ok: true, value: coauthorList });
64
- });
65
- test("setMobSession", async () => {
66
- const session = "leo Leo Messi <leo.messi@arg.com>\nab Alice Bob <alice@example.com>";
67
- mockRunCmd.mockResolvedValue({ ok: true, value: session });
68
- const result = await gitMobClient.setMobSession(["ab", "cd"]);
69
- expect(runCliCommand).toHaveBeenCalledWith("git-mob", [
70
- "--with",
71
- "ab",
72
- "cd",
73
- ]);
74
- expect(result).toEqual({ ok: true, value: session });
75
- });
76
- test("clearMobSession", async () => {
77
- mockRunCmd.mockResolvedValue({ ok: true, value: "" });
78
- const result = await gitMobClient.clearMobSession();
79
- expect(runCliCommand).toHaveBeenCalledWith("git-mob", ["--clear"]);
80
- expect(result).toEqual({ ok: true, value: "" });
81
- });
82
- test("listMobSessionCoauthors", async () => {
83
- const coauthors = "leo Leo Messi <leo.messi@arg.com>\nab Alice Bob <alice@example.com>";
84
- mockRunCmd.mockResolvedValue({ ok: true, value: coauthors });
85
- const result = await gitMobClient.listMobSessionCoauthors();
86
- expect(runCliCommand).toHaveBeenCalledWith("git-mob", ["--list"]);
87
- expect(result).toEqual({ ok: true, value: coauthors });
88
- });
89
- test("listMobSessionCoauthorTrailers", async () => {
90
- const trailers = "Co-authored-by: Leo Messi <leo.messi@arg.com>\nCo-authored-by: Alice Bob <alice@example.com>";
91
- mockRunCmd.mockResolvedValue({ ok: true, value: trailers });
92
- const result = await gitMobClient.listMobSessionCoauthorTrailers();
93
- expect(runCliCommand).toHaveBeenCalledWith("git-mob", ["--trailers"]);
94
- expect(result).toEqual({ ok: true, value: trailers });
95
- });
96
- test("getVersion", async () => {
97
- mockRunCmd.mockResolvedValue({ ok: true, value: "git-mob-tool 1.6.2" });
98
- const result = await gitMobClient.getVersion();
99
- expect(runCliCommand).toHaveBeenCalledWith("git-mob", ["--version"]);
100
- expect(result).toEqual({ ok: true, value: "git-mob-tool 1.6.2" });
101
- });
102
- test("getHelp (no command)", async () => {
103
- mockRunCmd.mockResolvedValue({ ok: true, value: "help" });
104
- const result = await gitMobClient.getHelp();
105
- expect(runCliCommand).toHaveBeenCalledWith("git-mob", ["help"]);
106
- expect(result).toEqual({ ok: true, value: "help" });
107
- });
108
- test("getHelp (with command)", async () => {
109
- mockRunCmd.mockResolvedValue({ ok: true, value: "help setup" });
110
- const result = await gitMobClient.getHelp("setup");
111
- expect(runCliCommand).toHaveBeenCalledWith("git-mob", ["help", "setup"]);
112
- expect(result).toEqual({ ok: true, value: "help setup" });
113
- });
114
- });
@@ -1,58 +0,0 @@
1
- import { describe, it, expect, jest } from "@jest/globals";
2
- import * as helpers from "./helpers/index.js";
3
- import * as resources from "./resources/index.js";
4
- import * as tools from "./tools/index.js";
5
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
6
- import { createGitMobServer } from "./gitMobServerFactory.js";
7
- jest.mock("./helpers/index.js", () => ({
8
- registerGitMobTool: jest.fn(),
9
- registerGitMobResource: jest.fn(),
10
- registerGtMobResourceAsTool: jest.fn(),
11
- }));
12
- jest.mock("@modelcontextprotocol/sdk/server/mcp.js", () => {
13
- const actual = jest.requireActual("@modelcontextprotocol/sdk/server/mcp.js");
14
- return {
15
- ...actual,
16
- McpServer: jest.fn().mockImplementation((meta, opts) => ({ meta, opts })),
17
- };
18
- });
19
- describe("gitMobServerFactory: createGitMobServer", () => {
20
- const mockMCPServer = McpServer;
21
- it("should create an instance of McpServer for Git Mob", () => {
22
- createGitMobServer();
23
- expect(mockMCPServer).toHaveBeenCalledWith({ name: "Git Mob", version: "1.0.0" }, {
24
- capabilities: {
25
- tools: {},
26
- resources: {},
27
- },
28
- });
29
- });
30
- it("should register all resources", async () => {
31
- const { registerGitMobResource } = helpers;
32
- const server = createGitMobServer();
33
- expect(registerGitMobResource).toHaveBeenCalledWith(server, resources.gitMobVersion);
34
- expect(registerGitMobResource).toHaveBeenCalledWith(server, resources.gitMobHelp);
35
- expect(registerGitMobResource).toHaveBeenCalledWith(server, resources.teamMembers);
36
- expect(registerGitMobResource).toHaveBeenCalledWith(server, resources.mobSessionCoauthors);
37
- expect(registerGitMobResource).toHaveBeenCalledWith(server, resources.mobSessionCoauthorTrailers);
38
- });
39
- it("should register all resources as tools", async () => {
40
- const { registerGtMobResourceAsTool } = helpers;
41
- const server = createGitMobServer();
42
- expect(registerGtMobResourceAsTool).toHaveBeenCalledWith(server, resources.gitMobVersion);
43
- expect(registerGtMobResourceAsTool).toHaveBeenCalledWith(server, resources.gitMobHelp);
44
- expect(registerGtMobResourceAsTool).toHaveBeenCalledWith(server, resources.teamMembers);
45
- expect(registerGtMobResourceAsTool).toHaveBeenCalledWith(server, resources.mobSessionCoauthors);
46
- expect(registerGtMobResourceAsTool).toHaveBeenCalledWith(server, resources.mobSessionCoauthorTrailers);
47
- });
48
- it("should register all tools", async () => {
49
- const { registerGitMobTool } = helpers;
50
- const server = createGitMobServer();
51
- expect(registerGitMobTool).toHaveBeenCalledWith(server, tools.setupGitMobGlobally);
52
- expect(registerGitMobTool).toHaveBeenCalledWith(server, tools.setupGitMobLocally);
53
- expect(registerGitMobTool).toHaveBeenCalledWith(server, tools.addTeamMember);
54
- expect(registerGitMobTool).toHaveBeenCalledWith(server, tools.deleteTeamMember);
55
- expect(registerGitMobTool).toHaveBeenCalledWith(server, tools.setMobSessionCoauthors);
56
- expect(registerGitMobTool).toHaveBeenCalledWith(server, tools.clearMobSession);
57
- });
58
- });
@@ -1,36 +0,0 @@
1
- import { describe, it, expect, jest } from "@jest/globals";
2
- import { registerGitMobResource } from "./registerGitMobResource";
3
- import { ResourceTemplate, } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- describe("[helpers] registerGitMobResource", () => {
5
- it("should register given git mob resource with the given server", () => {
6
- const mockServer = {
7
- resource: jest.fn(),
8
- };
9
- const name = "test_resource";
10
- const template = new ResourceTemplate("gitmob://test-resource", {
11
- list: undefined,
12
- });
13
- const metadata = {
14
- description: "This is a test resource for testing purposes.",
15
- mimeType: "text/plain",
16
- };
17
- const readCallback = async (uri) => {
18
- return {
19
- contents: [
20
- {
21
- uri: uri.href,
22
- text: "hello world",
23
- },
24
- ],
25
- };
26
- };
27
- const testResource = {
28
- name,
29
- template,
30
- metadata,
31
- readCallback,
32
- };
33
- registerGitMobResource(mockServer, testResource);
34
- expect(mockServer.resource).toHaveBeenCalledWith(testResource.name, testResource.template, testResource.metadata, testResource.readCallback);
35
- });
36
- });
@@ -1,63 +0,0 @@
1
- import { describe, it, expect, jest } from "@jest/globals";
2
- import { registerGtMobResourceAsTool } from "./registerGitMobResourceAsTool";
3
- import { ResourceTemplate, } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- describe("[helpers] registerGtMobResourceAsTool", () => {
5
- const RESOURCE_CALLBACK_CONTENT = "hello world";
6
- const arrangeMockServerAndTestResource = () => {
7
- const mockServer = {
8
- registerTool: jest.fn(),
9
- };
10
- const name = "test_resource";
11
- const template = new ResourceTemplate("gitmob://test-resource", {
12
- list: undefined,
13
- });
14
- const metadata = {
15
- description: "This is a test resource for testing purposes.",
16
- mimeType: "text/plain",
17
- };
18
- const readCallback = async (uri) => {
19
- return {
20
- contents: [
21
- {
22
- uri: uri.href,
23
- text: RESOURCE_CALLBACK_CONTENT,
24
- },
25
- ],
26
- };
27
- };
28
- const testResource = {
29
- name,
30
- template,
31
- metadata,
32
- readCallback,
33
- };
34
- return { mockServer, testResource };
35
- };
36
- it("should register a resource as a tool with the given server", async () => {
37
- const { mockServer, testResource } = arrangeMockServerAndTestResource();
38
- registerGtMobResourceAsTool(mockServer, testResource);
39
- expect(mockServer.registerTool).toHaveBeenCalledWith(`get_${testResource.name}`, {
40
- description: String(testResource.metadata.description),
41
- inputSchema: {},
42
- annotations: {
43
- title: `get_${testResource.name}`,
44
- readOnlyHint: true,
45
- destructiveHint: false,
46
- idempotentHint: true,
47
- openWorldHint: false,
48
- },
49
- }, expect.any(Function));
50
- });
51
- it("should have registered tool callback return the resource callback content when invoked", async () => {
52
- const { mockServer, testResource } = arrangeMockServerAndTestResource();
53
- const readCallBackSpy = jest.spyOn(testResource, "readCallback");
54
- registerGtMobResourceAsTool(mockServer, testResource);
55
- const toolCallback = mockServer.registerTool.mock
56
- .calls[0][2];
57
- const result = await toolCallback({}, {});
58
- expect(readCallBackSpy).toHaveBeenCalled();
59
- expect(result).toEqual({
60
- content: [{ type: "text", text: RESOURCE_CALLBACK_CONTENT }],
61
- });
62
- });
63
- });
@@ -1,40 +0,0 @@
1
- import { describe, it, expect, jest } from "@jest/globals";
2
- import { registerGitMobTool } from "./registerGitMobTool";
3
- import { z } from "zod";
4
- describe("[helpers] registerGitMobTool", () => {
5
- it("should register given git mob tool with the given server", () => {
6
- const mockServer = {
7
- registerTool: jest.fn(),
8
- };
9
- const name = "test_tool";
10
- const description = "This is a tool for testing purposes.";
11
- const inputSchema = {
12
- foo: z.string(),
13
- bar: z.string(),
14
- };
15
- const annotations = {
16
- title: "Test me",
17
- readOnlyHint: false,
18
- destructiveHint: false,
19
- idempotentHint: false,
20
- openWorldHint: false,
21
- };
22
- const callback = async ({ foo, bar }) => {
23
- return { content: [{ type: "text", text: foo + bar }] };
24
- };
25
- const testTool = {
26
- name,
27
- description,
28
- inputSchema,
29
- annotations,
30
- callback,
31
- };
32
- registerGitMobTool(mockServer, testTool);
33
- expect(mockServer.registerTool).toHaveBeenCalledWith(testTool.name, {
34
- description: testTool.description,
35
- inputSchema: testTool.inputSchema,
36
- outputSchema: testTool.outputSchema,
37
- annotations: testTool.annotations,
38
- }, testTool.callback);
39
- });
40
- });
@@ -1,38 +0,0 @@
1
- import { describe, it, expect } from "@jest/globals";
2
- import { runCliCommand } from "./runCliCommand";
3
- describe("[helpers] runCliCommand", () => {
4
- it("should return ok and stdout for a successful command", async () => {
5
- const result = await runCliCommand("node", ["-e", "console.log('hello')"]);
6
- expect(result.ok).toBe(true);
7
- expect(result.value.trim()).toBe("hello");
8
- });
9
- it("should return ok and stderr for a command that writes to stderr but exits 0", async () => {
10
- const result = await runCliCommand("node", [
11
- "-e",
12
- "console.error('err'); process.exit(0)",
13
- ]);
14
- expect(result.ok).toBe(true);
15
- expect(result.value.trim()).toBe("err");
16
- });
17
- it("should return ok: false and stderr for a command that fails with stderr", async () => {
18
- const result = await runCliCommand("node", [
19
- "-e",
20
- "console.error('fail'); process.exit(1)",
21
- ]);
22
- expect(result.ok).toBe(false);
23
- expect(result.value.trim()).toBe("fail");
24
- });
25
- it("should return ok: false and stdout for a command that fails with stdout only", async () => {
26
- const result = await runCliCommand("node", [
27
- "-e",
28
- "console.log('failout'); process.exit(1)",
29
- ]);
30
- expect(result.ok).toBe(false);
31
- expect(result.value.trim()).toBe("failout");
32
- });
33
- it("should return ok: false and message for a non-existent command", async () => {
34
- const result = await runCliCommand("nonexistent-cmd-xyz", []);
35
- expect(result.ok).toBe(false);
36
- expect(result.value.trim()).toBe("spawn nonexistent-cmd-xyz ENOENT");
37
- });
38
- });
@@ -1,22 +0,0 @@
1
- import { describe, expect, it, jest } from "@jest/globals";
2
- import { createGitMobServer } from "./gitMobServerFactory.js";
3
- // Mock StdioServerTransport from the MCP SDK
4
- const transport = {};
5
- const mockConnect = jest.fn();
6
- const mockStdioServerTransport = jest.fn().mockImplementation(() => transport);
7
- jest.mock("@modelcontextprotocol/sdk/server/stdio.js", () => ({
8
- StdioServerTransport: mockStdioServerTransport,
9
- }));
10
- // Mock createGitMobServer to return a mock server with a connect method
11
- jest.mock("./gitMobServerFactory.js", () => ({
12
- createGitMobServer: jest.fn(() => ({ connect: mockConnect })),
13
- }));
14
- describe("index.ts", () => {
15
- it("should create a server, transport, and connect them", async () => {
16
- // Dynamically import index.ts to run its top-level code
17
- await import("./index.js");
18
- expect(createGitMobServer).toHaveBeenCalled();
19
- expect(mockStdioServerTransport).toHaveBeenCalled();
20
- expect(mockConnect).toHaveBeenCalledWith(transport);
21
- });
22
- });
@@ -1,23 +0,0 @@
1
- import resource from "./gitMobHelp";
2
- import { describe, it, expect } from "@jest/globals";
3
- import { ResourceTemplate, } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- describe("[resources] gitMobHelp", () => {
5
- it("should have correct name", () => {
6
- expect(resource.name).toBe("git_mob_help");
7
- });
8
- it("should have correct template", () => {
9
- const template = new ResourceTemplate("gitmob://help", {
10
- list: undefined,
11
- });
12
- expect(resource.template).toEqual(template);
13
- });
14
- it("should have correct metadata", () => {
15
- const metadata = {
16
- description: "Displays general help and usage information for the Git Mob CLI. " +
17
- "You can optionally provide a command ('setup', 'coauthor', or 'help') " +
18
- "to get detailed help for that specific command.",
19
- mimeType: "text/plain",
20
- };
21
- expect(resource.metadata).toEqual(metadata);
22
- });
23
- });
@@ -1,19 +0,0 @@
1
- import resource from "./gitMobVersion";
2
- import { describe, it, expect } from "@jest/globals";
3
- import { ResourceTemplate, } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- describe("[resources] gitMobVersion", () => {
5
- it("should have correct name", () => {
6
- expect(resource.name).toBe("git_mob_version");
7
- });
8
- it("should have correct template", () => {
9
- const template = new ResourceTemplate("gitmob://version", { list: undefined });
10
- expect(resource.template).toEqual(template);
11
- });
12
- it("should have correct metadata", () => {
13
- const metadata = {
14
- description: "The installed version of the Git Mob CLI.",
15
- mimeType: "text/plain",
16
- };
17
- expect(resource.metadata).toEqual(metadata);
18
- });
19
- });
@@ -1,22 +0,0 @@
1
- import resource from "./mobSessionCoauthorTrailers";
2
- import { describe, it, expect } from "@jest/globals";
3
- import { ResourceTemplate, } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- describe("[resources] mobSessionCoauthorTrailers", () => {
5
- it("should have correct name", () => {
6
- expect(resource.name).toBe("mob_session_coauthor_trailers");
7
- });
8
- it("should have correct template", () => {
9
- const template = new ResourceTemplate("gitmob://mob-session-coauthor-trailers", { list: undefined });
10
- expect(resource.template).toEqual(template);
11
- });
12
- it("should have correct metadata", () => {
13
- const metadata = {
14
- description: "List of the git Co-authored-by trailers for the coauthors " +
15
- "currently included in the active mob or pairing session. " +
16
- "If Git Mob is setup, these Co-authored-by trailers will be automatically " +
17
- "added to the commit's message when making commits during the session.",
18
- mimeType: "text/plain",
19
- };
20
- expect(resource.metadata).toEqual(metadata);
21
- });
22
- });
@@ -1,21 +0,0 @@
1
- import resource from "./mobSessionCoauthors";
2
- import { describe, it, expect } from "@jest/globals";
3
- import { ResourceTemplate, } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- describe("[resources] mobSessionCoauthors", () => {
5
- it("should have correct name", () => {
6
- expect(resource.name).toBe("mob_session_coauthors");
7
- });
8
- it("should have correct template", () => {
9
- const template = new ResourceTemplate("gitmob://mob-session-coauthors", { list: undefined });
10
- expect(resource.template).toEqual(template);
11
- });
12
- it("should have correct metadata", () => {
13
- const metadata = {
14
- description: "List of all coauthors currently included in the active mob or pairing session. " +
15
- "If Git Mob is setup, these coauthors will be automatically added as " +
16
- "Co-authored-by trailers to the commit's message when making commits during the session.",
17
- mimeType: "text/plain",
18
- };
19
- expect(resource.metadata).toEqual(metadata);
20
- });
21
- });
@@ -1,22 +0,0 @@
1
- import resource from "./teamMembers";
2
- import { describe, it, expect } from "@jest/globals";
3
- import { ResourceTemplate, } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- describe("[resources] teamMembers", () => {
5
- it("should have correct name", () => {
6
- expect(resource.name).toBe("team_members");
7
- });
8
- it("should have correct template", () => {
9
- const template = new ResourceTemplate("gitmob://team-members", { list: undefined });
10
- expect(resource.template).toEqual(template);
11
- });
12
- it("should have correct metadata", () => {
13
- const metadata = {
14
- description: "List of all the team members that have been added to Git Mob. " +
15
- "The team members can then be used in pairing / mobbing sessions as coauthors." +
16
- "Each entry is formatted as: <key> <name> <email>." +
17
- "Ask the user which team member(s) they want to pair or mob with.",
18
- mimeType: "text/plain",
19
- };
20
- expect(resource.metadata).toEqual(metadata);
21
- });
22
- });
@@ -1,33 +0,0 @@
1
- import { z } from "zod";
2
- import tool from "./addTeamMember.js";
3
- import { describe, it, expect } from "@jest/globals";
4
- describe("[tools] addTeamMember", () => {
5
- it("should have correct name", () => {
6
- expect(tool.name).toBe("add_team_member");
7
- });
8
- it("should have correct description", () => {
9
- const description = "Adds a new team member using their key, name, and email. " +
10
- "This member can then be used in a pairing or mobbing sessions as a cauthor. " +
11
- "The first name is a good choice for the key." +
12
- "Ask the user if they want mob or pair with this team member.";
13
- expect(tool.description).toBe(description);
14
- });
15
- it("should have correct input schema", () => {
16
- const inputSchema = {
17
- key: z.string(),
18
- name: z.string(),
19
- email: z.string(),
20
- };
21
- expect(JSON.stringify(tool.inputSchema)).toEqual(JSON.stringify(inputSchema));
22
- });
23
- it("should have correct annotations", () => {
24
- const annotations = {
25
- title: "Add Team Member",
26
- readOnlyHint: false,
27
- destructiveHint: false,
28
- idempotentHint: false,
29
- openWorldHint: false,
30
- };
31
- expect(tool.annotations).toEqual(annotations);
32
- });
33
- });
@@ -1,25 +0,0 @@
1
- import tool from "./clearMobSession.js";
2
- import { describe, it, expect } from "@jest/globals";
3
- describe("[tools] clearMobSession", () => {
4
- it("should have correct name", () => {
5
- expect(tool.name).toBe("clear_mob_session");
6
- });
7
- it("should have correct description", () => {
8
- const description = "Clears the active mob or pairing session.";
9
- expect(tool.description).toBe(description);
10
- });
11
- it("should have correct input schema", () => {
12
- const inputSchema = {};
13
- expect(JSON.stringify(tool.inputSchema)).toEqual(JSON.stringify(inputSchema));
14
- });
15
- it("should have correct annotations", () => {
16
- const annotations = {
17
- title: "Clear Mob Session",
18
- readOnlyHint: false,
19
- destructiveHint: false,
20
- idempotentHint: true,
21
- openWorldHint: false,
22
- };
23
- expect(tool.annotations).toEqual(annotations);
24
- });
25
- });
@@ -1,30 +0,0 @@
1
- import { z } from "zod";
2
- import tool from "./deleteTeamMember.js";
3
- import { describe, it, expect } from "@jest/globals";
4
- describe("[tools] deleteTeamMember", () => {
5
- it("should have correct name", () => {
6
- expect(tool.name).toBe("delete_team_member");
7
- });
8
- it("should have correct description", () => {
9
- const description = "Deletes a team member by their key. " +
10
- "User can only delete a team member they have added previously. " +
11
- "If user did not specify a key, show them list of existing team members and ask them to select one.";
12
- expect(tool.description).toBe(description);
13
- });
14
- it("should have correct input schema", () => {
15
- const inputSchema = {
16
- key: z.string(),
17
- };
18
- expect(JSON.stringify(tool.inputSchema)).toEqual(JSON.stringify(inputSchema));
19
- });
20
- it("should have correct annotations", () => {
21
- const annotations = {
22
- title: "Delete Team Member",
23
- readOnlyHint: false,
24
- destructiveHint: true,
25
- idempotentHint: true,
26
- openWorldHint: false,
27
- };
28
- expect(tool.annotations).toEqual(annotations);
29
- });
30
- });
@@ -1,31 +0,0 @@
1
- import { z } from "zod";
2
- import tool from "./setMobSessionCoauthors.js";
3
- import { describe, it, expect } from "@jest/globals";
4
- describe("[tools] setMobSessionCoauthors", () => {
5
- it("should have correct name", () => {
6
- expect(tool.name).toBe("set_mob_session_coauthors");
7
- });
8
- it("should have correct description", () => {
9
- const description = "Sets the active pairing or mob session by specifying the " +
10
- "keys of the team members to include as coauthors. " +
11
- "If Git Mob is setup, these coauthors will be automatically added as " +
12
- "Co-authored-by trailers to the commit's message when making commits during the session.";
13
- expect(tool.description).toBe(description);
14
- });
15
- it("should have correct input schema", () => {
16
- const inputSchema = {
17
- coauthorKeys: z.array(z.string()).min(1),
18
- };
19
- expect(JSON.stringify(tool.inputSchema)).toEqual(JSON.stringify(inputSchema));
20
- });
21
- it("should have correct annotations", () => {
22
- const annotations = {
23
- title: "Set Mob or Pairing Session Coauthors using Team Members",
24
- readOnlyHint: false,
25
- destructiveHint: true,
26
- idempotentHint: true,
27
- openWorldHint: false,
28
- };
29
- expect(tool.annotations).toEqual(annotations);
30
- });
31
- });
@@ -1,29 +0,0 @@
1
- import tool from "./setupGitMobGlobally.js";
2
- import { describe, it, expect } from "@jest/globals";
3
- describe("[tools] setupGitMobGlobally", () => {
4
- it("should have correct name", () => {
5
- expect(tool.name).toBe("setup_git_mob_globally");
6
- });
7
- it("should have correct description", () => {
8
- const description = "Configures the Git Mob CLI globally for all repositories on your system. " +
9
- "This one-time setup installs a global prepare-commit-msg git hook, which automatically " +
10
- "appends Co-authored-by trailers to commit messages during mob or pairing sessions. " +
11
- "If a repository overrides the core.hooksPath git configuration (e.g., when using " +
12
- "Husky), the setupGitMobLocally tool needs to be invoked in addition to this. ";
13
- expect(tool.description).toBe(description);
14
- });
15
- it("should have correct input schema", () => {
16
- const inputSchema = {};
17
- expect(JSON.stringify(tool.inputSchema)).toEqual(JSON.stringify(inputSchema));
18
- });
19
- it("should have correct annotations", () => {
20
- const annotations = {
21
- title: "Setup Git Mob Globally",
22
- readOnlyHint: false,
23
- destructiveHint: true,
24
- idempotentHint: false,
25
- openWorldHint: false,
26
- };
27
- expect(tool.annotations).toEqual(annotations);
28
- });
29
- });
@@ -1,30 +0,0 @@
1
- import tool from "./setupGitMobLocally.js";
2
- import { describe, it, expect } from "@jest/globals";
3
- describe("[tools] setupGitMobLocally", () => {
4
- it("should have correct name", () => {
5
- expect(tool.name).toBe("setup_git_mob_locally");
6
- });
7
- it("should have correct description", () => {
8
- const description = "Sets up the Git Mob CLI for the current repository by installing a local " +
9
- "prepare-commit-msg git hook. This hook delegates to the global " +
10
- "prepare-commit-msg hook configured by setupGitMobGlobally. Use this tool " +
11
- "only if your repository overrides the core.hooksPath git " +
12
- "configuration (e.g., when using Husky). Note: You must run " +
13
- "setupGitMobGlobally at least once before using this tool.";
14
- expect(tool.description).toBe(description);
15
- });
16
- it("should have correct input schema", () => {
17
- const inputSchema = {};
18
- expect(JSON.stringify(tool.inputSchema)).toEqual(JSON.stringify(inputSchema));
19
- });
20
- it("should have correct annotations", () => {
21
- const annotations = {
22
- title: "Setup Git Mob Locally",
23
- readOnlyHint: false,
24
- destructiveHint: true,
25
- idempotentHint: false,
26
- openWorldHint: false,
27
- };
28
- expect(tool.annotations).toEqual(annotations);
29
- });
30
- });