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
5 changes: 5 additions & 0 deletions .superset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"setup": ["bun install"],
"teardown": [],
"run": ["bun run dev mcp start"]
}
12 changes: 10 additions & 2 deletions src/commands/example.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ describe("exampleAction", () => {
it("outputs JSON when --json flag provided", async () => {
const consoleSpy = spyOn(console, "log").mockImplementation(() => {});

await exampleAction("test", { lang: "javascript", json: true }, createDeps());
await exampleAction(
"test",
{ lang: "javascript", json: true },
createDeps(),
);

const output = consoleSpy.mock.calls[0]?.[0] as string;
const parsed = JSON.parse(output);
Expand All @@ -52,7 +56,11 @@ describe("exampleAction", () => {

it("throws AuthRequiredError on auth failure", async () => {
await expect(
exampleAction("test", { lang: "python" }, createDeps({ hasValidToken: false })),
exampleAction(
"test",
{ lang: "python" },
createDeps({ hasValidToken: false }),
),
).rejects.toThrow(AuthRequiredError);
});
});
36 changes: 18 additions & 18 deletions src/commands/search-registration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ describe("registerUnifiedSearchCommands", () => {
capability: "enabled",
});

expect(program.commands.some((command) => command.name() === "search")).toBe(
false,
);
expect(
program.commands.some((command) => command.name() === "search"),
).toBe(false);
expect(
program.commands.some((command) => command.name() === "search-status"),
).toBe(false);
Expand All @@ -29,9 +29,9 @@ describe("registerUnifiedSearchCommands", () => {
expiredStoredAuth: false,
});

expect(program.commands.some((command) => command.name() === "search")).toBe(
false,
);
expect(
program.commands.some((command) => command.name() === "search"),
).toBe(false);
});

it("registers search commands when capability is enabled", async () => {
Expand All @@ -42,9 +42,9 @@ describe("registerUnifiedSearchCommands", () => {
capability: "enabled",
});

expect(program.commands.some((command) => command.name() === "search")).toBe(
true,
);
expect(
program.commands.some((command) => command.name() === "search"),
).toBe(true);
expect(
program.commands.some((command) => command.name() === "search-status"),
).toBe(true);
Expand All @@ -58,9 +58,9 @@ describe("registerUnifiedSearchCommands", () => {
capability: "disabled",
});

expect(program.commands.some((command) => command.name() === "search")).toBe(
true,
);
expect(
program.commands.some((command) => command.name() === "search"),
).toBe(true);
});

it("registers search commands for opaque env tokens", async () => {
Expand All @@ -72,9 +72,9 @@ describe("registerUnifiedSearchCommands", () => {
envTokenPresent: true,
});

expect(program.commands.some((command) => command.name() === "search")).toBe(
true,
);
expect(
program.commands.some((command) => command.name() === "search"),
).toBe(true);
});

it("registers search commands for expired stored auth", async () => {
Expand All @@ -86,8 +86,8 @@ describe("registerUnifiedSearchCommands", () => {
expiredStoredAuth: true,
});

expect(program.commands.some((command) => command.name() === "search")).toBe(
true,
);
expect(
program.commands.some((command) => command.name() === "search"),
).toBe(true);
});
});
4 changes: 3 additions & 1 deletion src/services/code-navigation-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,9 @@ const unifiedSearchGraphQLResponseSchema = z.object({
const unifiedSearchStatusGraphQLResponseSchema = z.object({
data: z
.object({
discoverySearchProgress: unifiedSearchProgressSchema.nullable().optional(),
discoverySearchProgress: unifiedSearchProgressSchema
.nullable()
.optional(),
})
.nullable()
.optional(),
Expand Down
6 changes: 4 additions & 2 deletions src/shared/unified-search-target.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import type { CodeNavigationTarget } from "../services/index.js";
import { InvalidArgumentError, parsePackageSpec } from "./package-spec.js";
import { toCodeNavigationRegistry } from "./code-navigation.js";
import { InvalidArgumentError, parsePackageSpec } from "./package-spec.js";

export function parseUnifiedSearchTargetSpec(spec: string): CodeNavigationTarget {
export function parseUnifiedSearchTargetSpec(
spec: string,
): CodeNavigationTarget {
const trimmed = spec.trim();
if (trimmed.length === 0) {
throw new InvalidArgumentError("Target spec cannot be empty.");
Expand Down
4 changes: 1 addition & 3 deletions src/tools/get-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ const schema = {
license_mode: z
.enum(["strict", "yolo", "custom"])
.optional()
.describe(
'License filtering mode: strict (default), yolo, or custom.',
),
.describe("License filtering mode: strict (default), yolo, or custom."),
};

const DESCRIPTION = `Get verified, canonical code examples from global open source.
Expand Down
9 changes: 7 additions & 2 deletions src/tools/search-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export interface SearchStatusArgs {
}

const schema = {
search_ref: z.string().min(1).describe("Search reference returned by search."),
search_ref: z
.string()
.min(1)
.describe("Search reference returned by search."),
};

const DESCRIPTION =
Expand All @@ -32,7 +35,9 @@ export function createSearchStatusTool(
const payload = buildUnifiedSearchStatusPayload(outcome);
return textResult(JSON.stringify(payload));
} catch (error) {
return errorResult(JSON.stringify(buildUnifiedSearchErrorPayload(error)));
return errorResult(
JSON.stringify(buildUnifiedSearchErrorPayload(error)),
);
}
},
};
Expand Down
Loading