@mrrlin-dev/mcp 0.4.247 → 0.4.249

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 +42 -14
  2. package/package.json +1 -1
package/dist/bin.cjs CHANGED
@@ -91934,6 +91934,12 @@ function validateCandidateUrl(rawUrl) {
91934
91934
  }
91935
91935
  return parsed.toString().replace(/\/$/, "");
91936
91936
  }
91937
+ function parseGitHubRepository(value) {
91938
+ if (!value) return null;
91939
+ const match2 = /^([A-Za-z0-9](?:[A-Za-z0-9-]{0,38}))\/([A-Za-z0-9_.-]{1,100})$/.exec(value);
91940
+ if (!match2 || !match2[1] || !match2[2] || match2[2] === "." || match2[2] === "..") return null;
91941
+ return { org: match2[1], repo: match2[2] };
91942
+ }
91937
91943
  var VercelAdapter = class {
91938
91944
  profileId = "vercel.v1";
91939
91945
  adapterVersion = "1.0.0";
@@ -91974,6 +91980,12 @@ var VercelAdapter = class {
91974
91980
  if (!manifest.gitCommitSha || !/^[0-9a-f]{40}$/.test(manifest.gitCommitSha)) {
91975
91981
  return { eligible: false, reason: "Git source mode requires a 40-character commit SHA" };
91976
91982
  }
91983
+ if (!parseGitHubRepository(manifest.gitRepository)) {
91984
+ return { eligible: false, reason: "Git source mode requires a GitHub repository in owner/repo format" };
91985
+ }
91986
+ if (computeSourceManifestDigest({ mode: "git_commit", gitCommitSha: manifest.gitCommitSha }) !== manifest.sourceDigest) {
91987
+ return { eligible: false, reason: "Git source digest does not match the requested commit" };
91988
+ }
91977
91989
  return { eligible: true };
91978
91990
  }
91979
91991
  if (manifest.mode === "inline_manifest") {
@@ -91997,15 +92009,15 @@ var VercelAdapter = class {
91997
92009
  throw new VercelContractError(targetValidation.reason);
91998
92010
  }
91999
92011
  const target = targetValidation.target;
92000
- const sourceEligibility = this.isSourceEligible(params.sourceManifest);
92001
- if (!sourceEligibility.eligible) {
92002
- throw new VercelContractError(sourceEligibility.reason);
92003
- }
92004
92012
  if (!params.operationId || typeof params.operationId !== "string") {
92005
92013
  throw new VercelContractError("PrepareRequestParams must specify non-empty operationId");
92006
92014
  }
92007
92015
  const op = normalizePublisherOperation(params.operation);
92008
92016
  if (op === "publish_release" || op === "publish_preview") {
92017
+ const sourceEligibility = this.isSourceEligible(params.sourceManifest);
92018
+ if (!sourceEligibility.eligible) {
92019
+ throw new VercelContractError(sourceEligibility.reason);
92020
+ }
92009
92021
  if (op === "publish_release") {
92010
92022
  if (params.environment !== "production") {
92011
92023
  throw new VercelContractError(
@@ -92075,8 +92087,12 @@ var VercelAdapter = class {
92075
92087
  if (params.sourceManifest.mode === "inline_manifest") {
92076
92088
  requestBody.files = filesPayload;
92077
92089
  } else if (params.sourceManifest.mode === "git_commit") {
92090
+ const repository = parseGitHubRepository(params.sourceManifest.gitRepository);
92091
+ if (!repository) throw new VercelContractError("GitHub repository is missing or invalid");
92078
92092
  requestBody.gitSource = {
92079
92093
  type: "github",
92094
+ org: repository.org,
92095
+ repo: repository.repo,
92080
92096
  sha: params.sourceManifest.gitCommitSha
92081
92097
  };
92082
92098
  }
@@ -106839,7 +106855,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
106839
106855
  }
106840
106856
 
106841
106857
  // src/_generated/version.ts
106842
- var PKG_VERSION = "0.4.247";
106858
+ var PKG_VERSION = "0.4.249";
106843
106859
 
106844
106860
  // src/bridge-allowed-origins.ts
106845
106861
  var DEFAULT_DIRECTOR_BRIDGE_ALLOWED_ORIGINS = [
@@ -111671,8 +111687,8 @@ function renderTaskNotesContractLines(journalWriter = false) {
111671
111687
  " Adapt depth to the task: a one-line fix needs one sentence, not four headings."
111672
111688
  ];
111673
111689
  }
111674
- function taskJournalWriterEnabled(projectSlug, allowlist = process.env.MRRLIN_TASK_JOURNAL_WRITER_PROJECTS) {
111675
- return Boolean(projectSlug && projectSlug !== "*" && allowlist?.split(",").some((slug) => slug.trim() === projectSlug));
111690
+ function taskJournalWriterEnabled(projectSlug, killSwitch = process.env.MRRLIN_TASK_JOURNAL_WRITER_PROJECTS) {
111691
+ return Boolean(projectSlug && projectSlug !== "*") && killSwitchOn(killSwitch);
111676
111692
  }
111677
111693
  var TASK_JOURNAL_WRITER_INSTRUCTIONS = [
111678
111694
  "Progress journal for the active project (overrides progress-write destinations elsewhere in these instructions):",
@@ -125287,7 +125303,7 @@ function buildThreadStartParams(msg, config2, desiredModel) {
125287
125303
  ' Good: "Audit crawled-not-indexed pages and fix 404 errors"',
125288
125304
  ' Bad: "GSC coverage triage crawled-not-indexed + 404"',
125289
125305
  ...renderTaskNotesContractLines(taskJournalWriterEnabled(projectSlug)),
125290
- ...taskJournalWriterEnabled(projectSlug) ? [`Apply this journal pilot only to the exact project "${projectSlug}".`, TASK_JOURNAL_WRITER_INSTRUCTIONS] : [],
125306
+ ...taskJournalWriterEnabled(projectSlug) ? [`Apply these journal instructions to the project "${projectSlug}".`, TASK_JOURNAL_WRITER_INSTRUCTIONS] : [],
125291
125307
  // early-intent-confirmation (design.md, "The chat contract"): the core block below is copied
125292
125308
  // VERBATIM from design.md, per tasks.md 10.1. It replaces an older sentence that also carried
125293
125309
  // "omit operatorSeedRequest only when there is genuinely no operator request behind the task
@@ -127650,9 +127666,20 @@ function closeStartupWebSocketServer(server) {
127650
127666
  for (const socket of server.clients) socket.terminate();
127651
127667
  });
127652
127668
  }
127669
+ function staticOwnedSdkEnabled(env = process.env, platform = process.platform) {
127670
+ return platform !== "win32" && killSwitchOn(env.MRRLIN_BRIDGE_STATIC_OWNED_SDK);
127671
+ }
127672
+ function resolveDurableBridgeTransports(agentSecret, env = process.env) {
127673
+ const scopedScheduler = agentSecret && killSwitchOn(env.MRRLIN_BRIDGE_SCOPED_SCHEDULER);
127674
+ return {
127675
+ scopedScheduler,
127676
+ ownedSdk: scopedScheduler && killSwitchOn(env.MRRLIN_BRIDGE_OWNED_SDK),
127677
+ scopedRunRead: scopedScheduler && killSwitchOn(env.MRRLIN_BRIDGE_SCOPED_RUN_READ)
127678
+ };
127679
+ }
127653
127680
  async function startDirectorBridge(startupDeps = {}) {
127654
127681
  const agentSecret = readAgentSecret();
127655
- const staticBearer = !agentSecret && process.env.MRRLIN_BRIDGE_STATIC_OWNED_SDK === "1" ? process.env.MRRLIN_TOKEN?.trim() || readOperatorToken() || void 0 : void 0;
127682
+ const staticBearer = !agentSecret && staticOwnedSdkEnabled() ? process.env.MRRLIN_TOKEN?.trim() || readOperatorToken() || void 0 : void 0;
127656
127683
  const rollback = [];
127657
127684
  let disposeTransport;
127658
127685
  try {
@@ -127689,7 +127716,7 @@ function resolveCompactBridgeOption(name, prerequisites, env = process.env, warn
127689
127716
  if (flag2 === "1" && !ready) {
127690
127717
  const missing = [
127691
127718
  ...prerequisites.agentSecret ? [] : ["a durable agent credential"],
127692
- ...prerequisites.scopedScheduler ? [] : ["MRRLIN_BRIDGE_SCOPED_SCHEDULER=1"]
127719
+ ...prerequisites.scopedScheduler ? [] : ["the scoped scheduler (MRRLIN_BRIDGE_SCOPED_SCHEDULER is switched off)"]
127693
127720
  ].join(" and ");
127694
127721
  warn(`[mrrlin-mcp director-bridge] ${name}=1 ignored: it requires ${missing}; staying off
127695
127722
  `);
@@ -127697,7 +127724,7 @@ function resolveCompactBridgeOption(name, prerequisites, env = process.env, warn
127697
127724
  return ready;
127698
127725
  }
127699
127726
  async function startBridge(startupDeps, agentSecret, startupRollback) {
127700
- const scopedScheduler = process.env.MRRLIN_BRIDGE_SCOPED_SCHEDULER === "1";
127727
+ const { scopedScheduler, ownedSdk, scopedRunRead } = resolveDurableBridgeTransports(Boolean(agentSecret));
127701
127728
  const compactPrerequisites = { agentSecret: !!agentSecret, scopedScheduler };
127702
127729
  const compactTick = resolveCompactBridgeOption("MRRLIN_BRIDGE_COMPACT_SCHEDULER", compactPrerequisites);
127703
127730
  const compactHeartbeat = resolveCompactBridgeOption("MRRLIN_BRIDGE_COMPACT_HEARTBEAT", compactPrerequisites);
@@ -127780,8 +127807,6 @@ async function startBridge(startupDeps, agentSecret, startupRollback) {
127780
127807
  let schedulerScope;
127781
127808
  let transportFatal = null;
127782
127809
  let reportTransportFatal = null;
127783
- const ownedSdk = Boolean(agentSecret) && scopedScheduler && process.env.MRRLIN_BRIDGE_OWNED_SDK === "1";
127784
- const scopedRunRead = Boolean(agentSecret) && scopedScheduler && process.env.MRRLIN_BRIDGE_SCOPED_RUN_READ === "1";
127785
127810
  const baseFetch = globalThis.fetch;
127786
127811
  let staticToken;
127787
127812
  let authedFetch;
@@ -130521,6 +130546,9 @@ function createMrrlinMcpServer(options = {}, owned) {
130521
130546
  });
130522
130547
  return { resolved, server };
130523
130548
  }
130549
+ function stdioOwnedHttpEnabled(env = process.env, platform = process.platform) {
130550
+ return platform !== "win32" && killSwitchOn(env.MRRLIN_MCP_STDIO_OWNED_HTTP);
130551
+ }
130524
130552
  async function startStdioServer(options = {}) {
130525
130553
  let effective = options;
130526
130554
  if (!options.apiBaseUrl) {
@@ -130549,7 +130577,7 @@ async function startStdioServer(options = {}) {
130549
130577
  }
130550
130578
  }
130551
130579
  const resolvedOptions = resolveServerOptions(effective);
130552
- const owned = process.env.MRRLIN_MCP_STDIO_OWNED_HTTP === "1" && !effective.fetch && !effective.createOperation ? createStdioOwnedTransport(resolvedOptions) : void 0;
130580
+ const owned = stdioOwnedHttpEnabled() && !effective.fetch && !effective.createOperation ? createStdioOwnedTransport(resolvedOptions) : void 0;
130553
130581
  try {
130554
130582
  const { resolved, server } = createMrrlinMcpServer({ ...effective, createOperation: owned?.createOperation ?? effective.createOperation }, owned);
130555
130583
  const transport = new StdioServerTransport();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.247",
3
+ "version": "0.4.249",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"