@mrrlin-dev/mcp 0.4.144 → 0.4.146
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 +44 -9
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -63826,7 +63826,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
|
|
|
63826
63826
|
}
|
|
63827
63827
|
|
|
63828
63828
|
// src/_generated/version.ts
|
|
63829
|
-
var PKG_VERSION = "0.4.
|
|
63829
|
+
var PKG_VERSION = "0.4.146";
|
|
63830
63830
|
|
|
63831
63831
|
// src/bridge-allowed-origins.ts
|
|
63832
63832
|
var DEFAULT_DIRECTOR_BRIDGE_ALLOWED_ORIGINS = [
|
|
@@ -67683,8 +67683,10 @@ var EXECUTOR_BASE_INSTRUCTIONS = [
|
|
|
67683
67683
|
"the host (there is NO filesystem sandbox). Do your work by creating, editing, and deleting",
|
|
67684
67684
|
"files and running git/build/test commands WITHIN this worktree. Keep all changes inside the",
|
|
67685
67685
|
"worktree and do not read the operator's personal secrets or files outside it \u2014 this is a rule",
|
|
67686
|
-
"you must follow, not something the environment enforces. Be concise.
|
|
67687
|
-
"next increment
|
|
67686
|
+
"you must follow, not something the environment enforces. Be concise. This run has one work",
|
|
67687
|
+
// Dogfood v2 F-20: "stop the turn after the next increment" made runs stop after one small step;
|
|
67688
|
+
// see workTurnInstruction.
|
|
67689
|
+
"turn: carry the task as far as you can and stop only when it is complete or you are genuinely blocked.",
|
|
67688
67690
|
// ADR 0022 Phase 3: the executor is the orchestrator, not the sole worker. It has the
|
|
67689
67691
|
// external-agents `pick`/`dispatch` MCP tools (a pool of cheap/free models) and should
|
|
67690
67692
|
// delegate judgment-requiring work to them, keeping itself as judge. If external-agents
|
|
@@ -67808,6 +67810,33 @@ async function resolveEffectiveRisk(deps, worktreePath, projectSlug, review) {
|
|
|
67808
67810
|
}
|
|
67809
67811
|
return { risk, reason };
|
|
67810
67812
|
}
|
|
67813
|
+
function workTurnBudgetMs(remainingMs, completionReserveMs, completionMinMs) {
|
|
67814
|
+
if (completionReserveMs <= 0 || completionReserveMs < completionMinMs) return remainingMs;
|
|
67815
|
+
if (remainingMs >= completionReserveMs * 2) return remainingMs - completionReserveMs;
|
|
67816
|
+
if (remainingMs >= completionMinMs * 2) return remainingMs - completionMinMs;
|
|
67817
|
+
return remainingMs;
|
|
67818
|
+
}
|
|
67819
|
+
function workTurnInstruction(taskId, canWrite = true) {
|
|
67820
|
+
if (!canWrite) {
|
|
67821
|
+
return `Continue executing task ${taskId}. Make the next concrete increment of progress and record artifacts/judgements via MCP tools.`;
|
|
67822
|
+
}
|
|
67823
|
+
return `Continue executing task ${taskId}. Carry it as far as you can in this turn: implement it, run its checks, and commit your changes as your instructions describe. This is the run's only work turn \u2014 stop when the task is complete or you are genuinely blocked, not after a single step. Record artifacts and judgements via MCP tools.`;
|
|
67824
|
+
}
|
|
67825
|
+
var PREFLIGHT_REFUSAL_TOKENS = ["local_checkout_missing", "capability_not_routed", "task_blocked"];
|
|
67826
|
+
function judgementForRunPrompt(task, artifacts) {
|
|
67827
|
+
const judgement = task.latestJudgement;
|
|
67828
|
+
const filedByPreflight = (token2) => artifacts.some((artifact) => {
|
|
67829
|
+
if (artifact.kind !== "handoff_judgement") return false;
|
|
67830
|
+
const payload = artifact.payload;
|
|
67831
|
+
return payload?.reasonCode === token2 && payload?.reason === judgement;
|
|
67832
|
+
});
|
|
67833
|
+
const token = judgement && task.latestJudgementKind === "handoff" ? PREFLIGHT_REFUSAL_TOKENS.find((t) => judgement.startsWith(`${t}: run `) && filedByPreflight(t)) : void 0;
|
|
67834
|
+
if (!token) return { latestJudgement: task.latestJudgement, latestJudgementKind: task.latestJudgementKind };
|
|
67835
|
+
return {
|
|
67836
|
+
latestJudgement: `resolved \u2014 an earlier attempt stopped at the pre-flight check "${token}", and this run passed that check before it started, so the condition no longer holds. Do not ask about it again; continue the task.`,
|
|
67837
|
+
latestJudgementKind: task.latestJudgementKind
|
|
67838
|
+
};
|
|
67839
|
+
}
|
|
67811
67840
|
async function gatherContext(client, projectSlug, task, openRunId, rawProjectInput) {
|
|
67812
67841
|
let rawProject = rawProjectInput;
|
|
67813
67842
|
if (!rawProject) {
|
|
@@ -67862,8 +67891,9 @@ async function gatherContext(client, projectSlug, task, openRunId, rawProjectInp
|
|
|
67862
67891
|
notes: task.notes,
|
|
67863
67892
|
autonomyLevel: task.autonomyLevel,
|
|
67864
67893
|
autonomyReason: task.autonomyReason,
|
|
67865
|
-
|
|
67866
|
-
|
|
67894
|
+
// From every artifact of the task, before the recency cap below can drop the one that proves
|
|
67895
|
+
// where the judgement came from.
|
|
67896
|
+
...judgementForRunPrompt(task, allArtifacts)
|
|
67867
67897
|
},
|
|
67868
67898
|
specMarkdown,
|
|
67869
67899
|
runs,
|
|
@@ -68587,8 +68617,9 @@ ${renderTaskStateSection(taskState)}`;
|
|
|
68587
68617
|
task: {
|
|
68588
68618
|
id: task.id,
|
|
68589
68619
|
status: task.status,
|
|
68590
|
-
|
|
68591
|
-
|
|
68620
|
+
// Already resolved by gatherContext from the uncapped artifacts; context.artifacts is capped.
|
|
68621
|
+
latestJudgement: context.task.latestJudgement,
|
|
68622
|
+
latestJudgementKind: context.task.latestJudgementKind
|
|
68592
68623
|
},
|
|
68593
68624
|
newlyFinishedRuns: [priorRun],
|
|
68594
68625
|
newArtifacts,
|
|
@@ -68599,8 +68630,12 @@ ${renderTaskStateSection(taskState)}`;
|
|
|
68599
68630
|
}
|
|
68600
68631
|
const executionPrompt = resumed ? `${resumeContent}
|
|
68601
68632
|
|
|
68602
|
-
|
|
68603
|
-
const workBudgetMs =
|
|
68633
|
+
${workTurnInstruction(task.id, useExecutor)}` : workTurnInstruction(task.id, useExecutor);
|
|
68634
|
+
const workBudgetMs = workTurnBudgetMs(
|
|
68635
|
+
remainingTurnBudgetMs(),
|
|
68636
|
+
isCompletionTurnDisabled() ? 0 : completionTurnBudgetMs(),
|
|
68637
|
+
completionTurnMinBudgetMs()
|
|
68638
|
+
);
|
|
68604
68639
|
if (workBudgetMs <= 0) {
|
|
68605
68640
|
await failRun(
|
|
68606
68641
|
deps,
|