agentgit-mcp 0.1.0 → 0.2.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.
@@ -0,0 +1,182 @@
1
+ /**
2
+ * Evaluation tools: submit_evaluation, get_evaluations, get_latest_evaluation
3
+ *
4
+ * Agents run evaluations locally and submit results to the backend.
5
+ */
6
+ import { z } from "zod";
7
+ // Schema definitions
8
+ export const submitEvaluationSchema = z.object({
9
+ change_id: z.string().uuid().describe("The UUID of the change/PR to submit evaluation for"),
10
+ agent_id: z.string().min(1).max(255).describe("Your agent identifier"),
11
+ status: z
12
+ .enum(["passed", "failed", "error"])
13
+ .describe("Evaluation result: passed, failed, or error"),
14
+ tests_passed: z.boolean().default(false).describe("Whether all tests passed"),
15
+ tests_total: z.number().int().min(0).default(0).describe("Total number of tests"),
16
+ tests_failed: z.number().int().min(0).default(0).describe("Number of failed tests"),
17
+ lint_errors: z.number().int().min(0).default(0).describe("Number of lint errors"),
18
+ lint_warnings: z.number().int().min(0).default(0).describe("Number of lint warnings"),
19
+ type_errors: z.number().int().min(0).default(0).describe("Number of type errors"),
20
+ correctness_score: z
21
+ .number()
22
+ .min(0)
23
+ .max(1)
24
+ .default(0)
25
+ .describe("Correctness score (0-1) based on test results"),
26
+ performance_score: z
27
+ .number()
28
+ .min(0)
29
+ .max(1)
30
+ .default(0)
31
+ .describe("Performance score (0-1) based on benchmarks"),
32
+ quality_score: z
33
+ .number()
34
+ .min(0)
35
+ .max(1)
36
+ .default(0)
37
+ .describe("Quality score (0-1) based on lint/type checks"),
38
+ overall_score: z
39
+ .number()
40
+ .min(0)
41
+ .max(1)
42
+ .default(0)
43
+ .describe("Overall weighted score (0-1)"),
44
+ details: z.string().optional().describe("Optional detailed report"),
45
+ });
46
+ export const getEvaluationsSchema = z.object({
47
+ change_id: z.string().uuid().describe("The UUID of the change/PR"),
48
+ });
49
+ export const getLatestEvaluationSchema = z.object({
50
+ change_id: z.string().uuid().describe("The UUID of the change/PR"),
51
+ });
52
+ // Tool implementations
53
+ export async function submitEvaluation(client, input) {
54
+ return client.submitEvaluation(input.change_id, {
55
+ agent_id: input.agent_id,
56
+ status: input.status,
57
+ tests_passed: input.tests_passed,
58
+ tests_total: input.tests_total,
59
+ tests_failed: input.tests_failed,
60
+ lint_errors: input.lint_errors,
61
+ lint_warnings: input.lint_warnings,
62
+ type_errors: input.type_errors,
63
+ correctness_score: input.correctness_score,
64
+ performance_score: input.performance_score,
65
+ quality_score: input.quality_score,
66
+ overall_score: input.overall_score,
67
+ details: input.details,
68
+ });
69
+ }
70
+ export async function getEvaluations(client, input) {
71
+ return client.getEvaluations(input.change_id);
72
+ }
73
+ export async function getLatestEvaluation(client, input) {
74
+ return client.getLatestEvaluation(input.change_id);
75
+ }
76
+ // Tool definitions for MCP registration
77
+ export const evaluationTools = [
78
+ {
79
+ name: "submit_evaluation",
80
+ description: "Submit evaluation results for a PR/change. Run tests, lint, and benchmarks locally, " +
81
+ "then submit the results here. The backend stores results for tracking. " +
82
+ "Before calling this, you should:\n" +
83
+ "1. Run tests: `pytest` or `npm test`\n" +
84
+ "2. Run linting: `ruff check .` or `eslint .`\n" +
85
+ "3. Run type checks: `mypy .` or `tsc --noEmit`\n" +
86
+ "Then calculate scores and submit the results.",
87
+ inputSchema: {
88
+ type: "object",
89
+ properties: {
90
+ change_id: {
91
+ type: "string",
92
+ description: "The UUID of the change/PR to submit evaluation for",
93
+ },
94
+ agent_id: {
95
+ type: "string",
96
+ description: "Your agent identifier",
97
+ },
98
+ status: {
99
+ type: "string",
100
+ enum: ["passed", "failed", "error"],
101
+ description: "Evaluation result: passed (all checks pass), failed (issues found), error (couldn't run)",
102
+ },
103
+ tests_passed: {
104
+ type: "boolean",
105
+ description: "Whether all tests passed",
106
+ },
107
+ tests_total: {
108
+ type: "number",
109
+ description: "Total number of tests",
110
+ },
111
+ tests_failed: {
112
+ type: "number",
113
+ description: "Number of failed tests",
114
+ },
115
+ lint_errors: {
116
+ type: "number",
117
+ description: "Number of lint errors",
118
+ },
119
+ lint_warnings: {
120
+ type: "number",
121
+ description: "Number of lint warnings",
122
+ },
123
+ type_errors: {
124
+ type: "number",
125
+ description: "Number of type errors",
126
+ },
127
+ correctness_score: {
128
+ type: "number",
129
+ description: "Correctness score (0-1): 1.0 if all tests pass, lower based on failures",
130
+ },
131
+ performance_score: {
132
+ type: "number",
133
+ description: "Performance score (0-1): based on benchmark results, 0.5 if no benchmarks",
134
+ },
135
+ quality_score: {
136
+ type: "number",
137
+ description: "Quality score (0-1): deduct for lint errors and type errors",
138
+ },
139
+ overall_score: {
140
+ type: "number",
141
+ description: "Overall score (0-1): typically 0.5*correctness + 0.3*performance + 0.2*quality",
142
+ },
143
+ details: {
144
+ type: "string",
145
+ description: "Optional detailed report of the evaluation",
146
+ },
147
+ },
148
+ required: ["change_id", "agent_id", "status"],
149
+ },
150
+ },
151
+ {
152
+ name: "get_evaluations",
153
+ description: "Get all evaluations submitted for a change/PR. Returns a list of all " +
154
+ "evaluation results ordered by most recent first.",
155
+ inputSchema: {
156
+ type: "object",
157
+ properties: {
158
+ change_id: {
159
+ type: "string",
160
+ description: "The UUID of the change/PR",
161
+ },
162
+ },
163
+ required: ["change_id"],
164
+ },
165
+ },
166
+ {
167
+ name: "get_latest_evaluation",
168
+ description: "Get the most recent evaluation for a change/PR. Use this to check " +
169
+ "the current evaluation status before reviewing or voting.",
170
+ inputSchema: {
171
+ type: "object",
172
+ properties: {
173
+ change_id: {
174
+ type: "string",
175
+ description: "The UUID of the change/PR",
176
+ },
177
+ },
178
+ required: ["change_id"],
179
+ },
180
+ },
181
+ ];
182
+ //# sourceMappingURL=evaluation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluation.js","sourceRoot":"","sources":["../../src/tools/evaluation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,qBAAqB;AACrB,MAAM,CAAC,MAAM,sBAA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AiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,2BAA2B;iBACzC;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,CAAC;SACxB;KACF;IACD;QACE,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EACT,oEAAoE;YACpE,2DAA2D;QAC7D,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,2BAA2B;iBACzC;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,CAAC;SACxB;KACF;CACF,CAAC"}
@@ -1,50 +1,55 @@
1
1
  /**
2
2
  * Lifecycle tools: acquire_task, release_task, submit_pr, revise_pr
3
+ *
4
+ * Task ID = GitHub issue number (integer, not UUID).
3
5
  */
4
6
  import { z } from "zod";
5
7
  import { AgentGitHubClient } from "../client.js";
6
8
  import { Task, Change } from "../types.js";
7
9
  export declare const acquireTaskSchema: z.ZodObject<{
8
- task_id: z.ZodString;
10
+ issue_number: z.ZodNumber;
9
11
  agent_id: z.ZodString;
10
12
  }, "strip", z.ZodTypeAny, {
11
- task_id: string;
13
+ issue_number: number;
12
14
  agent_id: string;
13
15
  }, {
14
- task_id: string;
16
+ issue_number: number;
15
17
  agent_id: string;
16
18
  }>;
17
19
  export declare const releaseTaskSchema: z.ZodObject<{
18
- task_id: z.ZodString;
20
+ issue_number: z.ZodNumber;
19
21
  agent_id: z.ZodString;
20
22
  }, "strip", z.ZodTypeAny, {
21
- task_id: string;
23
+ issue_number: number;
22
24
  agent_id: string;
23
25
  }, {
24
- task_id: string;
26
+ issue_number: number;
25
27
  agent_id: string;
26
28
  }>;
27
29
  export declare const submitPrSchema: z.ZodObject<{
28
- task_id: z.ZodString;
30
+ task_id: z.ZodNumber;
29
31
  agent_id: z.ZodString;
30
32
  pr_url: z.ZodString;
31
33
  pr_number: z.ZodNumber;
32
34
  commit_sha: z.ZodString;
33
35
  tee_attestation: z.ZodOptional<z.ZodString>;
36
+ improvement_notes: z.ZodOptional<z.ZodString>;
34
37
  }, "strip", z.ZodTypeAny, {
35
- task_id: string;
38
+ task_id: number;
36
39
  agent_id: string;
37
40
  pr_url: string;
38
41
  pr_number: number;
39
42
  commit_sha: string;
40
43
  tee_attestation?: string | undefined;
44
+ improvement_notes?: string | undefined;
41
45
  }, {
42
- task_id: string;
46
+ task_id: number;
43
47
  agent_id: string;
44
48
  pr_url: string;
45
49
  pr_number: number;
46
50
  commit_sha: string;
47
51
  tee_attestation?: string | undefined;
52
+ improvement_notes?: string | undefined;
48
53
  }>;
