@mrrlin-dev/mcp 0.4.262 → 0.4.268

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.
Files changed (2) hide show
  1. package/dist/bin.cjs +82 -20
  2. package/package.json +1 -1
package/dist/bin.cjs CHANGED
@@ -81216,7 +81216,12 @@ async function runDeliverableGate(target, deps) {
81216
81216
  };
81217
81217
  }
81218
81218
  if (result.outcome === "CONVERGED") {
81219
- return { outcome: result.outcome, rounds: result.rounds, headOutcomes: result.history.at(-1)?.headOutcomes ?? [] };
81219
+ return {
81220
+ outcome: result.outcome,
81221
+ rounds: result.rounds,
81222
+ headOutcomes: result.history.at(-1)?.headOutcomes ?? [],
81223
+ contentHash: currentHash
81224
+ };
81220
81225
  }
81221
81226
  return { outcome: result.outcome, rounds: result.rounds };
81222
81227
  }
@@ -101696,7 +101701,9 @@ var registerLocalCheckoutInputSchema = projectScopedSchema.extend({
101696
101701
  });
101697
101702
  var initLocalRepoInputSchema = projectScopedSchema.extend({
101698
101703
  path: external_exports.string().min(1).describe("Absolute path to the operator's project folder (not inside any git repository)."),
101699
- operatorConsent: external_exports.literal(true).describe("true only after the operator explicitly agreed in chat that this folder may become a git repository.")
101704
+ operatorConsent: external_exports.literal(true, {
101705
+ error: 'operatorConsent must be the JSON boolean true (not the string "true", not "yes"), passed only after the operator explicitly said yes in chat to turning this folder into a git repository.'
101706
+ }).describe("true only after the operator explicitly agreed in chat that this folder may become a git repository.")
101700
101707
  });
101701
101708
  var applyLocalRunInputSchema = projectScopedSchema.extend({ runId: external_exports.string().min(1) });
