@imenam/mcp-feature-analyzer 1.0.21 → 1.0.22

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.
package/README.md CHANGED
@@ -136,7 +136,7 @@ Quatorze outils. Les noms, descriptions et textes de résultat sont en anglais ;
136
136
 
137
137
  | Outil | Effet |
138
138
  |---|---|
139
- | `list_analyses` | Point d'entrée : les analyses regroupées par projet, chacune avec ses refs, ses constats ouverts par gravité, ses fichiers revus, son nombre de schémas et l'état de sa revue ; une revue soumise est « pending processing » tant que l'agent ne l'a pas marquée traitée, « processed at … » ensuite, avec la note du traitement ; une revue approuvée est « nothing to process ». `project` limite la liste à un projet (un nom inconnu liste les projets existants) ; `review_state` à un état de revue (`not_started`, `in_progress`, `files_reviewed`, `submitted`), aux revues soumises restant à traiter (`to_process`) ou qui n'attendent plus l'agent (`processed` : marquées traitées, ou approuvées). Invite l'agent à reprendre l'analyse existante d'une feature plutôt qu'à en créer une autre. Signale aussi les fichiers d'analyse illisibles. |
139
+ | `list_analyses` | Point d'entrée : les 5 analyses les plus récemment modifiées (`limit` change ce nombre ; la réponse signale quand la liste est tronquée), regroupées par projet, chacune avec ses refs, ses constats ouverts par gravité, ses fichiers revus, son nombre de schémas et l'état de sa revue ; une revue soumise est « pending processing » tant que l'agent ne l'a pas marquée traitée, « processed at … » ensuite, avec la note du traitement ; une revue approuvée est « nothing to process ». `project` limite la liste à un projet (un nom inconnu liste les projets existants) ; `review_state` à un état de revue (`not_started`, `in_progress`, `files_reviewed`, `submitted`), aux revues soumises restant à traiter (`to_process`) ou qui n'attendent plus l'agent (`processed` : marquées traitées, ou approuvées). Invite l'agent à reprendre l'analyse existante d'une feature plutôt qu'à en créer une autre. Signale aussi les fichiers d'analyse illisibles. |
140
140
  | `create_analysis` | Calcule et fige le diff : `repo_path` (racine absolue du dépôt), `project` (projet ou feature, dossier de rangement, requis), `title`, `mode` (`branch` ou `working_tree`), `base` (requis en `branch`), `head` (en `branch`, défaut `HEAD`), `request_text` et `request_source` (la demande initiale : ticket, prompt), `follow_up_of` (voir [Revues de suivi](#revues-de-suivi)). Renvoie l'identifiant et la liste des fichiers. |
141
141
  | `get_analysis` | Vue complète : projet, demande, vue d'ensemble, résumé, fichiers (revus ou non), constats avec statut et emplacement, remarques du relecteur, schémas (signalés quand leur tracé a des croisements), état de la revue, et ses liens de suivi (analyse suivie avec le rang du tour, revue de suivi avec son état). |
142
142
  | `update_analysis` | Change `title`, `project`, la vue d'ensemble (`objective`, `approach`, `attention_points`), `summary` (les changements fonctionnels de la feature, une puce par changement, remplace toute la liste) ou la demande initiale (`request_text`, `request_source` ; `null` efface). Les champs absents sont conservés. |
package/dist/src/index.js CHANGED
@@ -22,7 +22,7 @@ import { AddNoteRequestSchema, AnalysisRequestSchema, DeleteNoteRequestSchema, S
22
22
  import { ANALYSIS_MODES, DIAGRAM_KINDS, EXPLANATION_SIDES, FINDING_KINDS, NODE_SHAPES, NODE_STATUSES, SEVERITIES, } from "../shared/schemas/analysis.schema.js";
23
23
  import { errorResult, textResult } from "./tools/types.js";
24
24
  import { createAnalysis } from "./tools/create-analysis.js";
25
- import { listAnalyses, REVIEW_STATE_FILTERS } from "./tools/list-analyses.js";
25
+ import { DEFAULT_LIST_LIMIT, listAnalyses, REVIEW_STATE_FILTERS } from "./tools/list-analyses.js";
26
26
  import { getAnalysis } from "./tools/get-analysis.js";
27
27
  import { getDiff } from "./tools/get-diff.js";
28
28
  import { refreshAnalysis } from "./tools/refresh-analysis.js";
@@ -361,7 +361,8 @@ const PROJECT_DOC = "Project the analysis belongs to: the product or feature nam
361
361
  const TOOLS = [
362
362
  {
363
363
  name: "list_analyses",
364
- description: "List the analyses grouped by project, with their refs, open findings by severity, reviewed files, diagram count and review state " +
364
+ description: `List the ${DEFAULT_LIST_LIMIT} most recently updated analyses by default (raise limit to see more), grouped by project, with their refs, ` +
365
+ "open findings by severity, reviewed files, diagram count and review state " +
365
366
  "(not started, in progress, all files reviewed, submitted; a submitted review is pending processing until mark_feedback_processed or refresh_analysis, " +
366
367
  "except an approved one, which has nothing to process). " +
367
368
  "Start here: when the project already has an analysis of the feature, " +
@@ -371,6 +372,11 @@ const TOOLS = [
371
372
  type: "object",
372
373
  properties: {
373
374
  project: { type: "string", description: "Only list the analyses of this project (exact name). An unknown name lists the existing projects." },
375
+ limit: {
376
+ type: "integer",
377
+ minimum: 1,
378
+ description: `Maximum number of analyses to list, most recently updated first, after the project and review_state filters. Default ${DEFAULT_LIST_LIMIT}.`,
379
+ },
374
380
  review_state: {
375
381
  type: "string",
376
382
  enum: [...REVIEW_STATE_FILTERS],
@@ -7,9 +7,12 @@ import { type Args, type ToolResult } from "./types.js";
7
7
  */
8
8
  export declare const REVIEW_STATE_FILTERS: readonly ["not_started", "in_progress", "files_reviewed", "submitted", "to_process", "processed"];
9
9
  export type ReviewStateFilter = (typeof REVIEW_STATE_FILTERS)[number];
10
+ /** Nombre d'analyses listées quand `limit` est absent. */
11
+ export declare const DEFAULT_LIST_LIMIT = 5;
10
12
  /**
11
- * Liste les analyses regroupées par projet (projet le plus récemment modifié en
12
- * premier, puis analyses de la plus récente à la plus ancienne), éventuellement
13
- * limitées à un projet et à un état de revue, et les fichiers illisibles.
13
+ * Liste les `limit` analyses les plus récemment modifiées, éventuellement
14
+ * limitées à un projet et à un état de revue, regroupées par projet (projet le
15
+ * plus récemment modifié en premier, puis analyses de la plus récente à la plus
16
+ * ancienne), et les fichiers illisibles.
14
17
  */
15
18
  export declare function listAnalyses(store: AnalysisStore, args: Args): ToolResult;
@@ -1,6 +1,6 @@
1
1
  import { REVIEW_PROGRESS_STATES } from "../../shared/schemas/analysis.schema.js";
2
2
  import { progressLabel, progressStateLabel, refsLabel, severityCountsLabel } from "./format.js";
3
- import { optionalEnum, optionalString, rejectUnknownFields, textResult } from "./types.js";
3
+ import { optionalEnum, optionalPositiveInt, optionalString, rejectUnknownFields, textResult } from "./types.js";
4
4
  /**
5
5
  * Filtre `review_state` : un état d'avancement, ou parmi les revues soumises
6
6
  * celles qui restent à traiter (`to_process`) ou n'attendent plus l'agent
@@ -52,19 +52,24 @@ function analysisLines(summary) {
52
52
  }
53
53
  return lines;
54
54
  }
55
+ /** Nombre d'analyses listées quand `limit` est absent. */
56
+ export const DEFAULT_LIST_LIMIT = 5;
55
57
  /**
56
- * Liste les analyses regroupées par projet (projet le plus récemment modifié en
57
- * premier, puis analyses de la plus récente à la plus ancienne), éventuellement
58
- * limitées à un projet et à un état de revue, et les fichiers illisibles.
58
+ * Liste les `limit` analyses les plus récemment modifiées, éventuellement
59
+ * limitées à un projet et à un état de revue, regroupées par projet (projet le
60
+ * plus récemment modifié en premier, puis analyses de la plus récente à la plus
61
+ * ancienne), et les fichiers illisibles.
59
62
  */
60
63
  export function listAnalyses(store, args) {
61
- rejectUnknownFields(args, ["project", "review_state"]);
64
+ rejectUnknownFields(args, ["project", "review_state", "limit"]);
62
65
  const project = optionalString(args, "project");
63
66
  const reviewState = optionalEnum(args, "review_state", REVIEW_STATE_FILTERS);
67
+ const limit = optionalPositiveInt(args, "limit") ?? DEFAULT_LIST_LIMIT;
64
68
  const { analyses: all, unreadable } = store.list();
65
69
  const known = new Set(all.map((summary) => summary.project));
66
- const analyses = reviewState === undefined ? all : all.filter((summary) => matchesReviewState(summary, reviewState));
67
- const groups = groupByProject(analyses);
70
+ const matching = all.filter((summary) => (project === undefined || summary.project === project) &&
71
+ (reviewState === undefined || matchesReviewState(summary, reviewState)));
72
+ const groups = groupByProject(matching.slice(0, limit));
68
73
  const lines = [];
69
74
  if (project !== undefined && !known.has(project)) {
70
75
  const names = [...groupByProject(all).keys()];
@@ -73,21 +78,21 @@ export function listAnalyses(store, args) {
73
78
  : `Unknown project "${project}". Existing projects: ${names.map((name) => `"${name}"`).join(", ")}. ` +
74
79
  `Call list_analyses without project to see them all, or create_analysis to start a new project.`);
75
80
  }
76
- const shown = project === undefined ? [...groups] : groups.has(project) ? [[project, groups.get(project)]] : [];
77
81
  const scope = project === undefined ? "" : ` in project "${project}"`;
78
82
  const filtered = reviewState === undefined ? "" : ` with review state ${reviewState}`;
79
83
  if (all.length === 0) {
80
84
  lines.push("No analyses yet. Create one with create_analysis once the feature is developed: it freezes the diff of a branch or of the working tree for human review.");
81
85
  }
82
- else if (shown.length === 0) {
86
+ else if (matching.length === 0) {
83
87
  lines.push(`No analysis${scope}${filtered}. Call list_analyses without review_state to see them all.`);
84
88
  }
85
89
  else {
86
- const total = shown.reduce((sum, [, list]) => sum + list.length, 0);
87
- lines.push(project === undefined
88
- ? `${total} analysis(es)${filtered} in ${groups.size} project(s), most recently updated first:`
89
- : `${total} analysis(es)${filtered}${scope}, most recently updated first:`);
90
- for (const [name, list] of shown) {
90
+ const inProjects = project === undefined ? ` in ${groups.size} project(s)` : "";
91
+ lines.push(matching.length > limit
92
+ ? `Showing only the ${limit} most recently updated of ${matching.length} analyses${filtered}${scope}${inProjects}. ` +
93
+ `Pass a higher limit to see more, or filter with project or review_state:`
94
+ : `${matching.length} analysis(es)${filtered}${scope}${inProjects}, most recently updated first:`);
95
+ for (const [name, list] of groups) {
91
96
  lines.push("", `## Project "${name}" (${projectCounts(list)})`);
92
97
  for (const summary of list)
93
98
  lines.push(...analysisLines(summary));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imenam/mcp-feature-analyzer",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "MCP server that helps a human review a feature developed by an AI agent: summary, changed files, frozen diff, findings ranked by severity, diagrams, and structured feedback the agent reads back.",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {