@yawlabs/mcp 1.0.7 → 1.0.8

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/CHANGELOG.md CHANGED
@@ -4,6 +4,20 @@ All notable changes to `@yawlabs/mcp` (formerly `@yawlabs/mcph`) are documented
4
4
 
5
5
  ## Unreleased -- a fresh Yaw Mode pane names the local-scope entry it will lose
6
6
 
7
+ **Added -- `YAW_MCP_READONLY_DIAGNOSTICS=1` runs `doctor` and `bundles` without writing anything**
8
+
9
+ Yaw Terminal's MCP panel runs `yaw-mcp doctor --json`, `status --json` and `bundles list --json` on every refresh, and `doctor` is not read-only. It sweeps expired `yaw-mcp try` trials: a read-modify-write of each client config the trial was wired into (`~/.claude.json` among them), taken with no lock against the client that owns the file, which drops a UTF-8 BOM and adds a trailing newline on the way through. It also renames a pre-0.12 `~/.yaw-mcp.json` or project `.yaw-mcp.json` / `.yaw-mcp.local.json` into `.yaw-mcp/` as part of loading config, and so does `bundles match`. A refresh the user did not ask for should not do either.
10
+
11
+ With the variable set (`1` or `true` in any case, surrounding whitespace ignored -- the spellings `YAW_MCP_AUTO_LOAD`, `YAW_MCP_FOUNDRY` and `YAW_MCP_REWARD_GRADER` take):
12
+
13
+ - `doctor`, text and `--json`, does not run the trial sweep. It still scans the trials. An expired one is not listed as live and not dropped: each becomes a warning -- ``trial "<slug>": expired but not swept -- YAW_MCP_READONLY_DIAGNOSTICS is set, so this run edits no client config, and its entry may still be wired into <path>; run `yaw-mcp doctor` with YAW_MCP_READONLY_DIAGNOSTICS unset to sweep it, or `yaw-mcp try-cleanup <slug>` `` -- so the run exits 2, the same as for an expired trial the sweep could not remove. TRIALS prints a count and points at WARNINGS.
14
+ - `doctor` and `bundles match` do not migrate a legacy config file. Each file the migration would have moved is a warning instead, naming the file and where the next ordinary run moves it, because the settings in it are not part of that report. The check runs the migrator's own walk and per-file checks, so it names exactly the files a real run would move.
15
+ - `status` and `bundles list` wrote nothing before and write nothing now.
16
+
17
+ **`doctor --json` gains fields only on a run with the variable set**: a top-level `"readOnly": true`, and `trials.unswept` (`{ slug, clientName, clientPath, markerPath, msSinceExpiry }` per expired trial left in place, possibly empty) with `trials.sweepHint` (one display sentence naming both commands, or `null`). Without the variable, `doctor` (text and `--json`), `bundles` and `status` behave and print exactly as before: the trial sweep and the migration still run, and none of the new fields, lines or warnings appear. The variable is not listed in doctor's ENVIRONMENT section, because its 28-character name would re-pad every line of that section on every ordinary run. A run with it set prints `mode: read-only (YAW_MCP_READONLY_DIAGNOSTICS is set) -- no trial sweep, no config migration` under the header instead.
18
+
19
+ The broker never reads the variable. Its startup config load still migrates legacy files even when the variable has leaked into a client's environment, because it is the process that folds them in.
20
+
7
21
  **Added -- a startup pre-warm of `npx -y <pkg>@latest` servers so the first `initialize` of a session does not pay the cold-cache tax**
8
22
 
9
23
  A server entry shaped `{ command: "npx", args: ["-y", "@yawlabs/<x>-mcp@latest"] }` resolves `@latest` on every spawn. On a fresh `~/.npm/_npx/` cache -- which npm keeps per-tarball-URL hash and so flushes whenever a package publishes a new build -- the first spawn does a registry round-trip + a tar download + the child's own `initialize`. Together that is reliably >30s, which exceeds the downstream MCP client's `initialize` deadline and surfaces as the user-visible line "MCP request initialize to server mcp timed out after 30000ms". yaw-mcp's own `MCP_CONNECT_TIMEOUT` is 15s by default, so the user loses the activation AND yaw-mcp spends 15s in the attempt before giving up.