101702
101709
  var setProjectCodeHostInputSchema = projectScopedSchema.extend({
@@ -101869,7 +101876,7 @@ var mcpToolDescriptions = {
101869
101876
  [mcpToolNames.listTaskDependencies]: "List task blocked-by dependencies.",
101870
101877
  [mcpToolNames.listTaskEvents]: "List append-only events recorded for a task, including autonomy verdict changes.",
101871
101878
  [mcpToolNames.listTasks]: "List tasks for a project. Optional `q` does case-insensitive substring search over task id, title, notes, and tags \u2014 the primary way to find tasks by topic. Other optional filters: status, category, subcategory, type, impact, autonomy, assignee, blockedBy.",
101872
- [mcpToolNames.listTaxonomy]: "List allowed project category/subcategory pairs. Every new project starts with the same defaults (seo/content, seo/technical, seo/directory, outreach/partners), so never infer what the business does from them.",
101879
+ [mcpToolNames.listTaxonomy]: "List allowed project category/subcategory pairs. A new project starts with one neutral pair (general/general); projects created earlier may still carry the old defaults (seo/content, seo/technical, seo/directory, outreach/partners). Never infer what the business does from categories. Once you know the project's goal, propose 2-4 pairs that fit it and create them with create_taxonomy_entry after the operator agrees.",
101873
101880
  [mcpToolNames.listWikiPages]: "List markdown Wiki pages with optional folder/search filters.",
101874
101881
  [mcpToolNames.searchWikiPages]: "Search project Wiki pages using ranked full-text search. Returns excerpts suitable for grounding Director decisions.",
101875
101882
  [mcpToolNames.searchKnowledge]: "Search the rendered Mrrlin docs wiki using the lexical RAG index. Returns cited chunks with stable wiki_url fields.",
@@ -101908,7 +101915,7 @@ var mcpToolDescriptions = {
101908
101915
  [mcpToolNames.stopExecutionRun]: "Operator stop: park an in-flight execution run at handoff_requested with blockingReason operator_stopped. Parks rather than cancels, so restart_execution_run can resume it later. Refuses (409) a run already at a terminal status.",
101909
101916
  [mcpToolNames.resolveHandoff]: "Resolve a tool_assisted handoff for an execution run (outcome success|failure). Success returns the task to the board; failure opens a new handoff cycle. Idempotent.",
101910
101917
  [mcpToolNames.registerLocalCheckout]: "Register the operator-local git checkout path for `projectSlug` so execution-run workers run code on this machine instead of the cloud. Validates the path is a git repo whose `origin` remote matches `repo`, then writes the (slug -> absolute path) entry to the operator-local checkout registry. For a project with no GitHub (code kept only on this computer), omit `repo`: the path must then be the top of a git repository owned by the operator, not the home folder, a system folder or a credentials/settings folder such as ~/.ssh, ~/.aws or ~/.config. Call this after locating the checkout on disk (e.g. via filesystem search) and confirming the choice with the user in chat \u2014 they should NOT have to paste the path into Settings. Returns `{ projectSlug, path, confirmedAt }`. Idempotent: re-registering overwrites the prior entry.",
101911
- [mcpToolNames.initLocalRepo]: "For a project with no GitHub whose folder is not a git repository yet: run `git init` and one initial commit in the operator's own folder, then register it. Call ONLY after asking the operator in chat, in plain words, and getting an explicit yes; pass operatorConsent: true. Refuses a folder already inside a git repository, the home folder or any folder containing it, a filesystem root, a system folder, or a credentials/settings folder such as ~/.ssh, ~/.aws, ~/.gnupg or ~/.config. Adds a default .gitignore (node_modules, build output, .env files) only when the folder has none.",
101918
+ [mcpToolNames.initLocalRepo]: "For a project with no GitHub whose folder is not a git repository yet: run `git init` and one initial commit in the operator's own folder, then register it. Call ONLY after asking the operator in chat, in plain words, and getting an explicit yes; pass operatorConsent: true (the JSON boolean, not a string). Refuses a folder already inside a git repository, the home folder or any folder containing it, a filesystem root, a system folder, or a credentials/settings folder such as ~/.ssh, ~/.aws, ~/.gnupg or ~/.config. Adds a default .gitignore (node_modules, build output, .env files) only when the folder has none.",
101912
101919
  [mcpToolNames.setProjectCodeHost]: "Record where this project's code lives, after the operator answered the code-host question: local (keep it on this computer), github or gitlab (they want to push there; connect it next). Does not move any code.",
101913
101920
  [mcpToolNames.applyLocalRun]: "Land a finished local run's commits on the project's main branch again: retries a landing that could not happen when the task closed (folder had unsaved changes, main moved, files in the way) and backfills runs closed before auto-landing existed. Only for a run that is done on a task that is closed_done and delivered locally (deliveryRef). Merges the newest main into the run branch and re-runs the build/tests before fast-forwarding; a conflict or a red build is reported, never forced.",
101914
101921
  [mcpToolNames.retrieveContext]: "Rehydrate a mrrlin:// handle emitted by the compact-context layer into the full canonical Mrrlin record (task/wiki page/project snapshot/execution run/artifacts). Use whenever you need the full source \u2014 irreversible decisions (closing tasks, dispatching deploys, writing specs) MUST call this first; never act on a compact envelope alone. Returns `{ kind, data }`. Invalid or unsupported handle \u2192 structured `HANDLE_INVALID` error."
@@ -106912,7 +106919,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
106912
106919
  }
106913
106920
 
106914
106921
  // src/_generated/version.ts
106915
- var PKG_VERSION = "0.4.262";
106922
+ var PKG_VERSION = "0.4.268";
106916
106923
 
106917
106924
  // src/bridge-allowed-origins.ts
106918
106925
  var DEFAULT_DIRECTOR_BRIDGE_ALLOWED_ORIGINS = [
@@ -113504,6 +113511,10 @@ async function releaseRestartedWorktrees(deps, projectSlug, runId) {
113504
113511
  }
113505
113512
  }
113506
113513
  function f54ProgressRequested(env = process.env) {
113514
+ const raw = (env.MRRLIN_F54_PROGRESS_LEASE ?? "").trim().toLowerCase();
113515
+ return raw !== "0" && raw !== "false";
113516
+ }
113517
+ function f54ProgressExplicit(env = process.env) {
113507
113518
  const raw = (env.MRRLIN_F54_PROGRESS_LEASE ?? "").trim().toLowerCase();
113508
113519
  return raw === "1" || raw === "true";
113509
113520
  }
@@ -113528,8 +113539,9 @@ async function driveRun(deps, projectSlug, runId, shutdown) {
113528
113539
  if (shutdown?.aborted) return;
113529
113540
  const supervisor = deps.drainSupervisor === void 0 ? defaultDrainSupervisor() : deps.drainSupervisor;
113530
113541
  const requested = f54ProgressRequested();
113531
- const askProgress = requested ? resolveF54ProgressLease(await claimIsContainable(deps, supervisor)) : false;
113532
- if (requested && !askProgress) {
113542
+ const platform = deps.platform ?? process.platform;
113543
+ const askProgress = requested ? resolveF54ProgressLease(await claimIsContainable(deps, supervisor, platform)) : false;
113544
+ if (requested && !askProgress && f54ProgressExplicit()) {
113533
113545
  console.warn(JSON.stringify({ event: "execution_lease_containment_unavailable", projectSlug, runId, mode: "legacy" }));
113534
113546
  }
113535
113547
  const started = import_node_perf_hooks.performance.now();
@@ -113573,7 +113585,7 @@ async function driveRun(deps, projectSlug, runId, shutdown) {
113573
113585
  await releaseUnstartedClaim("drain_supervision_unavailable");
113574
113586
  return;
113575
113587
  }
113576
- if (progressLease && !supervision && !await launcherContains(deps, process.platform)) {
113588
+ if (progressLease && !supervision && !await launcherContains(deps, platform)) {
113577
113589
  await releaseUnstartedClaim("drain_supervision_unavailable");
113578
113590
  return;
113579
113591
  }
@@ -115752,6 +115764,7 @@ async function driveNonCodeRun(deps, projectSlug, runId, leaseId, task, domain2,
115752
115764
  );
115753
115765
  return;
115754
115766
  }
115767
+ const settledContentHash = gateResult.contentHash ?? contentHash;
115755
115768
  if (parsedResult.outcome === "negative_result") {
115756
115769
  try {
115757
115770
  await writeNegativeResultEvidencePage(deps.client, projectSlug, task, {
@@ -115844,7 +115857,7 @@ ${lines2}`
115844
115857
  {
115845
115858
  artifactId: pageId,
115846
115859
  storageVersion: "1",
115847
- contentHash,
115860
+ contentHash: settledContentHash,
115848
115861
  kind: "deliverable_page"
115849
115862
  },
115850
115863
  ...urlArtifacts
@@ -115880,7 +115893,7 @@ ${lines2}`
115880
115893
  outcome: parsedResult.outcome,
115881
115894
  resultSummary: parsedResult.resultSummary,
115882
115895
  deliverablePageId: pageId,
115883
- contentHash,
115896
+ contentHash: settledContentHash,
115884
115897
  ...receipt ? { receipt } : {}
115885
115898
  });
115886
115899
  if (!settled && await runHasLease(deps, projectSlug, runId, leaseId)) {
@@ -128302,7 +128315,7 @@ async function startBridge(startupDeps, agentSecret, startupRollback) {
128302
128315
  if (controller) activeDrives.set(controller, drive);
128303
128316
  };
128304
128317
  const driveRunNow = driveTracked;
128305
- const asyncShutdown = progressExecution && process.platform === "win32" ? new AbortController() : void 0;
128318
+ const asyncShutdown = f54ProgressExplicit() && process.platform === "win32" ? new AbortController() : void 0;
128306
128319
  startupRollback?.add(() => {
128307
128320
  executionStopping = true;
128308
128321
  asyncShutdown?.abort();
@@ -130552,6 +130565,11 @@ function jsonSchemaPrimitiveType(schema) {
130552
130565
  const current2 = unwrapZodSchema(schema);
130553
130566
  if (current2 instanceof external_exports.ZodNumber) return "number";
130554
130567
  if (current2 instanceof external_exports.ZodBoolean) return "boolean";
130568
+ if (current2 instanceof external_exports.ZodLiteral) {
130569
+ const values = [...current2.values];
130570
+ if (values.length > 0 && values.every((value) => typeof value === "boolean")) return "boolean";
130571
+ if (values.length > 0 && values.every((value) => typeof value === "number")) return "number";
130572
+ }
130555
130573
  return "string";
130556
130574
  }
130557
130575
  function jsonSchemaProperty(schema) {
@@ -131767,7 +131785,9 @@ async function runDoctor(flags, deps) {
131767
131785
  id: "restart",
131768
131786
  ok: hookOk,
131769
131787
  detail: hook.status === "configured" ? `starts after a restart (${hook.label})` : hook.status === "unknown" ? "not checked on this platform" : hook.status === "registered_failing" ? `${hook.label} is registered but failed with exit code ${hook.lastExitCode}` : "nothing starts the helper after a restart",
131770
- fix: hookOk ? null : "run mrrlin-mcp connect with a new setup code from Mrrlin",
131788
+ // Dogfood v4 N19: was "run mrrlin-mcp connect with a new setup code", a second round trip for
131789
+ // the one part of setup that needs no code.
131790
+ fix: hookOk ? null : "run mrrlin-mcp start-after-restart",
131771
131791
  counted: true
131772
131792
  });
131773
131793
  try {
@@ -131874,6 +131894,17 @@ function removeBridgeLaunchAgent(deps) {
131874
131894
  }
131875
131895
  return { ok: true, message: "Removed the LaunchAgent." };
131876
131896
  }
131897
+ function classifyLaunchAgentProbe(input) {
131898
+ if (!input.plistExists) return null;
131899
+ if (!input.loaded) {
131900
+ return input.label === BRIDGE_LAUNCH_AGENT_LABEL && input.plistRunsAtLoad && input.plistProgramExists === true ? { status: "configured", label: `${input.label} (loads at next login)` } : null;
131901
+ }
131902
+ const runs = /^\s*runs\s*=\s*(\d+)/m.exec(input.stdout);
131903
+ const exitCode = /^\s*last exit code\s*=\s*(-?\d+)/m.exec(input.stdout);
131904
+ if (!exitCode || runs?.[1] === "0") return { status: "configured", label: input.label };
131905
+ const code = Number(exitCode[1]);
131906
+ return code === 0 ? { status: "configured", label: input.label } : { status: "registered_failing", label: input.label, lastExitCode: code };
131907
+ }
131877
131908
 
131878
131909
  // src/windows-startup.ts
131879
131910
  var import_node_path61 = __toESM(require("node:path"), 1);
@@ -132104,14 +132135,28 @@ function bootHookStatus() {
132104
132135
  ];
132105
132136
  for (const candidate of candidates) {
132106
132137
  const printed = (0, import_node_child_process35.spawnSync)("launchctl", ["print", `gui/${uid}/${candidate.label}`], { encoding: "utf8" });
132107
- if (printed.status !== 0) continue;
132108
- if (!(0, import_node_fs46.existsSync)(candidate.plist)) continue;
132109
- const out = printed.stdout ?? "";
132110
- const runs = /^\s*runs\s*=\s*(\d+)/m.exec(out);
132111
- const exitCode = /^\s*last exit code\s*=\s*(-?\d+)/m.exec(out);
132112
- if (!exitCode || runs?.[1] === "0") return { status: "configured", label: candidate.label };
132113
- const code = Number(exitCode[1]);
132114
- return code === 0 ? { status: "configured", label: candidate.label } : { status: "registered_failing", label: candidate.label, lastExitCode: code };
132138
+ const plistExists = (0, import_node_fs46.existsSync)(candidate.plist);
132139
+ let plistRunsAtLoad = false;
132140
+ let plistProgramExists = false;
132141
+ if (plistExists && printed.status !== 0) {
132142
+ try {
132143
+ const plist = (0, import_node_fs46.readFileSync)(candidate.plist, "utf8");
132144
+ plistRunsAtLoad = /<key>RunAtLoad<\/key>\s*<true\/>/.test(plist);
132145
+ const program = /<key>ProgramArguments<\/key>\s*<array>\s*<string>([^<]+)<\/string>/.exec(plist)?.[1];
132146
+ plistProgramExists = Boolean(program && (0, import_node_fs46.existsSync)(program));
132147
+ } catch {
132148
+ plistRunsAtLoad = false;
132149
+ }
132150
+ }
132151
+ const status = classifyLaunchAgentProbe({
132152
+ label: candidate.label,
132153
+ loaded: printed.status === 0,
132154
+ stdout: printed.stdout ?? "",
132155
+ plistExists,
132156
+ plistRunsAtLoad,
132157
+ plistProgramExists
132158
+ });
132159
+ if (status) return status;
132115
132160
  }
132116
132161
  return { status: "not_configured" };
132117
132162
  }
@@ -132432,6 +132477,10 @@ Usage:
132432
132477
  disposable worktree cwd; set
132433
132478
  MRRLIN_DIRECTOR_BRIDGE_CODEX_CWD to override.
132434
132479
 
132480
+ mrrlin-mcp start-after-restart
132481
+ Start the helper after a restart (macOS: the
132482
+ per-user LaunchAgent; Windows: the Startup
132483
+ folder entry). No setup code needed.
132435
132484
  mrrlin-mcp uninstall-service Stop and remove the mrrlin-bridge pm2
132436
132485
  [--purge-secret] process, delete the ecosystem.config.cjs,
132437
132486
  and optionally wipe the local agent credential
@@ -132642,6 +132691,19 @@ async function main() {
132642
132691
  process.exitCode = await runDoctor({ json: rest.includes("--json"), logs: rest.includes("--logs") }, realDoctorDeps());
132643
132692
  return;
132644
132693
  }
132694
+ // Dogfood v4 N19: the same start-after-restart hook `connect` sets up, without a setup code, so
132695
+ // a missing hook (doctor's "restart" line) is fixed in place instead of with a second code.
132696
+ case "start-after-restart": {
132697
+ if (process.platform !== "darwin" && process.platform !== "win32") {
132698
+ process.stderr.write("[mrrlin-mcp start-after-restart] On Linux, run `pm2 startup` and follow the command it prints.\n");
132699
+ process.exit(2);
132700
+ }
132701
+ const hook = process.platform === "win32" ? installWindowsStartup(realWindowsStartupDeps()) : installBridgeLaunchAgent(realLaunchAgentDeps());
132702
+ process.stderr.write(`[mrrlin-mcp start-after-restart] ${hook.ok ? "set up" : `failed: ${hook.message}`}
132703
+ `);
132704
+ if (!hook.ok) process.exit(2);
132705
+ return;
132706
+ }
132645
132707
  case "install-service": {
132646
132708
  const ok = installService({
132647
132709
  env: process.env,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.262",
3
+ "version": "0.4.268",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"