@mrrlin-dev/mcp 0.4.143 → 0.4.145

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 +38 -13
  2. package/package.json +1 -1
package/dist/bin.cjs CHANGED
@@ -63211,6 +63211,15 @@ function createTurnLock() {
63211
63211
  return { run: run3, activeCount };
63212
63212
  }
63213
63213
 
63214
+ // src/thread-binding.ts
63215
+ function directorThreadEnv(projectSlug) {
63216
+ const slug = projectSlug ?? "";
63217
+ if (!slug || slug.length > 200 || /[\s\p{Cc}]/u.test(slug)) {
63218
+ return { MRRLIN_PROJECT_SLUG: null, MRRLIN_PROJECT_BINDING: "none" };
63219
+ }
63220
+ return { MRRLIN_PROJECT_SLUG: slug, MRRLIN_PROJECT_BINDING: null };
63221
+ }
63222
+
63214
63223
  // src/self-update.ts
63215
63224
  var import_node_child_process21 = require("node:child_process");
63216
63225
  var import_node_crypto16 = require("node:crypto");
@@ -63817,7 +63826,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
63817
63826
  }
63818
63827
 
63819
63828
  // src/_generated/version.ts
63820
- var PKG_VERSION = "0.4.143";
63829
+ var PKG_VERSION = "0.4.145";
63821
63830
 
63822
63831
  // src/bridge-allowed-origins.ts
63823
63832
  var DEFAULT_DIRECTOR_BRIDGE_ALLOWED_ORIGINS = [
@@ -67799,6 +67808,21 @@ async function resolveEffectiveRisk(deps, worktreePath, projectSlug, review) {
67799
67808
  }
67800
67809
  return { risk, reason };
67801
67810
  }
67811
+ var PREFLIGHT_REFUSAL_TOKENS = ["local_checkout_missing", "capability_not_routed", "task_blocked"];
67812
+ function judgementForRunPrompt(task, artifacts) {
67813
+ const judgement = task.latestJudgement;
67814
+ const filedByPreflight = (token2) => artifacts.some((artifact) => {
67815
+ if (artifact.kind !== "handoff_judgement") return false;
67816
+ const payload = artifact.payload;
67817
+ return payload?.reasonCode === token2 && payload?.reason === judgement;
67818
+ });
67819
+ const token = judgement && task.latestJudgementKind === "handoff" ? PREFLIGHT_REFUSAL_TOKENS.find((t) => judgement.startsWith(`${t}: run `) && filedByPreflight(t)) : void 0;
67820
+ if (!token) return { latestJudgement: task.latestJudgement, latestJudgementKind: task.latestJudgementKind };
67821
+ return {
67822
+ 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.`,
67823
+ latestJudgementKind: task.latestJudgementKind
67824
+ };
67825
+ }
67802
67826
  async function gatherContext(client, projectSlug, task, openRunId, rawProjectInput) {
67803
67827
  let rawProject = rawProjectInput;
67804
67828
  if (!rawProject) {
@@ -67853,8 +67877,9 @@ async function gatherContext(client, projectSlug, task, openRunId, rawProjectInp
67853
67877
  notes: task.notes,
67854
67878
  autonomyLevel: task.autonomyLevel,
67855
67879
  autonomyReason: task.autonomyReason,
67856
- latestJudgement: task.latestJudgement,
67857
- latestJudgementKind: task.latestJudgementKind
67880
+ // From every artifact of the task, before the recency cap below can drop the one that proves
67881
+ // where the judgement came from.
67882
+ ...judgementForRunPrompt(task, allArtifacts)
67858
67883
  },
67859
67884
  specMarkdown,
67860
67885
  runs,
@@ -68468,7 +68493,13 @@ ${renderTaskStateSection(taskState)}`;
68468
68493
  baseInstructions: useExecutor ? localGitMode ? EXECUTOR_LOCAL_GIT_BASE_INSTRUCTIONS : EXECUTOR_BASE_INSTRUCTIONS : CONSUMER_BASE_INSTRUCTIONS,
68469
68494
  developerInstructions: null,
68470
68495
  ephemeral: null,
68471
- mcpConfig: deps.mcpConfigPath
68496
+ mcpConfig: deps.mcpConfigPath,
68497
+ // Dogfood v2 F-17: the run's Mrrlin MCP server must be bound to its project. Codex does not
68498
+ // pass its process environment to MCP servers, so the binding set on the executor process
68499
+ // (acquireExecutorAgent) never reached them and every project tool refused the run with "no
68500
+ // active workspace bound". The adapter applies this per thread (codexThreadConfig), and a
68501
+ // resumed thread loaded with another binding is refused and restarted fresh.
68502
+ env: directorThreadEnv(projectSlug)
68472
68503
  };
68473
68504
  let resumed = true;
68474
68505
  let acquireResult;
@@ -68572,8 +68603,9 @@ ${renderTaskStateSection(taskState)}`;
68572
68603
  task: {
68573
68604
  id: task.id,
68574
68605
  status: task.status,
68575
- latestJudgement: task.latestJudgement,
68576
- latestJudgementKind: task.latestJudgementKind
68606
+ // Already resolved by gatherContext from the uncapped artifacts; context.artifacts is capped.
68607
+ latestJudgement: context.task.latestJudgement,
68608
+ latestJudgementKind: context.task.latestJudgementKind
68577
68609
  },
68578
68610
  newlyFinishedRuns: [priorRun],
68579
68611
  newArtifacts,
@@ -76920,13 +76952,6 @@ function neutralCheckoutCwd(stateDir) {
76920
76952
  }
76921
76953
  return dir;
76922
76954
  }
76923
- function directorThreadEnv(projectSlug) {
76924
- const slug = projectSlug ?? "";
76925
- if (!slug || slug.length > 200 || /[\s\p{Cc}]/u.test(slug)) {
76926
- return { MRRLIN_PROJECT_SLUG: null, MRRLIN_PROJECT_BINDING: "none" };
76927
- }
76928
- return { MRRLIN_PROJECT_SLUG: slug, MRRLIN_PROJECT_BINDING: null };
76929
- }
76930
76955
  function buildThreadStartParams(msg, config2, desiredModel) {
76931
76956
  const baseInstructions = [
76932
76957
  "You are the Mrrlin Director assistant.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.143",
3
+ "version": "0.4.145",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"