@mushi-mushi/mcp 0.29.2 → 0.30.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
@@ -380,6 +380,24 @@ var TOOL_CATALOG = [
380
380
  returnsUntrusted: true,
381
381
  useCase: "What does my CI cost, and would it be cheaper or faster on my own machine?"
382
382
  },
383
+ {
384
+ name: "get_ci_bill",
385
+ title: "Real GitHub Actions bill",
386
+ description: 'Return what GitHub actually charged for Actions, read from GitHub\'s billing usage API by the CI collector once a day (or pushed with `mushi runner bill --push`). Unlike get_ci_costs, these money figures are measured, not estimated. Returns { window, previousWindow, provenance: "measured", currency: "USD", available, repoScoped (true when you are not a member of the organization: only your projects\' repos are shown), unavailableReason (why there is no bill and how to connect one), owners [{ owner, ownerType, lastOkAt, lastAttemptAt, lastError, lastSource (api | cli), coveredFrom }], month { label, grossUsd, discountUsd, netUsd } (this calendar month so far), totals { grossUsd, discountUsd, netUsd, minutes }, previousTotals and change { netUsd, netPct } (null unless Mushi holds the whole previous period), windowComplete, byRepo [{ repo, netUsd, grossUsd, discountUsd, minutes }], bySku, byDay (every day of the window), dataThrough, agentShare { share, billedMinutes, agentBilledMinutes, branches, provenance: "estimated" } (paid GitHub-hosted minutes on Mushi agent branches, from the jobs Mushi recorded) }. Net is what was charged; public repos and included minutes show as discount. Optional projectId (default: the configured project; an account-level key with none reads every project) and days (1-90, default 30). Read-only.',
387
+ scope: "mcp:read",
388
+ hints: { readOnly: true, idempotent: true, openWorld: true },
389
+ returnsUntrusted: true,
390
+ useCase: "What did GitHub Actions actually cost me this month, and which repo or agent drove it?"
391
+ },
392
+ {
393
+ name: "get_worker_status",
394
+ title: "Local worker status and problems",
395
+ description: "Return your local workers (`mushi work --daemon`, ADR 0048) as the console's Pipeline \u2192 Workers tab shows them: flags first, worst first (ADR 0048 amendment 2026-10-28), then machines and lanes. A flag is one way a worker stopped doing useful work, in plain words: host_offline, machine_not_ready (a lane's clone is not a git clone), run_stuck (a run has held an agent space over 45 minutes, with its stage: prepare, agent, commit = the repo's commit hook, push = its pre-push hook, pr, and its last log lines), lanes_waiting (lanes waited over 15 minutes for an agent space, naming the runs that hold them), account_check (the Cursor account check: another account, signed out, missing, or timed out), gh_signed_out, machine_waiting (memory, GitHub quota or sign-in guard), machine_busy (load per core 2 or more), hook_failures (2+ runs of a lane failed in the repo's git hooks in 24 h), unmanaged_run (a `mushi work` run no worker claims has run over 45 minutes) and credits_idle (no agent work for 2 hours while Cursor credits expire within 7 days, with what blocks the work). Each flag has { id, kind, severity (danger | warn), hostname, laneName, title, cause, sinceSec, stage, log, actions [{ kind (stop_run | pause_lane | open_report | open_pr | copy_command | recheck_account | switch_account | open_page), label, command? }] }; stopping a run, pausing a lane, re-checking the account and switching the Cursor account (a sign-in link only the owner of the machine sees) happen in the console. Log lines are cleaned on the machine and on the server (no keys, tokens, e-mails or paths) but are still text from a machine and its repos. Returns { generatedAt, flags, projects, hosts [{ id, hostname, platform, online, lastHeartbeatAt, status (state, agents, maxAgents, memAvailableGb, load1, cpus, checks, slots, waitWhy), guards, revoked, mine, cursorAccount (in full only on your own machines), cursorLogin (the last account switch: state, never its link), canSwitchAccount }], lanes [{ id, hostId, projectId, projectName, name, config, status (state, counters, inflight runs), active, queue, recent, counts7d }] }. Optional projectId (default: the configured project; an account-level key with none reads every project). Read-only.",
396
+ scope: "mcp:read",
397
+ hints: { readOnly: true, idempotent: true, openWorld: false },
398
+ returnsUntrusted: true,
399
+ useCase: "Why did my local worker lanes stop fixing bugs, and which run is stuck where?"
400
+ },
383
401
  {
384
402
  name: "request_ci_placement_change",
385
403
  title: "Ask to change where CI runs (needs approval)",
@@ -389,6 +407,42 @@ var TOOL_CATALOG = [
389
407
  returnsUntrusted: true,
390
408
  useCase: "Ask to run yen-yen's PR jobs on the Alienware runner instead of paid GitHub minutes, for a person to approve."
391
409
  },
410
+ {
411
+ name: "open_ci_cost_fix",
412
+ title: "Open a CI cost fix PR (draft)",
413
+ description: "Open a DRAFT pull request that applies one CI cost fix to one workflow file (ADR 0047), the fix a CI advice item offers as autofix (get_ci_overview / get_ci_costs advice[].autofix { kind, projectId, repo, workflowPath }). kind: add_concurrency (a concurrency group that cancels superseded pull request runs, never a push), skip_drafts (ready_for_review added to the pull_request types and every job skips drafts), weekly_cron (a schedule that fires more than weekly runs once a week), ignore_docs_paths (paths-ignore for docs-only changes, Markdown, docs/, license and issue templates, on pull_request and push; refused when a job looks like a required check, because a skipped workflow never reports and the PR could not merge). The repo must be connected to the project. Mushi reads the workflow from the default branch, edits only that file (comments kept), opens the PR as a draft with a conventional ci: title, and records the workflow's billed minutes per day for the 14 days before; nothing changes until a person reviews, readies and merges it. The job runs in the background: read it again with the job id (GET /v1/admin/ci/cost-fixes/{id}, or `mushi runner fix-status`); after the merge it shows the saving measured per day. Writing a workflow file needs the GitHub App's Workflows: Read and write permission or a token with the workflow scope. Confirm with the user first. Returns { job: { id, status (queued | running | pr_opened | no_change | refused | failed), summary, errorCode, error, prUrl, baseline, measured, saving } }, or an error (REPO_NOT_IN_PROJECT, PR_ALREADY_OPEN with the job, COST_FIX_IN_PROGRESS, RATE_LIMITED: 10 an hour per project). Write.",
414
+ scope: "mcp:write",
415
+ hints: { readOnly: false, destructive: false, idempotent: false, openWorld: true },
416
+ returnsUntrusted: true,
417
+ useCase: "Stop glot.it's CI from running on draft agent PRs: open the skip-drafts fix for ci.yml as a draft PR to review."
418
+ },
419
+ {
420
+ name: "preview_ci_cost_fix_rollout",
421
+ title: "Preview CI cost fixes for every app",
422
+ description: "Preview 'Apply to every app' for the CI cost fixes (ADR 0047 amendment): every CI advice item that carries an autofix, across the apps this key may change (viewers' apps are left out), grouped per app and repo, so each repo can get ONE draft pull request (one CI run) for all its fixes. Per repo { projectId, projectName, repo, items [{ key, workflowPath, kind (add_concurrency | skip_drafts | weekly_cron | ignore_docs_paths), title, evidence, monthSavingUsd (estimated USD per 30 days, null when Mushi cannot price it), state (ready | pr_open | in_progress), prUrl }], readyItems, monthSavingUsd (the ready items' priced saving), unpricedItems, block (set when Mushi already knows the repo's GitHub access cannot edit workflow files: GITHUB_WORKFLOWS_WRITE_MISSING, from the setup check or the last attempt) }, largest saving first, plus totals, caps { reposPerRequest: 10, itemsPerRepo: 20 } and partial (set when part of the advice could not be read). Optional projectId limits it to one app; an account-level key with none reads every app. Read-only: it changes nothing. Open them with apply_ci_cost_fix_rollout.",
423
+ scope: "mcp:read",
424
+ hints: { readOnly: true, idempotent: true, openWorld: true },
425
+ returnsUntrusted: true,
426
+ useCase: "Which CI cost fixes can Mushi open across all my apps, and what would each repo save?"
427
+ },
428
+ {
429
+ name: "apply_ci_cost_fix_rollout",
430
+ title: "Open CI cost fixes for every app (one draft PR per repo)",
431
+ description: "Open the CI cost fixes from preview_ci_cost_fix_rollout as ONE draft pull request per repo (ADR 0047 amendment), so each repo runs CI once for all its fixes instead of once per fix. repos: [{ projectId, repo, items: [{ workflowPath, kind }] }], at most 10 repos and 20 items each (pass the preview's ready items). Mushi rebuilds the advice itself and opens only items it still advises (evidence and saving come from the server), skips an edit whose PR is still open or that is being opened, and counts each repo once against its project's 10 CI fix PRs an hour. In each repo it reads every workflow once, applies the kinds in turn with the same refusals as open_ci_cost_fix, and opens one draft PR with a ci: title whose body lists each change and each refusal; a refused item is never dropped, and when every item is refused no PR is opened. Nothing changes until a person reviews, readies and merges the PR. Needs the GitHub App's Workflows: Read and write permission (or a token with the workflow scope). Confirm with the user first. Returns { queued, results [{ projectId, repo, status (queued | skipped | error), bundleId, jobs, skipped [{ workflowPath, kind, code (NOT_ADVISED | PR_ALREADY_OPEN | COST_FIX_IN_PROGRESS), message, prUrl }], error { code (NOT_FOUND | FORBIDDEN | REPO_NOT_IN_PROJECT | RATE_LIMITED | COST_FIX_IN_PROGRESS | MIGRATION_PENDING), message } }] }. Follow each bundle with get_ci_cost_fix_bundle. Write.",
432
+ scope: "mcp:write",
433
+ hints: { readOnly: false, destructive: false, idempotent: false, openWorld: true },
434
+ returnsUntrusted: true,
435
+ useCase: "Open every advised CI cost fix across my apps, one reviewed draft PR per repo."
436
+ },
437
+ {
438
+ name: "get_ci_cost_fix_bundle",
439
+ title: "CI cost fix bundle (one PR, several fixes)",
440
+ description: "Read one CI cost fix bundle (one draft PR for several fixes in one repo, from apply_ci_cost_fix_rollout) by its bundleId: { bundle: { id, projectId, repo, status (queued | running | pr_opened | nothing_opened | failed), prUrl, prNumber, items (each fix: workflowPath, kind, status, summary, error, prUrl, baseline, measured, saving), measuredUsdPerMonth (after the merge: the saving measured per workflow, each workflow once) } }. After the merge it reads GitHub once and stores the minutes per day since. Read-only on GitHub.",
441
+ scope: "mcp:read",
442
+ hints: { readOnly: true, idempotent: true, openWorld: true },
443
+ returnsUntrusted: true,
444
+ useCase: "Did the CI fix PR for glot.it open, which fixes were refused, and what did it save after the merge?"
445
+ },
392
446
  {
393
447
  name: "explain_finding",
394
448
  title: "Explain one finding",
@@ -961,7 +1015,7 @@ var TDD_TOOL_CATALOG = [
961
1015
  {
962
1016
  name: "list_qa_story_runs",
963
1017
  title: "Recent QA story runs",
964
- description: "Return the most recent runs for a given QA story, newest first. Each row includes status (passed/failed/error/running), latency_ms, created_at, error_message headline, and assertion_failures (up to 10). Use this to understand whether a story is currently healthy, what the last failure was, and whether a manual run has completed.",
1018
+ description: "Return the most recent runs for a given QA story, newest first. Each row includes status (passed/failed/error/running), latency_ms, created_at, error_message headline, and assertion_failures (up to 10). Optional projectId (project_id is accepted too) defaults to the configured project. An account-level key passes the project the story belongs to; a project-bound key refuses a different project. Use this to understand whether a story is currently healthy, what the last failure was, and whether a manual run has completed.",
965
1019
  scope: "mcp:read",
966
1020
  hints: { readOnly: true, idempotent: true, openWorld: true },
967
1021
  useCase: 'Show me the last 10 runs for the "home page loads" story and why they failed.'
@@ -969,7 +1023,7 @@ var TDD_TOOL_CATALOG = [
969
1023
  {
970
1024
  name: "get_qa_story_run",
971
1025
  title: "QA story run detail",
972
- description: "Fetch the full detail for a single qa_story_run: status, error_message, assertion_failures, latency_ms, provider_session_url (Browserbase replay link when available), and screenshot URLs from qa_story_evidence. Use this to drill into a specific failing run and understand the exact error before deciding whether to improve the story script or fix the app.",
1026
+ description: "Fetch the full detail for a single qa_story_run: status, error_message, assertion_failures, latency_ms, provider_session_url (Browserbase replay link when available), and screenshot URLs from qa_story_evidence. Optional projectId (project_id is accepted too) defaults to the configured project. An account-level key passes the project the story belongs to; a project-bound key refuses a different project. Use this to drill into a specific failing run and understand the exact error before deciding whether to improve the story script or fix the app.",
973
1027
  scope: "mcp:read",
974
1028
  hints: { readOnly: true, idempotent: true, openWorld: true },
975
1029
  useCase: "What exactly happened in this failed QA run? Show me the error and screenshots."
@@ -1256,7 +1310,13 @@ var FEATURE_GROUPS = [
1256
1310
  "usage",
1257
1311
  "codebase",
1258
1312
  /** Deprecated aliases kept for one release — hidden unless `legacy` or `all`. */
1259
- "legacy"
1313
+ "legacy",
1314
+ /**
1315
+ * A preset, not a group: no tool maps to it. It lists PRESET_TOOLS.vibe
1316
+ * (about a dozen tools across triage, fixes, setup and docs) for chat
1317
+ * connectors such as Lovable and for clients that cap their tool count.
1318
+ */
1319
+ "vibe"
1260
1320
  ];
1261
1321
  var DEFAULT_FEATURE_GROUPS = [
1262
1322
  "triage",
@@ -1266,7 +1326,7 @@ var DEFAULT_FEATURE_GROUPS = [
1266
1326
  "docs"
1267
1327
  ];
1268
1328
  var ALL_FEATURE_GROUPS = FEATURE_GROUPS.filter(
1269
- (g) => g !== "legacy"
1329
+ (g) => g !== "legacy" && g !== "vibe"
1270
1330
  );
1271
1331
  var TOOL_FEATURE_MAP = {
1272
1332
  // triage
@@ -1338,7 +1398,13 @@ var TOOL_FEATURE_MAP = {
1338
1398
  refresh_ci: "fixes",
1339
1399
  get_ci_overview: "fixes",
1340
1400
  get_ci_costs: "fixes",
1401
+ get_ci_bill: "fixes",
1402
+ get_worker_status: "fixes",
1341
1403
  request_ci_placement_change: "fixes",
1404
+ open_ci_cost_fix: "fixes",
1405
+ preview_ci_cost_fix_rollout: "fixes",
1406
+ apply_ci_cost_fix_rollout: "fixes",
1407
+ get_ci_cost_fix_bundle: "fixes",
1342
1408
  get_fix_verification: "fixes",
1343
1409
  reopen_report: "fixes",
1344
1410
  reply_to_reporter: "fixes",
@@ -1413,6 +1479,22 @@ var TOOL_FEATURE_MAP = {
1413
1479
  get_mushi_doc: "docs",
1414
1480
  use_mushi: "docs"
1415
1481
  };
1482
+ var PRESET_TOOLS = {
1483
+ vibe: [
1484
+ "triage_next_steps",
1485
+ "get_recent_reports",
1486
+ "search_reports",
1487
+ "get_report_detail",
1488
+ "get_fix_context",
1489
+ "transition_status",
1490
+ "reply_to_reporter",
1491
+ "file_report",
1492
+ "diagnose_setup",
1493
+ "use_mushi",
1494
+ "search_mushi_docs",
1495
+ "get_mushi_doc"
1496
+ ]
1497
+ };
1416
1498
  var DEPRECATED_TOOL_ALIASES = {
1417
1499
  // Removed deprecated tools → successor.
1418
1500
  setup_check: "diagnose_setup",
@@ -1451,6 +1533,7 @@ function toolMatchesFeatures(toolName, filter) {
1451
1533
  if (Object.prototype.hasOwnProperty.call(DEPRECATED_TOOL_ALIASES, toolName)) {
1452
1534
  return filter.includes("legacy");
1453
1535
  }
1536
+ if (filter.some((g) => PRESET_TOOLS[g]?.includes(toolName))) return true;
1454
1537
  const group = TOOL_FEATURE_MAP[toolName];
1455
1538
  return group !== void 0 && filter.includes(group);
1456
1539
  }
@@ -1489,7 +1572,7 @@ var MUSHI_DOCS_INDEX = [
1489
1572
  route: "/",
1490
1573
  markdown: "index.md",
1491
1574
  keywords: ["know", "ai-built", "app", "broke", "fix", "ready"],
1492
- headings: ["The problem it solves", "A real example from our own sites", "What this is (and is not)", "Where it stands today", "This is what a diagnosis looks like", "See it in action", "Get started", "Install it in your app"],
1575
+ headings: ["What it takes", "What this is (and is not)"],
1493
1576
  excerpt: "Your AI shipped it. Mushi tells you why it broke: a plain-English diagnosis and a ready fix in your editor. Open source, Sentry optional."
1494
1577
  },
1495
1578
  {
@@ -1498,7 +1581,7 @@ var MUSHI_DOCS_INDEX = [
1498
1581
  route: "/admin",
1499
1582
  markdown: "admin/index.md",
1500
1583
  keywords: ["admin", "console"],
1501
- headings: ["Day-to-day", "Deeper surfaces"],
1584
+ headings: ["See it", "Day-to-day", "Deeper surfaces"],
1502
1585
  excerpt: "Guide to the Mushi admin console \u2014 the reports inbox, fix drafts and PRs, plain-English queries, and a link to every deeper page of the console."
1503
1586
  },
1504
1587
  {
@@ -1543,7 +1626,7 @@ var MUSHI_DOCS_INDEX = [
1543
1626
  route: "/admin/billing",
1544
1627
  markdown: "admin/billing.md",
1545
1628
  keywords: ["admin", "billing"],
1546
- headings: ["Reading your usage card", "Usage breakdown", "Predictability controls", "Upgrading your plan", "Changing plan", "Managing payment and invoices", "CLI parity", "Related docs"],
1629
+ headings: ["Reading your usage card", "Usage breakdown", "Predictability controls", "Apps on your plan", "Upgrading your plan", "Changing plan", "Managing payment and invoices", "CLI parity"],
1547
1630
  excerpt: "The Billing page shows your diagnosis quota, usage alerts at 50% and 80%, your projected bill, and spend caps for your Mushi plan."
1548
1631
  },
1549
1632
  {
@@ -1552,8 +1635,8 @@ var MUSHI_DOCS_INDEX = [
1552
1635
  route: "/admin/checks",
1553
1636
  markdown: "admin/checks.md",
1554
1637
  keywords: ["admin", "checks"],
1555
- headings: ["App checks", "AI quality"],
1556
- excerpt: "The Checks page lists every automatic check on this app. Each card opens that check, with the same live count the sidebar shows."
1638
+ headings: ["The checks", "App checks", "AI quality"],
1639
+ excerpt: "The Checks page shows every automatic check on this app with its state, when it last ran and its open count, failing checks first."
1557
1640
  },
1558
1641
  {
1559
1642
  title: "CI runners",
@@ -1561,7 +1644,7 @@ var MUSHI_DOCS_INDEX = [
1561
1644
  route: "/admin/ci",
1562
1645
  markdown: "admin/ci.md",
1563
1646
  keywords: ["admin", "ci", "runners"],
1564
- headings: ["Test machine or your code", "Queue and wait", "Runner map", "What would make fixes land sooner", "When nothing has reported in", "Related pages"],
1647
+ headings: ["Spend less on CI", "How it reads your runs", "Test machine or your code", "Queue and wait", "Runner map", "What would make fixes land sooner", "Your real bill", "Cost advice that reads your workflows"],
1565
1648
  excerpt: "The console CI runners page shows where tests run, how long they wait for a machine, and whether a red check was your code or the test machine."
1566
1649
  },
1567
1650
  {
@@ -1633,8 +1716,8 @@ var MUSHI_DOCS_INDEX = [
1633
1716
  route: "/admin/dashboard",
1634
1717
  markdown: "admin/dashboard.md",
1635
1718
  keywords: ["admin", "dashboard"],
1636
- headings: ["What to look for first", "Flow canvas", "KPI tiles (14-day window)", "Charts row (14 days)", "Triage queue", "Insights row", "Common tasks", "Morning check (2 minutes)"],
1637
- excerpt: "The Mushi dashboard answers whether anything broke since your last release \u2014 new reports, overnight fix runs and pipeline health on one screen."
1719
+ headings: ["App card", "Health lights", "Needs you", "Release", "Pages", "Access and details", "This week vs last week", "Recent activity"],
1720
+ excerpt: "Home in the Mushi console shows how one app is doing \u2014 is it up, what needs you, what is shipping, which pages have bugs and who can reach it."
1638
1721
  },
1639
1722
  {
1640
1723
  title: "Design system",
@@ -1736,13 +1819,13 @@ var MUSHI_DOCS_INDEX = [
1736
1819
  excerpt: "The Knowledge graph page draws your project's bugs, components and fixes as an interactive graph, so you can see which areas cluster problems."
1737
1820
  },
1738
1821
  {
1739
- title: "Integration health",
1822
+ title: "Mushi health",
1740
1823
  url: docUrl("/admin/health"),
1741
1824
  route: "/admin/health",
1742
1825
  markdown: "admin/health.md",
1743
- keywords: ["admin", "health", "integration"],
1826
+ keywords: ["admin", "health"],
1744
1827
  headings: ["Time window", "LLM health summary", "Provider probes", "Cron job health", "Recent LLM calls log", "Recommended actions", "Related pages"],
1745
- excerpt: "The Integration health page monitors Mushi's LLM pipelines, cron jobs and provider connections so you catch a degraded integration early."
1828
+ excerpt: "The Mushi health page shows whether Mushi itself is working (its AI calls, background jobs and provider connections), so you catch a degraded integration early."
1746
1829
  },
1747
1830
  {
1748
1831
  title: "To-do",
@@ -1777,7 +1860,7 @@ var MUSHI_DOCS_INDEX = [
1777
1860
  route: "/admin/inventory",
1778
1861
  markdown: "admin/inventory.md",
1779
1862
  keywords: ["admin", "inventory", "user", "stories"],
1780
- headings: ["What you see", "Run gates / Run crawler", "SDK-driven discovery", "Surface mode in the graph", "Five gates", "Watch your live site", "Synthetic monitor", "Spec traceability \u2014 every fix carries the originating Action"],
1863
+ headings: ["What you see", "Check every action / Crawl the app", "SDK-driven discovery", "Surface mode in the graph", "Five gates", "Watch your live site", "Synthetic monitor", "Spec traceability \u2014 every fix carries the originating Action"],
1781
1864
  excerpt: "The User stories page manages your inventory.yaml \u2014 every page, action and story your app should have \u2014 and shows which of them the gates cover."
1782
1865
  },
1783
1866
  {
@@ -1804,7 +1887,7 @@ var MUSHI_DOCS_INDEX = [
1804
1887
  route: "/admin/lessons",
1805
1888
  markdown: "admin/lessons.md",
1806
1889
  keywords: ["admin", "lessons"],
1807
- headings: ["The lifecycle: how a report becomes a rule", "Tab: Lessons", "When to retire a lesson", "Tab: Clusters", "Tab: Query Sim", "Common tasks", "Reviewing new candidates (weekly)", "After fixing a recurring bug"],
1890
+ headings: ["The lifecycle: how a report becomes a rule", "Tab: Recurring patterns (?tab=clusters)", "Tab: Rules in use (?tab=lessons)", "When to retire a lesson", "Tab: Try a change (?tab=query)", "Common tasks", "Reviewing new patterns (weekly)", "After fixing a recurring bug"],
1808
1891
  excerpt: "The Lessons page turns repeat fixes into rules \u2014 when the same root cause keeps returning, Mushi records it so your editor sees it on the next PR."
1809
1892
  },
1810
1893
  {
@@ -1867,7 +1950,7 @@ var MUSHI_DOCS_INDEX = [
1867
1950
  route: "/admin/pipeline",
1868
1951
  markdown: "admin/pipeline.md",
1869
1952
  keywords: ["admin", "pipeline"],
1870
- headings: ["Stages", "Who opens fixes", "Stuck groups", "Release trains", "Intake and deploys"],
1953
+ headings: ["Stages", "Who opens fixes", "Stuck groups", "Release trains", "Intake and deploys", "Workers", "When a worker stops doing useful work", "Send to my local worker"],
1871
1954
  excerpt: "The console Pipeline page shows every bug from report to deploy, where it is stuck and why, with one-click fixes."
1872
1955
  },
1873
1956
  {
@@ -1948,7 +2031,7 @@ var MUSHI_DOCS_INDEX = [
1948
2031
  route: "/admin/releases",
1949
2032
  markdown: "admin/releases.md",
1950
2033
  keywords: ["admin", "releases"],
1951
- headings: ["What it generates", "Creating a release", "Release automatically when you ship", "Release entry fields", "SDK surface", "Related pages"],
2034
+ headings: ["What it generates", "Creating a release", "Release automatically when you ship", "Batch tab: what ships next", "Release entry fields", "SDK surface", "Related pages"],
1952
2035
  excerpt: "The Releases page drafts a changelog for each version from the fixes that shipped, crediting the users whose reports led to each fix."
1953
2036
  },
1954
2037
  {
@@ -2011,7 +2094,7 @@ var MUSHI_DOCS_INDEX = [
2011
2094
  route: "/admin/settings",
2012
2095
  markdown: "admin/settings.md",
2013
2096
  keywords: ["admin", "settings"],
2014
- headings: ["Tabs", "General", "BYOK (API keys)", "Firecrawl", "Browserbase", "Health", "Dev tools", "Changing a key"],
2097
+ headings: ["Tabs", "General", "BYOK (API keys)", "Firecrawl", "Browserbase", "Health", "Dev tools", "Display & sidebar"],
2015
2098
  excerpt: "The Settings page holds every project option \u2014 notifications, your own LLM keys, widget copy, Slack alerts and developer settings."
2016
2099
  },
2017
2100
  {
@@ -2083,7 +2166,7 @@ var MUSHI_DOCS_INDEX = [
2083
2166
  route: "/admin/ux-runs",
2084
2167
  markdown: "admin/ux-runs.md",
2085
2168
  keywords: ["admin", "ux-runs", "runs", "ux"],
2086
- headings: ["Run in the cloud", "What you see", "File as bug", "Audit signed-in screens", "Where the changes are"],
2169
+ headings: ["Run in the cloud", "What you see", "File as bug", "Audit signed-in screens", "First-time user test", "Where the changes are"],
2087
2170
  excerpt: "Each screen your coding agent worked on in a mushi ux run, with its plan, every attempt, before and after screenshots, and what was kept."
2088
2171
  },
2089
2172
  {
@@ -2165,7 +2248,7 @@ var MUSHI_DOCS_INDEX = [
2165
2248
  markdown: "cloud.md",
2166
2249
  keywords: ["cloud"],
2167
2250
  headings: ["Plans", "Sign-up flow", "Why metered on diagnoses", "Spend controls", "Self-hosting"],
2168
- excerpt: "Hosted Mushi Mushi \u2014 bug reports, plain-English diagnoses, and fix dispatch without running servers. Free tier includes 50 diagnoses a month."
2251
+ excerpt: "Hosted Mushi Mushi \u2014 bug reports, plain-English diagnoses, and fix dispatch without running servers. Free for one app with 100 diagnoses a month."
2169
2252
  },
2170
2253
  {
2171
2254
  title: "Compare",
@@ -2210,7 +2293,7 @@ var MUSHI_DOCS_INDEX = [
2210
2293
  markdown: "compare/sentry-vs-mushi.md",
2211
2294
  keywords: ["compare", "sentry-vs-mushi", "sentry"],
2212
2295
  headings: ["What each one is", "Side by side", "Where they overlap, and where they do not", "Running Mushi alongside Sentry", "Pick Sentry if", "Pick Mushi if", "Frequently asked questions"],
2213
- excerpt: "Sentry vs Mushi Mushi in 2026 \u2014 what each captures, Sentry's free tier and Seer pricing next to Mushi's 50 free diagnoses a month, and running both."
2296
+ excerpt: "Sentry vs Mushi Mushi in 2026 \u2014 what each captures, Sentry's free tier and Seer pricing next to Mushi's free plan (1 app, 100 diagnoses), and running both."
2214
2297
  },
2215
2298
  {
2216
2299
  title: "Concepts",
@@ -2290,7 +2373,7 @@ var MUSHI_DOCS_INDEX = [
2290
2373
  route: "/concepts/closed-loop",
2291
2374
  markdown: "concepts/closed-loop.md",
2292
2375
  keywords: ["concepts", "closed-loop", "closed", "loop", "evolution", "thesis"],
2293
- headings: ["The NTSB moment software is missing", "Why the linear SDLC is the wrong unit", "Cumulative selection: why it works", "What the loop looks like in practice", "What this means for the roadmap"],
2376
+ headings: ["What happens to a bug", "The NTSB moment software is missing", "Why the linear SDLC is the wrong unit", "Cumulative selection: why it works", "What the loop looks like in practice", "What this means for the roadmap"],
2294
2377
  excerpt: "The thesis behind Mushi \u2014 why AI-built apps need a closed loop from what users feel to a verified fix, and how capture, diagnosis and fixes connect."
2295
2378
  },
2296
2379
  {
@@ -2428,6 +2511,15 @@ var MUSHI_DOCS_INDEX = [
2428
2511
  headings: ["Choosing a Mode", "Bring Your Own Button", "Staying out of the way", "Smart Hide", "Native SDKs"],
2429
2512
  excerpt: "Choose where Mushi's bug-report button lives \u2014 corner stamp, edge tab, banner, your own button via attach, or fully manual \u2014 on web and mobile."
2430
2513
  },
2514
+ {
2515
+ title: "Sample diagnosis: Pay now does nothing on a phone",
2516
+ url: docUrl("/demo/diagnosis"),
2517
+ route: "/demo/diagnosis",
2518
+ markdown: "demo/diagnosis.md",
2519
+ keywords: ["demo", "diagnosis", "sample", "pay", "now", "does", "nothing", "phone"],
2520
+ headings: ["Get this for your own app", "One the model wrote"],
2521
+ excerpt: "A sample Mushi diagnosis you can read without signing up. A user's complaint, what the widget captured, the plain-English cause and the fix prompt."
2522
+ },
2431
2523
  {
2432
2524
  title: "Cursor integration",
2433
2525
  url: docUrl("/integrations/cursor"),
@@ -2686,7 +2778,7 @@ var MUSHI_DOCS_INDEX = [
2686
2778
  route: "/plugins",
2687
2779
  markdown: "plugins/index.md",
2688
2780
  keywords: ["plugins", "plugin", "marketplace"],
2689
- headings: ["Available plugins", "Webhook delivery contract", "Build your own"],
2781
+ headings: ["Works with Sentry, or without it", "Available plugins", "Webhook delivery contract", "Build your own"],
2690
2782
  excerpt: "Send Mushi events to the tools you already use through HMAC-signed Standard Webhooks \u2014 12 first-party plugins and an SDK to build your own."
2691
2783
  },
2692
2784
  {
@@ -2825,13 +2917,13 @@ var MUSHI_DOCS_INDEX = [
2825
2917
  excerpt: "Send every Mushi event to Zapier and on to thousands of apps such as Notion, Google Sheets and HubSpot \u2014 Catch Hook setup and event filters."
2826
2918
  },
2827
2919
  {
2828
- title: "Pricing \u2014 free tier, Pro, and self-host",
2920
+ title: "Pricing \u2014 Free, Builder, Studio and self-host",
2829
2921
  url: docUrl("/pricing"),
2830
2922
  route: "/pricing",
2831
2923
  markdown: "pricing.md",
2832
- keywords: ["pricing", "free", "tier", "pro", "self-host"],
2833
- headings: ["Plans", "What counts as a diagnosis", "Pricing estimator", "Example bills", "Why diagnoses, not events", "BYOK and the self-host path", "Compared to Sentry + Seer", "Frequently asked questions"],
2834
- excerpt: "Mushi Mushi pricing \u2014 50 AI bug diagnoses a month free, no card. Open-source Sentry alternative you can self-host for free, or upgrade for teams."
2924
+ keywords: ["pricing", "free", "builder", "studio", "self-host"],
2925
+ headings: ["Plans", "What counts as a diagnosis", "Pricing estimator", "Example bills", "Why apps, not reports?", "Why diagnoses, not events", "Your own AI key and the self-host path", "Compared to Sentry + Seer"],
2926
+ excerpt: "Mushi Mushi pricing \u2014 free for one app and 100 AI bug diagnoses a month. Builder $29/mo for 3 apps, Studio $79/mo for 10. Free to self-host."
2835
2927
  },
2836
2928
  {
2837
2929
  title: "Quickstart \u2014 fix your first bug in 60 seconds",
@@ -2839,7 +2931,7 @@ var MUSHI_DOCS_INDEX = [
2839
2931
  route: "/quickstart",
2840
2932
  markdown: "quickstart/index.md",
2841
2933
  keywords: ["quickstart", "fix", "first", "bug", "60", "seconds", "choose", "stack"],
2842
- headings: ["What you need", "The fastest way: one command", "Start here (editor first)", "Pick your stack", "How do I install the SDK?", "Troubleshooting"],
2934
+ headings: ["Install", "Send your first report", "Get your first fix", "Pick your framework", "Where to start", "Keys and settings", "Troubleshooting"],
2843
2935
  excerpt: "Install Mushi with npx mushi-mushi, connect Cursor or Claude Code over MCP, and turn user bug reports into plain-English diagnoses with ready fixes."
2844
2936
  },
2845
2937
  {
@@ -2875,7 +2967,7 @@ var MUSHI_DOCS_INDEX = [
2875
2967
  route: "/quickstart/cli-console-loop",
2876
2968
  markdown: "quickstart/cli-console-loop.md",
2877
2969
  keywords: ["quickstart", "cli-console-loop", "cli", "console", "loop", "setup"],
2878
- headings: ["Which CLI command?", "Browser sign-in flow (recommended)", "What happens in the terminal", "What happens in the browser", "How sign-in reliability works", "1. Run the wizard", "2. Approve in the browser", "3. Pick or create a project"],
2970
+ headings: ["Set up in five steps", "1. Run the wizard", "2. Approve in the browser", "3. Pick or create a project", "4. SDK installed", "5. Wire Cursor MCP (optional but recommended)", "Which CLI command?", "Browser sign-in flow (recommended)"],
2879
2971
  excerpt: "How npx mushi-mushi creates a project, mints an SDK key and installs the SDK through browser sign-in, and how to recover when the setup loop fails."
2880
2972
  },
2881
2973
  {
@@ -2893,7 +2985,7 @@ var MUSHI_DOCS_INDEX = [
2893
2985
  route: "/quickstart/incident-loop",
2894
2986
  markdown: "quickstart/incident-loop.md",
2895
2987
  keywords: ["quickstart", "incident-loop", "incident", "loop", "bug", "fix", "prompt"],
2896
- headings: ["No MCP? Copy the fix prompt", "Prerequisites", "Step 1 \u2014 Capture or pick a report", "Step 2 \u2014 Pull fix context", "Step 3 \u2014 Generate the fix prompt", "Step 4 \u2014 Paste and ship", "Troubleshooting", "See also"],
2988
+ headings: ["No MCP? Copy the fix prompt", "Before you start", "The loop", "Capture or pick a report", "Pull the fix context", "Get a deeper fix plan (optional)", "Paste and ship", "Troubleshooting"],
2897
2989
  excerpt: "Run npx mushi-mushi, ship, and turn your first user-reported bug into a plain-English diagnosis and a paste-ready fix for Cursor or Claude Code."
2898
2990
  },
2899
2991
  {
@@ -2905,13 +2997,31 @@ var MUSHI_DOCS_INDEX = [
2905
2997
  headings: ["Install (Swift Package Manager)", "Initialize", "Open the widget or submit a report", "Sentry"],
2906
2998
  excerpt: "Add Mushi's native Swift SDK to an iOS app with Swift Package Manager \u2014 shake-to-report, offline queue and device context. Preview build, not on CocoaPods yet."
2907
2999
  },
3000
+ {
3001
+ title: "Mushi in Lovable or Bolt",
3002
+ url: docUrl("/quickstart/lovable-bolt"),
3003
+ route: "/quickstart/lovable-bolt",
3004
+ markdown: "quickstart/lovable-bolt.md",
3005
+ keywords: ["quickstart", "lovable-bolt", "lovable", "bolt", "no", "terminal"],
3006
+ headings: ["Get your script tag", "Paste it into Lovable or Bolt", "Publish and send a test report", "Fix a real bug", "Read reports inside Lovable", "Where the key goes, and is it safe?", "Change how the button looks", "If nothing shows up"],
3007
+ excerpt: "Add Mushi to a Lovable or Bolt app without a terminal. Paste one script tag through your prompt, then read each bug's plain-English cause and fix prompt."
3008
+ },
3009
+ {
3010
+ title: "Ask Lovable why it broke",
3011
+ url: docUrl("/quickstart/lovable-mcp"),
3012
+ route: "/quickstart/lovable-mcp",
3013
+ markdown: "quickstart/lovable-mcp.md",
3014
+ keywords: ["quickstart", "lovable-mcp", "lovable", "mcp", "ask", "broke"],
3015
+ headings: ["Add Mushi to Lovable", "Open the custom MCP form", "Fill in the form", "Sign in and approve", "Ask Lovable", "Claude Code: one paste", "Cursor: one click", "Bolt"],
3016
+ excerpt: "Add Mushi to Lovable as an MCP connector in three steps; Lovable reads the plain-English diagnosis and fixes the bug. Claude Code and Cursor in one paste."
3017
+ },
2908
3018
  {
2909
3019
  title: "MCP server for bug fixing in Cursor & Claude Code",
2910
3020
  url: docUrl("/quickstart/mcp"),
2911
3021
  route: "/quickstart/mcp",
2912
3022
  markdown: "quickstart/mcp.md",
2913
3023
  keywords: ["quickstart", "mcp", "server", "bug", "fixing", "cursor", "claude", "code"],
2914
- headings: ["OAuth login (recommended \u2014 no keys to copy)", "One-liner setup (recommended)", "Claude Code plugin", "Smithery (hosted MCP)", "Manual setup: Cursor", "Manual setup: Claude Desktop", "Hosted Streamable HTTP transport (no subprocess)", "Available tools"],
3024
+ headings: ["Connect in three steps", "Add the Mushi server", "Sign in", "Ask your editor", "How sign-in works (OAuth, no keys to copy)", "One-liner setup (recommended)", "Claude Code plugin", "Smithery (hosted MCP)"],
2915
3025
  excerpt: "Set up the Mushi MCP server with npx mushi-mushi setup \u2014 read bug reports, get fix context, and dispatch fixes from Cursor, Claude Code, or Codex."
2916
3026
  },
2917
3027
  {
@@ -5026,6 +5136,67 @@ function createMushiServer(config) {
5026
5136
  return jsonResult(await apiCall(`/v1/admin/ci/compare?${qs}`, void 0, { minTimeoutMs: 6e4 }));
5027
5137
  }
5028
5138
  );
5139
+ server.registerTool(
5140
+ "get_ci_bill",
5141
+ {
5142
+ title: titleOf("get_ci_bill"),
5143
+ description: descOf("get_ci_bill"),
5144
+ annotations: annotationsFor("get_ci_bill"),
5145
+ inputSchema: z.object({
5146
+ projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project; omitted with an account-level key, every project you can read"),
5147
+ days: z.number().int().min(1).max(90).optional().describe("Window in days (default 30)")
5148
+ }),
5149
+ outputSchema: z.looseObject({
5150
+ window: z.unknown().optional(),
5151
+ previousWindow: z.unknown().optional(),
5152
+ provenance: z.string().optional().describe("measured: from GitHub's bill"),
5153
+ currency: z.string().optional(),
5154
+ available: z.boolean().optional(),
5155
+ repoScoped: z.boolean().optional().describe("Only your projects' repos: you are not a member of the organization"),
5156
+ unavailableReason: z.string().nullable().optional().describe("Why there is no bill, and how to connect one"),
5157
+ owners: z.array(z.looseObject({})).optional(),
5158
+ month: z.looseObject({}).optional().describe("This calendar month so far: grossUsd, discountUsd, netUsd"),
5159
+ totals: z.looseObject({}).optional(),
5160
+ previousTotals: z.looseObject({}).nullable().optional(),
5161
+ change: z.looseObject({}).nullable().optional(),
5162
+ windowComplete: z.boolean().optional(),
5163
+ byRepo: z.array(z.looseObject({})).optional(),
5164
+ bySku: z.array(z.looseObject({})).optional(),
5165
+ byDay: z.array(z.looseObject({})).optional(),
5166
+ dataThrough: z.string().nullable().optional(),
5167
+ agentShare: z.looseObject({}).nullable().optional().describe("Paid minutes on Mushi agent branches (estimated)")
5168
+ })
5169
+ },
5170
+ async (args) => {
5171
+ const pid = args.projectId ? await resolveProjectId(args.projectId) : projectId || void 0;
5172
+ const qs = new URLSearchParams({ days: String(args.days ?? 30) });
5173
+ if (pid) qs.set("project_id", pid);
5174
+ return jsonResult(await apiCall(`/v1/admin/ci/bill?${qs}`, void 0, { minTimeoutMs: 6e4 }));
5175
+ }
5176
+ );
5177
+ server.registerTool(
5178
+ "get_worker_status",
5179
+ {
5180
+ title: titleOf("get_worker_status"),
5181
+ description: descOf("get_worker_status"),
5182
+ annotations: annotationsFor("get_worker_status"),
5183
+ inputSchema: z.object({
5184
+ projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project; omitted with an account-level key, every project you can read")
5185
+ }),
5186
+ outputSchema: z.looseObject({
5187
+ generatedAt: z.string().optional(),
5188
+ flags: z.array(z.looseObject({})).optional().describe("Worst first: what stops a worker, why, and the fix"),
5189
+ projects: z.array(z.looseObject({})).optional(),
5190
+ hosts: z.array(z.looseObject({})).optional(),
5191
+ lanes: z.array(z.looseObject({})).optional()
5192
+ })
5193
+ },
5194
+ async (args) => {
5195
+ const pid = args.projectId ? await resolveProjectId(args.projectId) : projectId || void 0;
5196
+ const qs = pid ? `?${new URLSearchParams({ projectId: pid })}` : "";
5197
+ return jsonResult(await apiCall(`/v1/admin/work/lanes${qs}`));
5198
+ }
5199
+ );
5029
5200
  server.registerTool(
5030
5201
  "request_ci_placement_change",
5031
5202
  {
@@ -5046,6 +5217,77 @@ function createMushiServer(config) {
5046
5217
  return jsonText(await apiCall("/v1/admin/ci/placement/requests", { method: "POST", body: JSON.stringify(body) }));
5047
5218
  }
5048
5219
  );
5220
+ server.registerTool(
5221
+ "open_ci_cost_fix",
5222
+ {
5223
+ title: titleOf("open_ci_cost_fix"),
5224
+ description: descOf("open_ci_cost_fix"),
5225
+ annotations: annotationsFor("open_ci_cost_fix"),
5226
+ inputSchema: z.object({
5227
+ projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project"),
5228
+ repo: z.string().regex(/^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/).describe("owner/repo, connected to the project"),
5229
+ workflowPath: z.string().max(200).regex(/^\.github\/workflows\/[A-Za-z0-9._/-]+\.ya?ml$/).describe("The workflow file, e.g. .github/workflows/ci.yml"),
5230
+ kind: z.enum(["add_concurrency", "skip_drafts", "weekly_cron", "ignore_docs_paths"]).describe("The fix (advice[].autofix.kind)")
5231
+ })
5232
+ },
5233
+ async (args) => {
5234
+ const pid = await resolveProjectId(args.projectId);
5235
+ const body = { projectId: pid, repo: args.repo, workflowPath: args.workflowPath, kind: args.kind };
5236
+ return jsonText(await apiCall("/v1/admin/ci/cost-fixes", { method: "POST", body: JSON.stringify(body) }));
5237
+ }
5238
+ );
5239
+ const COST_FIX_KIND = z.enum(["add_concurrency", "skip_drafts", "weekly_cron", "ignore_docs_paths"]);
5240
+ const WORKFLOW_PATH = z.string().max(200).regex(/^\.github\/workflows\/[A-Za-z0-9._/-]+\.ya?ml$/);
5241
+ server.registerTool(
5242
+ "preview_ci_cost_fix_rollout",
5243
+ {
5244
+ title: titleOf("preview_ci_cost_fix_rollout"),
5245
+ description: descOf("preview_ci_cost_fix_rollout"),
5246
+ annotations: annotationsFor("preview_ci_cost_fix_rollout"),
5247
+ inputSchema: z.object({
5248
+ projectId: z.string().optional().describe("Limit it to one app; omitted with an account-level key, every app you may change")
5249
+ })
5250
+ },
5251
+ async (args) => {
5252
+ const pid = args.projectId ? await resolveProjectId(args.projectId) : projectId || void 0;
5253
+ const qs = pid ? `?project_id=${encodeURIComponent(pid)}` : "";
5254
+ return jsonText(await apiCall(`/v1/admin/ci/cost-fix-rollout${qs}`, void 0, { minTimeoutMs: 6e4 }));
5255
+ }
5256
+ );
5257
+ server.registerTool(
5258
+ "apply_ci_cost_fix_rollout",
5259
+ {
5260
+ title: titleOf("apply_ci_cost_fix_rollout"),
5261
+ description: descOf("apply_ci_cost_fix_rollout"),
5262
+ annotations: annotationsFor("apply_ci_cost_fix_rollout"),
5263
+ inputSchema: z.object({
5264
+ repos: z.array(
5265
+ z.object({
5266
+ projectId: z.string().describe("The app the repo is connected to (preview repos[].projectId)"),
5267
+ repo: z.string().regex(/^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/).describe("owner/repo"),
5268
+ items: z.array(z.object({ workflowPath: WORKFLOW_PATH, kind: COST_FIX_KIND })).min(1).max(20)
5269
+ })
5270
+ ).min(1).max(10).describe("One entry per repo: the ready items from preview_ci_cost_fix_rollout")
5271
+ })
5272
+ },
5273
+ async (args) => {
5274
+ return jsonText(await apiCall("/v1/admin/ci/cost-fix-rollout", { method: "POST", body: JSON.stringify({ repos: args.repos }) }, { minTimeoutMs: 6e4 }));
5275
+ }
5276
+ );
5277
+ server.registerTool(
5278
+ "get_ci_cost_fix_bundle",
5279
+ {
5280
+ title: titleOf("get_ci_cost_fix_bundle"),
5281
+ description: descOf("get_ci_cost_fix_bundle"),
5282
+ annotations: annotationsFor("get_ci_cost_fix_bundle"),
5283
+ inputSchema: z.object({
5284
+ bundleId: z.string().uuid().describe("results[].bundleId from apply_ci_cost_fix_rollout")
5285
+ })
5286
+ },
5287
+ async (args) => {
5288
+ return jsonText(await apiCall(`/v1/admin/ci/cost-fix-bundles/${encodeURIComponent(args.bundleId)}`));
5289
+ }
5290
+ );
5049
5291
  server.registerTool(
5050
5292
  "explain_finding",
5051
5293
  {
@@ -7255,13 +7497,19 @@ Be specific. No generic advice.`
7255
7497
  description: descOf("list_qa_story_runs", TDD_TOOL_CATALOG),
7256
7498
  annotations: annotationsFor("list_qa_story_runs", TDD_TOOL_CATALOG),
7257
7499
  inputSchema: z.object({
7500
+ // `project_id` is not a second field. registerTool wraps this schema
7501
+ // with acceptSnakeCaseAliases, which calls normalizeArgAliases
7502
+ // (arg-aliases.ts) and renames project_id to projectId before zod.
7503
+ projectId: z.string().optional().describe("Project UUID that owns the story. Defaults to the configured project. On an account connection, pass the project the story belongs to."),
7258
7504
  storyId: z.string().describe("QA story id (uuid)"),
7259
7505
  limit: z.number().int().min(1).max(50).optional().default(10).describe("Max runs to return (default 10)")
7260
7506
  })
7261
7507
  },
7262
- async ({ storyId, limit }) => {
7508
+ async ({ projectId: projectId2, storyId, limit }) => {
7509
+ const { projectId: pid, headers } = await projectScopeHeaders(projectId2);
7263
7510
  const data = await apiCall(
7264
- `/v1/admin/projects/${config.projectId}/qa-stories/${storyId}/runs?limit=${limit ?? 10}`
7511
+ `/v1/admin/projects/${pid}/qa-stories/${storyId}/runs?limit=${limit ?? 10}`,
7512
+ { headers }
7265
7513
  );
7266
7514
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
7267
7515
  }
@@ -7273,15 +7521,23 @@ Be specific. No generic advice.`
7273
7521
  description: descOf("get_qa_story_run", TDD_TOOL_CATALOG),
7274
7522
  annotations: annotationsFor("get_qa_story_run", TDD_TOOL_CATALOG),
7275
7523
  inputSchema: z.object({
7524
+ // `project_id` is not a second field. registerTool wraps this schema
7525
+ // with acceptSnakeCaseAliases, which calls normalizeArgAliases
7526
+ // (arg-aliases.ts) and renames project_id to projectId before zod.
7527
+ projectId: z.string().optional().describe(
7528
+ "Project UUID that owns the story. Defaults to the configured project. On an account connection, pass the project the story belongs to."
7529
+ ),
7276
7530
  storyId: z.string().describe("QA story id (uuid)"),
7277
7531
  runId: z.string().describe("Run id (uuid) to fetch detail for")
7278
7532
  })
7279
7533
  },
7280
- async ({ storyId, runId }) => {
7534
+ async ({ projectId: projectId2, storyId, runId }) => {
7535
+ const { projectId: pid, headers } = await projectScopeHeaders(projectId2);
7281
7536
  const data = await apiCall(
7282
- `/v1/admin/projects/${config.projectId}/qa-stories/${storyId}/runs?limit=50`
7537
+ `/v1/admin/projects/${pid}/qa-stories/${storyId}/runs?limit=50`,
7538
+ { headers }
7283
7539
  );
7284
- const run = data?.data?.runs?.find((r) => r.id === runId) ?? null;
7540
+ const run = data?.runs?.find((r) => r.id === runId) ?? null;
7285
7541
  if (!run) {
7286
7542
  throw new MushiApiError(
7287
7543
  404,