@arcbridge/mcp-server 0.5.0 → 0.6.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.
- package/dist/index.js +29 -21
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -42,8 +42,8 @@ function registerInitProject(server, ctx) {
|
|
|
42
42
|
"Initialize ArcBridge in a project directory. Creates .arcbridge/ with arc42 documentation, phase plan, agent roles, SQLite database, and platform-specific configs.",
|
|
43
43
|
{
|
|
44
44
|
name: z.string().min(1).describe("Project name"),
|
|
45
|
-
template: z.enum(["nextjs-app-router", "react-vite", "api-service", "dotnet-webapi", "unity-game", "angular-app"]).default("nextjs-app-router").describe(
|
|
46
|
-
"Project template: nextjs-app-router (Next.js with App Router, SSR/SSG), react-vite (React SPA with Vite, client-only), angular-app (Angular with standalone components, TypeScript), api-service (Node.js API with Express/Fastify/Hono), dotnet-webapi (ASP.NET Core Web API, C#), unity-game (Unity game project, C#, code-heavy)"
|
|
45
|
+
template: z.enum(["nextjs-app-router", "react-vite", "api-service", "dotnet-webapi", "unity-game", "angular-app", "fullstack-nextjs-dotnet"]).default("nextjs-app-router").describe(
|
|
46
|
+
"Project template: nextjs-app-router (Next.js with App Router, SSR/SSG), react-vite (React SPA with Vite, client-only), angular-app (Angular with standalone components, TypeScript), api-service (Node.js API with Express/Fastify/Hono), dotnet-webapi (ASP.NET Core Web API, C#), unity-game (Unity game project, C#, code-heavy), fullstack-nextjs-dotnet (monorepo with Next.js frontend + .NET API backend)"
|
|
47
47
|
),
|
|
48
48
|
features: z.array(z.enum(["auth", "database", "api"])).default([]).describe("Features to scaffold"),
|
|
49
49
|
quality_priorities: z.array(QualityCategorySchema).default(["security", "performance", "accessibility", "maintainability"]).describe(QUALITY_PRIORITIES_DESCRIPTION),
|
|
@@ -230,17 +230,25 @@ Use \`arcbridge_get_project_status\` to see the current state.`
|
|
|
230
230
|
|
|
231
231
|
// src/tools/get-project-status.ts
|
|
232
232
|
import { z as z2 } from "zod";
|
|
233
|
-
import { refreshFromDocs } from "@arcbridge/core";
|
|
233
|
+
import { refreshFromDocs as refreshFromDocs2 } from "@arcbridge/core";
|
|
234
234
|
|
|
235
235
|
// src/helpers.ts
|
|
236
236
|
import { join as join2 } from "path";
|
|
237
237
|
import { existsSync as existsSync2 } from "fs";
|
|
238
|
-
import { openDatabase, migrate } from "@arcbridge/core";
|
|
238
|
+
import { openDatabase, migrate, initializeSchema, refreshFromDocs } from "@arcbridge/core";
|
|
239
239
|
function ensureDb(ctx, targetDir) {
|
|
240
240
|
if (ctx.db) return ctx.db;
|
|
241
241
|
const dbPath = join2(targetDir, ".arcbridge", "index.db");
|
|
242
242
|
if (!existsSync2(dbPath)) {
|
|
243
|
-
|
|
243
|
+
const configPath = join2(targetDir, ".arcbridge", "config.yaml");
|
|
244
|
+
if (!existsSync2(configPath)) return null;
|
|
245
|
+
const db = openDatabase(dbPath);
|
|
246
|
+
initializeSchema(db);
|
|
247
|
+
migrate(db);
|
|
248
|
+
refreshFromDocs(db, targetDir);
|
|
249
|
+
ctx.db = db;
|
|
250
|
+
ctx.projectRoot = targetDir;
|
|
251
|
+
return db;
|
|
244
252
|
}
|
|
245
253
|
ctx.db = openDatabase(dbPath);
|
|
246
254
|
migrate(ctx.db);
|
|
@@ -290,7 +298,7 @@ function registerGetProjectStatus(server, ctx) {
|
|
|
290
298
|
if (!db) {
|
|
291
299
|
return notInitialized();
|
|
292
300
|
}
|
|
293
|
-
|
|
301
|
+
refreshFromDocs2(db, params.target_dir);
|
|
294
302
|
const metaRows = db.prepare(
|
|
295
303
|
"SELECT key, value FROM arcbridge_meta WHERE key IN ('project_name', 'project_type', 'platforms')"
|
|
296
304
|
).all();
|
|
@@ -706,7 +714,7 @@ function registerGetQualityScenarios(server, ctx) {
|
|
|
706
714
|
|
|
707
715
|
// src/tools/get-phase-plan.ts
|
|
708
716
|
import { z as z6 } from "zod";
|
|
709
|
-
import { refreshFromDocs as
|
|
717
|
+
import { refreshFromDocs as refreshFromDocs3 } from "@arcbridge/core";
|
|
710
718
|
function registerGetPhasePlan(server, ctx) {
|
|
711
719
|
server.tool(
|
|
712
720
|
"arcbridge_get_phase_plan",
|
|
@@ -720,7 +728,7 @@ function registerGetPhasePlan(server, ctx) {
|
|
|
720
728
|
async (params) => {
|
|
721
729
|
const db = ensureDb(ctx, params.target_dir);
|
|
722
730
|
if (!db) return notInitialized();
|
|
723
|
-
|
|
731
|
+
refreshFromDocs3(db, params.target_dir);
|
|
724
732
|
let query = "SELECT id, name, phase_number, status, description, gate_status, started_at, completed_at FROM phases";
|
|
725
733
|
const conditions = [];
|
|
726
734
|
const queryParams = [];
|
|
@@ -809,7 +817,7 @@ function registerGetPhasePlan(server, ctx) {
|
|
|
809
817
|
|
|
810
818
|
// src/tools/get-current-tasks.ts
|
|
811
819
|
import { z as z7 } from "zod";
|
|
812
|
-
import { refreshFromDocs as
|
|
820
|
+
import { refreshFromDocs as refreshFromDocs4 } from "@arcbridge/core";
|
|
813
821
|
function registerGetCurrentTasks(server, ctx) {
|
|
814
822
|
server.tool(
|
|
815
823
|
"arcbridge_get_current_tasks",
|
|
@@ -822,7 +830,7 @@ function registerGetCurrentTasks(server, ctx) {
|
|
|
822
830
|
async (params) => {
|
|
823
831
|
const db = ensureDb(ctx, params.target_dir);
|
|
824
832
|
if (!db) return notInitialized();
|
|
825
|
-
|
|
833
|
+
refreshFromDocs4(db, params.target_dir);
|
|
826
834
|
let currentPhase;
|
|
827
835
|
if (params.phase_id) {
|
|
828
836
|
currentPhase = db.prepare("SELECT id, name FROM phases WHERE id = ?").get(params.phase_id);
|
|
@@ -1153,7 +1161,7 @@ If you need a new block, add it to \`.arcbridge/arc42/05-building-blocks.md\` an
|
|
|
1153
1161
|
|
|
1154
1162
|
// src/tools/delete-task.ts
|
|
1155
1163
|
import { z as z10 } from "zod";
|
|
1156
|
-
import { deleteTaskFromYaml, refreshFromDocs as
|
|
1164
|
+
import { deleteTaskFromYaml, refreshFromDocs as refreshFromDocs5 } from "@arcbridge/core";
|
|
1157
1165
|
function registerDeleteTask(server, ctx) {
|
|
1158
1166
|
server.tool(
|
|
1159
1167
|
"arcbridge_delete_task",
|
|
@@ -1189,7 +1197,7 @@ function registerDeleteTask(server, ctx) {
|
|
|
1189
1197
|
}
|
|
1190
1198
|
}
|
|
1191
1199
|
if (results.length > 0) {
|
|
1192
|
-
|
|
1200
|
+
refreshFromDocs5(db, params.target_dir);
|
|
1193
1201
|
}
|
|
1194
1202
|
const lines = [];
|
|
1195
1203
|
if (results.length > 0) {
|
|
@@ -1208,7 +1216,7 @@ function registerDeleteTask(server, ctx) {
|
|
|
1208
1216
|
|
|
1209
1217
|
// src/tools/create-phase.ts
|
|
1210
1218
|
import { z as z11 } from "zod";
|
|
1211
|
-
import { addPhaseToYaml, refreshFromDocs as
|
|
1219
|
+
import { addPhaseToYaml, refreshFromDocs as refreshFromDocs6 } from "@arcbridge/core";
|
|
1212
1220
|
function registerCreatePhase(server, ctx) {
|
|
1213
1221
|
server.tool(
|
|
1214
1222
|
"arcbridge_create_phase",
|
|
@@ -1223,7 +1231,7 @@ function registerCreatePhase(server, ctx) {
|
|
|
1223
1231
|
async (params) => {
|
|
1224
1232
|
const db = ensureDb(ctx, params.target_dir);
|
|
1225
1233
|
if (!db) return notInitialized();
|
|
1226
|
-
|
|
1234
|
+
refreshFromDocs6(db, params.target_dir);
|
|
1227
1235
|
const maxPhase = db.prepare("SELECT MAX(phase_number) as max FROM phases").get();
|
|
1228
1236
|
const phaseNumber = params.phase_number ?? (maxPhase.max ?? -1) + 1;
|
|
1229
1237
|
const existing = db.prepare("SELECT id FROM phases WHERE phase_number = ?").get(phaseNumber);
|
|
@@ -1246,7 +1254,7 @@ function registerCreatePhase(server, ctx) {
|
|
|
1246
1254
|
`Failed to create phase: ${yamlResult.warning ?? "YAML update failed"}`
|
|
1247
1255
|
);
|
|
1248
1256
|
}
|
|
1249
|
-
|
|
1257
|
+
refreshFromDocs6(db, params.target_dir);
|
|
1250
1258
|
const lines = [
|
|
1251
1259
|
`Phase created: **${phaseId}**`,
|
|
1252
1260
|
"",
|
|
@@ -1272,7 +1280,7 @@ function registerCreatePhase(server, ctx) {
|
|
|
1272
1280
|
|
|
1273
1281
|
// src/tools/delete-phase.ts
|
|
1274
1282
|
import { z as z12 } from "zod";
|
|
1275
|
-
import { deletePhaseFromYaml, refreshFromDocs as
|
|
1283
|
+
import { deletePhaseFromYaml, refreshFromDocs as refreshFromDocs7 } from "@arcbridge/core";
|
|
1276
1284
|
function registerDeletePhase(server, ctx) {
|
|
1277
1285
|
server.tool(
|
|
1278
1286
|
"arcbridge_delete_phase",
|
|
@@ -1302,7 +1310,7 @@ function registerDeletePhase(server, ctx) {
|
|
|
1302
1310
|
`Failed to delete phase: ${yamlResult.warning ?? "Unknown error"}`
|
|
1303
1311
|
);
|
|
1304
1312
|
}
|
|
1305
|
-
|
|
1313
|
+
refreshFromDocs7(db, params.target_dir);
|
|
1306
1314
|
const lines = [
|
|
1307
1315
|
`Phase **${phase.id}** deleted: "${phase.name}" (phase ${phase.phase_number})`
|
|
1308
1316
|
];
|
|
@@ -1408,7 +1416,7 @@ function formatAdrs(adrs, title) {
|
|
|
1408
1416
|
|
|
1409
1417
|
// src/tools/reindex.ts
|
|
1410
1418
|
import { z as z14 } from "zod";
|
|
1411
|
-
import { indexProject as indexProject2, refreshFromDocs as
|
|
1419
|
+
import { indexProject as indexProject2, refreshFromDocs as refreshFromDocs8 } from "@arcbridge/core";
|
|
1412
1420
|
function registerReindex(server, ctx) {
|
|
1413
1421
|
server.tool(
|
|
1414
1422
|
"arcbridge_reindex",
|
|
@@ -1424,7 +1432,7 @@ function registerReindex(server, ctx) {
|
|
|
1424
1432
|
const db = ensureDb(ctx, params.target_dir);
|
|
1425
1433
|
if (!db) return notInitialized();
|
|
1426
1434
|
try {
|
|
1427
|
-
const docWarnings =
|
|
1435
|
+
const docWarnings = refreshFromDocs8(db, params.target_dir);
|
|
1428
1436
|
const result = await indexProject2(db, {
|
|
1429
1437
|
projectRoot: params.target_dir,
|
|
1430
1438
|
tsconfigPath: params.tsconfig_path,
|
|
@@ -3098,7 +3106,7 @@ import {
|
|
|
3098
3106
|
applyInferences,
|
|
3099
3107
|
verifyScenarios,
|
|
3100
3108
|
loadConfig as loadConfig4,
|
|
3101
|
-
refreshFromDocs as
|
|
3109
|
+
refreshFromDocs as refreshFromDocs9,
|
|
3102
3110
|
syncPhaseToYaml,
|
|
3103
3111
|
transaction
|
|
3104
3112
|
} from "@arcbridge/core";
|
|
@@ -3117,7 +3125,7 @@ function registerCompletePhase(server, ctx) {
|
|
|
3117
3125
|
const start = Date.now();
|
|
3118
3126
|
const db = ensureDb(ctx, params.target_dir);
|
|
3119
3127
|
if (!db) return notInitialized();
|
|
3120
|
-
|
|
3128
|
+
refreshFromDocs9(db, params.target_dir);
|
|
3121
3129
|
let phase;
|
|
3122
3130
|
if (params.phase_id) {
|
|
3123
3131
|
phase = db.prepare("SELECT id, name, phase_number, status, gate_status FROM phases WHERE id = ?").get(params.phase_id);
|