@mushi-mushi/mcp 0.32.1 → 0.33.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/server.js CHANGED
@@ -4,18 +4,20 @@ import {
4
4
  TDD_TOOL_CATALOG,
5
5
  TOOL_CATALOG,
6
6
  routeUseMushiIntent
7
- } from "./chunk-MVP3BKZ2.js";
7
+ } from "./chunk-UPSIGKYM.js";
8
8
  import {
9
9
  MUSHI_SERVER_METADATA
10
- } from "./chunk-FJRPC4VR.js";
10
+ } from "./chunk-XSTWBVLT.js";
11
11
  import {
12
12
  DEPRECATED_TOOL_ALIASES,
13
13
  TOOL_FEATURE_MAP,
14
14
  toolMatchesFeatures
15
- } from "./chunk-PHTWQKFE.js";
15
+ } from "./chunk-XRH7NB34.js";
16
16
 
17
17
  // src/server.ts
18
18
  import { AsyncLocalStorage } from "async_hooks";
19
+ import { readFileSync as readFileSync2 } from "fs";
20
+ import { join as join2 } from "path";
19
21
  import { McpServer } from "@modelcontextprotocol/server";
20
22
  import { z } from "zod";
21
23
  import { createLogger } from "@mushi-mushi/core";
@@ -512,6 +514,15 @@ var MUSHI_DOCS_INDEX = [
512
514
  headings: ["Refresh and status", "Diagram and list", 'What "not connected" means', "Side panel", "Risk checks", "Related"],
513
515
  excerpt: "The App blueprint page in the Mushi Mushi console shows what this app is built from, the state of each part, and the draft pull request a change opens."
514
516
  },
