@mrrlin-dev/mcp 0.4.67 → 0.4.71

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