@arcbridge/mcp-server 0.4.2 → 0.5.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.
package/dist/index.js CHANGED
@@ -139,15 +139,11 @@ Use \`arcbridge_get_project_status\` to see the current state.`
139
139
  );
140
140
  }
141
141
  let indexResult = null;
142
+ let indexError;
142
143
  try {
143
- const result = await indexProject(db, { projectRoot: targetDir });
144
- indexResult = {
145
- symbolsIndexed: result.symbolsIndexed,
146
- dependenciesIndexed: result.dependenciesIndexed,
147
- componentsAnalyzed: result.componentsAnalyzed,
148
- routesAnalyzed: result.routesAnalyzed
149
- };
150
- } catch {
144
+ indexResult = await indexProject(db, { projectRoot: targetDir });
145
+ } catch (err) {
146
+ indexError = err instanceof Error ? err.message : String(err);
151
147
  }
152
148
  const blockCount = db.prepare("SELECT COUNT(*) as count FROM building_blocks").get();
153
149
  const scenarioCount = db.prepare("SELECT COUNT(*) as count FROM quality_scenarios").get();
@@ -169,12 +165,27 @@ Use \`arcbridge_get_project_status\` to see the current state.`
169
165
  `- **Phases:** ${phaseCount.count}`,
170
166
  `- **Tasks:** ${taskCount.count}`,
171
167
  `- **Agent roles:** ${roles.length}`,
172
- ...indexResult ? [
168
+ ...indexResult && !indexResult.skippedReason ? [
173
169
  `- **Symbols indexed:** ${indexResult.symbolsIndexed}`,
174
170
  `- **Dependencies indexed:** ${indexResult.dependenciesIndexed}`,
175
171
  `- **Components analyzed:** ${indexResult.componentsAnalyzed}`,
176
172
  `- **Routes analyzed:** ${indexResult.routesAnalyzed}`
177
- ] : [input.template === "dotnet-webapi" || input.template === "unity-game" ? `- **Code indexing:** run \`arcbridge_reindex\` to index C# symbols (tree-sitter or Roslyn)` : `- **Code indexing:** skipped (no tsconfig.json found \u2014 run \`arcbridge_reindex\` later)`],
173
+ ] : [(() => {
174
+ const oneLine = (msg) => {
175
+ const normalized = msg.replace(/\s*\r?\n\s*/g, " ").trim();
176
+ return normalized.length > 200 ? `${normalized.slice(0, 199)}\u2026` : normalized;
177
+ };
178
+ const skippedReason = indexResult?.skippedReason;
179
+ const isCSharp = input.template === "dotnet-webapi" || input.template === "unity-game";
180
+ const reindexHint = isCSharp ? "run `arcbridge_reindex` after project setup to index C# symbols" : "run `arcbridge_reindex` once your project is set up";
181
+ if (skippedReason) {
182
+ return `- **Code indexing:** skipped \u2014 ${oneLine(skippedReason)}. ${reindexHint}`;
183
+ }
184
+ if (indexError) {
185
+ return `- **Code indexing:** failed \u2014 ${oneLine(indexError)}. ${reindexHint}`;
186
+ }
187
+ return `- **Code indexing:** failed. ${reindexHint}`;
188
+ })()],
178
189
  "",
179
190
  "## Files",
180
191
  "",
@@ -1401,12 +1412,12 @@ import { indexProject as indexProject2, refreshFromDocs as refreshFromDocs7 } fr
1401
1412
  function registerReindex(server, ctx) {
1402
1413
  server.tool(
1403
1414
  "arcbridge_reindex",
1404
- "Re-index the project: refreshes architecture docs from arc42/YAML files, then reindexes code symbols (TypeScript & C#/.NET). This is the first step of the sync pipeline \u2014 use it to pick up manual doc edits and code changes.",
1415
+ "Re-index the project: refreshes architecture docs from arc42/YAML files, then reindexes code symbols (TypeScript, C#/.NET; Python and Go are experimental). This is the first step of the sync pipeline \u2014 use it to pick up manual doc edits and code changes.",
1405
1416
  {
1406
1417
  target_dir: z14.string().describe("Absolute path to the project directory"),
1407
1418
  tsconfig_path: z14.string().optional().describe("Override tsconfig.json path (default: auto-detect). Only used for TypeScript projects."),
1408
1419
  service: z14.string().optional().describe("Service name for monorepo projects (default: 'main')"),
1409
- language: z14.enum(["typescript", "csharp", "auto"]).optional().describe("Project language. 'auto' detects from project files (default: 'auto')")
1420
+ language: z14.enum(["typescript", "csharp", "python", "go", "auto"]).optional().describe("Project language. 'auto' detects from project files (default: 'auto')")
1410
1421
  },
1411
1422
  async (params) => {
1412
1423
  const start = Date.now();