49
54
  export declare const revisePrSchema: z.ZodObject<{
50
55
  change_id: z.ZodString;
@@ -72,7 +77,7 @@ export declare const lifecycleTools: ({
72
77
  inputSchema: {
73
78
  type: "object";
74
79
  properties: {
75
- task_id: {
80
+ issue_number: {
76
81
  type: string;
77
82
  description: string;
78
83
  };
@@ -80,10 +85,12 @@ export declare const lifecycleTools: ({
80
85
  type: string;
81
86
  description: string;
82
87
  };
88
+ task_id?: undefined;
83
89
  pr_url?: undefined;
84
90
  pr_number?: undefined;
85
91
  commit_sha?: undefined;
86
92
  tee_attestation?: undefined;
93
+ improvement_notes?: undefined;
87
94
  change_id?: undefined;
88
95
  new_commit_sha?: undefined;
89
96
  revision_notes?: undefined;
@@ -120,6 +127,11 @@ export declare const lifecycleTools: ({
120
127
  type: string;
121
128
  description: string;
122
129
  };
130
+ improvement_notes: {
131
+ type: string;
132
+ description: string;
133
+ };
134
+ issue_number?: undefined;
123
135
  change_id?: undefined;
124
136
  new_commit_sha?: undefined;
125
137
  revision_notes?: undefined;
@@ -148,11 +160,13 @@ export declare const lifecycleTools: ({
148
160
  type: string;
149
161
  description: string;
150
162
  };
163
+ issue_number?: undefined;
151
164
  task_id?: undefined;
152
165
  pr_url?: undefined;
153
166
  pr_number?: undefined;
154
167
  commit_sha?: undefined;
155
168
  tee_attestation?: undefined;
169
+ improvement_notes?: undefined;
156
170
  };
157
171
  required: string[];
158
172
  };
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../src/tools/lifecycle.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG3C,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;EAUzB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;EAQzB,CAAC;AAGH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,GACvC,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAsB,WAAW,CAC/B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,GACvC,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,GACpC,OAAO,CAAC,MAAM,CAAC,CASjB;AAED,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,GACpC,OAAO,CAAC,MAAM,CAAC,CAMjB;AAGD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC"}
@@ -1,18 +1,20 @@
1
1
  /**
2
2
  * Lifecycle tools: acquire_task, release_task, submit_pr, revise_pr
3
+ *
4
+ * Task ID = GitHub issue number (integer, not UUID).
3
5
  */
4
6
  import { z } from "zod";
5
7
  // Schema definitions for tool inputs
6
8
  export const acquireTaskSchema = z.object({
7
- task_id: z.string().uuid().describe("The UUID of the task to acquire"),
9
+ issue_number: z.number().int().positive().describe("The GitHub issue number to acquire"),
8
10
  agent_id: z.string().min(1).max(255).describe("The unique identifier of the acquiring agent"),
9
11
  });
10
12
  export const releaseTaskSchema = z.object({
11
- task_id: z.string().uuid().describe("The UUID of the task to release"),
13
+ issue_number: z.number().int().positive().describe("The GitHub issue number to release"),
12
14
  agent_id: z.string().min(1).max(255).describe("The agent ID (must match the acquirer)"),
13
15
  });
14
16
  export const submitPrSchema = z.object({
15
- task_id: z.string().uuid().describe("The UUID of the task this PR addresses"),
17
+ task_id: z.number().int().positive().describe("The GitHub issue number this PR addresses"),
16
18
  agent_id: z.string().min(1).max(255).describe("The agent submitting the PR"),
17
19
  pr_url: z.string().url().max(500).describe("Full URL of the GitHub pull request"),
18
20
  pr_number: z.number().int().positive().describe("The PR number on GitHub"),
@@ -21,6 +23,7 @@ export const submitPrSchema = z.object({
21
23
  .length(40)
22
24
  .describe("The 40-character SHA of the commit being submitted for review"),
23
25
  tee_attestation: z.string().optional().describe("Optional TEE attestation for verified execution"),
26
+ improvement_notes: z.string().max(5000).optional().describe("Explanation of your approach and improvements made"),
24
27
  });
25
28
  export const revisePrSchema = z.object({
26
29
  change_id: z.string().uuid().describe("The UUID of the change/PR to revise"),
@@ -33,10 +36,10 @@ export const revisePrSchema = z.object({
33
36
  });
34
37
  // Tool implementations
35
38
  export async function acquireTask(client, input) {
36
- return client.acquireTask(input.task_id, input.agent_id);
39
+ return client.acquireTask(input.issue_number, input.agent_id);
37
40
  }
38
41
  export async function releaseTask(client, input) {
39
- return client.releaseTask(input.task_id, input.agent_id);
42
+ return client.releaseTask(input.issue_number, input.agent_id);
40
43
  }
41
44
  export async function submitPr(client, input) {
42
45
  return client.registerChange({
@@ -46,6 +49,7 @@ export async function submitPr(client, input) {
46
49
  pr_number: input.pr_number,
47
50
  commit_sha: input.commit_sha,
48
51
  tee_attestation: input.tee_attestation,
52
+ improvement_notes: input.improvement_notes,
49
53
  });
50
54
  }
51
55
  export async function revisePr(client, input) {
@@ -59,54 +63,54 @@ export async function revisePr(client, input) {
59
63
  export const lifecycleTools = [
60
64
  {
61
65
  name: "acquire_task",
62
- description: "Acquire/lock a task for your agent. This claims the task so no other agent can work on it. " +
63
- "The task must be in 'open' status. Returns the updated task with your agent_id set.",
66
+ description: "Acquire a GitHub issue as a task. This fetches the issue from GitHub and creates " +
67
+ "a task record in the database. The task is claimed so no other agent can work on it.",
64
68
  inputSchema: {
65
69
  type: "object",
66
70
  properties: {
67
- task_id: {
68
- type: "string",
69
- description: "The UUID of the task to acquire",
71
+ issue_number: {
72
+ type: "number",
73
+ description: "The GitHub issue number to acquire",
70
74
  },
71
75
  agent_id: {
72
76
  type: "string",
73
77
  description: "Your unique agent identifier",
74
78
  },
75
79
  },
76
- required: ["task_id", "agent_id"],
80
+ required: ["issue_number", "agent_id"],
77
81
  },
78
82
  },
79
83
  {
80
84
  name: "release_task",
81
- description: "Release a previously acquired task back to open status. " +
85
+ description: "Release an acquired task back to available. " +
82
86
  "Only the agent that acquired the task can release it. " +
83
87
  "Use this if you cannot complete the task.",
84
88
  inputSchema: {
85
89
  type: "object",
86
90
  properties: {
87
- task_id: {
88
- type: "string",
89
- description: "The UUID of the task to release",
91
+ issue_number: {
92
+ type: "number",
93
+ description: "The GitHub issue number to release",
90
94
  },
91
95
  agent_id: {
92
96
  type: "string",
93
97
  description: "Your agent ID (must match the original acquirer)",
94
98
  },
95
99
  },
96
- required: ["task_id", "agent_id"],
100
+ required: ["issue_number", "agent_id"],
97
101
  },
98
102
  },
99
103
  {
100
104
  name: "submit_pr",
101
105
  description: "Submit a pull request for review. After completing your work and creating a PR on GitHub, " +
102
106
  "use this to register it for the consensus review process. The task must be acquired by your agent. " +
103
- "Other agents will then review and vote on your PR.",
107
+ "Other agents will then review and vote on your PR. Include improvement_notes to explain your approach.",
104
108
  inputSchema: {
105
109
  type: "object",
106
110
  properties: {
107
111
  task_id: {
108
- type: "string",
109
- description: "The UUID of the task this PR addresses",
112
+ type: "number",
113
+ description: "The GitHub issue number this PR addresses",
110
114
  },
111
115
  agent_id: {
112
116
  type: "string",
@@ -128,6 +132,10 @@ export const lifecycleTools = [
128
132
  type: "string",
129
133
  description: "Optional TEE attestation for verified execution",
130
134
  },
135
+ improvement_notes: {
136
+ type: "string",
137
+ description: "Explain your approach: what you changed, why, and how it improves the code",
138
+ },
131
139
  },
132
140
  required: ["task_id", "agent_id", "pr_url", "pr_number", "commit_sha"],
133
141
  },
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../src/tools/lifecycle.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,qCAAqC;AACrC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACtE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,8CAA8C,CAAC;CAC9F,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACtE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAA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,EAAE,mCAAmC;iBACjD;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,mEAAmE;iBACjF;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,yBAAyB;iBACvC;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,6CAA6C;iBAC3D;gBACD,eAAe,EAAE;oBACf,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,iDAAiD;iBAC/D;gBACD,iBAAiB,EAAE;oBACjB,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,4EAA4E;iBAC1F;aACF;YACD,QAAQ,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,CAAC;SACvE;KACF;IACD;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EACT,gGAAgG;YAChG,4EAA4E;YAC5E,wFAAwF;QAC1F,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,qCAAqC;iBACnD;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,6CAA6C;iBAC3D;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,wDAAwD;iBACtE;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,oDAAoD;iBAClE;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,CAAC;SACxE;KACF;CACF,CAAC"}
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Review tools: list_pending_reviews, submit_review, get_consensus_status
2
+ * Review tools: list_pending_reviews, submit_review, submit_vote, get_consensus_status
3
3
  */
4
4
  import { z } from "zod";
5
5
  import { AgentGitHubClient } from "../client.js";
6
- import { ChangeList, Review, ConsensusStatus } from "../types.js";
6
+ import { ChangeList, Review, Vote, ConsensusStatus } from "../types.js";
7
7
  export declare const listPendingReviewsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
8
8
  export declare const getPrDetailsSchema: z.ZodObject<{
9
9
  change_id: z.ZodString;
@@ -38,6 +38,22 @@ export declare const getConsensusStatusSchema: z.ZodObject<{
38
38
  }, {
39
39
  change_id: string;
40
40
  }>;
41
+ export declare const submitVoteSchema: z.ZodObject<{
42
+ change_id: z.ZodString;
43
+ agent_id: z.ZodString;
44
+ decision: z.ZodEnum<["approve", "reject"]>;
45
+ reason: z.ZodString;
46
+ }, "strip", z.ZodTypeAny, {
47
+ agent_id: string;
48
+ change_id: string;
49
+ decision: "approve" | "reject";
50
+ reason: string;
51
+ }, {
52
+ agent_id: string;
53
+ change_id: string;
54
+ decision: "approve" | "reject";
55
+ reason: string;
56
+ }>;
41
57
  export declare function listPendingReviews(client: AgentGitHubClient): Promise<ChangeList>;
42
58
  export interface PrDetails {
43
59
  change: Awaited<ReturnType<AgentGitHubClient["getChange"]>>;
@@ -47,6 +63,7 @@ export interface PrDetails {
47
63
  export declare function getPrDetails(client: AgentGitHubClient, input: z.infer<typeof getPrDetailsSchema>): Promise<PrDetails>;
48
64
  export declare function submitReview(client: AgentGitHubClient, input: z.infer<typeof submitReviewSchema>): Promise<Review>;
49
65
  export declare function getConsensusStatus(client: AgentGitHubClient, input: z.infer<typeof getConsensusStatusSchema>): Promise<ConsensusStatus>;
66
+ export declare function submitVote(client: AgentGitHubClient, input: z.infer<typeof submitVoteSchema>): Promise<Vote>;
50
67
  export declare const reviewTools: ({
51
68
  name: string;
52
69
  description: string;
@@ -58,6 +75,7 @@ export declare const reviewTools: ({
58
75
  decision?: undefined;
59
76
  summary?: undefined;
60
77
  line_comments?: undefined;
78
+ reason?: undefined;
61
79
  };
62
80
  required?: undefined;
63
81
  };
@@ -75,6 +93,7 @@ export declare const reviewTools: ({
75
93
  decision?: undefined;
76
94
  summary?: undefined;
77
95
  line_comments?: undefined;
96
+ reason?: undefined;
78
97
  };
79
98
  required: string[];
80
99
  };
@@ -105,6 +124,35 @@ export declare const reviewTools: ({
105
124
  type: string;
106
125
  description: string;
107
126
  };
127
+ reason?: undefined;
128
+ };
129
+ required: string[];
130
+ };
131
+ } | {
132
+ name: string;
133
+ description: string;
134
+ inputSchema: {
135
+ type: "object";
136
+ properties: {
137
+ change_id: {
138
+ type: string;
139
+ description: string;
140
+ };
141
+ agent_id: {
142
+ type: string;
143
+ description: string;
144
+ };
145
+ decision: {
146
+ type: string;
147
+ enum: string[];
148
+ description: string;
149
+ };
150
+ reason: {
151
+ type: string;
152
+ description: string;
153
+ };
154
+ summary?: undefined;
155
+ line_comments?: undefined;
108
156
  };
109
157
  required: string[];
110
158
  };
@@ -1 +1 @@
1
- {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/tools/review.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,EAAkB,MAAM,aAAa,CAAC;AAGlF,eAAO,MAAM,wBAAwB,gDAAe,CAAC;AAErD,eAAO,MAAM,kBAAkB;;;;;;EAE7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;EAW7B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;EAEnC,CAAC;AAGH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAEvF;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5D,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,iBAA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AC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAEvF;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5D,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IACpE,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;CACzE;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,GACxC,OAAO,CAAC,SAAS,CAAC,CAOpB;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,GACxC,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,GAC9C,OAAO,CAAC,eAAe,CAAC,CAE1B;AAGD,wBAAsB,UAAU,CAC9B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,GACtC,OAAO,CAAC,IAAI,CAAC,CAMf;AAGD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8GvB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Review tools: list_pending_reviews, submit_review, get_consensus_status
2
+ * Review tools: list_pending_reviews, submit_review, submit_vote, get_consensus_status
3
3
  */
4
4
  import { z } from "zod";
5
5
  // Schema definitions for tool inputs
@@ -22,6 +22,15 @@ export const submitReviewSchema = z.object({
22
22
  export const getConsensusStatusSchema = z.object({
23
23
  change_id: z.string().uuid().describe("The UUID of the change/PR"),
24
24
  });
25
+ // New decoupled voting schema
26
+ export const submitVoteSchema = z.object({
27
+ change_id: z.string().uuid().describe("The UUID of the change/PR to vote on"),
28
+ agent_id: z.string().min(1).max(255).describe("Your agent identifier"),
29
+ decision: z
30
+ .enum(["approve", "reject"])
31
+ .describe("Your vote decision: approve or reject (use gh pr review for comments)"),
32
+ reason: z.string().min(1).describe("Reason for your vote. For rejections, reference specific issues found on GitHub."),
33
+ });
25
34
  // Tool implementations
26
35
  export async function listPendingReviews(client) {
27
36
  return client.listPendingChanges();
@@ -45,6 +54,14 @@ export async function submitReview(client, input) {
45
54
  export async function getConsensusStatus(client, input) {
46
55
  return client.getConsensusStatus(input.change_id);
47
56
  }
57
+ // New decoupled voting function
58
+ export async function submitVote(client, input) {
59
+ return client.submitVote(input.change_id, {
60
+ agent_id: input.agent_id,
61
+ decision: input.decision,
62
+ reason: input.reason,
63
+ });
64
+ }
48
65
  // Tool definitions for MCP registration
49
66
  export const reviewTools = [
50
67
  {
@@ -73,10 +90,10 @@ export const reviewTools = [
73
90
  },
74
91
  {
75
92
  name: "submit_review",
76
- description: "Submit your review for a pending PR. You can approve, reject, or comment. " +
77
- "You cannot review your own PRs. Each agent can only submit one review per change. " +
78
- "Once enough approvals are received (usually 2), the PR is automatically merged. " +
79
- "If rejected, the author can revise and resubmit.",
93
+ description: "[DEPRECATED - Use submit_vote instead] " +
94
+ "Submit your review for a pending PR. " +
95
+ "The new workflow is: 1) Post feedback on GitHub with `gh pr review`, " +
96
+ "2) Register vote with submit_vote. This tool is kept for backward compatibility.",
80
97
  inputSchema: {
81
98
  type: "object",
82
99
  properties: {
@@ -120,5 +137,36 @@ export const reviewTools = [
120
137
  required: ["change_id"],
121
138
  },
122
139
  },
140
+ {
141
+ name: "submit_vote",
142
+ description: "Register your vote for backend consensus coordination. " +
143
+ "IMPORTANT: Before using this tool, first post detailed feedback on GitHub using " +
144
+ "`gh pr review <PR_NUMBER> --approve` or `gh pr review <PR_NUMBER> --request-changes --body '...'`. " +
145
+ "This tool only tracks votes for automated merge/close decisions. " +
146
+ "Use 'approve' or 'reject' - comments should go on GitHub directly.",
147
+ inputSchema: {
148
+ type: "object",
149
+ properties: {
150
+ change_id: {
151
+ type: "string",
152
+ description: "The UUID of the change/PR to vote on",
153
+ },
154
+ agent_id: {
155
+ type: "string",
156
+ description: "Your agent identifier",
157
+ },
158
+ decision: {
159
+ type: "string",
160
+ enum: ["approve", "reject"],
161
+ description: "Your vote decision (approve or reject)",
162
+ },
163
+ reason: {
164
+ type: "string",
165
+ description: "Reason for your vote. For rejections, reference issues from your GitHub review.",
166
+ },
167
+ },
168
+ required: ["change_id", "agent_id", "decision", "reason"],
169
+ },
170
+ },
123
171
  ];
124
172
  //# sourceMappingURL=review.js.map