package/README.md CHANGED
@@ -421,6 +421,7 @@ Common ones (run `yaw-mcp --help` for the full list):
421
421
  | `MCP_CALL_TIMEOUT` | Milliseconds to wait for a single proxied `tools/call`. Default `60000` (the SDK's own bound); raise it for legitimately slow servers. Same `1..2147483647` whole-millisecond parse, invalid values fall back with one warn. |
422
422
  | `YAW_MCP_IDLE_THRESHOLD` | Non-matching tool calls a loaded server tolerates before it is unloaded. Default `10`; bursty servers earn more patience automatically. The older name `MCP_CONNECT_IDLE_THRESHOLD` still works as a fallback. |
423
423
  | `YAW_MCP_DISABLE_PERSISTENCE` | `1` keeps learning + pack history process-scoped (CI, containers). Default off. |
424
+ | `YAW_MCP_READONLY_DIAGNOSTICS` | `1` makes `doctor` (text and `--json`) and `bundles` write nothing, for a caller that runs them in the background on a timer. `doctor` still scans `yaw-mcp try` trials but does not sweep expired ones out of your client configs: each is reported as a warning (so the run exits 2) and listed in `--json`'s `trials.unswept`, with `trials.sweepHint` naming the fix -- a plain `yaw-mcp doctor` with the variable unset, or `yaw-mcp try-cleanup <slug>`. A pre-0.12 `~/.yaw-mcp.json` or project `.yaw-mcp.json` / `.yaw-mcp.local.json` is not moved into `.yaw-mcp/`; each is reported as a warning instead (its settings are not loaded for that run). `--json` carries `"readOnly": true` on such a run. `status` never writes, so it is unaffected. Default off. |
424
425
  | `LOG_LEVEL` | `debug` \| `info` \| `warn` \| `error`. Default `info`. |
425
426
 
426
427
  ## Requirements
@@ -9,7 +9,7 @@ import {
9
9
  readCheckMemo,
10
10
  recordAttemptAt,
11
11
  writeCheckMemo
12
- } from "./chunk-YBL36YGY.js";
12
+ } from "./chunk-A73UTVAV.js";
13
13
  export {
14
14
  acquireUpgradeLock,
15
15
  attemptedRecentlyAt,
@@ -4415,7 +4415,7 @@ async function oamFloorLines(probe) {
4415
4415
  }
4416
4416
  async function defaultRunningPrefix(argvPath) {
4417
4417
  if (process.env.VITEST) return null;
4418
- const { detectRunningInstallPrefix: detectRunningInstallPrefix2 } = await import("./auto-upgrade-ABZIVFE3.js");
4418
+ const { detectRunningInstallPrefix: detectRunningInstallPrefix2 } = await import("./auto-upgrade-I24ES4PC.js");
4419
4419
  return detectRunningInstallPrefix2(argvPath);
4420
4420
  }
4421
4421
  async function defaultSpawn(cmd, args, cwd) {
@@ -4476,7 +4476,7 @@ async function runUpgrade(opts = {}) {
4476
4476
  if (method === "global-npm") {
4477
4477
  const rawPrefix = await (opts.runningPrefix ?? defaultRunningPrefix)(argvPath);
4478
4478
  if (rawPrefix !== null) {
4479
- const { quoteArgForDisplay: quoteArgForDisplay2, quoteShellArgIfNeeded: quoteShellArgIfNeeded2 } = await import("./auto-upgrade-ABZIVFE3.js");
4479
+ const { quoteArgForDisplay: quoteArgForDisplay2, quoteShellArgIfNeeded: quoteShellArgIfNeeded2 } = await import("./auto-upgrade-I24ES4PC.js");
4480
4480
  const spawnForm = quoteShellArgIfNeeded2(rawPrefix, opts.platform);
4481
4481
  const displayForm = quoteArgForDisplay2(rawPrefix, opts.platform);
4482
4482
  if (spawnForm !== null && displayForm !== null) {
@@ -4593,7 +4593,7 @@ async function runUpgrade(opts = {}) {
4593
4593
  return { exitCode: 3, lines };
4594
4594
  }
4595
4595
  function readCurrentVersion() {
4596
- return true ? "1.0.7" : "dev";
4596
+ return true ? "1.0.8" : "dev";
4597
4597
  }
4598
4598
 
4599
4599
  // src/auto-upgrade.ts
@@ -4875,7 +4875,7 @@ function defaultSpawn2(cmd, args, onDone = () => {
4875
4875
  async function maybeAutoUpgrade(deps = {}) {
4876
4876
  const optOut = process.env.YAW_MCP_AUTO_UPGRADE;
4877
4877
  if (optOut === "0" || optOut?.toLowerCase() === "false") return;
4878
- const current = deps.currentVersion ?? (true ? "1.0.7" : "dev");
4878
+ const current = deps.currentVersion ?? (true ? "1.0.8" : "dev");
4879
4879
  if (current === "dev") return;
4880
4880
  const argvPath = deps.argvPath ?? process.argv[1];
4881
4881
  const method = (deps.isSeaImpl ? await deps.isSeaImpl() : await detectSea()) ? "binary" : detectInstallMethod(argvPath, realpathSync2, ["unknown", "local-node-modules"]);
package/dist/index.js CHANGED
@@ -93,7 +93,7 @@ import {
93
93
  unparseableConfigFix,
94
94
  userConfigDir,
95
95
  yawModeOverlay
96
- } from "./chunk-YBL36YGY.js";
96
+ } from "./chunk-A73UTVAV.js";
97
97
 
98
98
  // src/audit-cmd.ts
99
99
  import { homedir as homedir6 } from "os";
@@ -3196,7 +3196,7 @@ async function connectToUpstreamOnce(config, onDisconnect, onListChanged, bridge
3196
3196
  if (downstreamCaps?.sampling) capabilities.sampling = downstreamCaps.sampling;
3197
3197
  if (downstreamCaps?.roots) capabilities.roots = {};
3198
3198
  const client = new Client(
3199
- { name: "yaw-mcp", version: true ? "1.0.7" : "dev" },
3199
+ { name: "yaw-mcp", version: true ? "1.0.8" : "dev" },
3200
3200
  { capabilities }
3201
3201
  );
3202
3202
  if (bridge && capabilities.elicitation) {
@@ -4026,7 +4026,7 @@ async function exists(path5) {
4026
4026
  return false;
4027
4027
  }
4028
4028
  }
4029
- async function migrateFile(legacy, target, scope) {
4029
+ async function migrateFile(legacy, target, scope, plan) {
4030
4030
  let st;
4031
4031
  try {
4032
4032
  st = await lstat(legacy);
@@ -4066,6 +4066,10 @@ async function migrateFile(legacy, target, scope) {
4066
4066
  });
4067
4067
  return;
4068
4068
  }
4069
+ if (plan !== null) {
4070
+ plan.push({ scope, legacy, target });
4071
+ return;
4072
+ }
4069
4073
  try {
4070
4074
  await mkdir3(dirname5(target), { recursive: true });
4071
4075
  await rename2(legacy, target);
@@ -4092,10 +4096,18 @@ async function migrateFile(legacy, target, scope) {
4092
4096
  }
4093
4097
  }
4094
4098
  async function migrateLegacyConfigPaths(opts) {
4099
+ await walkLegacyConfigPaths(opts, null);
4100
+ }
4101
+ async function planLegacyConfigMigration(opts) {
4102
+ const plan = [];
4103
+ await walkLegacyConfigPaths(opts, plan);
4104
+ return plan;
4105
+ }
4106
+ async function walkLegacyConfigPaths(opts, plan) {
4095
4107
  const { cwd, home } = opts;
4096
4108
  const legacyGlobal = join7(home, LEGACY_GLOBAL_FILENAME);
4097
4109
  const newGlobal = join7(userConfigDir(home), NEW_CONFIG_FILENAME);
4098
- await migrateFile(legacyGlobal, newGlobal, "global");
4110
+ await migrateFile(legacyGlobal, newGlobal, "global", plan);
4099
4111
  const homeLocal = join7(home, LEGACY_LOCAL_FILENAME);
4100
4112
  if (await exists(homeLocal)) {
4101
4113
  log("warn", "yaw-mcp config: legacy machine-local file at $HOME has no new location -- leaving it in place", {
@@ -4109,10 +4121,10 @@ async function migrateLegacyConfigPaths(opts) {
4109
4121
  const newDir = join7(legacyProjectRoot, CONFIG_DIRNAME);
4110
4122
  const legacyLocal = join7(legacyProjectRoot, LEGACY_LOCAL_FILENAME);
4111
4123
  const newLocal = join7(newDir, NEW_LOCAL_FILENAME);
4112
- await migrateFile(legacyLocal, newLocal, "local");
4124
+ await migrateFile(legacyLocal, newLocal, "local", plan);
4113
4125
  const legacyProject = join7(legacyProjectRoot, LEGACY_PROJECT_FILENAME);
4114
4126
  const newProject = join7(newDir, NEW_CONFIG_FILENAME);
4115
- await migrateFile(legacyProject, newProject, "project");
4127
+ await migrateFile(legacyProject, newProject, "project", plan);
4116
4128
  }
4117
4129
  }
4118
4130
  async function findLegacyProjectRoot(cwd, home) {
@@ -4134,6 +4146,15 @@ async function findLegacyProjectRoot(cwd, home) {
4134
4146
  var CONFIG_FILENAME = "config.json";
4135
4147
  var LOCAL_CONFIG_FILENAME = "config.local.json";
4136
4148
  var CURRENT_SCHEMA_VERSION = 1;
4149
+ var READONLY_DIAGNOSTICS_ENV = "YAW_MCP_READONLY_DIAGNOSTICS";
4150
+ function isReadOnlyDiagnostics(env = process.env) {
4151
+ const raw = env[READONLY_DIAGNOSTICS_ENV]?.trim();
4152
+ if (raw === void 0 || raw === "") return false;
4153
+ return raw === "1" || raw.toLowerCase() === "true";
4154
+ }
4155
+ function legacyMigrationSkippedWarning(p) {
4156
+ return `${p.legacy}: pre-0.12 config file not migrated -- ${READONLY_DIAGNOSTICS_ENV} is set, so this run moves no files and the settings in it are NOT part of this report. The next yaw-mcp start (or this command with ${READONLY_DIAGNOSTICS_ENV} unset) moves it to ${p.target}.`;
4157
+ }
4137
4158
  var DEPRECATED_KEYS = ["token", "apiBase"];
4138
4159
  var KNOWN_CONFIG_KEYS = /* @__PURE__ */ new Set([
4139
4160
  "$schema",
@@ -4295,7 +4316,17 @@ async function loadYawMcpConfig(opts = {}) {
4295
4316
  const home = resolve3(opts.home ?? homedir7());
4296
4317
  const warnings = [];
4297
4318
  const loadedFiles = [];
4298
- await migrateLegacyConfigPathsOnce(cwd, home);
4319
+ if (opts.readOnly) {
4320
+ const pending2 = await planLegacyConfigMigration({ cwd, home }).catch((err) => {
4321
+ log("warn", "Legacy config migration check failed", {
4322
+ error: err instanceof Error ? err.message : String(err)
4323
+ });
4324
+ return [];
4325
+ });
4326
+ for (const p of pending2) warnings.push(legacyMigrationSkippedWarning(p));
4327
+ } else {
4328
+ await migrateLegacyConfigPathsOnce(cwd, home);
4329
+ }
4299
4330
  const projectConfigDir = await findProjectConfigDir(cwd, home, opts.env).catch((err) => {
4300
4331
  log("warn", "Failed searching for project .yaw-mcp/ dir", {
4301
4332
  error: err instanceof Error ? err.message : String(err)
@@ -4427,7 +4458,7 @@ async function runBundlesCommand(opts = {}) {
4427
4458
  }
4428
4459
  const env = opts.env ?? process.env;
4429
4460
  const loaded = await loadLocalBundles({ cwd: opts.cwd, home: opts.home, env });
4430
- const config = await loadYawMcpConfig({ cwd: opts.cwd, home: opts.home, env });
4461
+ const config = await loadYawMcpConfig({ cwd: opts.cwd, home: opts.home, env, readOnly: isReadOnlyDiagnostics(env) });
4431
4462
  for (const w of loaded.warnings) printErr(`warning: ${w}`);
4432
4463
  for (const w of config.warnings) printErr(`warning: ${w}`);
4433
4464
  const enabled = (loaded.config?.servers ?? []).filter((s) => s.isActive).map((s) => s.namespace);
@@ -11031,7 +11062,7 @@ function foldBundleWarnings(warnings, probe) {
11031
11062
  const prefix = `${probe.path}:`;
11032
11063
  return warnings.filter((w) => !w.startsWith(prefix));
11033
11064
  }
11034
- var VERSION = true ? "1.0.7" : "dev";
11065
+ var VERSION = true ? "1.0.8" : "dev";
11035
11066
  var DOCTOR_USAGE = `Usage: yaw-mcp doctor [--json]
11036
11067
 
11037
11068
  Print a diagnostic of your yaw-mcp setup.
@@ -11058,8 +11089,9 @@ async function collectDoctorBase(opts) {
11058
11089
  const appData = resolveAppDataDir({ home: opts.home, env: opts.env });
11059
11090
  const os = opts.os ?? CURRENT_OS;
11060
11091
  const env = opts.env ?? process.env;
11092
+ const readOnly = isReadOnlyDiagnostics(env);
11061
11093
  const timestamp = (/* @__PURE__ */ new Date()).toISOString();
11062
- const config = await loadYawMcpConfig({ cwd, home, env });
11094
+ const config = await loadYawMcpConfig({ cwd, home, env, readOnly });
11063
11095
  const trustProbe = await probeProjectTrust({ cwd, home, env }).catch(() => null);
11064
11096
  const trustWarning = projectTrustWarning(trustProbe);
11065
11097
  if (trustWarning) config.warnings = [...config.warnings, trustWarning];
@@ -11070,6 +11102,7 @@ async function collectDoctorBase(opts) {
11070
11102
  appData,
11071
11103
  os,
11072
11104
  env,
11105
+ readOnly,
11073
11106
  timestamp,
11074
11107
  config,
11075
11108
  trustProbe,
@@ -11127,10 +11160,11 @@ async function runDoctor(opts = {}) {
11127
11160
  write(`${s}
11128
11161
  `);
11129
11162
  };
11130
- const { cwd, home, appData, os, env, timestamp, config, trustProbe, claudeConfigDir, clientEnv: clientEnv2 } = await collectDoctorBase(opts);
11163
+ const { cwd, home, appData, os, env, readOnly, timestamp, config, trustProbe, claudeConfigDir, clientEnv: clientEnv2 } = await collectDoctorBase(opts);
11131
11164
  print(`yaw-mcp doctor -- ${timestamp}`);
11132
11165
  print(`yaw-mcp version: ${VERSION}`);
11133
11166
  print(`platform: ${os}`);
11167
+ if (readOnly) print(`mode: read-only (${READONLY_DIAGNOSTICS_ENV} is set) -- no trial sweep, no config migration`);
11134
11168
  print("");
11135
11169
  print("CONFIG FILES");
11136
11170
  if (config.loadedFiles.length === 0) {
@@ -11168,7 +11202,7 @@ async function runDoctor(opts = {}) {
11168
11202
  print
11169
11203
  });
11170
11204
  renderReliabilitySection({ disabled: persistenceDisabled, persisted: persistedState, print });
11171
- const trialWarnings = await renderTrialsSection({ home, print, now: opts.now });
11205
+ const trialWarnings = await renderTrialsSection({ home, print, now: opts.now, readOnly });
11172
11206
  if (trialWarnings.length > 0) config.warnings = [...config.warnings, ...trialWarnings];
11173
11207
  const clients = probeClients({
11174
11208
  home,
@@ -11258,13 +11292,9 @@ async function runDoctor(opts = {}) {
11258
11292
  async function runDoctorJson(opts) {
11259
11293
  const lines = [];
11260
11294
  const write = opts.out ?? createStreamWriter(process.stdout);
11261
- const { cwd, home, appData, os, env, timestamp, config, trustProbe, claudeConfigDir, clientEnv: clientEnv2 } = await collectDoctorBase(opts);
11262
- const trialScan = await scanTrials({ home, now: opts.now });
11263
- const trialGc = await gcExpiredTrials({
11264
- home,
11265
- now: opts.now,
11266
- scan: trialScan
11267
- }).catch(() => ({ cleared: 0, failed: 0, failures: [] }));
11295
+ const { cwd, home, appData, os, env, readOnly, timestamp, config, trustProbe, claudeConfigDir, clientEnv: clientEnv2 } = await collectDoctorBase(opts);
11296
+ const trialStatus = await collectTrialStatus({ home, now: opts.now, readOnly });
11297
+ const { scan: trialScan, gc: trialGc } = trialStatus;
11268
11298
  const clients = probeClients({
11269
11299
  home,
11270
11300
  os,
@@ -11363,7 +11393,19 @@ async function runDoctorJson(opts) {
11363
11393
  clientPath: marker.clientPath,
11364
11394
  msUntilExpiry
11365
11395
  })),
11366
- malformed: trialScan.malformed
11396
+ malformed: trialScan.malformed,
11397
+ // Read-only runs only, so an ordinary run's `trials` block is unchanged
11398
+ // (see DoctorJsonSnapshot.trials.unswept).
11399
+ ...readOnly ? {
11400
+ unswept: trialStatus.unswept.map(({ marker, path: path5, msUntilExpiry }) => ({
11401
+ slug: marker.slug,
11402
+ clientName: marker.clientName,
11403
+ clientPath: marker.clientPath,
11404
+ markerPath: path5,
11405
+ msSinceExpiry: Math.max(0, -msUntilExpiry)
11406
+ })),
11407
+ sweepHint: trialStatus.unswept.length > 0 ? TRIAL_SWEEP_HINT : null
11408
+ } : {}
11367
11409
  };
11368
11410
  const oamStatus = await collectOamRuntimeStatus({
11369
11411
  env,
@@ -11374,8 +11416,8 @@ async function runDoctorJson(opts) {
11374
11416
  });
11375
11417
  config.warnings = [...config.warnings, ...foldBundleWarnings(oamStatus.bundleWarnings, trustProbe)];
11376
11418
  const vault = await collectVaultStatus({ home, env, servers: oamStatus.servers });
11377
- if (trialGc.failures.length > 0) {
11378
- config.warnings = [...config.warnings, ...trialGc.failures.map(trialGcFailureWarning)];
11419
+ if (trialStatus.warnings.length > 0) {
11420
+ config.warnings = [...config.warnings, ...trialStatus.warnings];
11379
11421
  }
11380
11422
  config.warnings = [...config.warnings, ...clientLaunchWarnings(clients)];
11381
11423
  const oamRuntime = {
@@ -11424,6 +11466,8 @@ async function runDoctorJson(opts) {
11424
11466
  timestamp,
11425
11467
  version: VERSION,
11426
11468
  platform: os,
11469
+ // Present only on a read-only run -- see DoctorJsonSnapshot.readOnly.
11470
+ ...readOnly ? { readOnly: true } : {},
11427
11471
  // DEPRECATED keys, emitted with their original nested shape and null
11428
11472
  // members so `doctor --json` stays parseable for consumers reading
11429
11473
  // `.token.source` / `.apiBase.value`. See DoctorJsonSnapshot.
@@ -11824,16 +11868,35 @@ function renderReliabilitySection(opts) {
11824
11868
  }
11825
11869
  print("");
11826
11870
  }
11827
- async function renderTrialsSection(opts) {
11828
- const { home, print, now } = opts;
11871
+ var TRIAL_SWEEP_HINT = `Expired trials are not swept while ${READONLY_DIAGNOSTICS_ENV} is set. Run \`yaw-mcp doctor\` with it unset to sweep them all, or \`yaw-mcp try-cleanup <slug>\` to remove one.`;
11872
+ function trialUnsweptWarning(entry) {
11873
+ const { slug, clientPath } = entry.marker;
11874
+ return `trial "${slug}": expired but not swept -- ${READONLY_DIAGNOSTICS_ENV} is set, so this run edits no client config, and its entry may still be wired into ${clientPath}; run \`yaw-mcp doctor\` with ${READONLY_DIAGNOSTICS_ENV} unset to sweep it, or \`yaw-mcp try-cleanup ${slug}\``;
11875
+ }
11876
+ async function collectTrialStatus(opts) {
11877
+ const { home, now, readOnly } = opts;
11829
11878
  const scan = await scanTrials({ home, now });
11879
+ if (readOnly) {
11880
+ return {
11881
+ scan,
11882
+ gc: { cleared: 0, failed: 0, failures: [] },
11883
+ unswept: scan.expired,
11884
+ warnings: scan.expired.map(trialUnsweptWarning)
11885
+ };
11886
+ }
11830
11887
  const gc = await gcExpiredTrials({ home, now, scan }).catch(() => ({
11831
11888
  cleared: 0,
11832
11889
  failed: 0,
11833
11890
  failures: []
11834
11891
  }));
11835
- const warnings = gc.failures.map(trialGcFailureWarning);
11836
- if (scan.live.length === 0 && gc.cleared === 0 && gc.failed === 0 && scan.malformed.length === 0) return warnings;
11892
+ return { scan, gc, unswept: [], warnings: gc.failures.map(trialGcFailureWarning) };
11893
+ }
11894
+ async function renderTrialsSection(opts) {
11895
+ const { home, print, now, readOnly } = opts;
11896
+ const { scan, gc, unswept, warnings } = await collectTrialStatus({ home, now, readOnly });
11897
+ if (scan.live.length === 0 && gc.cleared === 0 && gc.failed === 0 && unswept.length === 0 && scan.malformed.length === 0) {
11898
+ return warnings;
11899
+ }
11837
11900
  print("TRIALS (yaw-mcp try)");
11838
11901
  if (gc.cleared > 0) {
11839
11902
  print(` swept ${gc.cleared} expired trial${gc.cleared === 1 ? "" : "s"} this run`);
@@ -11841,6 +11904,11 @@ async function renderTrialsSection(opts) {
11841
11904
  if (gc.failed > 0) {
11842
11905
  print(` ${gc.failed} expired trial${gc.failed === 1 ? "" : "s"} could not be swept -- see WARNINGS`);
11843
11906
  }
11907
+ if (unswept.length > 0) {
11908
+ print(
11909
+ ` ${unswept.length} expired trial${unswept.length === 1 ? "" : "s"} not swept (${READONLY_DIAGNOSTICS_ENV} is set) -- see WARNINGS`
11910
+ );
11911
+ }
11844
11912
  for (const { marker, msUntilExpiry } of scan.live) {
11845
11913
  print(` ${marker.slug} -> ${marker.clientName} (${marker.clientPath}) -- expires in ${formatTtl(msUntilExpiry)}`);
11846
11914
  }
@@ -17860,7 +17928,7 @@ var ConnectServer = class _ConnectServer {
17860
17928
  static SHUTDOWN_DRAIN_MS = 2e3;
17861
17929
  constructor() {
17862
17930
  this.server = new Server(
17863
- { name: "yaw-mcp", version: true ? "1.0.7" : "dev" },
17931
+ { name: "yaw-mcp", version: true ? "1.0.8" : "dev" },
17864
17932
  {
17865
17933
  capabilities: {
17866
17934
  tools: { listChanged: true },
@@ -21264,7 +21332,7 @@ function registerShutdownTriggers(shutdown, targets) {
21264
21332
  // src/status-cmd.ts
21265
21333
  import { existsSync as existsSync10 } from "fs";
21266
21334
  import { homedir as homedir23 } from "os";
21267
- var VERSION2 = true ? "1.0.7" : "dev";
21335
+ var VERSION2 = true ? "1.0.8" : "dev";
21268
21336
  var STATUS_SCHEMA_VERSION = 1;
21269
21337
  var STATUS_USAGE = `Usage: yaw-mcp status [--json]
21270
21338
 
@@ -21890,6 +21958,13 @@ if (subcommand === "compliance") {
21890
21958
  are written -- never the raw intent -- but
21891
21959
  ordinary words survive, so do not enable it on
21892
21960
  intents that carry names or other PII.
21961
+ YAW_MCP_READONLY_DIAGNOSTICS Set to \`1\` to make \`doctor\` and \`bundles\`
21962
+ write nothing, for a caller that runs them in
21963
+ the background: expired \`yaw-mcp try\` trials
21964
+ are reported as warnings instead of swept out
21965
+ of client configs, and a pre-0.12 config file
21966
+ is reported instead of moved into .yaw-mcp/
21967
+ (default: off; \`status\` never writes).
21893
21968
  YAW_MCP_CATALOG_URL Override the catalog \`add\`/\`try\` resolve slugs
21894
21969
  against (default https://yaw.sh/data/mcp-catalog.json).
21895
21970
 
@@ -22016,7 +22091,7 @@ if (subcommand === "compliance") {
22016
22091
  `);
22017
22092
  process.exitCode = 0;
22018
22093
  } else if (subcommand === "--version" || subcommand === "-V") {
22019
- process.stdout.write(`yaw-mcp ${true ? "1.0.7" : "dev"}
22094
+ process.stdout.write(`yaw-mcp ${true ? "1.0.8" : "dev"}
22020
22095
  `);
22021
22096
  process.exitCode = 0;
22022
22097
  } else if (subcommand !== void 0 && !subcommand.startsWith("-")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/mcp",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "mcpName": "io.github.YawLabs/mcp",
5
5
  "description": "MCP gateway and orchestrator: one local install fronts every MCP server for Claude Code, Cursor, and VS Code, loading tools on demand.",
6
6
  "license": "SEE LICENSE IN LICENSE.md",