@mrrlin-dev/mcp 0.4.67 → 0.4.72

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 +127 -127
  2. package/package.json +2 -2
package/dist/bin.cjs CHANGED
@@ -20767,20 +20767,18 @@ async function resolveApiBaseUrlDynamic(opts = {}) {
20767
20767
  const { baseUrl, retargeted } = retargetRetiredApiBaseUrl(direct.trim());
20768
20768
  return { baseUrl, source: retargeted ? "retired-retarget" : "explicit" };
20769
20769
  }
20770
- if ((env.MRRLIN_STAGING ?? "").trim() === "1") return { baseUrl: STAGING_API_BASE_URL, source: "staging-env" };
20771
- const timeoutMs = opts.probeTimeoutMs ?? readProbeTimeoutMs(env);
20772
- if (await probeLocalHealth(DEFAULT_API_BASE_URL, timeoutMs, fetchImpl)) {
20773
- return { baseUrl: DEFAULT_API_BASE_URL, source: "local-probe" };
20770
+ if ((env.MRRLIN_STAGING ?? "").trim() === "1") {
20771
+ return { baseUrl: STAGING_API_BASE_URL, source: "staging-env" };
20774
20772
  }
20775
- if ((env.MRRLIN_API_AUTODETECT ?? "").trim() === "1") {
20773
+ const autoDetect = (env.MRRLIN_API_AUTODETECT ?? "").trim() === "1";
20774
+ const timeoutMs = opts.probeTimeoutMs ?? readProbeTimeoutMs(env);
20775
+ if (autoDetect) {
20776
20776
  if (await probeLocalHealth(DEFAULT_API_BASE_URL, timeoutMs, fetchImpl)) {
20777
20777
  return { baseUrl: DEFAULT_API_BASE_URL, source: "local-probe" };
20778
20778
  }
20779
20779
  return { baseUrl: STAGING_API_BASE_URL, source: "staging-autodetect" };
20780
20780
  }
20781
- throw new Error(
20782
- `Local Mrrlin API not reachable at ${DEFAULT_API_BASE_URL}. Start it, or set MRRLIN_API_BASE_URL=${STAGING_API_BASE_URL} to target staging (or MRRLIN_API_AUTODETECT=1 to auto-fall back to staging when local is down).`
20783
- );
20781
+ return { baseUrl: PRODUCTION_API_BASE_URL, source: "production-default" };
20784
20782
  }
20785
20783
 
20786
20784
  // src/browser-runtime.ts
@@ -37201,22 +37199,35 @@ var openApiOperationIds = {
37201
37199
  };
37202
37200
 
37203
37201
  // ../../packages/schemas/dist/session.js
37202
+ var sessionEmailSchema = external_exports.string().email();
37204
37203
  var operatorSessionSchema = external_exports.object({
37205
- emails: external_exports.array(external_exports.string().email()).default([]),
37204
+ emails: external_exports.array(sessionEmailSchema).default([]),
37206
37205
  expiresAt: external_exports.number().int().positive(),
37207
37206
  handle: external_exports.string().regex(/^@.+/),
37208
37207
  issuedAt: external_exports.number().int().positive(),
37209
37208
  kind: external_exports.enum(["web", "agent"]).default("web"),
37210
37209
  login: external_exports.string().min(1),
37211
37210
  projectSlug: external_exports.string().min(1).optional(),
37212
- provider: external_exports.literal("github"),
37211
+ provider: external_exports.enum(["github", "firebase"]),
37213
37212
  repo: external_exports.string().min(1).nullable(),
37214
37213
  // ADR 0016: `scope` distinguishes project-pinned agent tokens (legacy, default) from
37215
37214
  // operator-scoped agent tokens. Only relevant for kind:"agent". `web` sessions ignore it.
37216
37215
  // Default 'project' for backward-compat: tokens minted before this field existed parse
37217
37216
  // cleanly into the project branch of the middleware (which mirrors today's behavior).
37218
- scope: external_exports.enum(["project", "operator"]).default("project")
37217
+ scope: external_exports.enum(["project", "operator"]).default("project"),
37218
+ // Billing entitlement carried on the session. Optional because a GitHub session never has one
37219
+ // and a Firebase session has one only once the claims exist. `determinedAt` is what makes it
37220
+ // falsifiable: the token lives for 7 days, so a value that can go stale needs a freshness bound
37221
+ // enforced by the reader (readEffectivePlan), not by the cookie.
37222
+ entitlement: external_exports.object({
37223
+ plan: external_exports.string(),
37224
+ status: external_exports.enum(["active", "none"]),
37225
+ determinedAt: external_exports.number()
37226
+ }).optional()
37219
37227
  });
37228
+ var WEB_SESSION_TTL_MS = 1e3 * 60 * 60 * 24 * 7;
37229
+ var WEB_SESSION_TTL_SECONDS = WEB_SESSION_TTL_MS / 1e3;
37230
+ var ENTITLEMENT_FRESHNESS_MS = 1e3 * 60 * 60;
37220
37231
  var AGENT_SESSION_TTL_MS = 1e3 * 60 * 15;
37221
37232
 
37222
37233
  // ../../packages/schemas/dist/github-state.js
@@ -37295,7 +37306,10 @@ var agentPoolResponseSchema = external_exports.object({
37295
37306
  });
37296
37307
  var agentCapabilitiesSchema = external_exports.object({
37297
37308
  listsModels: external_exports.boolean(),
37298
- readsRateLimits: external_exports.boolean(),
37309
+ // claude-rate-limit-percent design.md D1/D2 — split from a single `readsRateLimits`, which
37310
+ // conflated "has a quota pull RPC" with "turn stream pushes a renderable numeric snapshot".
37311
+ pullsRateLimits: external_exports.boolean(),
37312
+ pushesRateLimits: external_exports.boolean(),
37299
37313
  models: external_exports.array(external_exports.string()),
37300
37314
  // Picker entries for a provider that has no model-listing RPC (`listsModels: false`): the alias
37301
37315
  // the CLI accepts as `id`, a human label carrying the version the alias resolves to, and that
@@ -37307,7 +37321,8 @@ var agentCapabilitiesSchema = external_exports.object({
37307
37321
  var AGENT_CAPABILITIES = {
37308
37322
  codex: {
37309
37323
  listsModels: true,
37310
- readsRateLimits: true,
37324
+ pullsRateLimits: true,
37325
+ pushesRateLimits: true,
37311
37326
  models: [],
37312
37327
  modelCatalog: [],
37313
37328
  sandboxModes: ["read-only", "workspace-write", "danger-full-access"],
@@ -37315,7 +37330,8 @@ var AGENT_CAPABILITIES = {
37315
37330
  },
37316
37331
  claude: {
37317
37332
  listsModels: false,
37318
- readsRateLimits: false,
37333
+ pullsRateLimits: false,
37334
+ pushesRateLimits: true,
37319
37335
  // Aliases the Claude CLI documents for `--model` (`claude --help`), and what each resolved to
37320
37336
  // on 2026-09-04 per the CLI's own `system.init.model` frame. Keep in step with
37321
37337
  // packages/agent-client/src/providers/claude/models.ts — the parity test enforces equality.
@@ -37331,7 +37347,8 @@ var AGENT_CAPABILITIES = {
37331
37347
  },
37332
37348
  agy: {
37333
37349
  listsModels: true,
37334
- readsRateLimits: false,
37350
+ pullsRateLimits: false,
37351
+ pushesRateLimits: false,
37335
37352
  models: [
37336
37353
  "gemini-3.8-flash-high",
37337
37354
  "gemini-3.8-flash-medium",
@@ -39950,7 +39967,8 @@ var CodexProviderAdapter = class {
39950
39967
  capabilities() {
39951
39968
  return {
39952
39969
  listsModels: true,
39953
- readsRateLimits: true,
39970
+ pullsRateLimits: true,
39971
+ pushesRateLimits: true,
39954
39972
  models: [],
39955
39973
  modelCatalog: [],
39956
39974
  sandboxModes: ["read-only", "workspace-write", "danger-full-access"],
@@ -40337,7 +40355,8 @@ var ClaudeProviderAdapter = class {
40337
40355
  capabilities() {
40338
40356
  return {
40339
40357
  listsModels: false,
40340
- readsRateLimits: false,
40358
+ pullsRateLimits: false,
40359
+ pushesRateLimits: true,
40341
40360
  models: [...CLAUDE_MODELS],
40342
40361
  modelCatalog: claudeModelCatalog(),
40343
40362
  // The neutral 3-value vocabulary every startThread/startTurn caller speaks; permissionModeFor
@@ -40779,10 +40798,8 @@ function parseAgyModelsOutput(output3) {
40779
40798
  if (/^(Fetching|Warning|Error)/i.test(line))
40780
40799
  continue;
40781
40800
  const parts = line.split(/\t+|\s{2,}/).map((p) => p.trim()).filter(Boolean);
40782
- if (parts.length < 1)
40783
- continue;
40784
40801
  const id = parts[0];
40785
- if (!MODEL_ID_REGEX2.test(id)) {
40802
+ if (!id || !MODEL_ID_REGEX2.test(id)) {
40786
40803
  console.warn(`[agy:models] skipping malformed model id: ${id}`);
40787
40804
  continue;
40788
40805
  }
@@ -41269,40 +41286,45 @@ function runAgentExec(input, deps, persistedProvider) {
41269
41286
  }
41270
41287
 
41271
41288
  // ../../packages/agent-client/dist/resolved-seat.js
41272
- var CODEX_STRONG_MODEL_CONSTANT = "gpt-5.6-terra";
41273
- var CLAUDE_STRONG_MODEL_CONSTANT = "sonnet";
41274
- var AGY_STRONG_MODEL_CONSTANT = "gemini-3.1-pro-high";
41275
- var CODEX_WEAK_MODEL_CONSTANT = "codex-gpt-5.4-mini";
41276
- var CLAUDE_WEAK_MODEL_CONSTANT = "haiku";
41277
- var AGY_WEAK_MODEL_CONSTANT = "gemini-3.6-flash-low";
41289
+ var CODEX_DEFAULT_MODEL_CONSTANT = "gpt-5.6-terra";
41290
+ var CLAUDE_DEFAULT_MODEL_CONSTANT = "sonnet";
41291
+ var AGY_DEFAULT_MODEL_CONSTANT = "gemini-3.1-pro-high";
41292
+ var CODEX_DEFAULT_MODEL_ENV = "MRRLIN_CODEX_DEFAULT_MODEL";
41278
41293
  var CODEX_STRONG_MODEL_ENV = "MRRLIN_CODEX_STRONG_MODEL";
41294
+ var CLAUDE_DEFAULT_MODEL_ENV = "MRRLIN_CLAUDE_DEFAULT_MODEL";
41279
41295
  var CLAUDE_STRONG_MODEL_ENV = "MRRLIN_CLAUDE_STRONG_MODEL";
41296
+ var AGY_DEFAULT_MODEL_ENV = "MRRLIN_AGY_DEFAULT_MODEL";
41280
41297
  var AGY_STRONG_MODEL_ENV = "MRRLIN_AGY_STRONG_MODEL";
41281
- function strongConstantFor(providerId) {
41298
+ var CODEX_WEAK_MODEL_ENV = "MRRLIN_CODEX_WEAK_MODEL";
41299
+ var CLAUDE_WEAK_MODEL_ENV = "MRRLIN_CLAUDE_WEAK_MODEL";
41300
+ var AGY_WEAK_MODEL_ENV = "MRRLIN_AGY_WEAK_MODEL";
41301
+ function weakEnvVarFor(providerId) {
41282
41302
  if (providerId === "codex")
41283
- return CODEX_STRONG_MODEL_CONSTANT;
41303
+ return CODEX_WEAK_MODEL_ENV;
41284
41304
  if (providerId === "claude")
41285
- return CLAUDE_STRONG_MODEL_CONSTANT;
41286
- return AGY_STRONG_MODEL_CONSTANT;
41305
+ return CLAUDE_WEAK_MODEL_ENV;
41306
+ return AGY_WEAK_MODEL_ENV;
41287
41307
  }
41288
- function weakConstantFor(providerId) {
41308
+ function defaultConstantFor(providerId) {
41289
41309
  if (providerId === "codex")
41290
- return CODEX_WEAK_MODEL_CONSTANT;
41310
+ return CODEX_DEFAULT_MODEL_CONSTANT;
41291
41311
  if (providerId === "claude")
41292
- return CLAUDE_WEAK_MODEL_CONSTANT;
41293
- return AGY_WEAK_MODEL_CONSTANT;
41312
+ return CLAUDE_DEFAULT_MODEL_CONSTANT;
41313
+ return AGY_DEFAULT_MODEL_CONSTANT;
41294
41314
  }
41295
- function strongEnvVarFor(providerId) {
41296
- if (providerId === "codex")
41297
- return CODEX_STRONG_MODEL_ENV;
41298
- if (providerId === "claude")
41299
- return CLAUDE_STRONG_MODEL_ENV;
41300
- return AGY_STRONG_MODEL_ENV;
41315
+ function readModelEnv(providerId) {
41316
+ if (providerId === "codex") {
41317
+ return process.env[CODEX_DEFAULT_MODEL_ENV]?.trim() || process.env[CODEX_STRONG_MODEL_ENV]?.trim();
41318
+ }
41319
+ if (providerId === "claude") {
41320
+ return process.env[CLAUDE_DEFAULT_MODEL_ENV]?.trim() || process.env[CLAUDE_STRONG_MODEL_ENV]?.trim();
41321
+ }
41322
+ return process.env[AGY_DEFAULT_MODEL_ENV]?.trim() || process.env[AGY_STRONG_MODEL_ENV]?.trim();
41301
41323
  }
41302
41324
  function logFallback(providerId, tier, source, value) {
41303
41325
  console.error(`[resolved-seat] provider=${providerId} ${tier}=${value} (source: ${source})`);
41304
41326
  }
41305
- function pickStrongModelFromList(models) {
41327
+ function pickDefaultModelFromList(models) {
41306
41328
  const defaultModel = models.find((m) => m.isDefault === true);
41307
41329
  if (defaultModel)
41308
41330
  return defaultModel.id;
@@ -41311,96 +41333,66 @@ function pickStrongModelFromList(models) {
41311
41333
  return nonHidden.id;
41312
41334
  return models[0]?.id ?? null;
41313
41335
  }
41314
- function pickWeakModelFromList(models, strongModel) {
41315
- const preferredWeak = models.find((m) => {
41316
- const id = m.id.toLowerCase();
41317
- if (id === strongModel.toLowerCase())
41318
- return false;
41319
- return /(^|[-_])(mini|weak|small)([-_]|$)/i.test(id) || id.includes("flash-low") || /(^|[-_])flash([-_]|$)/i.test(id);
41320
- });
41321
- if (preferredWeak)
41322
- return preferredWeak.id;
41323
- const fallbackLow = models.find((m) => {
41324
- const id = m.id.toLowerCase();
41325
- if (id === strongModel.toLowerCase())
41326
- return false;
41327
- return /(^|[-_])low([-_]|$)/i.test(id);
41328
- });
41329
- if (fallbackLow)
41330
- return fallbackLow.id;
41331
- return null;
41332
- }
41336
+ var warnedEnvVars = /* @__PURE__ */ new Set();
41333
41337
  async function mintResolvedSeat(provider, opts) {
41334
41338
  const capabilities = provider.capabilities();
41335
41339
  const providerId = provider.id;
41336
- let strongModel;
41337
- let weakModel;
41340
+ let model;
41338
41341
  let pinRetired;
41339
41342
  let retiredPin;
41340
- const strongEnvVar = strongEnvVarFor(providerId);
41341
- const strongEnvValue = process.env[strongEnvVar]?.trim();
41343
+ const weakEnvVar = weakEnvVarFor(providerId);
41344
+ if (process.env[weakEnvVar] && !warnedEnvVars.has(weakEnvVar)) {
41345
+ warnedEnvVars.add(weakEnvVar);
41346
+ console.warn(`[resolved-seat] ${weakEnvVar} is deprecated; weak model tier has been unified into default model`);
41347
+ }
41348
+ const envValue = readModelEnv(providerId);
41342
41349
  if (opts?.handle && capabilities.listsModels) {
41343
41350
  try {
41344
41351
  const models = await opts.handle.listModels();
41345
- if (strongEnvValue && models.some((m) => m.id === strongEnvValue)) {
41346
- strongModel = strongEnvValue;
41347
- logFallback(providerId, "strong", "env", strongModel);
41352
+ if (models.length === 0) {
41353
+ throw new Error("empty model list");
41354
+ }
41355
+ if (envValue && models.some((m) => m.id === envValue)) {
41356
+ model = envValue;
41357
+ logFallback(providerId, "default", "env", model);
41348
41358
  } else {
41349
- const picked = pickStrongModelFromList(models);
41359
+ const picked = pickDefaultModelFromList(models);
41350
41360
  if (picked) {
41351
- strongModel = picked;
41352
- if (strongEnvValue) {
41353
- logFallback(providerId, "strong", "live-default (env pin retired)", strongModel);
41361
+ model = picked;
41362
+ if (envValue) {
41363
+ logFallback(providerId, "default", "live-default (env pin retired)", model);
41354
41364
  pinRetired = true;
41355
- retiredPin = strongEnvValue;
41365
+ retiredPin = envValue;
41356
41366
  }
41357
41367
  } else {
41358
41368
  throw new Error("empty model list");
41359
41369
  }
41360
41370
  }
41361
41371
  } catch {
41362
- if (strongEnvValue) {
41363
- strongModel = strongEnvValue;
41364
- logFallback(providerId, "strong", "env", strongModel);
41372
+ if (envValue) {
41373
+ model = envValue;
41374
+ logFallback(providerId, "default", "env", model);
41365
41375
  } else {
41366
- strongModel = strongConstantFor(providerId);
41367
- logFallback(providerId, "strong", "constant", strongModel);
41376
+ model = defaultConstantFor(providerId);
41377
+ logFallback(providerId, "default", "constant", model);
41368
41378
  }
41369
41379
  }
41370
- } else if (strongEnvValue) {
41371
- strongModel = strongEnvValue;
41372
- logFallback(providerId, "strong", "env", strongModel);
41380
+ } else if (envValue) {
41381
+ model = envValue;
41382
+ logFallback(providerId, "default", "env", model);
41373
41383
  } else {
41374
- strongModel = strongConstantFor(providerId);
41375
- logFallback(providerId, "strong", "constant", strongModel);
41376
- }
41377
- if (providerId === "claude") {
41378
- weakModel = CLAUDE_WEAK_MODEL_CONSTANT;
41379
- logFallback(providerId, "weak", "constant", weakModel);
41380
- } else {
41381
- if (opts?.handle && capabilities.listsModels) {
41382
- try {
41383
- const models = await opts.handle.listModels();
41384
- const picked = pickWeakModelFromList(models, strongModel);
41385
- if (picked) {
41386
- weakModel = picked;
41387
- } else {
41388
- weakModel = strongModel;
41389
- logFallback(providerId, "weak", "degenerate (weak=strong)", weakModel);
41390
- }
41391
- } catch {
41392
- weakModel = weakConstantFor(providerId);
41393
- logFallback(providerId, "weak", "constant", weakModel);
41394
- }
41395
- } else {
41396
- weakModel = weakConstantFor(providerId);
41397
- logFallback(providerId, "weak", "constant", weakModel);
41398
- }
41384
+ model = defaultConstantFor(providerId);
41385
+ logFallback(providerId, "default", "constant", model);
41399
41386
  }
41400
41387
  return {
41401
41388
  id: providerId,
41402
41389
  capabilities,
41403
- models: { strong: strongModel, weak: weakModel },
41390
+ model,
41391
+ models: {
41392
+ strong: model,
41393
+ weak: model,
41394
+ default: model
41395
+ },
41404
41396
  ...pinRetired ? { pinRetired: true, retiredPin } : {}
41405
41397
  };
41406
41398
  }
@@ -43467,7 +43459,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
43467
43459
  }
43468
43460
 
43469
43461
  // src/_generated/version.ts
43470
- var PKG_VERSION = "0.4.67";
43462
+ var PKG_VERSION = "0.4.72";
43471
43463
 
43472
43464
  // src/api-base-url-migrate.ts
43473
43465
  var import_node_fs5 = __toESM(require("node:fs"), 1);
@@ -45869,11 +45861,11 @@ ${artifact}`,
45869
45861
  sandbox: "read-only",
45870
45862
  codexExecutable,
45871
45863
  // model-tier-planning-and-arbiter task 2.5 (D1): the arbiter is pinned to the seat's
45872
- // strongest model.
45873
- model: seat?.models.strong
45864
+ // default model.
45865
+ model: seat?.model ?? seat?.models?.strong
45874
45866
  }
45875
45867
  );
45876
- recordCost("arbiter", "arbiter", seat?.models.strong ?? null, startedAt, result);
45868
+ recordCost("arbiter", "arbiter", seat?.model ?? seat?.models?.strong ?? null, startedAt, result);
45877
45869
  return result;
45878
45870
  },
45879
45871
  async runReviser(artifact, accepted) {
@@ -46035,10 +46027,10 @@ ${artifact}`,
46035
46027
  sandbox: "read-only",
46036
46028
  codexExecutable,
46037
46029
  // model-tier-planning-and-arbiter task 2.5 (D1): the arbiter is pinned to the seat's
46038
- // strongest model.
46039
- model: seat?.models.strong
46030
+ // default model.
46031
+ model: seat?.model ?? seat?.models?.strong
46040
46032
  });
46041
- recordCost("arbiter", "arbiter", seat?.models.strong ?? null, startedAt, result);
46033
+ recordCost("arbiter", "arbiter", seat?.model ?? seat?.models?.strong ?? null, startedAt, result);
46042
46034
  return result;
46043
46035
  },
46044
46036
  async runReviser(artifact, accepted) {
@@ -46166,10 +46158,10 @@ ${persona}`,
46166
46158
  sandbox: "read-only",
46167
46159
  codexExecutable,
46168
46160
  // model-tier-planning-and-arbiter task 2.5 (D1): the arbiter is pinned to the seat's
46169
- // strongest model.
46170
- model: seat?.models.strong
46161
+ // default model.
46162
+ model: seat?.model ?? seat?.models?.strong
46171
46163
  });
46172
- recordCost("arbiter", "arbiter", seat?.models.strong ?? null, startedAt, result);
46164
+ recordCost("arbiter", "arbiter", seat?.model ?? seat?.models?.strong ?? null, startedAt, result);
46173
46165
  return result;
46174
46166
  },
46175
46167
  async runReviser(artifact, accepted) {
@@ -47256,10 +47248,10 @@ async function runDraftSpec(ctx, input, deps) {
47256
47248
  timeoutMs: draftSpecTimeoutMs(),
47257
47249
  sandbox: "read-only",
47258
47250
  codexExecutable: ctx.codexExecutable,
47259
- // model-tier-planning-and-arbiter task 2.4 (D1): planning is pinned to the seat's strongest
47251
+ // model-tier-planning-and-arbiter task 2.4 (D1): planning is pinned to the seat's primary
47260
47252
  // model. Absent when ctx carries no seat (e.g. a hand-built test ctx) — runExec reproduces
47261
47253
  // today's argv byte-for-byte in that case (task 2.3).
47262
- model: ctx.seat?.models.strong
47254
+ model: ctx.seat?.model ?? ctx.seat?.models?.strong
47263
47255
  });
47264
47256
  if (!exec.ok) {
47265
47257
  return { kind: "retry", failureReason: "provider_unavailable", error: `spec authoring failed: ${exec.error}` };
@@ -49342,7 +49334,7 @@ async function driveRun(deps, projectSlug, runId) {
49342
49334
  resolvedProviderId = claimed.agentSeat;
49343
49335
  } else {
49344
49336
  const seat = await mintResolvedSeat(resolveProvider(process.env, getSelectedProvider()));
49345
- void notifyPinRetirementIfRetired(seat, { projectSlug });
49337
+ void notifyPinRetirementIfRetired(seat);
49346
49338
  resolvedProviderId = seat.id;
49347
49339
  await deps.client.updateExecutionRun(projectSlug, runId, { agentSeat: seat.id }).catch((err) => {
49348
49340
  console.warn(
@@ -51391,6 +51383,10 @@ async function compactChat(input, deps) {
51391
51383
  "",
51392
51384
  "Summary:"
51393
51385
  ].join("\n");
51386
+ const targetModel = input.model ?? input.weakModel;
51387
+ if (!targetModel) {
51388
+ throw new Error("CompactionInput requires either 'model' or 'weakModel'");
51389
+ }
51394
51390
  const exec = await runExec(
51395
51391
  {
51396
51392
  prompt,
@@ -51399,7 +51395,7 @@ async function compactChat(input, deps) {
51399
51395
  timeoutMs: input.timeoutMs,
51400
51396
  sandbox: "read-only",
51401
51397
  codexExecutable: input.codexExecutable,
51402
- model: input.weakModel
51398
+ model: targetModel
51403
51399
  },
51404
51400
  void 0,
51405
51401
  input.provider
@@ -57412,6 +57408,9 @@ function describeZeroOutputLimit(signal) {
57412
57408
  resetAt: signal.resetAt
57413
57409
  };
57414
57410
  }
57411
+ function shouldForwardRateLimits(capabilities) {
57412
+ return capabilities.pushesRateLimits;
57413
+ }
57415
57414
  var BOOTSTRAP_SEAT_REFRESH_TIMEOUT_MS = 3e3;
57416
57415
  function createBridgeMessageHandler(deps) {
57417
57416
  const tombstones = deps.tombstones ?? /* @__PURE__ */ new Map();
@@ -57715,7 +57714,7 @@ function createBridgeMessageHandler(deps) {
57715
57714
  const result = await deps.runCompaction({
57716
57715
  history,
57717
57716
  provider: compactionSeat.id,
57718
- weakModel: compactionSeat.models.weak
57717
+ model: compactionSeat.model
57719
57718
  });
57720
57719
  const rawSeed = result.kind === "no-seed" ? result.note : result.seed;
57721
57720
  const seed = rawSeed.trim().length > 0 ? rawSeed : "No prior context could be carried forward.";
@@ -57920,7 +57919,7 @@ function createBridgeMessageHandler(deps) {
57920
57919
  }
57921
57920
  models = staticModels.size > 0 ? [...staticModels.values()] : null;
57922
57921
  }
57923
- const needsHandle = bootstrapCapabilities.listsModels || bootstrapCapabilities.readsRateLimits;
57922
+ const needsHandle = bootstrapCapabilities.listsModels || bootstrapCapabilities.pullsRateLimits;
57924
57923
  const codexClient2 = needsHandle ? await deps.acquireCodex(bootstrapProviderId) : null;
57925
57924
  try {
57926
57925
  if (codexClient2 && bootstrapCapabilities.listsModels) try {
@@ -57949,7 +57948,7 @@ function createBridgeMessageHandler(deps) {
57949
57948
  bootstrapError = error51 instanceof Error ? error51.message : String(error51);
57950
57949
  models = fallbackModels.length > 0 ? fallbackModels : null;
57951
57950
  }
57952
- if (codexClient2 && bootstrapCapabilities.readsRateLimits) {
57951
+ if (codexClient2 && bootstrapCapabilities.pullsRateLimits) {
57953
57952
  try {
57954
57953
  rateLimits = await codexClient2.readRateLimits();
57955
57954
  } catch (error51) {
@@ -58323,7 +58322,7 @@ function createBridgeMessageHandler(deps) {
58323
58322
  else if (event.type === "tool_result") toolBusy.end(event.tool.id);
58324
58323
  forward(event);
58325
58324
  if (event.type === "rate_limits") {
58326
- if (turnProviderCapabilities.readsRateLimits) {
58325
+ if (shouldForwardRateLimits(turnProviderCapabilities)) {
58327
58326
  sendInTurn({ type: "rateLimits", directorSessionId, rateLimits: event.snapshot });
58328
58327
  }
58329
58328
  const signal = detectExhaustedProviderLimit(event.snapshot, Date.now());
@@ -59151,10 +59150,11 @@ async function startDirectorBridge() {
59151
59150
  runExternalAgentsCli: (args, opts) => runExternalAgentsCli(args, { ...opts, envCliPath: process.env["EXTERNAL_AGENTS_CLI"] }),
59152
59151
  // Compaction runner for `compact-request` (agent-seat-surfaces task 2.5). Closes over `config`
59153
59152
  // (in scope here, unlike inside the handler) for cwd/executable, and the module-level budget +
59154
- // timeout constants. The handler supplies only the resolved seat's provider + weak model.
59153
+ // timeout constants. The handler supplies only the resolved seat's provider + default model.
59155
59154
  runCompaction: (args) => compactChat({
59156
59155
  history: args.history,
59157
59156
  provider: args.provider,
59157
+ model: args.model ?? args.weakModel,
59158
59158
  weakModel: args.weakModel,
59159
59159
  budgetBytes: DEFAULT_COMPACTION_SEED_BUDGET_BYTES,
59160
59160
  cwd: config2.codexCwd ?? process.cwd(),
@@ -67303,9 +67303,9 @@ async function runIntentCheck(ctx, input) {
67303
67303
  timeoutMs: intentCheckTimeoutMs(),
67304
67304
  sandbox: "read-only",
67305
67305
  codexExecutable: ctx.codexExecutable,
67306
- // model-tier-planning-and-arbiter task 2.6 (D1): the judge is pinned to the seat's strongest
67306
+ // model-tier-planning-and-arbiter task 2.6 (D1): the judge is pinned to the seat's primary
67307
67307
  // model.
67308
- model: ctx.seat?.models.strong
67308
+ model: ctx.seat?.model ?? ctx.seat?.models?.strong
67309
67309
  });
67310
67310
  if (!exec.ok) {
67311
67311
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.67",
3
+ "version": "0.4.72",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"
@@ -21,9 +21,9 @@
21
21
  "@types/ws": "^8.18.1",
22
22
  "esbuild": "^0.24.0",
23
23
  "tsx": "^4.22.3",
24
- "@mrrlin/client": "0.0.0",
25
24
  "@mrrlin/agent-client": "0.0.0",
26
25
  "@mrrlin/director-e2e": "0.0.0",
26
+ "@mrrlin/client": "0.0.0",
27
27
  "@mrrlin/schemas": "0.0.0",
28
28
  "@mrrlin/tsconfig": "0.0.0",
29
29
  "@mrrlin/wiki": "0.0.0"