@algosuite/vo-mcp 0.2.0-beta.25 → 0.2.0-beta.27

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.
@@ -177,27 +177,46 @@ function getAnthropicKey({ EntryCtor = defaultEntryCtor() } = {}) {
177
177
  }
178
178
  var PREFER_LOGIN_ENV = "VO_RUNNER_PREFER_LOGIN";
179
179
  var CLAUDE_PREFER_LOGIN_ENV = "VO_RUNNER_CLAUDE_PREFER_LOGIN";
180
+ var PREFER_KEY_ENV = "VO_RUNNER_PREFER_KEY";
181
+ var CLAUDE_PREFER_KEY_ENV = "VO_RUNNER_CLAUDE_PREFER_KEY";
180
182
  function isTruthyFlag(v) {
181
183
  const s = String(v ?? "").trim().toLowerCase();
182
184
  return s === "1" || s === "true" || s === "yes" || s === "on";
183
185
  }
184
- function withAnthropicKey(baseEnv = {}, { getKey = getAnthropicKey } = {}) {
185
- if (isTruthyFlag(baseEnv[CLAUDE_PREFER_LOGIN_ENV]) || isTruthyFlag(baseEnv[PREFER_LOGIN_ENV])) {
186
+ function wantsLogin(env) {
187
+ return isTruthyFlag(env[CLAUDE_PREFER_LOGIN_ENV]) || isTruthyFlag(env[PREFER_LOGIN_ENV]);
188
+ }
189
+ function wantsKey(env) {
190
+ return isTruthyFlag(env[CLAUDE_PREFER_KEY_ENV]) || isTruthyFlag(env[PREFER_KEY_ENV]);
191
+ }
192
+ function withAnthropicKey(baseEnv = {}, { getKey = getAnthropicKey, probeLogin = probeClaudeLoginState } = {}) {
193
+ if (wantsLogin(baseEnv)) {
186
194
  const next = { ...baseEnv };
187
195
  delete next.ANTHROPIC_API_KEY;
188
196
  return next;
189
197
  }
190
198
  if (baseEnv.ANTHROPIC_API_KEY) return { ...baseEnv };
191
199
  const key = getKey();
192
- return key ? { ...baseEnv, ANTHROPIC_API_KEY: key } : { ...baseEnv };
200
+ if (!key) return { ...baseEnv };
201
+ if (!wantsKey(baseEnv) && probeLogin() === true) return { ...baseEnv };
202
+ return { ...baseEnv, ANTHROPIC_API_KEY: key };
203
+ }
204
+ function claudeCostBasis(env = process.env) {
205
+ return String(env.ANTHROPIC_API_KEY || "").trim() ? "vendor_billed" : "subscription_api_equivalent";
193
206
  }
194
- function describeAnthropicAuthSource(baseEnv = {}, { getKey = getAnthropicKey } = {}) {
195
- if (isTruthyFlag(baseEnv[CLAUDE_PREFER_LOGIN_ENV]) || isTruthyFlag(baseEnv[PREFER_LOGIN_ENV])) {
207
+ function describeAnthropicAuthSource(baseEnv = {}, { getKey = getAnthropicKey, probeLogin = probeClaudeLoginState } = {}) {
208
+ if (wantsLogin(baseEnv)) {
196
209
  return "claude auth login (VO_RUNNER_PREFER_LOGIN set \u2014 any API key ignored)";
197
210
  }
198
211
  if (baseEnv.ANTHROPIC_API_KEY) return "ANTHROPIC_API_KEY from environment";
199
- if (getKey()) return "ANTHROPIC_API_KEY from OS keychain";
200
- return "claude auth login session (no API key set)";
212
+ if (!getKey()) return "claude auth login session (no API key set)";
213
+ if (wantsKey(baseEnv)) {
214
+ return "ANTHROPIC_API_KEY from OS keychain (VO_RUNNER_PREFER_KEY set \u2014 subscription ignored)";
215
+ }
216
+ if (probeLogin() === true) {
217
+ return "claude auth login session (subscription beats the stored keychain key)";
218
+ }
219
+ return "ANTHROPIC_API_KEY from OS keychain";
201
220
  }
202
221
  function probeClaudeLoginState({
203
222
  spawn: spawn2 = spawnSync2,
@@ -375,6 +394,36 @@ function parseClaudeStreamEvent(line) {
375
394
  return event.type === "result" ? buildResultEvent(event) : null;
376
395
  }
377
396
 
397
+ // ../../scripts/virtual-office/code-runner/agent-auth-tier.mjs
398
+ var AUTH_TIER_SUBSCRIPTION = "subscription";
399
+ var AUTH_TIER_API_KEY = "api_key";
400
+ var AUTH_TIER_LOCAL = "local";
401
+ var AUTH_TIER_UNKNOWN = "unknown";
402
+ var AUTH_TIERS = Object.freeze([
403
+ AUTH_TIER_SUBSCRIPTION,
404
+ AUTH_TIER_API_KEY,
405
+ AUTH_TIER_LOCAL,
406
+ AUTH_TIER_UNKNOWN
407
+ ]);
408
+ var COST_BASIS_TO_TIER = Object.freeze({
409
+ subscription_api_equivalent: AUTH_TIER_SUBSCRIPTION,
410
+ vendor_billed: AUTH_TIER_API_KEY,
411
+ local_zero: AUTH_TIER_LOCAL
412
+ });
413
+ function authTierFromCostBasis(costBasis) {
414
+ return COST_BASIS_TO_TIER[String(costBasis ?? "")] ?? AUTH_TIER_UNKNOWN;
415
+ }
416
+ function safeAuthTier(compute) {
417
+ try {
418
+ return normalizeAuthTier(compute());
419
+ } catch {
420
+ return AUTH_TIER_UNKNOWN;
421
+ }
422
+ }
423
+ function normalizeAuthTier(value) {
424
+ return AUTH_TIERS.includes(value) ? value : AUTH_TIER_UNKNOWN;
425
+ }
426
+
378
427
  // ../../scripts/virtual-office/code-runner/cli-version-floor.mjs
379
428
  var MIN_CLAUDE_CLI_VERSION = "2.1.218";
380
429
  var SECURITY_RATIONALE = "Claude Code 2.1.211/2.1.213 fixed a PreToolUse-hook bypass on unsandboxed Bash (our destructive-fs/git/cloud tripwires DO NOT FIRE on older CLIs) and worktree-subagents mutating the main checkout. 2.1.218 fixed Windows paths with a lowercase-\\u segment (e.g. ...\\utils\\, ...\\ui\\) being corrupted into CJK in tool inputs, making those files silently inaccessible \u2014 the fleet is Windows and 1,376 tracked files sit under utils/ alone. Update: npm install -g @anthropic-ai/claude-code (or the native installer).";
@@ -440,9 +489,22 @@ function isTimeout(probe) {
440
489
  function notFound(probe) {
441
490
  return errorCode(probe?.error) === "ENOENT";
442
491
  }
492
+ function resolveClaudeAuthTier({
493
+ env = process.env,
494
+ loggedIn = null,
495
+ getStoredKey = getAnthropicKey
496
+ } = {}) {
497
+ return safeAuthTier(() => {
498
+ const spawnEnv = withAnthropicKey(env, { getKey: getStoredKey, probeLogin: () => loggedIn });
499
+ const tier = authTierFromCostBasis(claudeCostBasis(spawnEnv));
500
+ if (tier === AUTH_TIER_SUBSCRIPTION && loggedIn !== true) return AUTH_TIER_UNKNOWN;
501
+ return tier;
502
+ });
503
+ }
443
504
  async function checkClaudeAuth({
444
505
  spawnVersion = spawnClaudeSync,
445
506
  probeLogin = probeClaudeLoginState,
507
+ getStoredKey = getAnthropicKey,
446
508
  env = process.env
447
509
  } = {}) {
448
510
  try {
@@ -492,6 +554,10 @@ async function checkClaudeAuth({
492
554
  return {
493
555
  installed: true,
494
556
  authenticated: true,
557
+ // Dispatch-time billing signal, carried on the same probe that already
558
+ // paid for the login read. Never sent for a non-authenticated result:
559
+ // there is no tier without a working credential.
560
+ authTier: resolveClaudeAuthTier({ env, loggedIn, getStoredKey }),
495
561
  message: loggedIn === true ? "claude CLI installed and logged in (claude auth status)" : "claude binary found (login state unknown \u2014 auth check is best-effort)"
496
562
  };
497
563
  } catch (error) {
@@ -536,7 +602,7 @@ var ClaudeRunner = class {
536
602
  return withAnthropicKey(env);
537
603
  }
538
604
  costBasis(env = process.env) {
539
- return String(env.ANTHROPIC_API_KEY || "").trim() ? "vendor_billed" : "subscription_api_equivalent";
605
+ return claudeCostBasis(env);
540
606
  }
541
607
  /** Describe which Anthropic auth source the spawn will use (for runner logs). */
542
608
  describeAuth(env = process.env) {
@@ -811,6 +877,19 @@ var CodexRunner = class {
811
877
  costBasis(env = process.env) {
812
878
  return String(env.OPENAI_API_KEY || env.CODEX_API_KEY || "").trim() ? "vendor_billed" : "subscription_api_equivalent";
813
879
  }
880
+ /**
881
+ * Dispatch-time billing tier for the NEXT codex spawn, from the SAME facts
882
+ * checkAuth() already gathered — no extra subprocess. applyAuthEnv() is a
883
+ * keychain read in this process (@napi-rs/keyring), not a spawn.
884
+ *
885
+ * Codex is the agent where this signal was already computed and then thrown
886
+ * away: checkAuth() distinguished "API key available (no persisted ChatGPT
887
+ * login)" from a real login, but only inside a `message` string that the
888
+ * heartbeat schema strips before storage. This gives that fact a typed home.
889
+ */
890
+ authTier(env = this.env) {
891
+ return safeAuthTier(() => authTierFromCostBasis(this.costBasis(this.applyAuthEnv(env))));
892
+ }
814
893
  /** Best-effort binary + persisted-login probe. Never throws or spends tokens. */
815
894
  async checkAuth() {
816
895
  try {
@@ -844,6 +923,7 @@ ${login.stderr || ""}`.trim();
844
923
  installed: true,
845
924
  authenticated: true,
846
925
  ...versionField,
926
+ authTier: this.authTier(),
847
927
  message: "codex API key available (no persisted ChatGPT login)"
848
928
  };
849
929
  }
@@ -858,6 +938,7 @@ ${login.stderr || ""}`.trim();
858
938
  installed: true,
859
939
  authenticated: true,
860
940
  ...versionField,
941
+ authTier: this.authTier(),
861
942
  message: output || "codex login status succeeded"
862
943
  };
863
944
  } catch (err) {
@@ -960,6 +1041,16 @@ var CursorRunner = class {
960
1041
  costBasis(env = process.env) {
961
1042
  return env.CURSOR_API_KEY ? "vendor_billed" : "unknown";
962
1043
  }
1044
+ /**
1045
+ * Dispatch-time billing tier. Inherits costBasis()'s deliberate refusal to
1046
+ * guess: a prior interactive `cursor-agent login` has undocumented
1047
+ * subscription semantics, so it reports 'unknown' rather than claiming a
1048
+ * flat-cost seat the runner cannot actually prove. Keychain read only — the
1049
+ * heartbeat never pays for a subprocess to answer this.
1050
+ */
1051
+ authTier(env = process.env) {
1052
+ return safeAuthTier(() => authTierFromCostBasis(this.costBasis(this.applyAuthEnv(env))));
1053
+ }
963
1054
  /** Best-effort: is `cursor-agent` on PATH? Never throws. */
964
1055
  async checkAuth() {
965
1056
  try {
@@ -985,6 +1076,7 @@ var CursorRunner = class {
985
1076
  return {
986
1077
  installed: true,
987
1078
  authenticated: true,
1079
+ authTier: this.authTier(),
988
1080
  message: "cursor-agent found (EXPERIMENTAL: headless mode may need a TTY; auth check is best-effort)"
989
1081
  };
990
1082
  } catch (err) {
@@ -1121,6 +1213,10 @@ var LocalModelRunner = class {
1121
1213
  costBasis() {
1122
1214
  return "local_zero";
1123
1215
  }
1216
+ /** Dispatch-time billing tier: local inference is never billed by a vendor. */
1217
+ authTier() {
1218
+ return safeAuthTier(() => authTierFromCostBasis(this.costBasis()));
1219
+ }
1124
1220
  describeAuth(env = process.env) {
1125
1221
  const authEnv = this.applyAuthEnv(env);
1126
1222
  const provider = resolveLocalProvider(this.env);
@@ -1178,6 +1274,7 @@ var LocalModelRunner = class {
1178
1274
  return {
1179
1275
  installed: true,
1180
1276
  authenticated: true,
1277
+ authTier: this.authTier(),
1181
1278
  message: `${provider} reachable; model "${model}" configured (local-only, no cloud spend)`
1182
1279
  };
1183
1280
  }
package/dist/cli.js CHANGED
@@ -4474,7 +4474,7 @@ async function buildCloudOrStubResponse(args) {
4474
4474
 
4475
4475
  // src/tools/heal/common-heal.ts
4476
4476
  init_common();
4477
- var HEAL_STUB_REASON = 'cloud-mode not yet wired; tool surface is live, admin-callable wiring pending vo-cloud-tenant-model dispatch (see packages/vo-mcp/src/modes/cloud.ts + EXTRACTION_AUDIT.md "Stub remaining")';
4477
+ var HEAL_STUB_REASON = "cloud mode is not configured on this session, so the admin callable was not reached. The wiring exists (see buildCloudOrStubResponse); sign in with `vo-mcp login` to route this tool to the control plane. Note that /api/v1/admin/* additionally requires a founding-operator credential.";
4478
4478
  var HEAL_GATE_TYPE = "admin-action";
4479
4479
 
4480
4480
  // src/tools/heal/trigger-heal.ts
@@ -4495,7 +4495,7 @@ var inputSchema8 = {
4495
4495
  },
4496
4496
  additionalProperties: false
4497
4497
  };
4498
- var description8 = "Triggers a self-heal pass against open PRs. Optionally scope to a `focus_page` (priority queue for one tester) or omit to fire the auto-process queue. Wraps the `voTriggerHeal` admin Cloud Function. V1 stub: returns `verdict: 'unimplemented'` with structured normalized_input \u2014 cloud-mode wiring is pending. The contract is locked; consumers can call this tool today and get the correct surface without working execution.";
4498
+ var description8 = "Triggers a self-heal pass against open PRs. Optionally scope to a `focus_page` (priority queue for one tester) or omit to fire the auto-process queue. Wraps the `voTriggerHeal` admin Cloud Function. Requires a founding-operator credential: the control plane's scoped-operator gate refuses `/api/v1/admin/*` for tenant-scoped accounts, which receive HTTP 403 `scoped_operator_forbidden`. Falls back to a clearly-marked `unimplemented` envelope with structured normalized_input when cloud mode is not configured.";
4499
4499
  function isToolInput8(v) {
4500
4500
  if (typeof v !== "object" || v === null) return false;
4501
4501
  const o = v;
@@ -4553,7 +4553,7 @@ var inputSchema9 = {
4553
4553
  },
4554
4554
  additionalProperties: false
4555
4555
  };
4556
- var description9 = "Retries one or more failed fix attempts by id. Pass `attempt_id` for the single case or `attempt_ids` (up to 50) for the batch case. Wraps `voRetryFixAttempt` / `voRetryFixAttempts` admin Cloud Functions. V1 stub: returns `verdict: 'unimplemented'` \u2014 cloud-mode wiring pending.";
4556
+ var description9 = "Retries one or more failed fix attempts by id. Pass `attempt_id` for the single case or `attempt_ids` (up to 50) for the batch case. Wraps `voRetryFixAttempt` / `voRetryFixAttempts` admin Cloud Functions. Requires a founding-operator credential: the control plane's scoped-operator gate refuses `/api/v1/admin/*` for tenant-scoped accounts, which receive HTTP 403 `scoped_operator_forbidden`. Falls back to a clearly-marked `unimplemented` envelope when cloud mode is not configured.";
4557
4557
  function isToolInput9(v) {
4558
4558
  if (typeof v !== "object" || v === null) return false;
4559
4559
  const o = v;
@@ -4641,7 +4641,7 @@ var inputSchema10 = {
4641
4641
  required: ["attempt_id"],
4642
4642
  additionalProperties: false
4643
4643
  };
4644
- var description10 = "Clears (cancels) a single fix attempt by id. Wraps `voClearFixAttempt` admin Cloud Function. V1 stub: returns `verdict: 'unimplemented'` \u2014 cloud-mode wiring pending.";
4644
+ var description10 = "Clears (cancels) a single fix attempt by id. Wraps `voClearFixAttempt` admin Cloud Function. Requires a founding-operator credential: the control plane's scoped-operator gate refuses `/api/v1/admin/*` for tenant-scoped accounts, which receive HTTP 403 `scoped_operator_forbidden`. Falls back to a clearly-marked `unimplemented` envelope when cloud mode is not configured.";
4645
4645
  function isToolInput10(v) {
4646
4646
  if (typeof v !== "object" || v === null) return false;
4647
4647
  const o = v;
@@ -4689,7 +4689,7 @@ var inputSchema11 = {
4689
4689
  required: ["run_id"],
4690
4690
  additionalProperties: false
4691
4691
  };
4692
- var description11 = "Cancels a running GitHub Actions workflow by run id. Wraps `voStopWorkflow` admin Cloud Function. V1 stub: returns `verdict: 'unimplemented'` \u2014 cloud-mode wiring pending.";
4692
+ var description11 = "Cancels a running GitHub Actions workflow by run id. Wraps `voStopWorkflow` admin Cloud Function. Requires a founding-operator credential: the control plane's scoped-operator gate refuses `/api/v1/admin/*` for tenant-scoped accounts, which receive HTTP 403 `scoped_operator_forbidden`. Falls back to a clearly-marked `unimplemented` envelope when cloud mode is not configured.";
4693
4693
  function isToolInput11(v) {
4694
4694
  if (typeof v !== "object" || v === null) return false;
4695
4695
  const o = v;
@@ -4735,7 +4735,7 @@ var inputSchema12 = {
4735
4735
  properties: {},
4736
4736
  additionalProperties: false
4737
4737
  };
4738
- var description12 = "Returns the current Command Center workflow-runs snapshot (Heal, Manager, Auto-Merge, Deploy on Merge, etc.). Wraps `voGetWorkflowRuns` admin Cloud Function. Read-only diagnostic. V1 stub: returns `verdict: 'unimplemented'` \u2014 cloud-mode wiring pending.";
4738
+ var description12 = "Returns the current Command Center workflow-runs snapshot (Heal, Manager, Auto-Merge, Deploy on Merge, etc.). Wraps `voGetWorkflowRuns` admin Cloud Function. Read-only diagnostic. Requires a founding-operator credential: the control plane's scoped-operator gate refuses `/api/v1/admin/*` for tenant-scoped accounts, which receive HTTP 403 `scoped_operator_forbidden`. Falls back to a clearly-marked `unimplemented` envelope when cloud mode is not configured.";
4739
4739
  function isToolInput12(v) {
4740
4740
  if (typeof v !== "object" || v === null) return false;
4741
4741
  return true;
@@ -4762,7 +4762,7 @@ init_common();
4762
4762
 
4763
4763
  // src/tools/pr/common-pr.ts
4764
4764
  init_common();
4765
- var PR_STUB_REASON = 'cloud-mode not yet wired; tool surface is live, admin-callable wiring pending vo-cloud-tenant-model dispatch (see packages/vo-mcp/src/modes/cloud.ts + EXTRACTION_AUDIT.md "Stub remaining")';
4765
+ var PR_STUB_REASON = "cloud mode is not configured on this session, so the admin callable was not reached. The wiring exists (see buildCloudOrStubResponse); sign in with `vo-mcp login` to route this tool to the control plane. Note that /api/v1/admin/* additionally requires a founding-operator credential.";
4766
4766
  var PR_GATE_TYPE = "admin-action";
4767
4767
 
4768
4768
  // src/tools/pr/list-pending-prs.ts
@@ -4774,7 +4774,7 @@ var inputSchema13 = {
4774
4774
  properties: {},
4775
4775
  additionalProperties: false
4776
4776
  };
4777
- var description13 = "Lists open AlgoHQ-source pull requests with blocker / source / tester / specialist-context metadata. Read-only diagnostic for Command Center reads. Wraps `voListPendingPRs` admin Cloud Function. V1 stub: returns `verdict: 'unimplemented'` \u2014 cloud-mode wiring pending.";
4777
+ var description13 = "Lists open AlgoHQ-source pull requests with blocker / source / tester / specialist-context metadata. Read-only diagnostic for Command Center reads. Wraps `voListPendingPRs` admin Cloud Function. Requires a founding-operator credential: the control plane's scoped-operator gate refuses `/api/v1/admin/*` for tenant-scoped accounts, which receive HTTP 403 `scoped_operator_forbidden`. Falls back to a clearly-marked `unimplemented` envelope when cloud mode is not configured.";
4778
4778
  function isToolInput13(v) {
4779
4779
  return typeof v === "object" && v !== null;
4780
4780
  }
@@ -4811,7 +4811,7 @@ var inputSchema14 = {
4811
4811
  required: ["pr_number"],
4812
4812
  additionalProperties: false
4813
4813
  };
4814
- var description14 = "Approves + merges a single AlgoHQ-source pull request by number. Wraps `voMergePR` admin Cloud Function (server-side refuses non-AlgoHQ PRs with permission-denied). V1 stub: returns `verdict: 'unimplemented'` \u2014 cloud-mode wiring pending.";
4814
+ var description14 = "Approves + merges a single AlgoHQ-source pull request by number. Wraps `voMergePR` admin Cloud Function (server-side refuses non-AlgoHQ PRs with permission-denied). Requires a founding-operator credential: the control plane's scoped-operator gate refuses `/api/v1/admin/*` for tenant-scoped accounts, which receive HTTP 403 `scoped_operator_forbidden`. Falls back to a clearly-marked `unimplemented` envelope when cloud mode is not configured.";
4815
4815
  function isToolInput14(v) {
4816
4816
  if (typeof v !== "object" || v === null) return false;
4817
4817
  const o = v;
@@ -4856,7 +4856,7 @@ var inputSchema15 = {
4856
4856
  required: ["pr_number"],
4857
4857
  additionalProperties: false
4858
4858
  };
4859
- var description15 = "Closes a pull request without merging. No retry dispatched \u2014 use `vo_reject_and_retry` for close+retry. Wraps `voRejectPR` admin Cloud Function. V1 stub: returns `verdict: 'unimplemented'` \u2014 cloud-mode wiring pending.";
4859
+ var description15 = "Closes a pull request without merging. No retry dispatched \u2014 use `vo_reject_and_retry` for close+retry. Wraps `voRejectPR` admin Cloud Function. Requires a founding-operator credential: the control plane's scoped-operator gate refuses `/api/v1/admin/*` for tenant-scoped accounts, which receive HTTP 403 `scoped_operator_forbidden`. Falls back to a clearly-marked `unimplemented` envelope when cloud mode is not configured.";
4860
4860
  function isToolInput15(v) {
4861
4861
  if (typeof v !== "object" || v === null) return false;
4862
4862
  const o = v;
@@ -4895,7 +4895,7 @@ var inputSchema16 = {
4895
4895
  properties: {},
4896
4896
  additionalProperties: false
4897
4897
  };
4898
- var description16 = "Iterates all open AlgoHQ-source pull requests and merges (or arms auto-merge) on each. Returns counts of merged / accepted / total plus per-PR results. Wraps `voApproveAllFixes` admin Cloud Function. V1 stub: returns `verdict: 'unimplemented'` \u2014 cloud-mode wiring pending.";
4898
+ var description16 = "Iterates all open AlgoHQ-source pull requests and merges (or arms auto-merge) on each. Returns counts of merged / accepted / total plus per-PR results. Wraps `voApproveAllFixes` admin Cloud Function. Requires a founding-operator credential: the control plane's scoped-operator gate refuses `/api/v1/admin/*` for tenant-scoped accounts, which receive HTTP 403 `scoped_operator_forbidden`. Falls back to a clearly-marked `unimplemented` envelope when cloud mode is not configured.";
4899
4899
  function isToolInput16(v) {
4900
4900
  return typeof v === "object" && v !== null;
4901
4901
  }
@@ -4930,7 +4930,7 @@ var inputSchema17 = {
4930
4930
  required: ["pr_number"],
4931
4931
  additionalProperties: false
4932
4932
  };
4933
- var description17 = "Closes an AlgoHQ pull request and dispatches a self-heal pass to retry the same focus page. Cloud callable refuses non-AlgoHQ PRs and respects the self-heal kill switch + per-PR retry block. Wraps `voRejectAndRetry` admin Cloud Function. V1 stub: returns `verdict: 'unimplemented'` \u2014 cloud-mode wiring pending.";
4933
+ var description17 = "Closes an AlgoHQ pull request and dispatches a self-heal pass to retry the same focus page. Cloud callable refuses non-AlgoHQ PRs and respects the self-heal kill switch + per-PR retry block. Wraps `voRejectAndRetry` admin Cloud Function. Requires a founding-operator credential: the control plane's scoped-operator gate refuses `/api/v1/admin/*` for tenant-scoped accounts, which receive HTTP 403 `scoped_operator_forbidden`. Falls back to a clearly-marked `unimplemented` envelope when cloud mode is not configured.";
4934
4934
  function isToolInput17(v) {
4935
4935
  if (typeof v !== "object" || v === null) return false;
4936
4936
  const o = v;
@@ -6613,8 +6613,26 @@ var callMetaWithMetrics = createMetaModelCaller();
6613
6613
 
6614
6614
  // src/consensus/consensus-panel.ts
6615
6615
  var VO_MCP_CONSENSUS_PANEL = {
6616
- anthropic: "claude-opus-4-7",
6617
- openai: "gpt-5",
6616
+ // claude-opus-5 (2026-07-24). Opus 4.7 was STRICTLY DOMINATED, not merely old:
6617
+ // Opus 5 is $5/$25 per MTok vs Opus 4.7's $15/$75 — a 3x cost cut on this slot,
6618
+ // corroborated by our own catalog (constants/pricing/sciencePricing.ts prices
6619
+ // claude-opus-5 at 0.010 vs claude-opus-4-7 at 0.030) — AND the same 2026-07-24
6620
+ // release note REMOVED fast mode from Opus 4.7 outright: `speed: "fast"` now
6621
+ // returns an error there rather than degrading, unlike the Opus 4.6 removal.
6622
+ // Verified served: GET /v1/models/claude-opus-5 -> HTTP 200 (2026-07-30).
6623
+ //
6624
+ // Claude-5 API safety checked before this swap: Opus 5 rejects `temperature` /
6625
+ // `top_p` / `top_k` and manual `thinking.budget_tokens` with HTTP 400. Neither
6626
+ // the consensus-engine Anthropic adapter nor functions-shared `callAnthropic`
6627
+ // sends any of them, and buildAdaptiveThinking emits `thinking: {type:'adaptive'}`
6628
+ // (the supported form) — so this swap cannot 400.
6629
+ anthropic: "claude-opus-5",
6630
+ // gpt-5.6-terra (GA 2026-07-09; −20% price cut 2026-07-30). NOTE the real IDs
6631
+ // are tiered — `gpt-5.6-sol` / `-terra` / `-luna`; there is NO bare `gpt-5.6`
6632
+ // alias (verified against the served model list, 2026-07-30). Terra is the
6633
+ // cost/capability balance point and the right default for a judgment panel;
6634
+ // Sol is available if verdict quality ever needs it.
6635
+ openai: "gpt-5.6-terra",
6618
6636
  // gemini-2.5-FLASH (not -pro): flash accepts the default thinkingBudget=0 from
6619
6637
  // callGeminiWithMetrics; 2.5-pro REJECTS budget 0 ("only works in thinking mode").
6620
6638
  // Flash is also ~10x cheaper. 2026-06-02.