Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/gittensory-mcp/bin/gittensory-mcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { buildBranchAnalysisPayload, collectLocalDiff, collectLocalBranchMetadat
const defaultApiUrl = "https://gittensory-api.aethereal.dev";
const legacyDefaultApiUrls = new Set(["https://gittensory-api.zeronode.workers.dev"]);
const packageName = "@jsonbored/gittensory-mcp";
const packageVersion = "0.5.0";
const packageVersion = "0.6.0";
const npmRegistryUrl = (process.env.GITTENSORY_NPM_REGISTRY_URL ?? "https://registry.npmjs.org").replace(/\/+$/, "");
const upgradeCommand = `npm install -g ${packageName}@latest`;
const npxFallbackCommand = `npx ${packageName}@latest <command>`;
Expand Down
22 changes: 11 additions & 11 deletions test/unit/mcp-cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ describe("gittensory-mcp CLI", () => {

it("reports a current install without upgrade guidance", async () => {
tempDir = mkdtempSync(join(tmpdir(), "gittensory-cli-"));
const url = await startFixtureServer({ latestVersion: "0.5.0", minMcpVersion: "0.5.0" });
const url = await startFixtureServer({ latestVersion: "0.6.0", minMcpVersion: "0.5.0" });
const payload = JSON.parse(
await runAsync(["status", "--json"], {
GITTENSORY_API_URL: url,
Expand All @@ -232,7 +232,7 @@ describe("gittensory-mcp CLI", () => {
status: "compatible",
source: "compatibility_endpoint",
minVersion: "0.5.0",
latestRecommendedVersion: "0.5.0",
latestRecommendedVersion: "0.6.0",
apiVersion: "0.1.0",
});
});
Expand All @@ -252,8 +252,8 @@ describe("gittensory-mcp CLI", () => {
expect(ahead.package).toMatchObject({ state: "ahead", updateAvailable: false });
await new Promise<void>((resolve) => server?.close(() => resolve()));

// Local 0.5.0 vs a higher-core prerelease 0.6.0-rc.1 -> stale.
const staleUrl = await startFixtureServer({ latestVersion: "0.6.0-rc.1" });
// Local 0.6.0 vs a higher-core prerelease 0.7.0-rc.1 -> stale.
const staleUrl = await startFixtureServer({ latestVersion: "0.7.0-rc.1" });
const stale = JSON.parse(
await runAsync(["status", "--json"], {
GITTENSORY_API_URL: staleUrl,
Expand Down Expand Up @@ -348,7 +348,7 @@ describe("gittensory-mcp CLI", () => {

it("uses API recommended package metadata when the npm registry is unavailable", async () => {
tempDir = mkdtempSync(join(tmpdir(), "gittensory-cli-"));
const url = await startFixtureServer({ npmStatus: 500, latestRecommendedMcpVersion: "0.6.0" });
const url = await startFixtureServer({ npmStatus: 500, latestRecommendedMcpVersion: "0.7.0" });
const payload = JSON.parse(
await runAsync(["status", "--json"], {
GITTENSORY_API_URL: url,
Expand All @@ -360,7 +360,7 @@ describe("gittensory-mcp CLI", () => {
expect(payload.package).toMatchObject({
state: "stale",
latestStatus: "api",
latestVersion: "0.6.0",
latestVersion: "0.7.0",
upgradeCommand: "npm install -g @jsonbored/gittensory-mcp@latest",
});
});
Expand Down Expand Up @@ -620,12 +620,12 @@ describe("gittensory-mcp CLI", () => {
}),
) as { package: { name: string; version: string; latestStatus: string }; api: { status: string }; auth: { login: string } };

expect(status.package).toMatchObject({ name: "@jsonbored/gittensory-mcp", version: "0.5.0", latestStatus: "skipped" });
expect(status.package).toMatchObject({ name: "@jsonbored/gittensory-mcp", version: "0.6.0", latestStatus: "skipped" });
expect(status.api.status).toBe("ok");
expect(status.auth.login).toBe("JSONbored");

const changelog = JSON.parse(run(["changelog", "--json"])) as { package: { version: string }; changelog: string };
expect(changelog.package.version).toBe("0.5.0");
expect(changelog.package.version).toBe("0.6.0");
expect(changelog.changelog).toContain("# Changelog");
});

Expand All @@ -643,7 +643,7 @@ describe("gittensory-mcp CLI", () => {

const sessionRequest = requests.find((request) => request.url === "/v1/auth/session");
expect(sessionRequest?.headers["x-gittensory-mcp-package"]).toBe("@jsonbored/gittensory-mcp");
expect(sessionRequest?.headers["x-gittensory-mcp-version"]).toBe("0.5.0");
expect(sessionRequest?.headers["x-gittensory-mcp-version"]).toBe("0.6.0");
expect(sessionRequest?.headers["x-gittensory-mcp-client"]).toBe("gittensory-mcp-cli");
const telemetryHeaders = JSON.stringify({
package: sessionRequest?.headers["x-gittensory-mcp-package"],
Expand Down Expand Up @@ -1124,7 +1124,7 @@ describe("gittensory-mcp CLI", () => {
});

it("reports the package version via version, --version, and -v", () => {
const expected = "@jsonbored/gittensory-mcp/0.5.0";
const expected = "@jsonbored/gittensory-mcp/0.6.0";
for (const flag of ["version", "--version", "-v"]) {
const plain = run([flag]).trim();
expect(plain).toContain(expected);
Expand All @@ -1137,7 +1137,7 @@ describe("gittensory-mcp CLI", () => {
it("emits machine-readable version output with --json", () => {
const payload = JSON.parse(run(["version", "--json"])) as { name: string; version: string; apiVersion: string; node: string };
expect(payload.name).toBe("@jsonbored/gittensory-mcp");
expect(payload.version).toBe("0.5.0");
expect(payload.version).toBe("0.6.0");
expect(payload.apiVersion).toBe("0.1.0");
expect(payload.node).toBe(process.version);
});
Expand Down
Loading