@mrrlin-dev/mcp 0.4.131 → 0.4.133
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/bin.cjs +47 -43
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -54809,6 +54809,7 @@ async function deliverThroughCapability(client, input) {
|
|
|
54809
54809
|
await recordUse(client, route, resolvedToolName, input, "refused");
|
|
54810
54810
|
return { ok: false, reason: "gate_refused" };
|
|
54811
54811
|
}
|
|
54812
|
+
var MRRLIN_API_CAPABILITIES = /* @__PURE__ */ new Set(["wiki", "artifacts"]);
|
|
54812
54813
|
var RepoHostRouteUnavailableError = class extends Error {
|
|
54813
54814
|
constructor(message) {
|
|
54814
54815
|
super(message);
|
|
@@ -54818,7 +54819,8 @@ var RepoHostRouteUnavailableError = class extends Error {
|
|
|
54818
54819
|
var NoGrantForServerError = class extends RepoHostRouteUnavailableError {
|
|
54819
54820
|
};
|
|
54820
54821
|
async function proceedToDestination(client, route, resolvedToolName, input) {
|
|
54821
|
-
|
|
54822
|
+
const taskless = !input.taskId;
|
|
54823
|
+
if (taskless && !MRRLIN_API_CAPABILITIES.has(route.capability)) {
|
|
54822
54824
|
await recordUse(client, route, resolvedToolName, input, "refused");
|
|
54823
54825
|
return {
|
|
54824
54826
|
ok: false,
|
|
@@ -54826,7 +54828,7 @@ async function proceedToDestination(client, route, resolvedToolName, input) {
|
|
|
54826
54828
|
message: "taskId is required for capability permit issuance"
|
|
54827
54829
|
};
|
|
54828
54830
|
}
|
|
54829
|
-
if (!client.issueCapabilityPermit || !client.redeemCapabilityPermit) {
|
|
54831
|
+
if (!taskless && (!client.issueCapabilityPermit || !client.redeemCapabilityPermit)) {
|
|
54830
54832
|
await recordUse(client, route, resolvedToolName, input, "refused");
|
|
54831
54833
|
return {
|
|
54832
54834
|
ok: false,
|
|
@@ -54835,53 +54837,55 @@ async function proceedToDestination(client, route, resolvedToolName, input) {
|
|
|
54835
54837
|
};
|
|
54836
54838
|
}
|
|
54837
54839
|
let invocationId;
|
|
54838
|
-
|
|
54839
|
-
|
|
54840
|
-
|
|
54841
|
-
|
|
54842
|
-
|
|
54843
|
-
|
|
54844
|
-
|
|
54845
|
-
|
|
54846
|
-
|
|
54847
|
-
|
|
54848
|
-
|
|
54849
|
-
|
|
54850
|
-
|
|
54851
|
-
|
|
54852
|
-
|
|
54853
|
-
|
|
54854
|
-
|
|
54855
|
-
|
|
54856
|
-
|
|
54857
|
-
if (redemption.
|
|
54858
|
-
|
|
54859
|
-
|
|
54860
|
-
|
|
54861
|
-
|
|
54862
|
-
|
|
54840
|
+
if (input.taskId && client.issueCapabilityPermit && client.redeemCapabilityPermit) {
|
|
54841
|
+
try {
|
|
54842
|
+
const payloadDigest = import_node_crypto5.default.createHash("sha256").update(JSON.stringify(input.payload ?? null)).digest("hex");
|
|
54843
|
+
const permit = await client.issueCapabilityPermit(input.taskProjectSlug, {
|
|
54844
|
+
projectSlug: input.taskProjectSlug,
|
|
54845
|
+
taskId: input.taskId,
|
|
54846
|
+
serverId: route.serverId,
|
|
54847
|
+
capability: route.capability,
|
|
54848
|
+
toolName: resolvedToolName,
|
|
54849
|
+
operationClass: resolveOperationClass(route, "reversible"),
|
|
54850
|
+
payloadDigest
|
|
54851
|
+
});
|
|
54852
|
+
const idempotencyKey = `deliver:${input.taskProjectSlug}:${permit.id}`;
|
|
54853
|
+
const redemption = await client.redeemCapabilityPermit(input.taskProjectSlug, {
|
|
54854
|
+
permitId: permit.id,
|
|
54855
|
+
idempotencyKey,
|
|
54856
|
+
payloadDigest
|
|
54857
|
+
});
|
|
54858
|
+
invocationId = redemption.id;
|
|
54859
|
+
if (redemption.replayed) {
|
|
54860
|
+
if (redemption.status === "completed") {
|
|
54861
|
+
const recorded = await recordUse(client, route, resolvedToolName, input, "ok");
|
|
54862
|
+
return { ok: true, use: recorded, result: redemption.result };
|
|
54863
|
+
}
|
|
54864
|
+
if (redemption.status === "failed") {
|
|
54865
|
+
await recordUse(client, route, resolvedToolName, input, "error");
|
|
54866
|
+
return {
|
|
54867
|
+
ok: false,
|
|
54868
|
+
reason: "invocation_failed",
|
|
54869
|
+
message: errorMessage(redemption.error) ?? "Capability invocation previously failed"
|
|
54870
|
+
};
|
|
54871
|
+
}
|
|
54872
|
+
await recordUse(client, route, resolvedToolName, input, "refused");
|
|
54863
54873
|
return {
|
|
54864
54874
|
ok: false,
|
|
54865
|
-
reason: "
|
|
54866
|
-
message:
|
|
54875
|
+
reason: "operational_incident",
|
|
54876
|
+
message: `Capability invocation ${redemption.id} is in status "${redemption.status}" (operational incident: no automatic redispatch)`
|
|
54867
54877
|
};
|
|
54868
54878
|
}
|
|
54879
|
+
} catch (permitError) {
|
|
54869
54880
|
await recordUse(client, route, resolvedToolName, input, "refused");
|
|
54881
|
+
const msg = errorMessage(permitError) ?? String(permitError);
|
|
54882
|
+
const isNoGrant = msg.includes("GRANT_REQUIRED") || msg.includes("no active grant");
|
|
54870
54883
|
return {
|
|
54871
54884
|
ok: false,
|
|
54872
|
-
reason: "
|
|
54873
|
-
message:
|
|
54885
|
+
reason: isNoGrant ? "no_grant" : "gate_refused",
|
|
54886
|
+
message: msg
|
|
54874
54887
|
};
|
|
54875
54888
|
}
|
|
54876
|
-
} catch (permitError) {
|
|
54877
|
-
await recordUse(client, route, resolvedToolName, input, "refused");
|
|
54878
|
-
const msg = errorMessage(permitError) ?? String(permitError);
|
|
54879
|
-
const isNoGrant = msg.includes("GRANT_REQUIRED") || msg.includes("no active grant");
|
|
54880
|
-
return {
|
|
54881
|
-
ok: false,
|
|
54882
|
-
reason: isNoGrant ? "no_grant" : "gate_refused",
|
|
54883
|
-
message: msg
|
|
54884
|
-
};
|
|
54885
54889
|
}
|
|
54886
54890
|
try {
|
|
54887
54891
|
const result = await callDestination(
|
|
@@ -58644,7 +58648,7 @@ function indexOutside(worktreePath, files) {
|
|
|
58644
58648
|
const conflicted = new Set(files);
|
|
58645
58649
|
return git(worktreePath, ["ls-files", "-s"]).split("\n").filter((line) => {
|
|
58646
58650
|
const match = /^(\d+) ([0-9a-f]+) (\d)\t(.*)$/.exec(line);
|
|
58647
|
-
return match !== null && match[3] === "0" && !conflicted.has(match[4]);
|
|
58651
|
+
return match !== null && match[3] === "0" && !conflicted.has(match[4] ?? "");
|
|
58648
58652
|
}).sort().join("\n");
|
|
58649
58653
|
}
|
|
58650
58654
|
function integrationCommitMessage(defaultBranch, runId) {
|
|
@@ -58721,7 +58725,7 @@ function verifyIntegrationResolved(input) {
|
|
|
58721
58725
|
const conflicted = new Set(input.files);
|
|
58722
58726
|
const strays = gitRaw(input.worktreePath, ["status", "--porcelain", "--untracked-files=all"]).split("\n").filter((line) => line.length > 3).filter((line) => line.startsWith("??") || line[1] !== " ").map((line) => {
|
|
58723
58727
|
const entry = line.slice(3);
|
|
58724
|
-
return entry.includes(" -> ") ? entry.split(" -> ")[1] : entry;
|
|
58728
|
+
return entry.includes(" -> ") ? entry.split(" -> ")[1] ?? entry : entry;
|
|
58725
58729
|
}).filter((file2) => !conflicted.has(file2));
|
|
58726
58730
|
if (strays.length > 0) {
|
|
58727
58731
|
return { ok: false, reason: "changed_outside_conflicts", detail: strays.join(", ") };
|
|
@@ -63639,7 +63643,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
|
|
|
63639
63643
|
}
|
|
63640
63644
|
|
|
63641
63645
|
// src/_generated/version.ts
|
|
63642
|
-
var PKG_VERSION = "0.4.
|
|
63646
|
+
var PKG_VERSION = "0.4.133";
|
|
63643
63647
|
|
|
63644
63648
|
// src/bridge-allowed-origins.ts
|
|
63645
63649
|
var DEFAULT_DIRECTOR_BRIDGE_ALLOWED_ORIGINS = [
|