@klitchevo/code-council 0.0.1

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.
Files changed (58) hide show
  1. package/.env.example +21 -0
  2. package/LICENSE +21 -0
  3. package/README.md +342 -0
  4. package/dist/config.d.ts +48 -0
  5. package/dist/config.d.ts.map +1 -0
  6. package/dist/config.js +61 -0
  7. package/dist/constants.d.ts +33 -0
  8. package/dist/constants.d.ts.map +1 -0
  9. package/dist/constants.js +36 -0
  10. package/dist/errors.d.ts +53 -0
  11. package/dist/errors.d.ts.map +1 -0
  12. package/dist/errors.js +92 -0
  13. package/dist/index.d.ts +7 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +79 -0
  16. package/dist/logger.d.ts +22 -0
  17. package/dist/logger.d.ts.map +1 -0
  18. package/dist/logger.js +62 -0
  19. package/dist/prompts/backend-review.d.ts +6 -0
  20. package/dist/prompts/backend-review.d.ts.map +1 -0
  21. package/dist/prompts/backend-review.js +28 -0
  22. package/dist/prompts/code-review.d.ts +6 -0
  23. package/dist/prompts/code-review.d.ts.map +1 -0
  24. package/dist/prompts/code-review.js +18 -0
  25. package/dist/prompts/frontend-review.d.ts +6 -0
  26. package/dist/prompts/frontend-review.d.ts.map +1 -0
  27. package/dist/prompts/frontend-review.js +28 -0
  28. package/dist/prompts/plan-review.d.ts +6 -0
  29. package/dist/prompts/plan-review.d.ts.map +1 -0
  30. package/dist/prompts/plan-review.js +29 -0
  31. package/dist/review-client.d.ts +75 -0
  32. package/dist/review-client.d.ts.map +1 -0
  33. package/dist/review-client.js +116 -0
  34. package/dist/schemas.d.ts +60 -0
  35. package/dist/schemas.d.ts.map +1 -0
  36. package/dist/schemas.js +46 -0
  37. package/dist/tools/factory.d.ts +20 -0
  38. package/dist/tools/factory.d.ts.map +1 -0
  39. package/dist/tools/factory.js +55 -0
  40. package/dist/tools/list-config.d.ts +9 -0
  41. package/dist/tools/list-config.d.ts.map +1 -0
  42. package/dist/tools/list-config.js +31 -0
  43. package/dist/tools/review-backend.d.ts +22 -0
  44. package/dist/tools/review-backend.d.ts.map +1 -0
  45. package/dist/tools/review-backend.js +38 -0
  46. package/dist/tools/review-code.d.ts +15 -0
  47. package/dist/tools/review-code.d.ts.map +1 -0
  48. package/dist/tools/review-code.js +29 -0
  49. package/dist/tools/review-frontend.d.ts +22 -0
  50. package/dist/tools/review-frontend.d.ts.map +1 -0
  51. package/dist/tools/review-frontend.js +38 -0
  52. package/dist/tools/review-plan.d.ts +22 -0
  53. package/dist/tools/review-plan.d.ts.map +1 -0
  54. package/dist/tools/review-plan.js +35 -0
  55. package/dist/utils/parallel-executor.d.ts +10 -0
  56. package/dist/utils/parallel-executor.d.ts.map +1 -0
  57. package/dist/utils/parallel-executor.js +21 -0
  58. package/package.json +81 -0
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Zod schemas for input validation across all tools.
3
+ * Validates structure and types, not arbitrary limits.
4
+ */
5
+ import { z } from "zod";
6
+ /**
7
+ * Schema for code review input
8
+ */
9
+ export declare const CodeReviewSchema: z.ZodObject<{
10
+ code: z.ZodString;
11
+ language: z.ZodOptional<z.ZodString>;
12
+ context: z.ZodOptional<z.ZodString>;
13
+ }, z.core.$strip>;
14
+ /**
15
+ * Schema for frontend review input
16
+ */
17
+ export declare const FrontendReviewSchema: z.ZodObject<{
18
+ code: z.ZodString;
19
+ framework: z.ZodOptional<z.ZodString>;
20
+ review_type: z.ZodOptional<z.ZodEnum<{
21
+ full: "full";
22
+ performance: "performance";
23
+ accessibility: "accessibility";
24
+ ux: "ux";
25
+ }>>;
26
+ context: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strip>;
28
+ /**
29
+ * Schema for backend review input
30
+ */
31
+ export declare const BackendReviewSchema: z.ZodObject<{
32
+ code: z.ZodString;
33
+ language: z.ZodOptional<z.ZodString>;
34
+ review_type: z.ZodOptional<z.ZodEnum<{
35
+ full: "full";
36
+ security: "security";
37
+ performance: "performance";
38
+ architecture: "architecture";
39
+ }>>;
40
+ context: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strip>;
42
+ /**
43
+ * Schema for plan review input
44
+ */
45
+ export declare const PlanReviewSchema: z.ZodObject<{
46
+ plan: z.ZodString;
47
+ review_type: z.ZodOptional<z.ZodEnum<{
48
+ full: "full";
49
+ feasibility: "feasibility";
50
+ completeness: "completeness";
51
+ risks: "risks";
52
+ timeline: "timeline";
53
+ }>>;
54
+ context: z.ZodOptional<z.ZodString>;
55
+ }, z.core.$strip>;
56
+ export type CodeReviewInput = z.infer<typeof CodeReviewSchema>;
57
+ export type FrontendReviewInput = z.infer<typeof FrontendReviewSchema>;
58
+ export type BackendReviewInput = z.infer<typeof BackendReviewSchema>;
59
+ export type PlanReviewInput = z.infer<typeof PlanReviewSchema>;
60
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;iBAI3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;iBAO/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;iBAO9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;iBAM3B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC/D,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Zod schemas for input validation across all tools.
3
+ * Validates structure and types, not arbitrary limits.
4
+ */
5
+ import { z } from "zod";
6
+ /**
7
+ * Schema for code review input
8
+ */
9
+ export const CodeReviewSchema = z.object({
10
+ code: z.string().min(1, "Code cannot be empty"),
11
+ language: z.string().optional(),
12
+ context: z.string().optional(),
13
+ });
14
+ /**
15
+ * Schema for frontend review input
16
+ */
17
+ export const FrontendReviewSchema = z.object({
18
+ code: z.string().min(1, "Code cannot be empty"),
19
+ framework: z.string().optional(),
20
+ review_type: z
21
+ .enum(["accessibility", "performance", "ux", "full"])
22
+ .optional(),
23
+ context: z.string().optional(),
24
+ });
25
+ /**
26
+ * Schema for backend review input
27
+ */
28
+ export const BackendReviewSchema = z.object({
29
+ code: z.string().min(1, "Code cannot be empty"),
30
+ language: z.string().optional(),
31
+ review_type: z
32
+ .enum(["security", "performance", "architecture", "full"])
33
+ .optional(),
34
+ context: z.string().optional(),
35
+ });
36
+ /**
37
+ * Schema for plan review input
38
+ */
39
+ export const PlanReviewSchema = z.object({
40
+ plan: z.string().min(1, "Plan cannot be empty"),
41
+ review_type: z
42
+ .enum(["feasibility", "completeness", "risks", "timeline", "full"])
43
+ .optional(),
44
+ context: z.string().optional(),
45
+ });
46
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Tool factory for creating MCP review tools with consistent error handling
3
+ */
4
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5
+ import type { z } from "zod";
6
+ import type { ModelReviewResult } from "../review-client";
7
+ /**
8
+ * Create a review tool with consistent error handling and logging
9
+ */
10
+ export declare function createReviewTool(server: McpServer, config: {
11
+ name: string;
12
+ description: string;
13
+ inputSchema: Record<string, z.ZodType<unknown>>;
14
+ handler: (input: Record<string, unknown>) => Promise<{
15
+ results: ModelReviewResult[];
16
+ models: string[];
17
+ reviewType?: string;
18
+ }>;
19
+ }): void;
20
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/tools/factory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AA2B1D;;GAEG;AACH,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE;IACP,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAChD,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;QACpD,OAAO,EAAE,iBAAiB,EAAE,CAAC;QAC7B,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;CACH,GACC,IAAI,CA0CN"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Tool factory for creating MCP review tools with consistent error handling
3
+ */
4
+ import { formatError } from "../errors";
5
+ import { logger } from "../logger";
6
+ /**
7
+ * Format review results into a readable markdown string
8
+ */
9
+ function formatResults(results) {
10
+ return results
11
+ .map((r) => {
12
+ if (r.error) {
13
+ return `## Review from \`${r.model}\`\n\n**Error:** ${r.error}`;
14
+ }
15
+ return `## Review from \`${r.model}\`\n\n${r.review}`;
16
+ })
17
+ .join("\n\n---\n\n");
18
+ }
19
+ /**
20
+ * Create a review tool with consistent error handling and logging
21
+ */
22
+ export function createReviewTool(server, config) {
23
+ server.registerTool(config.name, {
24
+ description: config.description,
25
+ inputSchema: config.inputSchema,
26
+ }, async (input) => {
27
+ try {
28
+ logger.debug(`Starting ${config.name}`, {
29
+ inputKeys: Object.keys(input),
30
+ });
31
+ const { results, models, reviewType } = await config.handler(input);
32
+ logger.info(`Completed ${config.name}`, {
33
+ modelCount: models.length,
34
+ successCount: results.filter((r) => !r.error).length,
35
+ errorCount: results.filter((r) => r.error).length,
36
+ });
37
+ const title = reviewType
38
+ ? `# ${config.name.replace("review_", "").replace("_", " ")} Review - ${reviewType} (${models.length} models)`
39
+ : `# ${config.name.replace("review_", "").replace("_", " ")} Review Results (${models.length} models)`;
40
+ return {
41
+ content: [
42
+ {
43
+ type: "text",
44
+ text: `${title}\n\n${formatResults(results)}`,
45
+ },
46
+ ],
47
+ };
48
+ }
49
+ catch (error) {
50
+ logger.error(`Error in ${config.name}`, error instanceof Error ? error : new Error(String(error)));
51
+ return formatError(error);
52
+ }
53
+ });
54
+ }
55
+ //# sourceMappingURL=factory.js.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * List configuration tool - shows current model configuration
3
+ */
4
+ export declare function handleListConfig(): Promise<{
5
+ results: never[];
6
+ models: never[];
7
+ text: string;
8
+ }>;
9
+ //# sourceMappingURL=list-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-config.d.ts","sourceRoot":"","sources":["../../src/tools/list-config.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,wBAAsB,gBAAgB;;;;GA0BrC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * List configuration tool - shows current model configuration
3
+ */
4
+ import { BACKEND_REVIEW_MODELS, CODE_REVIEW_MODELS, FRONTEND_REVIEW_MODELS, PLAN_REVIEW_MODELS, } from "../config";
5
+ export async function handleListConfig() {
6
+ const text = `## Current Configuration
7
+
8
+ **Code Review Models:**
9
+ ${CODE_REVIEW_MODELS.map((m) => `- \`${m}\``).join("\n")}
10
+
11
+ **Frontend Review Models:**
12
+ ${FRONTEND_REVIEW_MODELS.map((m) => `- \`${m}\``).join("\n")}
13
+
14
+ **Backend Review Models:**
15
+ ${BACKEND_REVIEW_MODELS.map((m) => `- \`${m}\``).join("\n")}
16
+
17
+ **Plan Review Models:**
18
+ ${PLAN_REVIEW_MODELS.map((m) => `- \`${m}\``).join("\n")}
19
+
20
+ To customize models, set environment variables in your MCP config:
21
+ - CODE_REVIEW_MODELS
22
+ - FRONTEND_REVIEW_MODELS
23
+ - BACKEND_REVIEW_MODELS
24
+ - PLAN_REVIEW_MODELS`;
25
+ return {
26
+ results: [],
27
+ models: [],
28
+ text,
29
+ };
30
+ }
31
+ //# sourceMappingURL=list-config.js.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Backend review tool - reviews backend code for security, performance, architecture
3
+ */
4
+ import { z } from "zod";
5
+ import type { ReviewClient } from "../review-client";
6
+ export declare const backendReviewSchema: {
7
+ code: z.ZodString;
8
+ language: z.ZodOptional<z.ZodString>;
9
+ review_type: z.ZodOptional<z.ZodEnum<{
10
+ full: "full";
11
+ security: "security";
12
+ performance: "performance";
13
+ architecture: "architecture";
14
+ }>>;
15
+ context: z.ZodOptional<z.ZodString>;
16
+ };
17
+ export declare function handleBackendReview(client: ReviewClient, input: Record<string, unknown>): Promise<{
18
+ results: import("../review-client").ModelReviewResult[];
19
+ models: string[];
20
+ reviewType: "full" | "security" | "performance" | "architecture";
21
+ }>;
22
+ //# sourceMappingURL=review-backend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-backend.d.ts","sourceRoot":"","sources":["../../src/tools/review-backend.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,eAAO,MAAM,mBAAmB;;;;;;;;;;CAW/B,CAAC;AAEF,wBAAsB,mBAAmB,CACxC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;GA2B9B"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Backend review tool - reviews backend code for security, performance, architecture
3
+ */
4
+ import { z } from "zod";
5
+ import { BACKEND_REVIEW_MODELS } from "../config";
6
+ import { logger } from "../logger";
7
+ export const backendReviewSchema = {
8
+ code: z.string().describe("The backend code to review"),
9
+ language: z
10
+ .string()
11
+ .optional()
12
+ .describe("Programming language/framework (e.g., node, python, go, rust)"),
13
+ review_type: z
14
+ .enum(["security", "performance", "architecture", "full"])
15
+ .optional()
16
+ .describe("Type of review to perform (default: full)"),
17
+ context: z.string().optional().describe("Additional context"),
18
+ };
19
+ export async function handleBackendReview(client, input) {
20
+ const { code, language, review_type, context } = input;
21
+ logger.info("Running backend review", {
22
+ modelCount: BACKEND_REVIEW_MODELS.length,
23
+ models: BACKEND_REVIEW_MODELS,
24
+ language,
25
+ reviewType: review_type || "full",
26
+ });
27
+ const results = await client.reviewBackend(code, BACKEND_REVIEW_MODELS, {
28
+ language,
29
+ reviewType: review_type,
30
+ context,
31
+ });
32
+ return {
33
+ results,
34
+ models: BACKEND_REVIEW_MODELS,
35
+ reviewType: review_type || "full",
36
+ };
37
+ }
38
+ //# sourceMappingURL=review-backend.js.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Code review tool - reviews code for quality, bugs, performance, and security
3
+ */
4
+ import { z } from "zod";
5
+ import type { ReviewClient } from "../review-client";
6
+ export declare const codeReviewSchema: {
7
+ code: z.ZodString;
8
+ language: z.ZodOptional<z.ZodString>;
9
+ context: z.ZodOptional<z.ZodString>;
10
+ };
11
+ export declare function handleCodeReview(client: ReviewClient, input: Record<string, unknown>): Promise<{
12
+ results: import("../review-client").ModelReviewResult[];
13
+ models: string[];
14
+ }>;
15
+ //# sourceMappingURL=review-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-code.d.ts","sourceRoot":"","sources":["../../src/tools/review-code.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AAEF,wBAAsB,gBAAgB,CACrC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;GA6B9B"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Code review tool - reviews code for quality, bugs, performance, and security
3
+ */
4
+ import { z } from "zod";
5
+ import { CODE_REVIEW_MODELS } from "../config";
6
+ import { logger } from "../logger";
7
+ export const codeReviewSchema = {
8
+ code: z.string().describe("The code to review"),
9
+ language: z.string().optional().describe("Programming language of the code"),
10
+ context: z.string().optional().describe("Additional context about the code"),
11
+ };
12
+ export async function handleCodeReview(client, input) {
13
+ const { code, language, context } = input;
14
+ const fullContext = language
15
+ ? `Language: ${language}${context ? `\n${context}` : ""}`
16
+ : context;
17
+ logger.info("Running code review", {
18
+ modelCount: CODE_REVIEW_MODELS.length,
19
+ models: CODE_REVIEW_MODELS,
20
+ hasLanguage: !!language,
21
+ hasContext: !!context,
22
+ });
23
+ const results = await client.reviewCode(code, CODE_REVIEW_MODELS, fullContext);
24
+ return {
25
+ results,
26
+ models: CODE_REVIEW_MODELS,
27
+ };
28
+ }
29
+ //# sourceMappingURL=review-code.js.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Frontend review tool - reviews frontend code for accessibility, performance, UX
3
+ */
4
+ import { z } from "zod";
5
+ import type { ReviewClient } from "../review-client";
6
+ export declare const frontendReviewSchema: {
7
+ code: z.ZodString;
8
+ framework: z.ZodOptional<z.ZodString>;
9
+ review_type: z.ZodOptional<z.ZodEnum<{
10
+ full: "full";
11
+ performance: "performance";
12
+ accessibility: "accessibility";
13
+ ux: "ux";
14
+ }>>;
15
+ context: z.ZodOptional<z.ZodString>;
16
+ };
17
+ export declare function handleFrontendReview(client: ReviewClient, input: Record<string, unknown>): Promise<{
18
+ results: import("../review-client").ModelReviewResult[];
19
+ models: string[];
20
+ reviewType: "full" | "performance" | "accessibility" | "ux";
21
+ }>;
22
+ //# sourceMappingURL=review-frontend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-frontend.d.ts","sourceRoot":"","sources":["../../src/tools/review-frontend.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,eAAO,MAAM,oBAAoB;;;;;;;;;;CAWhC,CAAC;AAEF,wBAAsB,oBAAoB,CACzC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;GA2B9B"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Frontend review tool - reviews frontend code for accessibility, performance, UX
3
+ */
4
+ import { z } from "zod";
5
+ import { FRONTEND_REVIEW_MODELS } from "../config";
6
+ import { logger } from "../logger";
7
+ export const frontendReviewSchema = {
8
+ code: z.string().describe("The frontend code to review"),
9
+ framework: z
10
+ .string()
11
+ .optional()
12
+ .describe("Frontend framework (e.g., react, vue, svelte)"),
13
+ review_type: z
14
+ .enum(["accessibility", "performance", "ux", "full"])
15
+ .optional()
16
+ .describe("Type of review to perform (default: full)"),
17
+ context: z.string().optional().describe("Additional context"),
18
+ };
19
+ export async function handleFrontendReview(client, input) {
20
+ const { code, framework, review_type, context } = input;
21
+ logger.info("Running frontend review", {
22
+ modelCount: FRONTEND_REVIEW_MODELS.length,
23
+ models: FRONTEND_REVIEW_MODELS,
24
+ framework,
25
+ reviewType: review_type || "full",
26
+ });
27
+ const results = await client.reviewFrontend(code, FRONTEND_REVIEW_MODELS, {
28
+ framework,
29
+ reviewType: review_type,
30
+ context,
31
+ });
32
+ return {
33
+ results,
34
+ models: FRONTEND_REVIEW_MODELS,
35
+ reviewType: review_type || "full",
36
+ };
37
+ }
38
+ //# sourceMappingURL=review-frontend.js.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Plan review tool - reviews implementation plans before coding
3
+ */
4
+ import { z } from "zod";
5
+ import type { ReviewClient } from "../review-client";
6
+ export declare const planReviewSchema: {
7
+ plan: z.ZodString;
8
+ review_type: z.ZodOptional<z.ZodEnum<{
9
+ full: "full";
10
+ feasibility: "feasibility";
11
+ completeness: "completeness";
12
+ risks: "risks";
13
+ timeline: "timeline";
14
+ }>>;
15
+ context: z.ZodOptional<z.ZodString>;
16
+ };
17
+ export declare function handlePlanReview(client: ReviewClient, input: Record<string, unknown>): Promise<{
18
+ results: import("../review-client").ModelReviewResult[];
19
+ models: string[];
20
+ reviewType: "full" | "feasibility" | "completeness" | "risks" | "timeline";
21
+ }>;
22
+ //# sourceMappingURL=review-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-plan.d.ts","sourceRoot":"","sources":["../../src/tools/review-plan.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,eAAO,MAAM,gBAAgB;;;;;;;;;;CAU5B,CAAC;AAEF,wBAAsB,gBAAgB,CACrC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;GA6B9B"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Plan review tool - reviews implementation plans before coding
3
+ */
4
+ import { z } from "zod";
5
+ import { PLAN_REVIEW_MODELS } from "../config";
6
+ import { logger } from "../logger";
7
+ export const planReviewSchema = {
8
+ plan: z.string().describe("The implementation plan to review"),
9
+ review_type: z
10
+ .enum(["feasibility", "completeness", "risks", "timeline", "full"])
11
+ .optional()
12
+ .describe("Type of review to perform (default: full)"),
13
+ context: z
14
+ .string()
15
+ .optional()
16
+ .describe("Additional context about the project or constraints"),
17
+ };
18
+ export async function handlePlanReview(client, input) {
19
+ const { plan, review_type, context } = input;
20
+ logger.info("Running plan review", {
21
+ modelCount: PLAN_REVIEW_MODELS.length,
22
+ models: PLAN_REVIEW_MODELS,
23
+ reviewType: review_type || "full",
24
+ });
25
+ const results = await client.reviewPlan(plan, PLAN_REVIEW_MODELS, {
26
+ reviewType: review_type,
27
+ context,
28
+ });
29
+ return {
30
+ results,
31
+ models: PLAN_REVIEW_MODELS,
32
+ reviewType: review_type || "full",
33
+ };
34
+ }
35
+ //# sourceMappingURL=review-plan.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Utility for executing operations in parallel with error handling
3
+ */
4
+ import type { ModelReviewResult } from "../review-client";
5
+ /**
6
+ * Execute a review function across multiple models in parallel
7
+ * Each model runs independently, failures are captured in the result
8
+ */
9
+ export declare function executeInParallel(models: string[], reviewFn: (model: string) => Promise<string>): Promise<ModelReviewResult[]>;
10
+ //# sourceMappingURL=parallel-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallel-executor.d.ts","sourceRoot":"","sources":["../../src/utils/parallel-executor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D;;;GAGG;AACH,wBAAsB,iBAAiB,CACtC,MAAM,EAAE,MAAM,EAAE,EAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAC1C,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAa9B"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Utility for executing operations in parallel with error handling
3
+ */
4
+ /**
5
+ * Execute a review function across multiple models in parallel
6
+ * Each model runs independently, failures are captured in the result
7
+ */
8
+ export async function executeInParallel(models, reviewFn) {
9
+ const promises = models.map(async (model) => {
10
+ try {
11
+ const review = await reviewFn(model);
12
+ return { model, review };
13
+ }
14
+ catch (error) {
15
+ const errorMessage = error instanceof Error ? error.message : "Unknown error";
16
+ return { model, review: "", error: errorMessage };
17
+ }
18
+ });
19
+ return Promise.all(promises);
20
+ }
21
+ //# sourceMappingURL=parallel-executor.js.map
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "@klitchevo/code-council",
3
+ "version": "0.0.1",
4
+ "description": "Multi-model AI code review server using OpenRouter - get diverse perspectives from multiple LLMs in parallel",
5
+ "main": "dist/index.js",
6
+ "type": "module",
7
+ "bin": {
8
+ "code-council": "./dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist/**/*.js",
12
+ "dist/**/*.d.ts",
13
+ "dist/**/*.d.ts.map",
14
+ "!dist/**/*.test.*",
15
+ "README.md",
16
+ "LICENSE",
17
+ ".env.example"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "start": "node dist/index.js",
22
+ "dev": "tsc --watch",
23
+ "test": "vitest run",
24
+ "test:watch": "vitest",
25
+ "test:coverage": "vitest run --coverage",
26
+ "lint": "biome lint src",
27
+ "lint:fix": "biome lint --write src",
28
+ "format": "biome format --write src",
29
+ "format:check": "biome format src",
30
+ "check": "biome check src",
31
+ "check:fix": "biome check --write src",
32
+ "typecheck": "tsc --noEmit",
33
+ "prepare": "lefthook install",
34
+ "prepublishOnly": "bun run typecheck && bun test && bun run build"
35
+ },
36
+ "keywords": [
37
+ "mcp",
38
+ "openrouter",
39
+ "code-review",
40
+ "frontend-review",
41
+ "backend-review",
42
+ "ai",
43
+ "llm",
44
+ "model-context-protocol",
45
+ "mcp-server",
46
+ "multi-model",
47
+ "code-analysis",
48
+ "static-analysis",
49
+ "ai-code-review",
50
+ "claude",
51
+ "gpt",
52
+ "gemini"
53
+ ],
54
+ "author": "klitchevo",
55
+ "license": "MIT",
56
+ "repository": {
57
+ "type": "git",
58
+ "url": "https://github.com/klitchevo/code-council.git"
59
+ },
60
+ "bugs": {
61
+ "url": "https://github.com/klitchevo/code-council/issues"
62
+ },
63
+ "homepage": "https://github.com/klitchevo/code-council#readme",
64
+ "dependencies": {
65
+ "@modelcontextprotocol/sdk": "1.25.1",
66
+ "@openrouter/sdk": "0.3.10",
67
+ "dotenv": "17.2.3",
68
+ "zod": "4.2.1"
69
+ },
70
+ "devDependencies": {
71
+ "@biomejs/biome": "2.3.10",
72
+ "@types/node": "25.0.3",
73
+ "@vitest/coverage-v8": "4.0.16",
74
+ "lefthook": "2.0.12",
75
+ "typescript": "5.9.3",
76
+ "vitest": "4.0.16"
77
+ },
78
+ "engines": {
79
+ "node": ">=18.0.0"
80
+ }
81
+ }