@mrrlin-dev/mcp 0.4.91 → 0.4.93

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 +39 -12
  2. package/package.json +1 -1
package/dist/bin.cjs CHANGED
@@ -39406,6 +39406,7 @@ var mrrlinProjectSchedulerPolicySchema = external_exports.object({
39406
39406
  createdAt: external_exports.string().datetime(),
39407
39407
  // Slice 3 Part E: combined per-UTC-day cap on scheduler-enqueued draft/consensus jobs.
39408
39408
  dailyAutonomousJobBudget: external_exports.number().int().nonnegative(),
39409
+ defaultAutoDeploy: mrrlinAutoDeploySchema,
39409
39410
  eligibleAutonomyLevels: external_exports.array(mrrlinAutonomyLevelSchema).min(1),
39410
39411
  // Slice 3 Part E: cap on concurrently active scheduler-created (ER-SCHED-*) runs.
39411
39412
  maxConcurrentAutonomousRuns: external_exports.number().int().nonnegative(),
@@ -39421,6 +39422,7 @@ var mrrlinProjectSchedulerPolicyUpsertSchema = external_exports.object({
39421
39422
  autoSpecApproval: mrrlinAutoSpecApprovalSchema.optional(),
39422
39423
  cadenceSeconds: external_exports.number().int().positive().nullable().optional(),
39423
39424
  dailyAutonomousJobBudget: external_exports.number().int().nonnegative().optional(),
39425
+ defaultAutoDeploy: mrrlinAutoDeploySchema.optional(),
39424
39426
  eligibleAutonomyLevels: external_exports.array(mrrlinAutonomyLevelSchema).min(1).optional(),
39425
39427
  maxConcurrentAutonomousRuns: external_exports.number().int().nonnegative().optional(),
39426
39428
  prodGraceSeconds: external_exports.number().int().nonnegative().optional(),
@@ -50980,7 +50982,7 @@ async function invokeCapability(server, toolName, payload) {
50980
50982
  throw classifyInvokeError(error51, target, toolName);
50981
50983
  }
50982
50984
  if (result.isError) {
50983
- throw new Error(`invokeCapability: tool "${toolName}" reported isError -- ${extractFirstText(result.content)}`);
50985
+ throw new InvokeToolExecutionError(toolName, extractFirstText(result.content));
50984
50986
  }
50985
50987
  return { content: result.content, url: extractFirstUrl(result.content) };
50986
50988
  } finally {
@@ -50994,6 +50996,12 @@ var InvokeToolNotFoundError = class extends Error {
50994
50996
  this.name = "InvokeToolNotFoundError";
50995
50997
  }
50996
50998
  };
50999
+ var InvokeToolExecutionError = class extends Error {
51000
+ constructor(toolName, detail, cause) {
51001
+ super(`invokeCapability: tool "${toolName}" reported isError -- ${detail}`, { cause });
51002
+ this.name = "InvokeToolExecutionError";
51003
+ }
51004
+ };
50997
51005
  var InvokeUnreachableError = class extends Error {
50998
51006
  constructor(url2, cause) {
50999
51007
  super(`invokeCapability: could not reach the granted server at ${url2}`, { cause });
@@ -51027,9 +51035,12 @@ function classifyInvokeError(error51, url2, toolName) {
51027
51035
  return new InvokeUnreachableError(url2, error51);
51028
51036
  }
51029
51037
  if (error51 instanceof McpError) {
51030
- if (error51.code === ErrorCode.MethodNotFound || error51.code === ErrorCode.InvalidParams) {
51038
+ if (error51.code === ErrorCode.MethodNotFound) {
51031
51039
  return new InvokeToolNotFoundError(toolName, error51);
51032
51040
  }
51041
+ if (error51.code === ErrorCode.InvalidParams) {
51042
+ return new InvokeMalformedResultError(`invalid parameters for tool "${toolName}": ${error51.message}`, error51);
51043
+ }
51033
51044
  return new InvokeMalformedResultError(error51.message, error51);
51034
51045
  }
51035
51046
  if (error51 instanceof TypeError || error51 instanceof Error && (error51.name === "TimeoutError" || error51.name === "AbortError")) {
@@ -51041,8 +51052,15 @@ function isRecord(value) {
51041
51052
  return typeof value === "object" && value !== null && !Array.isArray(value);
51042
51053
  }
51043
51054
  function extractFirstUrl(content) {
51044
- const match = findFirstMatch(content, /https?:\/\/\S+/);
51045
- return match ? match.replace(/[.,;:!?"')\]}>]+$/, "") : null;
51055
+ const match = findFirstMatch(content, /https?:\/\/[^\s<>|]+/);
51056
+ if (!match) return null;
51057
+ const cleaned = match.replace(/[.,;:!?"')\]}]+$/, "");
51058
+ try {
51059
+ const parsed = new URL(cleaned);
51060
+ return parsed.href;
51061
+ } catch {
51062
+ return null;
51063
+ }
51046
51064
  }
51047
51065
  function extractFirstText(content) {
51048
51066
  if (Array.isArray(content)) {
@@ -51086,9 +51104,11 @@ function parsePullRequestUrl(url2) {
51086
51104
  const owner = parts[pullIdx - 2];
51087
51105
  const repo = parts[pullIdx - 1];
51088
51106
  const pullPart = parts[pullIdx + 1];
51089
- const pullNumber = pullPart ? parseInt(pullPart, 10) : NaN;
51090
- if (owner && repo && !Number.isNaN(pullNumber)) {
51091
- return { owner, repo, pullNumber };
51107
+ if (pullPart && /^\d+$/.test(pullPart)) {
51108
+ const pullNumber = parseInt(pullPart, 10);
51109
+ if (owner && repo && !Number.isNaN(pullNumber)) {
51110
+ return { owner, repo, pullNumber };
51111
+ }
51092
51112
  }
51093
51113
  }
51094
51114
  } catch {
@@ -51128,7 +51148,7 @@ async function deliverToGit(server, toolName, payload) {
51128
51148
  }
51129
51149
  return invokeCapability(server, toolName, args);
51130
51150
  }
51131
- if (isDefaultGitHubRoute && toolName === defaultRoute.operations.pull_request_state) {
51151
+ if (isDefaultGitHubRoute && (toolName === defaultRoute.operations.pull_request_state || toolName === "pull_request_read")) {
51132
51152
  const { operation: _operation, ...args } = payload;
51133
51153
  const urlParts = parsePullRequestUrl(payload.pullRequestUrl);
51134
51154
  let owner = args.owner ?? urlParts.owner;
@@ -51144,7 +51164,12 @@ async function deliverToGit(server, toolName, payload) {
51144
51164
  if (owner) adaptedArgs.owner = owner;
51145
51165
  if (repo) adaptedArgs.repo = repo;
51146
51166
  if (pullNumber !== void 0) {
51147
- adaptedArgs.pull_number = pullNumber;
51167
+ if (toolName === "pull_request_read") {
51168
+ adaptedArgs.method = "get";
51169
+ adaptedArgs.pullNumber = pullNumber;
51170
+ } else {
51171
+ adaptedArgs.pull_number = pullNumber;
51172
+ }
51148
51173
  }
51149
51174
  return invokeCapability(server, toolName, adaptedArgs);
51150
51175
  }
@@ -51232,8 +51257,10 @@ async function deliverToSend(server, toolName, payload) {
51232
51257
  const defaultRoute = server.id ? getDefaultCapabilityRouteForServer(server.id) : null;
51233
51258
  const isDefaultSlackRoute = defaultRoute?.capability === "send";
51234
51259
  if (payload.operation === "dispatch" && isDefaultSlackRoute && toolName === defaultRoute.operations.dispatch) {
51235
- const channelId = args.channel_id ?? args.destination ?? args.channel ?? args.to;
51236
- const text = args.text ?? args.body ?? args.message ?? args.content;
51260
+ const rawChannel = args.channel_id ?? args.destination ?? args.channel ?? args.to;
51261
+ const channelId = typeof rawChannel === "string" ? rawChannel.trim() : rawChannel !== void 0 ? String(rawChannel) : void 0;
51262
+ const rawText = args.text ?? args.body ?? args.message ?? args.content;
51263
+ const text = typeof rawText === "string" ? rawText.trim() : rawText !== void 0 ? String(rawText) : void 0;
51237
51264
  const adaptedArgs = {};
51238
51265
  if (channelId !== void 0) adaptedArgs.channel_id = channelId;
51239
51266
  if (text !== void 0) adaptedArgs.text = text;
@@ -57691,7 +57718,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
57691
57718
  }
57692
57719
 
57693
57720
  // src/_generated/version.ts
57694
- var PKG_VERSION = "0.4.91";
57721
+ var PKG_VERSION = "0.4.93";
57695
57722
 
57696
57723
  // src/api-base-url-migrate.ts
57697
57724
  var import_node_fs13 = __toESM(require("node:fs"), 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.91",
3
+ "version": "0.4.93",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"