@j0hanz/code-review-analyst-mcp 1.7.3 → 1.7.4

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.
@@ -183,13 +183,17 @@ function createProgressReporter(extra) {
183
183
  };
184
184
  }
185
185
  const progressToken = rawToken;
186
- let lastCurrent = 0;
186
+ let lastCurrent = -1;
187
187
  let didSendTerminal = false;
188
188
  return async (payload) => {
189
189
  if (didSendTerminal) {
190
190
  return;
191
191
  }
192
- const current = Math.max(payload.current, lastCurrent);
192
+ let { current } = payload;
193
+ if (current <= lastCurrent && current < (payload.total ?? Infinity)) {
194
+ current = lastCurrent + 0.01;
195
+ }
196
+ current = Math.max(current, lastCurrent);
193
197
  const total = payload.total !== undefined
194
198
  ? Math.max(payload.total, current)
195
199
  : undefined;
@@ -265,18 +269,20 @@ async function sendSingleStepProgress(extra, toolName, context, current, state)
265
269
  async function reportProgressStepUpdate(reportProgress, toolName, context, current, metadata) {
266
270
  await reportProgress({
267
271
  current,
272
+ total: TASK_PROGRESS_TOTAL,
268
273
  message: formatProgressStep(toolName, context, metadata),
269
274
  });
270
275
  }
271
276
  async function reportProgressCompletionUpdate(reportProgress, toolName, context, outcome) {
272
277
  await reportProgress({
273
278
  current: TASK_PROGRESS_TOTAL,
279
+ total: TASK_PROGRESS_TOTAL,
274
280
  message: formatProgressCompletion(toolName, context, outcome),
275
281
  });
276
282
  }
277
283
  async function reportSchemaRetryProgressBestEffort(reportProgress, toolName, context, retryCount, maxRetries) {
278
284
  try {
279
- await reportProgressStepUpdate(reportProgress, toolName, context, STEP_VALIDATING_RESPONSE, `Schema repair in progress (attempt ${retryCount}/${maxRetries})...`);
285
+ await reportProgressStepUpdate(reportProgress, toolName, context, STEP_VALIDATING_RESPONSE + retryCount / (maxRetries + 1), `Schema repair in progress (attempt ${retryCount}/${maxRetries})...`);
280
286
  }
281
287
  catch {
282
288
  // Progress updates are best-effort and must not interrupt retries.
@@ -557,35 +563,54 @@ export function registerStructuredToolTask(server, config) {
557
563
  geminiSchema: config.geminiSchema,
558
564
  resultSchema: config.resultSchema,
559
565
  });
560
- server.registerTool(config.name, {
566
+ server.experimental.tasks.registerToolTask(config.name, {
561
567
  title: config.title,
562
568
  description: config.description,
563
569
  inputSchema: config.inputSchema,
564
570
  outputSchema: DefaultOutputSchema,
565
571
  annotations: buildToolAnnotations(config.annotations),
566
- }, async (input, extra) => {
567
- const runner = new ToolExecutionRunner(config, {
568
- onLog: async (level, data) => {
569
- // Standard logging for tool calls
570
- try {
571
- await server.sendLoggingMessage({
572
- level: toLoggingLevel(level),
573
- logger: 'gemini',
574
- data: asObjectRecord(data),
575
- });
576
- }
577
- catch {
578
- // Fallback if logging fails
579
- }
580
- },
581
- reportProgress: createProgressReporter(extra),
582
- statusReporter: {
583
- updateStatus: async () => {
584
- // No-op for standard tool calls as they don't have a persistent task status
572
+ execution: {
573
+ taskSupport: 'optional',
574
+ },
575
+ }, {
576
+ createTask: async (input, extra) => {
577
+ const task = await extra.taskStore.createTask({ ttl: 300000 });
578
+ const extendedStore = extra.taskStore;
579
+ const runner = new ToolExecutionRunner(config, {
580
+ onLog: async (level, data) => {
581
+ try {
582
+ await server.sendLoggingMessage({
583
+ level: toLoggingLevel(level),
584
+ logger: 'gemini',
585
+ data: asObjectRecord(data),
586
+ });
587
+ }
588
+ catch {
589
+ // Fallback if logging fails
590
+ }
585
591
  },
586
- },
587
- });
588
- runner.setResponseSchemaOverride(responseSchema);
589
- return await runner.run(input);
592
+ reportProgress: createProgressReporter(extra),
593
+ statusReporter: {
594
+ updateStatus: async (message) => {
595
+ await extendedStore.updateTaskStatus(task.taskId, 'working', message);
596
+ },
597
+ storeResult: async (status, result) => {
598
+ await extra.taskStore.storeTaskResult(task.taskId, status, result);
599
+ },
600
+ },
601
+ });
602
+ runner.setResponseSchemaOverride(responseSchema);
603
+ // Run in background
604
+ runner.run(input).catch(async (error) => {
605
+ await extendedStore.updateTaskStatus(task.taskId, 'failed', getErrorMessage(error));
606
+ });
607
+ return { task };
608
+ },
609
+ getTask: async (input, extra) => {
610
+ return await extra.taskStore.getTask(extra.taskId);
611
+ },
612
+ getTaskResult: async (input, extra) => {
613
+ return (await extra.taskStore.getTaskResult(extra.taskId));
614
+ },
590
615
  });
591
616
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@j0hanz/code-review-analyst-mcp",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "mcpName": "io.github.j0hanz/code-review-analyst",
5
5
  "description": "Gemini-powered MCP server for code review analysis.",
6
6
  "type": "module",