@mrrlin-dev/mcp 0.4.231 → 0.4.233
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 +51 -39
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -26080,8 +26080,9 @@ function runAgyExec(input, deps) {
|
|
|
26080
26080
|
child.kill("SIGKILL");
|
|
26081
26081
|
finish({ ok: false, error: `${executable} exec timed out after ${input.timeoutMs}ms` });
|
|
26082
26082
|
}, input.timeoutMs);
|
|
26083
|
+
const decoder = new import_node_string_decoder3.StringDecoder("utf8");
|
|
26083
26084
|
child.stdout?.on("data", (chunk) => {
|
|
26084
|
-
stdout += chunk.
|
|
26085
|
+
stdout += typeof chunk === "string" ? chunk : decoder.write(chunk);
|
|
26085
26086
|
});
|
|
26086
26087
|
child.stderr?.on("data", () => {
|
|
26087
26088
|
});
|
|
@@ -26095,7 +26096,7 @@ function runAgyExec(input, deps) {
|
|
|
26095
26096
|
finish({ ok: false, error: `${executable} exec exited with code ${code ?? "null"}` });
|
|
26096
26097
|
return;
|
|
26097
26098
|
}
|
|
26098
|
-
finish(extractOneShotResult2(stdout));
|
|
26099
|
+
finish(extractOneShotResult2(stdout + decoder.end()));
|
|
26099
26100
|
});
|
|
26100
26101
|
});
|
|
26101
26102
|
}
|
|
@@ -26127,11 +26128,12 @@ function extractOneShotResult2(stdout) {
|
|
|
26127
26128
|
}
|
|
26128
26129
|
};
|
|
26129
26130
|
}
|
|
26130
|
-
var import_node_child_process9, AGY_READ_ONLY_NOTICE, AGY_CANNOT_EDIT_ERROR;
|
|
26131
|
+
var import_node_child_process9, import_node_string_decoder3, AGY_READ_ONLY_NOTICE, AGY_CANNOT_EDIT_ERROR;
|
|
26131
26132
|
var init_exec3 = __esm({
|
|
26132
26133
|
"../../packages/agent-client/dist/providers/agy/exec.js"() {
|
|
26133
26134
|
"use strict";
|
|
26134
26135
|
import_node_child_process9 = require("node:child_process");
|
|
26136
|
+
import_node_string_decoder3 = require("node:string_decoder");
|
|
26135
26137
|
init_execution_child();
|
|
26136
26138
|
init_models2();
|
|
26137
26139
|
init_windows_command();
|
|
@@ -81118,12 +81120,15 @@ function telemetryDay(now = /* @__PURE__ */ new Date()) {
|
|
|
81118
81120
|
return now.toISOString().slice(0, 10);
|
|
81119
81121
|
}
|
|
81120
81122
|
|
|
81123
|
+
// src/kill-switch.ts
|
|
81124
|
+
function killSwitchOn(value) {
|
|
81125
|
+
const raw = (value ?? "").trim().toLowerCase();
|
|
81126
|
+
return !(raw === "0" || raw === "false");
|
|
81127
|
+
}
|
|
81128
|
+
|
|
81121
81129
|
// src/consensus/resolve-gated-task.ts
|
|
81122
81130
|
function useLinkedTaskLookupV1(value = process.env.MRRLIN_MCP_LINKED_TASK_V1) {
|
|
81123
|
-
|
|
81124
|
-
if (!flag2 || flag2 === "0" || flag2 === "false") return false;
|
|
81125
|
-
if (flag2 === "1") return true;
|
|
81126
|
-
throw new Error("Invalid MRRLIN_MCP_LINKED_TASK_V1");
|
|
81131
|
+
return killSwitchOn(value);
|
|
81127
81132
|
}
|
|
81128
81133
|
async function resolveGatedTaskId(client, projectSlug, page, useV1 = useLinkedTaskLookupV1()) {
|
|
81129
81134
|
let linkingId;
|
|
@@ -96246,6 +96251,7 @@ var deliverableConsensusDescriptor = {
|
|
|
96246
96251
|
var import_node_crypto14 = require("node:crypto");
|
|
96247
96252
|
init_dist();
|
|
96248
96253
|
init_dist2();
|
|
96254
|
+
var BLOCKER_STATUS_CHUNK = 16;
|
|
96249
96255
|
var DRAFT_SPEC_TOOL_NAME = "draft_task_spec";
|
|
96250
96256
|
var SPECS_FOLDER = "Specs";
|
|
96251
96257
|
var DRAFT_SPEC_TLDR_MAX_CHARS = 300;
|
|
@@ -96464,7 +96470,7 @@ async function runDraftSpec(ctx, input, deps) {
|
|
|
96464
96470
|
const client = ctx.client;
|
|
96465
96471
|
let task;
|
|
96466
96472
|
try {
|
|
96467
|
-
const bounded = process.env.MRRLIN_MCP_DRAFT_INITIAL_TASK_BOUNDED
|
|
96473
|
+
const bounded = killSwitchOn(process.env.MRRLIN_MCP_DRAFT_INITIAL_TASK_BOUNDED);
|
|
96468
96474
|
task = bounded ? await client.getTask(projectSlug, taskId, { boundedResponse: true, signal: ctx.signal }) : await client.getTask(projectSlug, taskId);
|
|
96469
96475
|
} catch (error51) {
|
|
96470
96476
|
if (error51 instanceof MrrlinResponseTooLargeError) {
|
|
@@ -96484,15 +96490,16 @@ async function runDraftSpec(ctx, input, deps) {
|
|
|
96484
96490
|
if ((task.blockedBy ?? []).length > 0) {
|
|
96485
96491
|
let hasActiveBlocker;
|
|
96486
96492
|
try {
|
|
96487
|
-
|
|
96488
|
-
|
|
96489
|
-
|
|
96490
|
-
|
|
96491
|
-
|
|
96492
|
-
|
|
96493
|
-
|
|
96494
|
-
|
|
96493
|
+
if (killSwitchOn(process.env.MRRLIN_MCP_DRAFT_BLOCKER_STATUS_V1)) {
|
|
96494
|
+
const unique = [...new Set(task.blockedBy)];
|
|
96495
|
+
hasActiveBlocker = false;
|
|
96496
|
+
for (let start = 0; start < unique.length && !hasActiveBlocker; start += BLOCKER_STATUS_CHUNK) {
|
|
96497
|
+
const ids = blockerTaskIdsSchema.parse(unique.slice(start, start + BLOCKER_STATUS_CHUNK));
|
|
96498
|
+
const active = await client.getTaskBlockerStatusV1(projectSlug, ids, { signal: ctx.signal });
|
|
96499
|
+
if (typeof active !== "boolean") throw new Error("Invalid blocker status result");
|
|
96500
|
+
hasActiveBlocker = active;
|
|
96495
96501
|
}
|
|
96502
|
+
} else {
|
|
96496
96503
|
const blockers = await client.listTasks(projectSlug);
|
|
96497
96504
|
hasActiveBlocker = getActiveBlockedByIds(task.blockedBy, blockers).length > 0;
|
|
96498
96505
|
}
|
|
@@ -96505,11 +96512,7 @@ async function runDraftSpec(ctx, input, deps) {
|
|
|
96505
96512
|
}
|
|
96506
96513
|
if (hasActiveBlocker) return skipped("blocked_by_active");
|
|
96507
96514
|
}
|
|
96508
|
-
const
|
|
96509
|
-
if (draftLinkFlag && draftLinkFlag !== "1" && draftLinkFlag !== "0" && draftLinkFlag !== "false") {
|
|
96510
|
-
return { kind: "retry", failureReason: "provider_unavailable", error: "Invalid MRRLIN_MCP_DRAFT_LINK_V1" };
|
|
96511
|
-
}
|
|
96512
|
-
const useDraftLinkV1 = draftLinkFlag === "1";
|
|
96515
|
+
const useDraftLinkV1 = !ctx.boundDraftCommit && killSwitchOn(process.env.MRRLIN_MCP_DRAFT_LINK_V1);
|
|
96513
96516
|
const autoDeploy = task.autoDeploy ?? "off";
|
|
96514
96517
|
let topology = null;
|
|
96515
96518
|
let deploySkippedReason = null;
|
|
@@ -96554,7 +96557,7 @@ async function runDraftSpec(ctx, input, deps) {
|
|
|
96554
96557
|
};
|
|
96555
96558
|
}
|
|
96556
96559
|
let constitution = null;
|
|
96557
|
-
const boundedConstitution = process.env.MRRLIN_MCP_DRAFT_CONSTITUTION_BOUNDED
|
|
96560
|
+
const boundedConstitution = killSwitchOn(process.env.MRRLIN_MCP_DRAFT_CONSTITUTION_BOUNDED);
|
|
96558
96561
|
if (boundedConstitution) {
|
|
96559
96562
|
try {
|
|
96560
96563
|
const result = await client.getDraftConstitutionV1(projectSlug, { signal: ctx.signal });
|
|
@@ -96562,7 +96565,10 @@ async function runDraftSpec(ctx, input, deps) {
|
|
|
96562
96565
|
if (result.kind === "found") constitution = result.markdownBody;
|
|
96563
96566
|
} catch (error51) {
|
|
96564
96567
|
ctx.signal?.throwIfAborted();
|
|
96565
|
-
|
|
96568
|
+
const definitelyAbsent = error51 instanceof MrrlinResponseTooLargeError || error51 instanceof MrrlinApiError && error51.status === 404;
|
|
96569
|
+
if (!definitelyAbsent) {
|
|
96570
|
+
return { kind: "retry", failureReason: "provider_unavailable", error: `constitution lookup failed for ${projectSlug}: ${errMessage3(error51)}` };
|
|
96571
|
+
}
|
|
96566
96572
|
}
|
|
96567
96573
|
} else {
|
|
96568
96574
|
try {
|
|
@@ -106448,7 +106454,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
|
|
|
106448
106454
|
}
|
|
106449
106455
|
|
|
106450
106456
|
// src/_generated/version.ts
|
|
106451
|
-
var PKG_VERSION = "0.4.
|
|
106457
|
+
var PKG_VERSION = "0.4.233";
|
|
106452
106458
|
|
|
106453
106459
|
// src/bridge-allowed-origins.ts
|
|
106454
106460
|
var DEFAULT_DIRECTOR_BRIDGE_ALLOWED_ORIGINS = [
|
|
@@ -111060,6 +111066,7 @@ init_dist();
|
|
|
111060
111066
|
var ANSWERED_QUESTION_RESTARTED_BY = "bridge:answered-question";
|
|
111061
111067
|
var LOG_PREFIX = "[mrrlin] answered-question resume";
|
|
111062
111068
|
var PARKED_STATUSES = ["handoff_queued", "handoff_requested"];
|
|
111069
|
+
var RESUME_QUESTION_WINDOW = 50;
|
|
111063
111070
|
function log(message) {
|
|
111064
111071
|
process.stderr.write(`${LOG_PREFIX}: ${message}
|
|
111065
111072
|
`);
|
|
@@ -111081,7 +111088,11 @@ async function resumeRunsWithAnsweredQuestions(client, projectSlug) {
|
|
|
111081
111088
|
if (run5.blockingReason === "operator_stopped") continue;
|
|
111082
111089
|
let linked;
|
|
111083
111090
|
try {
|
|
111084
|
-
const items = await client.listInboxItems(projectSlug, {
|
|
111091
|
+
const items = await client.listInboxItems(projectSlug, {
|
|
111092
|
+
kind: "question",
|
|
111093
|
+
taskId: run5.taskId,
|
|
111094
|
+
limit: RESUME_QUESTION_WINDOW
|
|
111095
|
+
});
|
|
111085
111096
|
linked = items.filter((item) => item.askingRunId === run5.id && item.origin == null);
|
|
111086
111097
|
} catch (error51) {
|
|
111087
111098
|
log(`listing questions of ${run5.taskId} failed: ${describe4(error51)}`);
|
|
@@ -111095,12 +111106,23 @@ async function resumeRunsWithAnsweredQuestions(client, projectSlug) {
|
|
|
111095
111106
|
if (!newest || newest.status !== "acknowledged" || !newest.answer?.trim()) continue;
|
|
111096
111107
|
if (newest.id === run5.resumedOnQuestionId) continue;
|
|
111097
111108
|
try {
|
|
111098
|
-
const task = await client.getTask(projectSlug, run5.taskId);
|
|
111109
|
+
const task = await client.getTask(projectSlug, run5.taskId, { boundedResponse: true });
|
|
111099
111110
|
if (mrrlinTerminalTaskStatuses.includes(task.status)) continue;
|
|
111100
111111
|
} catch (error51) {
|
|
111101
111112
|
log(`reading task ${run5.taskId} failed: ${describe4(error51)}`);
|
|
111102
111113
|
continue;
|
|
111103
111114
|
}
|
|
111115
|
+
try {
|
|
111116
|
+
await client.restartExecutionRun(projectSlug, run5.id, {
|
|
111117
|
+
restartedBy: ANSWERED_QUESTION_RESTARTED_BY,
|
|
111118
|
+
answeredQuestionId: newest.id
|
|
111119
|
+
});
|
|
111120
|
+
restarted.push(run5.id);
|
|
111121
|
+
log(`restarted ${run5.id} on the answer to ${newest.id}`);
|
|
111122
|
+
} catch (error51) {
|
|
111123
|
+
log(`restarting ${run5.id} failed: ${describe4(error51)}`);
|
|
111124
|
+
continue;
|
|
111125
|
+
}
|
|
111104
111126
|
for (const older of ordered.slice(1)) {
|
|
111105
111127
|
if (older.status !== "pending") continue;
|
|
111106
111128
|
try {
|
|
@@ -111113,16 +111135,6 @@ async function resumeRunsWithAnsweredQuestions(client, projectSlug) {
|
|
|
111113
111135
|
log(`superseding ${older.id} failed: ${describe4(error51)}`);
|
|
111114
111136
|
}
|
|
111115
111137
|
}
|
|
111116
|
-
try {
|
|
111117
|
-
await client.restartExecutionRun(projectSlug, run5.id, {
|
|
111118
|
-
restartedBy: ANSWERED_QUESTION_RESTARTED_BY,
|
|
111119
|
-
answeredQuestionId: newest.id
|
|
111120
|
-
});
|
|
111121
|
-
restarted.push(run5.id);
|
|
111122
|
-
log(`restarted ${run5.id} on the answer to ${newest.id}`);
|
|
111123
|
-
} catch (error51) {
|
|
111124
|
-
log(`restarting ${run5.id} failed: ${describe4(error51)}`);
|
|
111125
|
-
}
|
|
111126
111138
|
}
|
|
111127
111139
|
return restarted;
|
|
111128
111140
|
}
|
|
@@ -124335,13 +124347,13 @@ function buildThreadStartParams(msg, config2, desiredModel) {
|
|
|
124335
124347
|
// Dogfood v2 F-28: asked about GT-4, the Director repeated stop reasons that no longer held, offered no
|
|
124336
124348
|
// restart, and sent the non-technical operator to "a technical person" for the task's human review.
|
|
124337
124349
|
// The rule states what to do, never which past fixes made a reason stale: such a list rots.
|
|
124338
|
-
"Parked runs (handoff_queued/handoff_requested): if asked or the blocker may be gone, re-check each stop reason now.",
|
|
124350
|
+
"Parked runs (handoff_queued/handoff_requested): if asked or the blocker may be gone, re-check each stop reason now; never repeat an earlier one unchecked.",
|
|
124339
124351
|
"If none holds and `restart_execution_run` lists the reason as yours, restart and say it is queued again.",
|
|
124340
124352
|
"Otherwise offer a restart in plain words; the operator's yes is the explicit ask. Never delegate a restart.",
|
|
124341
|
-
"Keep a run parked while its blocker holds
|
|
124353
|
+
"Keep a run parked while its blocker holds; say what is missing. For human review, explain the change",
|
|
124342
124354
|
"and risk plainly, ask for approval and record it with `append_task_event`; restart on yes, park on no.",
|
|
124343
124355
|
"Never send the operator to a technical person. Approval never clears independent review (the run re-runs it)",
|
|
124344
|
-
"or restarts `operator_stopped` (operator only). The operator answers deploy approvals in Inbox, never in chat.",
|
|
124356
|
+
"or restarts `operator_stopped` (operator only). The operator answers deploy approvals in Inbox, never in chat or by you.",
|
|
124345
124357
|
// Dogfood v2 F-46: the operator accepted GT-5 in chat; a note on GT-5 reached nothing GT-6's executor
|
|
124346
124358
|
// reads, and rewriting GT-6's notes let a model decide what the acceptance lifts. It is state now.
|
|
124347
124359
|
"When the operator accepts a task's result, record it with `record_task_acceptance` in their words: runs of",
|