517
+ {
518
+ title: "Release kits",
519
+ url: docUrl("/admin/release-kits"),
520
+ route: "/admin/release-kits",
521
+ markdown: "admin/release-kits.md",
522
+ keywords: ["admin", "release-kits", "release", "kits"],
523
+ headings: ["Record clips (opt-in)", "Make the product video", "Put media on the stores (approval first)"],
524
+ excerpt: "A release kit gathers a release's screenshots, flow clips, changelog and brand colours for a product video, and store media you approve."
525
+ },
515
526
  {
516
527
  title: "Releases",
517
528
  url: docUrl("/admin/releases"),
@@ -575,6 +586,15 @@ var MUSHI_DOCS_INDEX = [
575
586
  headings: ["How it works", "Add the workflow", "What the action does", "Private registries", "Pinning", "Why Mushi Mushi does not write the lockfile or the workflow\u2026", "Limits"],
576
587
  excerpt: "Add one workflow to your repo so Mushi Mushi's SDK upgrade PRs arrive with a refreshed lockfile and pass npm ci or pnpm install --frozen-lockfile."
577
588
  },
589
+ {
590
+ title: "Security proof",
591
+ url: docUrl("/admin/security-proof"),
592
+ route: "/admin/security-proof",
593
+ markdown: "admin/security-proof.md",
594
+ keywords: ["admin", "security-proof", "security", "proof"],
595
+ headings: ["Add the workflow", "How a release is proven", "What becomes a bug", "From an agent"],
596
+ excerpt: "Each release's Security proof: the scans your own CI ran for the commit it ships. Dependencies, secrets, an optional AI review, a live scan."
597
+ },
578
598
  {
579
599
  title: "Settings",
580
600
  url: docUrl("/admin/settings"),
@@ -638,6 +658,15 @@ var MUSHI_DOCS_INDEX = [
638
658
  headings: ["Plans", "Roles", "Invitation Flow"],
639
659
  excerpt: "How teams work in Mushi Mushi. Organizations own projects, billing, invitations and the member roster, and project access comes from membership."
640
660
  },
661
+ {
662
+ title: "Timeline",
663
+ url: docUrl("/admin/timeline"),
664
+ route: "/admin/timeline",
665
+ markdown: "admin/timeline.md",
666
+ keywords: ["admin", "timeline"],
667
+ headings: ["Pin each release's screens", "From your editor"],
668
+ excerpt: "The Timeline shows your app release by release: bugs fixed, screens improved, scores, AI cost and a before/after of every screen."
669
+ },
641
670
  {
642
671
  title: "All users",
643
672
  url: docUrl("/admin/users"),
@@ -1949,7 +1978,7 @@ var MUSHI_DOCS_INDEX = [
1949
1978
  route: "/sdks/theming",
1950
1979
  markdown: "sdks/theming.md",
1951
1980
  keywords: ["sdks", "theming", "bug", "widget"],
1952
- headings: ["Three easy ways", "1. Script tag (Lovable, Bolt, plain HTML)", "2. In code", "3. In the console", "What can be set where", "CSS tokens", "Contrast rule", "Route rules"],
1981
+ headings: ["Three easy ways", "1. Script tag (Lovable, Bolt, plain HTML)", "2. In code", "3. In the console", "What can be set where", "CSS tokens", "Report type colours", "Contrast rule"],
1953
1982
  excerpt: "Match the Mushi Mushi bug widget to your app: accent, theme, corner, language and hidden pages from a script tag, code or the console, plus 13 CSS tokens."
1954
1983
  },
1955
1984
  {
@@ -2372,6 +2401,92 @@ function safeStringify(value) {
2372
2401
  }
2373
2402
  }
2374
2403
 
2404
+ // src/ux-captures.ts
2405
+ import { closeSync, existsSync, fstatSync, openSync, readdirSync, readFileSync, readSync, statSync } from "fs";
2406
+ import { join } from "path";
2407
+ var UX_CAPTURE_MAX_PAGES = 60;
2408
+ var UX_CAPTURE_MAX_PNG_BYTES = 8 * 1024 * 1024;
2409
+ var PNG_SIG = [137, 80, 78, 71, 13, 10, 26, 10];
2410
+ function sizeAndHead(file) {
2411
+ const fd = openSync(file, "r");
2412
+ try {
2413
+ const head = Buffer.alloc(32);
2414
+ const n = readSync(fd, head, 0, 32, 0);
2415
+ return { size: fstatSync(fd).size, head: head.subarray(0, n) };
2416
+ } finally {
2417
+ closeSync(fd);
2418
+ }
2419
+ }
2420
+ function pngDimensions(bytes) {
2421
+ if (bytes.length < 24 || PNG_SIG.some((b, i) => bytes[i] !== b)) return null;
2422
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
2423
+ const width = view.getUint32(16);
2424
+ const height = view.getUint32(20);
2425
+ return width > 0 && height > 0 ? { width, height } : null;
2426
+ }
2427
+ var clampDim = (n) => Math.max(200, Math.min(4e3, Math.round(n)));
2428
+ function pathFor(name) {
2429
+ const slug = name.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-");
2430
+ return `/${slug || "screen"}`.slice(0, 500);
2431
+ }
2432
+ function readCapturePages(dir) {
2433
+ const root = join(dir, "pages");
2434
+ if (!existsSync(root)) throw new Error(`No ${root} folder: put each screen in <dir>/pages/<screen>/settled.png.`);
2435
+ const out = [];
2436
+ for (const name of readdirSync(root).sort()) {
2437
+ const folder = join(root, name);
2438
+ if (!statSync(folder).isDirectory()) continue;
2439
+ const shots = ["early", "settled"].filter((s) => existsSync(join(folder, `${s}.png`)));
2440
+ if (!shots.length) continue;
2441
+ let dims = null;
2442
+ for (const s of shots) {
2443
+ const file = join(folder, `${s}.png`);
2444
+ const { size, head } = sizeAndHead(file);
2445
+ if (size > UX_CAPTURE_MAX_PNG_BYTES) throw new Error(`${file} is over 8 MB.`);
2446
+ const d = pngDimensions(head);
2447
+ if (!d) throw new Error(`${file} is not a PNG.`);
2448
+ dims = d;
2449
+ }
2450
+ let given = {};
2451
+ const factsFile = join(folder, "facts.json");
2452
+ if (existsSync(factsFile)) {
2453
+ try {
2454
+ given = JSON.parse(readFileSync(factsFile, "utf8"));
2455
+ } catch {
2456
+ throw new Error(`${factsFile} is not valid JSON.`);
2457
+ }
2458
+ }
2459
+ const path = typeof given.path === "string" && given.path.startsWith("/") ? given.path : pathFor(typeof given.key === "string" ? given.key : name);
2460
+ const key = typeof given.key === "string" && given.key ? given.key : path;
2461
+ const gv = given.viewport;
2462
+ const viewport = gv && typeof gv.width === "number" && typeof gv.height === "number" ? { width: clampDim(gv.width), height: clampDim(gv.height) } : dims ? { width: clampDim(dims.width), height: clampDim(dims.height) } : { width: 390, height: 844 };
2463
+ const label = typeof given.label === "string" && given.label ? given.label : name.replace(/[-_]+/g, " ");
2464
+ out.push({
2465
+ folder,
2466
+ shots: [...shots],
2467
+ facts: {
2468
+ title: label,
2469
+ headings: [],
2470
+ text: "",
2471
+ controls: [],
2472
+ settleMs: null,
2473
+ axe: null,
2474
+ overflowX: false,
2475
+ consoleErrors: 0,
2476
+ cls: 0,
2477
+ ...given,
2478
+ key,
2479
+ path,
2480
+ label,
2481
+ viewport
2482
+ }
2483
+ });
2484
+ }
2485
+ if (!out.length) throw new Error(`No screenshots in ${root}.`);
2486
+ if (out.length > UX_CAPTURE_MAX_PAGES) throw new Error(`${out.length} screens; one upload takes at most ${UX_CAPTURE_MAX_PAGES}.`);
2487
+ return out;
2488
+ }
2489
+
2375
2490
  // src/key-scopes.ts
2376
2491
  function mcpKeyLoginCommand(projectId) {
2377
2492
  return `npx mushi-mushi login${projectId ? ` --project-id ${projectId}` : ""}`;
@@ -3807,6 +3922,83 @@ function createMushiServer(config) {
3807
3922
  return jsonText(await apiCall(`/v1/admin/orgs/${org}/connector-actions`, { method: "POST", body: JSON.stringify(body) }));
3808
3923
  }
3809
3924
  );
3925
+ server.registerTool(
3926
+ "get_security_proof",
3927
+ {
3928
+ title: titleOf("get_security_proof"),
3929
+ description: descOf("get_security_proof"),
3930
+ annotations: annotationsFor("get_security_proof"),
3931
+ inputSchema: z.object({
3932
+ projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted"),
3933
+ releaseId: z.string().uuid().optional().describe("Release UUID; its pinned commit is the one proven"),
3934
+ commitSha: z.string().regex(/^[0-9a-fA-F]{7,40}$/).optional().describe("A commit to prove instead of a release")
3935
+ })
3936
+ },
3937
+ async (args) => {
3938
+ const pid = await resolveProjectId(args.projectId);
3939
+ const q = new URLSearchParams();
3940
+ if (args.releaseId) q.set("release", args.releaseId);
3941
+ if (args.commitSha) q.set("commit", args.commitSha);
3942
+ const qs = q.toString();
3943
+ return jsonText(await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/security-proof${qs ? `?${qs}` : ""}`));
3944
+ }
3945
+ );
3946
+ server.registerTool(
3947
+ "export_release_kit",
3948
+ {
3949
+ title: titleOf("export_release_kit"),
3950
+ description: descOf("export_release_kit"),
3951
+ annotations: annotationsFor("export_release_kit"),
3952
+ inputSchema: z.object({
3953
+ projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted"),
3954
+ releaseId: z.string().uuid().describe("Release UUID (list releases in the console or with get_release_calendar)")
3955
+ })
3956
+ },
3957
+ async (args) => {
3958
+ const pid = await resolveProjectId(args.projectId);
3959
+ return jsonText(await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/releases/${encodeURIComponent(args.releaseId)}/kit/export`, { method: "POST", body: "{}" }));
3960
+ }
3961
+ );
3962
+ server.registerTool(
3963
+ "request_store_media_upload",
3964
+ {
3965
+ title: titleOf("request_store_media_upload"),
3966
+ description: descOf("request_store_media_upload"),
3967
+ annotations: annotationsFor("request_store_media_upload"),
3968
+ inputSchema: z.object({
3969
+ projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted"),
3970
+ releaseId: z.string().uuid().describe("Release UUID whose kit holds the assets"),
3971
+ connectorId: z.string().uuid().describe("App Store Connect or Google Play connector bound to the app (list_connectors)"),
3972
+ action: z.enum(["upload_screenshots", "upload_app_preview", "upload_listing_images", "set_promo_video"]),
3973
+ locale: z.string().min(2).max(20).describe("Store language, e.g. en-US"),
3974
+ displayType: z.string().max(40).optional().describe("upload_screenshots: e.g. APP_IPHONE_67, APP_IPAD_PRO_3GEN_129"),
3975
+ previewType: z.string().max(40).optional().describe("upload_app_preview: e.g. IPHONE_67"),
3976
+ imageType: z.string().max(40).optional().describe("upload_listing_images: phoneScreenshots, featureGraphic, icon, \u2026"),
3977
+ replace: z.boolean().optional().describe("upload_listing_images: clear that image type for the language first"),
3978
+ youtubeUrl: z.string().url().max(200).optional().describe("set_promo_video: the published YouTube video"),
3979
+ previewFrameTimeCode: z.string().regex(/^\d{2}:\d{2}:\d{2}:\d{2}$/).optional().describe("upload_app_preview: poster frame, e.g. 00:00:05:00"),
3980
+ assetIds: z.array(z.string().uuid()).max(10).optional().describe("Kit asset ids to upload"),
3981
+ reason: z.string().max(500).optional().describe("Why, shown to the approver")
3982
+ })
3983
+ },
3984
+ async (args) => {
3985
+ const pid = await resolveProjectId(args.projectId);
3986
+ const body = {
3987
+ connectorId: args.connectorId,
3988
+ action: args.action,
3989
+ locale: args.locale,
3990
+ displayType: args.displayType,
3991
+ previewType: args.previewType,
3992
+ imageType: args.imageType,
3993
+ replace: args.replace,
3994
+ youtubeUrl: args.youtubeUrl,
3995
+ previewFrameTimeCode: args.previewFrameTimeCode,
3996
+ assetIds: args.assetIds ?? [],
3997
+ reason: args.reason
3998
+ };
3999
+ return jsonText(await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/releases/${encodeURIComponent(args.releaseId)}/kit/store-upload`, { method: "POST", body: JSON.stringify(body) }));
4000
+ }
4001
+ );
3810
4002
  server.registerTool(
3811
4003
  "get_store_status",
3812
4004
  {
@@ -3930,6 +4122,70 @@ function createMushiServer(config) {
3930
4122
  return jsonText(await apiCall(`/v1/admin/code-health?${qs}`));
3931
4123
  }
3932
4124
  );
4125
+ server.registerTool(
4126
+ "get_timeline",
4127
+ {
4128
+ title: titleOf("get_timeline"),
4129
+ description: descOf("get_timeline"),
4130
+ annotations: annotationsFor("get_timeline"),
4131
+ inputSchema: z.object({
4132
+ projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted")
4133
+ })
4134
+ },
4135
+ async (args) => {
4136
+ const pid = await resolveProjectId(args.projectId);
4137
+ return jsonText(await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/timeline?compact=1`));
4138
+ }
4139
+ );
4140
+ server.registerTool(
4141
+ "get_surface_history",
4142
+ {
4143
+ title: titleOf("get_surface_history"),
4144
+ description: descOf("get_surface_history"),
4145
+ annotations: annotationsFor("get_surface_history"),
4146
+ inputSchema: z.object({
4147
+ surfaceKey: z.string().regex(/^[a-z0-9][a-z0-9-]{0,119}$/).describe("A screen key from get_timeline's surfaces[].key"),
4148
+ projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted")
4149
+ })
4150
+ },
4151
+ async (args) => {
4152
+ const pid = await resolveProjectId(args.projectId);
4153
+ return jsonText(await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/timeline/surfaces/${encodeURIComponent(args.surfaceKey)}`));
4154
+ }
4155
+ );
4156
+ server.registerTool(
4157
+ "get_ux_run",
4158
+ {
4159
+ title: titleOf("get_ux_run"),
4160
+ description: descOf("get_ux_run"),
4161
+ annotations: annotationsFor("get_ux_run"),
4162
+ inputSchema: z.object({
4163
+ runId: z.string().regex(/^[0-9]{8}-[0-9]{6}-[a-z0-9]{4}$/).describe("Local run id, e.g. 20261127-091500-ab3d (get_timeline points[].runs)"),
4164
+ projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted")
4165
+ })
4166
+ },
4167
+ async (args) => {
4168
+ const pid = await resolveProjectId(args.projectId);
4169
+ return jsonText(await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/ux-runs/${encodeURIComponent(args.runId)}`));
4170
+ }
4171
+ );
4172
+ server.registerTool(
4173
+ "start_ux_run",
4174
+ {
4175
+ title: titleOf("start_ux_run"),
4176
+ description: descOf("start_ux_run"),
4177
+ annotations: annotationsFor("start_ux_run"),
4178
+ inputSchema: z.object({
4179
+ kind: z.enum(["scorecard", "loop"]).optional().describe("scorecard (score every page, default) or loop (a coding agent improves screens)"),
4180
+ projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted")
4181
+ })
4182
+ },
4183
+ async (args) => {
4184
+ const pid = await resolveProjectId(args.projectId);
4185
+ const qs = new URLSearchParams({ kind: args.kind ?? "scorecard" });
4186
+ return jsonText(await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/timeline/run-plan?${qs}`));
4187
+ }
4188
+ );
3933
4189
  const CI_ADVICE_OUTPUT = z.looseObject({
3934
4190
  id: z.string(),
3935
4191
  severity: z.string(),
@@ -6015,6 +6271,133 @@ function createMushiServer(config) {
6015
6271
  return jsonText({ ...data, next: journeyRecordingNextOf(checked.body.hours) });
6016
6272
  }
6017
6273
  );
6274
+ const UX_PLATFORMS = ["ios", "android", "flutter", "react_native", "capacitor", "web", "other"];
6275
+ const UX_SOURCES = ["maestro", "adb", "simctl", "sdk", "playwright", "other"];
6276
+ server.registerTool(
6277
+ "upload_ux_captures",
6278
+ {
6279
+ title: titleOf("upload_ux_captures"),
6280
+ description: descOf("upload_ux_captures"),
6281
+ annotations: annotationsFor("upload_ux_captures"),
6282
+ inputSchema: z.object({
6283
+ projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted"),
6284
+ platform: z.enum(UX_PLATFORMS).describe("What the screens are from"),
6285
+ device: z.string().max(120).optional().describe('The device or simulator, e.g. "Pixel 8 (API 35)"'),
6286
+ source: z.enum(UX_SOURCES).optional().describe("The driver that captured them"),
6287
+ app: z.string().max(120).optional().describe("What to call the app"),
6288
+ viewport: z.string().optional().describe("WIDTHxHEIGHT, e.g. 390x844 (default: the first screen)"),
6289
+ maxCostUsd: z.number().min(0.05).max(20).optional().describe("The most the run may spend on server scoring"),
6290
+ pages: z.array(z.object({ facts: z.record(z.string(), z.unknown()), shots: z.array(z.enum(["early", "settled"])).min(1).max(2) })).max(60).optional().describe("The screens: { facts, shots }. Omit when dir is given."),
6291
+ dir: z.string().optional().describe("stdio only: a folder with pages/<screen>/settled.png (+ early.png, facts.json); uploads the PNGs too"),
6292
+ score: z.boolean().optional().describe("With dir: score each screen, group the causes and close the run")
6293
+ })
6294
+ },
6295
+ async (args) => {
6296
+ const pid = await resolveProjectId(args.projectId);
6297
+ if (!args.dir && !args.pages?.length) throw new MushiApiError(400, "INVALID_PARAMS", "Give pages, or dir on this stdio server.");
6298
+ const local = args.dir ? readCapturePages(args.dir) : null;
6299
+ const pages = local ? local.map((p) => ({ facts: p.facts, shots: p.shots })) : args.pages ?? [];
6300
+ const created = await apiCall("/v1/ux/captures", {
6301
+ method: "POST",
6302
+ body: JSON.stringify({
6303
+ projectId: pid,
6304
+ platform: args.platform,
6305
+ ...args.device ? { device: args.device } : {},
6306
+ ...args.source ? { source: args.source } : {},
6307
+ ...args.app ? { app: args.app } : {},
6308
+ ...args.viewport ? { viewport: args.viewport } : {},
6309
+ ...args.maxCostUsd !== void 0 ? { maxCostUsd: args.maxCostUsd } : {},
6310
+ pages
6311
+ })
6312
+ });
6313
+ if (!local) return jsonText(created);
6314
+ const byKey = new Map(local.map((p) => [p.facts.key, p]));
6315
+ const names = /* @__PURE__ */ new Map();
6316
+ for (const u of created.uploads ?? []) {
6317
+ const p = byKey.get(u.page);
6318
+ if (!p) continue;
6319
+ const shot = u.name.endsWith("/early.png") ? "early" : "settled";
6320
+ const put = await doFetch(u.signedUrl, { method: "PUT", headers: { "Content-Type": "image/png" }, body: new Uint8Array(readFileSync2(join2(p.folder, `${shot}.png`))) });
6321
+ if (!put.ok) throw new MushiApiError(502, "UPLOAD_FAILED", `Screenshot ${u.name} not uploaded (storage answered ${put.status}). The run is ${created.runId}.`);
6322
+ names.set(u.page, [...names.get(u.page) ?? [], u.name]);
6323
+ }
6324
+ if (!args.score) return jsonText({ ...created, uploaded: [...names.values()].flat().length });
6325
+ const base = `/v1/admin/projects/${encodeURIComponent(pid)}/ux-scorecard/${created.runId}`;
6326
+ const scores = /* @__PURE__ */ new Map();
6327
+ const errors = [];
6328
+ for (const p of local) {
6329
+ try {
6330
+ const r = await apiCall(`${base}/score`, { method: "POST", body: JSON.stringify({ facts: p.facts, shots: names.get(p.facts.key) ?? [], app: args.app ?? "this app" }) });
6331
+ if (r.score) scores.set(p.facts.key, r.score);
6332
+ } catch (err) {
6333
+ errors.push(`${p.facts.key}: ${err instanceof Error ? err.message : String(err)}`);
6334
+ }
6335
+ }
6336
+ let causes = [];
6337
+ try {
6338
+ causes = (await apiCall(`${base}/group`, { method: "POST", body: "{}" })).causes ?? [];
6339
+ } catch (err) {
6340
+ errors.push(`grouping: ${err instanceof Error ? err.message : String(err)}`);
6341
+ }
6342
+ const vp = args.viewport ?? `${local[0].facts.viewport.width}x${local[0].facts.viewport.height}`;
6343
+ await apiCall(base, {
6344
+ method: "PUT",
6345
+ body: JSON.stringify({
6346
+ status: "done",
6347
+ viewport: vp,
6348
+ scored_by: "server",
6349
+ started_at: (/* @__PURE__ */ new Date()).toISOString(),
6350
+ finished_at: (/* @__PURE__ */ new Date()).toISOString(),
6351
+ pages: local.map((p) => ({ facts: p.facts, score: scores.get(p.facts.key) ?? null, shots: names.get(p.facts.key) ?? [], ...scores.has(p.facts.key) ? {} : { error: "Not scored." } })),
6352
+ causes
6353
+ })
6354
+ });
6355
+ const overall = [...scores.values()].map((s) => s.overall ?? 0);
6356
+ return jsonText({ runId: created.runId, reservedUsd: created.reservedUsd, scored: scores.size, pages: local.length, mean: overall.length ? Math.round(overall.reduce((a, b) => a + b, 0) / overall.length * 10) / 10 : null, causes: causes.length, errors, next: created.next });
6357
+ }
6358
+ );
6359
+ server.registerTool(
6360
+ "list_personas",
6361
+ {
6362
+ title: titleOf("list_personas"),
6363
+ description: descOf("list_personas"),
6364
+ annotations: annotationsFor("list_personas"),
6365
+ inputSchema: PROJECT_ID_INPUT
6366
+ },
6367
+ async (args) => {
6368
+ const pid = await resolveProjectId(args.projectId);
6369
+ return jsonText(await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/personas`));
6370
+ }
6371
+ );
6372
+ server.registerTool(
6373
+ "start_fresh_eyes",
6374
+ {
6375
+ title: titleOf("start_fresh_eyes"),
6376
+ description: descOf("start_fresh_eyes"),
6377
+ annotations: annotationsFor("start_fresh_eyes"),
6378
+ inputSchema: z.object({
6379
+ projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted"),
6380
+ personaId: z.string().optional().describe("A persona id from list_personas"),
6381
+ url: z.string().max(500).optional().describe("The start page (default: the app's known address)"),
6382
+ goal: z.string().max(300).optional().describe("What the visitor came to do (default: the persona's goal, else the last one)"),
6383
+ sessions: z.number().int().min(1).max(5).optional().describe("Visitors, 1-5 (default 3)"),
6384
+ successText: z.string().max(120).optional().describe("Words on screen that mean the goal was reached"),
6385
+ dryRun: z.boolean().optional().describe("Look around only and file nothing")
6386
+ })
6387
+ },
6388
+ async (args) => {
6389
+ const pid = await resolveProjectId(args.projectId);
6390
+ const body = {
6391
+ ...args.personaId ? { personaId: args.personaId } : {},
6392
+ ...args.url ? { url: args.url } : {},
6393
+ ...args.goal ? { goal: args.goal } : {},
6394
+ ...args.sessions !== void 0 ? { sessions: args.sessions } : {},
6395
+ ...args.successText ? { successText: args.successText } : {},
6396
+ ...args.dryRun !== void 0 ? { dryRun: args.dryRun } : {}
6397
+ };
6398
+ return jsonText(await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/fresh-eyes`, { method: "POST", body: JSON.stringify(body) }));
6399
+ }
6400
+ );
6018
6401
  server.registerResource(
6019
6402
  "activation_status",
6020
6403
  "mushi://activation",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mushi-mushi/mcp",
3
3
  "mcpName": "io.github.kensaurus/mushi-mushi",
4
- "version": "0.32.1",
4
+ "version": "0.33.0",
5
5
  "license": "MIT",
6
6
  "description": "MCP server for Cursor, Claude Code and Copilot. One place to improve AI-built apps: fix bugs, smooth user journeys and clean up the code.",
7
7
  "type": "module",
@@ -45,7 +45,7 @@
45
45
  "@modelcontextprotocol/core": "^2.3.1",
46
46
  "@modelcontextprotocol/server": "^2.3.1",
47
47
  "zod": "^4.6.7",
48
- "@mushi-mushi/core": "^1.39.0"
48
+ "@mushi-mushi/core": "^1.40.1"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@sentry/node": "^10.57.0"